]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
gdb: Check for nullptr when computing srcpath
authorAaron Merey <amerey@redhat.com>
Fri, 28 Feb 2020 00:07:01 +0000 (19:07 -0500)
committerAaron Merey <amerey@redhat.com>
Fri, 28 Feb 2020 00:07:01 +0000 (19:07 -0500)
commite5da11393a16416afc0c0a1da9914b6424f37fa8
treee6d5efb5e3b9b92982b7b15e77bfe36bf8749b95
parenta1f2ad114c9927d5e457d6eb6bb8ed5120b6fec8
gdb: Check for nullptr when computing srcpath

This fixes a regression caused by commit 0d79cdc494d5:

  $ make check TESTS="gdb.dwarf2/dw2-ranges-base.exp"
  [...]
  ERROR: GDB process no longer exists

This error is caused by an abort during the computation of srcpath
when SYMTAB_DIRNAME (s) == NULL.

Computing srcpath only when SYMTAB_DIRNAME (s) is not NULL fixes this
error. Also change the condition for calling debuginfod_source_query
to include whether srcpath could be computed.

gdb/ChangeLog:

2020-02-27  Aaron Merey  <amerey@redhat.com>

        * source.c (open_source_file): Check for nullptr when computing
        srcpath.
gdb/ChangeLog
gdb/source.c