public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug macros/29063] New: Handle macinfo section and tags
@ 2022-04-13 17:40 blarsen at redhat dot com
  2022-04-13 21:56 ` [Bug macros/29063] " simon.marchi at polymtl dot ca
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: blarsen at redhat dot com @ 2022-04-13 17:40 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29063
           Summary: Handle macinfo section and tags
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: macros
          Assignee: unassigned at sourceware dot org
          Reporter: blarsen at redhat dot com
  Target Milestone: ---

The DWARF4 spec defined the .debug_macinfo section, which was replaced by the
.debug_macro section by DWARF5, and a series of tags, such as:

* DW_MACINFO_define
* DW_MACINFO_undef
* DW_MACINFO_start_file
* DW_MACINFO_end_file
* DW_MACINFO_vendor_ext

and none of these are handled by GDB. The biggest problem with this is that
clang, by default, uses these DWARF4 style for macro debug information.

As an example to see the problem, trying gdb.base/macscp.exp using
RUNTESTFLAGS="CC_FOR_TARGET=clang" will show that GDB can't deal with the
macros there, and complaints are very unhelpful.

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

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

* [Bug macros/29063] Handle macinfo section and tags
  2022-04-13 17:40 [Bug macros/29063] New: Handle macinfo section and tags blarsen at redhat dot com
@ 2022-04-13 21:56 ` simon.marchi at polymtl dot ca
  2022-04-18 13:37 ` tromey at sourceware dot org
  2022-04-18 19:17 ` blarsen at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: simon.marchi at polymtl dot ca @ 2022-04-13 21:56 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at polymtl dot ca

--- Comment #1 from Simon Marchi <simon.marchi at polymtl dot ca> ---
GDB does handle them, it's just that the DW_MACINFO_* defines happen to have
the same value has the DW_MACRO_* ones, and GDB only lists the DW_MACRO_* ones
in its switch-cases.

Which version of clang are you using?  And which linker/version are you using? 
The linker version affects the generation of the line header table, which is
used by GDB to create macro_source_file, so the linker has an influence here.

With clang 13 and ld 2.34 (which clang uses by default on my Ubuntu 20.04), I
get:

$ make check TESTS="gdb.base/macscp.exp" RUNTESTFLAGS="CC_FOR_TARGET=clang-13"
...
FAIL: gdb.base/macscp.exp: info macro FROM_COMMANDLINE

                === gdb Summary ===

# of expected passes            319
# of unexpected failures        1
# of known failures             19

The failure is due to this:

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

If you see more failures, there must be something else.  I'd be curious to
know, because I'm currently working on fixing macro printing for various cases
of binaries compiled with both gcc and clang.

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

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

* [Bug macros/29063] Handle macinfo section and tags
  2022-04-13 17:40 [Bug macros/29063] New: Handle macinfo section and tags blarsen at redhat dot com
  2022-04-13 21:56 ` [Bug macros/29063] " simon.marchi at polymtl dot ca
@ 2022-04-18 13:37 ` tromey at sourceware dot org
  2022-04-18 19:17 ` blarsen at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2022-04-18 13:37 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Simon Marchi from comment #1)
> GDB does handle them, it's just that the DW_MACINFO_* defines happen to have
> the same value has the DW_MACRO_* ones, and GDB only lists the DW_MACRO_*
> ones in its switch-cases.

Maybe static asserts to this effect would make the code more clear.

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

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

* [Bug macros/29063] Handle macinfo section and tags
  2022-04-13 17:40 [Bug macros/29063] New: Handle macinfo section and tags blarsen at redhat dot com
  2022-04-13 21:56 ` [Bug macros/29063] " simon.marchi at polymtl dot ca
  2022-04-18 13:37 ` tromey at sourceware dot org
@ 2022-04-18 19:17 ` blarsen at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: blarsen at redhat dot com @ 2022-04-18 19:17 UTC (permalink / raw)
  To: gdb-prs

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

B. Larsen <blarsen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from B. Larsen <blarsen at redhat dot com> ---
Oh, I was actually looking at the FROM_COMMANDLINE issue, grep'ed for macinfo
and saw those nowhere but comments, so I jumped to this conclusion. Thanks for
the quick reply!

*** This bug has been marked as a duplicate of bug 29034 ***

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

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

end of thread, other threads:[~2022-04-18 19:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 17:40 [Bug macros/29063] New: Handle macinfo section and tags blarsen at redhat dot com
2022-04-13 21:56 ` [Bug macros/29063] " simon.marchi at polymtl dot ca
2022-04-18 13:37 ` tromey at sourceware dot org
2022-04-18 19:17 ` blarsen at redhat dot com

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