public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
@ 2021-07-22 13:19 swbz at conicmail dot com
  2021-07-25 14:33 ` [Bug gdb/28121] " ssbssa at sourceware dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: swbz at conicmail dot com @ 2021-07-22 13:19 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

            Bug ID: 28121
           Summary: `info variables` for `int * const x[]` gives `int *
                    constx[1]` (no space between `const` and name)
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: swbz at conicmail dot com
  Target Milestone: ---

Steps to Reproduce:
1) C declaration: `int * const x[];`
2) Compile, run with GDB and execute GDB command `info variables`


Actual Results: `int * constx[1];` (no space between `const` and name `x`)

Expected Results: `int * const x[1];` (space between `const` and name `x`)

Environment:
* Linux 5.8.0-63-generic #71~20.04.1-Ubuntu SMP Thu Jul 15 17:46:08 UTC 2021
x86_64 x86_64 x86_64 GNU/Linux
* Both: gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) and clang version
10.0.0-4ubuntu1
* GNU gdb (GDB) 12.0.50.20210722-git

Additional Info:

Seems to be some combination of the `const` appearing after the `*` and the
fact that this is an array. The following all output as expected:

* `int * const x;`
* `int * x[];`
* `int const x[];`

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/28121] `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
  2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
@ 2021-07-25 14:33 ` ssbssa at sourceware dot org
  2021-07-26 16:36 ` andrew.burgess at embecosm dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ssbssa at sourceware dot org @ 2021-07-25 14:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/28121] `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
  2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
  2021-07-25 14:33 ` [Bug gdb/28121] " ssbssa at sourceware dot org
@ 2021-07-26 16:36 ` andrew.burgess at embecosm dot com
  2021-07-26 17:03 ` andrew.burgess at embecosm dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: andrew.burgess at embecosm dot com @ 2021-07-26 16:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

Andrew Burgess <andrew.burgess at embecosm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.burgess at embecosm dot com

--- Comment #1 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
Created attachment 13569
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13569&action=edit
Possible fix.

Still in testing here, but if it passes I'll post this to the m/l.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/28121] `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
  2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
  2021-07-25 14:33 ` [Bug gdb/28121] " ssbssa at sourceware dot org
  2021-07-26 16:36 ` andrew.burgess at embecosm dot com
@ 2021-07-26 17:03 ` andrew.burgess at embecosm dot com
  2021-07-28  9:21 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: andrew.burgess at embecosm dot com @ 2021-07-26 17:03 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

--- Comment #2 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
https://sourceware.org/pipermail/gdb-patches/2021-July/181133.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/28121] `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
  2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
                   ` (2 preceding siblings ...)
  2021-07-26 17:03 ` andrew.burgess at embecosm dot com
@ 2021-07-28  9:21 ` cvs-commit at gcc dot gnu.org
  2021-07-28  9:22 ` andrew.burgess at embecosm dot com
  2023-12-31 15:26 ` ssbssa at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28  9:21 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Burgess <aburgess@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=77791f9c21ec05423db6724a3be543f2cb6e5822

commit 77791f9c21ec05423db6724a3be543f2cb6e5822
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Mon Jul 26 17:29:05 2021 +0100

    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

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/28121] `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
  2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
                   ` (3 preceding siblings ...)
  2021-07-28  9:21 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28  9:22 ` andrew.burgess at embecosm dot com
  2023-12-31 15:26 ` ssbssa at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: andrew.burgess at embecosm dot com @ 2021-07-28  9:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

Andrew Burgess <andrew.burgess at embecosm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
I believe this issue should now be fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug gdb/28121] `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name)
  2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
                   ` (4 preceding siblings ...)
  2021-07-28  9:22 ` andrew.burgess at embecosm dot com
@ 2023-12-31 15:26 ` ssbssa at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: ssbssa at sourceware dot org @ 2023-12-31 15:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28121

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eager at eagercon dot com

--- Comment #5 from Hannes Domani <ssbssa at sourceware dot org> ---
*** Bug 14696 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-31 15:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 13:19 [Bug gdb/28121] New: `info variables` for `int * const x[]` gives `int * constx[1]` (no space between `const` and name) swbz at conicmail dot com
2021-07-25 14:33 ` [Bug gdb/28121] " ssbssa at sourceware dot org
2021-07-26 16:36 ` andrew.burgess at embecosm dot com
2021-07-26 17:03 ` andrew.burgess at embecosm dot com
2021-07-28  9:21 ` cvs-commit at gcc dot gnu.org
2021-07-28  9:22 ` andrew.burgess at embecosm dot com
2023-12-31 15:26 ` ssbssa at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).