This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Attempt #2: gdb patch to complain properly about nested symbols
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: Attempt #2: gdb patch to complain properly about nested symbols
- From: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Date: Tue, 21 Dec 1999 19:58:00 -0800 (PST)
Hello gdb-patches people,
Here's spin #2 of my patch to complain properly about nested symbols.
Per Kevin and Jason's responses, I changed the textual description and
moved the text out of the code and into the ChangeLog.
Michael Elizabeth Chastain
<chastain@cygnus.com>
"love without fear"
---
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/ChangeLog,v
retrieving revision 1.5776
diff -u -r1.5776 ChangeLog
--- ChangeLog 1999/12/18 03:37:39 1.5776
+++ ChangeLog 1999/12/22 03:57:07
@@ -1,3 +1,11 @@
+1999-12-21 Michael Chastain <chastain@cygnus.com>
+
+ * dbxread.c (process_one_symbol): check for strange nested
+ LBRAC symbols before calling finish_block rather than after.
+ Also do not call define_symbol for these symbols. These symbols
+ would end up half-constructed with a null "table" pointer and
+ crash gdb later.
+
Fri Dec 17 18:24:58 1999 David Taylor <taylor@texas.cygnus.com>
* language.c (_initialize_language): move settings of language,
Index: gdb/dbxread.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/dbxread.c,v
retrieving revision 1.243
diff -u -r1.243 dbxread.c
--- dbxread.c 1999/11/25 05:56:21 1.243
+++ dbxread.c 1999/12/22 03:57:08
@@ -2379,6 +2379,13 @@
function_start_offset = valu;
within_function = 1;
+
+ if (context_stack_depth > 1)
+ {
+ complain (&lbrac_unmatched_complaint, symnum);
+ break;
+ }
+
if (context_stack_depth > 0)
{
new = pop_context ();
@@ -2386,9 +2393,6 @@
finish_block (new->name, &local_symbols, new->old_blocks,
new->start_addr, valu, objfile);
}
- /* Stack must be empty now. */
- if (context_stack_depth != 0)
- complain (&lbrac_unmatched_complaint, symnum);
new = push_context (0, valu);
new->name = define_symbol (valu, name, desc, type, objfile);