This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python][rfc] Rename gdb.current_frame to gdb.newest_frame.


El lun, 05-01-2009 a las 16:34 -0700, Tom Tromey escribiÃ:
> >>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
> Thiago> But I kept caller_is and caller_matches using gdb.newest_frame, since I
> Thiago> don't use these functions so I am not sure of what is expected by their
> Thiago> users.
> 
> Hah, me neither.  But I think using the selected frame is perhaps better.
> 
> My use for this function is on a breakpoint condition, where the
> distinction doesn't matter.  But one could imagine using it in
> "commands", after an "up-silent" or something...

Ok, committed the following to change the to use selected_frame.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


2009-01-29  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* python/lib/gdb/function/caller_is.py: Use `selected_frame' instead
	of `newest_frame'.

diff --git a/gdb/python/lib/gdb/function/caller_is.py b/gdb/python/lib/gdb/function/caller_is.py
index 929ba26..2b9c5c7 100644
--- a/gdb/python/lib/gdb/function/caller_is.py
+++ b/gdb/python/lib/gdb/function/caller_is.py
@@ -30,7 +30,7 @@ to traverse to find the calling function.  The default is 1."""
         super (CallerIs, self).__init__ ("caller_is")
 
     def invoke (self, name, nframes = 1):
-        frame = gdb.newest_frame ()
+        frame = gdb.selected_frame ()
         while nframes > 0:
             frame = frame.older ()
             nframes = nframes - 1
@@ -48,7 +48,7 @@ to traverse to find the calling function.  The default is 1."""
         super (CallerMatches, self).__init__ ("caller_matches")
 
     def invoke (self, name, nframes = 1):
-        frame = gdb.newest_frame ()
+        frame = gdb.selected_frame ()
         while nframes > 0:
             frame = frame.older ()
             nframes = nframes - 1



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]