Commit Graph

70 Commits

Author SHA1 Message Date
Tom Tromey 5717c425a6 Add "objfile" parameter to two partial_symtab methods
This series will cause partial symtabs to be shared across objfiles.
However, full symtabs and symbols will still be objfile-dependent, so
will be expanded separately for each objfile.  So, a debug info reader
will need to know which objfile to consult when expanding a partial
symtab.

This patch adds an objfile parameter to the two relevant methods of
partial_symtab.  Current implementations simply ignore them.

gdb/ChangeLog:

	* psymtab.c (partial_map_expand_apply)
	(psym_find_pc_sect_compunit_symtab, psym_lookup_symbol)
	(psym_lookup_global_symbol_language)
	(psymtab_to_symtab, psym_find_last_source_symtab, dump_psymtab)
	(psym_print_stats, psym_expand_symtabs_for_function)
	(psym_map_symbol_filenames, psym_map_matching_symbols)
	(psym_expand_symtabs_matching)
	(partial_symtab::read_dependencies, maintenance_info_psymtabs)
	(maintenance_check_psymtabs): Update.
	* psympriv.h (struct partial_symtab) <readin_p,
	get_compunit_symtab>: Add objfile parameter.
	(struct standard_psymtab) <readin_p, get_compunit_symtab>:
	Likewise.
	* dwarf2/read.c (struct dwarf2_include_psymtab) <readin_p,
	get_compunit_symtab>: Likewise.
	(dwarf2_psymtab::expand_psymtab): Pass objfile argument.

Change-Id: I3f0b26787c3e78f7fb78b9fc011d91fb8690f3a0
2020-05-27 11:13:48 -04:00
Tom Tromey 2467f4f6a5 Introduce new add_psymbol_to_list overload
This adds a new overload of add_psymbol_to_list.  This one takes an
already constructed psymbol and adds it to the bcache and the
appropriate list.

This seemed cleaner than continuing to add parameters to the existing
add_psymbol_to_list, and is more in line with how full symbols are
constructed.

gdb/ChangeLog
2020-04-24  Tom Tromey  <tom@tromey.com>

	* psymtab.c (add_psymbol_to_bcache): Simplify calling convention.
	(add_psymbol_to_list): New overload.  Make old overload call new
	one.
	* psympriv.h (add_psymbol_to_list): New overload.
2020-04-24 15:35:02 -06:00
Tom de Vries 194d088fb1 [gdb] Fix missing symtab includes
[ The test-case requires commit c1a66c0629 "[gdb] Expand symbolless symtabs
using maint expand-symtabs". ]

Consider the debug info for the test-case included in this patch.  It consists
of a PU:
...
 <0><d2>: Abbrev Number: 2 (DW_TAG_partial_unit)
 <1><d3>: Abbrev Number: 0
...
imported by a CU:
...
 <0><df>: Abbrev Number: 2 (DW_TAG_compile_unit)
    <e0>   DW_AT_language    : 2        (non-ANSI C)
    <e1>   DW_AT_stmt_list   : 0xe9
 <1><e5>: Abbrev Number: 3 (DW_TAG_imported_unit)
    <e6>   DW_AT_import      : <0xd2>   [Abbrev Number: 2]
 <1><ea>: Abbrev Number: 0
...
and the CU has a dw2-symtab-includes.h file in the .debug_line file name
table:
...
 The Directory Table (offset 0x101):
  1     /data/gdb_versions/devel/src/gdb/testsuite/gdb.dwarf2

 The File Name Table (offset 0x138):
  Entry Dir     Time    Size    Name
  1     1       0       0       dw2-symtab-includes.h
...

After expanding all symtabs, we can see the CU listed in the user field of the
PU, and vice-versa the PU listed in the includes of the CU:
...
$ gdb.sh -batch \
  -iex "set language c" \
  outputs/gdb.dwarf2/dw2-symtab-includes/dw2-symtab-includes \
  -ex "maint expand-symtabs" \
  -ex "maint info symtabs"
  ...
  { ((struct compunit_symtab *) 0x394dd60)
    debugformat DWARF 2
    producer (null)
    dirname (null)
    blockvector ((struct blockvector *) 0x394dea0)
    user ((struct compunit_symtab *) 0x394dba0)
  }
  { ((struct compunit_symtab *) 0x394dba0)
    debugformat DWARF 2
    producer (null)
    dirname (null)
    blockvector ((struct blockvector *) 0x394dd10)
    user ((struct compunit_symtab *) (null))
    ( includes
      ((struct compunit_symtab *) 0x394dd60)
    )
  }
...

But if we instead only expand the symtab for the dw2-symtab-includes.h file,
the includes and user links are gone:
...
$ gdb -batch \
  -iex "set language c" \
  outputs/gdb.dwarf2/dw2-symtab-includes/dw2-symtab-includes \
  -ex "maint expand-symtabs dw2-symtab-includes.h" \
  -ex "maint info symtabs"
  ...
  { ((struct compunit_symtab *) 0x2728210)
    debugformat DWARF 2
    producer (null)
    dirname (null)
    blockvector ((struct blockvector *) 0x2728350)
    user ((struct compunit_symtab *) (null))
  }
  { ((struct compunit_symtab *) 0x2728050)
    debugformat DWARF 2
    producer (null)
    dirname (null)
    blockvector ((struct blockvector *) 0x27281c0)
    user ((struct compunit_symtab *) (null))
  }
...

The includes are calculated by process_cu_includes in gdb/dwarf2/read.c.

In the case of expanding all symtabs:
- the CU partial symtab is expanded using psymtab_to_symtab
- psymtab_to_symtab calls dwarf2_psymtab::read_symtab
- dwarf2_psymtab::read_symtab calls dwarf2_psymtab::expand_psymtab
- dwarf2_psymtab::read_symtab calls process_cu_includes, and we have the
  includes

In the case of expanding the symtab for dw2-symtab-includes.h:
- the dw2-symtab-includes.h partial symtab is expanded using psymtab_to_symtab
- psymtab_to_symtab calls dwarf2_include_psymtab::read_symtab
- dwarf2_include_psymtab::read_symtab calls
  dwarf2_include_psymtab::expand_psymtab
- dwarf2_include_psymtab::expand_psymtab calls
  partial_symtab::expand_dependencies
- partial_symtab::expand_dependencies calls dwarf2_psymtab::expand_psymtab
  for the CU partial symtab
- the CU partial symtab is expanded using dwarf2_psymtab::expand_psymtab
- process_cu_includes is never called

Fix this by making sure in dwarf2_include_psymtab::read_symtab that
read_symtab is called for the CU partial symtab.

Tested on x86_64-linux, with native, and target board cc-with-dwz and
cc-with-dwz-m.

In addition, tested test-case with target boards cc-with-gdb-index.exp,
cc-with-debug-names.exp and readnow.exp.

gdb/ChangeLog:

2020-04-14  Simon Marchi  <simon.marchi@polymtl.ca>
	    Tom de Vries  <tdevries@suse.de>

	PR symtab/25718
	* psympriv.h (struct partial_symtab::read_symtab)
	(struct partial_symtab::expand_psymtab)
	(struct partial_symtab::read_dependencies): Update comments.
	* dwarf2/read.c (struct dwarf2_include_psymtab::read_symtab): Call
	read_symtab for includer.
	(struct dwarf2_include_psymtab::expand_psymtab): Assert false.
	(struct dwarf2_include_psymtab::readin_p): Call readin_p () for includer.
	(struct dwarf2_include_psymtab::m_readin): Remove.
	(struct dwarf2_include_psymtab::includer): New member function.
	(dwarf2_psymtab::expand_psymtab): Assert !readin.

gdb/testsuite/ChangeLog:

2020-04-14  Tom de Vries  <tdevries@suse.de>

	PR symtab/25718
	* gdb.dwarf2/dw2-symtab-includes.exp: New file.
2020-04-14 15:30:50 +02:00
Simon Marchi 48993951ce gdb: rename partial_symtab::read_dependencies to expand_dependencies
This method calls partial_symtab::expand_psymtab on all dependencies of
a psymtab.  Given that there is also a partial_symtab::read_symtab
method, I think it would be clearer to name this function
expand_dependencies, rather than read_dependencies.

gdb/ChangeLog:

	* psympriv.h (partial_symtab) <read_dependencies>: Rename to...
	<expand_dependencies>: ... this.
	* psymtab.c (partial_symtab::read_dependencies): Rename to...
	(partial_symtab::expand_dependencies): ... this.
	* dwarf2/read.c (dwarf2_include_psymtab) <expand_psymtab>:
	Update.
	(dwarf2_psymtab::expand_psymtab): Update.
	* dbxread.c (dbx_psymtab_to_symtab_1): Update.
	* mdebugread.c (psymtab_to_symtab_1): Update.
	* xcoffread.c (xcoff_psymtab_to_symtab_1): Update.
2020-03-29 15:23:48 -04:00
Simon Marchi 3ad830466f gdb: remove discard_psymtab function
This function does not add much value, compared to calling the method on
the psymtab_storage object directly.

gdb/ChangeLog:

	* psympriv.h (discard_psymtab): Remove.
	* dbxread.c (dbx_end_psymtab): Update.
	* xcoffread.c (xcoff_end_psymtab): Update.
2020-03-29 15:23:32 -04:00
Tom Tromey d4d947ae37 Update partial_symtab comment
The introductory comment for partial_symtab has been mildly incorrect
since the partial symtab code was changed to allocate partial symtabs
with "new".  This patch removes the incorrect text.

gdb/ChangeLog
2020-02-21  Tom Tromey  <tom@tromey.com>

	* psympriv.h (struct partial_symtab): Update comment.
2020-02-21 14:44:41 -07:00
Tom Tromey 128a391fe4 Virtualize "readin" and "compunit_symtab"
This patch removes the "readin" and "compunit_symtab" members from
partial_symtab, replacing them with methods.  Then it introduces a new
"standard_psymtab" class, which restores these members; and changes
the symbol readers to use this intermediate class as the base class of
their partial symtab subclasses.

The reason for this is to make it possible for a symbol reader to
implement an alternate mapping between partial and full symbol tables.
This is important in order to be able to share psymtabs across
objfiles -- whether a psymtab has been "readin" is objfile-dependent,
as are the pointers to the full symbol tables.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* psymtab.c (partial_map_expand_apply)
	(psym_find_pc_sect_compunit_symtab, psym_lookup_symbol)
	(psymtab_to_symtab, psym_find_last_source_symtab, dump_psymtab)
	(psym_print_stats, psym_expand_symtabs_for_function)
	(psym_map_symbol_filenames, psym_map_matching_symbols)
	(psym_expand_symtabs_matching)
	(partial_symtab::read_dependencies, maintenance_info_psymtabs)
	(maintenance_check_psymtabs): Use new methods.
	* psympriv.h (struct partial_symtab) <readin_p,
	get_compunit_symtab>: New methods.
	<readin, compunit_symtab>: Remove members.
	(struct standard_psymtab): New.
	(struct legacy_psymtab): Derive from standard_psymtab.
	* dwarf2read.h (struct dwarf2_psymtab): Derive from
	standard_psymtab.
	* ctfread.c (struct ctf_psymtab): Derive from standard_psymtab.

Change-Id: Idb923f196d7e03bf7cb9cfc8134ed06dd3f211ce
2020-01-26 16:40:21 -07:00
Tom Tromey 0494dbecdf Consolidate partial symtab dependency reading
Most of the symbol readers have code to iterate over a partial symtabs
dependencies, expanding each one and optionally printing a message.
Now that the "second-stage" psymtab expansion is available as a
method, these implementations can all be merged.

This patch also changes a couple more warnings into assertions.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_psymtab_to_symtab_1): Call
	read_dependencies.  Add assert.
	* psymtab.c (partial_symtab::read_dependencies): New method.
	* psympriv.h (struct partial_symtab) <read_dependencies>: New
	method.
	* mdebugread.c (psymtab_to_symtab_1): Call read_dependencies.
	* dwarf2read.c (dwarf2_psymtab::expand_psymtab): Call
	read_dependencies.
	* dbxread.c (dbx_psymtab_to_symtab_1): Call read_dependencies.
	Add assert.

Change-Id: I8151e05677794e90223edc1a4cb70f7f69137d46
2020-01-26 16:40:21 -07:00
Tom Tromey 8566b89b73 Introduce partial_symtab::expand_psymtab method
The symbol readers generally used two functions to expand a partial
symtab: an outer function (now the "read_symtab" method), and an inner
function, typically named something like "psymtab_to_symtab".

This patch changes this second step to be a method on partial_symtab,
and updates all the callers.  For legacy_psymtab, a new function
pointer member is introduced.

This patch enables a subsequent cleanup.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_psymtab_to_symtab_1): Change argument order.
	Call expand_psymtab.
	(xcoff_read_symtab): Call expand_psymtab.
	(xcoff_start_psymtab, xcoff_end_psymtab): Set
	legacy_expand_psymtab.
	* psympriv.h (struct partial_symtab) <expand_psymtab>: New
	method.
	(struct legacy_psymtab) <expand_psymtab>: Implement.
	<legacy_expand_psymtab>: New member.
	* mdebugread.c (mdebug_read_symtab): Call expand_psymtab.
	(parse_partial_symbols): Set legacy_expand_psymtab.
	(psymtab_to_symtab_1): Change argument order.  Call
	expand_psymtab.
	(new_psymtab): Set legacy_expand_psymtab.
	* dwarf2read.h (struct dwarf2_psymtab) <expand_psymtab>: Declare.
	* dwarf2read.c (dwarf2_psymtab::read_symtab): Call
	expand_psymtab.
	(dwarf2_psymtab::expand_psymtab): Rename from
	psymtab_to_symtab_1.  Call expand_psymtab.
	* dbxread.c (start_psymtab): Set legacy_expand_psymtab.
	(dbx_end_psymtab): Likewise.
	(dbx_psymtab_to_symtab_1): Change argument order. Call
	expand_psymtab.
	(dbx_read_symtab): Call expand_psymtab.
	* ctfread.c (struct ctf_psymtab) <expand_psymtab>: Declare.
	(ctf_psymtab::expand_psymtab): Rename from psymtab_to_symtab.
	(ctf_psymtab::read_symtab): Call expand_psymtab.

Change-Id: Ic39a2d7aa7b424088d910b59dbd21271fa1c3430
2020-01-26 16:40:21 -07:00
Tom Tromey 891813beaa Introduce partial_symtab::read_symtab method
This introduces a new partial_symtab::read_symtab method, and updates
the symbol readers to subclass partial_symtab and implement this
method.  The old read_symtab and read_symtab_private members are
removed.

In practice, only DWARF and CTF are truly updated to take advantage of
the new setup.  The other symbol readers are less actively maintained,
and so this patch also introduces a "legacy_psymtab", which
essentially works the same way as the old partial_symtab.

(Note that, without more knowledge of the interaction between these
symbol readers, fixing this to remove the new (small) overhead is not
trivial, because these readers copy the read_symtab pointer between
partial symtabs.)

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (this_symtab_psymtab, read_xcoff_symtab)
	(xcoff_psymtab_to_symtab_1, xcoff_read_symtab)
	(xcoff_start_psymtab, xcoff_end_psymtab, scan_xcoff_symtab): Use
	legacy_symtab.
	* stabsread.h (dbx_end_psymtab): Use legacy_symtab.
	* psymtab.c (psymtab_to_symtab): Call method.
	(dump_psymtab): Update.
	* psympriv.h (struct partial_symtab): Add virtual destructor.
	<read_symtab>: New method.
	(struct legacy_symtab): New.
	* mdebugread.c (mdebug_read_symtab): Use legacy_psymtab.
	(struct pst_map) <pst>: Now a legacy_psymtab.
	(parse_procedure, parse_partial_symbols, psymtab_to_symtab_1)
	(new_psymtab): Use legacy_psymtab.
	* dwarf2read.h (struct dwarf2_psymtab): New.
	(struct dwarf2_per_cu_data) <psymtab>: Use it.
	* dwarf2read.c (dwarf2_create_include_psymtab)
	(dwarf2_build_include_psymtabs, create_type_unit_group)
	(create_partial_symtab, process_psymtab_comp_unit_reader)
	(build_type_psymtabs_reader, build_type_psymtab_dependencies)
	(set_partial_user): Use dwarf2_psymtab.
	(dwarf2_psymtab::read_symtab): Rename from dwarf2_read_symtab.
	(psymtab_to_symtab_1, process_full_comp_unit)
	(process_full_type_unit, dwarf2_ranges_read)
	(dwarf2_get_pc_bounds, psymtab_include_file_name)
	(dwarf_decode_lines): Use dwarf2_psymtab.
	* dwarf-index-write.c (psym_index_map): Use dwarf2_psymtab.
	(add_address_entry_worker, write_one_signatured_type)
	(recursively_count_psymbols, recursively_write_psymbols)
	(write_one_signatured_type, psyms_seen_size, write_gdbindex)
	(write_debug_names): Likewise.
	* dbxread.c (struct header_file_location): Take a legacy_psymtab.
	<pst>: Now a legacy_psymtab.
	(find_corresponding_bincl_psymtab): Return a legacy_psymtab.
	(read_dbx_symtab, start_psymtab, dbx_end_psymtab)
	(dbx_psymtab_to_symtab_1, read_ofile_symtab): Use legacy_psymtab.
	* ctfread.c (struct ctf_psymtab): New.
	(ctf_start_symtab, ctf_end_symtab, psymtab_to_symtab): Take a
	ctf_psymtab.
	(ctf_psymtab::read_symtab): Rename from ctf_read_symtab.
	(create_partial_symtab): Return a ctf_psymtab.
	(scan_partial_symbols): Update.

Change-Id: Ia57a828786867d6ad03200af8f996f48ed15285e
2020-01-26 16:40:21 -07:00
Tom Tromey c3693a1d94 Turn start_psymtab_common into a constructor
This turns start_psymtab_common into a constructor, and then changes
the callers to use "new" directly.  This completes the psymtab
allocation transition -- now it is possible for symbol readers to
subclass struct partial_symtab.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_start_psymtab): Use new.
	* psymtab.c (partial_symtab::partial_symtab): New constructor,
	renamed from start_psymtab_common.
	* psympriv.h (struct partial_symtab): Add new constructor.
	(start_psymtab_common): Don't declare.
	* mdebugread.c (parse_partial_symbols): Use new.
	* dwarf2read.c (create_partial_symtab): Use new.
	* dbxread.c (start_psymtab): Use new.
	* ctfread.c (create_partial_symtab): Use new.

