diff options
author | Guinevere Larsen <blarsen@redhat.com> | 2024-01-22 10:13:52 +0100 |
---|---|---|
committer | Guinevere Larsen <blarsen@redhat.com> | 2024-01-23 16:58:55 +0100 |
commit | 0068bd6fb3579dd8df7561e038cb3fe27f122b0e (patch) | |
tree | 9d1c50273d00a9490e93f80fb101481c51924e8a /gdbsupport/intrusive_list.h | |
parent | 047fa8cc1cc534f19428b18d3d0c50e8139d3335 (diff) | |
download | gdb-0068bd6fb3579dd8df7561e038cb3fe27f122b0e.zip gdb-0068bd6fb3579dd8df7561e038cb3fe27f122b0e.tar.gz gdb-0068bd6fb3579dd8df7561e038cb3fe27f122b0e.tar.bz2 |
gdb: fix "list ." related crash
When a user attempts to use the "list ." command with an inferior that
doesn't have debug symbols, GDB would crash. This was reported as PR
gdb/31256.
The crash would happen when attempting to get the current symtab_and_line
for the stop location, because the symtab would return a null pointer
and we'd attempt to dereference it to print the line.
This commit fixes that by checking for an empty symtab and erroring out
of the function if it happens.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31256
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdbsupport/intrusive_list.h')
0 files changed, 0 insertions, 0 deletions