public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [vxworks 02/14] New command_post observer.
Date: Sun, 25 Apr 2010 15:48:00 -0000	[thread overview]
Message-ID: <1272210447-13895-3-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1272210447-13895-1-git-send-email-brobecker@adacore.com>

Just as the current language, or current inferior, or current thread,
affect some of the commands being issued by the user to the debugger,
with multi-partition systems, we now have a current partition (formerly
known as a Protection Domain, or PD).

What we are trying to do is to keep the user informed of the current
PD (which is identified by either PD ID or name, but we like to print
both).

The problem is that we cannot just print a message everytime the PD
gets switched, because many commands result in a temporary switch of
partition.  For instance, info threads will need to switch to the
associated PDs in order to get the PC and associated symbolic info.
We don't want to write the notification for each switch. However, we
do want to print that notification if we just hit a breakpoint for
some code living in a different partition...

The way we solved this is by remembering the PD ID before we issued
the last command.  At the end of a command execution, if the PD ID
changed, then we write a notification...

This patch introduces an observer (command_post) that gets triggered
at the end of a command execution...

2010-04-24  Joel Brobecker  <brobecker@adacore.com>

        * doc/observer.texi (command_post): New observer.
        * top.c: #include "observer.h".
        (execute_command): Call observer_notify_command_post.
---
 gdb/doc/observer.texi |    4 ++++
 gdb/top.c             |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi
index e19b8ed..ceb5b87 100644
--- a/gdb/doc/observer.texi
+++ b/gdb/doc/observer.texi
@@ -132,6 +132,10 @@ Called with @var{objfile} equal to @code{NULL} to indicate
 previously loaded symbol table data has now been invalidated.
 @end deftypefun
 
+@deftypefun void command_post (void)
+The debugger just finished executing a command.
+@end deftypefun
+
 @deftypefun void new_thread (struct thread_info *@var{t})
 The thread specified by @var{t} has been created.
 @end deftypefun
diff --git a/gdb/top.c b/gdb/top.c
index dc2104c..e7eb4e6 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -63,6 +63,7 @@
 #include <ctype.h>
 #include "ui-out.h"
 #include "cli-out.h"
+#include "observer.h"
 
 /* Default command line prompt.  This is overriden in some configs. */
 
@@ -475,6 +476,9 @@ execute_command (char *p, int from_tty)
 	  warned = 1;
 	}
     }
+
+  /* Emit the "command_post" notification.  */
+  observer_notify_command_post ();
 }
 
 /* Read commands from `instream' and execute them
-- 
1.6.3.3

  parent reply	other threads:[~2010-04-25 15:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 15:47 Adding support for VxWorks target Joel Brobecker
2010-04-25 15:47 ` [vxworks 01/14] Some ada-lang/ada-tasks routines needed by the " Joel Brobecker
2010-04-25 15:48 ` [vxworks 14/14] Configury and Makefile updates for VxWorks Joel Brobecker
2010-04-25 15:48 ` Joel Brobecker [this message]
2010-04-26 18:51   ` [vxworks 02/14] New command_post observer Tom Tromey
2010-04-27 14:22     ` Joel Brobecker
2010-04-27 17:16       ` Tom Tromey
2010-04-25 15:48 ` [vxworks 03/14] New module remote-wtx-utils Joel Brobecker
2010-04-26 18:55   ` Tom Tromey
2010-04-27 16:27     ` Joel Brobecker
2010-04-25 15:48 ` [vxworks 10/14] Add new "wtx" target Joel Brobecker
2010-04-25 15:48 ` [vxworks 09/14] remote-wtx-hw / register fetch/store support Joel Brobecker
2010-04-25 15:48 ` [vxworks 08/14] Partition support Joel Brobecker
2010-04-25 15:48 ` [vxworks 13/14] Add tdep files for x86 and powerpc Joel Brobecker
2010-04-25 20:45   ` Mark Kettenis
2010-04-26 16:41     ` Joel Brobecker
2010-04-25 15:48 ` [vxworks 11/14] WTX-TCL support module Joel Brobecker
2010-04-25 15:56 ` [vxworks 07/14] "multi-tasks-mode" support Joel Brobecker
2010-04-25 15:56 ` [vxworks 05/14] Add options to control Vxworks related settings Joel Brobecker
2010-05-04 15:25   ` Joel Brobecker
2010-04-25 15:56 ` [vxworks 06/14] VxWorks breakpoint-handling module Joel Brobecker
2010-04-25 15:56 ` [vxworks 12/14] Add support for VxWorks 6 Joel Brobecker
2010-04-25 16:01 ` [vxworks 04/14] remote-wtxapi: The WTX API abstraction layer Joel Brobecker
2010-05-04 14:58 ` Adding support for VxWorks target Joel Brobecker
2010-05-04 15:43   ` Stan Shebs
2010-05-04 18:30     ` one big unit or several smaller units? (was: "Re: Adding support for VxWorks target") Joel Brobecker
2010-11-25  0:53 ` Adding support for VxWorks target Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272210447-13895-3-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).