forked from qt-creator/qt-creator
Debugger: Unify the dumper reload code
Instead, push backend differences into a more generic reportResult() function. Change-Id: I6bc34580e915b830e592680022b3499ae5eb1e57 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -2238,6 +2238,10 @@ class DumperBase:
|
|||||||
reload(m)
|
reload(m)
|
||||||
self.setupDumpers(args)
|
self.setupDumpers(args)
|
||||||
|
|
||||||
|
def loadDumpers(self, args):
|
||||||
|
msg = self.setupDumpers()
|
||||||
|
self.reportResult(msg, args)
|
||||||
|
|
||||||
def addDumperModule(self, args):
|
def addDumperModule(self, args):
|
||||||
path = args['path']
|
path = args['path']
|
||||||
(head, tail) = os.path.split(path)
|
(head, tail) = os.path.split(path)
|
||||||
|
@@ -1149,8 +1149,8 @@ class Dumper(DumperBase):
|
|||||||
def exitGdb(self, _):
|
def exitGdb(self, _):
|
||||||
gdb.execute("quit")
|
gdb.execute("quit")
|
||||||
|
|
||||||
def loadDumpers(self, args):
|
def reportResult(self, msg, args):
|
||||||
print(self.setupDumpers())
|
print(msg)
|
||||||
|
|
||||||
def profile1(self, args):
|
def profile1(self, args):
|
||||||
"""Internal profiling"""
|
"""Internal profiling"""
|
||||||
@@ -1176,8 +1176,6 @@ class CliDumper(Dumper):
|
|||||||
self.indent = 0
|
self.indent = 0
|
||||||
self.isCli = True
|
self.isCli = True
|
||||||
|
|
||||||
def reportDumpers(self, msg):
|
|
||||||
return msg
|
|
||||||
|
|
||||||
def put(self, line):
|
def put(self, line):
|
||||||
if self.output.endswith('\n'):
|
if self.output.endswith('\n'):
|
||||||
|
@@ -1485,10 +1485,6 @@ class Dumper(DumperBase):
|
|||||||
result += ',offset="%s"}' % (loadAddr - base)
|
result += ',offset="%s"}' % (loadAddr - base)
|
||||||
self.reportResult(result + ']', args)
|
self.reportResult(result + ']', args)
|
||||||
|
|
||||||
def loadDumpers(self, args):
|
|
||||||
msg = self.setupDumpers()
|
|
||||||
self.reportResult(msg, args)
|
|
||||||
|
|
||||||
def fetchMemory(self, args):
|
def fetchMemory(self, args):
|
||||||
address = args['address']
|
address = args['address']
|
||||||
length = args['length']
|
length = args['length']
|
||||||
@@ -1538,9 +1534,6 @@ class Tester(Dumper):
|
|||||||
s.start()
|
s.start()
|
||||||
s.join(30)
|
s.join(30)
|
||||||
|
|
||||||
def reportDumpers(self, msg):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def testLoop(self, args):
|
def testLoop(self, args):
|
||||||
# Disable intermediate reporting.
|
# Disable intermediate reporting.
|
||||||
savedReport = self.report
|
savedReport = self.report
|
||||||
|
Reference in New Issue
Block a user