Change-Id: I5a0217bcb52bcfa442559771954bb66bd9ccbf02
2020-01-26 16:40:21 -07:00
Tom Tromey 32caafd02b Change allocate_psymtab to be a constructor
This is the next step in getting the symbol readers to allocate
psymtabs themselves: change allocate_psymtab to be an ordinary
constructor, and then use "new" at the previous call sites.  Note that
this doesn't get us all the way -- start_psymtab_common is still
allocating a partial symtab.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_end_psymtab): Use new.
	* psymtab.c (start_psymtab_common): Use new.
	(partial_symtab::partial_symtab): Rename from allocate_psymtab.
	Update.
	* psympriv.h (struct partial_symtab): Add parameters to
	constructor.  Don't inline.
	(allocate_psymtab): Don't declare.
	* mdebugread.c (new_psymtab): Use new.
	* dwarf2read.c (dwarf2_create_include_psymtab): Use new.
	* dbxread.c (dbx_end_psymtab): Use new.

Change-Id: Iffeae64c925050b90b9916cbc36e15b26ff42226
2020-01-26 16:40:21 -07:00
Tom Tromey 6d94535fc6 Change some psymtab fields to bool
This changes a few fields in partial_symtab to have type bool.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_psymtab_to_symtab_1): Update.
	* psymtab.c (psym_print_stats): Update.
	* psympriv.h (struct partial_symtab) <readin,
	psymtabs_addrmap_supported, anonymous>: Now bool.
	* mdebugread.c (psymtab_to_symtab_1): Update.
	* dwarf2read.c (create_type_unit_group, create_partial_symtab)
	(build_type_psymtabs_reader, psymtab_to_symtab_1)
	(process_full_comp_unit, process_full_type_unit): Update.
	* dbxread.c (dbx_psymtab_to_symtab_1): Update.
	* ctfread.c (psymtab_to_symtab): Update.

Change-Id: I206761d083493589049ea0bc785ed6542339234d
2020-01-26 16:40:21 -07:00
Tom Tromey 6f17252b76 Use new and delete for psymtabs
This changes psymtabs to be allocated with new and destroyed with
delete.  As a consequence, the psymtab free-list is also removed.

The motivation for this is to let symbol readers subclass
partial_symtab.

gdb/ChangeLog
2020-01-26  Tom Tromey  <tom@tromey.com>

	* mdebugread.c (parse_partial_symbols): Use discard_psymtab.
	* psymtab.h (class psymtab_storage) <free_psymtabs>: Remove.
	* psymtab.c (psymtab_storage): Delete psymtabs.
	(psymtab_storage::allocate_psymtab): Use new.
	(psymtab_storage::discard_psymtab): Use delete.
	* psympriv.h (struct partial_symtab): Add constructor and
	initializers.

Change-Id: I4e78ac538fc0ea52b57489c1afb8f935a30941ef
2020-01-26 16:40:20 -07:00
Simon Marchi b3b3bada0d gdb: introduce objfile text_section_offset and data_section_offset methods
The pattern

  objfile->section_offsets[SECT_OFF_TEXT (objfile)]

... appears very often, to get the offset of the text section of an
objfile.  I thought it would be more readable to write it as:

  objfile->text_section_offset ()

... so I added this method and used it where possible.  I also added
data_section_offset, although it is not used as much.

gdb/ChangeLog:

	* objfiles.h (ALL_OBJFILE_OSECTIONS): Move up.
	(SECT_OFF_DATA): Likewise.
	(SECT_OFF_RODATA): Likewise.
	(SECT_OFF_TEXT): Likewise.
	(SECT_OFF_BSS): Likewise.
	(struct objfile) <text_section_offset, data_section_offset>: New
	methods.
	* amd64-windows-tdep.c (amd64_windows_find_unwind_info): Use
	objfile::text_section_offset.
	* coff-pe-read.c (add_pe_forwarded_sym): Likewise.
	* coffread.c (coff_symtab_read): Likewise.
	(enter_linenos): Likewise.
	(process_coff_symbol): Likewise.
	* ctfread.c (get_objfile_text_range): Likewise.
	* dtrace-probe.c (dtrace_probe::get_relocated_address):
	Use objfile::data_section_offset.
	* dwarf2-frame.c (execute_cfa_program): Use
	objfile::text_section_offset.
	(dwarf2_frame_find_fde): Likewise.
	* dwarf2read.c (create_addrmap_from_index): Likewise.
	(create_addrmap_from_aranges): Likewise.
	(dw2_find_pc_sect_compunit_symtab): Likewise.
	(process_psymtab_comp_unit_reader): Likewise.
	(add_partial_symbol): Likewise.
	(add_partial_subprogram): Likewise.
	(process_full_comp_unit): Likewise.
	(read_file_scope): Likewise.
	(read_func_scope): Likewise.
	(read_lexical_block_scope): Likewise.
	(read_call_site_scope): Likewise.
	(dwarf2_rnglists_process): Likewise.
	(dwarf2_ranges_process): Likewise.
	(dwarf2_ranges_read): Likewise.
	(dwarf_decode_lines_1): Likewise.
	(new_symbol): Likewise.
	(dwarf2_fetch_die_loc_sect_off): Likewise.
	(dwarf2_per_cu_text_offset): Likewise.
	* hppa-bsd-tdep.c (hppabsd_find_global_pointer): Likewise.
	* hppa-tdep.c (read_unwind_info): Likewise.
	* ia64-tdep.c (ia64_find_unwind_table): Likewise.
	* psympriv.h (struct partial_symtab): Likewise.
	* psymtab.c (find_pc_sect_psymtab): Likewise.
	* solib-svr4.c (enable_break): Likewise.
	* stap-probe.c (relocate_address): Use
	objfile::data_section_offset.
	* xcoffread.c (enter_line_range): Use
	objfile::text_section_offset.
	(read_xcoff_symtab): Likewise.
2020-01-23 17:55:35 -05:00
Tom Tromey 6a053cb1ff Change section_offsets to a std::vector
This changes section_offsets to be specialization of a std::vector and
updates all the users.  It also removes the ANOFFSET and
SIZEOF_N_SECTION_OFFSETS macros.

Most of this is just a generic sort of cleanup, that reduces the
number of lines of code.  However, a couple spots were doing weird
things.

objfile_relocate did:

-      std::vector<struct section_offsets>
-	new_debug_offsets (SIZEOF_N_SECTION_OFFSETS (debug_objfile->num_sections));

... which seems to greatly over-estimate the number of elements
needed.

This appeared in set_objfile_default_section_offset:

-  std::vector<struct section_offsets> offsets (objf->num_sections,
-					       { { offset } });

... which makes sense due to type safety, but is also actively
confusing given that section_offsets was previously also a kind of
vector type.

Tested on x86-64 Fedora 30.

gdb/ChangeLog
2020-01-08  Tom Tromey  <tromey@adacore.com>

	* xcoffread.c (enter_line_range, read_xcoff_symtab)
	(process_xcoff_symbol, xcoff_symfile_offsets): Update.
	* symtab.h (MSYMBOL_VALUE_ADDRESS): Update.
	(struct section_offsets, ANOFFSET, SIZEOF_N_SECTION_OFFSETS):
	Remove.
	(section_offsets): New typedef.
	* symtab.c (fixup_section, get_msymbol_address): Update.
	* symmisc.c (dump_msymbols): Update.
	* symfile.h (relative_addr_info_to_section_offsets)
	(symfile_map_offsets_to_segments): Update.
	* symfile.c (build_section_addr_info_from_objfile)
	(init_objfile_sect_indices): Update.
	(struct place_section_arg): Change type of "offsets".
	(place_section): Update.
	(relative_addr_info_to_section_offsets): Change type of
	"section_offsets".  Remove "num_sections" parameter.
	(default_symfile_offsets, syms_from_objfile_1)
	(set_objfile_default_section_offset): Update.
	(reread_symbols): No need to preserve section offsets by hand.
	(symfile_map_offsets_to_segments): Change type of "offsets".
	* stap-probe.c (relocate_address): Update.
	* stabsread.h (process_one_symbol): Update.
	* solib-target.c (struct lm_info_target) <offsets>: Change type.
	(solib_target_relocate_section_addresses): Update.
	* solib-svr4.c (enable_break, svr4_relocate_main_executable):
	Update.
	* solib-frv.c (frv_relocate_main_executable): Update.
	* solib-dsbt.c (dsbt_relocate_main_executable): Update.
	* solib-aix.c (solib_aix_get_section_offsets): Change return
	type.
	(solib_aix_solib_create_inferior_hook): Update.
	* remote.c (remote_target::get_offsets): Update.
	* psymtab.c (find_pc_sect_psymtab): Update.
	* psympriv.h (struct partial_symbol) <address, text_low,
	text_high>: Update.
	* objfiles.h (obj_section_offset): Update.
	(struct objfile) <section_offsets>: Change type.
	<num_sections>: Remove.
	(objfile_relocate): Update.
	* objfiles.c (entry_point_address_query): Update
	(relocate_one_symbol): Change type of "section_offsets".
	(objfile_relocate1, objfile_relocate1): Change type of
	"new_offsets".
	(objfile_rebase1): Update.
	* mipsread.c (mipscoff_symfile_read): Update.
	(read_alphacoff_dynamic_symtab): Remove "section_offsets"
	parameter.
	* mdebugread.c (parse_symbol): Change type of "section_offsets".
	(parse_external, psymtab_to_symtab_1): Update.
	* machoread.c (macho_symfile_offsets): Update.
	* ia64-tdep.c (ia64_find_unwind_table): Update.
	* hppa-tdep.c (read_unwind_info): Update.
	* hppa-bsd-tdep.c (hppabsd_find_global_pointer): Update.
	* dwarf2read.c (create_addrmap_from_index)
	(create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab)
	(process_psymtab_comp_unit_reader, add_partial_symbol)
	(add_partial_subprogram, process_full_comp_unit)
	(read_file_scope, read_func_scope, read_lexical_block_scope)
	(read_call_site_scope, dwarf2_rnglists_process)
	(dwarf2_ranges_process, dwarf2_ranges_read)
	(dwarf_decode_lines_1, var_decode_location, new_symbol)
	(dwarf2_fetch_die_loc_sect_off, dwarf2_per_cu_text_offset):
	Update.
	* dwarf2-frame.c (execute_cfa_program, dwarf2_frame_find_fde):
	Update.
	* dtrace-probe.c (dtrace_probe::get_relocated_address): Update.
	* dbxread.c (read_dbx_symtab, read_ofile_symtab): Update.
	(process_one_symbol): Change type of "section_offsets".
	* ctfread.c (get_objfile_text_range): Update.
	* coffread.c (coff_symtab_read, enter_linenos)
	(process_coff_symbol): Update.
	* coff-pe-read.c (add_pe_forwarded_sym): Update.
	* amd64-windows-tdep.c (amd64_windows_find_unwind_info): Update.

Change-Id: I147eb967e9b44d82f4048039de7bb44b80cd72fb
2020-01-08 15:32:41 -07:00
Joel Brobecker b811d2c292 Update copyright year range in all GDB files.
gdb/ChangeLog:

        Update copyright year range in all GDB files.
2020-01-01 10:20:53 +04:00
Tom Tromey d1aa3cf0bb Remove symbol-related static asserts
commit 3573abe1d added static asserts to ensure that symbol sizes
don't vary.  However, this failed to build on Windows, on at least one
ARM platform (see PR build/25182) and internally at AdaCore for PPC.

So, I think it is probably best to just remove these assertions,
effectively reverting 3573abe1d.

gdb/ChangeLog
2019-11-13  Tom Tromey  <tromey@adacore.com>

	PR build/25182:
	* psympriv.h (partial_symbol): Remove static assert.
	* symtab.h (general_symbol_info, symbol): Remove static assert.

Change-Id: I51940fb2240c474838b48494b5072081701789bb
2019-11-13 12:52:40 -07:00
Christian Biesinger 3573abe1de Add static_asserts for the sizes of space-critical structs
Specifically the three structs mentioned in symtab.h:
- general_symbol_info
- symbol
- partial_symbol

This ensures that those structs won't accidentally get bigger.

gdb/ChangeLog:

2019-11-04  Christian Biesinger  <cbiesinger@google.com>

	* psympriv.h: Add static_asserts for sizeof (general_symbol_info)
	and sizeof (symbol).
	* symtab.h: Add a static_assert for sizeof (partial_symbol).

Change-Id: Idd68320aa3e79ee7cc749019724636a58ce4b9c6
2019-11-04 12:13:09 -06:00
Christian Biesinger 31edb80295 Change some arguments to gdb::string_view instead of name+len
Just some code cleanup. This change has a few benefits:
- Shorter argument list in the functions
- If the caller needs to calculate the string, they no longer
  need to explicitly call strlen
- It is easy to pass std::string to this (done in one place
  currently)

This also updates a couple of places that were passing 0/1 to
a bool parameter.

gdb/ChangeLog:

2019-10-29  Christian Biesinger  <cbiesinger@google.com>

	* coffread.c (record_minimal_symbol): Update.
	(process_coff_symbol): Update.
	* dbxread.c (read_dbx_symtab): Update.
	* dwarf2read.c (add_partial_symbol): Update.
	(fixup_go_packaging): Update.
	(load_partial_dies): Update.
	(new_symbol): Update.
	* elfread.c (record_minimal_symbol): Change signature to use
	gdb::string_view instead of name+len.
	(elf_symtab_read): Update.
	(elf_rel_plt_read): Update.
	* mdebugread.c (parse_partial_symbols): Update.
	(handle_psymbol_enumerators): Update.
	(new_symbol): Update.
	* minsyms.c (minimal_symbol_reader::record_full): Change signature
	to use gdb::string_view instead of name+len.
	* minsyms.h (class minimal_symbol_reader) <record_full>: Likewise.
	* psympriv.h (add_psymbol_to_list): Likewise.
	* psymtab.c (add_psymbol_to_bcache): Likewise.
	(add_psymbol_to_list): Likewise.
	* stabsread.c (define_symbol): Update.
	* symtab.c (symbol_set_names): Change signature to use gdb::string_view.
	* symtab.h (SYMBOL_SET_NAMES): Likewise.
	(symbol_set_names): Likewise.
	* xcoffread.c (scan_xcoff_symtab): Update.

Change-Id: I2675c6865e0368f9c755a1081088a53aa54dda4c
2019-10-29 14:19:59 -05:00
Simon Marchi 703a86c2fa gdb: re-write add_psymbol_to_list doc, move it to header file
The comment above the add_psymbol_to_list function seems outdated and
misleading, here's an attempt at improving it.

gdb/ChangeLog:

	* psymtab.c (add_psymbol_to_list): Move comment to psympriv.h.
	* psympriv.h (add_psymbol_to_list): Move comment here and update
	it.
2019-09-30 11:49:57 -04:00
Christian Biesinger 67547d896b Change the type of copy_names from int to bool
This parameter is really a boolean, so change the type accordingly
and update the callers.

This is for symbol_set_names, add_psymbol_to_bcache, and
add_psymbol_to_list.

minimal_symbol_reader::record_full was already passing a bool
to symbol_set_names.

gdb/ChangeLog:

2019-09-11  Christian Biesinger  <cbiesinger@google.com>

	* dbxread.c (read_dbx_symtab): Update.
	* dwarf2read.c (load_partial_dies): Update.
	* mdebugread.c (parse_partial_symbols): Update.
	(handle_psymbol_enumerators): Update.
	* psympriv.h (add_psymbol_to_list): Change type of copy_names to bool.
	* psymtab.c (add_psymbol_to_bcache): Likewise.
	(add_psymbol_to_list): Likewise.
	* symtab.c (symbol_set_names): Likewise.
	* symtab.h (symbol_set_names): Likewise.
	* xcoffread.c (scan_xcoff_symtab): Update.
2019-09-11 12:43:45 -05:00
Tom Tromey af97b4161f Don't derive partial_symbol from general_symbol_info
This patch partly reverts commit 8a6d42345 ("Change representation of
psymbol to flush out accessors"); specifically, it changes
partial_symbol to no longer derive from general_symbol_info.

The basic problem here is that the bcache compares objects bitwise,
and this change made it less likely that the relevant fields in the
psymbol would be fully initialized.  This could be seen by running a
test under valgrind on the Fedora-i686 buildbot.

I considered a simpler patch, namely just zeroing the psymbol's
"value" field in add_psymbol_to_bcache.  However, it wasn't clear to
me that this memset could not then be optimized away by the compiler.

Regression tested by the buildbot.  I think this should go in 8.3 as
well.

gdb/ChangeLog
2019-05-04  Tom Tromey  <tom@tromey.com>

	* psymtab.c (psymbol_name_matches, match_partial_symbol)
	(lookup_partial_symbol, print_partial_symbols)
	(recursively_search_psymtabs, sort_pst_symbols, psymbol_hash)
	(psymbol_compare): Update.
	(add_psymbol_to_bcache): Clear the entire psymbol.
	(maintenance_check_psymtabs): Update.
	* psympriv.h (struct partial_symbol): Don't derive from
	general_symbol_info.
	<obj_section, unrelocated_address, address,
	set_unrelocated_address>: Update.
	<ginfo>: New member.
	* dwarf-index-write.c (write_psymbols, debug_names::insert)
	(debug_names::write_psymbols): Update.
2019-05-04 13:43:50 -06:00
Tom Tromey d320c2b5e1 Introduce class psymtab_storage
This introduces a new psymtab_storage class, which holds all
psymbol-related objects that are independent of the objfile.  (This
latter contraint explains why psymbol_map was not moved; though this
could still be done with some work.)

This patch does not yet change where psymtab allocation is done --
that comes later.  This just wraps everything in a single object to
make further transformations simpler.

Note that a shared_ptr is used to link from the objfile to the
psymtab_storage object.  The end goal here is to allow a given symbol
reader to simply attach to the psymtab_storage object to the BFD, then
reuse it in later invocations; shared_ptr makes this simple to reason
about.

gdb/ChangeLog
2019-01-10  Tom Tromey  <tom@tromey.com>

	* symmisc.c (print_symbol_bcache_statistics): Update.
	(print_objfile_statistics): Update.
	* symfile.c (reread_symbols): Update.
	* psymtab.h (class psymtab_storage): New.
	* psymtab.c (psymtab_storage): New constructor.
	(~psymtab_storage): New destructor.
	(require_partial_symbols): Update.
	(ALL_OBJFILE_PSYMTABS_REQUIRED): Rewrite.
	(find_pc_sect_psymtab, find_pc_sect_psymbol)
	(match_partial_symbol, lookup_partial_symbol, dump_psymtab)
	(psym_dump, recursively_search_psymtabs, psym_has_symbols)
	(psym_find_compunit_symtab_by_address, sort_pst_symbols)
	(start_psymtab_common, end_psymtab_common)
	(add_psymbol_to_bcache, add_psymbol_to_list, init_psymbol_list)
	(allocate_psymtab): Update.
	(psymtab_storage::discard_psymtab): Rename from discard_psymtab.
	Update.
	(dump_psymtab_addrmap, maintenance_print_psymbols)
	(maintenance_check_psymtabs): Update.
	(class objfile_psymtabs): Move to objfiles.h.
	* psympriv.h (discard_psymtab): Now inline.
	(psymtab_discarder::psymtab_discarder): Update.
	(psymtab_discarder::~psymtab_discarder): Update.
	(ALL_OBJFILE_PSYMTABS): Rewrite.
	* objfiles.h (struct objfile) <psymtabs, psymtabs_addrmap,
	free_psymtabs, psymbol_cache, global_psymbols, static_psymbols>:
	Remove fields.
	<partial_symtabs>: New field.
	(class objfile_psymtabs): Move from psymtab.h.  Update.
	* objfiles.c (objfile::objfile): Initialize partial_symtabs, not
	psymbol_cache.
	(objfile::~objfile): Don't destroy psymbol_cache.
	* mdebugread.c (parse_partial_symbols): Update.
	* dwarf2read.c (create_addrmap_from_index)
	(create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab)
	(process_psymtab_comp_unit_reader, dwarf2_build_psymtabs_hard)
	(add_partial_subprogram, dwarf2_ranges_read): Update.
	* dwarf-index-write.c (write_address_map)
	(write_one_signatured_type, recursively_write_psymbols)
	(class debug_names, class debug_names, write_psymtabs_to_index):
	Update.
2019-01-10 07:08:12 -07:00
Tom Tromey 6eee24ce30 Simplify calls to init_psymbol_list
Existing callers to init_psymbol_list were checking to see if psymbols
had already been initialized.  It seemed better to me to do this check
directly in init_psymbol_list, simplifying the callers.

gdb/ChangeLog
2019-01-10  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_initial_scan): Unconditionally call
	init_psymbol_list.
	* psymtab.c (init_psymbol_list): Do nothing if already called.
	* psympriv.h (init_psymbol_list): Add comment.
	* dwarf2read.c (dwarf2_build_psymtabs): Unconditionally call
	init_psymbol_list.
	* dbxread.c (dbx_symfile_read): Unconditionally call
	init_psymbol_list.
2019-01-10 07:08:11 -07:00
Tom Tromey 75aedd27e6 Change add_psymbol_to_list to use an enum
This changes add_psymbol_to_list to use an enum, rather than a pointer
to a vector, to decide where to put the new symbol.  This reduces the
number of direct references to the static_psymbols and global_psymbols
members of the objfile, which is handy in a later patch.

gdb/ChangeLog
2019-01-10  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (scan_xcoff_symtab): Update.
	* psymtab.c (add_psymbol_to_list): Replace "list" parameter with
	"where".
	* mdebugread.c (parse_partial_symbols)
	(handle_psymbol_enumerators): Update.
	* dwarf2read.c (add_partial_symbol, load_partial_dies): Update.
	* dbxread.c (read_dbx_symtab): Update.
	* psympriv.h (psymbol_placement): New enum.
	(add_psymbol_to_list): Update.
2019-01-10 07:08:11 -07:00
Tom Tromey 939652a515 Remove parameters from start_psymtab_common
start_psymtab_common takes references to the global_psymbols and
static_psymbols vectors, but it also has an objfile parameter.  This
is redundant, so this patch simplifies the function by removing those
reference parameters.

gdb/ChangeLog
2019-01-10  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_start_psymtab): Remove global_psymbols and
	static_psymbols parameters.
	(scan_xcoff_symtab): Update.
	* psymtab.c (start_psymtab_common): Remove global_psymbols and
	static_psymbols parameters.
	* psympriv.h (start_psymtab_common): Update.
	* mdebugread.c (parse_partial_symbols): Update.
	* dwarf2read.c (create_partial_symtab): Update.
	* dbxread.c (read_dbx_symtab): Update.
	(start_psymtab): Remove global_psymbols and static_psymbols
	parameters.
2019-01-10 07:08:10 -07:00
Tom Tromey baa62830ed Remove some unneeded psymtab initializations
allocate_psymtab has long cleared the new psymtab that is returned.
This patch documents this behavior and then removes some redundant
initializations.

gdb/ChangeLog
2019-01-10  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_end_psymtab): Remove some initializations.
	* psymtab.c (allocate_psymtab): Add comment.
	* psympriv.h (allocate_psymtab): Add comment.
	* dwarf2read.c (dwarf2_create_include_psymtab): Remove some
	initializations.
	* dbxread.c (dbx_end_psymtab): Remove some initializations.
2019-01-10 07:08:10 -07:00
Tom Tromey b22a7c6ab6 Remove ALL_OBJFILE_PSYMTABS
This removes the ALL_OBJFILE_PSYMTABS macro, replacing its uses with
ranged for loops.

gdb/ChangeLog
2019-01-09  Tom Tromey  <tom@tromey.com>

	* dbxread.c (dbx_end_psymtab): Use objfile_psymtabs.
	* mdebugread.c (parse_partial_symbols): Use objfile_psymtabs.
	* psymtab.c (ALL_OBJFILE_PSYMTABS_REQUIRED): Remove.
	(psym_map_symtabs_matching_filename, find_pc_sect_psymtab)
	(psym_lookup_symbol, psym_find_last_source_symtab)
	(psym_forget_cached_source_info, psym_print_stats)
	(psym_expand_symtabs_for_function, psym_expand_all_symtabs)
	(psym_expand_symtabs_with_fullname, psym_map_symbol_filenames)
	(psym_map_matching_symbols, psym_expand_symtabs_matching)
	(psym_find_compunit_symtab_by_address)
	(maintenance_print_psymbols, maintenance_info_psymtabs)
	(maintenance_check_psymtabs): Use ranged for.
	* psymtab.h (class objfile_psymtabs): New.
	(require_partial_symbols): Return objfile_psymtabs.
	* psympriv.h (ALL_OBJFILE_PSYMTABS): Remove.
2019-01-09 18:28:15 -07:00
Joel Brobecker 42a4f53d2b Update copyright year range in all GDB files.
This commit applies all changes made after running the gdb/copyright.py
script.

Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.

gdb/ChangeLog:

	Update copyright year range in all GDB files.
2019-01-01 10:01:51 +04:00
Tom Tromey 7974897237 Make psymbols and psymtabs independent of the program space
This patch finally makes partial symbols and partial symtabs
independent of the program space.

Specifically:

It changes add_psymbol_to_list to accept a section index, and changes
the psymbol readers to pass this.  At the same time it removes the
code to add the objfile's section offset to the psymbol.

It adds an objfile argument to the psymtab textlow and texthigh
accessors and changes some code to use the raw variants instead.

It removes the "relocate" method from struct quick_symbol_functions,
as it is no longer needed any more.

It changes partial_symbol::address so that the relevant offset is now
applied at the point of use.

