#include "gdbtypes.h"
#include "objfiles.h"
#include "dwarf2.h"
-#include "buildsym-legacy.h"
+#include "buildsym.h"
#include "demangle.h"
#include "gdb-demangle.h"
#include "expression.h"
const char *producer = nullptr;
+ /* The symtab builder for this CU. This is only non-NULL when full
+ symbols are being read. */
+ std::unique_ptr<buildsym_compunit> builder;
+
/* The generic symbol table building routines have separate lists for
file scope symbols and all all other scopes (local scopes). So
we need to select the right one to pass to add_symbol_to_list().
struct dwarf2_cu *, struct partial_symtab *,
CORE_ADDR, int decode_mapping);
-static void dwarf2_start_subfile (const char *, const char *);
+static void dwarf2_start_subfile (struct dwarf2_cu *, const char *,
+ const char *);
static struct compunit_symtab *dwarf2_start_symtab (struct dwarf2_cu *,
const char *, const char *,
static void read_module (struct die_info *die, struct dwarf2_cu *cu);
-static struct using_direct **using_directives (enum language);
+static struct using_direct **using_directives (struct dwarf2_cu *cu);
static void read_import_statement (struct die_info *die, struct dwarf2_cu *);
struct pending *list;
int i;
- for (list = *get_global_symbols (); list != NULL; list = list->next)
+ for (list = *cu->builder->get_global_symbols ();
+ list != NULL;
+ list = list->next)
{
for (i = 0; i < list->nsyms; ++i)
{
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_TYPE (sym) = type;
- add_symbol_to_list (sym, get_global_symbols ());
+ add_symbol_to_list (sym, cu->builder->get_global_symbols ());
xfree (package_name);
}
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- scoped_free_pendings free_pending;
-
/* Clear the list here in case something was left over. */
cu->method_list.clear ();
get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu);
addr = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
- static_block = end_symtab_get_static_block (addr, 0, 1);
+ static_block = cu->builder->end_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
this comp unit. */
dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);
- cust = end_symtab_from_static_block (static_block,
- SECT_OFF_TEXT (objfile), 0);
+ cust = cu->builder->end_symtab_from_static_block (static_block,
+ SECT_OFF_TEXT (objfile),
+ 0);
if (cust != NULL)
{
/* Push it for inclusion processing later. */
dwarf2_per_objfile->just_read_cus.push_back (per_cu);
+
+ /* Not needed any more. */
+ cu->builder.reset ();
}
/* Generate full symbol information for type unit PER_CU, whose DIEs have
gdb_assert (per_cu->is_debug_types);
sig_type = (struct signatured_type *) per_cu;
- scoped_free_pendings free_pending;
-
/* Clear the list here in case something was left over. */
cu->method_list.clear ();
this TU's symbols to the existing symtab. */
if (sig_type->type_unit_group->compunit_symtab == NULL)
{
- cust = end_expandable_symtab (0, SECT_OFF_TEXT (objfile));
+ cust = cu->builder->end_expandable_symtab (0, SECT_OFF_TEXT (objfile));
sig_type->type_unit_group->compunit_symtab = cust;
if (cust != NULL)
}
else
{
- augment_type_symtab ();
+ cu->builder->augment_type_symtab ();
cust = sig_type->type_unit_group->compunit_symtab;
}
pst->compunit_symtab = cust;
pst->readin = 1;
}
+
+ /* Not needed any more. */
+ cu->builder.reset ();
}
/* Process an imported unit DIE. */
}
/* Return the using directives repository (global or local?) to use in the
- current context for LANGUAGE.
+ current context for CU.
For Ada, imported declarations can materialize renamings, which *may* be
global. However it is impossible (for now?) in DWARF to distinguish
global only in Ada. */
static struct using_direct **
-using_directives (enum language language)
+using_directives (struct dwarf2_cu *cu)
{
- if (language == language_ada && outermost_context_p ())
- return get_global_using_directives ();
+ if (cu->language == language_ada && cu->builder->outermost_context_p ())
+ return cu->builder->get_global_using_directives ();
else
- return get_local_using_directives ();
+ return cu->builder->get_local_using_directives ();
}
/* Read the import statement specified by the given die and record it. */
process_die (child_die, cu);
}
- add_using_directive (using_directives (cu->language),
+ add_using_directive (using_directives (cu),
import_prefix,
canonical_name,
import_alias,
else
{
gdb_assert (tu_group->symtabs == NULL);
- restart_symtab (tu_group->compunit_symtab, "", 0);
+ gdb_assert (cu->builder == nullptr);
+ struct compunit_symtab *cust = tu_group->compunit_symtab;
+ cu->builder.reset (new struct buildsym_compunit
+ (COMPUNIT_OBJFILE (cust), "",
+ COMPUNIT_DIRNAME (cust),
+ compunit_language (cust),
+ 0, cust));
}
return;
}
{
file_entry &fe = cu->line_header->file_names[i];
- dwarf2_start_subfile (fe.name, fe.include_dir (cu->line_header));
+ dwarf2_start_subfile (cu, fe.name, fe.include_dir (cu->line_header));
- if (get_current_subfile ()->symtab == NULL)
+ if (cu->builder->get_current_subfile ()->symtab == NULL)
{
/* NOTE: start_subfile will recognize when it's been
passed a file it has already seen. So we can't
assume there's a simple mapping from
cu->line_header->file_names to subfiles, plus
cu->line_header->file_names may contain dups. */
- get_current_subfile ()->symtab
- = allocate_symtab (cust, get_current_subfile ()->name);
+ cu->builder->get_current_subfile ()->symtab
+ = allocate_symtab (cust,
+ cu->builder->get_current_subfile ()->name);
}
- fe.symtab = get_current_subfile ()->symtab;
+ fe.symtab = cu->builder->get_current_subfile ()->symtab;
tu_group->symtabs[i] = fe.symtab;
}
}
else
{
- restart_symtab (tu_group->compunit_symtab, "", 0);
+ gdb_assert (cu->builder == nullptr);
+ struct compunit_symtab *cust = tu_group->compunit_symtab;
+ cu->builder.reset (new struct buildsym_compunit
+ (COMPUNIT_OBJFILE (cust), "",
+ COMPUNIT_DIRNAME (cust),
+ compunit_language (cust),
+ 0, cust));
for (i = 0; i < cu->line_header->file_names.size (); ++i)
{
}
}
- newobj = push_context (0, lowpc);
+ newobj = cu->builder->push_context (0, lowpc);
newobj->name = new_symbol (die, read_type_die (die, cu), cu,
(struct symbol *) templ_func);
attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
}
- cu->list_in_scope = get_local_symbols ();
+ cu->list_in_scope = cu->builder->get_local_symbols ();
if (die->child != NULL)
{
}
}
- struct context_stack cstk = pop_context ();
+ struct context_stack cstk = cu->builder->pop_context ();
/* Make a block for the local symbols within. */
- block = finish_block (cstk.name, cstk.old_blocks,
- cstk.static_link, lowpc, highpc);
+ block = cu->builder->finish_block (cstk.name, cstk.old_blocks,
+ cstk.static_link, lowpc, highpc);
/* For C++, set the block's scope. */
if ((cu->language == language_cplus
a function declares a class that has methods). This means that
when we finish processing a function scope, we may need to go
back to building a containing block's symbol lists. */
- *get_local_symbols () = cstk.locals;
- set_local_using_directives (cstk.local_using_directives);
+ *cu->builder->get_local_symbols () = cstk.locals;
+ cu->builder->set_local_using_directives (cstk.local_using_directives);
/* If we've finished processing a top-level function, subsequent
symbols go in the file symbol list. */
- if (outermost_context_p ())
- cu->list_in_scope = get_file_symbols ();
+ if (cu->builder->outermost_context_p ())
+ cu->list_in_scope = cu->builder->get_file_symbols ();
}
/* Process all the DIES contained within a lexical block scope. Start
lowpc = gdbarch_adjust_dwarf2_addr (gdbarch, lowpc + baseaddr);
highpc = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
- push_context (0, lowpc);
+ cu->builder->push_context (0, lowpc);
if (die->child != NULL)
{
child_die = die->child;
}
}
inherit_abstract_dies (die, cu);
- struct context_stack cstk = pop_context ();
+ struct context_stack cstk = cu->builder->pop_context ();
- if (*get_local_symbols () != NULL || (*get_local_using_directives ()) != NULL)
+ if (*cu->builder->get_local_symbols () != NULL
+ || (*cu->builder->get_local_using_directives ()) != NULL)
{
struct block *block
- = finish_block (0, cstk.old_blocks, NULL,
- cstk.start_addr, highpc);
+ = cu->builder->finish_block (0, cstk.old_blocks, NULL,
+ cstk.start_addr, highpc);
/* Note that recording ranges after traversing children, as we
do here, means that recording a parent's ranges entails
to do. */
dwarf2_record_block_ranges (die, block, baseaddr, cu);
}
- *get_local_symbols () = cstk.locals;
- set_local_using_directives (cstk.local_using_directives);
+ *cu->builder->get_local_symbols () = cstk.locals;
+ cu->builder->set_local_using_directives (cstk.local_using_directives);
}
/* Read in DW_TAG_call_site and insert it to CU->call_site_htab. */
low = gdbarch_adjust_dwarf2_addr (gdbarch, low + baseaddr);
high = gdbarch_adjust_dwarf2_addr (gdbarch, high + baseaddr);
- record_block_range (block, low, high - 1);
+ cu->builder->record_block_range (block, low, high - 1);
}
}
end += baseaddr;
start = gdbarch_adjust_dwarf2_addr (gdbarch, start);
end = gdbarch_adjust_dwarf2_addr (gdbarch, end);
- record_block_range (block, start, end - 1);
+ cu->builder->record_block_range (block, start, end - 1);
});
}
}
const char *previous_prefix = determine_prefix (die, cu);
std::vector<const char *> excludes;
- add_using_directive (using_directives (cu->language),
+ add_using_directive (using_directives (cu),
previous_prefix, TYPE_NAME (type), NULL,
NULL, excludes, 0, &objfile->objfile_obstack);
}
public:
/* Initialize a machine state for the start of a line number
program. */
- lnp_state_machine (gdbarch *arch, line_header *lh, bool record_lines_p);
+ lnp_state_machine (struct dwarf2_cu *cu, gdbarch *arch, line_header *lh,
+ bool record_lines_p);
file_entry *current_file ()
{
/* Handle DW_LNE_end_sequence. */
void handle_end_sequence ()
{
- m_record_line_callback = ::record_line;
+ m_currently_recording_lines = true;
}
private:
m_line_has_non_zero_discriminator = m_discriminator != 0;
}
+ struct dwarf2_cu *m_cu;
+
gdbarch *m_gdbarch;
/* True if we're recording lines.
/* The last file a line number was recorded for. */
struct subfile *m_last_subfile = NULL;
- /* The function to call to record a line. */
- record_line_ftype *m_record_line_callback = NULL;
+ /* When true, record the lines we decode. */
+ bool m_currently_recording_lines = false;
/* The last line number that was recorded, used to coalesce
consecutive entries for the same line. This can happen, for
{
const char *dir = fe->include_dir (m_line_header);
- m_last_subfile = get_current_subfile ();
+ m_last_subfile = m_cu->builder->get_current_subfile ();
m_line_has_non_zero_discriminator = m_discriminator != 0;
- dwarf2_start_subfile (fe->name, dir);
+ dwarf2_start_subfile (m_cu, fe->name, dir);
}
}
% m_line_header->maximum_ops_per_instruction);
}
-/* Ignore this record_line request. */
-
-static void
-noop_record_line (struct subfile *subfile, int line, CORE_ADDR pc)
-{
- return;
-}
-
/* Return non-zero if we should add LINE to the line number table.
LINE is the line to add, LAST_LINE is the last line that was added,
LAST_SUBFILE is the subfile for LAST_LINE.
within one sequence, thus this coalescing is ok. */
static int
-dwarf_record_line_p (unsigned int line, unsigned int last_line,
+dwarf_record_line_p (struct dwarf2_cu *cu,
+ unsigned int line, unsigned int last_line,
int line_has_non_zero_discriminator,
struct subfile *last_subfile)
{
- if (get_current_subfile () != last_subfile)
+ if (cu->builder->get_current_subfile () != last_subfile)
return 1;
if (line != last_line)
return 1;
return 0;
}
-/* Use P_RECORD_LINE to record line number LINE beginning at address ADDRESS
- in the line table of subfile SUBFILE. */
+/* Use the CU's builder to record line number LINE beginning at
+ address ADDRESS in the line table of subfile SUBFILE. */
static void
dwarf_record_line_1 (struct gdbarch *gdbarch, struct subfile *subfile,
unsigned int line, CORE_ADDR address,
- record_line_ftype p_record_line)
+ struct dwarf2_cu *cu)
{
CORE_ADDR addr = gdbarch_addr_bits_remove (gdbarch, address);
paddress (gdbarch, address));
}
- (*p_record_line) (subfile, line, addr);
+ if (cu != nullptr)
+ cu->builder->record_line (subfile, line, addr);
}
/* Subroutine of dwarf_decode_lines_1 to simplify it.
static void
dwarf_finish_line (struct gdbarch *gdbarch, struct subfile *subfile,
- CORE_ADDR address, record_line_ftype p_record_line)
+ CORE_ADDR address, struct dwarf2_cu *cu)
{
if (subfile == NULL)
return;
paddress (gdbarch, address));
}
- dwarf_record_line_1 (gdbarch, subfile, 0, address, p_record_line);
+ dwarf_record_line_1 (gdbarch, subfile, 0, address, cu);
}
void
fe->included_p = 1;
if (m_record_lines_p && m_is_stmt)
{
- if (m_last_subfile != get_current_subfile () || end_sequence)
+ if (m_last_subfile != m_cu->builder->get_current_subfile ()
+ || end_sequence)
{
- dwarf_finish_line (m_gdbarch, m_last_subfile,
- m_address, m_record_line_callback);
+ dwarf_finish_line (m_gdbarch, m_last_subfile, m_address,
+ m_currently_recording_lines ? m_cu : nullptr);
}
if (!end_sequence)
{
- if (dwarf_record_line_p (m_line, m_last_line,
+ if (dwarf_record_line_p (m_cu, m_line, m_last_line,
m_line_has_non_zero_discriminator,
m_last_subfile))
{
- dwarf_record_line_1 (m_gdbarch, get_current_subfile (),
+ dwarf_record_line_1 (m_gdbarch,
+ m_cu->builder->get_current_subfile (),
m_line, m_address,
- m_record_line_callback);
+ m_currently_recording_lines ? m_cu : nullptr);
}
- m_last_subfile = get_current_subfile ();
+ m_last_subfile = m_cu->builder->get_current_subfile ();
m_last_line = m_line;
}
}
}
}
-lnp_state_machine::lnp_state_machine (gdbarch *arch, line_header *lh,
- bool record_lines_p)
+lnp_state_machine::lnp_state_machine (struct dwarf2_cu *cu, gdbarch *arch,
+ line_header *lh, bool record_lines_p)
{
+ m_cu = cu;
m_gdbarch = arch;
m_record_lines_p = record_lines_p;
m_line_header = lh;
- m_record_line_callback = ::record_line;
+ m_currently_recording_lines = true;
/* Call `gdbarch_adjust_dwarf2_line' on the initial 0 address as if there
was a line entry for it so that the backend has a chance to adjust it
complaint (_(".debug_line address at offset 0x%lx is 0 [in module %s]"),
line_offset, objfile_name (objfile));
- m_record_line_callback = noop_record_line;
- /* Note: record_line_callback is left as noop_record_line until
- we see DW_LNE_end_sequence. */
+ m_currently_recording_lines = false;
+ /* Note: m_currently_recording_lines is left as false until we see
+ DW_LNE_end_sequence. */
}
}
{
/* The DWARF line number program state machine. Reset the state
machine at the start of each sequence. */
- lnp_state_machine state_machine (gdbarch, lh, record_lines_p);
+ lnp_state_machine state_machine (cu, gdbarch, lh, record_lines_p);
bool end_sequence = false;
if (record_lines_p)
const file_entry *fe = state_machine.current_file ();
if (fe != NULL)
- dwarf2_start_subfile (fe->name, fe->include_dir (lh));
+ dwarf2_start_subfile (cu, fe->name, fe->include_dir (lh));
}
/* Decode the table. */
/* Make sure a symtab is created for every file, even files
which contain only variables (i.e. no code with associated
line numbers). */
- struct compunit_symtab *cust = buildsym_compunit_symtab ();
+ struct compunit_symtab *cust = cu->builder->get_compunit_symtab ();
int i;
for (i = 0; i < lh->file_names.size (); i++)
{
file_entry &fe = lh->file_names[i];
- dwarf2_start_subfile (fe.name, fe.include_dir (lh));
+ dwarf2_start_subfile (cu, fe.name, fe.include_dir (lh));
- if (get_current_subfile ()->symtab == NULL)
+ if (cu->builder->get_current_subfile ()->symtab == NULL)
{
- get_current_subfile ()->symtab
- = allocate_symtab (cust, get_current_subfile ()->name);
+ cu->builder->get_current_subfile ()->symtab
+ = allocate_symtab (cust,
+ cu->builder->get_current_subfile ()->name);
}
- fe.symtab = get_current_subfile ()->symtab;
+ fe.symtab = cu->builder->get_current_subfile ()->symtab;
}
}
}
subfile's name. */
static void
-dwarf2_start_subfile (const char *filename, const char *dirname)
+dwarf2_start_subfile (struct dwarf2_cu *cu, const char *filename,
+ const char *dirname)
{
char *copy = NULL;
filename = copy;
}
- start_subfile (filename);
+ cu->builder->start_subfile (filename);
if (copy != NULL)
xfree (copy);
}
-/* Start a symtab for DWARF.
- NAME, COMP_DIR, LOW_PC are passed to start_symtab. */
+/* Start a symtab for DWARF. NAME, COMP_DIR, LOW_PC are passed to the
+ buildsym_compunit constructor. */
static struct compunit_symtab *
dwarf2_start_symtab (struct dwarf2_cu *cu,
const char *name, const char *comp_dir, CORE_ADDR low_pc)
{
- struct compunit_symtab *cust
- = start_symtab (cu->per_cu->dwarf2_per_objfile->objfile, name, comp_dir,
- low_pc, cu->language);
+ gdb_assert (cu->builder == nullptr);
- cu->list_in_scope = get_file_symbols ();
+ cu->builder.reset (new struct buildsym_compunit
+ (cu->per_cu->dwarf2_per_objfile->objfile,
+ name, comp_dir, cu->language, low_pc));
- record_debugformat ("DWARF 2");
- record_producer (cu->producer);
+ cu->list_in_scope = cu->builder->get_file_symbols ();
+
+ cu->builder->record_debugformat ("DWARF 2");
+ cu->builder->record_producer (cu->producer);
cu->processing_has_namespace_info = 0;
- return cust;
+ return cu->builder->get_compunit_symtab ();
}
static void
access them globally. For instance, we want to be able
to break on a nested subprogram without having to
specify the context. */
- list_to_add = get_global_symbols ();
+ list_to_add = cu->builder->get_global_symbols ();
}
else
{
if (!suppress_add)
{
if (attr2 && (DW_UNSND (attr2) != 0))
- list_to_add = get_global_symbols ();
+ list_to_add = cu->builder->get_global_symbols ();
else
list_to_add = cu->list_in_scope;
}
/* A variable with DW_AT_external is never static,
but it may be block-scoped. */
- list_to_add = (cu->list_in_scope == get_file_symbols ()
- ? get_global_symbols () : cu->list_in_scope);
+ list_to_add
+ = (cu->list_in_scope == cu->builder->get_file_symbols ()
+ ? cu->builder->get_global_symbols ()
+ : cu->list_in_scope);
}
else
list_to_add = cu->list_in_scope;
{
/* A variable with DW_AT_external is never static, but it
may be block-scoped. */
- list_to_add = (cu->list_in_scope == get_file_symbols ()
- ? get_global_symbols () : cu->list_in_scope);
+ list_to_add
+ = (cu->list_in_scope == cu->builder->get_file_symbols ()
+ ? cu->builder->get_global_symbols ()
+ : cu->list_in_scope);
SYMBOL_ACLASS_INDEX (sym) = LOC_UNRESOLVED;
}
when we do not have enough information to show inlined frames;
pretend it's a local variable in that case so that the user can
still see it. */
- struct context_stack *curr = get_current_context_stack ();
+ struct context_stack *curr
+ = cu->builder->get_current_context_stack ();
if (curr != nullptr && curr->name != nullptr)
SYMBOL_IS_ARGUMENT (sym) = 1;
attr = dwarf2_attr (die, DW_AT_location, cu);
if (!suppress_add)
{
- list_to_add = (cu->list_in_scope == get_file_symbols ()
- && cu->language == language_cplus
- ? get_global_symbols () : cu->list_in_scope);
+ list_to_add
+ = (cu->list_in_scope == cu->builder->get_file_symbols ()
+ && cu->language == language_cplus
+ ? cu->builder->get_global_symbols ()
+ : cu->list_in_scope);
/* The semantics of C++ state that "struct foo {
... }" also defines a typedef for "foo". */
/* NOTE: carlton/2003-11-10: See comment above in the
DW_TAG_class_type, etc. block. */
- list_to_add = (cu->list_in_scope == get_file_symbols ()
- && cu->language == language_cplus
- ? get_global_symbols () : cu->list_in_scope);
+ list_to_add
+ = (cu->list_in_scope == cu->builder->get_file_symbols ()
+ && cu->language == language_cplus
+ ? cu->builder->get_global_symbols ()
+ : cu->list_in_scope);
}
break;
case DW_TAG_imported_declaration:
case DW_TAG_namespace:
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
- list_to_add = get_global_symbols ();
+ list_to_add = cu->builder->get_global_symbols ();
break;
case DW_TAG_module:
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
- list_to_add = get_global_symbols ();
+ list_to_add = cu->builder->get_global_symbols ();
break;
case DW_TAG_common_block:
SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK;
namespaces based on the demangled name. */
if (!cu->processing_has_namespace_info
&& cu->language == language_cplus)
- cp_scan_for_anonymous_namespaces (get_buildsym_compunit (), sym,
- objfile);
+ cp_scan_for_anonymous_namespaces (cu->builder.get (), sym, objfile);
}
return (sym);
}
static struct macro_source_file *
-macro_start_file (int file, int line,
+macro_start_file (struct dwarf2_cu *cu,
+ int file, int line,
struct macro_source_file *current_file,
struct line_header *lh)
{
{
/* Note: We don't create a macro table for this compilation unit
at all until we actually get a filename. */
- struct macro_table *macro_table = get_macro_table ();
+ struct macro_table *macro_table = cu->builder->get_macro_table ();
/* If we have no current file, then this must be the start_file
directive for the compilation unit's main source file. */
including DW_MACRO_import. */
static void
-dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
+dwarf_decode_macro_bytes (struct dwarf2_cu *cu,
bfd *abfd,
const gdb_byte *mac_ptr, const gdb_byte *mac_end,
struct macro_source_file *current_file,
unsigned int offset_size,
htab_t include_hash)
{
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
enum dwarf_macro_record_type macinfo_type;
int at_commandline;
at_commandline = 0;
}
else
- current_file = macro_start_file (file, line, current_file, lh);
+ current_file = macro_start_file (cu, file, line, current_file,
+ lh);
}
break;
{
*slot = (void *) new_mac_ptr;
- dwarf_decode_macro_bytes (dwarf2_per_objfile,
- include_bfd, new_mac_ptr,
+ dwarf_decode_macro_bytes (cu, include_bfd, new_mac_ptr,
include_mac_end, current_file, lh,
section, section_is_gnu, is_dwz,
offset_size, include_hash);
file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
mac_ptr += bytes_read;
- current_file = macro_start_file (file, line, current_file, lh);
+ current_file = macro_start_file (cu, file, line, current_file, lh);
}
break;
mac_ptr = section->buffer + offset;
slot = htab_find_slot (include_hash.get (), mac_ptr, INSERT);
*slot = (void *) mac_ptr;
- dwarf_decode_macro_bytes (dwarf2_per_objfile,
- abfd, mac_ptr, mac_end,
+ dwarf_decode_macro_bytes (cu, abfd, mac_ptr, mac_end,
current_file, lh, section,
section_is_gnu, 0, offset_size,
include_hash.get ());