aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.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
commit0c5e171aedb2697b4ebf072e47f498aaf62b7a05 (patch)
treeeb5298b4d660ad5ee83458a089cf5509c1398a6f /gdb/buildsym.c
parent11041102f23fd5f34fd4b81b04788e403a70edee (diff)
downloadfsf-binutils-gdb-0c5e171aedb2697b4ebf072e47f498aaf62b7a05.zip
fsf-binutils-gdb-0c5e171aedb2697b4ebf072e47f498aaf62b7a05.tar.gz
fsf-binutils-gdb-0c5e171aedb2697b4ebf072e47f498aaf62b7a05.tar.bz2
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/buildsym.c')
-rw-r--r--gdb/buildsym.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 09e8122..ae8929d 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -33,6 +33,7 @@
#include "symfile.h"
#include "objfiles.h"
#include "gdbtypes.h"
+#include "gdb_assert.h"
#include "complaints.h"
#include "gdb_string.h"
#include "expression.h" /* For "enum exp_opcode" used by... */
@@ -1100,6 +1101,14 @@ push_context (int desc, CORE_ADDR valu)
return new;
}
+
+struct context_stack *
+pop_context (void)
+{
+ gdb_assert (context_stack_depth > 0);
+ return (&context_stack[--context_stack_depth]);
+}
+
/* Compute a small integer hash code for the given name. */