[PATCH][gdb/symtab] Fix check-psymtab failure for inline function

Tom Tromey tom@tromey.com
Wed Mar 11 00:08:55 GMT 2020


>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> When loading the executable in gdb, we create a partial symbol for foo, but
Tom> after expansion into a full symbol table no actual symbol is created,
Tom> resulting in a maint check-psymtab failure:
Tom> ...
Tom> (gdb) maint check-psymtab
Tom> Static symbol `foo' only found in inline.c psymtab
Tom> ...

Tom> Fix this by preventing the creation of this type of partial symbol.

With this patch, if there is a function which is only inlined (there is
no "out-line" copy), will "break function" still work?

It seems to me that it wouldn't always, because there wouldn't be a
partial symbol to match.  Maybe it might work accidentally if the inline
function appears in a CU that is already expanded, like main's.  So the
test would have to be an always-inline function that isn't used in
main's CU.

If it does work, then I wonder how, since my mental model is that all
the paths to expansion require a matching partial symbol.

If it doesn't work, then I think a different fix is needed.

thanks,
Tom


More information about the Gdb-patches mailing list