This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/gdb-8.2-branch] Use scoped_free_pendings in coff_symtab_read
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 17 Jul 2018 15:47:22 -0000
- Subject: [binutils-gdb/gdb-8.2-branch] Use scoped_free_pendings in coff_symtab_read
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=79b38778d788e01e66e82f16bf3d4957439c77d5
commit 79b38778d788e01e66e82f16bf3d4957439c77d5
Author: Tom Tromey <tom@tromey.com>
Date: Fri Jun 29 15:10:04 2018 -0600
Use scoped_free_pendings in coff_symtab_read
PR gdb/18624 concerns an assertion failure that occurs when setting a
breakpoint in a Go program on Windows.
What happens here is that coff_symtab_read uses buildsym but does not
instantiate scoped_free_pendings. So, the struct pending objects are
never released. Later, dwarf2read.c calls buildsym_init, which
asserts.
This patch fixes the problem by instantiating scoped_free_pendings in
coff_symtab_read.
Tested using the test executable from the PR. I don't know how to
test this more fully.
2018-07-17 Tom Tromey <tom@tromey.com>
PR gdb/18624:
* coffread.c (coff_symtab_read): Use scoped_free_pendings.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/coffread.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7b77e87..7388c7d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-17 Tom Tromey <tom@tromey.com>
+
+ PR gdb/18624:
+ * coffread.c (coff_symtab_read): Use scoped_free_pendings.
+
2018-07-11 Pedro Alves <palves@redhat.com>
PR gdb/23377
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 30583e1..9e2edde 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -803,6 +803,9 @@ coff_symtab_read (minimal_symbol_reader &reader,
CORE_ADDR tmpaddr;
struct minimal_symbol *msym;
+ buildsym_init ();
+ scoped_free_pendings free_pending;
+
/* Work around a stdio bug in SunOS4.1.1 (this makes me nervous....
it's hard to know I've really worked around it. The fix should
be harmless, anyway). The symptom of the bug is that the first