[5/8] gdb/dwarf: remove unused local variable in create_debug_type_hash_table

Message ID 20250305050834.2223161-5-simon.marchi@polymtl.ca
State New
Headers
Series [1/8] gdb/dwarf: remove unnecessary local variable in dw2_get_file_names_reader |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Simon Marchi March 5, 2025, 5:06 a.m. UTC
  From: Simon Marchi <simon.marchi@efficios.com>

Change-Id: I40679fbe32a8a1a9cced085532c83f06affc294c
---
 gdb/dwarf2/read.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Tom Tromey March 5, 2025, 4:03 p.m. UTC | #1
>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:

Simon> From: Simon Marchi <simon.marchi@efficios.com>
Simon> Change-Id: I40679fbe32a8a1a9cced085532c83f06affc294c

It shouldn't really be possible to have an unused variable but I guess
is exempt since it's non-trivial?

Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Simon Marchi March 5, 2025, 4:12 p.m. UTC | #2
On 3/5/25 11:03 AM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> From: Simon Marchi <simon.marchi@efficios.com>
> Simon> Change-Id: I40679fbe32a8a1a9cced085532c83f06affc294c
> 
> It shouldn't really be possible to have an unused variable but I guess
> is exempt since it's non-trivial?

Yeah that's my guess, I wish that compilers could be a bit smarter about
that, since they can see that the constructor and destructor of
unique_ptr doesn't have any side-effects.  Perhaps some higher level
linting tools like Coverity could catch those.  Anyway, not a big deal.

Simon
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 946d99fd4c15..479dc06eb667 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2574,7 +2574,6 @@  create_debug_type_hash_table (dwarf2_per_objfile *per_objfile,
   end_ptr = info_ptr + section->size;
   while (info_ptr < end_ptr)
     {
-      signatured_type_up sig_type;
       struct dwo_unit *dwo_tu;
       void **slot;
       const gdb_byte *ptr = info_ptr;