From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 931AE385BF9C for ; Fri, 28 Jan 2022 12:47:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 931AE385BF9C X-ASG-Debug-ID: 1643374052-0c856e06ad2719d0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id hwOaAXqYiexOZDmn (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Jan 2022 07:47:32 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id A151D441D68; Fri, 28 Jan 2022 07:47:32 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 13/33] gdb: remove COMPUNIT_LOCATIONS_VALID macro, add getter/setter Date: Fri, 28 Jan 2022 07:45:11 -0500 X-ASG-Orig-Subj: [PATCH 13/33] gdb: remove COMPUNIT_LOCATIONS_VALID macro, add getter/setter Message-Id: <20220128124531.2302941-14-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220128124531.2302941-1-simon.marchi@polymtl.ca> References: <20220128124531.2302941-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1643374052 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 3288 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95629 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3613.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE 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: Fri, 28 Jan 2022 12:47:42 -0000 From: Simon Marchi Add a getter and a setter for a compunit_symtab's locations valid flag. Remove the corresponding macro and adjust all callers. Change-Id: I3e3cfba926ce62993d5b61814331bb3244afad01 --- gdb/dwarf2/read.c | 2 +- gdb/symtab.c | 4 ++-- gdb/symtab.h | 13 +++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 0d78c242768a..a14ac22f2882 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9493,7 +9493,7 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language) options - this waits on GCC PR other/32998 (-frecord-gcc-switches). */ if (cu->has_loclist && gcc_4_minor >= 5) - cust->locations_valid = 1; + cust->set_locations_valid (true); if (gcc_4_minor >= 5) cust->epilogue_unwind_valid = 1; diff --git a/gdb/symtab.c b/gdb/symtab.c index 70a9f10ea4b6..5ad5cdbe3a3a 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3709,7 +3709,7 @@ find_function_start_sal_1 (CORE_ADDR func_addr, obj_section *section, symtab_and_line sal = find_pc_sect_line (func_addr, section, 0); if (funfirstline && sal.symtab != NULL - && (COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (sal.symtab)) + && (SYMTAB_COMPUNIT (sal.symtab)->locations_valid () || SYMTAB_LANGUAGE (sal.symtab) == language_asm)) { struct gdbarch *gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch (); @@ -3885,7 +3885,7 @@ skip_prologue_sal (struct symtab_and_line *sal) have proven the CU (Compilation Unit) supports it. sal->SYMTAB does not have to be set by the caller so we use SYM instead. */ if (sym != NULL - && COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (symbol_symtab (sym)))) + && SYMTAB_COMPUNIT (symbol_symtab (sym))->locations_valid ()) force_skip = 0; saved_pc = pc; diff --git a/gdb/symtab.h b/gdb/symtab.h index c59e3c3457c7..a612e1a9b483 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1531,6 +1531,16 @@ struct compunit_symtab m_block_line_section = block_line_section; } + bool locations_valid () const + { + return m_locations_valid; + } + + void set_locations_valid (bool locations_valid) + { + m_locations_valid = locations_valid; + } + /* Make PRIMARY_FILETAB the primary filetab of this compunit symtab. PRIMARY_FILETAB must already be a filetab of this compunit symtab. */ @@ -1593,7 +1603,7 @@ struct compunit_symtab /* Symtab has been compiled with both optimizations and debug info so that GDB may stop skipping prologues as variables locations are valid already at function entry points. */ - unsigned int locations_valid : 1; + unsigned int m_locations_valid : 1; /* DWARF unwinder for this CU is valid even for epilogues (PC at the return instruction). This is supported by GCC since 4.5.0. */ @@ -1626,7 +1636,6 @@ struct compunit_symtab using compunit_symtab_range = next_range; -#define COMPUNIT_LOCATIONS_VALID(cust) ((cust)->locations_valid) #define COMPUNIT_EPILOGUE_UNWIND_VALID(cust) ((cust)->epilogue_unwind_valid) #define COMPUNIT_MACRO_TABLE(cust) ((cust)->macro_table) -- 2.34.1