summaryrefslogtreecommitdiff
path: root/gdb/c-typeprint.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-07-26 17:29:05 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-07-28 09:38:32 +0100
commit77791f9c21ec05423db6724a3be543f2cb6e5822 (patch)
tree8a107efc10f07f11b0360e600d91fada075cce93 /gdb/c-typeprint.c
parentad14ab00eb89cccd32815ee7ebb6104aa7db040f (diff)
downloadbinutils-gdb-77791f9c21ec05423db6724a3be543f2cb6e5822.tar.gz
gdb: fix missing space in some info variables output
Fixes PR gdb/28121. When a user declares an array like this: int * const foo_1[3]; And in GDB the user does this: (gdb) info variables foo All variables matching regular expression "foo": File test.c: 1: int * constfoo_1[3]; Notice the missing space between 'const' and 'foo_1'. This is fixed in c_type_print_varspec_prefix (c-typeprint.c) by passing through the flag that indicates if a trailing space is needed, rather than hard coding the flag to false as we currently do. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28121
Diffstat (limited to 'gdb/c-typeprint.c')
-rw-r--r--gdb/c-typeprint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 0502d31eff9..741541749b3 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -436,8 +436,8 @@ c_type_print_varspec_prefix (struct type *type,
case TYPE_CODE_ARRAY:
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
- stream, show, 0, 0, language, flags,
- podata);
+ stream, show, 0, need_post_space,
+ language, flags, podata);
if (passed_a_ptr)
fprintf_filtered (stream, "(");
break;