summaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorKlee Dienes <kdienes@apple.com>2002-11-18 19:14:10 +0000
committerKlee Dienes <kdienes@apple.com>2002-11-18 19:14:10 +0000
commit60ffc12c2259eb8ab80321121aaddbff84e8f1a9 (patch)
tree1ad8242f1246b97260640016e25a7323c575bd8a /gdb/dbxread.c
parent9283744f2c87cf567ed3e9c4253f69d9ab82f17b (diff)
downloadgdb-60ffc12c2259eb8ab80321121aaddbff84e8f1a9.tar.gz
2002-11-18 Klee Dienes <kdienes@apple.com>
* buildsym.h (pop_context): Convert to function, defined in buildsym.c. * buildsym.c: Include gdb_assert.h. (pop_context): Implement as C function. Add check for stack underflow. * dbxread.c (process_one_symbol): Complain and stop processing that symbol if we are already at the top of the context stack for a function-end N_FUN (this would imply an umatched RBRAC). Ditto when processing N_RBRAC.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 0cf70919972..538f076a6f7 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2774,6 +2774,13 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
{
/* This N_FUN marks the end of a function. This closes off the
current block. */
+
+ if (context_stack_depth <= 0)
+ {
+ complain (&lbrac_mismatch_complaint, symnum);
+ break;
+ }
+
record_line (current_subfile, 0, function_start_offset + valu);
within_function = 0;
new = pop_context ();
@@ -2843,6 +2850,12 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
N_SO, the linker did not relocate them (sigh). */
valu += last_source_start_addr;
+ if (context_stack_depth <= 0)
+ {
+ complain (&lbrac_mismatch_complaint, symnum);
+ break;
+ }
+
new = pop_context ();
if (desc != new->depth)
complain (&lbrac_mismatch_complaint, symnum);