public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-pmuldoon-python-backtrace: use frame.locals() and frame.arguments() API over assembling the local/arguments from the frame.
@ 2012-04-05 11:06 pmuldoon
  0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2012-04-05 11:06 UTC (permalink / raw)
  To: archer-commits

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-05 11:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-05 11:06 [SCM] archer-pmuldoon-python-backtrace: use frame.locals() and frame.arguments() API over assembling the local/arguments from the frame pmuldoon

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).