Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Luis Machado <luis.machado@arm.com>, Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] [gdb] Fix "value is not available" with debug frame
Date: Mon, 4 Mar 2024 16:59:39 +0100	[thread overview]
Message-ID: <256c19eb-c3ac-4930-a479-0820a2a59a23@suse.de> (raw)
In-Reply-To: <1debdf44-22b2-45b9-bba1-68baa3a90adf@arm.com>

On 3/4/24 16:25, Luis Machado wrote:
> On 2/18/24 13:30, Tom de Vries wrote:
>> On 2/18/24 05:09, Kevin Buettner wrote:
>>> Hi Tom,
>>>
>>> On Tue, 13 Feb 2024 18:17:18 +0100
>>> Tom de Vries <tdevries@suse.de> wrote:
>>>
>>>> On arm-linux, with a started hello world, running "info frame" works fine, but
>>>> when I set debug frame to on, I run into:
>>>> ...
>>>> (gdb) info frame
>>>>     ...
>>>> [frame] frame_unwind_register_value: exit
>>>> value is not available
>>>> (gdb)
>>>> ...
>>>>
>>>> The problem is here in frame_unwind_register_value:
>>>> ...
>>>>             if (value->lazy ())
>>>>               gdb_printf (&debug_file, " lazy");
>>>>             else
>>>>               {
>>>>                 int i;
>>>>                 gdb::array_view<const gdb_byte> buf = value->contents ();
>>>> ...
>>>> where we call value->contents () while !value->entirely_available ().
>>>>
>>>> Fix this by checking value->entirely_available () and printing:
>>>> ...
>>>>       [frame] frame_unwind_register_value:   -> register=91 unavailable
>>>> ...
>>>>
>>>> Tested on arm-linux.
>>>
>>> The fix looks good to me.
>>>
>>> I'm wondering about the test case though.  Is it the case that the
>>> failure depends on debug info from a particular compiler (or compiler
>>> version)?  If so, would it be possible to devise a test using the
>>> DWARF assembler which would not be dependent on compiler output that
>>> may change over time?
>>>
>>
>> Hi Kevin,
>>
>> thanks for the review.
>>
>> This doesn't depend on debug info.  The test-case depends on a register being unavailable.  I don't know if or how we can reliably enforce this condition in a test-case.
>>
>> To give some more detail, a minimal way to show the register as unavailable is:
>> ...
>> $ gcc hello.c
>> $ gdb -q -batch a.out -ex start -ex 'p $tpidruro'
>> Temporary breakpoint 1 at 0x512
>>
>> Temporary breakpoint 1, 0xaaaaa512 in main ()
>> $1 = <unavailable>
>> ...
>>
>> I'm not sure why it's unavailable.
>>
>> It seems the register was added as part of some tls support for fbsd arm tdep.  It could be that support for the register is missing in linux arm tdep.
>>
>> It also could be a kernel problem (used kernel is 4.4.190).
>>
>> Or, something to do with the fact that I'm running a pinebook with 64-bit kernel, 32-bit userland setup.
>>
>> Luis, any comments on this?  Is this a bug, or a missing feature, or expected behaviour?
>>
>> Thanks,
>> - Tom
>>
>>> Kevin
>>>
>>
> 
> Hi Tom,
> 
> I was out on time off. It looks like Thiago addressed this in a separate thread, is that right?

Hi Luis,

welcome back :)

Thiago addressed removing the "<unavailable>" register.

I took the opportunity of having an "<unavailable>" register available 
to improve gdb behaviour in presence of such a register.

This patch is an example of that, as well as 
https://sourceware.org/pipermail/gdb-patches/2024-March/206965.html .

Thanks,
- Tom



      reply	other threads:[~2024-03-04 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 17:17 Tom de Vries
2024-02-18  4:09 ` Kevin Buettner
2024-02-18 13:30   ` Tom de Vries
2024-02-26 14:34     ` Tom de Vries
2024-02-26 22:34     ` Thiago Jung Bauermann
2024-02-26 22:41       ` Simon Marchi
2024-02-27 16:19         ` Tom de Vries
2024-03-04 15:25     ` Luis Machado
2024-03-04 15:59       ` Tom de Vries [this message]

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=256c19eb-c3ac-4930-a479-0820a2a59a23@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=luis.machado@arm.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