summaryrefslogtreecommitdiff
path: root/gdb/m2-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-05-18 15:29:13 +0000
committerTom Tromey <tromey@redhat.com>2012-05-18 15:29:13 +0000
commitb012acddd87cb89dc4b357adf458511232c58bfe (patch)
tree53fe717d585832ab24bd2e2ec7c786f914d2a86f /gdb/m2-valprint.c
parent1d51a733d5f20fe7ad6e89103f50742da2991586 (diff)
downloadbinutils-gdb-b012acddd87cb89dc4b357adf458511232c58bfe.tar.gz
* valprint.c (val_print_string): Don't print leading space.
* p-valprint.c (pascal_val_print) <TYPE_CODE_PTR>: Optionally print space before string or vtbl. * m2-valprint.c (print_unpacked_pointer): Optionally print space before string. * jv-valprint.c (java_value_print): Print space before string. * go-valprint.c (print_go_string): Print space before string. * f-valprint.c (f_val_print) <TYPE_CODE_PTR>: Optionally print space before string. * c-valprint.c (c_val_print) <TYPE_CODE_PTR>: Optionally print space before string or vtbl. * auxv.c (fprint_target_auxv): Print space after address.
Diffstat (limited to 'gdb/m2-valprint.c')
-rw-r--r--gdb/m2-valprint.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
index 015af3b0aa4..ea3f296c308 100644
--- a/gdb/m2-valprint.c
+++ b/gdb/m2-valprint.c
@@ -195,6 +195,7 @@ print_unpacked_pointer (struct type *type,
{
struct gdbarch *gdbarch = get_type_arch (type);
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ int want_space = 0;
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
@@ -205,7 +206,10 @@ print_unpacked_pointer (struct type *type,
}
if (options->addressprint && options->format != 's')
- fputs_filtered (paddress (gdbarch, address), stream);
+ {
+ fputs_filtered (paddress (gdbarch, address), stream);
+ want_space = 1;
+ }
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
@@ -214,8 +218,12 @@ print_unpacked_pointer (struct type *type,
&& TYPE_CODE (elttype) == TYPE_CODE_INT
&& (options->format == 0 || options->format == 's')
&& addr != 0)
- return val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
- stream, options);
+ {
+ if (want_space)
+ fputs_filtered (" ", stream);
+ return val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
+ stream, options);
+ }
return 0;
}