public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] [gdb/symtab] Fix some issues with macro complaints
@ 2024-06-26 18:50 Tom de Vries
  2024-06-26 18:50 ` [PATCH 1/3] [gdb/symtab] Emit malformed macro definition complaint once Tom de Vries
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tom de Vries @ 2024-06-26 18:50 UTC (permalink / raw)
  To: gdb-patches

With a minimal test-case test.c:
...
int main (void) { return 0; }
...
compiled like this:
...
$ gcc test.c -g3 -gdwarf-5
...
I get:
...
$ gdb -q -batch -iex "set complaints 100" a.out -ex "p main"
During symbol reading: debug info gives source 2 included from file at zero line 0
During symbol reading: debug info gives command-line macro definition with non-zero line 19: _STDC_PREDEF_H 1
During symbol reading: debug info gives command-line macro definition with non-zero line 38: __STDC_IEC_559__ 1
During symbol reading: debug info gives command-line macro definition with non-zero line 39: __STDC_IEC_60559_BFP__ 201404L
During symbol reading: debug info gives command-line macro definition with non-zero line 48: __STDC_IEC_559_COMPLEX__ 1
During symbol reading: debug info gives command-line macro definition with non-zero line 49: __STDC_IEC_60559_COMPLEX__ 201404L
During symbol reading: debug info gives command-line macro definition with non-zero line 62: __STDC_ISO_10646__ 201706L
$1 = {int (void)} 0x4101ac <main>
...

These complaints seemed unnecessary to me, so I wrote some patches to get rid of
these.

There are three patches in the series:
- [gdb/symtab] Emit malformed macro definition complaint once
- [gdb/symtab] Fix incorrect complaint for imported definition
- [gdb/symtab] Don't complain about stdc-predef.h include

The first patch introduces a dwarf assembly test-case testing a fair amount
of complaints for the .debug_macro section.

That also happens to trigger a duplicate complaint, so a fix for that is
included.

The last two patches get rid of the complaints shown above.

Tom de Vries (3):
  [gdb/symtab] Emit malformed macro definition complaint once
  [gdb/symtab] Fix incorrect complaint for imported definition
  [gdb/symtab] Don't complain about stdc-predef.h include

 gdb/dwarf2/macro.c                            |  42 ++--
 gdb/testsuite/gdb.dwarf2/macro-complaints.exp | 213 ++++++++++++++++++
 gdb/testsuite/lib/dwarf.exp                   |  12 +-
 3 files changed, 250 insertions(+), 17 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/macro-complaints.exp


base-commit: cbccccfdf19a388abb10579aea42c8b35c25c933
-- 
2.35.3


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

end of thread, other threads:[~2024-07-02 22:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 18:50 [PATCH 0/3] [gdb/symtab] Fix some issues with macro complaints Tom de Vries
2024-06-26 18:50 ` [PATCH 1/3] [gdb/symtab] Emit malformed macro definition complaint once Tom de Vries
2024-07-02 22:03   ` Alexandra Petlanova Hajkova
2024-06-26 18:50 ` [PATCH 2/3] [gdb/symtab] Fix incorrect complaint for imported definition Tom de Vries
2024-06-26 18:50 ` [PATCH 3/3] [gdb/symtab] Don't complain about stdc-predef.h include Tom de Vries

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).