Skip to content
Commit e5da1139 authored by Aaron Merey's avatar Aaron Merey
Browse files

gdb: Check for nullptr when computing srcpath

This fixes a regression caused by commit 0d79cdc4:

  $ 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.
parent a1f2ad11
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment