From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: optimized-out pieces
Date: Wed, 09 Jun 2010 18:44:00 -0000 [thread overview]
Message-ID: <20100609184356.GA23679@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <m3iq5tjqsj.fsf@fleche.redhat.com>
> +static int
> +check_pieced_value_validity (const struct value *value, int bit_offset,
> + int bit_length)
> +{
> + struct piece_closure *c
> + = (struct piece_closure *) value_computed_closure (value);
> + int i;
> +
> + bit_offset += 8 * value_offset (value);
I miss some `value_bitpos (value)' possibility here.
> + for (i = 0; i < c->n_pieces && bit_length > 0; i++)
> + {
> + struct dwarf_expr_piece *p = &c->pieces[i];
> + size_t this_size_bits = p->size;
> +
> + if (bit_offset > 0)
> + {
> + if (bit_offset >= this_size_bits)
> + {
> + bit_offset -= this_size_bits;
> + continue;
> + }
> +
> + bit_length -= bit_offset;
Here should be `bit_length -= this_size_bits - bit_offset'.
If we heve:
this_size_bits = 8
bit_offset = 7
bit_length = 2
then your code does
bit_length -= 7; bit_length = -5;
while for the next piece it should be:
bit_length -= 1; bit_length = 1;
> + bit_offset = 0;
> + }
> + else
> + bit_length -= this_size_bits;
> +
> + if (p->location == DWARF_VALUE_OPTIMIZED_OUT)
> + return 0;
> + }
> +
> + return 1;
> +}
Thanks,
Jan
next prev parent reply other threads:[~2010-06-09 18:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 19:19 Tom Tromey
2010-06-04 21:42 ` Tom Tromey
2010-06-07 22:35 ` Jan Kratochvil
2010-06-08 18:36 ` Tom Tromey
2010-06-08 18:42 ` Jan Kratochvil
2010-06-08 18:57 ` Tom Tromey
2010-06-09 5:50 ` Jan Kratochvil
2010-06-10 17:14 ` Tom Tromey
2010-06-11 15:34 ` Tom Tromey
2010-06-14 12:07 ` Frederic Riss
2010-06-15 15:54 ` Tom Tromey
2010-06-09 18:44 ` Jan Kratochvil [this message]
2010-06-14 12:13 ` [commit] Fix "return" command (Re: RFC: optimized-out pieces) Ulrich Weigand
2010-06-15 15:58 ` Tom Tromey
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=20100609184356.GA23679@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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