This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: RFC: selected frame in read_var_value


On Mon, Sep 08, 2003 at 09:33:33AM -0400, Andrew Cagney wrote:
> 
> >Is this about what you wanted, and are my comments on the mark?
> 
> Yes, just one pedantic tweak.
> 
> >If so, how do you feel about a mass replacement of the one deprecated
> >construct (deprecated_selected_frame) with the new deprecated construct
> >(deprecated_safe_get_selected_frame) in the places in GDB which use
> >this "if frame arg is NULL, get selected frame" idiom?
> 
> For 6.0, scares the peverbial out of me -> got a convincing argument? 
> :-)  For the mainline, not phased.

I don't know if it's convincing, but I've had one bug reported that
would be fixed by it (assertion failure in -data-list-changed-registers).
I've got another one to look at now that might be similar.  We could
just do 'em as they're discovered.

> 
> Andrew
> 
> 
> >+/* This is a variant of get_selected_frame which can be called when the
> >+   inferior is not running; in that case it will return NULL instead of
> >+   calling error ().  */
> 
> Almost.  Those are also true for a core file.

Ooh, that's right of course.  I'll revise and commit.

> 
> >+struct frame_info *
> >+deprecated_safe_get_selected_frame (void)
> >+{
> >+  if (!target_has_registers || !target_has_stack || !target_has_memory)
> >+    return NULL;
> >+  return get_selected_frame ();
> >+}
> 
> 
> 
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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