Commit ffb749ac authored by hjk's avatar hjk
Browse files

Debugger: Avoid some warnings on LLDB bridge startup



Change-Id: I38454b7079e760ff363e92e2ec82542592b70e5b
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 5c248233
...@@ -741,10 +741,11 @@ class Dumper(DumperBase): ...@@ -741,10 +741,11 @@ class Dumper(DumperBase):
self.report(self.describeError(error)) self.report(self.describeError(error))
def currentThread(self): def currentThread(self):
return self.process.GetSelectedThread() return None if self.process is None else self.process.GetSelectedThread()
def currentFrame(self): def currentFrame(self):
return self.currentThread().GetSelectedFrame() thread = self.currentThread()
return None if thread is None else thread.GetSelectedFrame()
def reportLocation(self): def reportLocation(self):
thread = self.currentThread() thread = self.currentThread()
...@@ -1057,7 +1058,9 @@ class Dumper(DumperBase): ...@@ -1057,7 +1058,9 @@ class Dumper(DumperBase):
self.putItem(child) self.putItem(child)
def reportVariables(self, _ = None): def reportVariables(self, _ = None):
frame = self.currentThread().GetSelectedFrame() frame = self.currentFrame()
if frame is None:
return
self.currentIName = 'local' self.currentIName = 'local'
self.put('data=[') self.put('data=[')
self.anonNumber = 0 self.anonNumber = 0
...@@ -1128,6 +1131,7 @@ class Dumper(DumperBase): ...@@ -1128,6 +1131,7 @@ class Dumper(DumperBase):
self.report('process="none"') self.report('process="none"')
else: else:
frame = self.currentFrame() frame = self.currentFrame()
if frame:
result = 'registers=[' result = 'registers=['
for group in frame.GetRegisters(): for group in frame.GetRegisters():
for reg in group: for reg in group:
...@@ -1246,7 +1250,7 @@ class Dumper(DumperBase): ...@@ -1246,7 +1250,7 @@ class Dumper(DumperBase):
if hasattr(bp, 'GetNumLocations'): if hasattr(bp, 'GetNumLocations'):
for i in xrange(bp.GetNumLocations()): for i in xrange(bp.GetNumLocations()):
loc = bp.GetLocationAtIndex(i) loc = bp.GetLocationAtIndex(i)
addr = loc.GetLoadAddress() addr = loc.GetAddress()
result += '{locid="%s"' % loc.GetID() result += '{locid="%s"' % loc.GetID()
result += ',func="%s"' % addr.GetFunction().GetName() result += ',func="%s"' % addr.GetFunction().GetName()
result += ',enabled="%s"' % (1 if loc.IsEnabled() else 0) result += ',enabled="%s"' % (1 if loc.IsEnabled() else 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment