From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Aa7cFTKwsWnHBSQAWB0awg (envelope-from ) for ; Wed, 11 Mar 2026 14:10:58 -0400 Received: by simark.ca (Postfix, from userid 112) id 5595F1E0E1; Wed, 11 Mar 2026 14:10:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2061E1E09A for ; Wed, 11 Mar 2026 14:10:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 98E254BB58F7 for ; Wed, 11 Mar 2026 18:10:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98E254BB58F7 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id DC0124BB58C8 for ; Wed, 11 Mar 2026 18:10:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC0124BB58C8 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DC0124BB58C8 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773252631; cv=none; b=QWGaFT3CTxWdR1Q78c5TdtQ0bMlJNFNfYTCo5yjqhlqMDFEEZiwMA36MmpkVc6OHvMjcBXJLCnZ62Fjb/J8SLvF4hOo0DLK/JP8EpvcFpf79Pynty9eX8coAv0C4DQOD/jyuoShlRmdUJ6AiHGyyXUTRFnOoHQF/n6yKmqiPu9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773252631; c=relaxed/simple; bh=I6p/MQm1tTEx0A51HfrtAAwiUEjuFMT/DqX5pVP9I9Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OMZLyxhTai4sUUSzcsXmvv016LdM0tJ8FiXM5JRDvnCafuvI9J4Jmhdmjk+cro8L6sCJg+g5QIaXdMHBcXIrEpJpS7xsCjHGmCmkXkatAwtFfsGLVdWGuy+U5nsZGu7JBdfX2PJSL5mWBw6iNU+5XTqN3n6jONLhBzTKZaYifwg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC0124BB58C8 Received: by simark.ca (Postfix) id 134071E0EF; Wed, 11 Mar 2026 14:10:29 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 14/23] gdb/dwarf: change dwarf2_fetch_cfa_info to return bool Date: Wed, 11 Mar 2026 14:05:39 -0400 Message-ID: <20260311180825.720803-15-simon.marchi@efficios.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260311180825.720803-1-simon.marchi@efficios.com> References: <20260311180825.720803-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Change-Id: I4d5dc288c6ade399e62c73dcb21eebfe2ae16bb7 --- gdb/dwarf2/frame.c | 7 ++++--- gdb/dwarf2/frame.h | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 47cdf397f3de..be55b90df597 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -768,7 +768,7 @@ dwarf2_frame_find_quirks (struct dwarf2_frame_state *fs, /* See dwarf2/frame.h. */ -int +bool dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, dwarf2_per_cu *data, int *regnum_out, LONGEST *offset_out, CORE_ADDR *text_offset_out, @@ -815,14 +815,15 @@ dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, *offset_out = -fs.regs.cfa_offset; else *offset_out = fs.regs.cfa_offset; - return 1; + + return true; } case CFA_EXP: *text_offset_out = per_objfile->objfile->text_section_offset (); *cfa_start_out = fs.regs.cfa_exp; *cfa_end_out = fs.regs.cfa_exp + fs.regs.cfa_exp_len; - return 0; + return false; default: internal_error (_("Unknown CFA rule.")); diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h index 89fa234c43c0..47f9ed88f7c5 100644 --- a/gdb/dwarf2/frame.h +++ b/gdb/dwarf2/frame.h @@ -246,7 +246,7 @@ CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame); /* Find the CFA information for PC. - Return 1 if a register is used for the CFA, or 0 if another + Return true if a register is used for the CFA, or false if another expression is used. Throw an exception on error. GDBARCH is the architecture to use. @@ -254,17 +254,17 @@ CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame); REGNUM_OUT is an out parameter that is set to the register number. OFFSET_OUT is the offset to use from this register. - These are only filled in when 1 is returned. + These are only filled in when true is returned. TEXT_OFFSET_OUT, CFA_START_OUT, and CFA_END_OUT describe the CFA - in other cases. These are only used when 0 is returned. */ + in other cases. These are only used when false is returned. */ -extern int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, - dwarf2_per_cu *data, int *regnum_out, - LONGEST *offset_out, - CORE_ADDR *text_offset_out, - const gdb_byte **cfa_start_out, - const gdb_byte **cfa_end_out); +extern bool dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, + dwarf2_per_cu *data, int *regnum_out, + LONGEST *offset_out, + CORE_ADDR *text_offset_out, + const gdb_byte **cfa_start_out, + const gdb_byte **cfa_end_out); /* Allocate a new instance of the function unique data. @@ -330,14 +330,14 @@ static inline void *dwarf2_frame_allocate_fn_data return nullptr; } -static inline int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, - struct dwarf2_per_cu_data *data, - int *regnum_out, LONGEST *offset_out, - CORE_ADDR *text_offset_out, - const gdb_byte **cfa_start_out, - const gdb_byte **cfa_end_out) +static inline bool +dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc, + struct dwarf2_per_cu_data *data, int *regnum_out, + LONGEST *offset_out, CORE_ADDR *text_offset_out, + const gdb_byte **cfa_start_out, + const gdb_byte **cfa_end_out) { - return 0; + return false; } static inline void -- 2.53.0