summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-04-20 23:31:27 +0000
committerGreg Clayton <gclayton@apple.com>2012-04-20 23:31:27 +0000
commitf99295c3a684a4370a38074c62e352cf80e4e0b8 (patch)
tree5152f32620e1b67465c7754c5422bcf06110c138 /lldb/examples/python
parentb4e849b9249a246f236e1daadcabed112f4ba5df (diff)
downloadbcm5719-llvm-f99295c3a684a4370a38074c62e352cf80e4e0b8.tar.gz
bcm5719-llvm-f99295c3a684a4370a38074c62e352cf80e4e0b8.zip
Fixed some issues with symbolicating things. Fixed symbolication.add_module() to not use the resolved_path before we have tried to locate it. Fixed crashlog.locate_module_and_debug_symbols() to return true and false correctly.
llvm-svn: 155255
Diffstat (limited to 'lldb/examples/python')
-rwxr-xr-xlldb/examples/python/crashlog.py11
-rwxr-xr-xlldb/examples/python/symbolication.py11
2 files changed, 10 insertions, 12 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 725ea2e5fe3..49be635e756 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -114,7 +114,7 @@ class CrashLog(symbolication.Symbolicator):
def locate_module_and_debug_symbols(self):
if self.resolved_path:
# Don't load a module twice...
- return 0
+ return True
print 'Locating %s %s...' % (self.uuid, self.path),
if os.path.exists(self.dsymForUUIDBinary):
dsym_for_uuid_command = '%s %s' % (self.dsymForUUIDBinary, self.uuid)
@@ -144,16 +144,15 @@ class CrashLog(symbolication.Symbolicator):
break;
if not self.resolved_path:
print "error: file %s '%s' doesn't match the UUID in the installed file" % (self.uuid, self.path)
- return 0
+ return False
if (self.resolved_path and os.path.exists(self.resolved_path)) or (self.path and os.path.exists(self.path)):
print 'ok'
- if self.path != self.resolved_path:
+ if self.resolved_path:
print ' exe = "%s"' % self.resolved_path
if self.symfile:
print ' dsym = "%s"' % self.symfile
- return 1
- else:
- return 0
+ return True
+ return False
diff --git a/lldb/examples/python/symbolication.py b/lldb/examples/python/symbolication.py
index 0e9aa070ee6..8f10be84f10 100755
--- a/lldb/examples/python/symbolication.py
+++ b/lldb/examples/python/symbolication.py
@@ -282,17 +282,16 @@ class Image:
def add_module(self, target):
'''Add the Image described in this object to "target" and load the sections if "load" is True.'''
if target:
- resolved_path = self.get_resolved_path();
# Try and find using UUID only first so that paths need not match up
if self.uuid:
self.module = target.AddModule (None, None, str(self.uuid))
if not self.module:
- if self.locate_module_and_debug_symbols ():
- path_spec = lldb.SBFileSpec (resolved_path)
- #print 'target.AddModule (path="%s", arch="%s", uuid=%s)' % (resolved_path, self.arch, self.uuid)
- self.module = target.AddModule (resolved_path, self.arch, self.uuid)
+ self.locate_module_and_debug_symbols ()
+ resolved_path = self.get_resolved_path()
+ print 'target.AddModule (path="%s", arch="%s", uuid=%s, symfile="%s")' % (resolved_path, self.arch, self.uuid, self.symfile)
+ self.module = target.AddModule (resolved_path, self.arch, self.uuid)#, self.symfile)
if not self.module:
- return 'error: unable to get module for (%s) "%s"' % (self.arch, resolved_path)
+ return 'error: unable to get module for (%s) "%s"' % (self.arch, self.get_resolved_path())
if self.has_section_load_info():
return self.load_module(target)
else:
OpenPOWER on IntegriCloud