diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-21 00:15:12 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-20 09:42:42 -0600 |
commit | 3c65e5b31cb5587773deff979099435b9687a0f4 (patch) | |
tree | b13e4e32406f0d0ef00600828133d4b564f7f7df /gdb/dwarf2read.c | |
parent | a60f3166aa946336c68e7a873d5eed6061b5733c (diff) | |
download | gdb-3c65e5b31cb5587773deff979099435b9687a0f4.zip gdb-3c65e5b31cb5587773deff979099435b9687a0f4.tar.gz gdb-3c65e5b31cb5587773deff979099435b9687a0f4.tar.bz2 |
Move current_subfile to buildsym_compunit
This moves the global current_subfile into buildsym_compunit.
gdb/ChangeLog
2018-07-20 Tom Tromey <tom@tromey.com>
* xcoffread.c (process_linenos): Update.
* stabsread.c (define_symbol, read_type, read_enum_type): Update.
* mdebugread.c (psymtab_to_symtab_1): Update.
* dwarf2read.c (setup_type_unit_groups)
(lnp_state_machine::handle_set_file, dwarf_record_line_p)
(lnp_state_machine::record_line, dwarf_decode_lines): Update.
* dbxread.c (process_one_symbol): Update.
* coffread.c (coff_symtab_read, enter_linenos)
(process_coff_symbol): Update.
* buildsym.h (current_subfile): Don't declare.
(get_current_subfile): Declare.
* buildsym.c (struct buildsym_compunit) <m_current_subfile>: New
member.
(start_subfile, free_buildsym_compunit, push_subfile)
(prepare_for_building, start_symtab): Update.
(get_current_subfile): New function.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 859419e..62c87e6 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -11574,18 +11574,18 @@ setup_type_unit_groups (struct die_info *die, struct dwarf2_cu *cu) dwarf2_start_subfile (fe.name, fe.include_dir (cu->line_header)); - if (current_subfile->symtab == NULL) + if (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. */ - current_subfile->symtab - = allocate_symtab (cust, current_subfile->name); + get_current_subfile ()->symtab + = allocate_symtab (cust, get_current_subfile ()->name); } - fe.symtab = current_subfile->symtab; + fe.symtab = get_current_subfile ()->symtab; tu_group->symtabs[i] = fe.symtab; } } @@ -20461,7 +20461,7 @@ lnp_state_machine::handle_set_file (file_name_index file) { const char *dir = fe->include_dir (m_line_header); - m_last_subfile = current_subfile; + m_last_subfile = get_current_subfile (); m_line_has_non_zero_discriminator = m_discriminator != 0; dwarf2_start_subfile (fe->name, dir); } @@ -20526,7 +20526,7 @@ dwarf_record_line_p (unsigned int line, unsigned int last_line, int line_has_non_zero_discriminator, struct subfile *last_subfile) { - if (current_subfile != last_subfile) + if (get_current_subfile () != last_subfile) return 1; if (line != last_line) return 1; @@ -20607,7 +20607,7 @@ lnp_state_machine::record_line (bool end_sequence) fe->included_p = 1; if (m_record_lines_p && m_is_stmt) { - if (m_last_subfile != current_subfile || end_sequence) + if (m_last_subfile != get_current_subfile () || end_sequence) { dwarf_finish_line (m_gdbarch, m_last_subfile, m_address, m_record_line_callback); @@ -20619,11 +20619,11 @@ lnp_state_machine::record_line (bool end_sequence) m_line_has_non_zero_discriminator, m_last_subfile)) { - dwarf_record_line_1 (m_gdbarch, current_subfile, + dwarf_record_line_1 (m_gdbarch, get_current_subfile (), m_line, m_address, m_record_line_callback); } - m_last_subfile = current_subfile; + m_last_subfile = get_current_subfile (); m_last_line = m_line; } } @@ -20954,12 +20954,12 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir, dwarf2_start_subfile (fe.name, fe.include_dir (lh)); - if (current_subfile->symtab == NULL) + if (get_current_subfile ()->symtab == NULL) { - current_subfile->symtab - = allocate_symtab (cust, current_subfile->name); + get_current_subfile ()->symtab + = allocate_symtab (cust, get_current_subfile ()->name); } - fe.symtab = current_subfile->symtab; + fe.symtab = get_current_subfile ()->symtab; } } } |