public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Decl/def matching with templates without template parameters in the DW_AT_name
@ 2023-01-06 17:37 David Blaikie
  2023-01-11 18:24 ` Simon Marchi
  0 siblings, 1 reply; 11+ messages in thread
From: David Blaikie @ 2023-01-06 17:37 UTC (permalink / raw)
  To: gdb

I've been working on reducing debug info size, especially for
expression-template heavy code like in Tensorflow and Eigen.

To that end, I've implemented the flag -gsimple-template-names in
Clang that simplifies the DW_AT_name for templates by omitting
template parameters (eg: "vector" instead of "vector<int,
std::allocator<int>>") when the DW_TAG_template_*_parameters contain
sufficient information to reconstruct the original name.

This generally seems to work in GDB - that looks intentional (perhaps
because someone else implemented this feature elsewhere, or just for
canonicalization reasons (the full string with template parameters
might have different whitespace, parentheses, other formatting)), it
seems unlikely that GDB would accidentally be able to connect two
"vector" declarations up to the right "vector" definitions based on
the template parameters without intentional code to support this
scenario.

But one place I found a problem was in pretty printers. I have
situations where a type declaration isn't resolved to a definition
when working within a pretty printer (resulting in the pretty printer
being unable to find member variables in the object/of that type) -
but if I print out the variable/member it works correctly - or if I
"list" the source of the file where the definition of the type is,
then the pretty printer works correctly.

Does this ring a bell for anyone/sound like something sufficient to
file a bug, or would I need to dig in further to create an isolated
reproduction to help communicate the issue I'm seeing?

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

end of thread, other threads:[~2023-01-18 22:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 17:37 Decl/def matching with templates without template parameters in the DW_AT_name David Blaikie
2023-01-11 18:24 ` Simon Marchi
2023-01-11 23:50   ` David Blaikie
2023-01-12  1:46     ` Simon Marchi
2023-01-14 20:28       ` Tom Tromey
2023-01-16 21:18         ` Simon Marchi
2023-01-18 22:08           ` David Blaikie
2023-01-18 22:12         ` David Blaikie
2023-01-18 22:01       ` David Blaikie
2023-01-12  2:32     ` Simon Marchi
2023-01-18 22:04       ` David Blaikie

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