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)
|
||||
self.setupDumpers(args)
|
||||
|
||||
def loadDumpers(self, args):
|
||||
msg = self.setupDumpers()
|
||||
self.reportResult(msg, args)
|
||||
|
||||
def addDumperModule(self, args):
|
||||
path = args['path']
|
||||
(head, tail) = os.path.split(path)
|
||||
|
@@ -1149,8 +1149,8 @@ class Dumper(DumperBase):
|
||||
def exitGdb(self, _):
|
||||
gdb.execute("quit")
|
||||
|
||||
def loadDumpers(self, args):
|
||||
print(self.setupDumpers())
|
||||
def reportResult(self, msg, args):
|
||||
print(msg)
|
||||
|
||||
def profile1(self, args):
|
||||
"""Internal profiling"""
|
||||
@@ -1176,8 +1176,6 @@ class CliDumper(Dumper):
|
||||
self.indent = 0
|
||||
self.isCli = True
|
||||
|
||||
def reportDumpers(self, msg):
|
||||
return msg
|
||||
|
||||
def put(self, line):
|
||||
if self.output.endswith('\n'):
|
||||
|
@@ -1485,10 +1485,6 @@ class Dumper(DumperBase):
|
||||
result += ',offset="%s"}' % (loadAddr - base)
|
||||
self.reportResult(result + ']', args)
|
||||
|
||||
def loadDumpers(self, args):
|
||||
msg = self.setupDumpers()
|
||||
self.reportResult(msg, args)
|
||||
|
||||
def fetchMemory(self, args):
|
||||
address = args['address']
|
||||
length = args['length']
|
||||
@@ -1538,9 +1534,6 @@ class Tester(Dumper):
|
||||
s.start()
|
||||
s.join(30)
|
||||
|
||||
def reportDumpers(self, msg):
|
||||
pass
|
||||
|
||||
def testLoop(self, args):
|
||||
# Disable intermediate reporting.
|
||||
savedReport = self.report
|
||||
|
Reference in New Issue
Block a user