diff options
Diffstat (limited to 'backtrace.py')
-rw-r--r-- | backtrace.py | 19 |
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 |