From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 1/5] Remove some unused variables in dwarf2read.c
Date: Sun, 01 Apr 2018 00:04:00 -0000 [thread overview]
Message-ID: <20180401000444.13490-2-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20180401000444.13490-1-simon.marchi@polymtl.ca>
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<bool (symtab *)> 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
next prev parent reply other threads:[~2018-04-01 0:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-01 0:04 [PATCH 0/5] Random dwarf2read.c improvements Simon Marchi
2018-04-01 0:04 ` [PATCH 4/5] Make dwarf2_per_objfile::all_comp_units an std::vector Simon Marchi
2018-04-01 0:04 ` [PATCH 3/5] Remove some usages of get_dwarf2_per_objfile Simon Marchi
2018-04-01 0:04 ` Simon Marchi [this message]
2018-04-02 16:00 ` [PATCH 1/5] Remove some unused variables in dwarf2read.c Joel Brobecker
2018-04-01 0:16 ` [PATCH 2/5] Replace dw2_get_cu/dw2_get_cutu with methods of dwarf2_per_objfile Simon Marchi
2018-04-02 16:17 ` Joel Brobecker
2018-04-02 17:21 ` Simon Marchi
2018-04-01 0:16 ` [PATCH 5/5] Make dwarf2_per_objfile::all_type_units an std::vector Simon Marchi
2018-04-07 18:01 ` [PATCH 0/5] Random dwarf2read.c improvements Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180401000444.13490-2-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox