aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1996-01-12 07:16:20 +0000
committerPer Bothner <per@bothner.com>1996-01-12 07:16:20 +0000
commit7ef893139cfc56fba6db4909dfbcbe210d7e8143 (patch)
treeeba9b2a30953cb278aff5ceb9455ad5e129b52d6 /gdb/gdbtypes.c
parent34cfa2dab5a0d1f6c53b24847d6fd590c7a618c0 (diff)
downloadgdb-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/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 366ab34..a21f959 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -878,12 +878,19 @@ check_typedef (type)
{
if (!TYPE_TARGET_TYPE (type))
{
- char* name = type_name_no_tag (type);
+ char* name;
+ struct symbol *sym;
+
+ /* It is dangerous to call lookup_symbol if we are currently
+ reading a symtab. Infinite recursion is one danger. */
+ if (currently_reading_symtab)
+ return type;
+
+ name = type_name_no_tag (type);
/* FIXME: shouldn't we separately check the TYPE_NAME and the
TYPE_TAG_NAME, and look in STRUCT_NAMESPACE and/or VAR_NAMESPACE
as appropriate? (this code was written before TYPE_NAME and
TYPE_TAG_NAME were separate). */
- struct symbol *sym;
if (name == NULL)
{
complain (&stub_noname_complaint);
@@ -899,7 +906,7 @@ check_typedef (type)
type = TYPE_TARGET_TYPE (type);
}
- if (TYPE_FLAGS(type) & TYPE_FLAG_STUB)
+ if ((TYPE_FLAGS(type) & TYPE_FLAG_STUB) && ! currently_reading_symtab)
{
char* name = type_name_no_tag (type);
/* FIXME: shouldn't we separately check the TYPE_NAME and the