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 B86773857C64 for ; Fri, 9 Oct 2020 11:28:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B86773857C64 IronPort-SDR: Ls3ZK23n66W8yhQmkXDt3IvINxDx9lSBBDceFFJ1783msIMhM7/hRgjmptLe/RgSbk5Hxg3ltF 08wrG2TOR5WQ== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="250165899" X-IronPort-AV: E=Sophos;i="5.77,354,1596524400"; d="scan'208";a="250165899" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 04:28:14 -0700 IronPort-SDR: dyj9AgCJeW5nw8fSJRQEmcDsGH4K+kC3x1yX85Oq1YjqiuWAS+yNj3B4IWiFvQAlslE7x15mH+ yEKnCjNBy3wg== X-IronPort-AV: E=Sophos;i="5.77,354,1596524400"; d="scan'208";a="462156437" Received: from ulll2701.iul.intel.com (HELO localhost) ([172.28.50.171]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 04:28:13 -0700 From: Natalia Saiapova To: gdb-patches@sourceware.org Subject: [PATCH v2 1/6] gdb: add in_cond_eval field to thread_control_state struct. Date: Fri, 9 Oct 2020 13:27:13 +0200 Message-Id: <20201009112719.629-2-natalia.saiapova@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201009112719.629-1-natalia.saiapova@intel.com> References: <20200831123519.16232-1-natalia.saiapova () intel ! com> <20201009112719.629-1-natalia.saiapova@intel.com> X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 09 Oct 2020 11:28:17 -0000 This patch adds a new field to thread_control_state struct, which is set to true when the thread is evaluating a breakpoint condition, and false otherwise. gdb/ChangeLog: 2020-08-27 Natalia Saiapova Tankut Baris Aktemur * breakpoint.c (bpstat_check_breakpoint_conditions): Set/unset thread->control.in_cond_eval. * gdbthread.h (thread_control_state) : New boolean field. Co-authored-by: Natalia Saiapova Co-authored-by: Tankut Baris Aktemur Signed-off-by: Natalia Saiapova --- gdb/breakpoint.c | 3 +++ gdb/gdbthread.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 296b08c0afc..77f927dc645 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5209,10 +5209,13 @@ bpstat_check_breakpoint_conditions (bpstat bs, thread_info *thread) { try { + thread->control.in_cond_eval = true; condition_result = breakpoint_cond_eval (cond); + thread->control.in_cond_eval = false; } catch (const gdb_exception &ex) { + thread->control.in_cond_eval = false; exception_fprintf (gdb_stderr, ex, "Error in testing breakpoint condition:\n"); } diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index ab5771fdb47..9e93587f221 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -158,6 +158,9 @@ struct thread_control_state command. This is used to decide whether "set scheduler-locking step" behaves like "on" or "off". */ int stepping_command = 0; + + /* True if the thread is evaluating a BP condition. */ + bool in_cond_eval = false; }; /* Inferior thread specific part of `struct infcall_suspend_state'. */ -- 2.17.1 Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Gary Kershaw Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928