I am sending this patch on behalf of kmoy@google.com, who discovered the bug
and wrote the fix.
gdb_demangle can return null for strings that don't properly demangle. The null
check was mistakenly removed in commit
43816ebc335. Without this check, GDB
aborts when loading symbols from some binaries.
gdb/ChangeLog
2020-02-21 Ali Tamur <tamur@google.com>
* dwarf2/read.c (dwarf2_name): Add null check.
+2020-02-21 Ali Tamur <tamur@google.com>
+
+ * dwarf2/read.c (dwarf2_name): Add null check.
+
2020-02-20 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_find_containing_comp_unit): Use ">", not
{
gdb::unique_xmalloc_ptr<char> demangled
(gdb_demangle (DW_STRING (attr), DMGL_TYPES));
+ if (demangled == nullptr)
+ return nullptr;
const char *base;