This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python][rfc] Rename gdb.current_frame to gdb.newest_frame.
- From: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: archer ml <archer at sourceware dot org>
- Date: Thu, 29 Jan 2009 02:40:19 -0200
- Subject: Re: [python][rfc] Rename gdb.current_frame to gdb.newest_frame.
- References: <1229466040.8380.17.camel@localhost.localdomain> <1230578912.8380.69.camel@localhost.localdomain> <m3sknxiay3.fsf@fleche.redhat.com>
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