From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/3] [gdb/symtab] Fix some issues with macro complaints
Date: Wed, 26 Jun 2024 20:50:18 +0200 [thread overview]
Message-ID: <20240626185021.12421-1-tdevries@suse.de> (raw)
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
next reply other threads:[~2024-06-26 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 18:50 Tom de Vries [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240626185021.12421-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).