gdb/ChangeLog
2018-07-26  Tom Tromey  <tom@tromey.com>

	* dwarf-index-write.c (add_address_entry): Don't add objfile
	offsets.
	* dbxread.c (find_stab_function): Rename from
	find_stab_function_addr.  Return a bound_minimal_symbol.
	(read_dbx_symtab): Use raw_text_low, raw_text_high.
	Don't add objfile offsets.
	(end_psymtab): Use raw_text_low, raw_text_high,
	MSYMBOL_VALUE_RAW_ADDRESS.
	(read_ofile_symtab): Update.
	(process_one_symbol): Update.
	* dwarf2read.c (create_addrmap_from_index): Don't add objfile
	offsets.
	(dw2_relocate): Remove.
	(dw2_find_pc_sect_symtab): Bias PC by the text offset before
	searching addrmap.
	(dwarf2_gdb_index_functions, dwarf2_debug_names_functions):
	Update.
	(process_psymtab_comp_unit_reader, add_partial_symbol)
	(add_partial_subprogram, dwarf2_ranges_read): Update.
	(load_partial_dies): Update.
	(add_address_entry): Don't add objfile offsets.
	(dwarf2_build_include_psymtabs): Update.
	(create_addrmap_from_aranges): Don't add objfile offsets.
	(dw2_find_pc_sect_compunit_symtab): Update.
	* mdebugread.c (parse_symbol): Don't add objfile offsets.
	(parse_lines): Remove 'pst' parameter, replace with 'textlow'.
	Update.
	(parse_partial_symbols): Don't add objfile offsets.  Use
	raw_text_low, raw_text_high.  Update.
	(handle_psymbol_enumerators, psymtab_to_symtab_1): Update.
	* objfiles.c (objfile_relocate1): Don't relocate psymtabs_addrmap
	or call 'relocate' quick function.  Clear psymbol_map.
	* psympriv.h (struct partial_symbol) <address>: Add section
	offset.
	<set_unrelocated_address>: Rename from set_address.
	<raw_text_low, raw_text_high>: New methods.
	<text_low, text_high>: Add objfile parameter.
	(add_psymbol_to_bcache): Add 'section' parameter.  Call
	set_unrelocated_address.
	* psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab)
	(find_pc_psymbol): Update.
	(fixup_psymbol_section, relocate_psymtabs): Remove.
	(dump_psymtab, psym_functions): Update.
	(add_psymbol_to_bcache, add_psymbol_to_list): Add 'section'
	parameter.
	(maintenance_info_psymtabs, maintenance_check_psymtabs): Update.
	(start_psymtab_common): Update.
	* symfile-debug.c (debug_qf_relocate): Remove.
	(debug_sym_quick_functions): Update.
	* symfile.h (struct quick_symbol_functions) <relocate>: Remove.
	* xcoffread.c (scan_xcoff_symtab): Don't add objfile offsets.
	Update.
2018-07-26 09:18:31 -06:00
Tom Tromey 52948f01e4 Add validity bits for psymtab high and low fields
Right now some psymtab code checks whether a psymtab's textlow or
texthigh fields are valid by comparing against 0.

I imagine this is mildly wrong in the current environment, but once
psymtabs are relocated dynamically, it will no longer be correct,
because it will be much more normal to see a psymtab with a textlow of
zero -- this will just mean it appears at the start of the text
section.

This patch introduces validity bits to handle this situation more
nicely, and changes users of the code to follow.

gdb/ChangeLog
2018-07-26  Tom Tromey  <tromey@redhat.com>

	* dbxread.c (end_psymtab): Use text_high_valid and
	text_low_valid.
	* mdebugread.c (parse_partial_symbols): Use text_low_valid.
	(psymtab_to_symtab_1): Use text_high_valid and text_low_valid.
	* psympriv.h (struct partial_symtab) <m_text_low, m_text_high>:
	Update comment.
	<text_low_valid, text_high_valid>: New fields.
	<set_text_low, set_text_high>: Update.
	* xcoffread.c (scan_xcoff_symtab): Use text_low_valid.
2018-07-26 09:18:31 -06:00
Tom Tromey 4ae976d1df Introduce accessors for psymtab high and low fields
This introduces accessors for the partial symbol table textlow and
texthigh fields.  This lets us later arrange to relocate these values
at their point of use.

I did this conversion by renaming the fields.  I didn't rename the
fields back afterward, thinking that on the off chance that someone
has a patch touching this area, then a merge would helpfully break
their compile.

I looked at making the fields private, but this interferes with the
memset in allocate_psymtab, and I didn't want to chase this down.
This conversion can be done later if need be.

gdb/ChangeLog
2018-07-26  Tom Tromey  <tom@tromey.com>

	* dbxread.c (read_dbx_symtab, end_psymtab, read_ofile_symtab):
	Update.
	* dwarf2read.c (dwarf2_create_include_psymtab): Don't initialize
	textlow and texthigh fields.
	(process_psymtab_comp_unit_reader, dwarf2_build_include_psymtabs):
	Update.
	* mdebugread.c (parse_lines, parse_partial_symbols)
	(psymtab_to_symtab_1): Update.
	* psympriv.h (struct partial_symtab) <m_text_low, m_text_high>:
	Rename fields.  Update comment.  Now private.
	<text_low, text_high, set_text_low, set_text_high>: New methods.
	* psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab)
	(find_pc_sect_psymbol, relocate_psymtabs, dump_psymtab)
	(start_psymtab_common, maintenance_info_psymtabs)
	(maintenance_check_psymtabs): Update.
	* xcoffread.c (xcoff_end_psymtab): Don't initialize textlow and
	texthigh fields.
	(scan_xcoff_symtab): Update.
2018-07-26 09:18:30 -06:00
Tom Tromey 02e9e7f7e2 Introduce partial_symbol::address
This introduces a partial_symbol::address method.  This method takes
an objfile argument.  This is necessary so that we can later relocate
a partial symbol at its point of use.  It also adds an accessor to
compute the unrelocated value; and a method to be used for setting the
field.

Note that the new method doesn't actually perform any relocation yet.
That will come in a subsequent patch.  However, the comments are
written to reflect the intended, rather than the temporary, semantics.

gdb/ChangeLog
2018-07-26  Tom Tromey  <tromey@redhat.com>

	* psympriv.h (struct partial_symbol) <unrelocated_address,
	address, set_address>: New methods.
	* psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymbol)
	(fixup_psymbol_section, relocate_psymtabs): Update.
	(print_partial_symbols): Add 'objfile' parameter.  Update.
	(dump_psymtab, add_psymbol_to_bcache, psym_fill_psymbol_map):
	Update.
2018-07-26 09:18:30 -06:00
Tom Tromey 8a6d423450 Change representation of psymbol to flush out accessors
This is the psymbol analog to the patch to change the representation
of minimal symbols:

    https://sourceware.org/ml/gdb-patches/2013-10/msg00524.html

It has the same rationale: namely, that we're going to change the code
to apply psymbol offsets at runtime.  This will be done by adding an
argument to the SYMBOL_VALUE_ADDRESS macro -- but since we can't
convert all the symbol types at once, we need a new approach.

Because gdb now is in C++, this patch changes partial_symbol to
inherit from general_symbol_info, rather than renaming the field.
This simplifies code in some places.

Also, as noted before, these macros implement a kind of "phony
polymorphism" that is not actually useful in practice; so this patch
removes the macros in favor of simply referring directly to members.
In a few cases -- obj_section in this patch and the symbol address in
the future -- methods will be used instead.

Note that this removes the blanket memset from add_psymbol_to_bcache.
This hasn't really been needed since bcache was modified to allow
holes in objects and since psymtab took advantage of that.  This
deletion was required due to changing partial_symbol to derive from
general_symbol_info.

gdb/ChangeLog
2018-07-26  Tom Tromey  <tom@tromey.com>

	* dwarf-index-write.c (write_psymbols, debug_names::insert)
	(debug_names::write_psymbols): Update.
	* psympriv.h (struct partial_symbol): Derive from
	general_symbol_info.
	<obj_section>: New method.
	(PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove.n
	* psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab)
	(find_pc_sect_psymbol, fixup_psymbol_section)
	(match_partial_symbol, lookup_partial_symbol, relocate_psymtabs)
	(print_partial_symbols, recursively_search_psymtabs)
	(compare_psymbols, psymbol_hash, psymbol_compare)
	(add_psymbol_to_bcache, maintenance_check_psymtabs)
	(psymbol_name_matches, psym_fill_psymbol_map): Update.
2018-07-26 09:18:29 -06:00
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
Simon Marchi af5bf4ada4 Replace psymbol_allocation_list with std::vector
psymbol_allocation_list is basically a vector implementation.  We can
replace it with an std::vector, now that objfile has been C++-ified.

I sent this to the buildbot, there are a few suspicious failures, but
I don't think they are related to this patch.  For example on powerpc:

new FAIL: gdb.base/catch-syscall.exp: execve: syscall execve has returned
new FAIL: gdb.base/catch-syscall.exp: execve: continue to main
new FAIL: gdb.base/catch-syscall.exp: execve: continue until exit

I get the same failures when testing manually on gcc112, without this
patch.

