From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34829 invoked by alias); 1 Apr 2018 00:04:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 34711 invoked by uid 89); 1 Apr 2018 00:04:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=H*MI:sk:2018040, inspection 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; Sun, 01 Apr 2018 00:04:54 +0000 X-ASG-Debug-ID: 1522541086-0c856e618974ed80001-fS2M51 Received: from smtp.ebox.ca (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id OiEaDfCCEpphNEmO (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 31 Mar 2018 20:04:46 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id 4F829441D64; Sat, 31 Mar 2018 20:04:46 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 192-222-164-54.qc.cable.ebox.net[192.222.164.54] X-Barracuda-Apparent-Source-IP: 192.222.164.54 X-Barracuda-RBL-IP: 192.222.164.54 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/5] Remove some unused variables in dwarf2read.c Date: Sun, 01 Apr 2018 00:04:00 -0000 X-ASG-Orig-Subj: [PATCH 1/5] Remove some unused variables in dwarf2read.c Message-Id: <20180401000444.13490-2-simon.marchi@polymtl.ca> In-Reply-To: <20180401000444.13490-1-simon.marchi@polymtl.ca> References: <20180401000444.13490-1-simon.marchi@polymtl.ca> X-Barracuda-Connect: smtp.electronicbox.net[96.127.255.82] X-Barracuda-Start-Time: 1522541086 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3544 X-Barracuda-BRTS-Status: 1 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.49475 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00003.txt.bz2 Most of them are obvious. The ones in dwarf2_record_block_ranges are less obvious, because it is a bit suspicious to have that many variables unused. But after inspection, it seems like it dates from commit 5f46c5a54825 ("Code cleanup: Split dwarf2_ranges_read to a callback"), where dwarf2_record_block_ranges was made to use dwarf2_ranges_process, which contains the same functionality. gdb/ChangeLog: * dwarf2read.c (create_signatured_type_table_from_debug_names): Remove unused variables. (dw2_map_symtabs_matching_filename): Likewise. (dwarf2_record_block_ranges): Likewise. (dwarf2_read_addr_index): Likewise. (follow_die_offset): Likewise. --- gdb/dwarf2read.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index fd544a7f9b98..c2fed7f60109 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3118,9 +3118,7 @@ create_signatured_type_table_from_debug_names for (uint32_t i = 0; i < map.tu_count; ++i) { struct signatured_type *sig_type; - ULONGEST signature; void **slot; - cu_offset type_offset_in_tu; sect_offset sect_off = (sect_offset) (extract_unsigned_integer @@ -3838,7 +3836,6 @@ dw2_map_symtabs_matching_filename (struct objfile *objfile, const char *name, const char *real_path, gdb::function_view callback) { - int i; const char *name_basename = lbasename (name); struct dwarf2_per_objfile *dwarf2_per_objfile = get_dwarf2_per_objfile (objfile); @@ -14879,24 +14876,6 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block, address range list in the .debug_ranges section. */ unsigned long offset = (DW_UNSND (attr) + (need_ranges_base ? cu->ranges_base : 0)); - const gdb_byte *buffer; - - /* For some target architectures, but not others, the - read_address function sign-extends the addresses it returns. - To recognize base address selection entries, we need a - mask. */ - unsigned int addr_size = cu->header.addr_size; - CORE_ADDR base_select_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1)); - - /* The base address, to which the next pair is relative. Note - that this 'base' is a DWARF concept: most entries in a range - list are relative, to reduce the number of relocs against the - debugging information. This is separate from this function's - 'baseaddr' argument, which GDB uses to relocate debugging - information from a shared library based on the address at - which the library was loaded. */ - CORE_ADDR base = cu->base_address; - int base_known = cu->base_known; dwarf2_ranges_process (offset, cu, [&] (CORE_ADDR start, CORE_ADDR end) @@ -19660,7 +19639,6 @@ dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu, unsigned int addr_index) { struct dwarf2_per_objfile *dwarf2_per_objfile = per_cu->dwarf2_per_objfile; - struct objfile *objfile = dwarf2_per_objfile->objfile; struct dwarf2_cu *cu = per_cu->cu; ULONGEST addr_base; int addr_size; @@ -22876,7 +22854,6 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *target_cu, *cu = *ref_cu; struct dwarf2_per_objfile *dwarf2_per_objfile = cu->per_cu->dwarf2_per_objfile; - struct objfile *objfile = dwarf2_per_objfile->objfile; gdb_assert (cu->per_cu != NULL); -- 2.16.3