Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>,
	Tom de Vries <tdevries@suse.de>,
	gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH][gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE
Date: Mon, 25 Jan 2021 13:12:06 -0500	[thread overview]
Message-ID: <b36ce9f9-2d6e-76bd-7153-5422d9f44eb4@polymtl.ca> (raw)
In-Reply-To: <AM8PR10MB4708243CC2285BA56BE4B4FFE4BD0@AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM>



On 2021-01-25 12:42 p.m., Bernd Edlinger wrote:
> On 1/25/21 5:36 PM, Simon Marchi wrote:
>>> Yes, unfortunately I have not any experience with writing such assembly
>>> tests, but I am always impressed when one of you does it though :-)
>>>
>>> Nevertheless, the test case seems to be stable from gcc-4.8 .. gcc-11,
>>> that it fails without the patch and passes with the patch.
>>>
>>> So is it okay to push my partial symbols test as-is?
>>
>> My patch here adds a test that uses DW_FORM_sec_offset to point
>> to a .debug_rnglists (DWARF5) section.  Maybe that's sufficient,
>> but if not I could probably do a DWARF4 equivalent.
>>
>>   https://sourceware.org/pipermail/gdb-patches/2021-January/175229.html
>>
> 
> Yeah, the hardest part on a one-line change like this is always the test case.
> 
> So, I tried this patch on current trunk, but it fails:
> 
> Running /home/ed/gnu/gdb-build-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp ...
> ERROR: Couldn't load rnglists-multiple-cus-dw32 into GDB (GDB internal error).
> ERROR: Couldn't load rnglists-multiple-cus-dw64 into GDB (GDB internal error).
> Running /home/ed/gnu/gdb-build-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp ...
> FAIL: gdb.dwarf2/rnglists-sec-offset.exp: is_64=false: p/x &foo
> FAIL: gdb.dwarf2/rnglists-sec-offset.exp: is_64=true: p/x &foo
> 
> This probably means that your test tests more than this single-line change alone?

Hmm, with current master (so with Tom's patch merged),
gdb.dwarf2/rnglists-sec-offset.exp passes for me.

But gdb.dwarf2/rnglists-multiple-cus.exp is expected to fail if you don't
have the other patches in my series.
 
> I always thought that the partial symbols are replaced by the
> full symbols as soon as the first item from the CU is accessed, say "main".
> Can you explain how that can be?
> I was never able to get a reproducer for partial symbols with only one CU.

The bug fixed by this patch triggers as soon as you have a function
(DW_TAG_subprogram) with a DW_AT_ranges, I don't think it matters whether
there is one or more CUs.  But perhaps it's difficult to force the compiler
to emit a function with DW_AT_ranges (so, with a non-contiguous range) when
using a single CU.

Simon

  reply	other threads:[~2021-01-25 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 12:24 Tom de Vries
2021-01-25 12:52 ` Bernd Edlinger
2021-01-25 15:27   ` Simon Marchi via Gdb-patches
2021-01-25 15:37     ` Tom de Vries
2021-01-25 15:47       ` Bernd Edlinger
2021-01-25 16:36         ` Simon Marchi via Gdb-patches
2021-01-25 17:42           ` Bernd Edlinger
2021-01-25 18:12             ` Simon Marchi via Gdb-patches [this message]
2021-01-25 18:53               ` Bernd Edlinger
2021-01-25 19:20                 ` Bernd Edlinger
2021-01-26  1:52                 ` Simon Marchi via Gdb-patches
2021-01-26  7:47                   ` Bernd Edlinger

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=b36ce9f9-2d6e-76bd-7153-5422d9f44eb4@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=bernd.edlinger@hotmail.de \
    --cc=simon.marchi@polymtl.ca \
    --cc=tdevries@suse.de \
    --cc=tom@tromey.com \
    /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