public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26644] New: `info variables` does not show ones defined with macro
@ 2020-09-22 10:21 hi-angel at yandex dot ru
  2020-09-22 10:22 ` [Bug gdb/26644] `info variables` does not show ones defined with #define hi-angel at yandex dot ru
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hi-angel at yandex dot ru @ 2020-09-22 10:21 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26644
           Summary: `info variables` does not show ones defined with macro
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: hi-angel at yandex dot ru
  Target Milestone: ---

Currently `info variables` command does not print ones declared with `#define`.
I mean, it kinda makes sense if you take the meaning of "variable" as of a
mutable identifier. However this is not the meaning gdb uses because the
command prints enum fields just fine, which are not mutable either. So this is
a bug.

# Steps to reproduce (in terms of terminal commands)

    $ cat test2.c
    #define MY_MACRO 7

    int main() {}
    $ gcc test2.c -o a -g3 -O0
    $ gdb ./a
    Reading symbols from ./a...
    gdb λ br main
    Breakpoint 1 at 0x1122: file test2.c, line 3.
    gdb λ r
    Starting program: /tmp/a

    Breakpoint 1, main () at test2.c:3
    3       int main() {}
    gdb λ p MY_MACRO
    $1 = 7
    gdb λ info variables MY_MACRO
    All variables matching regular expression "MY_MACRO":
    gdb λ

## Expected

`info variables` would print `#define MY_MACRO 7`

## Actual

`info variables` did not print anything about MY_MACRO.

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

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

end of thread, other threads:[~2020-09-24 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 10:21 [Bug gdb/26644] New: `info variables` does not show ones defined with macro hi-angel at yandex dot ru
2020-09-22 10:22 ` [Bug gdb/26644] `info variables` does not show ones defined with #define hi-angel at yandex dot ru
2020-09-23 19:51 ` tromey at sourceware dot org
2020-09-23 21:32 ` hi-angel at yandex dot ru
2020-09-24 12:35 ` tromey 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).