* [RFA] Add observer notification in normal_stop
@ 2003-03-18 1:49 Joel Brobecker
2003-03-18 1:51 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2003-03-18 1:49 UTC (permalink / raw)
To: gdb-patches
Hello,
I am currently writing a regression test for observer.c, which will live
in testsuite/gdb.gdb. It's using a mechanism similar to xfullpath.exp.
But in order for the test to function, observer.o needs to be linked in.
This wasn't the case up to now, because there is currently no code using
it.
This patch is adding a call to observer_notify_normal_stop() inside
normal_stop. This notification will be useful later, when the latest
version of ada-task.c (from ACT's repository, accessible from
libre.act-europe.fr BTW) is contributed. In the meantime, the overhead
is really minimal and it allows us to test observer.c by debugging gdb.
2003-03-17 J. Brobecker <brobecker@gnat.com>
* infrun.c (observer.h): Add #include.
(normal_stop): Add call to observer_notify_normal_stop.
* Makefile.in (infrun.o): Add dependency on observer.h.
Ok to apply?
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Add observer notification in normal_stop
2003-03-18 1:49 [RFA] Add observer notification in normal_stop Joel Brobecker
@ 2003-03-18 1:51 ` Joel Brobecker
2003-03-18 15:50 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2003-03-18 1:51 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
[sigh, once more, with the patch this time...]
Hello,
I am currently writing a regression test for observer.c, which will live
in testsuite/gdb.gdb. It's using a mechanism similar to xfullpath.exp.
But in order for the test to function, observer.o needs to be linked in.
This wasn't the case up to now, because there is currently no code using
it.
This patch is adding a call to observer_notify_normal_stop() inside
normal_stop. This notification will be useful later, when the latest
version of ada-task.c (from ACT's repository, accessible from
libre.act-europe.fr BTW) is contributed. In the meantime, the overhead
is really minimal and it allows us to test observer.c by debugging gdb.
2003-03-17 J. Brobecker <brobecker@gnat.com>
* infrun.c (observer.h): Add #include.
(normal_stop): Add call to observer_notify_normal_stop.
* Makefile.in (infrun.o): Add dependency on observer.h.
Ok to apply?
--
Joel
[-- Attachment #2: infrun.diff --]
[-- Type: text/plain, Size: 2154 bytes --]
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.97
diff -c -3 -p -r1.97 infrun.c
*** infrun.c 24 Feb 2003 21:56:49 -0000 1.97
--- infrun.c 18 Mar 2003 01:40:13 -0000
***************
*** 42,47 ****
--- 42,48 ----
#include "inf-loop.h"
#include "regcache.h"
#include "value.h"
+ #include "observer.h"
/* Prototypes for local functions */
*************** print_stop_reason (enum inferior_stop_re
*** 2953,2958 ****
--- 2954,2961 ----
void
normal_stop (void)
{
+ observer_notify_normal_stop ();
+
/* As with the notification of thread events, we want to delay
notifying the user that we've switched thread context until
the inferior actually stops.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.342
diff -c -3 -p -r1.342 Makefile.in
*** Makefile.in 17 Mar 2003 23:25:08 -0000 1.342
--- Makefile.in 18 Mar 2003 01:40:15 -0000
*************** infptrace.o: infptrace.c $(defs_h) $(fra
*** 1817,1823 ****
infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \
$(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \
$(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \
! $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h)
inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h)
infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
--- 1817,1824 ----
infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \
$(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \
$(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \
! $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) \
! $(observer_h)
inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h)
infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Add observer notification in normal_stop
2003-03-18 1:51 ` Joel Brobecker
@ 2003-03-18 15:50 ` Andrew Cagney
2003-03-18 18:22 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-03-18 15:50 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
> [sigh, once more, with the patch this time...]
Welcome to my world.
> Hello,
>
> I am currently writing a regression test for observer.c, which will live
> in testsuite/gdb.gdb. It's using a mechanism similar to xfullpath.exp.
> But in order for the test to function, observer.o needs to be linked in.
> This wasn't the case up to now, because there is currently no code using
> it.
>
> This patch is adding a call to observer_notify_normal_stop() inside
> normal_stop. This notification will be useful later, when the latest
> version of ada-task.c (from ACT's repository, accessible from
> libre.act-europe.fr BTW) is contributed. In the meantime, the overhead
> is really minimal and it allows us to test observer.c by debugging gdb.
>
> 2003-03-17 J. Brobecker <brobecker@gnat.com>
>
> * infrun.c (observer.h): Add #include.
> (normal_stop): Add call to observer_notify_normal_stop.
> * Makefile.in (infrun.o): Add dependency on observer.h.
>
> Ok to apply?
I think down the end, next to the annotate_stop() call, would be better.
I'm assuming that the secret agenda is to replace all annotate_xxx() and
xxx_hook() calls with a equivalent observer_notify_xxx() call. Hence,
adding an observer_xxx() call where ever either of the former appears
should be pretty obvious and largely mechanical.
An orthogonal task is rationalizing some of those events and/or their
call site. For instance, merging registers changed and memory changed
into a single observer_notify_target_changed().
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add observer notification in normal_stop
2003-03-18 15:50 ` Andrew Cagney
@ 2003-03-18 18:22 ` Joel Brobecker
2003-03-18 19:00 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2003-03-18 18:22 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 640 bytes --]
> I think down the end, next to the annotate_stop() call, would be better.
Yes, makes sense, new patch attached.
> I'm assuming that the secret agenda is to replace all annotate_xxx() and
> xxx_hook() calls with a equivalent observer_notify_xxx() call. Hence,
> adding an observer_xxx() call where ever either of the former appears
> should be pretty obvious and largely mechanical.
That'd be nice.
2003-03-18 J. Brobecker <brobecker@gnat.com>
* infrun.c (observer.h): Add #include.
(normal_stop): Add call to observer_notify_normal_stop.
* Makefile.in (infrun.o): Add dependency on observer.h.
--
Joel
[-- Attachment #2: infrun.diff --]
[-- Type: text/plain, Size: 1983 bytes --]
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.97
diff -c -3 -p -r1.97 infrun.c
*** infrun.c 24 Feb 2003 21:56:49 -0000 1.97
--- infrun.c 18 Mar 2003 18:10:10 -0000
***************
*** 42,47 ****
--- 42,48 ----
#include "inf-loop.h"
#include "regcache.h"
#include "value.h"
+ #include "observer.h"
/* Prototypes for local functions */
*************** normal_stop (void)
*** 3113,3118 ****
--- 3114,3120 ----
done:
annotate_stopped ();
+ observer_notify_normal_stop ();
}
static int
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.342
diff -c -3 -p -r1.342 Makefile.in
*** Makefile.in 17 Mar 2003 23:25:08 -0000 1.342
--- Makefile.in 18 Mar 2003 18:10:12 -0000
*************** infptrace.o: infptrace.c $(defs_h) $(fra
*** 1817,1823 ****
infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \
$(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \
$(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \
! $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h)
inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h)
infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
--- 1817,1824 ----
infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \
$(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \
$(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \
! $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) \
! $(observer_h)
inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h)
infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Add observer notification in normal_stop
2003-03-18 18:22 ` Joel Brobecker
@ 2003-03-18 19:00 ` Andrew Cagney
2003-03-18 19:07 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-03-18 19:00 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
> 2003-03-18 J. Brobecker <brobecker@gnat.com>
>
> * infrun.c (observer.h): Add #include.
> (normal_stop): Add call to observer_notify_normal_stop.
> * Makefile.in (infrun.o): Add dependency on observer.h.
>
Yes, thanks.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add observer notification in normal_stop
2003-03-18 19:00 ` Andrew Cagney
@ 2003-03-18 19:07 ` Joel Brobecker
2003-03-18 19:12 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2003-03-18 19:07 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Tue, Mar 18, 2003 at 02:00:38PM -0500, Andrew Cagney wrote:
> >2003-03-18 J. Brobecker <brobecker@gnat.com>
> >
> > * infrun.c (observer.h): Add #include.
> > (normal_stop): Add call to observer_notify_normal_stop.
> > * Makefile.in (infrun.o): Add dependency on observer.h.
> >
> Yes, thanks.
I've just checked this in.
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add observer notification in normal_stop
2003-03-18 19:07 ` Joel Brobecker
@ 2003-03-18 19:12 ` Joel Brobecker
0 siblings, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2003-03-18 19:12 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Tue, Mar 18, 2003 at 11:07:25AM -0800, Joel Brobecker wrote:
> On Tue, Mar 18, 2003 at 02:00:38PM -0500, Andrew Cagney wrote:
> > >2003-03-18 J. Brobecker <brobecker@gnat.com>
> > >
> > > * infrun.c (observer.h): Add #include.
> > > (normal_stop): Add call to observer_notify_normal_stop.
> > > * Makefile.in (infrun.o): Add dependency on observer.h.
> > >
> > Yes, thanks.
>
> I've just checked this in.
I forgot to mention: Having moved this notification further down,
a change in the documentation will probably be needed. That's on
my plate.
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-03-18 19:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 1:49 [RFA] Add observer notification in normal_stop Joel Brobecker
2003-03-18 1:51 ` Joel Brobecker
2003-03-18 15:50 ` Andrew Cagney
2003-03-18 18:22 ` Joel Brobecker
2003-03-18 19:00 ` Andrew Cagney
2003-03-18 19:07 ` Joel Brobecker
2003-03-18 19:12 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox