mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
* hpread.c (set_namestring): New procedure replacing the
SET_NAMESTRING macro. (hpread_build_psymtabs): Replace calls to SET_NAMESTRING by calls to set_namestring.
This commit is contained in:
@ -1,4 +1,11 @@
|
|||||||
2003-01-10 J. Brobecker <brobecker@gnat.com>
|
2003-01-12 J. Brobecker <brobecker@gnat.com>
|
||||||
|
|
||||||
|
* hpread.c (set_namestring): New procedure replacing the
|
||||||
|
SET_NAMESTRING macro.
|
||||||
|
(hpread_build_psymtabs): Replace calls to SET_NAMESTRING
|
||||||
|
by calls to set_namestring.
|
||||||
|
|
||||||
|
2003-01-11 J. Brobecker <brobecker@gnat.com>
|
||||||
|
|
||||||
* hpread.c (SET_NAMESTRING): Remove an incorrect cast to fix
|
* hpread.c (SET_NAMESTRING): Remove an incorrect cast to fix
|
||||||
a compilation warning.
|
a compilation warning.
|
||||||
|
58
gdb/hpread.c
58
gdb/hpread.c
@ -87,23 +87,6 @@ struct hpread_symfile_info
|
|||||||
#define WITHIN_FUNCTION(o) (HPUX_SYMFILE_INFO(o)->within_function)
|
#define WITHIN_FUNCTION(o) (HPUX_SYMFILE_INFO(o)->within_function)
|
||||||
#define CURRENT_FUNCTION_VALUE(o) (HPUX_SYMFILE_INFO(o)->current_function_value)
|
#define CURRENT_FUNCTION_VALUE(o) (HPUX_SYMFILE_INFO(o)->current_function_value)
|
||||||
|
|
||||||
/* Given the native debug symbol SYM, set NAMEP to the name associated
|
|
||||||
with the debug symbol. Note we may be called with a debug symbol which
|
|
||||||
has no associated name, in that case we return an empty string.
|
|
||||||
|
|
||||||
Also note we "know" that the name for any symbol is always in the
|
|
||||||
same place. Hence we don't have to conditionalize on the symbol type. */
|
|
||||||
#define SET_NAMESTRING(SYM, NAMEP, OBJFILE) \
|
|
||||||
if (! hpread_has_name ((SYM)->dblock.kind)) \
|
|
||||||
*NAMEP = ""; \
|
|
||||||
else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \
|
|
||||||
{ \
|
|
||||||
complaint (&symfile_complaints, "bad string table offset in symbol %d", \
|
|
||||||
symnum); \
|
|
||||||
*NAMEP = ""; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
*NAMEP = (SYM)->dsfile.name + VT (OBJFILE)
|
|
||||||
|
|
||||||
/* We put a pointer to this structure in the read_symtab_private field
|
/* We put a pointer to this structure in the read_symtab_private field
|
||||||
of the psymtab. */
|
of the psymtab. */
|
||||||
@ -155,6 +138,9 @@ lbrac_mismatch_complaint (int arg1)
|
|||||||
|
|
||||||
/* Forward procedure declarations */
|
/* Forward procedure declarations */
|
||||||
|
|
||||||
|
static void set_namestring (union dnttentry *sym, char **namep,
|
||||||
|
struct objfile *objfile);
|
||||||
|
|
||||||
void hpread_symfile_init (struct objfile *);
|
void hpread_symfile_init (struct objfile *);
|
||||||
|
|
||||||
void do_pxdb (bfd *);
|
void do_pxdb (bfd *);
|
||||||
@ -302,6 +288,28 @@ trans_lang (enum hp_language in_lang)
|
|||||||
|
|
||||||
static char main_string[] = "main";
|
static char main_string[] = "main";
|
||||||
|
|
||||||
|
|
||||||
|
/* Given the native debug symbol SYM, set NAMEP to the name associated
|
||||||
|
with the debug symbol. Note we may be called with a debug symbol which
|
||||||
|
has no associated name, in that case we return an empty string. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_namestring (union dnttentry *sym, char **namep, struct objfile *objfile)
|
||||||
|
{
|
||||||
|
/* Note that we "know" that the name for any symbol is always in the same
|
||||||
|
place. Hence we don't have to conditionalize on the symbol type. */
|
||||||
|
if (! hpread_has_name (sym->dblock.kind))
|
||||||
|
*namep = "";
|
||||||
|
else if ((unsigned) sym->dsfile.name >= VT_SIZE (objfile))
|
||||||
|
{
|
||||||
|
complaint (&symfile_complaints, "bad string table offset in symbol %d",
|
||||||
|
symnum);
|
||||||
|
*namep = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*namep = sym->dsfile.name + VT (objfile);
|
||||||
|
}
|
||||||
|
|
||||||
/* Call PXDB to process our file.
|
/* Call PXDB to process our file.
|
||||||
|
|
||||||
Approach copied from DDE's "dbgk_run_pxdb". Note: we
|
Approach copied from DDE's "dbgk_run_pxdb". Note: we
|
||||||
@ -1917,7 +1925,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|
|||||||
|
|
||||||
/* A source file of some kind. Note this may simply
|
/* A source file of some kind. Note this may simply
|
||||||
be an included file. */
|
be an included file. */
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
|
|
||||||
/* Check if this is the source file we are already working
|
/* Check if this is the source file we are already working
|
||||||
with. */
|
with. */
|
||||||
@ -2022,7 +2030,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now begin a new module and a new psymtab for it */
|
/* Now begin a new module and a new psymtab for it */
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
|
valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
|
||||||
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
if (!pst)
|
if (!pst)
|
||||||
@ -2048,7 +2056,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|
|||||||
texthigh = valu;
|
texthigh = valu;
|
||||||
valu = dn_bufp->dfunc.lowaddr +
|
valu = dn_bufp->dfunc.lowaddr +
|
||||||
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
if (dn_bufp->dfunc.global)
|
if (dn_bufp->dfunc.global)
|
||||||
add_psymbol_to_list (namestring, strlen (namestring),
|
add_psymbol_to_list (namestring, strlen (namestring),
|
||||||
VAR_NAMESPACE, LOC_BLOCK,
|
VAR_NAMESPACE, LOC_BLOCK,
|
||||||
@ -2069,7 +2077,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|
|||||||
texthigh = valu;
|
texthigh = valu;
|
||||||
valu = dn_bufp->ddocfunc.lowaddr +
|
valu = dn_bufp->ddocfunc.lowaddr +
|
||||||
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
if (dn_bufp->ddocfunc.global)
|
if (dn_bufp->ddocfunc.global)
|
||||||
add_psymbol_to_list (namestring, strlen (namestring),
|
add_psymbol_to_list (namestring, strlen (namestring),
|
||||||
VAR_NAMESPACE, LOC_BLOCK,
|
VAR_NAMESPACE, LOC_BLOCK,
|
||||||
@ -2143,7 +2151,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|
|||||||
else
|
else
|
||||||
storage = LOC_UNDEF;
|
storage = LOC_UNDEF;
|
||||||
|
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
if (!pst)
|
if (!pst)
|
||||||
{
|
{
|
||||||
pst = hpread_start_psymtab (objfile,
|
pst = hpread_start_psymtab (objfile,
|
||||||
@ -2227,7 +2235,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
|
|||||||
case DNTT_TYPE_MEMENUM:
|
case DNTT_TYPE_MEMENUM:
|
||||||
case DNTT_TYPE_CONST:
|
case DNTT_TYPE_CONST:
|
||||||
/* Constants and members of enumerated types. */
|
/* Constants and members of enumerated types. */
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
if (!pst)
|
if (!pst)
|
||||||
{
|
{
|
||||||
pst = hpread_start_psymtab (objfile,
|
pst = hpread_start_psymtab (objfile,
|
||||||
@ -2827,8 +2835,8 @@ hpread_expand_symtab (struct objfile *objfile, int sym_offset, int sym_size,
|
|||||||
if (dn_bufp->dblock.extension)
|
if (dn_bufp->dblock.extension)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Yow! We call SET_NAMESTRING on things without names! */
|
/* Yow! We call set_namestring on things without names! */
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
set_namestring (dn_bufp, &namestring, objfile);
|
||||||
|
|
||||||
hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets,
|
hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets,
|
||||||
objfile, text_offset, text_size,
|
objfile, text_offset, text_size,
|
||||||
|
Reference in New Issue
Block a user