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: =frame-selected MI notification


>>>>> "Dmitry" == Dmitry Dzhus <dima@sphinx.net.ru> writes:

Dmitry> Nick Roberts once posted a patch which implements both =thread-selected
Dmitry> and =frame-selected via observers:
Dmitry> http://sourceware.org/ml/gdb-patches/2008-04/msg00377.html.

I didn't see any discussion of this patch in the archives.
Was it just forgotten?

In general I think that it makes sense to have MI notifications for
state changes caused by CLI commands.

Dmitry> Current implementation of =thread-selected in mi-main.c uses a
Dmitry> different approach, comparing current thread ID before and after
Dmitry> executing a command in `mi_execute_command` function. My patch
Dmitry> does the same for frame level. I don't know how is it
Dmitry> technically better. I think it would be nice if somebody
Dmitry> reviewed Nick's patch once again or at least accepted the one
Dmitry> proposed by me.

I tend to prefer Nick's approach.  I like the use of observers.

I would want to hear Vladimir's opinion as MI maintainer before
approving anything though.

Dmitry> -struct frame_info
Dmitry> -{
Dmitry> -  /* Level of this frame.  The inner-most (youngest) frame is at level

Moving struct frame_info from frame.c to frame.h is definitely not ok.

The point of the current approach is that frame_info is opaque and
cannot be directly manipulated by other modules.  I think this is a good
quality worth preserving.

But ...

Dmitry> +	  if (fi->level != previous_frame->level)

You should probably just get the frame_id for the previous frame, before
the command, and then compare it to the frame_id after the command
(using frame_id_eq).

Tom


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