[prev in list] [next in list] [prev in thread] [next in thread]
List: gdb-bugs
Subject: gdb/valprint.c:common_val_print
From: "Morten Welinder" <mwelinder () gmail ! com>
Date: 2007-09-08 0:19:14
Message-ID: 118833cc0709071719m188f2da6if71a8dfd49835af2 () mail ! gmail ! com
[Download RAW message or body]
Hi,
I am working on extending gdb's printing capabilities and I have noticed that
sometimes the "valaddr" (+embedded_offset) and "address" arguments to
val_print get out of sync.
To me it looks like common_val_print should add value_offset(val) to the
result of VALUE_ADDRESS, but I could be wrong.
The call in question is the second call print_pair below. The value type
in question is std::pair<int,std::string> in case it matters. value_offset is
20 for me; value_embedded_offset is (from memory) zero.
I have been working with gdb 6.5 (on i386), but common_val_print appears
unchanged in 6.6.
Morten
static void
print_pair (struct ui_file *stream, struct value *v,
int format, int deref_ref, int recurse, enum val_prettyprint pretty)
{
fputs_filtered ("<", stream);
common_val_print (value_struct_elt (&v, NULL, "first", NULL, NULL),
stream, format, deref_ref, recurse, pretty);
fputs_filtered (",", stream);
common_val_print (value_struct_elt (&v, NULL, "second", NULL, NULL),
stream, format, deref_ref, recurse, pretty);
fputs_filtered (">", stream);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic