* [unavailable values part 1, 00/17] introduction
@ 2011-02-07 14:26 Pedro Alves
2011-02-07 16:21 ` Tom Tromey
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Pedro Alves @ 2011-02-07 14:26 UTC (permalink / raw)
To: gdb-patches
In the context of tracepoints, I've been working on
adding support for partial/incomplete objects. That is, say, when
printing an array where only a few elements have been collected,
print what you can, and print something like "<unavailable>"
(like <optimized out>) for what has not been collected. E.g., with:
struct foo {
int a, b;
int array[10000];
void *ptr;
};
struct foo2 {
int d, ef;
struct foo foo;
};
struct foo2 foo2;
and a tracepoint that just collects "foo2.foo.array[0]",
when printing foo2 while inspecting the corresponding collected
traceframe, currently we get:
(gdb) p foo2
Cannot access memory at address 0x601080
This is GDB trying to read [&foo2, &foo2+sizeof foo2) for an lval_memory
value representing "foo2" and the read failing because required
memory is not "available" (it was not collected).
vs afterwards, after all the necessary changes, we'll get something like:
(gdb) p foo2
$1 = {d = <unavailable>, ef = <unavailable>, foo = {a = <unavailable>, b =
<unavailable>, array = {12345678,
<unavailable> <repeats 9999 times>}, ptr = <unavailable>}}
That is, we will still print what is available.
This requires marking chunks of a value's contents buffer as "unavailable"
at value read time, and, at value print time, check whether the value
contents chunk being printed is "available". The "unavailable"-ness of
the contents needs to be part of the struct value itself, given that when
printing a value from the value history, you still want to know what is
or isn't available, without consulting the target (which may not
exist anymore). The "unavailable"-ness of the contents is independent
of the backend lval_type (and implementation) behind a given
struct value, as it describes a "run-time"-ish property of the
value.
This series implements the base unavailable-value support, and
glues it with memory-based objects. Then, it fixes the printing
machinery to know how to print unavailable values in assorted
situations, and adds base tests.
Unavailable/uncollected function locals and arguments won't
be printing gracefully yet after this series, as
the glue between unavailable register / frame / values will
only come in a follow up series. After all that,
frame unwinding will also be taught to terminate gracefully
when not enough (stack/registers) data has been collected,
instead of printing errors, as currently.
I'd appreciate comments and extra eyeballs on all of this.
Pending objections, I'd like to commit this after a
reasonable wait.
I've regtested the series as a whole against current
mainline, and I saw no regressions.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [unavailable values part 1, 00/17] introduction
2011-02-07 14:26 [unavailable values part 1, 00/17] introduction Pedro Alves
@ 2011-02-07 16:21 ` Tom Tromey
2011-02-08 4:45 ` Joel Brobecker
2011-03-18 19:29 ` Pedro Alves
2 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2011-02-07 16:21 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> I'd appreciate comments and extra eyeballs on all of this.
Pedro> Pending objections, I'd like to commit this after a
Pedro> reasonable wait.
FWIW, I read through most of the patches. I sent email with comments
where I had some. I didn't really look at the gdbserver patches, since
I don't know anything about that code.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [unavailable values part 1, 00/17] introduction
2011-02-07 14:26 [unavailable values part 1, 00/17] introduction Pedro Alves
2011-02-07 16:21 ` Tom Tromey
@ 2011-02-08 4:45 ` Joel Brobecker
2011-02-14 11:50 ` Pedro Alves
2011-03-18 19:29 ` Pedro Alves
2 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2011-02-08 4:45 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
> I'd appreciate comments and extra eyeballs on all of this.
> Pending objections, I'd like to commit this after a
> reasonable wait.
I had a look as well, and the changes looked logical, well implemented,
and well documented.
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [unavailable values part 1, 00/17] introduction
2011-02-08 4:45 ` Joel Brobecker
@ 2011-02-14 11:50 ` Pedro Alves
0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2011-02-14 11:50 UTC (permalink / raw)
To: gdb-patches; +Cc: Joel Brobecker
On Monday 7 February 2011 16:21:35, Tom Tromey wrote:
> FWIW, I read through most of the patches. I sent email with comments
> where I had some. I didn't really look at the gdbserver patches, since
> I don't know anything about that code.
On Tuesday 8 February 2011 04:45:24, Joel Brobecker wrote:
> I had a look as well, and the changes looked logical, well implemented,
> and well documented.
Thanks guys! I've checked in the whole series now.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [unavailable values part 1, 00/17] introduction
2011-02-07 14:26 [unavailable values part 1, 00/17] introduction Pedro Alves
2011-02-07 16:21 ` Tom Tromey
2011-02-08 4:45 ` Joel Brobecker
@ 2011-03-18 19:29 ` Pedro Alves
2 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2011-03-18 19:29 UTC (permalink / raw)
To: gdb-patches
I've checked in this series.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-18 18:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-07 14:26 [unavailable values part 1, 00/17] introduction Pedro Alves
2011-02-07 16:21 ` Tom Tromey
2011-02-08 4:45 ` Joel Brobecker
2011-02-14 11:50 ` Pedro Alves
2011-03-18 19:29 ` Pedro Alves
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).