diff options
| author | Greg Clayton <gclayton@apple.com> | 2012-03-20 01:30:27 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2012-03-20 01:30:27 +0000 |
| commit | 2b1bc868a066b90100695ff5242268ae1939cefa (patch) | |
| tree | 5e0c90b11ed4e22cd35c1777eba244869381a722 /lldb/examples/python | |
| parent | 60e01c560a2234bea7e7156c5a972672f43033cf (diff) | |
| download | bcm5719-llvm-2b1bc868a066b90100695ff5242268ae1939cefa.tar.gz bcm5719-llvm-2b1bc868a066b90100695ff5242268ae1939cefa.zip | |
Added a fix to the crash log script that allows you to locate and load a binary from any location and _then_ do the symbolication. Something like:
(lldb) file /path/to/file.so
(lldb) crashlog crash.log
....
Then if the file.so has already been loaded it will use the one that is already in LLDB without trying to match up the paths.
llvm-svn: 153075
Diffstat (limited to 'lldb/examples/python')
| -rwxr-xr-x | lldb/examples/python/crashlog.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 3e8fab505ac..d5531ded0cf 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -195,7 +195,7 @@ class CrashLog: if text_section: error = lldb.target.SetSectionLoadAddress (text_section, self.text_addr_lo) if error.Success(): - #print 'Success: loaded %s.__TEXT = 0x%x' % (self.basename(), self.text_addr_lo) + #print 'Success: loaded %s.__TEXT = 0x%x' % (self.get_resolved_path_basename(), self.text_addr_lo) return None else: return 'error: %s' % error.GetCString() @@ -228,19 +228,22 @@ class CrashLog: def add_target_module(self): if lldb.target: - if self.fetch_symboled_executable_and_dsym (): - resolved_path = self.get_resolved_path(); - path_spec = lldb.SBFileSpec (resolved_path) - #print 'target.AddModule (path="%s", arch="%s", uuid=%s)' % (resolved_path, self.arch, self.uuid) - self.module = lldb.target.AddModule (resolved_path, self.arch, self.uuid) - if self.module: - err = self.load_module() - if err: - print err; - else: - return None + # Check for the module by UUID first in case it has been already loaded in LLDB + self.module = lldb.target.AddModule (None, None, str(self.uuid)) + if not self.module: + if self.fetch_symboled_executable_and_dsym (): + resolved_path = self.get_resolved_path(); + path_spec = lldb.SBFileSpec (resolved_path) + #print 'target.AddModule (path="%s", arch="%s", uuid=%s)' % (resolved_path, self.arch, self.uuid) + self.module = lldb.target.AddModule (resolved_path, self.arch, self.uuid) + if self.module: + err = self.load_module() + if err: + print err; else: - return 'error: unable to get module for (%s) "%s"' % (self.arch, resolved_path) + return None + else: + return 'error: unable to get module for (%s) "%s"' % (self.arch, resolved_path) else: return 'error: invalid target' |

