gdb/linespec.c: Fix missing source file during breakpoint re-set
authorAaron Merey <amerey@redhat.com>
Fri, 6 Jan 2023 23:45:27 +0000 (18:45 -0500)
committerAaron Merey <amerey@redhat.com>
Tue, 10 Jan 2023 00:47:10 +0000 (19:47 -0500)
commit7dd38e31d67c2548b52bea313ab18e40824c05da
tree871377749a5cf94f328cfb4474fdc3af4c11cd34
parent2ff63a29b0b01f949c8365f761e883d29709c44a
gdb/linespec.c: Fix missing source file during breakpoint re-set

During breakpoint re-setting, the source_filename of an
explicit_location_spec is used to lookup the symtabs associated with
the breakpoint being re-set.  This source_filename is compared with each
known symtab filename in order to retrieve the breakpoint's symtabs.

However the source_filename may have been originally copied from a
symtab's fullname (the path where GDB found the source file) when the
breakpoint was first created.  If a breakpoint symtab's filename and
fullname differ and there is no substitute-path rule that converts the
fullname to the filename, this will cause a NOT_FOUND_ERROR to be thrown
during re-setting.

Fix this by using a symtab's filename to set the explicit_location_spec
source_filename instead of the symtab's fullname.
gdb/linespec.c
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp