* symtab.c (lookup_symbol): Add comment about QUIT here.

This commit is contained in:
Jim Kingdon 1994-01-16 02:39:50 +00:00
parent bff37c5945
commit 8704184584
2 changed files with 27 additions and 6 deletions

View File

@ -1,5 +1,7 @@
Sat Jan 15 10:20:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* symtab.c (lookup_symbol): Add comment about QUIT here.
* utils.c (fputs_unfiltered): Call fputs, not fputs_maybe_filtered.
* c-exp.y (parse_number): Check for overflow regardless of range

View File

@ -1,6 +1,6 @@
/* Symbol table lookup for the GNU debugger, GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992
Free Software Foundation, Inc.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994
Free Software Foundation, Inc.
This file is part of GDB.
@ -469,6 +469,16 @@ find_pc_psymbol (psymtab, pc)
BLOCK_FOUND is set to the block in which NAME is found (in the case of
a field of `this', value_of_this sets BLOCK_FOUND to the proper value.) */
/* This function has a bunch of loops in it and it would seem to be
attractive to put in some QUIT's (though I'm not really sure
whether it can run long enough to be really important). But there
are a few calls for which it would appear to be bad news to quit
out of here: find_proc_desc in alpha-tdep.c and mips-tdep.c, and
nindy_frame_chain_valid in nindy-tdep.c. (Note that there is C++
code below which can error(), but that probably doesn't affect
these calls since they are looking for a known variable and thus
can probably assume it will never hit the C++ code). */
struct symbol *
lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
const char *name;
@ -1031,10 +1041,12 @@ find_pc_symtab (pc)
for a given address value. Slow but complete. */
struct symbol *
find_addr_symbol (addr)
find_addr_symbol (addr, symtabp, symaddrp)
CORE_ADDR addr;
struct symtab **symtabp;
CORE_ADDR *symaddrp;
{
struct symtab *symtab;
struct symtab *symtab, *best_symtab;
struct objfile *objfile;
register int bot, top;
register struct symbol *sym;
@ -1080,14 +1092,21 @@ find_addr_symbol (addr)
if (sym_addr > best_sym_addr)
{
/* Quit if we found an exact match. */
if (sym_addr == addr)
return sym;
best_sym = sym;
best_sym_addr = sym_addr;
best_symtab = symtab;
if (sym_addr == addr)
goto done;
}
}
}
}
done:
if (symtabp)
*symtabp = best_symtab;
if (symaddrp)
*symaddrp = best_sym_addr;
return best_sym;
}