This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: =frame-selected MI notification
- From: Tom Tromey <tromey at redhat dot com>
- To: Dmitry Dzhus <dima at sphinx dot net dot ru>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 27 Aug 2009 14:50:22 -0600
- Subject: Re: =frame-selected MI notification
- References: <87iqg99xb5.fsf@sphinx.net.ru>
- Reply-to: tromey at redhat dot com
>>>>> "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