From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patchv3] Fix crash on optimized-out entry data values
Date: Mon, 14 Jul 2014 18:12:00 -0000 [thread overview]
Message-ID: <53C41B3D.3060508@redhat.com> (raw)
In-Reply-To: <20140711153757.GA452@host2.jankratochvil.net>
On 07/11/2014 04:37 PM, Jan Kratochvil wrote:
> On Wed, 09 Jul 2014 17:31:21 +0200, Jan Kratochvil wrote:
>> On Wed, 09 Jul 2014 13:52:00 +0200, Pedro Alves wrote:
>>> On 07/09/2014 11:33 AM, Jan Kratochvil wrote:
>>>> --- a/gdb/value.c
>>>> +++ b/gdb/value.c
>>>> @@ -198,12 +198,13 @@ struct value
>>>> unsigned int lazy : 1;
>>>>
>>>> /* If nonzero, this is the value of a variable that does not
>>>> - actually exist in the program. If nonzero, and LVAL is
>>>> + actually fully exist in the program. If nonzero, and LVAL is
>>>> lval_register, this is a register ($pc, $sp, etc., never a
>>>> program variable) that has not been saved in the frame. All
>>>> optimized-out values are treated pretty much the same, except
>>>> registers have a different string representation and related
>>>> - error strings. */
>>>> + error strings. It is true also for only partially optimized
>>>> + out variables - see the 'unavailable' field below. */
>>>> unsigned int optimized_out : 1;
>>>>
>>>> /* If value is a variable, is it initialized or not. */
>>>> @@ -334,7 +335,10 @@ struct value
>>>> valid if lazy is nonzero. */
>>>> gdb_byte *contents;
>>>>
>>>> - /* Unavailable ranges in CONTENTS. We mark unavailable ranges,
>>>> + /* If OPTIMIZED_OUT is false then UNAVAILABLE must be VEC_empty
>>>> + (not necessarily NULL).
>>>
>>> Hmm, why? We can collect only part of a non-optimized out value.
>>> What am I missing?
>>
>> I miss some documentation how these availability fields interact together.
>
> From a comment in mail
> Message-Id: <201102071427.55970.pedro@codesourcery.com>
> We give preference to printing <optimized out> rather
> than <unavailable>, since if a value had been optimized out
> at compile time, it can never be collected at run-time.
>
> it seems it is just reversed, that 'unavailable' can exist only for
> !optimized_out and it cannot exist for for optimized_out values.
Not really true either. A value can be partially optimized out.
And then when e.g., inspecting a traceframe or a partial core dump,
the bits that are not optimized out may well not have been
collected, so those will be unavailable. I'm sending you a different
patch in a bit.
--
Pedro Alves
next prev parent reply other threads:[~2014-07-14 18:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 10:33 [patchv2] " Jan Kratochvil
2014-07-09 11:52 ` Pedro Alves
2014-07-09 15:31 ` Jan Kratochvil
2014-07-11 16:07 ` [patchv3] " Jan Kratochvil
2014-07-14 7:02 ` Yao Qi
2014-07-14 8:32 ` Jan Kratochvil
2014-07-14 18:12 ` Pedro Alves [this message]
2014-07-14 18:47 ` [PATCH] Handle partially optimized out values similarly to unavailable values (Re: [patchv2] Fix crash on optimized-out entry data values) Pedro Alves
2014-07-17 8:04 ` Jan Kratochvil
2014-07-17 8:35 ` Jan Kratochvil
2014-07-17 13:38 ` Pedro Alves
2014-07-20 15:33 ` [read_frame_arg patch] " Jan Kratochvil
2014-07-22 19:33 ` Pedro Alves
2014-07-22 20:21 ` [commit+7.8] [read_frame_arg patch] Handle partially optimized out values similarly to unavailable values Jan Kratochvil
2014-08-05 17:16 ` Doug Evans
2014-08-14 18:25 ` Jan Kratochvil
2014-07-23 14:26 ` [commit] Remove setting value address for reference entry value target data value Jan Kratochvil
2014-07-24 12:51 ` [PATCH v2] Handle partially optimized out values similarly to unavailable values Pedro Alves
2014-08-15 20:13 ` Jan Kratochvil
2014-08-19 23:36 ` Pedro Alves
2014-08-20 0:55 ` Andrew Pinski
2014-08-20 9:46 ` Pedro Alves
2014-08-20 10:32 ` [PUSHED] value.c (value_contents_bits_eq): Initialize l,h for gcc, -Wall. (was: Re: [PATCH v2] Handle partially optimized out values similarly to unavailable values) Pedro Alves
2014-08-20 16:28 ` Andrew Pinski
2014-08-21 19:57 ` Regression for i686 gdb.dwarf2/pieces-optimized-out.exp [Re: [PATCH v2] Handle partially optimized out values similarly to unavailable values] Jan Kratochvil
2014-08-22 16:20 ` Pedro Alves
2014-08-24 19:56 ` Jan Kratochvil
2014-09-04 11:36 ` [pushed] " Pedro Alves
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=53C41B3D.3060508@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).