gdb/ChangeLog:

	* objfiles.h: Don't include symfile.h.
	(struct partial_symbol): Remove forward-declaration.
	(struct objfile) <global_psymbols, static_psymbols>: Change type
	to std::vector<partial_symbol *>.
	* objfiles.c (objfile::objfile): Don't memset those fields.
	(objfile::~objfile): Don't free those fields.
	* psympriv.h (struct psymbol_allocation_list): Remove
	forward-declaration.
	(add_psymbol_to_list): Change psymbol_allocation_list parameter
	to std::vector.
	(start_psymtab_common): Change parameters to std::vector.
	* psymtab.c: Include algorithm.
	(require_partial_symbols): Call shrink_to_fit.
	(find_pc_sect_psymbol): Adjust to vector change.
	(match_partial_symbol): Likewise.
	(lookup_partial_symbol): Likewise.
	(psym_relocate): Likewise.
	(dump_psymtab): Likewise.
	(recursively_search_psymtabs): Likewise.
	(compare_psymbols): Remove.
	(sort_pst_symbols): Adjust to vector change.
	(start_psymtab_common): Likewise.
	(end_psymtab_common): Likewise.
	(psymbol_bcache_full): De-constify return value.
	(add_psymbol_to_bcache): Likewise.
	(extend_psymbol_list): Remove.
	(append_psymbol_to_list): Adjust to vector change.
	(add_psymbol_to_list): Likewise.
	(init_psymbol_list): Likewise.
	(maintenance_info_psymtabs): Likewise.
	(maintenance_check_psymtabs): Likewise.
	* symfile.h (struct psymbol_allocation_list): Remove.
	* symfile.c (reread_symbols): Adjust to vector change.
	* dbxread.c (start_psymtab): Change type of parameters.
	(dbx_symfile_read): Adjust to vector change.
	(read_dbx_symtab): Likewise.
	(start_psymtab): Change type of parameters.
	* dwarf2read.c (dwarf2_build_psymtabs): Adjust to vector change.
	(create_partial_symtab): Likewise.
	(add_partial_symbol): Likewise.
	(write_one_signatured_type): Likewise.
	(recursively_write_psymbols): Likewise.
	* mdebugread.c (parse_partial_symbols): Likewise.
	* xcoffread.c (xcoff_start_psymtab): Change type of parameters.
	(scan_xcoff_symtab): Adjust to vector change.
	(xcoff_initial_scan): Likewise.
2017-10-14 08:07:46 -04:00
Tom Tromey 906768f970 Remove make_cleanup_discard_psymtabs
This removes make_cleanup_discard_psymtabs in favor of a new class.

2017-01-10  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (dwarf2_build_psymtabs): Use psymtab_discarder.
	* psympriv.h (make_cleanup_discard_psymtabs): Don't declare.
	* psymtab.c (discard_psymtabs_upto): Remove.
	(make_cleanup_discard_psymtabs): Remove.
	(struct psymtab_state): Remove.
2017-01-10 19:14:12 -07:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Doug Evans 1762568fd6 psymtab.c (add_psymbol_to_bcache): Remove "val" arg.
gdb/ChangeLog:

	* psymtab.c (add_psymbol_to_bcache): Remove "val" arg.  All callers
	updated.
	(add_psymbol_to_list): Ditto.
2015-08-15 22:08:47 -07:00
Doug Evans 8763cedeec Add end_psymtab_common, have all debug info readers call it.
gdb/ChangeLog:

	* dbxread.c (dbx_end_psymtab): Renamed from end_psymtab.  All callers
	updated.  Call end_psymtab_common.
	* dwarf2read.c (process_psymtab_comp_unit_reader): Call
	end_psymtab_common.
	(build_type_psymtabs_reader): Ditto.
	* psympriv.h (sort_pst_symbols): Delete.
	(end_psymtab_common): Declare.
	* psymtab.c (sort_pst_symbols): Make static.
	(end_psymtab_common): New function.
	* xcoffread.c (xcoff_end_psymtab): Call end_psymtab_common.
2015-08-15 16:46:20 -07:00
Doug Evans 51cdc99310 Use macros for some enum bit field sizes.
gdb/ChangeLog:

	* defs.h (LANGUAGE_BITS): Define.
	* psympriv.h (partial_symbol) <domain>: Use SYMBOL_DOMAIN_BITS.
	(partial_symbol) <aclass>: Use SYMBOL_ACLASS_BITS.
	* symtab.h (general_symbol_info> <language>: Usage LANGUAGE_BITS.
	(minimal_symbol_type): Add nr_minsym_types.
	(MINSYM_TYPE_BITS): Define.
	(minimal_symbol) <type>: Use MINSYM_TYPE_BITS.
	(domain_enum_tag): Add NR_DOMAINS.
	(SYMBOL_DOMAIN_BITS): Change from 4 to 3.
	(SYMBOL_ACLASS_BITS): Define from 6 to 5.
2015-08-15 16:25:53 -07:00
Doug Evans 95cf586902 objfiles.h,psympriv.h,psymtab.c: Whitespace.
gdb/ChangeLog:

	* objfiles.h: Whitespace cleanup.
	* psympriv.h: Whitespace cleanup.
	* psymtab.c: Whitespace/coding convention cleanup.
2015-08-15 15:51:00 -07:00
Doug Evans 18a94d75a0 Remove special support in gdb for Sun's version of stabs.
Discussion:
https://sourceware.org/ml/gdb-patches/2015-05/msg00169.html

gdb/ChangeLog:

	* NEWS: Mention Sun's version of stabs is no longer supported.
	* elfread.c (free_elfinfo): Delete.  All uses updated.
	(elfstab_offset_sections): Delete.  All uses updated.
	* gdb-stabs.h (stab_section_info): Delete.  All uses updated.
	* psympriv.h (partial_symtab) <section_offsets>: Delete.
	All uses updated.
	* psymtab.c (start_psymtab_common): Delete arg section_offsets.
	All callers updated.

gdb/doc/ChangeLog:

	* stabs.texinfo (ELF Linker Relocation): Mention Sun stabs is no
	longer supported.
2015-06-19 11:34:43 -07:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Doug Evans 43f3e411c4 Split struct symtab into two: struct symtab and compunit_symtab.
Currently "symtabs" in gdb are stored as a single linked list of
struct symtab that contains both symbol symtabs (the blockvectors)
and file symtabs (the linetables).

This has led to confusion, bugs, and performance issues.

This patch is conceptually very simple: split struct symtab into
two pieces: one part containing things common across the entire
compilation unit, and one part containing things specific to each
source file.

Example.
For the case of a program built out of these files:

foo.c
  foo1.h
  foo2.h
bar.c
  foo1.h
  bar.h

Today we have a single list of struct symtabs:

objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL

where "->" means the "next" pointer in struct symtab.

With this patch, that turns into:

objfile -> foo.c(cu) -> bar.c(cu) -> NULL
            |            |
            v            v
           foo.c        bar.c
            |            |
            v            v
           foo1.h       foo1.h
            |            |
            v            v
           foo2.h       bar.h
            |            |
            v            v
           NULL         NULL

where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects,
and the files foo.c, etc. are struct symtab objects.

So now, for example, when we want to iterate over all blockvectors
we can now just iterate over the compunit_symtab list.

Plus a lot of the data that was either unused or replicated for each
symtab in a compilation unit now lives in struct compunit_symtab.
E.g., the objfile pointer, the producer string, etc.
I thought of moving "language" out of struct symtab but there is
logic to try to compute the language based on previously seen files,
and I think that's best left as is for now.
With my standard monster benchmark with -readnow (which I can't actually
do, but based on my calculations), whereas today the list requires
77MB to store all the struct symtabs, it now only requires 37MB.
A modest space savings given the gigabytes needed for all the debug info,
etc.  Still, it's nice.  Plus, whereas today we create a copy of dirname
for each source file symtab in a compilation unit, we now only create one
for the compunit.

So this patch is basically just a data structure reorg,
I don't expect significant performance improvements from it.

Notes:

1) A followup patch can do a similar split for struct partial_symtab.
I have left that until after I get the changes I want in to
better utilize .gdb_index (it may affect how we do partial syms).

2) Another followup patch *could* rename struct symtab.
The term "symtab" is ambiguous and has been a source of confusion.
In this patch I'm leaving it alone, calling it the "historical" name
of "filetabs", which is what they are now: just the file-name + line-table.

