Avoid crash in write_psymtabs_to_index
authorTom Tromey <tom@tromey.com>
Sat, 17 Apr 2021 19:40:04 +0000 (13:40 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 17 Apr 2021 19:40:04 +0000 (13:40 -0600)
commitda314dd397ab967af558f2929a79349aa5f96ac8
treeb208014a1127187e98feb5a94afa6148f48787bf
parent0b7b2c2adff43d39ee3bd39ebd91a6710d9175e4
Avoid crash in write_psymtabs_to_index

If I try "save gdb-index" using the executable from
gdb.cp/cmpd-minsyms.exp, gdb will crash.  This happens due to a
missing NULL check.

gdb/ChangeLog
2021-04-17  Tom Tromey  <tom@tromey.com>

* dwarf2/index-write.c (write_psymtabs_to_index): Check
partial_symtabs.

gdb/testsuite/ChangeLog
2021-04-17  Tom Tromey  <tom@tromey.com>

* gdb.dwarf2/gdb-index-nodebug.exp: New file.
gdb/ChangeLog
gdb/dwarf2/index-write.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/gdb-index-nodebug.exp [new file with mode: 0644]