mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 18:10:46 +00:00
* 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.
This commit is contained in:
@@ -310,6 +310,8 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
}
|
||||
else
|
||||
{
|
||||
int want_space = 0;
|
||||
|
||||
addr = unpack_pointer (type, valaddr + embedded_offset);
|
||||
elttype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
@@ -321,7 +323,10 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
}
|
||||
|
||||
if (options->addressprint && options->format != 's')
|
||||
fputs_filtered (paddress (gdbarch, addr), stream);
|
||||
{
|
||||
fputs_filtered (paddress (gdbarch, addr), stream);
|
||||
want_space = 1;
|
||||
}
|
||||
|
||||
/* For a pointer to char or unsigned char, also print the string
|
||||
pointed to, unless pointer is null. */
|
||||
@@ -329,8 +334,12 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
&& TYPE_CODE (elttype) == TYPE_CODE_INT
|
||||
&& (options->format == 0 || options->format == 's')
|
||||
&& addr != 0)
|
||||
i = val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
|
||||
stream, options);
|
||||
{
|
||||
if (want_space)
|
||||
fputs_filtered (" ", stream);
|
||||
i = val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1,
|
||||
stream, options);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user