summaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-05-18 15:29:11 +0000
committerTom Tromey <tromey@redhat.com>2012-05-18 15:29:11 +0000
commit6d07a30f94f9dbc34aab6fcbb4f8895ef019249b (patch)
treedf74382e62c7349ce231b2559ee01d886fbe5b52 /gdb/p-valprint.c
parent266ba1ac775fcc840534050597328fdac996677b (diff)
downloadgdb-6d07a30f94f9dbc34aab6fcbb4f8895ef019249b.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/p-valprint.c')
-rw-r--r--gdb/p-valprint.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 0a32a22b607..be28f938d1b 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);