This is the mail archive of the gdb-patches@sourceware.org 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: TUI + gdbserver broken?


Daniel Jacobowitz wrote:
static void
tui_selected_frame_level_changed_hook (int level)
{
struct frame_info *fi;

fi = deprecated_safe_get_selected_frame ();
/* Ensure that symbols for this frame are read in. Also, determine the
source language of this frame, and switch to it if desired. */
if (fi)
{
struct symtab *s;

How about this:


  if (level >= 0)
    {
      struct frame_info *fi = get_selected_frame (NULL);



That has exactly the same effect as it was before the your select frame changes.
That is, only try to get the selected frame when there is one. Maybe there should
still be a function like this in frame.c ?


struct frame_info *
deprecated_get_selected_frame ()
{
 return selected_frame;
}

(or perhaps call it get_selected_frame_if_any)

I don't think that the callbacks should ever change the selected_frame state, that is,
they should be pure observers - that is how it worked before, and your suggestion
would make it so too.


(I'll go try both versions)

Cheers,
Pedro Alves



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