From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id 4B047385803F for ; Wed, 1 Dec 2021 15:09:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4B047385803F X-IronPort-AV: E=McAfee;i="6200,9189,10184"; a="322721535" X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="322721535" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2021 07:09:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="512740187" Received: from ultl2604.iul.intel.com ([172.28.49.61]) by orsmga008.jf.intel.com with ESMTP; 01 Dec 2021 07:09:00 -0800 From: Tankut Baris Aktemur 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 Message-Id: <9195fd2511991fdd17cccc11e839dd0885c2f530.1638370938.git.tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2021 15:09:48 -0000 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 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