This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python] refactor pretty-printing, again
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> I wonder if printing the reference (and the address of string)
Paul> should be controlled by a separate 'print reftype on/off',
Paul> 'print arrayaddr on/off', or some such?
I'm just going to nuke references using the appended.
This isn't maximally efficient but I don't think it matters much.
I'm not sure what to do about string addresses.
We could be horrible and strip them in the std::string printer :-)
Tom
2008-11-12 Tom Tromey <tromey@redhat.com>
* valprint.c (value_print): Call apply_val_pretty_printer.
diff --git a/gdb/valprint.c b/gdb/valprint.c
index c580f39..37e5efc 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -326,6 +326,18 @@ value_print (struct value *val, struct ui_file *stream, int format,
return 0;
raw_printing = raw;
+ if (!raw)
+ {
+ int r = apply_val_pretty_printer (value_type (val),
+ value_contents_all (val),
+ value_embedded_offset (val),
+ value_address (val),
+ stream, format, 1, 0, pretty,
+ current_language);
+ if (r)
+ return r;
+ }
+
return LA_VALUE_PRINT (val, stream, format, pretty);
}