Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list
@ 2021-02-02 11:35 Tom de Vries
  2021-02-03 18:29 ` Simon Marchi via Gdb-patches
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2021-02-02 11:35 UTC (permalink / raw)
  To: gdb-patches

Hi,

When running test-case gdb.dwarf2/clang-debug-names.exp, I run into the
following warning:
...
(gdb) file clang-debug-names^M
Reading symbols from clang-debug-names...^M
warning: Section .debug_aranges in clang-debug-names has duplicate \
  debug_info_offset 0xc7, ignoring .debug_aranges.^M
...

This is caused by a missing return in commit 3ee6bb113af "[gdb/symtab] Fix
incomplete CU list assert in .debug_names".

Fix this by adding the missing return, such that we have instead this warning:
...
(gdb) file clang-debug-names^M
Reading symbols from clang-debug-names...^M
warning: Section .debug_aranges in clang-debug-names \
  entry at offset 0 debug_info_offset 0 does not exists, \
  ignoring .debug_aranges.^M
...
which is a known problem filed as PR25969 - "Ignoring .debug_aranges with
clang .debug_names".

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list

gdb/ChangeLog:

2021-02-02  Tom de Vries  <tdevries@suse.de>

	PR symtab/27307
	* dwarf2/read.c (create_cus_from_debug_names_list): Add missing
	return.

gdb/testsuite/ChangeLog:

2021-02-02  Tom de Vries  <tdevries@suse.de>

	PR symtab/27307
	* gdb.dwarf2/clang-debug-names.exp: Check file command warnings.

---
 gdb/dwarf2/read.c                              |  1 +
 gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 0a00f89cf6d..872b4e7bcf2 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -5323,6 +5323,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per_bfd,
 	  = create_cu_from_index_list (per_bfd, &section, is_dwz, sect_off, 0);
 	per_bfd->all_comp_units.push_back (per_cu);
       }
+      return;
     }
 
   sect_offset sect_off_prev;
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
index 12134cf7f3e..5548b30e771 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
@@ -33,6 +33,22 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
+set test "no file command warnings"
+if { [regexp "warning: " $gdb_file_cmd_msg] } {
+    set kfail_re \
+	[concat \
+	     "warning: Section .debug_aranges in \[^\r\n\]* entry" \
+	     "at offset 0 debug_info_offset 0 does not exists," \
+	     "ignoring \\.debug_aranges\\."]
+    if { [regexp $kfail_re $gdb_file_cmd_msg] } {
+	kfail symtab/25969 $test
+    } else {
+	fail $test
+    }
+} else {
+    pass $test
+}
+
 set cmd "ptype main"
 set pass_re \
     [multi_line \

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list
  2021-02-02 11:35 [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list Tom de Vries
@ 2021-02-03 18:29 ` Simon Marchi via Gdb-patches
  2021-02-05  8:21   ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi via Gdb-patches @ 2021-02-03 18:29 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 2021-02-02 6:35 a.m., Tom de Vries wrote:
> Hi,
> 
> When running test-case gdb.dwarf2/clang-debug-names.exp, I run into the
> following warning:
> ...
> (gdb) file clang-debug-names^M
> Reading symbols from clang-debug-names...^M
> warning: Section .debug_aranges in clang-debug-names has duplicate \
>   debug_info_offset 0xc7, ignoring .debug_aranges.^M
> ...
> 
> This is caused by a missing return in commit 3ee6bb113af "[gdb/symtab] Fix
> incomplete CU list assert in .debug_names".
> 
> Fix this by adding the missing return, such that we have instead this warning:
> ...
> (gdb) file clang-debug-names^M
> Reading symbols from clang-debug-names...^M
> warning: Section .debug_aranges in clang-debug-names \
>   entry at offset 0 debug_info_offset 0 does not exists, \
>   ignoring .debug_aranges.^M
> ...
> which is a known problem filed as PR25969 - "Ignoring .debug_aranges with
> clang .debug_names".
> 
> Tested on x86_64-linux.
> 
> Any comments?
> 
> Thanks,
> - Tom
> 
> [gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list
> 
> gdb/ChangeLog:
> 
> 2021-02-02  Tom de Vries  <tdevries@suse.de>
> 
> 	PR symtab/27307
> 	* dwarf2/read.c (create_cus_from_debug_names_list): Add missing
> 	return.
> 
> gdb/testsuite/ChangeLog:
> 
> 2021-02-02  Tom de Vries  <tdevries@suse.de>
> 
> 	PR symtab/27307
> 	* gdb.dwarf2/clang-debug-names.exp: Check file command warnings.
> 
> ---
>  gdb/dwarf2/read.c                              |  1 +
>  gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index 0a00f89cf6d..872b4e7bcf2 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -5323,6 +5323,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per_bfd,
>  	  = create_cu_from_index_list (per_bfd, &section, is_dwz, sect_off, 0);
>  	per_bfd->all_comp_units.push_back (per_cu);
>        }
> +      return;
>      }

I don't know the specific details of this, but from a quick glance it
makes sense.  It seems like two methods of patsing the CU table, we
don't want to run through the two methods.  I noticed the indentation is
wrong in the code above, could you push a patch to fix that?

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list
  2021-02-03 18:29 ` Simon Marchi via Gdb-patches
@ 2021-02-05  8:21   ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2021-02-05  8:21 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 2/3/21 7:29 PM, Simon Marchi wrote:
> On 2021-02-02 6:35 a.m., Tom de Vries wrote:
>> Hi,
>>
>> When running test-case gdb.dwarf2/clang-debug-names.exp, I run into the
>> following warning:
>> ...
>> (gdb) file clang-debug-names^M
>> Reading symbols from clang-debug-names...^M
>> warning: Section .debug_aranges in clang-debug-names has duplicate \
>>   debug_info_offset 0xc7, ignoring .debug_aranges.^M
>> ...
>>
>> This is caused by a missing return in commit 3ee6bb113af "[gdb/symtab] Fix
>> incomplete CU list assert in .debug_names".
>>
>> Fix this by adding the missing return, such that we have instead this warning:
>> ...
>> (gdb) file clang-debug-names^M
>> Reading symbols from clang-debug-names...^M
>> warning: Section .debug_aranges in clang-debug-names \
>>   entry at offset 0 debug_info_offset 0 does not exists, \
>>   ignoring .debug_aranges.^M
>> ...
>> which is a known problem filed as PR25969 - "Ignoring .debug_aranges with
>> clang .debug_names".
>>
>> Tested on x86_64-linux.
>>
>> Any comments?
>>
>> Thanks,
>> - Tom
>>
>> [gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list
>>
>> gdb/ChangeLog:
>>
>> 2021-02-02  Tom de Vries  <tdevries@suse.de>
>>
>> 	PR symtab/27307
>> 	* dwarf2/read.c (create_cus_from_debug_names_list): Add missing
>> 	return.
>>
>> gdb/testsuite/ChangeLog:
>>
>> 2021-02-02  Tom de Vries  <tdevries@suse.de>
>>
>> 	PR symtab/27307
>> 	* gdb.dwarf2/clang-debug-names.exp: Check file command warnings.
>>
>> ---
>>  gdb/dwarf2/read.c                              |  1 +
>>  gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 16 ++++++++++++++++
>>  2 files changed, 17 insertions(+)
>>
>> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
>> index 0a00f89cf6d..872b4e7bcf2 100644
>> --- a/gdb/dwarf2/read.c
>> +++ b/gdb/dwarf2/read.c
>> @@ -5323,6 +5323,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per_bfd,
>>  	  = create_cu_from_index_list (per_bfd, &section, is_dwz, sect_off, 0);
>>  	per_bfd->all_comp_units.push_back (per_cu);
>>        }
>> +      return;
>>      }
> 
> I don't know the specific details of this, but from a quick glance it
> makes sense.  It seems like two methods of patsing the CU table, we
> don't want to run through the two methods.

Thanks for the review.

> I noticed the indentation is
> wrong in the code above, could you push a patch to fix that?

Done, and committed this one.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-05  8:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 11:35 [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list Tom de Vries
2021-02-03 18:29 ` Simon Marchi via Gdb-patches
2021-02-05  8:21   ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox