* dbxread.c (process_one_symbol): Fix a few coding standard
issues. Improve code formatting.
This commit is contained in:
parent
91f54576a2
commit
e31272c3a6
2 changed files with 159 additions and 143 deletions
|
@ -1,5 +1,8 @@
|
||||||
2004-11-20 Mark Kettenis <kettenis@gnu.org>
|
2004-11-20 Mark Kettenis <kettenis@gnu.org>
|
||||||
|
|
||||||
|
* dbxread.c (process_one_symbol): Fix a few coding standard
|
||||||
|
issues. Improve code formatting.
|
||||||
|
|
||||||
* dbxread.c: Include "gdb_string.h".
|
* dbxread.c: Include "gdb_string.h".
|
||||||
(record_minimal_symbol, read_ofile_symtab): Replace
|
(record_minimal_symbol, read_ofile_symtab): Replace
|
||||||
DEPRECATED_STREQ and DEPRECATED_STREQN with strcmp and strncmp.
|
DEPRECATED_STREQ and DEPRECATED_STREQN with strcmp and strncmp.
|
||||||
|
|
299
gdb/dbxread.c
299
gdb/dbxread.c
|
@ -2635,14 +2635,13 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||||
DESC is the desc field of the ".stab" entry.
|
DESC is the desc field of the ".stab" entry.
|
||||||
VALU is the value field of the ".stab" entry.
|
VALU is the value field of the ".stab" entry.
|
||||||
NAME is the symbol name, in our address space.
|
NAME is the symbol name, in our address space.
|
||||||
SECTION_OFFSETS is a set of amounts by which the sections of this object
|
SECTION_OFFSETS is a set of amounts by which the sections of this
|
||||||
file were relocated when it was loaded into memory.
|
object file were relocated when it was loaded into memory. Note
|
||||||
Note that these section_offsets are not the
|
that these section_offsets are not the objfile->section_offsets but
|
||||||
objfile->section_offsets but the pst->section_offsets.
|
the pst->section_offsets. All symbols that refer to memory
|
||||||
All symbols that refer
|
locations need to be offset by these amounts.
|
||||||
to memory locations need to be offset by these amounts.
|
OBJFILE is the object file from which we are reading symbols. It
|
||||||
OBJFILE is the object file from which we are reading symbols.
|
is used in end_symtab. */
|
||||||
It is used in end_symtab. */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
|
@ -2650,15 +2649,16 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
struct objfile *objfile)
|
struct objfile *objfile)
|
||||||
{
|
{
|
||||||
struct context_stack *new;
|
struct context_stack *new;
|
||||||
/* This remembers the address of the start of a function. It is used
|
/* This remembers the address of the start of a function. It is
|
||||||
because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries are
|
used because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries
|
||||||
relative to the current function's start address. On systems
|
are relative to the current function's start address. On systems
|
||||||
other than Solaris 2, this just holds the SECT_OFF_TEXT value, and is
|
other than Solaris 2, this just holds the SECT_OFF_TEXT value,
|
||||||
used to relocate these symbol types rather than SECTION_OFFSETS. */
|
and is used to relocate these symbol types rather than
|
||||||
|
SECTION_OFFSETS. */
|
||||||
static CORE_ADDR function_start_offset;
|
static CORE_ADDR function_start_offset;
|
||||||
|
|
||||||
/* This holds the address of the start of a function, without the system
|
/* This holds the address of the start of a function, without the
|
||||||
peculiarities of function_start_offset. */
|
system peculiarities of function_start_offset. */
|
||||||
static CORE_ADDR last_function_start;
|
static CORE_ADDR last_function_start;
|
||||||
|
|
||||||
/* If this is nonzero, we've seen an N_SLINE since the start of the
|
/* If this is nonzero, we've seen an N_SLINE since the start of the
|
||||||
|
@ -2667,8 +2667,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
value is. */
|
value is. */
|
||||||
static int sline_found_in_function = 1;
|
static int sline_found_in_function = 1;
|
||||||
|
|
||||||
/* If this is nonzero, we've seen a non-gcc N_OPT symbol for this source
|
/* If this is nonzero, we've seen a non-gcc N_OPT symbol for this
|
||||||
file. Used to detect the SunPRO solaris compiler. */
|
source file. Used to detect the SunPRO solaris compiler. */
|
||||||
static int n_opt_found;
|
static int n_opt_found;
|
||||||
|
|
||||||
/* The stab type used for the definition of the last function.
|
/* The stab type used for the definition of the last function.
|
||||||
|
@ -2676,12 +2676,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
static int function_stab_type = 0;
|
static int function_stab_type = 0;
|
||||||
|
|
||||||
if (!block_address_function_relative)
|
if (!block_address_function_relative)
|
||||||
/* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
|
{
|
||||||
function start address, so just use the text offset. */
|
/* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
|
||||||
function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
function start address, so just use the text offset. */
|
||||||
|
function_start_offset =
|
||||||
|
ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
|
}
|
||||||
|
|
||||||
/* Something is wrong if we see real data before
|
/* Something is wrong if we see real data before seeing a source
|
||||||
seeing a source file name. */
|
file name. */
|
||||||
|
|
||||||
if (last_source_file == NULL && type != (unsigned char) N_SO)
|
if (last_source_file == NULL && type != (unsigned char) N_SO)
|
||||||
{
|
{
|
||||||
|
@ -2699,8 +2702,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
|
|
||||||
if (*name == '\000')
|
if (*name == '\000')
|
||||||
{
|
{
|
||||||
/* This N_FUN marks the end of a function. This closes off the
|
/* This N_FUN marks the end of a function. This closes off
|
||||||
current block. */
|
the current block. */
|
||||||
|
|
||||||
if (context_stack_depth <= 0)
|
if (context_stack_depth <= 0)
|
||||||
{
|
{
|
||||||
|
@ -2710,8 +2713,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
|
|
||||||
/* The following check is added before recording line 0 at
|
/* The following check is added before recording line 0 at
|
||||||
end of function so as to handle hand-generated stabs
|
end of function so as to handle hand-generated stabs
|
||||||
which may have an N_FUN stabs at the end of the function, but
|
which may have an N_FUN stabs at the end of the function,
|
||||||
no N_SLINE stabs. */
|
but no N_SLINE stabs. */
|
||||||
if (sline_found_in_function)
|
if (sline_found_in_function)
|
||||||
record_line (current_subfile, 0, last_function_start + valu);
|
record_line (current_subfile, 0, last_function_start + valu);
|
||||||
|
|
||||||
|
@ -2733,7 +2736,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
|
|
||||||
sline_found_in_function = 0;
|
sline_found_in_function = 0;
|
||||||
|
|
||||||
/* Relocate for dynamic loading */
|
/* Relocate for dynamic loading. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
valu = SMASH_TEXT_ADDRESS (valu);
|
valu = SMASH_TEXT_ADDRESS (valu);
|
||||||
last_function_start = valu;
|
last_function_start = valu;
|
||||||
|
@ -2786,16 +2789,16 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
lbrac_mismatch_complaint (symnum);
|
lbrac_mismatch_complaint (symnum);
|
||||||
|
|
||||||
/* Some compilers put the variable decls inside of an
|
/* Some compilers put the variable decls inside of an
|
||||||
LBRAC/RBRAC block. This macro should be nonzero if this
|
LBRAC/RBRAC block. This macro should be nonzero if this is
|
||||||
is true. DESC is N_DESC from the N_RBRAC symbol.
|
true. DESC is N_DESC from the N_RBRAC symbol. GCC_P is true
|
||||||
GCC_P is true if we've detected the GCC_COMPILED_SYMBOL
|
if we've detected the GCC_COMPILED_SYMBOL or the
|
||||||
or the GCC2_COMPILED_SYMBOL. */
|
GCC2_COMPILED_SYMBOL. */
|
||||||
#if !defined (VARIABLES_INSIDE_BLOCK)
|
#if !defined (VARIABLES_INSIDE_BLOCK)
|
||||||
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) 0
|
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Can only use new->locals as local symbols here if we're in
|
/* Can only use new->locals as local symbols here if we're in
|
||||||
gcc or on a machine that puts them before the lbrack. */
|
GCC or on a machine that puts them before the lbrack. */
|
||||||
if (!VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
|
if (!VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
|
||||||
{
|
{
|
||||||
if (local_symbols != NULL)
|
if (local_symbols != NULL)
|
||||||
|
@ -2808,8 +2811,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
symbols within an LBRAC/RBRAC block; this complaint
|
symbols within an LBRAC/RBRAC block; this complaint
|
||||||
might also help sort out problems in which
|
might also help sort out problems in which
|
||||||
VARIABLES_INSIDE_BLOCK is incorrectly defined. */
|
VARIABLES_INSIDE_BLOCK is incorrectly defined. */
|
||||||
complaint (&symfile_complaints,
|
complaint (&symfile_complaints, "\
|
||||||
"misplaced N_LBRAC entry; discarding local symbols which have no enclosing block");
|
misplaced N_LBRAC entry; discarding local symbols which have \
|
||||||
|
no enclosing block");
|
||||||
}
|
}
|
||||||
local_symbols = new->locals;
|
local_symbols = new->locals;
|
||||||
}
|
}
|
||||||
|
@ -2817,16 +2821,17 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
if (context_stack_depth
|
if (context_stack_depth
|
||||||
> !VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
|
> !VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
|
||||||
{
|
{
|
||||||
/* This is not the outermost LBRAC...RBRAC pair in the function,
|
/* This is not the outermost LBRAC...RBRAC pair in the
|
||||||
its local symbols preceded it, and are the ones just recovered
|
function, its local symbols preceded it, and are the ones
|
||||||
from the context stack. Define the block for them (but don't
|
just recovered from the context stack. Define the block
|
||||||
bother if the block contains no symbols. Should we complain
|
for them (but don't bother if the block contains no
|
||||||
on blocks without symbols? I can't think of any useful purpose
|
symbols. Should we complain on blocks without symbols?
|
||||||
for them). */
|
I can't think of any useful purpose for them). */
|
||||||
if (local_symbols != NULL)
|
if (local_symbols != NULL)
|
||||||
{
|
{
|
||||||
/* Muzzle a compiler bug that makes end < start. (which
|
/* Muzzle a compiler bug that makes end < start.
|
||||||
compilers? Is this ever harmful?). */
|
|
||||||
|
??? Which compilers? Is this ever harmful?. */
|
||||||
if (new->start_addr > valu)
|
if (new->start_addr > valu)
|
||||||
{
|
{
|
||||||
complaint (&symfile_complaints,
|
complaint (&symfile_complaints,
|
||||||
|
@ -2854,17 +2859,16 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
|
|
||||||
case N_FN:
|
case N_FN:
|
||||||
case N_FN_SEQ:
|
case N_FN_SEQ:
|
||||||
/* This kind of symbol indicates the start of an object file. */
|
/* This kind of symbol indicates the start of an object file.
|
||||||
/* Relocate for dynamic loading */
|
Relocate for dynamic loading. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case N_SO:
|
case N_SO:
|
||||||
/* This type of symbol indicates the start of data
|
/* This type of symbol indicates the start of data for one
|
||||||
for one source file.
|
source file. Finish the symbol table of the previous source
|
||||||
Finish the symbol table of the previous source file
|
file (if any) and start accumulating a new symbol table.
|
||||||
(if any) and start accumulating a new symbol table. */
|
Relocate for dynamic loading. */
|
||||||
/* Relocate for dynamic loading */
|
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
|
|
||||||
n_opt_found = 0;
|
n_opt_found = 0;
|
||||||
|
@ -2872,9 +2876,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
if (last_source_file)
|
if (last_source_file)
|
||||||
{
|
{
|
||||||
/* Check if previous symbol was also an N_SO (with some
|
/* Check if previous symbol was also an N_SO (with some
|
||||||
sanity checks). If so, that one was actually the directory
|
sanity checks). If so, that one was actually the
|
||||||
name, and the current one is the real file name.
|
directory name, and the current one is the real file
|
||||||
Patch things up. */
|
name. Patch things up. */
|
||||||
if (previous_stab_code == (unsigned char) N_SO)
|
if (previous_stab_code == (unsigned char) N_SO)
|
||||||
{
|
{
|
||||||
patch_subfile_names (current_subfile, name);
|
patch_subfile_names (current_subfile, name);
|
||||||
|
@ -2884,8 +2888,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
end_stabs ();
|
end_stabs ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Null name means this just marks the end of text for this .o file.
|
/* Null name means this just marks the end of text for this .o
|
||||||
Don't start a new symtab in this case. */
|
file. Don't start a new symtab in this case. */
|
||||||
if (*name == '\000')
|
if (*name == '\000')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2898,11 +2902,10 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case N_SOL:
|
case N_SOL:
|
||||||
/* This type of symbol indicates the start of data for
|
/* This type of symbol indicates the start of data for a
|
||||||
a sub-source-file, one whose contents were copied or
|
sub-source-file, one whose contents were copied or included
|
||||||
included in the compilation of the main source file
|
in the compilation of the main source file (whose name was
|
||||||
(whose name was given in the N_SO symbol.) */
|
given in the N_SO symbol). Relocate for dynamic loading. */
|
||||||
/* Relocate for dynamic loading */
|
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
start_subfile (name, current_subfile->dirname);
|
start_subfile (name, current_subfile->dirname);
|
||||||
break;
|
break;
|
||||||
|
@ -2922,11 +2925,12 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case N_SLINE:
|
case N_SLINE:
|
||||||
/* This type of "symbol" really just records
|
/* This type of "symbol" really just records one line-number --
|
||||||
one line-number -- core-address correspondence.
|
core-address correspondence. Enter it in the line list for
|
||||||
Enter it in the line list for this symbol table. */
|
this symbol table. */
|
||||||
|
|
||||||
/* Relocate for dynamic loading and for ELF acc fn-relative syms. */
|
/* Relocate for dynamic loading and for ELF acc
|
||||||
|
function-relative symbols. */
|
||||||
valu += function_start_offset;
|
valu += function_start_offset;
|
||||||
|
|
||||||
/* GCC 2.95.3 emits the first N_SLINE stab somwehere in the
|
/* GCC 2.95.3 emits the first N_SLINE stab somwehere in the
|
||||||
|
@ -2963,28 +2967,31 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
common_block_end (objfile);
|
common_block_end (objfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* The following symbol types need to have the appropriate offset added
|
/* The following symbol types need to have the appropriate
|
||||||
to their value; then we process symbol definitions in the name. */
|
offset added to their value; then we process symbol
|
||||||
|
definitions in the name. */
|
||||||
|
|
||||||
case N_STSYM: /* Static symbol in data seg */
|
case N_STSYM: /* Static symbol in data segment. */
|
||||||
case N_LCSYM: /* Static symbol in BSS seg */
|
case N_LCSYM: /* Static symbol in BSS segment. */
|
||||||
case N_ROSYM: /* Static symbol in Read-only data seg */
|
case N_ROSYM: /* Static symbol in read-only data segment. */
|
||||||
/* HORRID HACK DEPT. However, it's Sun's furgin' fault.
|
/* HORRID HACK DEPT. However, it's Sun's furgin' fault.
|
||||||
Solaris2's stabs-in-elf makes *most* symbols relative
|
Solaris 2's stabs-in-elf makes *most* symbols relative but
|
||||||
but leaves a few absolute (at least for Solaris 2.1 and version
|
leaves a few absolute (at least for Solaris 2.1 and version
|
||||||
2.0.1 of the SunPRO compiler). N_STSYM and friends sit on the fence.
|
2.0.1 of the SunPRO compiler). N_STSYM and friends sit on
|
||||||
.stab "foo:S...",N_STSYM is absolute (ld relocates it)
|
the fence. .stab "foo:S...",N_STSYM is absolute (ld
|
||||||
.stab "foo:V...",N_STSYM is relative (section base subtracted).
|
relocates it) .stab "foo:V...",N_STSYM is relative (section
|
||||||
This leaves us no choice but to search for the 'S' or 'V'...
|
base subtracted). This leaves us no choice but to search for
|
||||||
(or pass the whole section_offsets stuff down ONE MORE function
|
the 'S' or 'V'... (or pass the whole section_offsets stuff
|
||||||
call level, which we really don't want to do). */
|
down ONE MORE function call level, which we really don't want
|
||||||
|
to do). */
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
/* .o files and NLMs have non-zero text seg offsets, but don't need
|
/* Normal object file and NLMs have non-zero text seg offsets,
|
||||||
their static syms offset in this fashion. XXX - This is really a
|
but don't need their static syms offset in this fashion.
|
||||||
crock that should be fixed in the solib handling code so that I
|
XXX - This is really a crock that should be fixed in the
|
||||||
don't have to work around it here. */
|
solib handling code so that I don't have to work around it
|
||||||
|
here. */
|
||||||
|
|
||||||
if (!symfile_relocatable)
|
if (!symfile_relocatable)
|
||||||
{
|
{
|
||||||
|
@ -2992,20 +2999,22 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
if (p != 0 && p[1] == 'S')
|
if (p != 0 && p[1] == 'S')
|
||||||
{
|
{
|
||||||
/* The linker relocated it. We don't want to add an
|
/* The linker relocated it. We don't want to add an
|
||||||
elfstab_offset_sections-type offset, but we *do* want
|
elfstab_offset_sections-type offset, but we *do*
|
||||||
to add whatever solib.c passed to symbol_file_add as
|
want to add whatever solib.c passed to
|
||||||
addr (this is known to affect SunOS4, and I suspect ELF
|
symbol_file_add as addr (this is known to affect
|
||||||
too). Since elfstab_offset_sections currently does not
|
SunOS 4, and I suspect ELF too). Since
|
||||||
muck with the text offset (there is no Ttext.text
|
elfstab_offset_sections currently does not muck
|
||||||
|
with the text offset (there is no Ttext.text
|
||||||
symbol), we can get addr from the text offset. If
|
symbol), we can get addr from the text offset. If
|
||||||
elfstab_offset_sections ever starts dealing with the
|
elfstab_offset_sections ever starts dealing with
|
||||||
text offset, and we still need to do this, we need to
|
the text offset, and we still need to do this, we
|
||||||
invent a SECT_OFF_ADDR_KLUDGE or something. */
|
need to invent a SECT_OFF_ADDR_KLUDGE or something. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
goto define_a_symbol;
|
goto define_a_symbol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Since it's not the kludge case, re-dispatch to the right handler. */
|
/* Since it's not the kludge case, re-dispatch to the right
|
||||||
|
handler. */
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case N_STSYM:
|
case N_STSYM:
|
||||||
|
@ -3015,41 +3024,43 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
case N_ROSYM:
|
case N_ROSYM:
|
||||||
goto case_N_ROSYM;
|
goto case_N_ROSYM;
|
||||||
default:
|
default:
|
||||||
internal_error (__FILE__, __LINE__, "failed internal consistency check");
|
internal_error (__FILE__, __LINE__,
|
||||||
|
"failed internal consistency check");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case_N_STSYM: /* Static symbol in data seg */
|
case_N_STSYM: /* Static symbol in data segment. */
|
||||||
case N_DSLINE: /* Source line number, data seg */
|
case N_DSLINE: /* Source line number, data segment. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
|
||||||
goto define_a_symbol;
|
goto define_a_symbol;
|
||||||
|
|
||||||
case_N_LCSYM: /* Static symbol in BSS seg */
|
case_N_LCSYM: /* Static symbol in BSS segment. */
|
||||||
case N_BSLINE: /* Source line number, bss seg */
|
case N_BSLINE: /* Source line number, BSS segment. */
|
||||||
/* N_BROWS: overlaps with N_BSLINE */
|
/* N_BROWS: overlaps with N_BSLINE. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_BSS (objfile));
|
||||||
goto define_a_symbol;
|
goto define_a_symbol;
|
||||||
|
|
||||||
case_N_ROSYM: /* Static symbol in Read-only data seg */
|
case_N_ROSYM: /* Static symbol in read-only data segment. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_RODATA (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_RODATA (objfile));
|
||||||
goto define_a_symbol;
|
goto define_a_symbol;
|
||||||
|
|
||||||
case N_ENTRY: /* Alternate entry point */
|
case N_ENTRY: /* Alternate entry point. */
|
||||||
/* Relocate for dynamic loading */
|
/* Relocate for dynamic loading. */
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
goto define_a_symbol;
|
goto define_a_symbol;
|
||||||
|
|
||||||
/* The following symbol types we don't know how to process. Handle
|
/* The following symbol types we don't know how to process.
|
||||||
them in a "default" way, but complain to people who care. */
|
Handle them in a "default" way, but complain to people who
|
||||||
|
care. */
|
||||||
default:
|
default:
|
||||||
case N_CATCH: /* Exception handler catcher */
|
case N_CATCH: /* Exception handler catcher. */
|
||||||
case N_EHDECL: /* Exception handler name */
|
case N_EHDECL: /* Exception handler name. */
|
||||||
case N_PC: /* Global symbol in Pascal */
|
case N_PC: /* Global symbol in Pascal. */
|
||||||
case N_M2C: /* Modula-2 compilation unit */
|
case N_M2C: /* Modula-2 compilation unit. */
|
||||||
/* N_MOD2: overlaps with N_EHDECL */
|
/* N_MOD2: overlaps with N_EHDECL. */
|
||||||
case N_SCOPE: /* Modula-2 scope information */
|
case N_SCOPE: /* Modula-2 scope information. */
|
||||||
case N_ECOML: /* End common (local name) */
|
case N_ECOML: /* End common (local name). */
|
||||||
case N_NBTEXT: /* Gould Non-Base-Register symbols??? */
|
case N_NBTEXT: /* Gould Non-Base-Register symbols??? */
|
||||||
case N_NBDATA:
|
case N_NBDATA:
|
||||||
case N_NBBSS:
|
case N_NBBSS:
|
||||||
case N_NBSTS:
|
case N_NBSTS:
|
||||||
|
@ -3057,18 +3068,18 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
unknown_symtype_complaint (hex_string (type));
|
unknown_symtype_complaint (hex_string (type));
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
/* The following symbol types don't need the address field relocated,
|
/* The following symbol types don't need the address field
|
||||||
since it is either unused, or is absolute. */
|
relocated, since it is either unused, or is absolute. */
|
||||||
define_a_symbol:
|
define_a_symbol:
|
||||||
case N_GSYM: /* Global variable */
|
case N_GSYM: /* Global variable. */
|
||||||
case N_NSYMS: /* Number of symbols (ultrix) */
|
case N_NSYMS: /* Number of symbols (Ultrix). */
|
||||||
case N_NOMAP: /* No map? (ultrix) */
|
case N_NOMAP: /* No map? (Ultrix). */
|
||||||
case N_RSYM: /* Register variable */
|
case N_RSYM: /* Register variable. */
|
||||||
case N_DEFD: /* Modula-2 GNU module dependency */
|
case N_DEFD: /* Modula-2 GNU module dependency. */
|
||||||
case N_SSYM: /* Struct or union element */
|
case N_SSYM: /* Struct or union element. */
|
||||||
case N_LSYM: /* Local symbol in stack */
|
case N_LSYM: /* Local symbol in stack. */
|
||||||
case N_PSYM: /* Parameter variable */
|
case N_PSYM: /* Parameter variable. */
|
||||||
case N_LENG: /* Length of preceding symbol type */
|
case N_LENG: /* Length of preceding symbol type. */
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
int deftype;
|
int deftype;
|
||||||
|
@ -3085,29 +3096,31 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
function_stab_type = type;
|
function_stab_type = type;
|
||||||
|
|
||||||
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
|
||||||
/* Deal with the SunPRO 3.0 compiler which omits the address
|
/* Deal with the SunPRO 3.0 compiler which omits the
|
||||||
from N_FUN symbols. */
|
address from N_FUN symbols. */
|
||||||
if (type == N_FUN
|
if (type == N_FUN
|
||||||
&& valu == ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)))
|
&& valu == ANOFFSET (section_offsets,
|
||||||
|
SECT_OFF_TEXT (objfile)))
|
||||||
{
|
{
|
||||||
CORE_ADDR minsym_valu =
|
CORE_ADDR minsym_valu =
|
||||||
find_stab_function_addr (name, last_source_file, objfile);
|
find_stab_function_addr (name, last_source_file, objfile);
|
||||||
|
|
||||||
/* find_stab_function_addr will return 0 if the minimal
|
/* The function find_stab_function_addr will return
|
||||||
symbol wasn't found. (Unfortunately, this might also
|
0 if the minimal symbol wasn't found.
|
||||||
be a valid address.) Anyway, if it *does* return 0,
|
(Unfortunately, this might also be a valid
|
||||||
it is likely that the value was set correctly to begin
|
address.) Anyway, if it *does* return 0, it is
|
||||||
with... */
|
likely that the value was set correctly to begin
|
||||||
|
with... */
|
||||||
if (minsym_valu != 0)
|
if (minsym_valu != 0)
|
||||||
valu = minsym_valu;
|
valu = minsym_valu;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (block_address_function_relative)
|
if (block_address_function_relative)
|
||||||
/* For Solaris 2.0 compilers, the block addresses and
|
/* For Solaris 2 compilers, the block addresses and
|
||||||
N_SLINE's are relative to the start of the
|
N_SLINE's are relative to the start of the
|
||||||
function. On normal systems, and when using gcc on
|
function. On normal systems, and when using GCC on
|
||||||
Solaris 2.0, these addresses are just absolute, or
|
Solaris 2, these addresses are just absolute, or
|
||||||
relative to the N_SO, depending on
|
relative to the N_SO, depending on
|
||||||
BLOCK_ADDRESS_ABSOLUTE. */
|
BLOCK_ADDRESS_ABSOLUTE. */
|
||||||
function_start_offset = valu;
|
function_start_offset = valu;
|
||||||
|
@ -3143,15 +3156,16 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
/* We use N_OPT to carry the gcc2_compiled flag. Sun uses it
|
/* We use N_OPT to carry the gcc2_compiled flag. Sun uses it
|
||||||
for a bunch of other flags, too. Someday we may parse their
|
for a bunch of other flags, too. Someday we may parse their
|
||||||
flags; for now we ignore theirs and hope they'll ignore ours. */
|
flags; for now we ignore theirs and hope they'll ignore ours. */
|
||||||
case N_OPT: /* Solaris 2: Compiler options */
|
case N_OPT: /* Solaris 2: Compiler options. */
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
if (strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)
|
if (strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)
|
||||||
{
|
{
|
||||||
processing_gcc_compilation = 2;
|
processing_gcc_compilation = 2;
|
||||||
#if 0 /* Works, but is experimental. -fnf */
|
#if 0 /* Works, but is experimental. -fnf */
|
||||||
/* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
|
/* For now, stay with AUTO_DEMANGLING for g++ output, as
|
||||||
know whether it will use the old style or v3 mangling. */
|
we don't know whether it will use the old style or v3
|
||||||
|
mangling. */
|
||||||
if (AUTO_DEMANGLING)
|
if (AUTO_DEMANGLING)
|
||||||
{
|
{
|
||||||
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
|
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
|
||||||
|
@ -3177,12 +3191,12 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* The following symbol types can be ignored. */
|
/* The following symbol types can be ignored. */
|
||||||
case N_OBJ: /* Solaris 2: Object file dir and name */
|
case N_OBJ: /* Solaris 2: Object file dir and name. */
|
||||||
case N_PATCH: /* Solaris2: Patch Run Time Checker. */
|
case N_PATCH: /* Solaris 2: Patch Run Time Checker. */
|
||||||
/* N_UNDF: Solaris 2: file separator mark */
|
/* N_UNDF: Solaris 2: File separator mark. */
|
||||||
/* N_UNDF: -- we will never encounter it, since we only process one
|
/* N_UNDF: -- we will never encounter it, since we only process
|
||||||
file's symbols at once. */
|
one file's symbols at once. */
|
||||||
case N_ENDM: /* Solaris 2: End of module */
|
case N_ENDM: /* Solaris 2: End of module. */
|
||||||
case N_ALIAS: /* SunPro F77: alias name, ignore for now. */
|
case N_ALIAS: /* SunPro F77: alias name, ignore for now. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3194,9 +3208,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
symbol. */
|
symbol. */
|
||||||
if (name[0] == '#')
|
if (name[0] == '#')
|
||||||
{
|
{
|
||||||
/* Initialize symbol reference names and determine if this is
|
/* Initialize symbol reference names and determine if this is a
|
||||||
a definition. If symbol reference is being defined, go
|
definition. If a symbol reference is being defined, go ahead
|
||||||
ahead and add it. Otherwise, just return sym. */
|
and add it. Otherwise, just return. */
|
||||||
|
|
||||||
char *s = name;
|
char *s = name;
|
||||||
int refnum;
|
int refnum;
|
||||||
|
@ -3213,7 +3227,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||||
name = s;
|
name = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
previous_stab_code = type;
|
previous_stab_code = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue