diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2013-04-03 15:21:15 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2013-04-03 15:21:15 +0200 |
commit | aaa8a93cec50457abd1acd6c9c899ae0b13e6146 (patch) | |
tree | e3f36d59f173b6ae4ce2e590fa658b0c6723d0b9 | |
parent | eb67daa0d80229abdacda5edfcfa5b0bdcba2673 (diff) | |
download | gdb-bt-reformat-aaa8a93cec50457abd1acd6c9c899ae0b13e6146.tar.gz gdb-bt-reformat-aaa8a93cec50457abd1acd6c9c899ae0b13e6146.tar.xz gdb-bt-reformat-aaa8a93cec50457abd1acd6c9c899ae0b13e6146.zip |
Be ready for some missing fields (e.g., with _dl_new_object)
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-x | gdb-bt-reformat | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb-bt-reformat b/gdb-bt-reformat index d5ddea0..6b2c6a3 100755 --- a/gdb-bt-reformat +++ b/gdb-bt-reformat @@ -25,8 +25,8 @@ RE_BT = compile( '(?P<init>^\#[0-9]+\s+)' '(?:(?P<hex>%(DEF_HEX)s) in )?' '(?P<where>%(DEF_IDENT_FUNC)s|(?P<unknown>%(DEF_UNKNOWN)s|%(DEF_MSG)s))' - ' (?P<args>[(](?:(?<=[( ])%(DEF_IDENT_ARG)s=(?:%(DEF_IDENT)s|%(DEF_MSG)s|%(DEF_HEX)s|%(DEF_NUM)s|%(DEF_STR)s|%(DEF_STRUCT)s)(?:, )?)*[)])' - '(?(unknown)| at (?P<path>%(DEF_PATH)s):(?P<line>[1-9][0-9]*))' + '(?: (?P<args>[(](?:(?<=[( ])%(DEF_IDENT_ARG)s=(?:%(DEF_IDENT)s|%(DEF_MSG)s|%(DEF_HEX)s|%(DEF_NUM)s|%(DEF_STR)s|%(DEF_STRUCT)s)(?:, )?)*[)])' + '(?(unknown)| at (?P<path>%(DEF_PATH)s):(?P<line>[1-9][0-9]*)))?' % locals()) @@ -47,7 +47,7 @@ class BtLine(object): if self._found: for k, v in self._found.groupdict().iteritems(): #print "\t{0}: {1}".format(k, v) - setattr(self, k, v) + setattr(self, k, v if v is not None else '') else: raise BtLineError(fill(line.strip(), initial_indent=self._space * 2, subsequent_indent=self._space * 3)) @@ -57,8 +57,9 @@ class BtLine(object): args = wrap(self.args, subsequent_indent=self._space) space = '\n' + self._space res = self.init + self.where - res += (args[0] != '()' and space + '\n'.join(args) or '') - if not self.unknown: + if args and args[0] != '()': + res += space + '\n'.join(args) + if self.path: res += space + 'at ' + self.path + ':' + self.line return res |