This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Add Guile frame unwinder interface
- From: Pedro Alves <palves at redhat dot com>
- To: Andy Wingo <wingo at igalia dot com>
- Cc: gdb-patches at sourceware dot org, asmundak at google dot com
- Date: Tue, 10 Mar 2015 15:45:17 +0000
- Subject: Re: [PATCH v2] Add Guile frame unwinder interface
- Authentication-results: sourceware.org; auth=none
- References: <87oao7wi66 dot fsf at igalia dot com> <87zj7msbly dot fsf at igalia dot com> <54FDBF21 dot 4090400 at redhat dot com> <87pp8iq9wc dot fsf at igalia dot com>
On 03/09/2015 06:54 PM, Andy Wingo wrote:
> Hi,
>
> On Mon 09 Mar 2015 16:41, Pedro Alves <palves@redhat.com> writes:
>
>> On 03/09/2015 10:34 AM, Andy Wingo wrote:
>>> +@var{register} names a register, and should be a string, for example
>>> +@samp{rip}. @var{value} is the register value, as a @value{GDBN}
>>> +value. Alternately, passing @code{#f} as the value will mark the
>>> +register as unavailable.
>>
>> From a glimpse over the code, I think this actually marks it as
>> "<not saved>" (optimized out), right? That would be the correct
>> thing to do. Marking a register as "<unavailable>" is also possible,
>> but it is a different thing -- it means the value exists, but gdb
>> couln't get to it, because e.g., the core file is trimmed, or the
>> ptrace interface is missing access to some registers.
>>
>> That said, you may want to consider how you'd expand the API
>> to allow marking registers as unavailable.
>
> I didn't realize that "unavailable" and "not saved" were different
> things, thanks for the pointer. I guess given that the default is a
> "not saved" result, I can just document this default state, and that
> ephemeral-frame-add-saved-value! adds a value. We remove the #f case.
I wonder whether that's the best default though. That forces the
unwinder to always handle all registers, even random i/o registers, etc
the machine may happen to have/expose? An alternative would be
assume the register is found unmodified in this_frame. You'd need
a ephemeral-frame-mark-not-saved! then, of course.
>
> If we need to support other states like "unavailable", we can add other
> API like ephemeral-frame-mark-unavailable! or similar.
Yeah. Note that GDB can mark _parts_ of registers not saved
or unavailable, down to the bit level (mark_value_bits_optimized_out /
mark_value_bits_unavailable).
Thanks,
Pedro Alves