diff options
author | Tom Tromey <tromey@redhat.com> | 2012-05-18 15:29:13 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-05-18 15:29:13 +0000 |
commit | b012acddd87cb89dc4b357adf458511232c58bfe (patch) | |
tree | 53fe717d585832ab24bd2e2ec7c786f914d2a86f /gdb/p-valprint.c | |
parent | 1d51a733d5f20fe7ad6e89103f50742da2991586 (diff) | |
download | gdb-b012acddd87cb89dc4b357adf458511232c58bfe.zip gdb-b012acddd87cb89dc4b357adf458511232c58bfe.tar.gz gdb-b012acddd87cb89dc4b357adf458511232c58bfe.tar.bz2 |
* 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/p-valprint.c')
-rw-r--r-- | gdb/p-valprint.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 0a32a22..be28f93 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -74,6 +74,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, struct type *char_type; LONGEST val; CORE_ADDR addr; + int want_space = 0; CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) @@ -176,6 +177,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, if (options->addressprint && options->format != 's') { fputs_filtered (paddress (gdbarch, addr), stream); + want_space = 1; } /* For a pointer to char or unsigned char, also print the string @@ -188,6 +190,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, && (options->format == 0 || options->format == 's') && addr != 0) { + if (want_space) + fputs_filtered (" ", stream); /* No wide string yet. */ i = val_print_string (elttype, NULL, addr, -1, stream, options); } @@ -203,6 +207,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, ULONGEST string_length; void *buffer; + if (want_space) + fputs_filtered (" ", stream); buffer = xmalloc (length_size); read_memory (addr + length_pos, buffer, length_size); string_length = extract_unsigned_integer (buffer, length_size, @@ -223,9 +229,12 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, if ((msymbol != NULL) && (vt_address == SYMBOL_VALUE_ADDRESS (msymbol))) { - fputs_filtered (" <", stream); + if (want_space) + fputs_filtered (" ", stream); + fputs_filtered ("<", stream); fputs_filtered (SYMBOL_PRINT_NAME (msymbol), stream); fputs_filtered (">", stream); + want_space = 1; } if (vt_address && options->vtblprint) { @@ -235,6 +244,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, struct block *block = (struct block *) NULL; int is_this_fld; + if (want_space) + fputs_filtered (" ", stream); + if (msymbol != NULL) wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block, VAR_DOMAIN, &is_this_fld); |