From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] gdb/cli: add a 'normal_stop' option to 'cli_suppress_notification'
Date: Wed, 1 Dec 2021 16:08:28 +0100 [thread overview]
Message-ID: <9195fd2511991fdd17cccc11e839dd0885c2f530.1638370938.git.tankut.baris.aktemur@intel.com> (raw)
In-Reply-To: <cover.1638370938.git.tankut.baris.aktemur@intel.com>
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.
---
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 db5e313d36e..425c4b2f815 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 6ae57dcc030..2a4aacbd18f 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 0cd5b125919..1d9ac9585bc 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 ();
--
2.33.1
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2021-12-01 15:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-01 15:08 [PATCH 0/3] Suppressing CLI notifications Tankut Baris Aktemur
2021-12-01 15:08 ` [PATCH 1/3] gdb/cli: convert cli_suppress_notification from int to bool Tankut Baris Aktemur
2022-01-14 15:52 ` Tom Tromey
2021-12-01 15:08 ` Tankut Baris Aktemur [this message]
2022-01-14 16:01 ` [PATCH 2/3] gdb/cli: add a 'normal_stop' option to 'cli_suppress_notification' Tom Tromey
2021-12-01 15:08 ` [PATCH 3/3] gdb: add the 'set/show suppress-notification-cli' command Tankut Baris Aktemur
2022-01-14 16:04 ` Tom Tromey
2022-01-18 10:41 ` Andrew Burgess
2022-01-14 12:13 ` [PATCH 0/3] Suppressing CLI notifications Aktemur, Tankut Baris
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=9195fd2511991fdd17cccc11e839dd0885c2f530.1638370938.git.tankut.baris.aktemur@intel.com \
--to=tankut.baris.aktemur@intel.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).