From patchwork Wed Feb 26 04:39:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 38319 Received: (qmail 61501 invoked by alias); 26 Feb 2020 04:39:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 61492 invoked by uid 89); 26 Feb 2020 04:39:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Feb 2020 04:39:35 +0000 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id qxRmrRgBoTQVREGx (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Feb 2020 23:39:32 -0500 (EST) Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id 6744C441B21; Tue, 25 Feb 2020 23:39:32 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] Move dwarf2_read_addr_index declaration to dwarf2/read.h Date: Tue, 25 Feb 2020 23:39:31 -0500 Message-Id: <20200226043931.133126-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-IsSubscribed: yes The implementation is in dwarf2/read.c, so the declaration belongs in dwarf2/read.h. Also, move the documentation there. gdb/ChangeLog: * dwarf2/loc.h (dwarf2_read_addr_index): Move... * dwarf2/read.h (dwarf2_read_addr_index): ... here. * dwarf2/read.c (dwarf2_read_addr_index): Move doc to header. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2/loc.h | 3 --- gdb/dwarf2/read.c | 8 ++------ gdb/dwarf2/read.h | 8 ++++++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cb3e1854ac2d..aa4b01bac3b8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-02-25 Simon Marchi + + * dwarf2/loc.h (dwarf2_read_addr_index): Move... + * dwarf2/read.h (dwarf2_read_addr_index): ... here. + * dwarf2/read.c (dwarf2_read_addr_index): Move doc to header. + 2020-02-25 Andrew Burgess * gdbtypes.c (create_array_type_with_stride): Handle negative diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index ab071c21b344..dfb6f05525c6 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -138,9 +138,6 @@ void dwarf2_compile_property_to_c (string_file *stream, CORE_ADDR address, struct symbol *sym); -CORE_ADDR dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu, - unsigned int addr_index); - /* The symbol location baton types used by the DWARF-2 reader (i.e. SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct dwarf2_locexpr_baton" is for a symbol with a single location diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 8c40ddb727af..37d4af14ea50 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18867,14 +18867,10 @@ read_addr_index_from_leb128 (struct dwarf2_cu *cu, const gdb_byte *info_ptr, return read_addr_index (cu, addr_index); } -/* Given an index in .debug_addr, fetch the value. - NOTE: This can be called during dwarf expression evaluation, - long after the debug information has been read, and thus per_cu->cu - may no longer exist. */ +/* See read.h. */ CORE_ADDR -dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu, - unsigned int addr_index) +dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu, unsigned int addr_index) { struct dwarf2_per_objfile *dwarf2_per_objfile = per_cu->dwarf2_per_objfile; struct dwarf2_cu *cu = per_cu->cu; diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 640e19e4a0e6..a3ae412379ac 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -529,6 +529,14 @@ extern struct dwz_file *dwarf2_get_dwz_file struct type *dwarf2_get_die_type (cu_offset die_offset, struct dwarf2_per_cu_data *per_cu); +/* Given an index in .debug_addr, fetch the value. + NOTE: This can be called during dwarf expression evaluation, + long after the debug information has been read, and thus per_cu->cu + may no longer exist. */ + +CORE_ADDR dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu, + unsigned int addr_index); + /* When non-zero, dump line number entries as they are read in. */ extern unsigned int dwarf_line_debug;