aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-02-21 17:34:08 +0100
committerhjk <hjk121@nokiamail.com>2014-02-25 17:46:48 +0100
commit4ee7bdc562a1380ddd108bc0805e7c7bfa400a8f (patch)
tree18aed59d06222ace98cd29ccdb62e6c17a534b0c /share
parentcd85ac700d0fdc0742d3c7e23da7dda146820e2b (diff)
Debugger: Some cleanup in gdbbridge
Change-Id: Iecea0ee1d66cff3a4dbe2c9605babb2e49d0c93a Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/gdbbridge.py47
1 files changed, 4 insertions, 43 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index fd9d2b3e60..fb1c612d98 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -56,8 +56,6 @@ def registerCommand(name, func):
Command()
-def parseAndEvaluate(exp):
- return gdb.parse_and_eval(exp)
def listOfLocals(varList):
frame = gdb.selected_frame()
@@ -144,9 +142,6 @@ def listOfLocals(varList):
return items
-def catchCliOutput(command):
- return gdb.execute(command, to_string=True).split("\n")
-
#######################################################################
#
@@ -185,30 +180,6 @@ NamespaceCode = gdb.TYPE_CODE_NAMESPACE
#######################################################################
#
-# Step Command
-#
-#######################################################################
-
-def sal(args):
- (cmd, addr) = args.split(",")
- lines = catchCliOutput("info line *" + addr)
- fromAddr = "0x0"
- toAddr = "0x0"
- for line in lines:
- pos0from = line.find(" starts at address") + 19
- pos1from = line.find(" ", pos0from)
- pos0to = line.find(" ends at", pos1from) + 9
- pos1to = line.find(" ", pos0to)
- if pos1to > 0:
- fromAddr = line[pos0from : pos1from]
- toAddr = line[pos0to : pos1to]
- gdb.execute("maint packet sal%s,%s,%s" % (cmd,fromAddr, toAddr))
-
-registerCommand("sal", sal)
-
-
-#######################################################################
-#
# Convenience
#
#######################################################################
@@ -290,8 +261,6 @@ def importPlainDumpers(args):
registerCommand("importPlainDumpers", importPlainDumpers)
-#gdb.Value.child = impl_Value_child
-
class OutputSafer:
def __init__(self, d):
@@ -312,14 +281,6 @@ class OutputSafer:
-def value(expr):
- value = parseAndEvaluate(expr)
- try:
- return int(value)
- except:
- return str(value)
-
-
#def couldBePointer(p, align):
# type = lookupType("unsigned int")
# ptr = gdb.Value(p).cast(type)
@@ -636,7 +597,7 @@ class Dumper(DumperBase):
# Avoid malloc symbol clash with QVector.
gdb.execute("set $d = (%s*)calloc(sizeof(%s), 1)" % (type, type))
gdb.execute("set *$d = {%s}" % init)
- value = parseAndEvaluate("$d").dereference()
+ value = gdb.parse_and_eval("$d").dereference()
#warn(" TYPE: %s" % value.type)
#warn(" ADDR: %s" % value.address)
#warn(" VALUE: %s" % value)
@@ -655,7 +616,7 @@ class Dumper(DumperBase):
gdb.execute("set $d=(std::string*)calloc(sizeof(std::string), 2)");
gdb.execute("call($d->basic_string(\"" + init +
"\",*(std::allocator<char>*)(1+$d)))")
- value = parseAndEvaluate("$d").dereference()
+ value = gdb.parse_and_eval("$d").dereference()
#warn(" TYPE: %s" % value.type)
#warn(" ADDR: %s" % value.address)
#warn(" VALUE: %s" % value)
@@ -1634,7 +1595,7 @@ class Dumper(DumperBase):
def dynamicTypeName(self, value):
if self.hasVTable(value.type):
- #vtbl = str(parseAndEvaluate("{int(*)(int)}%s" % int(value.address)))
+ #vtbl = str(gdb.parse_and_eval("{int(*)(int)}%s" % int(value.address)))
try:
# Fails on 7.1 due to the missing to_string.
vtbl = gdb.execute("info symbol {int*}%s" % int(value.address),
@@ -1836,7 +1797,7 @@ registerCommand("threadnames", threadnames)
def qmlb(args):
# executeCommand(command, to_string=True).split("\n")
warm("RUNNING: break -f QScript::FunctionWrapper::proxyCall")
- output = catchCliOutput("rbreak -f QScript::FunctionWrapper::proxyCall")
+ output = gdb.execute("rbreak -f QScript::FunctionWrapper::proxyCall", to_string=True).split("\n")
warn("OUTPUT: %s " % output)
bp = output[0]
warn("BP: %s " % bp)