[Lldb-commits] [lldb] r156598 - in /lldb/branches/lldb-platform-work: ./ examples/python/crashlog.py examples/python/symbolication.py tools/driver/Driver.cpp
Johnny Chen
johnny.chen at apple.com
Thu May 10 17:36:58 PDT 2012
Author: johnny
Date: Thu May 10 19:36:58 2012
New Revision: 156598
URL: http://llvm.org/viewvc/llvm-project?rev=156598&view=rev
Log:
Merge changes from ToT trunk.
Modified:
lldb/branches/lldb-platform-work/ (props changed)
lldb/branches/lldb-platform-work/examples/python/crashlog.py
lldb/branches/lldb-platform-work/examples/python/symbolication.py
lldb/branches/lldb-platform-work/tools/driver/Driver.cpp
Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 10 19:36:58 2012
@@ -1 +1 @@
-/lldb/trunk:154223-156588
+/lldb/trunk:154223-156596
Modified: lldb/branches/lldb-platform-work/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/python/crashlog.py?rev=156598&r1=156597&r2=156598&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/crashlog.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/crashlog.py Thu May 10 19:36:58 2012
@@ -121,14 +121,15 @@
if self.resolved_path:
# Don't load a module twice...
return True
- print 'Getting symbols for %s %s...' % (self.uuid, self.path),
+ uuid_str = self.get_normalized_uuid_string()
+ print 'Getting symbols for %s %s...' % (uuid_str, self.path),
if os.path.exists(self.dsymForUUIDBinary):
- dsym_for_uuid_command = '%s %s' % (self.dsymForUUIDBinary, self.uuid)
+ dsym_for_uuid_command = '%s %s' % (self.dsymForUUIDBinary, uuid_str)
s = commands.getoutput(dsym_for_uuid_command)
if s:
plist_root = plistlib.readPlistFromString (s)
if plist_root:
- plist = plist_root[self.uuid]
+ plist = plist_root[uuid_str]
if plist:
if 'DBGArchitecture' in plist:
self.arch = plist['DBGArchitecture']
@@ -138,7 +139,7 @@
self.resolved_path = os.path.expanduser (plist['DBGSymbolRichExecutable'])
if not self.resolved_path and os.path.exists(self.path):
dwarfdump_cmd_output = commands.getoutput('dwarfdump --uuid "%s"' % self.path)
- self_uuid = uuid.UUID(self.uuid)
+ self_uuid = self.get_uuid()
for line in dwarfdump_cmd_output.splitlines():
match = self.dwarfdump_uuid_regex.search (line)
if match:
@@ -149,7 +150,7 @@
self.arch = match.group(2)
break;
if not self.resolved_path:
- print "error: file %s '%s' doesn't match the UUID in the installed file" % (self.uuid, self.path)
+ print "error: file %s '%s' doesn't match the UUID in the installed file" % (uuid_str, self.path)
return False
if (self.resolved_path and os.path.exists(self.resolved_path)) or (self.path and os.path.exists(self.path)):
print 'ok'
@@ -267,6 +268,8 @@
continue
self.info_lines.append(line.strip())
elif parse_mode == PARSE_MODE_THREAD:
+ if line.startswith ('Thread'):
+ continue
frame_match = self.frame_regex.search(line)
if frame_match:
ident = frame_match.group(2)
@@ -282,7 +285,7 @@
int(image_match.group(2),0),
image_match.group(3).strip(),
image_match.group(4).strip(),
- image_match.group(5),
+ uuid.UUID(image_match.group(5)),
image_match.group(6))
self.images.append (image)
else:
@@ -300,9 +303,12 @@
elif parse_mode == PARSE_MODE_THREGS:
stripped_line = line.strip()
- reg_values = stripped_line.split(' ')
+ reg_values = re.split(' +', stripped_line);
for reg_value in reg_values:
+ #print 'reg_value = "%s"' % reg_value
(reg, value) = reg_value.split(': ')
+ #print 'reg = "%s"' % reg
+ #print 'value = "%s"' % value
thread.registers[reg.strip()] = int(value, 0)
elif parse_mode == PARSE_MODE_SYSTEM:
self.system_profile.append(line)
@@ -398,24 +404,29 @@
except:
return
- for image_path in args:
- fullpath_search = image_path[0] == '/'
+ if args:
+ for image_path in args:
+ fullpath_search = image_path[0] == '/'
+ for crash_log in self.crash_logs:
+ matches_found = 0
+ for (image_idx, image) in enumerate(crash_log.images):
+ if fullpath_search:
+ if image.get_resolved_path() == image_path:
+ matches_found += 1
+ print image
+ else:
+ image_basename = image.get_resolved_path_basename()
+ if image_basename == image_path:
+ matches_found += 1
+ print image
+ if matches_found == 0:
+ for (image_idx, image) in enumerate(crash_log.images):
+ if string.find(image.get_resolved_path(), image_path) >= 0:
+ print image
+ else:
for crash_log in self.crash_logs:
- matches_found = 0
for (image_idx, image) in enumerate(crash_log.images):
- if fullpath_search:
- if image.get_resolved_path() == image_path:
- matches_found += 1
- print image
- else:
- image_basename = image.get_resolved_path_basename()
- if image_basename == image_path:
- matches_found += 1
- print image
- if matches_found == 0:
- for (image_idx, image) in enumerate(crash_log.images):
- if string.find(image.get_resolved_path(), image_path) >= 0:
- print image
+ print '[%u] %s' % (image_idx, image)
return False
Modified: lldb/branches/lldb-platform-work/examples/python/symbolication.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/python/symbolication.py?rev=156598&r1=156597&r2=156598&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/symbolication.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/symbolication.py Thu May 10 19:36:58 2012
@@ -283,12 +283,13 @@
'''Add the Image described in this object to "target" and load the sections if "load" is True.'''
if target:
# 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))
+ uuid_str = self.get_normalized_uuid_string()
+ if uuid_str:
+ self.module = target.AddModule (None, None, uuid_str)
if not self.module:
self.locate_module_and_debug_symbols ()
resolved_path = self.get_resolved_path()
- self.module = target.AddModule (resolved_path, self.arch, self.uuid)#, self.symfile)
+ self.module = target.AddModule (resolved_path, self.arch, uuid_str, self.symfile)
if not self.module:
return 'error: unable to get module for (%s) "%s"' % (self.arch, self.get_resolved_path())
if self.has_section_load_info():
@@ -308,10 +309,15 @@
return True
def get_uuid(self):
- if not self.uuid:
+ if not self.uuid and self.module:
self.uuid = uuid.UUID(self.module.GetUUIDString())
return self.uuid
+ def get_normalized_uuid_string(self):
+ if self.uuid:
+ return str(self.uuid).upper()
+ return None
+
def create_target(self):
'''Create a target using the information in this Image object.'''
if self.locate_module_and_debug_symbols ():
Modified: lldb/branches/lldb-platform-work/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/driver/Driver.cpp?rev=156598&r1=156597&r2=156598&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/driver/Driver.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/driver/Driver.cpp Thu May 10 19:36:58 2012
@@ -1106,14 +1106,6 @@
return bytes_len;
}
-// Intercept when the quit command is called and tell our driver that it is done
-static bool
-QuitCommandOverrideCallback (void *baton, const char **argv)
-{
- ((Driver *)baton)->SetIsDone();
- return true;
-}
-
void
Driver::MainLoop ()
{
@@ -1216,10 +1208,6 @@
SBCommandInterpreter sb_interpreter = m_debugger.GetCommandInterpreter();
- // Intercept when the quit command is called and tell our driver that it is done
- bool quit_success = sb_interpreter.SetCommandOverrideCallback ("quit", QuitCommandOverrideCallback, this);
- assert (quit_success);
-
m_io_channel_ap.reset (new IOChannel(m_editline_slave_fh, editline_output_slave_fh, stdout, stderr, this));
SBCommunication out_comm_2("driver.editline_output");
More information about the lldb-commits
mailing list