1991-12-24 07:16:58 +08:00
|
|
|
/* Shared code to pre-read a stab (dbx-style), when building a psymtab.
|
1995-04-01 19:24:43 +08:00
|
|
|
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995
|
1993-04-15 17:41:59 +08:00
|
|
|
Free Software Foundation, Inc.
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
1995-08-02 11:41:12 +08:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
/* The following need to be defined:
|
|
|
|
SET_NAMESTRING() --Set namestring to name of symbol.
|
|
|
|
CUR_SYMBOL_TYPE --Type code of current symbol.
|
|
|
|
CUR_SYMBOL_VALUE --Value field of current symbol. May be adjusted here.
|
1995-05-12 21:41:52 +08:00
|
|
|
namestring - variable pointing to the name of the stab.
|
|
|
|
section_offsets - variable pointing to the section offsets.
|
|
|
|
pst - the partial symbol table being built.
|
|
|
|
|
|
|
|
psymtab_include_list, includes_used, includes_allocated - list of include
|
|
|
|
file names (N_SOL) seen so far.
|
|
|
|
dependency_list, dependencies_used, dependencies_allocated - list of
|
|
|
|
N_EXCL stabs seen so far.
|
|
|
|
|
|
|
|
END_PSYMTAB -- end a partial symbol table.
|
|
|
|
START_PSYMTAB -- start a partial symbol table.
|
1991-12-24 07:16:58 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* End of macro definitions, now let's handle them symbols! */
|
|
|
|
|
|
|
|
switch (CUR_SYMBOL_TYPE)
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
/*
|
|
|
|
* Standard, external, non-debugger, symbols
|
|
|
|
*/
|
|
|
|
|
|
|
|
case N_TEXT | N_EXT:
|
|
|
|
case N_NBTEXT | N_EXT:
|
1992-07-04 21:59:03 +08:00
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
|
|
|
goto record_it;
|
|
|
|
|
|
|
|
case N_DATA | N_EXT:
|
1991-12-24 07:16:58 +08:00
|
|
|
case N_NBDATA | N_EXT:
|
1992-07-04 21:59:03 +08:00
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
|
|
|
|
goto record_it;
|
|
|
|
|
1993-07-20 10:50:15 +08:00
|
|
|
case N_BSS:
|
1992-07-04 21:59:03 +08:00
|
|
|
case N_BSS | N_EXT:
|
1991-12-24 07:16:58 +08:00
|
|
|
case N_NBBSS | N_EXT:
|
1992-07-04 21:59:03 +08:00
|
|
|
case N_SETV | N_EXT: /* FIXME, is this in BSS? */
|
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_BSS);
|
|
|
|
goto record_it;
|
|
|
|
|
1991-12-24 07:16:58 +08:00
|
|
|
case N_ABS | N_EXT:
|
1992-07-04 21:59:03 +08:00
|
|
|
record_it:
|
1991-12-28 05:11:37 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
1991-12-24 07:16:58 +08:00
|
|
|
SET_NAMESTRING();
|
|
|
|
|
|
|
|
bss_ext_symbol:
|
1992-02-22 09:46:16 +08:00
|
|
|
record_minimal_symbol (namestring, CUR_SYMBOL_VALUE,
|
|
|
|
CUR_SYMBOL_TYPE, objfile); /* Always */
|
1991-12-28 05:11:37 +08:00
|
|
|
#endif /* DBXREAD_ONLY */
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Standard, local, non-debugger, symbols */
|
|
|
|
|
|
|
|
case N_NBTEXT:
|
|
|
|
|
|
|
|
/* We need to be able to deal with both N_FN or N_TEXT,
|
|
|
|
because we have no way of knowing whether the sys-supplied ld
|
|
|
|
or GNU ld was used to make the executable. Sequents throw
|
|
|
|
in another wrinkle -- they renumbered N_FN. */
|
|
|
|
|
|
|
|
case N_FN:
|
|
|
|
case N_FN_SEQ:
|
|
|
|
case N_TEXT:
|
1991-12-28 05:11:37 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
1992-07-04 21:59:03 +08:00
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
1991-12-24 07:16:58 +08:00
|
|
|
SET_NAMESTRING();
|
|
|
|
if ((namestring[0] == '-' && namestring[1] == 'l')
|
|
|
|
|| (namestring [(nsl = strlen (namestring)) - 1] == 'o'
|
* configure.in, dbxread.c, hppa-coredep.c, hppa-pinsn.c,
hppabsd-core.c, hppabsd-tdep.c, hppabsd-xdep.c, hppahpux-tdep.c,
hppahpux-xdep.c, munch, partial-stab.h, tm-hppabsd.h,
tm-hppahpux.h, xm-hppabsd.h, xm-hppahpux.h: HPPA merge.
1992-06-20 06:43:49 +08:00
|
|
|
&& namestring [nsl - 2] == '.')
|
1994-11-07 04:16:34 +08:00
|
|
|
#ifdef GDB_TARGET_IS_HPPA
|
|
|
|
/* This braindamage is necessary for versions of GCC 2.6 and
|
|
|
|
earlier; it will not be necessary for GCC 2.7.
|
|
|
|
|
|
|
|
In a nutshell, we need a way to determine when we've hit
|
|
|
|
the end of a file with debug symbols. Most ports do this
|
|
|
|
with a N_SO record with a NULL symbol name (as will GCC 2.7
|
|
|
|
on the PA). GCC 2.6 (and earlier) on the PA instead creates
|
|
|
|
an N_TEXT symbol with the name "end_file." */
|
|
|
|
|| (namestring[0] == 'e' && STREQ (namestring, "end_file."))
|
|
|
|
#endif
|
* configure.in, dbxread.c, hppa-coredep.c, hppa-pinsn.c,
hppabsd-core.c, hppabsd-tdep.c, hppabsd-xdep.c, hppahpux-tdep.c,
hppahpux-xdep.c, munch, partial-stab.h, tm-hppabsd.h,
tm-hppahpux.h, xm-hppabsd.h, xm-hppahpux.h: HPPA merge.
1992-06-20 06:43:49 +08:00
|
|
|
)
|
1991-12-24 07:16:58 +08:00
|
|
|
{
|
1994-11-07 04:16:34 +08:00
|
|
|
#ifndef GDB_TARGET_IS_HPPA
|
1992-03-21 09:56:01 +08:00
|
|
|
if (objfile -> ei.entry_point < CUR_SYMBOL_VALUE &&
|
1992-07-04 21:59:03 +08:00
|
|
|
objfile -> ei.entry_point >= last_o_file_start)
|
1991-12-24 07:16:58 +08:00
|
|
|
{
|
1992-03-21 09:56:01 +08:00
|
|
|
objfile -> ei.entry_file_lowpc = last_o_file_start;
|
|
|
|
objfile -> ei.entry_file_highpc = CUR_SYMBOL_VALUE;
|
1991-12-24 07:16:58 +08:00
|
|
|
}
|
1994-11-07 04:16:34 +08:00
|
|
|
#endif
|
1991-12-24 07:16:58 +08:00
|
|
|
if (past_first_source_file && pst
|
|
|
|
/* The gould NP1 uses low values for .o and -l symbols
|
|
|
|
which are not the address. */
|
1992-06-24 15:31:55 +08:00
|
|
|
&& CUR_SYMBOL_VALUE >= pst->textlow)
|
1991-12-24 07:16:58 +08:00
|
|
|
{
|
|
|
|
END_PSYMTAB (pst, psymtab_include_list, includes_used,
|
|
|
|
symnum * symbol_size, CUR_SYMBOL_VALUE,
|
|
|
|
dependency_list, dependencies_used);
|
|
|
|
pst = (struct partial_symtab *) 0;
|
|
|
|
includes_used = 0;
|
|
|
|
dependencies_used = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
past_first_source_file = 1;
|
|
|
|
last_o_file_start = CUR_SYMBOL_VALUE;
|
|
|
|
}
|
1993-07-20 10:50:15 +08:00
|
|
|
else
|
|
|
|
goto record_it;
|
1991-12-28 05:11:37 +08:00
|
|
|
#endif /* DBXREAD_ONLY */
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case N_DATA:
|
1992-07-04 21:59:03 +08:00
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
|
1993-07-20 10:50:15 +08:00
|
|
|
goto record_it;
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
case N_UNDF | N_EXT:
|
1991-12-28 05:11:37 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
1991-12-24 07:16:58 +08:00
|
|
|
if (CUR_SYMBOL_VALUE != 0) {
|
|
|
|
/* This is a "Fortran COMMON" symbol. See if the target
|
|
|
|
environment knows where it has been relocated to. */
|
|
|
|
|
|
|
|
CORE_ADDR reladdr;
|
|
|
|
|
|
|
|
SET_NAMESTRING();
|
|
|
|
if (target_lookup_symbol (namestring, &reladdr)) {
|
|
|
|
continue; /* Error in lookup; ignore symbol for now. */
|
|
|
|
}
|
|
|
|
CUR_SYMBOL_TYPE ^= (N_BSS^N_UNDF); /* Define it as a bss-symbol */
|
|
|
|
CUR_SYMBOL_VALUE = reladdr;
|
|
|
|
goto bss_ext_symbol;
|
|
|
|
}
|
1991-12-28 05:11:37 +08:00
|
|
|
#endif /* DBXREAD_ONLY */
|
1991-12-24 07:16:58 +08:00
|
|
|
continue; /* Just undefined, not COMMON */
|
|
|
|
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
case N_UNDF:
|
|
|
|
#ifdef DBXREAD_ONLY
|
|
|
|
if (processing_acc_compilation && bufp->n_strx == 1) {
|
1992-06-15 02:10:10 +08:00
|
|
|
/* Deal with relative offsets in the string table
|
|
|
|
used in ELF+STAB under Solaris. If we want to use the
|
|
|
|
n_strx field, which contains the name of the file,
|
|
|
|
we must adjust file_string_table_offset *before* calling
|
|
|
|
SET_NAMESTRING(). */
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
past_first_source_file = 1;
|
|
|
|
file_string_table_offset = next_file_string_table_offset;
|
|
|
|
next_file_string_table_offset =
|
|
|
|
file_string_table_offset + bufp->n_value;
|
|
|
|
if (next_file_string_table_offset < file_string_table_offset)
|
|
|
|
error ("string table offset backs up at %d", symnum);
|
|
|
|
/* FIXME -- replace error() with complaint. */
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
#endif /* DBXREAD_ONLY */
|
|
|
|
continue;
|
|
|
|
|
1991-12-24 07:16:58 +08:00
|
|
|
/* Lots of symbol types we can just ignore. */
|
|
|
|
|
|
|
|
case N_ABS:
|
|
|
|
case N_NBDATA:
|
|
|
|
case N_NBBSS:
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Keep going . . .*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Special symbol types for GNU
|
|
|
|
*/
|
|
|
|
case N_INDR:
|
|
|
|
case N_INDR | N_EXT:
|
|
|
|
case N_SETA:
|
|
|
|
case N_SETA | N_EXT:
|
|
|
|
case N_SETT:
|
|
|
|
case N_SETT | N_EXT:
|
|
|
|
case N_SETD:
|
|
|
|
case N_SETD | N_EXT:
|
|
|
|
case N_SETB:
|
|
|
|
case N_SETB | N_EXT:
|
|
|
|
case N_SETV:
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Debugger symbols
|
|
|
|
*/
|
|
|
|
|
|
|
|
case N_SO: {
|
1993-07-19 06:50:30 +08:00
|
|
|
unsigned long valu;
|
1992-07-17 04:40:36 +08:00
|
|
|
static int prev_so_symnum = -10;
|
|
|
|
static int first_so_symnum;
|
1992-06-16 09:43:35 +08:00
|
|
|
char *p;
|
1993-07-19 06:50:30 +08:00
|
|
|
|
|
|
|
valu = CUR_SYMBOL_VALUE + ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
1995-04-01 19:24:43 +08:00
|
|
|
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
|
|
|
/* A zero value is probably an indication for the SunPRO 3.0
|
|
|
|
compiler. end_psymtab explicitly tests for zero, so
|
|
|
|
don't relocate it. */
|
|
|
|
if (CUR_SYMBOL_VALUE == 0)
|
|
|
|
valu = 0;
|
|
|
|
#endif
|
1993-07-19 06:50:30 +08:00
|
|
|
|
1992-07-17 04:40:36 +08:00
|
|
|
past_first_source_file = 1;
|
|
|
|
|
|
|
|
if (prev_so_symnum != symnum - 1)
|
|
|
|
{ /* Here if prev stab wasn't N_SO */
|
|
|
|
first_so_symnum = symnum;
|
|
|
|
|
|
|
|
if (pst)
|
|
|
|
{
|
|
|
|
END_PSYMTAB (pst, psymtab_include_list, includes_used,
|
|
|
|
symnum * symbol_size, valu,
|
|
|
|
dependency_list, dependencies_used);
|
|
|
|
pst = (struct partial_symtab *) 0;
|
|
|
|
includes_used = 0;
|
|
|
|
dependencies_used = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
prev_so_symnum = symnum;
|
|
|
|
|
1991-12-24 07:16:58 +08:00
|
|
|
/* End the current partial symtab and start a new one */
|
|
|
|
|
|
|
|
SET_NAMESTRING();
|
|
|
|
|
1994-07-23 08:53:28 +08:00
|
|
|
/* Null name means end of .o file. Don't start a new one. */
|
|
|
|
if (*namestring == '\000')
|
|
|
|
continue;
|
|
|
|
|
1992-06-16 09:43:35 +08:00
|
|
|
/* Some compilers (including gcc) emit a pair of initial N_SOs.
|
|
|
|
The first one is a directory name; the second the file name.
|
|
|
|
If pst exists, is empty, and has a filename ending in '/',
|
|
|
|
we assume the previous N_SO was a directory name. */
|
|
|
|
|
1992-06-18 02:14:22 +08:00
|
|
|
p = strrchr (namestring, '/');
|
1992-06-16 09:43:35 +08:00
|
|
|
if (p && *(p+1) == '\000')
|
1992-07-17 04:40:36 +08:00
|
|
|
continue; /* Simply ignore directory name SOs */
|
1992-06-16 09:43:35 +08:00
|
|
|
|
|
|
|
/* Some other compilers (C++ ones in particular) emit useless
|
1992-07-17 04:40:36 +08:00
|
|
|
SOs for non-existant .c files. We ignore all subsequent SOs that
|
|
|
|
immediately follow the first. */
|
|
|
|
|
|
|
|
if (!pst)
|
|
|
|
pst = START_PSYMTAB (objfile, section_offsets,
|
|
|
|
namestring, valu,
|
|
|
|
first_so_symnum * symbol_size,
|
|
|
|
objfile -> global_psymbols.next,
|
|
|
|
objfile -> static_psymbols.next);
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
case N_BINCL:
|
1993-11-12 07:27:21 +08:00
|
|
|
{
|
1991-12-28 05:11:37 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
1993-11-12 07:27:21 +08:00
|
|
|
enum language tmp_language;
|
|
|
|
/* Add this bincl to the bincl_list for future EXCLs. No
|
|
|
|
need to save the string; it'll be around until
|
|
|
|
read_dbx_symtab function returns */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
1993-11-12 07:27:21 +08:00
|
|
|
SET_NAMESTRING();
|
|
|
|
|
|
|
|
tmp_language = deduce_language_from_filename (namestring);
|
|
|
|
|
|
|
|
/* Only change the psymtab's language if we've learned
|
|
|
|
something useful (eg. tmp_language is not language_unknown).
|
|
|
|
In addition, to match what start_subfile does, never change
|
|
|
|
from C++ to C. */
|
|
|
|
if (tmp_language != language_unknown
|
|
|
|
&& (tmp_language != language_c
|
|
|
|
|| psymtab_language != language_cplus))
|
|
|
|
psymtab_language = tmp_language;
|
1991-12-24 07:16:58 +08:00
|
|
|
|
1993-11-12 07:27:21 +08:00
|
|
|
add_bincl_to_list (pst, namestring, CUR_SYMBOL_VALUE);
|
1991-12-24 07:16:58 +08:00
|
|
|
|
1993-11-12 07:27:21 +08:00
|
|
|
/* Mark down an include file in the current psymtab */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
1993-11-12 07:27:21 +08:00
|
|
|
goto record_include_file;
|
1991-12-24 07:16:58 +08:00
|
|
|
|
1993-01-01 01:24:06 +08:00
|
|
|
#else /* DBXREAD_ONLY */
|
1993-11-12 07:27:21 +08:00
|
|
|
continue;
|
1993-01-01 01:24:06 +08:00
|
|
|
#endif
|
1993-11-12 07:27:21 +08:00
|
|
|
}
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
case N_SOL:
|
|
|
|
{
|
1993-11-12 07:27:21 +08:00
|
|
|
enum language tmp_language;
|
|
|
|
/* Mark down an include file in the current psymtab */
|
|
|
|
|
|
|
|
SET_NAMESTRING();
|
|
|
|
|
|
|
|
tmp_language = deduce_language_from_filename (namestring);
|
|
|
|
|
|
|
|
/* Only change the psymtab's language if we've learned
|
|
|
|
something useful (eg. tmp_language is not language_unknown).
|
|
|
|
In addition, to match what start_subfile does, never change
|
|
|
|
from C++ to C. */
|
|
|
|
if (tmp_language != language_unknown
|
|
|
|
&& (tmp_language != language_c
|
|
|
|
|| psymtab_language != language_cplus))
|
|
|
|
psymtab_language = tmp_language;
|
|
|
|
|
|
|
|
/* In C++, one may expect the same filename to come round many
|
|
|
|
times, when code is coming alternately from the main file
|
|
|
|
and from inline functions in other files. So I check to see
|
|
|
|
if this is a file we've seen before -- either the main
|
|
|
|
source file, or a previously included file.
|
|
|
|
|
|
|
|
This seems to be a lot of time to be spending on N_SOL, but
|
|
|
|
things like "break c-exp.y:435" need to work (I
|
|
|
|
suppose the psymtab_include_list could be hashed or put
|
|
|
|
in a binary tree, if profiling shows this is a major hog). */
|
|
|
|
if (pst && STREQ (namestring, pst->filename))
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
{
|
1993-11-12 07:27:21 +08:00
|
|
|
register int i;
|
|
|
|
for (i = 0; i < includes_used; i++)
|
|
|
|
if (STREQ (namestring, psymtab_include_list[i]))
|
|
|
|
{
|
|
|
|
i = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == -1)
|
|
|
|
continue;
|
1991-12-24 07:16:58 +08:00
|
|
|
}
|
1993-11-12 07:27:21 +08:00
|
|
|
|
|
|
|
#ifdef DBXREAD_ONLY
|
|
|
|
record_include_file:
|
|
|
|
#endif
|
|
|
|
|
|
|
|
psymtab_include_list[includes_used++] = namestring;
|
|
|
|
if (includes_used >= includes_allocated)
|
|
|
|
{
|
|
|
|
char **orig = psymtab_include_list;
|
|
|
|
|
|
|
|
psymtab_include_list = (char **)
|
|
|
|
alloca ((includes_allocated *= 2) *
|
|
|
|
sizeof (char *));
|
|
|
|
memcpy ((PTR)psymtab_include_list, (PTR)orig,
|
|
|
|
includes_used * sizeof (char *));
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
1991-12-24 07:16:58 +08:00
|
|
|
case N_LSYM: /* Typedef or automatic variable. */
|
|
|
|
case N_STSYM: /* Data seg var -- static */
|
|
|
|
case N_LCSYM: /* BSS " */
|
1992-07-04 21:59:03 +08:00
|
|
|
case N_ROSYM: /* Read-only data seg var -- static. */
|
1991-12-24 07:16:58 +08:00
|
|
|
case N_NBSTS: /* Gould nobase. */
|
|
|
|
case N_NBLCS: /* symbols. */
|
1993-06-24 08:44:54 +08:00
|
|
|
case N_FUN:
|
|
|
|
case N_GSYM: /* Global (extern) variable; can be
|
|
|
|
data or bss (sigh FIXME). */
|
|
|
|
|
|
|
|
/* Following may probably be ignored; I'll leave them here
|
|
|
|
for now (until I do Pascal and Modula 2 extensions). */
|
|
|
|
|
|
|
|
case N_PC: /* I may or may not need this; I
|
|
|
|
suspect not. */
|
|
|
|
case N_M2C: /* I suspect that I can ignore this here. */
|
|
|
|
case N_SCOPE: /* Same. */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
SET_NAMESTRING();
|
|
|
|
|
|
|
|
p = (char *) strchr (namestring, ':');
|
1993-06-24 08:44:54 +08:00
|
|
|
if (!p)
|
|
|
|
continue; /* Not a debugging symbol. */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
1993-06-24 08:44:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* Main processing section for debugging symbols which
|
|
|
|
the initial read through the symbol tables needs to worry
|
|
|
|
about. If we reach this point, the symbol which we are
|
|
|
|
considering is definitely one we are interested in.
|
|
|
|
p must also contain the (valid) index into the namestring
|
|
|
|
which indicates the debugging type symbol. */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
switch (p[1])
|
|
|
|
{
|
1993-06-24 08:44:54 +08:00
|
|
|
case 'S':
|
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
|
1995-02-10 04:21:46 +08:00
|
|
|
#ifdef STATIC_TRANSFORM_NAME
|
|
|
|
namestring = STATIC_TRANSFORM_NAME (namestring);
|
|
|
|
#endif
|
1993-06-24 08:44:54 +08:00
|
|
|
ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_STATIC,
|
|
|
|
objfile->static_psymbols,
|
|
|
|
CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
|
|
|
continue;
|
|
|
|
case 'G':
|
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
|
|
|
|
/* The addresses in these entries are reported to be
|
|
|
|
wrong. See the code that reads 'G's for symtabs. */
|
|
|
|
ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_STATIC,
|
|
|
|
objfile->global_psymbols,
|
|
|
|
CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
|
|
|
continue;
|
|
|
|
|
1991-12-24 07:16:58 +08:00
|
|
|
case 'T':
|
1992-06-15 02:10:10 +08:00
|
|
|
if (p != namestring) /* a name is there, not just :T... */
|
1991-12-24 07:16:58 +08:00
|
|
|
{
|
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
1992-06-15 02:10:10 +08:00
|
|
|
STRUCT_NAMESPACE, LOC_TYPEDEF,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->static_psymbols,
|
|
|
|
CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
1992-06-15 02:10:10 +08:00
|
|
|
if (p[2] == 't')
|
|
|
|
{
|
|
|
|
/* Also a typedef with the same name. */
|
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_TYPEDEF,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->static_psymbols,
|
|
|
|
CUR_SYMBOL_VALUE, psymtab_language,
|
|
|
|
objfile);
|
1992-06-15 02:10:10 +08:00
|
|
|
p += 1;
|
|
|
|
}
|
1993-11-12 07:27:21 +08:00
|
|
|
/* The semantics of C++ state that "struct foo { ... }"
|
|
|
|
also defines a typedef for "foo". Unfortuantely, cfront
|
|
|
|
never makes the typedef when translating from C++ to C.
|
|
|
|
We make the typedef here so that "ptype foo" works as
|
|
|
|
expected for cfront translated code. */
|
|
|
|
else if (psymtab_language == language_cplus)
|
|
|
|
{
|
|
|
|
/* Also a typedef with the same name. */
|
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_TYPEDEF,
|
|
|
|
objfile->static_psymbols,
|
|
|
|
CUR_SYMBOL_VALUE, psymtab_language,
|
|
|
|
objfile);
|
|
|
|
}
|
1991-12-24 07:16:58 +08:00
|
|
|
}
|
|
|
|
goto check_enum;
|
|
|
|
case 't':
|
1992-06-15 02:10:10 +08:00
|
|
|
if (p != namestring) /* a name is there, not just :T... */
|
|
|
|
{
|
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_TYPEDEF,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->static_psymbols,
|
|
|
|
CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
1992-06-15 02:10:10 +08:00
|
|
|
}
|
1991-12-24 07:16:58 +08:00
|
|
|
check_enum:
|
|
|
|
/* If this is an enumerated type, we need to
|
|
|
|
add all the enum constants to the partial symbol
|
|
|
|
table. This does not cover enums without names, e.g.
|
|
|
|
"enum {a, b} c;" in C, but fortunately those are
|
|
|
|
rare. There is no way for GDB to find those from the
|
|
|
|
enum type without spending too much time on it. Thus
|
1993-06-24 08:44:54 +08:00
|
|
|
to solve this problem, the compiler needs to put out the
|
|
|
|
enum in a nameless type. GCC2 does this. */
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
/* We are looking for something of the form
|
|
|
|
<name> ":" ("t" | "T") [<number> "="] "e"
|
|
|
|
{<constant> ":" <value> ","} ";". */
|
|
|
|
|
|
|
|
/* Skip over the colon and the 't' or 'T'. */
|
|
|
|
p += 2;
|
|
|
|
/* This type may be given a number. Also, numbers can come
|
|
|
|
in pairs like (0,26). Skip over it. */
|
|
|
|
while ((*p >= '0' && *p <= '9')
|
|
|
|
|| *p == '(' || *p == ',' || *p == ')'
|
|
|
|
|| *p == '=')
|
|
|
|
p++;
|
|
|
|
|
|
|
|
if (*p++ == 'e')
|
|
|
|
{
|
1995-08-13 06:50:04 +08:00
|
|
|
/* The aix4 compiler emits extra crud before the members. */
|
|
|
|
if (*p == '-')
|
|
|
|
{
|
|
|
|
/* Skip over the type (?). */
|
|
|
|
while (*p != ':')
|
|
|
|
p++;
|
|
|
|
|
|
|
|
/* Skip over the colon. */
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
|
1991-12-24 07:16:58 +08:00
|
|
|
/* We have found an enumerated type. */
|
|
|
|
/* According to comments in read_enum_type
|
|
|
|
a comma could end it instead of a semicolon.
|
|
|
|
I don't know where that happens.
|
|
|
|
Accept either. */
|
|
|
|
while (*p && *p != ';' && *p != ',')
|
|
|
|
{
|
|
|
|
char *q;
|
|
|
|
|
|
|
|
/* Check for and handle cretinous dbx symbol name
|
|
|
|
continuation! */
|
1994-01-26 01:28:05 +08:00
|
|
|
if (*p == '\\' || (*p == '?' && p[1] == '\0'))
|
1991-12-24 07:16:58 +08:00
|
|
|
p = next_symbol_text ();
|
|
|
|
|
|
|
|
/* Point to the character after the name
|
|
|
|
of the enum constant. */
|
|
|
|
for (q = p; *q && *q != ':'; q++)
|
|
|
|
;
|
|
|
|
/* Note that the value doesn't matter for
|
|
|
|
enum constants in psymtabs, just in symtabs. */
|
|
|
|
ADD_PSYMBOL_TO_LIST (p, q - p,
|
|
|
|
VAR_NAMESPACE, LOC_CONST,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->static_psymbols, 0,
|
|
|
|
psymtab_language, objfile);
|
1991-12-24 07:16:58 +08:00
|
|
|
/* Point past the name. */
|
|
|
|
p = q;
|
|
|
|
/* Skip over the value. */
|
|
|
|
while (*p && *p != ',')
|
|
|
|
p++;
|
|
|
|
/* Advance past the comma. */
|
|
|
|
if (*p)
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
case 'c':
|
|
|
|
/* Constant, e.g. from "const" in Pascal. */
|
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_CONST,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->static_psymbols, CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case 'f':
|
* infrun.c (IN_SOLIB_TRAMPOLINE): Correct comment, trampolines
are in the .plt section.
* minsyms.c (lookup_solib_trampoline_symbol_by_pc,
find_solib_trampoline_target): New functions for handling
stepping into -g compiled shared libraries.
* symtab.h (lookup_solib_trampoline_symbol_by_pc,
find_solib_trampoline_target): Add prototypes.
* config/tm-sunos.h (IN_SOLIB_TRAMPOLINE, SKIP_TRAMPOLINE_CODE):
Define to handle stepping into -g compiled shared libraries.
* config/tm-sysv4.h (SKIP_TRAMPOLINE_CODE): Define to handle
stepping into -g compiled shared libraries.
* configure.in: Add mips-*-sysv4* support.
* config/mips/mipsv4.mh, config/mips/mipsv4.mt,
config/mips/tm-mipsv4.h, config/mips/xm-mipsv4.h, mipsv4-nat.c:
New files for MIPS SVR4 support.
* Makefile.in: Update for new mipsv4 files.
* alpha-tdep.c (heuristic_proc_desc, find_proc_desc): Use
read_next_frame_reg to obtain the frame relative stack pointer.
* mips-tdep.c (heuristic_proc_desc): Use read_next_frame_reg to
obtain the frame relative stack pointer.
* mdebugread.c (parse_partial_symbols, psymtab_to_symtab1):
Handle stStatic and stStaticProc symbols in stabs-in-ecoff output
by entering them into the minimal symbol table.
* printcmd.c (print_scalar_formatted): Do not try to unpack to
a long for float formats.
* solib.c: Include "elf/mips.h" only if DT_MIPS_RLD_MAP does not
get defined in <link.h>.
* solib.c (solib_add): Add shared library sections to the section
table of the target before adding the symbols.
* partial-stab.h: Relocate static and global functions.
* dbxread.c (read_dbx_symtab): Remove unused variable
end_of_text_address. Relocate text_addr when passing it
to end_psymtab.
For Alpha OSF/1 targets, enable gdb to set breakpoints in shared
library functions before the executable is run. Retrieve dynamic
symbols from stripped executables.
* mipsread.c (read_alphacoff_dynamic_symtab): New function.
* mipsread.c (mipscoff_symfile_read): Use it. Issue warning message
if no debugging symbols were found.
* alpha-tdep.c (alpha_skip_prologue): Silently return the unaltered
pc if memory at the pc is not accessible and GDB_TARGET_HAS_SHARED_LIBS
is defined.
* config/alpha/nm-alpha.h (GDB_TARGET_HAS_SHARED_LIBS): Define,
OSF/1 has shared libraries.
1994-04-08 08:35:15 +08:00
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
|
|
|
/* Kludges for ELF/STABS with Sun ACC */
|
|
|
|
last_function_name = namestring;
|
* config/sparc/tm-sun4sol2.h, dbxread.c: Rename
N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING.
* symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add
filename field.
* elfread.c (record_minimal_symbol_and_info),
minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return
newly created symbol.
* elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]:
Set filename field of minimal symbol.
* symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]:
Print filename field.
* minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile.
* symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y,
m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c,
os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c,
printcmd.c, dbxread.c: Change callers to pass NULL for sfile.
* dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
Find address of function from minimal symbols.
* partial-stab.h, case 'f', 'F': Call find_stab_function_addr
instead of getting pst->textlow from the stab.
* minsyms.c (find_stab_function_addr): New function.
1995-02-09 15:00:45 +08:00
|
|
|
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
1994-04-27 01:14:52 +08:00
|
|
|
/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
|
|
|
|
value for the bottom of the text seg in those cases. */
|
|
|
|
if (pst && pst->textlow == 0 && !symfile_relocatable)
|
* config/sparc/tm-sun4sol2.h, dbxread.c: Rename
N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING.
* symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add
filename field.
* elfread.c (record_minimal_symbol_and_info),
minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return
newly created symbol.
* elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]:
Set filename field of minimal symbol.
* symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]:
Print filename field.
* minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile.
* symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y,
m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c,
os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c,
printcmd.c, dbxread.c: Change callers to pass NULL for sfile.
* dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
Find address of function from minimal symbols.
* partial-stab.h, case 'f', 'F': Call find_stab_function_addr
instead of getting pst->textlow from the stab.
* minsyms.c (find_stab_function_addr): New function.
1995-02-09 15:00:45 +08:00
|
|
|
pst->textlow =
|
|
|
|
find_stab_function_addr (namestring, pst, objfile);
|
|
|
|
#endif
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
#if 0
|
|
|
|
if (startup_file_end == 0)
|
|
|
|
startup_file_end = CUR_SYMBOL_VALUE;
|
|
|
|
#endif
|
|
|
|
/* End kludge. */
|
|
|
|
#endif /* DBXREAD_ONLY */
|
1991-12-24 07:16:58 +08:00
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_BLOCK,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->static_psymbols, CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Global functions were ignored here, but now they
|
|
|
|
are put into the global psymtab like one would expect.
|
1993-04-15 17:41:59 +08:00
|
|
|
They're also in the minimal symbol table. */
|
1991-12-24 07:16:58 +08:00
|
|
|
case 'F':
|
* infrun.c (IN_SOLIB_TRAMPOLINE): Correct comment, trampolines
are in the .plt section.
* minsyms.c (lookup_solib_trampoline_symbol_by_pc,
find_solib_trampoline_target): New functions for handling
stepping into -g compiled shared libraries.
* symtab.h (lookup_solib_trampoline_symbol_by_pc,
find_solib_trampoline_target): Add prototypes.
* config/tm-sunos.h (IN_SOLIB_TRAMPOLINE, SKIP_TRAMPOLINE_CODE):
Define to handle stepping into -g compiled shared libraries.
* config/tm-sysv4.h (SKIP_TRAMPOLINE_CODE): Define to handle
stepping into -g compiled shared libraries.
* configure.in: Add mips-*-sysv4* support.
* config/mips/mipsv4.mh, config/mips/mipsv4.mt,
config/mips/tm-mipsv4.h, config/mips/xm-mipsv4.h, mipsv4-nat.c:
New files for MIPS SVR4 support.
* Makefile.in: Update for new mipsv4 files.
* alpha-tdep.c (heuristic_proc_desc, find_proc_desc): Use
read_next_frame_reg to obtain the frame relative stack pointer.
* mips-tdep.c (heuristic_proc_desc): Use read_next_frame_reg to
obtain the frame relative stack pointer.
* mdebugread.c (parse_partial_symbols, psymtab_to_symtab1):
Handle stStatic and stStaticProc symbols in stabs-in-ecoff output
by entering them into the minimal symbol table.
* printcmd.c (print_scalar_formatted): Do not try to unpack to
a long for float formats.
* solib.c: Include "elf/mips.h" only if DT_MIPS_RLD_MAP does not
get defined in <link.h>.
* solib.c (solib_add): Add shared library sections to the section
table of the target before adding the symbols.
* partial-stab.h: Relocate static and global functions.
* dbxread.c (read_dbx_symtab): Remove unused variable
end_of_text_address. Relocate text_addr when passing it
to end_psymtab.
For Alpha OSF/1 targets, enable gdb to set breakpoints in shared
library functions before the executable is run. Retrieve dynamic
symbols from stripped executables.
* mipsread.c (read_alphacoff_dynamic_symtab): New function.
* mipsread.c (mipscoff_symfile_read): Use it. Issue warning message
if no debugging symbols were found.
* alpha-tdep.c (alpha_skip_prologue): Silently return the unaltered
pc if memory at the pc is not accessible and GDB_TARGET_HAS_SHARED_LIBS
is defined.
* config/alpha/nm-alpha.h (GDB_TARGET_HAS_SHARED_LIBS): Define,
OSF/1 has shared libraries.
1994-04-08 08:35:15 +08:00
|
|
|
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
|
|
|
/* Kludges for ELF/STABS with Sun ACC */
|
|
|
|
last_function_name = namestring;
|
* config/sparc/tm-sun4sol2.h, dbxread.c: Rename
N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING.
* symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add
filename field.
* elfread.c (record_minimal_symbol_and_info),
minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return
newly created symbol.
* elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]:
Set filename field of minimal symbol.
* symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]:
Print filename field.
* minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile.
* symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y,
m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c,
os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c,
printcmd.c, dbxread.c: Change callers to pass NULL for sfile.
* dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
Find address of function from minimal symbols.
* partial-stab.h, case 'f', 'F': Call find_stab_function_addr
instead of getting pst->textlow from the stab.
* minsyms.c (find_stab_function_addr): New function.
1995-02-09 15:00:45 +08:00
|
|
|
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
1994-04-27 01:14:52 +08:00
|
|
|
/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
|
|
|
|
value for the bottom of the text seg in those cases. */
|
|
|
|
if (pst && pst->textlow == 0 && !symfile_relocatable)
|
* config/sparc/tm-sun4sol2.h, dbxread.c: Rename
N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING.
* symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add
filename field.
* elfread.c (record_minimal_symbol_and_info),
minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return
newly created symbol.
* elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]:
Set filename field of minimal symbol.
* symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]:
Print filename field.
* minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile.
* symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y,
m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c,
os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c,
printcmd.c, dbxread.c: Change callers to pass NULL for sfile.
* dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
Find address of function from minimal symbols.
* partial-stab.h, case 'f', 'F': Call find_stab_function_addr
instead of getting pst->textlow from the stab.
* minsyms.c (find_stab_function_addr): New function.
1995-02-09 15:00:45 +08:00
|
|
|
pst->textlow =
|
|
|
|
find_stab_function_addr (namestring, pst, objfile);
|
|
|
|
#endif
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
#if 0
|
|
|
|
if (startup_file_end == 0)
|
|
|
|
startup_file_end = CUR_SYMBOL_VALUE;
|
|
|
|
#endif
|
|
|
|
/* End kludge. */
|
|
|
|
#endif /* DBXREAD_ONLY */
|
1991-12-24 07:16:58 +08:00
|
|
|
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
|
|
|
|
VAR_NAMESPACE, LOC_BLOCK,
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
objfile->global_psymbols, CUR_SYMBOL_VALUE,
|
|
|
|
psymtab_language, objfile);
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Two things show up here (hopefully); static symbols of
|
|
|
|
local scope (static used inside braces) or extensions
|
|
|
|
of structure symbols. We can ignore both. */
|
|
|
|
case 'V':
|
|
|
|
case '(':
|
|
|
|
case '0':
|
|
|
|
case '1':
|
|
|
|
case '2':
|
|
|
|
case '3':
|
|
|
|
case '4':
|
|
|
|
case '5':
|
|
|
|
case '6':
|
|
|
|
case '7':
|
|
|
|
case '8':
|
|
|
|
case '9':
|
1995-05-18 13:24:29 +08:00
|
|
|
case '-':
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
1993-11-13 06:30:05 +08:00
|
|
|
case ':':
|
|
|
|
/* It is a C++ nested symbol. We don't need to record it
|
|
|
|
(I don't think); if we try to look up foo::bar::baz,
|
|
|
|
then symbols for the symtab containing foo should get
|
|
|
|
read in, I think. */
|
|
|
|
/* Someone says sun cc puts out symbols like
|
1991-12-24 07:16:58 +08:00
|
|
|
/foo/baz/maclib::/usr/local/bin/maclib,
|
|
|
|
which would get here with a symbol type of ':'. */
|
1993-11-13 06:30:05 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unexpected symbol descriptor. The second and subsequent stabs
|
|
|
|
of a continued stab can show up here. The question is
|
|
|
|
whether they ever can mimic a normal stab--it would be
|
|
|
|
nice if not, since we certainly don't want to spend the
|
|
|
|
time searching to the end of every string looking for
|
|
|
|
a backslash. */
|
|
|
|
|
1993-04-15 17:41:59 +08:00
|
|
|
complain (&unknown_symchar_complaint, p[1]);
|
1993-11-13 06:30:05 +08:00
|
|
|
|
|
|
|
/* Ignore it; perhaps it is an extension that we don't
|
|
|
|
know about. */
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
case N_EXCL:
|
1991-12-28 05:11:37 +08:00
|
|
|
#ifdef DBXREAD_ONLY
|
1991-12-24 07:16:58 +08:00
|
|
|
|
|
|
|
SET_NAMESTRING();
|
|
|
|
|
|
|
|
/* Find the corresponding bincl and mark that psymtab on the
|
|
|
|
psymtab dependency list */
|
|
|
|
{
|
|
|
|
struct partial_symtab *needed_pst =
|
|
|
|
find_corresponding_bincl_psymtab (namestring, CUR_SYMBOL_VALUE);
|
|
|
|
|
|
|
|
/* If this include file was defined earlier in this file,
|
|
|
|
leave it alone. */
|
|
|
|
if (needed_pst == pst) continue;
|
|
|
|
|
|
|
|
if (needed_pst)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int found = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < dependencies_used; i++)
|
|
|
|
if (dependency_list[i] == needed_pst)
|
|
|
|
{
|
|
|
|
found = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If it's already in the list, skip the rest. */
|
|
|
|
if (found) continue;
|
|
|
|
|
|
|
|
dependency_list[dependencies_used++] = needed_pst;
|
|
|
|
if (dependencies_used >= dependencies_allocated)
|
|
|
|
{
|
|
|
|
struct partial_symtab **orig = dependency_list;
|
|
|
|
dependency_list =
|
|
|
|
(struct partial_symtab **)
|
|
|
|
alloca ((dependencies_allocated *= 2)
|
|
|
|
* sizeof (struct partial_symtab *));
|
1992-03-30 07:26:47 +08:00
|
|
|
memcpy ((PTR)dependency_list, (PTR)orig,
|
1991-12-24 07:16:58 +08:00
|
|
|
(dependencies_used
|
|
|
|
* sizeof (struct partial_symtab *)));
|
|
|
|
#ifdef DEBUG_INFO
|
1993-11-02 06:25:23 +08:00
|
|
|
fprintf_unfiltered (gdb_stderr, "Had to reallocate dependency list.\n");
|
|
|
|
fprintf_unfiltered (gdb_stderr, "New dependencies allocated: %d\n",
|
1991-12-24 07:16:58 +08:00
|
|
|
dependencies_allocated);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1991-12-28 05:11:37 +08:00
|
|
|
#endif /* DBXREAD_ONLY */
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case N_RBRAC:
|
|
|
|
#ifdef HANDLE_RBRAC
|
|
|
|
HANDLE_RBRAC(CUR_SYMBOL_VALUE);
|
1991-12-28 05:11:37 +08:00
|
|
|
continue;
|
1991-12-24 07:16:58 +08:00
|
|
|
#endif
|
|
|
|
case N_EINCL:
|
|
|
|
case N_DSLINE:
|
|
|
|
case N_BSLINE:
|
|
|
|
case N_SSYM: /* Claim: Structure or union element.
|
|
|
|
Hopefully, I can ignore this. */
|
|
|
|
case N_ENTRY: /* Alternate entry point; can ignore. */
|
|
|
|
case N_MAIN: /* Can definitely ignore this. */
|
|
|
|
case N_CATCH: /* These are GNU C++ extensions */
|
|
|
|
case N_EHDECL: /* that can safely be ignored here. */
|
|
|
|
case N_LENG:
|
|
|
|
case N_BCOMM:
|
|
|
|
case N_ECOMM:
|
|
|
|
case N_ECOML:
|
|
|
|
case N_FNAME:
|
|
|
|
case N_SLINE:
|
|
|
|
case N_RSYM:
|
|
|
|
case N_PSYM:
|
|
|
|
case N_LBRAC:
|
|
|
|
case N_NSYMS: /* Ultrix 4.0: symbol count */
|
|
|
|
case N_DEFD: /* GNU Modula-2 */
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
|
1992-07-03 15:08:31 +08:00
|
|
|
case N_OBJ: /* useless types from Solaris */
|
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file): Convert error() to complain()t.
(dbx_symfile_read): Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init): Record symbol size and count via the objfile.
(dbx_next_symbol_text): Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab): Initialize file_string_table_offset to 0.
(SET_NAMESTRING): Use the offset.
(end_psymtab): Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1): Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab): Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol): Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT): Ignore.
(elfstab_build_psymtabs): New function to read stabs out of
an ELF file.
* Makefile.in: Accept $(BISON) even though we really want $(YACC).
(gdb): use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT): Ignore.
('f', 'F'): Save last function name.
* symfile.h: Prototype elfstab_build_psymtabs.
* symfile.c: Add almost-OK debug versions of add_psymbol_*to_list.
* xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 14:39:27 +08:00
|
|
|
case N_OPT:
|
1992-07-03 15:08:31 +08:00
|
|
|
case N_ENDM:
|
1991-12-24 07:16:58 +08:00
|
|
|
/* These symbols aren't interesting; don't worry about them */
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* If we haven't found it yet, ignore it. It's probably some
|
|
|
|
new type we don't know about yet. */
|
* complaints.c: New file, code moved from utils.c.
* complaints.c (complain): Made into a varargs function.
* complaints.h: New file, code moved from symfile.h.
* Makefile.in (SFILES_MAINDIR): Add complaints.c.
* Makefile.in (HFILES): Add complaints.h.
* Makefile.in (OBS): Add complaints.o.
* symfile.c (complaint_root, stop_whining, complaint_series,
complain, clear_complaints, add_show_from_set for stop_whining):
Moved to complaints.c.
* symfile.h (struct complaint, complaint_root decl, complain
prototype, clear_complaints prototype): Moved to complaints.h.
* buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c,
gdbtypes.c, mipsread.c, stbsread.c, symfile.c: Include
complaints.h. Remove casts from arguments to complain(),
which is now a varargs function, and remove unnecessary
placeholder zero args.
* defs.h (begin_line): Add prototype.
* defs.h (vprintf_filtered): Add prototype.
* dwarfread.c (varargs.h): Remove, no longer needed.
* dwarfread.c (dwarfwarn): Remove prototype and function.
* dwarfread.c (complaints): Define a bunch of complaints.
* dwarfread.c (SQUAWK): Remove macro defs, convert all
usages to standard complain() calls.
* utils.c (begin_line): New function that ensures that
whatever gets filter-printed next starts on its own line.
* utils.c (vprintf_filtered): New func, like vfprintf_filtered,
but to stdout (calls vfprintf_filtered internally).
1992-12-15 20:18:53 +08:00
|
|
|
complain (&unknown_symtype_complaint,
|
Fix many sins which will come up in 32 bit x 64 bit GDB, and
various miscellaneous things discovered in the process:
* printcmd.c, defs.h (print_address_numeric): New function.
* c-valprint.c (c_val_print), ch-valprint.c (chill_val_print)
breakpoint.c (describe_other_breakpoints, breakpoint_1, mention),
cp-valprint.c (cplus_print_value), infcmd.c (jump_command),
printcmd.c, stack.c, symfile.c, symmisc.c, valprint.c:
Use it.
* utils.c, defs.h (gdb_print_address): New function.
* expprint (dump_expression), gdbtypes.h: Use it.
* breakpoint.c (describe_other_breakpoints),
symmisc.c (dump_symtab, print_symbol):
Use filtered not unfiltered I/O.
(remove_breakpoints): Remove BREAKPOINT_DEBUG code. Might as well
just run gdb under a debugger for this (and it had problems with
printing addresses, how to print b->shadow, etc.).
* buildsym.c (make_blockvector), core.c (memory_error),
exec.c (print_section_info), maint.c (print_section_table),
mdebugread.c (parse_procedure), solib.c, source.c, symfile.c,
symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
Add comments saying code is broken. Marked with "FIXME-32x64".
* dbxread.c (process_one_symbol), partial-stab.h (default),
remote-vx.c (vx_run_files_info):
Don't cast int being passed to local_hex_string.
* symmisc.c (print_symbol): Don't cast long being passed to %lx.
* symtab.h (general_symbol_info): Add comment about SYMBOL_VALUE
only being a long.
* symmisc.c (print_symbol): Print "offset" in message for LOC_ARG
and LOC_LOCAL.
* printcmd.c (print_address): Remove #if 0 code with ADDR_BITS_REMOVE.
* source.c: Include <sys/types.h> regardless of USG.
1994-01-27 08:36:05 +08:00
|
|
|
local_hex_string (CUR_SYMBOL_TYPE));
|
1991-12-24 07:16:58 +08:00
|
|
|
continue;
|
|
|
|
}
|