diff options
author | Per Bothner <per@bothner.com> | 1996-01-12 07:16:20 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1996-01-12 07:16:20 +0000 |
commit | 7ef893139cfc56fba6db4909dfbcbe210d7e8143 (patch) | |
tree | eba9b2a30953cb278aff5ceb9455ad5e129b52d6 /gdb/symfile.c | |
parent | 34cfa2dab5a0d1f6c53b24847d6fd590c7a618c0 (diff) | |
download | gdb-7ef893139cfc56fba6db4909dfbcbe210d7e8143.zip gdb-7ef893139cfc56fba6db4909dfbcbe210d7e8143.tar.gz gdb-7ef893139cfc56fba6db4909dfbcbe210d7e8143.tar.bz2 |
* symfile.c (decrement_reading_symtab): New function.
* symfile.c, symtab.h (currently_reading_symtab): New variable.
* symfile.c (psymtab_to_symtab): Adjust currently_reading_symtab.
* gdbtypes.c (check_typedef): Don't call lookup_symbol if
currently_reading_symtab (since that could infinitely recurse).
This fixes PR chill/8793.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index dd10f5f..7782a04 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -267,6 +267,17 @@ obconcat (obstackp, s1, s2, s3) return val; } +/* True if we are nested inside psymtab_to_symtab. */ + +int currently_reading_symtab = 0; + +static int +decrement_reading_symtab (dummy) + void *dummy; +{ + currently_reading_symtab--; +} + /* Get the symbol table that corresponds to a partial_symtab. This is fast after the first time you do it. In fact, there is an even faster macro PSYMTAB_TO_SYMTAB that does the fast @@ -283,7 +294,10 @@ psymtab_to_symtab (pst) /* If it has not yet been read in, read it. */ if (!pst->readin) { + struct cleanup *back_to = make_cleanup (decrement_reading_symtab, NULL); + currently_reading_symtab++; (*pst->read_symtab) (pst); + do_cleanups (back_to); } return pst->symtab; |