[binutils-gdb] gdb/cli: add a 'normal_stop' option to 'cli_suppress_notification'

Tankut Baris Aktemur aktemur@sourceware.org
Mon Feb 7 07:34:11 GMT 2022


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2b826f759256b77b447da9831b079e32a7bb0cdb

commit 2b826f759256b77b447da9831b079e32a7bb0cdb
Author: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Date:   Mon Feb 7 08:26:56 2022 +0100

    gdb/cli: add a 'normal_stop' option to 'cli_suppress_notification'
    
    Extend the 'cli_suppress_notification' struct with a new field,
    'normal_stop', that can be used for checking if printing normal stop
    events on the CLI should be suppressed.
    
    This patch only introduces the flag.  The subsequent patch adds a user
    command to turn the flag off/on.

Diff:
---
 gdb/cli/cli-interp.c | 4 ++++
 gdb/command.h        | 3 +++
 gdb/tui/tui-interp.c | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index eb1edcc4ef1..dd56e12e696 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -127,6 +127,10 @@ cli_on_normal_stop (struct bpstat *bs, int print_frame)
   if (!print_frame)
     return;
 
+  /* This event is suppressed.  */
+  if (cli_suppress_notification.normal_stop)
+    return;
+
   SWITCH_THRU_ALL_UIS ()
     {
       struct interp *interp = top_level_interpreter ();
diff --git a/gdb/command.h b/gdb/command.h
index 258ec380a44..cd798146ae0 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -379,6 +379,9 @@ struct cli_suppress_notification
 {
   /* Inferior, thread, frame selected notification suppressed?  */
   bool user_selected_context = false;
+
+  /* Normal stop event suppressed? */
+  bool normal_stop = false;
 };
 
 extern struct cli_suppress_notification cli_suppress_notification;
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 9b92194dac3..e867441afb0 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -84,6 +84,10 @@ tui_on_normal_stop (struct bpstat *bs, int print_frame)
   if (!print_frame)
     return;
 
+  /* This event is suppressed.  */
+  if (cli_suppress_notification.normal_stop)
+    return;
+
   SWITCH_THRU_ALL_UIS ()
     {
       struct interp *interp = top_level_interpreter ();


More information about the Gdb-cvs mailing list