From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1712 invoked by alias); 5 Apr 2012 11:06:09 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 1684 invoked by uid 9514); 5 Apr 2012 11:06:09 -0000 Date: Thu, 05 Apr 2012 11:06:00 -0000 Message-ID: <20120405110609.1668.qmail@sourceware.org> 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. X-Git-Refname: refs/heads/archer-pmuldoon-python-backtrace X-Git-Reftype: branch X-Git-Oldrev: 4e0a42a813aa31156268765bba0219263a08f071 X-Git-Newrev: deb8867f8cbe4a5ffa97e1b9ec9aa0a104f59775 X-SW-Source: 2012-q2/txt/msg00011.txt.bz2 List-Id: 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 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.