This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] PR gdb/18021 - defend against "static virtual" methods
- From: sergiodj+buildbot at redhat dot com
- To: gdb-testers at sourceware dot org
- Date: Mon, 23 Mar 2015 16:13:45 -0400
- Subject: [binutils-gdb] PR gdb/18021 - defend against "static virtual" methods
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 7e993ebf2343a5b39d6d1df29fdebc2818064ae5 ***
Author: Keith Seitz <keiths@redhat.com>
Branch: master
Commit: 7e993ebf2343a5b39d6d1df29fdebc2818064ae5
PR gdb/18021 - defend against "static virtual" methods
This bug appears to be caused by bad debuginfo. The method
causing the sefault in the reporter's test case is marked both static
and virtual.
This patch simply safegaurds against this case in dwarf2_add_member_fn,
where the code assumes that there is a `this' pointer when a virtual method
is seen (more specifically, when DW_AT_vtable_elem is seen).
It previously dereferenced the first formal parameter
(`this' pointer), which in this case doesn't exist. GDB consequently
segfaulted dereferencing a NULL pointer.
gdb/ChangeLog
PR gdb/18021
* dwarf2read.c (dwarf2_add_member_fn): Issue a complaint
if we find a static method with DW_AT_vtable_elem_location.
gdb/testsuite/ChangeLog
PR gdb/18021
* gdb.dwarf2/staticvirtual.exp: New test.