summaryrefslogtreecommitdiffstats
path: root/backtrace.py
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2011-02-15 15:15:51 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2011-02-15 15:15:51 -0500
commita8ab774aec55fc200859a1c3b9202080093d1d30 (patch)
tree78655aafc22c984e06b2a937cca4144766c6aa4a /backtrace.py
parent1595336eafd67a1bde19c1129e97ebc6cb4f1c04 (diff)
downloadtriage-a8ab774aec55fc200859a1c3b9202080093d1d30.tar.gz
triage-a8ab774aec55fc200859a1c3b9202080093d1d30.tar.xz
triage-a8ab774aec55fc200859a1c3b9202080093d1d30.zip
Cope with backtraces where the thread says "Thread 0xb78516c0 (LWP 17355)", rather than just a decimal
Diffstat (limited to 'backtrace.py')
-rw-r--r--backtrace.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/backtrace.py b/backtrace.py
index 8d33577..57e907e 100644
--- a/backtrace.py
+++ b/backtrace.py
@@ -17,9 +17,9 @@ class Thread(object):
'''
Class representing a thread within a backtrace
'''
- def __init__(self, index, pid):
+ def __init__(self, index, extra):
self.index = index
- self.pid = pid
+ self.extra = extra
self.frames = {}
self.framelist = []
@@ -27,27 +27,26 @@ class Backtrace(object):
'''
Class representing a parsed backtrace
'''
- def __init__(self, string):
+ def __init__(self, string, debug=False):
'''
Parse the given string (from gdb)
'''
- debug = False
self._string = string
- if debug:
- print string
+ #if debug:
+ # print string
self._crash_site = None
self._thread = None
self._threads = {}
self._frame = None
for line in string.splitlines():
if debug:
- print repr(line)
- m = re.match('^Thread ([0-9]+) \(Thread ([0-9]+)\):$', line)
+ print 'GOT LINE: %r' % line
+ m = re.match('^Thread ([0-9]+) \(Thread (.*)\):$', line)
if m:
if debug:
print 'THREAD START:', m.groups()
self._thread = Thread(int(m.group(1)),
- int(m.group(2)))
+ m.group(2))
self._threads[self._thread.index] = self._thread
self._frame = None
continue
@@ -67,6 +66,8 @@ class Backtrace(object):
m.group(4))
if self._thread is None:
+ if debug:
+ print 'GOT CRASH SITE'
self._crash_site = f
self._frame = None
continue