public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-pmuldoon-python-backtrace: use frame.locals() and frame.arguments() API over assembling the local/arguments from the frame. Date: Thu, 05 Apr 2012 11:06:00 -0000 [thread overview] Message-ID: <20120405110609.1668.qmail@sourceware.org> (raw) The branch, archer-pmuldoon-python-backtrace has been updated via deb8867f8cbe4a5ffa97e1b9ec9aa0a104f59775 (commit) from 4e0a42a813aa31156268765bba0219263a08f071 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit deb8867f8cbe4a5ffa97e1b9ec9aa0a104f59775 Author: Phil Muldoon <pmuldoon@redhat.com> Date: Thu Apr 5 12:05:19 2012 +0100 use frame.locals() and frame.arguments() API over assembling the local/arguments from the frame. ----------------------------------------------------------------------- Summary of changes: gdb/testsuite/gdb.python/py-framefilter.py | 81 ++++++---------------------- 1 files changed, 16 insertions(+), 65 deletions(-) First 500 lines of diff: diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py index c6528c3..c1bf717 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.py +++ b/gdb/testsuite/gdb.python/py-framefilter.py @@ -71,73 +71,24 @@ class TestFilter: return "unknown" def frame_args (self): - func = self.frame.function() - args = [] - block = self.frame.block() - - if not func: - return - - for sym in block: - if not sym.is_argument: - continue; - - if len (sym.linkage_name): - nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block) - if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER: - sym = nsym - try: - val = sym.value(self.frame) - if val != None: - val = val - else: - val="???" - except RuntimeError, text: - val = text - - atuple = (sym.print_name, val) - args.append (atuple) - - return args + args = self.frame.arguments() + args_list = [] + if args != None: + for arg in args: + value = arg.value(self.frame) + args_list.append((arg, value)) - def frame_locals (self): - args = [] - block = self.frame.block() - func = self.frame.function() - - if not func: - return - fname = str (func) - - if fname == "end_func": - args.append(("Some kind of synthetic var", gdb.Value(42))) - - for sym in block: - if not sym.is_variable: - continue; - - if len (sym.linkage_name): - nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block) - if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER: - sym = nsym - try: - val = sym.value(self.frame) - if val != None: - val = val - else: - val="???" - except RuntimeError, text: - val = text - - atuple = (sym.print_name, val) - args.append (atuple) - - fname = str (self.frame.function()) + return args_list - if fname == "end_func": - args.append(("Some kind of synthetic var", gdb.Value(42))) - - return args + def frame_locals (self): + frame_locals = self.frame.locals() + frame_locals_list = [] + if frame_locals != None: + for frame_local in frame_locals: + value = frame_local.value(self.frame) + frame_locals_list.append((frame_local, value)) + + return frame_locals_list def line (self): sal = self.frame.find_sal() hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2012-04-05 11:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20120405110609.1668.qmail@sourceware.org \ --to=pmuldoon@sourceware.org \ --cc=archer-commits@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).