gdb/ChangeLog:

	Split struct symtab into two: struct symtab and compunit_symtab.
	* amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit.
	* block.c (blockvector_for_pc_sect): Change "struct symtab *" argument
	to "struct compunit_symtab *".  All callers updated.
	(set_block_compunit_symtab): Renamed from set_block_symtab.  Change
	"struct symtab *" argument to "struct compunit_symtab *".
	All callers updated.
	(get_block_compunit_symtab): Renamed from get_block_symtab.  Change
	result to "struct compunit_symtab *".  All callers updated.
	(find_iterator_compunit_symtab): Renamed from find_iterator_symtab.
	Change result to "struct compunit_symtab *".  All callers updated.
	* block.h (struct global_block) <compunit_symtab>: Renamed from symtab.
	hange type to "struct compunit_symtab *".  All uses updated.
	(struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab".
	Change type to "struct compunit_symtab *".  All uses updated.
	* buildsym.c (struct buildsym_compunit): New struct.
	(subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete.
	(buildsym_compunit): New static global.
	(finish_block_internal): Update to fetch objfile from
	buildsym_compunit.
	(make_blockvector): Delete objfile argument.
	(start_subfile): Rewrite to use buildsym_compunit.  Don't initialize
	debugformat, producer.
	(start_buildsym_compunit): New function.
	(free_buildsym_compunit): Renamed from free_subfiles_list.
	All callers updated.
	(patch_subfile_names): Rewrite to use buildsym_compunit.
	(get_compunit_symtab): New function.
	(get_macro_table): Delete argument comp_dir.  All callers updated.
	(start_symtab): Change result to "struct compunit_symtab *".
	All callers updated.  Create the subfile of the main source file.
	(watch_main_source_file_lossage): Rewrite to use buildsym_compunit.
	(reset_symtab_globals): Update.
	(end_symtab_get_static_block): Update to use buildsym_compunit.
	(end_symtab_without_blockvector): Rewrite.
	(end_symtab_with_blockvector): Change result to
	"struct compunit_symtab *".  All callers updated.
	Update to use buildsym_compunit.  Don't set symtab->dirname,
	instead set it in the compunit.
	Explicitly make sure main symtab is first in its list.
	Set debugformat, producer, blockvector, block_line_section, and
	macrotable in the compunit.
	(end_symtab_from_static_block): Change result to
	"struct compunit_symtab *".  All callers updated.
	(end_symtab, end_expandable_symtab): Ditto.
	(set_missing_symtab): Change symtab argument to
	"struct compunit_symtab *".  All callers updated.
	(augment_type_symtab): Ditto.
	(record_debugformat): Update to use buildsym_compunit.
	(record_producer): Update to use buildsym_compunit.
	* buildsym.h (struct subfile) <dirname>: Delete.
	<producer, debugformat>: Delete.
	<buildsym_compunit>: New member.
	(get_compunit_symtab): Declare.
	* dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed
	from primary_symtab.  Change type to "struct compunit_symtab *".
	All uses updated.
	(dwarf2_start_symtab): Change result to "struct compunit_symtab *".
	All callers updated.
	(dwarf_decode_macros): Delete comp_dir argument.  All callers updated.
	(struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from
	symtab.  Change type to "struct compunit_symtab *".  All uses updated.
	(dw2_instantiate_symtab): Change result to "struct compunit_symtab *".
	All callers updated.
	(dw2_find_last_source_symtab): Ditto.
	(dw2_lookup_symbol): Ditto.
	(recursively_find_pc_sect_compunit_symtab): Renamed from
	recursively_find_pc_sect_symtab.  Change result to
	"struct compunit_symtab *".  All callers updated.
	(dw2_find_pc_sect_compunit_symtab): Renamed from
	dw2_find_pc_sect_symtab.  Change result to
	"struct compunit_symtab *".  All callers updated.
	(get_compunit_symtab): Renamed from get_symtab.  Change result to
	"struct compunit_symtab *".  All callers updated.
	(recursively_compute_inclusions): Change type of immediate_parent
	argument to "struct compunit_symtab *".  All callers updated.
	(compute_compunit_symtab_includes): Renamed from
	compute_symtab_includes.  All callers updated.  Rewrite to compute
	includes of compunit_symtabs and not symtabs.
	(process_full_comp_unit): Update to work with struct compunit_symtab.
	(process_full_type_unit): Ditto.
	(dwarf_decode_lines_1): Delete argument comp_dir.  All callers updated.
	(dwarf_decode_lines): Remove special case handling of main subfile.
	(macro_start_file): Delete argument comp_dir.  All callers updated.
	(dwarf_decode_macro_bytes): Ditto.
	* guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to
	use struct compunit_symtab.
	* i386-tdep.c (i386_skip_prologue): Fetch producer from compunit.
	* jit.c (finalize_symtab): Build compunit_symtab.
	* jv-lang.c (get_java_class_symtab): Change result to
	"struct compunit_symtab *".  All callers updated.
	* macroscope.c (sal_macro_scope): Fetch macro table from compunit.
	* macrotab.c (struct macro_table) <compunit_symtab>: Renamed from
	comp_dir.  Change type to "struct compunit_symtab *".
	All uses updated.
	(new_macro_table): Change comp_dir argument to cust,
	"struct compunit_symtab *".  All callers updated.
	* maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from
	nr_primary_symtabs.  All uses updated.
	(count_symtabs_and_blocks): Update to handle compunits.
	(report_command_stats): Update output, "primary symtabs" renamed to
	"compunits".
	* mdebugread.c (new_symtab): Change result to
	"struct compunit_symtab *".  All callers updated.
	(parse_procedure): Change type of search_symtab argument to
	"struct compunit_symtab *".  All callers updated.
	* objfiles.c (objfile_relocate1): Loop over blockvectors in a
	separate loop.
	* objfiles.h (struct objfile) <compunit_symtabs>: Renamed from
	symtabs.  Change type to "struct compunit_symtab *".  All uses updated.
	(ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS.
	All uses updated.
	(ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS.
	All uses updated.
	(ALL_FILETABS): Renamed from ALL_SYMTABS.  All uses updated.
	(ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS.  All uses updated.
	* psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from
	symtab.  Change type to "struct compunit_symtab *".  All uses updated.
	* psymtab.c (psymtab_to_symtab): Change result type to
	"struct compunit_symtab *".  All callers updated.
	(find_pc_sect_compunit_symtab_from_partial): Renamed from
	find_pc_sect_symtab_from_partial.  Change result type to
	"struct compunit_symtab *".  All callers updated.
	(lookup_symbol_aux_psymtabs): Change result type to
	"struct compunit_symtab *".  All callers updated.
	(find_last_source_symtab_from_partial): Ditto.
	* python/py-symtab.c (stpy_get_producer): Fetch producer from compunit.
	* source.c (forget_cached_source_info_for_objfile): Fetch debugformat
	and macro_table from compunit.
	* symfile-debug.c (debug_qf_find_last_source_symtab): Change result
	type to "struct compunit_symtab *".  All callers updated.
	(debug_qf_lookup_symbol): Ditto.
	(debug_qf_find_pc_sect_compunit_symtab): Renamed from
	debug_qf_find_pc_sect_symtab, change result type to
	"struct compunit_symtab *".  All callers updated.
	* symfile.c (allocate_symtab): Delete objfile argument.
	New argument cust.
	(allocate_compunit_symtab): New function.
	(add_compunit_symtab_to_objfile): New function.
	* symfile.h (struct quick_symbol_functions) <lookup_symbol>:
	Change result type to "struct compunit_symtab *".  All uses updated.
	<find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab.
	Change result type to "struct compunit_symtab *".  All uses updated.
	* symmisc.c (print_objfile_statistics): Compute blockvector count in
	separate loop.
	(dump_symtab_1): Update test for primary source symtab.
	(maintenance_info_symtabs): Update to handle compunit symtabs.
	(maintenance_check_symtabs): Ditto.
	* symtab.c (set_primary_symtab): Delete.
	(compunit_primary_filetab): New function.
	(compunit_language): New function.
	(iterate_over_some_symtabs): Change type of arguments "first",
	"after_last" to "struct compunit_symtab *".  All callers updated.
	Update to loop over symtabs in each compunit.
	(error_in_psymtab_expansion): Rename symtab argument to cust,
	and change type to "struct compunit_symtab *".  All callers updated.
	(find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab.
	Change result type to "struct compunit_symtab *".  All callers updated.
	(find_pc_compunit_symtab): Renamed from find_pc_symtab.
	Change result type to "struct compunit_symtab *".  All callers updated.
	(find_pc_sect_line): Only loop over symtabs within selected compunit
	instead of all symtabs in the objfile.
	* symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab.
	<compunit_symtab> New member.
	<block_line_section>: Moved to compunit_symtab.
	<locations_valid>: Ditto.
	<epilogue_unwind_valid>: Ditto.
	<macro_table>: Ditto.
	<dirname>: Ditto.
	<debugformat>: Ditto.
	<producer>: Ditto.
	<objfile>: Ditto.
	<call_site_htab>: Ditto.
	<includes>: Ditto.
	<user>: Ditto.
	<primary>: Delete
	(SYMTAB_COMPUNIT): New macro.
	(SYMTAB_BLOCKVECTOR): Update definition.
	(SYMTAB_OBJFILE): Update definition.
	(SYMTAB_DIRNAME): Update definition.
	(struct compunit_symtab): New type.  Common members among all source
	symtabs within a compilation unit moved here.  All uses updated.
	(COMPUNIT_OBJFILE): New macro.
	(COMPUNIT_FILETABS): New macro.
	(COMPUNIT_DEBUGFORMAT): New macro.
	(COMPUNIT_PRODUCER): New macro.
	(COMPUNIT_DIRNAME): New macro.
	(COMPUNIT_BLOCKVECTOR): New macro.
	(COMPUNIT_BLOCK_LINE_SECTION): New macro.
	(COMPUNIT_LOCATIONS_VALID): New macro.
	(COMPUNIT_EPILOGUE_UNWIND_VALID): New macro.
	(COMPUNIT_CALL_SITE_HTAB): New macro.
	(COMPUNIT_MACRO_TABLE): New macro.
	(ALL_COMPUNIT_FILETABS): New macro.
	(compunit_symtab_ptr): New typedef.
	(DEF_VEC_P (compunit_symtab_ptr)): New vector type.

gdb/testsuite/ChangeLog:

	* gdb.base/maint.exp: Update expected output.
2014-11-20 07:47:44 -08:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Tom Tromey e1b06ae220 pack partial_symtab for space
This improves the packing of struct partial_symtab.  I noticed with
pahole that were were a couple of holes.  This consolidates the holes
without, I think, affecting readability -- it just moves the "user"
field a bit earlier in the struct.  This change saves a small amount
of memory.

2013-12-06  Tom Tromey  <tromey@redhat.com>

	* psympriv.h (struct partial_symtab) <user>: Move earlier.
2013-12-06 12:13:51 -07:00
Doug Evans ea52d8933d * psympriv.h (struct partial_symtab): Augment comment for member
section_offsets.
2013-05-06 16:45:13 +00:00