mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
gdb: rename start_symtab/end_symtab to start_compunit_symtab/end_compunit_symtab
It's a bit confusing because we have both "compunit_symtab" and "symtab" types, and many methods and functions containing "start_symtab" or "end_symtab", which actually deal with compunit_symtabs. I believe this comes from the time before compunit_symtab was introduced, where symtab did the job of both. Rename everything I found containing start_symtab or end_symtab to use start_compunit_symtab or end_compunit_symtab. Change-Id: If3849b156f6433640173085ad479b6a0b085ade2
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
#include "symtab.h"
|
||||
|
||||
/* The work-in-progress of the compunit we are building.
|
||||
This is created first, before any subfiles by start_symtab. */
|
||||
This is created first, before any subfiles by start_compunit_symtab. */
|
||||
|
||||
static struct buildsym_compunit *buildsym_compunit;
|
||||
|
||||
@ -171,11 +171,11 @@ free_buildsym_compunit (void)
|
||||
}
|
||||
|
||||
struct compunit_symtab *
|
||||
end_symtab (CORE_ADDR end_addr, int section)
|
||||
end_compunit_symtab (CORE_ADDR end_addr, int section)
|
||||
{
|
||||
gdb_assert (buildsym_compunit != nullptr);
|
||||
struct compunit_symtab *result
|
||||
= buildsym_compunit->end_symtab (end_addr, section);
|
||||
= buildsym_compunit->end_compunit_symtab (end_addr, section);
|
||||
free_buildsym_compunit ();
|
||||
return result;
|
||||
}
|
||||
@ -213,10 +213,10 @@ record_line (struct subfile *subfile, int line, CORE_ADDR pc)
|
||||
buildsym_compunit->record_line (subfile, line, pc, true);
|
||||
}
|
||||
|
||||
/* Start a new symtab for a new source file in OBJFILE. Called, for example,
|
||||
when a stabs symbol of type N_SO is seen, or when a DWARF
|
||||
TAG_compile_unit DIE is seen. It indicates the start of data for
|
||||
one original source file.
|
||||
/* Start a new compunit_symtab for a new source file in OBJFILE. Called, for
|
||||
example, when a stabs symbol of type N_SO is seen, or when a DWARF
|
||||
DW_TAG_compile_unit DIE is seen. It indicates the start of data for one
|
||||
original source file.
|
||||
|
||||
NAME is the name of the file (cannot be NULL). COMP_DIR is the
|
||||
directory in which the file was compiled (or NULL if not known).
|
||||
@ -226,8 +226,9 @@ record_line (struct subfile *subfile, int line, CORE_ADDR pc)
|
||||
the filename. */
|
||||
|
||||
struct compunit_symtab *
|
||||
start_symtab (struct objfile *objfile, const char *name, const char *comp_dir,
|
||||
CORE_ADDR start_addr, enum language language)
|
||||
start_compunit_symtab (struct objfile *objfile, const char *name,
|
||||
const char *comp_dir, CORE_ADDR start_addr,
|
||||
enum language language)
|
||||
{
|
||||
/* These should have been reset either by successful completion of building
|
||||
a symtab, or by the scoped_free_pendings destructor. */
|
||||
|
@ -30,20 +30,20 @@
|
||||
The basic way this module is used is as follows:
|
||||
|
||||
scoped_free_pendings free_pending;
|
||||
cust = start_symtab (...);
|
||||
cust = start_compunit_symtab (...);
|
||||
... read debug info ...
|
||||
cust = end_symtab (...);
|
||||
cust = end_compunit_symtab (...);
|
||||
|
||||
The compunit symtab pointer ("cust") is returned from both start_symtab
|
||||
and end_symtab to simplify the debug info readers.
|
||||
The compunit symtab pointer ("cust") is returned from both
|
||||
start_compunit_symtab and end_compunit_symtab to simplify the debug info readers.
|
||||
|
||||
dbxread.c and xcoffread.c use another variation:
|
||||
|
||||
scoped_free_pendings free_pending;
|
||||
cust = start_symtab (...);
|
||||
cust = start_compunit_symtab (...);
|
||||
... read debug info ...
|
||||
cust = end_symtab (...);
|
||||
... start_symtab + read + end_symtab repeated ...
|
||||
cust = end_compunit_symtab (...);
|
||||
... start_compunit_symtab + read + end_compunit_symtab repeated ...
|
||||
*/
|
||||
|
||||
class scoped_free_pendings
|
||||
@ -70,7 +70,8 @@ extern void push_subfile ();
|
||||
|
||||
extern const char *pop_subfile ();
|
||||
|
||||
extern struct compunit_symtab *end_symtab (CORE_ADDR end_addr, int section);
|
||||
extern struct compunit_symtab *end_compunit_symtab (CORE_ADDR end_addr,
|
||||
int section);
|
||||
|
||||
extern struct context_stack *push_context (int desc, CORE_ADDR valu);
|
||||
|
||||
@ -78,11 +79,11 @@ extern struct context_stack pop_context ();
|
||||
|
||||
extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc);
|
||||
|
||||
extern struct compunit_symtab *start_symtab (struct objfile *objfile,
|
||||
const char *name,
|
||||
const char *comp_dir,
|
||||
CORE_ADDR start_addr,
|
||||
enum language language);
|
||||
extern struct compunit_symtab *start_compunit_symtab (struct objfile *objfile,
|
||||
const char *name,
|
||||
const char *comp_dir,
|
||||
CORE_ADDR start_addr,
|
||||
enum language language);
|
||||
|
||||
/* Record the name of the debug format in the current pending symbol
|
||||
table. FORMAT must be a string with a lifetime at least as long as
|
||||
@ -106,12 +107,12 @@ extern void set_last_source_file (const char *name);
|
||||
extern const char *get_last_source_file (void);
|
||||
|
||||
/* Set the last source start address. Can only be used between
|
||||
start_symtab and end_symtab* calls. */
|
||||
start_compunit_symtab and end_compunit_symtab* calls. */
|
||||
|
||||
extern void set_last_source_start_addr (CORE_ADDR addr);
|
||||
|
||||
/* Get the last source start address. Can only be used between
|
||||
start_symtab and end_symtab* calls. */
|
||||
start_compunit_symtab and end_compunit_symtab* calls. */
|
||||
|
||||
extern CORE_ADDR get_last_source_start_addr ();
|
||||
|
||||
|
@ -728,7 +728,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
|
||||
}
|
||||
|
||||
|
||||
/* Subroutine of end_symtab to simplify it. Look for a subfile that
|
||||
/* Subroutine of end_compunit_symtab to simplify it. Look for a subfile that
|
||||
matches the main source file's basename. If there is only one, and
|
||||
if the main source file doesn't have any symbol or line number
|
||||
information, then copy this file's symtab and line_vector to the
|
||||
@ -796,13 +796,14 @@ buildsym_compunit::watch_main_source_file_lossage ()
|
||||
}
|
||||
}
|
||||
|
||||
/* Implementation of the first part of end_symtab. It allows modifying
|
||||
STATIC_BLOCK before it gets finalized by end_symtab_from_static_block.
|
||||
If the returned value is NULL there is no blockvector created for
|
||||
this symtab (you still must call end_symtab_from_static_block).
|
||||
/* Implementation of the first part of end_compunit_symtab. It allows modifying
|
||||
STATIC_BLOCK before it gets finalized by
|
||||
end_compunit_symtab_from_static_block. If the returned value is NULL there
|
||||
is no blockvector created for this symtab (you still must call
|
||||
end_compunit_symtab_from_static_block).
|
||||
|
||||
END_ADDR is the same as for end_symtab: the address of the end of the
|
||||
file's text.
|
||||
END_ADDR is the same as for end_compunit_symtab: the address of the end of
|
||||
the file's text.
|
||||
|
||||
If EXPANDABLE is non-zero the STATIC_BLOCK dictionary is made
|
||||
expandable.
|
||||
@ -811,8 +812,9 @@ buildsym_compunit::watch_main_source_file_lossage ()
|
||||
not contain any symbols. */
|
||||
|
||||
struct block *
|
||||
buildsym_compunit::end_symtab_get_static_block (CORE_ADDR end_addr,
|
||||
int expandable, int required)
|
||||
buildsym_compunit::end_compunit_symtab_get_static_block (CORE_ADDR end_addr,
|
||||
int expandable,
|
||||
int required)
|
||||
{
|
||||
/* Finish the lexical context of the last function in the file; pop
|
||||
the context stack. */
|
||||
@ -832,7 +834,7 @@ buildsym_compunit::end_symtab_get_static_block (CORE_ADDR end_addr,
|
||||
same. FIXME: Find out why it is happening. This is not
|
||||
believed to happen in most cases (even for coffread.c);
|
||||
it used to be an abort(). */
|
||||
complaint (_("Context stack not empty in end_symtab"));
|
||||
complaint (_("Context stack not empty in end_compunit_symtab"));
|
||||
m_context_stack.clear ();
|
||||
}
|
||||
}
|
||||
@ -896,13 +898,14 @@ buildsym_compunit::end_symtab_get_static_block (CORE_ADDR end_addr,
|
||||
}
|
||||
}
|
||||
|
||||
/* Subroutine of end_symtab_from_static_block to simplify it.
|
||||
/* Subroutine of end_compunit_symtab_from_static_block to simplify it.
|
||||
Handle the "have blockvector" case.
|
||||
See end_symtab_from_static_block for a description of the arguments. */
|
||||
See end_compunit_symtab_from_static_block for a description of the
|
||||
arguments. */
|
||||
|
||||
struct compunit_symtab *
|
||||
buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
|
||||
int section, int expandable)
|
||||
buildsym_compunit::end_compunit_symtab_with_blockvector
|
||||
(struct block *static_block, int section, int expandable)
|
||||
{
|
||||
struct compunit_symtab *cu = m_compunit_symtab;
|
||||
struct blockvector *blockvector;
|
||||
@ -1057,18 +1060,18 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
|
||||
return cu;
|
||||
}
|
||||
|
||||
/* Implementation of the second part of end_symtab. Pass STATIC_BLOCK
|
||||
as value returned by end_symtab_get_static_block.
|
||||
/* Implementation of the second part of end_compunit_symtab. Pass STATIC_BLOCK
|
||||
as value returned by end_compunit_symtab_get_static_block.
|
||||
|
||||
SECTION is the same as for end_symtab: the section number
|
||||
SECTION is the same as for end_compunit_symtab: the section number
|
||||
(in objfile->section_offsets) of the blockvector and linetable.
|
||||
|
||||
If EXPANDABLE is non-zero the GLOBAL_BLOCK dictionary is made
|
||||
expandable. */
|
||||
|
||||
struct compunit_symtab *
|
||||
buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
|
||||
int section, int expandable)
|
||||
buildsym_compunit::end_compunit_symtab_from_static_block
|
||||
(struct block *static_block, int section, int expandable)
|
||||
{
|
||||
struct compunit_symtab *cu;
|
||||
|
||||
@ -1086,7 +1089,7 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
|
||||
cu = NULL;
|
||||
}
|
||||
else
|
||||
cu = end_symtab_with_blockvector (static_block, section, expandable);
|
||||
cu = end_compunit_symtab_with_blockvector (static_block, section, expandable);
|
||||
|
||||
return cu;
|
||||
}
|
||||
@ -1100,7 +1103,7 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
|
||||
the section number (in objfile->section_offsets) of the blockvector
|
||||
and linetable.
|
||||
|
||||
Note that it is possible for end_symtab() to return NULL. In
|
||||
Note that it is possible for end_compunit_symtab() to return NULL. In
|
||||
particular, for the DWARF case at least, it will return NULL when
|
||||
it finds a compilation unit that has exactly one DIE, a
|
||||
TAG_compile_unit DIE. This can happen when we link in an object
|
||||
@ -1109,27 +1112,28 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
|
||||
never know about this empty file (FIXME).
|
||||
|
||||
If you need to modify STATIC_BLOCK before it is finalized you should
|
||||
call end_symtab_get_static_block and end_symtab_from_static_block
|
||||
yourself. */
|
||||
call end_compunit_symtab_get_static_block and
|
||||
end_compunit_symtab_from_static_block yourself. */
|
||||
|
||||
struct compunit_symtab *
|
||||
buildsym_compunit::end_symtab (CORE_ADDR end_addr, int section)
|
||||
buildsym_compunit::end_compunit_symtab (CORE_ADDR end_addr, int section)
|
||||
{
|
||||
struct block *static_block;
|
||||
|
||||
static_block = end_symtab_get_static_block (end_addr, 0, 0);
|
||||
return end_symtab_from_static_block (static_block, section, 0);
|
||||
static_block = end_compunit_symtab_get_static_block (end_addr, 0, 0);
|
||||
return end_compunit_symtab_from_static_block (static_block, section, 0);
|
||||
}
|
||||
|
||||
/* Same as end_symtab except create a symtab that can be later added to. */
|
||||
/* Same as end_compunit_symtab except create a symtab that can be later added
|
||||
to. */
|
||||
|
||||
struct compunit_symtab *
|
||||
buildsym_compunit::end_expandable_symtab (CORE_ADDR end_addr, int section)
|
||||
{
|
||||
struct block *static_block;
|
||||
|
||||
static_block = end_symtab_get_static_block (end_addr, 1, 0);
|
||||
return end_symtab_from_static_block (static_block, section, 1);
|
||||
static_block = end_compunit_symtab_get_static_block (end_addr, 1, 0);
|
||||
return end_compunit_symtab_from_static_block (static_block, section, 1);
|
||||
}
|
||||
|
||||
/* Subroutine of augment_type_symtab to simplify it.
|
||||
@ -1153,7 +1157,7 @@ set_missing_symtab (struct pending *pending_list,
|
||||
}
|
||||
}
|
||||
|
||||
/* Same as end_symtab, but for the case where we're adding more symbols
|
||||
/* Same as end_compunit_symtab, but for the case where we're adding more symbols
|
||||
to an existing symtab that is known to contain only type information.
|
||||
This is the case for DWARF4 Type Units. */
|
||||
|
||||
|
@ -271,13 +271,13 @@ struct buildsym_compunit
|
||||
|
||||
struct context_stack pop_context ();
|
||||
|
||||
struct block *end_symtab_get_static_block (CORE_ADDR end_addr,
|
||||
int expandable, int required);
|
||||
struct block *end_compunit_symtab_get_static_block
|
||||
(CORE_ADDR end_addr, int expandable, int required);
|
||||
|
||||
struct compunit_symtab *end_symtab_from_static_block
|
||||
(struct block *static_block, int section, int expandable);
|
||||
struct compunit_symtab *end_compunit_symtab_from_static_block
|
||||
(struct block *static_block, int section, int expandable);
|
||||
|
||||
struct compunit_symtab *end_symtab (CORE_ADDR end_addr, int section);
|
||||
struct compunit_symtab *end_compunit_symtab (CORE_ADDR end_addr, int section);
|
||||
|
||||
struct compunit_symtab *end_expandable_symtab (CORE_ADDR end_addr,
|
||||
int section);
|
||||
@ -299,8 +299,8 @@ private:
|
||||
|
||||
void watch_main_source_file_lossage ();
|
||||
|
||||
struct compunit_symtab *end_symtab_with_blockvector
|
||||
(struct block *static_block, int section, int expandable);
|
||||
struct compunit_symtab *end_compunit_symtab_with_blockvector
|
||||
(struct block *static_block, int section, int expandable);
|
||||
|
||||
/* The objfile we're reading debug info from. */
|
||||
struct objfile *m_objfile;
|
||||
|
@ -365,18 +365,18 @@ coff_alloc_type (int index)
|
||||
it indicates the start of data for one original source file. */
|
||||
|
||||
static void
|
||||
coff_start_symtab (struct objfile *objfile, const char *name)
|
||||
coff_start_compunit_symtab (struct objfile *objfile, const char *name)
|
||||
{
|
||||
within_function = 0;
|
||||
start_symtab (objfile,
|
||||
name,
|
||||
start_compunit_symtab (objfile,
|
||||
name,
|
||||
/* We never know the directory name for COFF. */
|
||||
NULL,
|
||||
NULL,
|
||||
/* The start address is irrelevant, since we call
|
||||
set_last_source_start_addr in coff_end_symtab. */
|
||||
0,
|
||||
set_last_source_start_addr in coff_end_compunit_symtab. */
|
||||
0,
|
||||
/* Let buildsym.c deduce the language for this symtab. */
|
||||
language_unknown);
|
||||
language_unknown);
|
||||
record_debugformat ("COFF");
|
||||
}
|
||||
|
||||
@ -400,11 +400,11 @@ complete_symtab (const char *name, CORE_ADDR start_addr, unsigned int size)
|
||||
list of all such. */
|
||||
|
||||
static void
|
||||
coff_end_symtab (struct objfile *objfile)
|
||||
coff_end_compunit_symtab (struct objfile *objfile)
|
||||
{
|
||||
set_last_source_start_addr (current_source_start_addr);
|
||||
|
||||
end_symtab (current_source_end_addr, SECT_OFF_TEXT (objfile));
|
||||
end_compunit_symtab (current_source_end_addr, SECT_OFF_TEXT (objfile));
|
||||
|
||||
/* Reinitialize for beginning of new file. */
|
||||
set_last_source_file (NULL);
|
||||
@ -812,7 +812,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
type_vector_length = INITIAL_TYPE_VECTOR_LENGTH;
|
||||
type_vector = XCNEWVEC (struct type *, type_vector_length);
|
||||
|
||||
coff_start_symtab (objfile, "");
|
||||
coff_start_compunit_symtab (objfile, "");
|
||||
|
||||
symnum = 0;
|
||||
while (symnum < nsyms)
|
||||
@ -824,10 +824,10 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
if (cs->c_symnum == next_file_symnum && cs->c_sclass != C_FILE)
|
||||
{
|
||||
if (get_last_source_file ())
|
||||
coff_end_symtab (objfile);
|
||||
coff_end_compunit_symtab (objfile);
|
||||
|
||||
coff_start_symtab (objfile, "_globals_");
|
||||
/* coff_start_symtab will set the language of this symtab to
|
||||
coff_start_compunit_symtab (objfile, "_globals_");
|
||||
/* coff_start_compunit_symtab will set the language of this symtab to
|
||||
language_unknown, since such a ``file name'' is not
|
||||
recognized. Override that with the minimal language to
|
||||
allow printing values in this symtab. */
|
||||
@ -890,8 +890,8 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
containing debugging information. */
|
||||
if (get_last_source_file ())
|
||||
{
|
||||
coff_end_symtab (objfile);
|
||||
coff_start_symtab (objfile, filestring);
|
||||
coff_end_compunit_symtab (objfile);
|
||||
coff_start_compunit_symtab (objfile, filestring);
|
||||
}
|
||||
in_source_file = 1;
|
||||
break;
|
||||
@ -1170,7 +1170,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
}
|
||||
|
||||
if (get_last_source_file ())
|
||||
coff_end_symtab (objfile);
|
||||
coff_end_compunit_symtab (objfile);
|
||||
|
||||
/* Patch up any opaque types (references to types that are not defined
|
||||
in the file where they are referenced, e.g. "struct foo *bar"). */
|
||||
|
@ -1246,8 +1246,8 @@ get_objfile_text_range (struct objfile *of, int *tsize)
|
||||
/* Start a symtab for OBJFILE in CTF format. */
|
||||
|
||||
static void
|
||||
ctf_start_symtab (ctf_psymtab *pst,
|
||||
struct objfile *of, CORE_ADDR text_offset)
|
||||
ctf_start_compunit_symtab (ctf_psymtab *pst,
|
||||
struct objfile *of, CORE_ADDR text_offset)
|
||||
{
|
||||
struct ctf_context *ccp;
|
||||
|
||||
@ -1263,14 +1263,14 @@ ctf_start_symtab (ctf_psymtab *pst,
|
||||
the .text section number. */
|
||||
|
||||
static struct compunit_symtab *
|
||||
ctf_end_symtab (ctf_psymtab *pst,
|
||||
CORE_ADDR end_addr, int section)
|
||||
ctf_end_compunit_symtab (ctf_psymtab *pst,
|
||||
CORE_ADDR end_addr, int section)
|
||||
{
|
||||
struct ctf_context *ccp;
|
||||
|
||||
ccp = &pst->context;
|
||||
struct compunit_symtab *result
|
||||
= ccp->builder->end_symtab (end_addr, section);
|
||||
= ccp->builder->end_compunit_symtab (end_addr, section);
|
||||
delete ccp->builder;
|
||||
ccp->builder = nullptr;
|
||||
return result;
|
||||
@ -1407,13 +1407,13 @@ ctf_psymtab::read_symtab (struct objfile *objfile)
|
||||
int tsize;
|
||||
|
||||
offset = get_objfile_text_range (objfile, &tsize);
|
||||
ctf_start_symtab (this, objfile, offset);
|
||||
ctf_start_compunit_symtab (this, objfile, offset);
|
||||
expand_psymtab (objfile);
|
||||
|
||||
set_text_low (offset);
|
||||
set_text_high (offset + tsize);
|
||||
compunit_symtab = ctf_end_symtab (this, offset + tsize,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
compunit_symtab = ctf_end_compunit_symtab (this, offset + tsize,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
|
||||
/* Finish up the debug error message. */
|
||||
if (info_verbose)
|
||||
|
@ -2318,8 +2318,8 @@ read_ofile_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
if (get_last_source_start_addr () > text_offset)
|
||||
set_last_source_start_addr (text_offset);
|
||||
|
||||
pst->compunit_symtab = end_symtab (text_offset + text_size,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
pst->compunit_symtab = end_compunit_symtab (text_offset + text_size,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
|
||||
end_stabs ();
|
||||
|
||||
@ -2367,7 +2367,7 @@ cp_set_block_scope (const struct symbol *symbol,
|
||||
the pst->section_offsets. All symbols that refer to memory
|
||||
locations need to be offset by these amounts.
|
||||
OBJFILE is the object file from which we are reading symbols. It
|
||||
is used in end_symtab.
|
||||
is used in end_compunit_symtab.
|
||||
LANGUAGE is the language of the symtab.
|
||||
*/
|
||||
|
||||
@ -2575,7 +2575,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
patch_subfile_names (get_current_subfile (), name);
|
||||
break; /* Ignore repeated SOs. */
|
||||
}
|
||||
end_symtab (valu, SECT_OFF_TEXT (objfile));
|
||||
end_compunit_symtab (valu, SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
}
|
||||
|
||||
@ -2587,7 +2587,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
function_start_offset = 0;
|
||||
|
||||
start_stabs ();
|
||||
start_symtab (objfile, name, NULL, valu, language);
|
||||
start_compunit_symtab (objfile, name, NULL, valu, language);
|
||||
record_debugformat ("stabs");
|
||||
break;
|
||||
|
||||
|
@ -54,8 +54,8 @@ dwarf2_cu::addr_sized_int_type (bool unsigned_p) const
|
||||
buildsym_compunit constructor. */
|
||||
|
||||
struct compunit_symtab *
|
||||
dwarf2_cu::start_symtab (const char *name, const char *comp_dir,
|
||||
CORE_ADDR low_pc)
|
||||
dwarf2_cu::start_compunit_symtab (const char *name, const char *comp_dir,
|
||||
CORE_ADDR low_pc)
|
||||
{
|
||||
gdb_assert (m_builder == nullptr);
|
||||
|
||||
|
@ -59,11 +59,11 @@ struct dwarf2_cu
|
||||
We don't need the pc/line-number mapping for type units. */
|
||||
void setup_type_unit_groups (struct die_info *die);
|
||||
|
||||
/* Start a symtab for DWARF. NAME, COMP_DIR, LOW_PC are passed to the
|
||||
buildsym_compunit constructor. */
|
||||
struct compunit_symtab *start_symtab (const char *name,
|
||||
const char *comp_dir,
|
||||
CORE_ADDR low_pc);
|
||||
/* Start a compunit_symtab for DWARF. NAME, COMP_DIR, LOW_PC are passed to
|
||||
the buildsym_compunit constructor. */
|
||||
struct compunit_symtab *start_compunit_symtab (const char *name,
|
||||
const char *comp_dir,
|
||||
CORE_ADDR low_pc);
|
||||
|
||||
/* Reset the builder. */
|
||||
void reset_builder () { m_builder.reset (); }
|
||||
|
@ -9458,7 +9458,8 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
|
||||
get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu);
|
||||
|
||||
addr = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
|
||||
static_block = cu->get_builder ()->end_symtab_get_static_block (addr, 0, 1);
|
||||
static_block
|
||||
= cu->get_builder ()->end_compunit_symtab_get_static_block (addr, 0, 1);
|
||||
|
||||
/* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
|
||||
Also, DW_AT_ranges may record ranges not belonging to any child DIEs
|
||||
@ -9467,9 +9468,8 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
|
||||
this comp unit. */
|
||||
dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);
|
||||
|
||||
cust = cu->get_builder ()->end_symtab_from_static_block (static_block,
|
||||
SECT_OFF_TEXT (objfile),
|
||||
0);
|
||||
cust = cu->get_builder ()->end_compunit_symtab_from_static_block
|
||||
(static_block, SECT_OFF_TEXT (objfile), 0);
|
||||
|
||||
if (cust != NULL)
|
||||
{
|
||||
@ -10626,7 +10626,8 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
|
||||
file_and_directory &fnd = find_file_and_directory (die, cu);
|
||||
|
||||
cu->start_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile), lowpc);
|
||||
cu->start_compunit_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile),
|
||||
lowpc);
|
||||
|
||||
gdb_assert (per_objfile->sym_cu == nullptr);
|
||||
scoped_restore restore_sym_cu
|
||||
@ -10719,7 +10720,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
|
||||
if (lh == NULL)
|
||||
{
|
||||
if (first_time)
|
||||
start_symtab ("", NULL, 0);
|
||||
start_compunit_symtab ("", NULL, 0);
|
||||
else
|
||||
{
|
||||
gdb_assert (tug_unshare->symtabs == NULL);
|
||||
@ -10740,7 +10741,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
|
||||
|
||||
if (first_time)
|
||||
{
|
||||
struct compunit_symtab *cust = start_symtab ("", NULL, 0);
|
||||
struct compunit_symtab *cust = start_compunit_symtab ("", NULL, 0);
|
||||
|
||||
/* Note: We don't assign tu_group->compunit_symtab yet because we're
|
||||
still initializing it, and our caller (a few levels up)
|
||||
|
@ -3961,7 +3961,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
|
||||
{
|
||||
valu += section_offsets[SECT_OFF_TEXT (objfile)];
|
||||
previous_stab_code = N_SO;
|
||||
cust = end_symtab (valu, SECT_OFF_TEXT (objfile));
|
||||
cust = end_compunit_symtab (valu, SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
last_symtab_ended = 1;
|
||||
}
|
||||
@ -4021,7 +4021,8 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
|
||||
|
||||
if (! last_symtab_ended)
|
||||
{
|
||||
cust = end_symtab (pst->raw_text_high (), SECT_OFF_TEXT (objfile));
|
||||
cust = end_compunit_symtab (pst->raw_text_high (),
|
||||
SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
}
|
||||
|
||||
|
@ -4659,7 +4659,7 @@ stabsread_new_init (void)
|
||||
}
|
||||
|
||||
/* Initialize anything that needs initializing at the same time as
|
||||
start_symtab() is called. */
|
||||
start_compunit_symtab() is called. */
|
||||
|
||||
void
|
||||
start_stabs (void)
|
||||
@ -4675,7 +4675,7 @@ start_stabs (void)
|
||||
common_block_name = NULL;
|
||||
}
|
||||
|
||||
/* Call after end_symtab(). */
|
||||
/* Call after end_compunit_symtab(). */
|
||||
|
||||
void
|
||||
end_stabs (void)
|
||||
|
@ -415,7 +415,7 @@ add_stab_to_list (char *stabname, struct pending_stabs **stabvector)
|
||||
and return it in a newly created table. If the old one is good
|
||||
enough, return the old one. */
|
||||
/* FIXME: I think all this stuff can be replaced by just passing
|
||||
sort_linevec = 1 to end_symtab. */
|
||||
sort_linevec = 1 to end_compunit_symtab. */
|
||||
|
||||
static struct linetable *
|
||||
arrange_linetable (struct linetable *oldLineTb)
|
||||
@ -514,7 +514,7 @@ arrange_linetable (struct linetable *oldLineTb)
|
||||
}
|
||||
|
||||
/* include file support: C_BINCL/C_EINCL pairs will be kept in the
|
||||
following `IncludeChain'. At the end of each symtab (end_symtab),
|
||||
following `IncludeChain'. At the end of each symtab (end_compunit_symtab),
|
||||
we will determine if we should create additional symtab's to
|
||||
represent if (the include files. */
|
||||
|
||||
@ -1042,8 +1042,8 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
pst_symtab_language = deduce_language_from_filename (filestring);
|
||||
|
||||
start_stabs ();
|
||||
start_symtab (objfile, filestring, NULL, file_start_addr,
|
||||
pst_symtab_language);
|
||||
start_compunit_symtab (objfile, filestring, NULL, file_start_addr,
|
||||
pst_symtab_language);
|
||||
record_debugformat (debugfmt);
|
||||
symnum = ((struct symloc *) pst->read_symtab_private)->first_symnum;
|
||||
max_symnum =
|
||||
@ -1130,14 +1130,14 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
{
|
||||
if (get_last_source_file ())
|
||||
{
|
||||
pst->compunit_symtab = end_symtab (cur_src_end_addr,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
pst->compunit_symtab = end_compunit_symtab
|
||||
(cur_src_end_addr, SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
}
|
||||
|
||||
start_stabs ();
|
||||
start_symtab (objfile, "_globals_", NULL,
|
||||
0, pst_symtab_language);
|
||||
start_compunit_symtab (objfile, "_globals_", NULL,
|
||||
0, pst_symtab_language);
|
||||
record_debugformat (debugfmt);
|
||||
cur_src_end_addr = first_object_file_end;
|
||||
/* Done with all files, everything from here on is globals. */
|
||||
@ -1221,12 +1221,13 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
{
|
||||
complete_symtab (filestring, file_start_addr);
|
||||
cur_src_end_addr = file_end_addr;
|
||||
end_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
|
||||
end_compunit_symtab (file_end_addr,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
start_stabs ();
|
||||
/* Give all csects for this source file the same
|
||||
name. */
|
||||
start_symtab (objfile, filestring, NULL,
|
||||
start_compunit_symtab (objfile, filestring, NULL,
|
||||
0, pst_symtab_language);
|
||||
record_debugformat (debugfmt);
|
||||
}
|
||||
@ -1327,7 +1328,7 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
|
||||
complete_symtab (filestring, file_start_addr);
|
||||
cur_src_end_addr = file_end_addr;
|
||||
end_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
|
||||
end_compunit_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
|
||||
/* XCOFF, according to the AIX 3.2 documentation, puts the
|
||||
@ -1346,7 +1347,8 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
filestring = cs->c_name;
|
||||
|
||||
start_stabs ();
|
||||
start_symtab (objfile, filestring, NULL, 0, pst_symtab_language);
|
||||
start_compunit_symtab (objfile, filestring, NULL, 0,
|
||||
pst_symtab_language);
|
||||
record_debugformat (debugfmt);
|
||||
last_csect_name = 0;
|
||||
|
||||
@ -1514,7 +1516,7 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
|
||||
complete_symtab (filestring, file_start_addr);
|
||||
cur_src_end_addr = file_end_addr;
|
||||
cust = end_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
|
||||
cust = end_compunit_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
|
||||
/* When reading symbols for the last C_FILE of the objfile, try
|
||||
to make sure that we set pst->compunit_symtab to the symtab for the
|
||||
file, not to the _globals_ symtab. I'm not sure whether this
|
||||
|
Reference in New Issue
Block a user