From patchwork Wed Feb 26 14:37:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 38322 Received: (qmail 52628 invoked by alias); 26 Feb 2020 14:37:37 -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 51953 invoked by uid 89); 26 Feb 2020 14:37:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:dw_at_c, sk:DW_AT_c X-HELO: mail.efficios.com Received: from mail.efficios.com (HELO mail.efficios.com) (167.114.26.124) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Feb 2020 14:37:35 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id A924A26C7AE for ; Wed, 26 Feb 2020 09:37:33 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id y2cLnoYR5IL5; Wed, 26 Feb 2020 09:37:30 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 401A726C7AC; Wed, 26 Feb 2020 09:37:30 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 401A726C7AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1582727850; bh=CWna5WXULaCnvkMkRwzACxpy7EbFeRxKrbx5eTemE4w=; h=From:To:Date:Message-Id:MIME-Version; b=F+/rDqAIvKCqonRjB9zDAS1EAiFzK5FXWUFVTWXDKTAxw5UrvgkXlVY9zwIY88cua EQ8IEoQqlCMnsDh20SUPpN1TUdOab0iLgr4mJv8SXHyGme8HHHp+e/63soWa3zaOv9 3IJKJnVYYqHbSFoJoxNzDaAm2TcmMvCJFZKfQ6EctI5VWJ8/DEfArmATPxkDU3Aj7x H4VBiwsfgg0+iVO8RvZohh3hD/scKDq1d6LCoQpocf69busBk5bL3E5xfPEqauYFOU ccA1trqCbIuNxXwzm20mZ+qpZZJgMY1iU6eijEIRysIx+t+X9ehW5sAKEyU1AfQ3K/ Gso1r1zzduiiQ== Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7SNBbe_OgfjW; Wed, 26 Feb 2020 09:37:30 -0500 (EST) Received: from smarchi-efficios.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by mail.efficios.com (Postfix) with ESMTPSA id 1FC0E26C7A8; Wed, 26 Feb 2020 09:37:30 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] Move more declarations from dwarf2/loc.h to dwarf2/read.h Date: Wed, 26 Feb 2020 09:37:24 -0500 Message-Id: <20200226143724.25135-1-simon.marchi@efficios.com> MIME-Version: 1.0 All these functions have their implementations in dwarf2/read.c, so move their declarations to dwarf2/read.h. Move the doc to the header, at the same time. gdb/ChangeLog: * dwarf2/loc.h (dwarf2_fetch_die_loc_sect_off, dwarf2_fetch_die_loc_cu_off, dwarf2_fetch_constant_bytes, dwarf2_fetch_die_type_sect_off): Move to... * dwarf2/read.h (dwarf2_fetch_die_loc_sect_off, dwarf2_fetch_die_loc_cu_off, dwarf2_fetch_constant_bytes, dwarf2_fetch_die_type_sect_off): ... here. * dwarf2/read.c (dwarf2_fetch_die_loc_sect_off, dwarf2_fetch_die_loc_cu_off, dwarf2_fetch_constant_bytes, dwarf2_fetch_die_type_sect_off): Move doc to header file. --- gdb/ChangeLog | 12 ++++++++++++ gdb/dwarf2/loc.h | 18 ------------------ gdb/dwarf2/read.c | 26 +++++++++----------------- gdb/dwarf2/read.h | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 35 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb4cc033a903..33f7bc8707ab 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2020-02-26 Simon Marchi + + * dwarf2/loc.h (dwarf2_fetch_die_loc_sect_off, + dwarf2_fetch_die_loc_cu_off, dwarf2_fetch_constant_bytes, + dwarf2_fetch_die_type_sect_off): Move to... + * dwarf2/read.h (dwarf2_fetch_die_loc_sect_off, + dwarf2_fetch_die_loc_cu_off, dwarf2_fetch_constant_bytes, + dwarf2_fetch_die_type_sect_off): ... here. + * dwarf2/read.c (dwarf2_fetch_die_loc_sect_off, + dwarf2_fetch_die_loc_cu_off, dwarf2_fetch_constant_bytes, + dwarf2_fetch_die_type_sect_off): Move doc to header file. + 2020-02-26 Tom de Vries PR gdb/25603 diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index dfb6f05525c6..98a7d8a60697 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -41,24 +41,6 @@ const gdb_byte *dwarf2_find_location_expression size_t *locexpr_length, CORE_ADDR pc); -struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off - (sect_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu, - CORE_ADDR (*get_frame_pc) (void *baton), - void *baton, bool resolve_abstract_p = false); - -struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off - (cu_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu, - CORE_ADDR (*get_frame_pc) (void *baton), - void *baton); - -extern const gdb_byte *dwarf2_fetch_constant_bytes (sect_offset, - struct dwarf2_per_cu_data *, - struct obstack *, - LONGEST *); - -struct type *dwarf2_fetch_die_type_sect_off (sect_offset, - struct dwarf2_per_cu_data *); - /* Find the frame base information for FRAMEFUNC at PC. START is an out parameter which is set to point to the DWARF expression to compute. LENGTH is an out parameter which is set to the length of diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 37d4af14ea50..684964474848 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -22211,14 +22211,11 @@ follow_die_ref (struct die_info *src_die, const struct attribute *attr, return die; } -/* Return DWARF block referenced by DW_AT_location of DIE at SECT_OFF at PER_CU. - Returned value is intended for DW_OP_call*. Returned - dwarf2_locexpr_baton->data has lifetime of - PER_CU->DWARF2_PER_OBJFILE->OBJFILE. */ +/* See read.h. */ struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, - struct dwarf2_per_cu_data *per_cu, + dwarf2_per_cu_data *per_cu, CORE_ADDR (*get_frame_pc) (void *baton), void *baton, bool resolve_abstract_p) { @@ -22317,12 +22314,11 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, return retval; } -/* Like dwarf2_fetch_die_loc_sect_off, but take a CU - offset. */ +/* See read.h. */ struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu, - struct dwarf2_per_cu_data *per_cu, + dwarf2_per_cu_data *per_cu, CORE_ADDR (*get_frame_pc) (void *baton), void *baton) { @@ -22350,15 +22346,12 @@ write_constant_as_bytes (struct obstack *obstack, return result; } -/* If the DIE at OFFSET in PER_CU has a DW_AT_const_value, return a - pointer to the constant bytes and set LEN to the length of the - data. If memory is needed, allocate it on OBSTACK. If the DIE - does not have a DW_AT_const_value, return NULL. */ +/* See read.h. */ const gdb_byte * dwarf2_fetch_constant_bytes (sect_offset sect_off, - struct dwarf2_per_cu_data *per_cu, - struct obstack *obstack, + dwarf2_per_cu_data *per_cu, + obstack *obstack, LONGEST *len) { struct dwarf2_cu *cu; @@ -22483,12 +22476,11 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off, return result; } -/* Return the type of the die at OFFSET in PER_CU. Return NULL if no - valid type for this die is found. */ +/* See read.h. */ struct type * dwarf2_fetch_die_type_sect_off (sect_offset sect_off, - struct dwarf2_per_cu_data *per_cu) + dwarf2_per_cu_data *per_cu) { struct dwarf2_cu *cu; struct die_info *die; diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index a3ae412379ac..00652c2b45a7 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -537,6 +537,39 @@ struct type *dwarf2_get_die_type (cu_offset die_offset, CORE_ADDR dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu, unsigned int addr_index); +/* Return DWARF block referenced by DW_AT_location of DIE at SECT_OFF at PER_CU. + Returned value is intended for DW_OP_call*. Returned + dwarf2_locexpr_baton->data has lifetime of + PER_CU->DWARF2_PER_OBJFILE->OBJFILE. */ + +struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off + (sect_offset sect_off, dwarf2_per_cu_data *per_cu, + CORE_ADDR (*get_frame_pc) (void *baton), + void *baton, bool resolve_abstract_p = false); + +/* Like dwarf2_fetch_die_loc_sect_off, but take a CU + offset. */ + +struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off + (cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu, + CORE_ADDR (*get_frame_pc) (void *baton), + void *baton); + +/* If the DIE at SECT_OFF in PER_CU has a DW_AT_const_value, return a + pointer to the constant bytes and set LEN to the length of the + data. If memory is needed, allocate it on OBSTACK. If the DIE + does not have a DW_AT_const_value, return NULL. */ + +extern const gdb_byte *dwarf2_fetch_constant_bytes + (sect_offset sect_off, dwarf2_per_cu_data *per_cu, obstack *obstack, + LONGEST *len); + +/* Return the type of the die at SECT_OFF in PER_CU. Return NULL if no + valid type for this die is found. */ + +struct type *dwarf2_fetch_die_type_sect_off + (sect_offset sect_off, dwarf2_per_cu_data *per_cu); + /* When non-zero, dump line number entries as they are read in. */ extern unsigned int dwarf_line_debug;