diff options
author | Tom Tromey <tromey@redhat.com> | 2010-07-13 20:51:34 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-07-13 20:51:34 +0000 |
commit | 9291a0cd80ce4d50cbe531a872b7b00e3e67e3c9 (patch) | |
tree | 1136abf1538a2fe83874339f6fea2566fd1e6235 /gdb/doc | |
parent | 58b6ab1339836b1684461bec9eb72682bc2972df (diff) | |
download | gdb-9291a0cd80ce4d50cbe531a872b7b00e3e67e3c9.zip gdb-9291a0cd80ce4d50cbe531a872b7b00e3e67e3c9.tar.gz gdb-9291a0cd80ce4d50cbe531a872b7b00e3e67e3c9.tar.bz2 |
gdb
* breakpoint.c (save_cmdlist): No longer static.
* gdbcmd.h (save_cmdlist): Declare.
* symfile.c (symbol_file_add_with_addrs_or_offsets): Set
OBJF_READNOW on objfile if readnow_symbol_files.
* elfread.c (elf_symfile_read): Use dwarf2_initialize_objfile.
(elf_sym_fns_gdb_index): New global.
* dwarf2read.c: Include exceptions.h.
(offset_type): New.
(struct mapped_index): New.
(dwarf2_per_cu_data_ptr): New typedef.
(struct dwarf2_per_objfile) <using_index, index_table, gdb_index>:
New fields.
(GDB_INDEX_SECTION): New define.
(struct dwarf2_per_cu_quick_data): New.
(struct dwarf2_per_cu_data) <objfile>: New field.
<psymtab>: Removed.
<v>: New field.
(byte_swap): New function.
(MAYBE_SWAP): New macro.
(INDEX_SUFFIX): New macro.
(dw2_do_instantiate_symtab): New function.
(dw2_instantiate_symtab): Likewise.
(create_cus_from_index): Likewise.
(create_addrmap_from_index): Likewise.
(mapped_index_string_hash): Likewise.
(find_slot_in_mapped_hash): Likewise.
(dwarf2_read_index): Likewise.
(dw2_setup): Likewise.
(dw2_require_line_header): Likewise.
(dw2_require_full_path): Likewise.
(dw2_find_last_source_symtab): Likewise.
(dw2_forget_cached_source_info): Likewise.
(dw2_lookup_symtab): Likewise.
(dw2_lookup_symbol): Likewise.
(dw2_do_expand_symtabs_matching): Likewise.
(dw2_pre_expand_symtabs_matching): Likewise.
(dw2_print_stats): Likewise.
(dw2_dump): Likewise.
(dw2_relocate): Likewise.
(dw2_expand_symtabs_for_function): Likewise.
(dw2_expand_all_symtabs): Likewise.
(dw2_expand_symtabs_with_filename): Likewise.
(dw2_find_symbol_file): Likewise.
(dw2_map_ada_symtabs): Likewise.
(dw2_expand_symtabs_matching): Likewise.
(dw2_find_pc_sect_symtab): Likewise.
(dw2_map_symbol_names): Likewise.
(dw2_map_symbol_filenames): Likewise.
(dw2_has_symbols): Likewise.
(dwarf2_gdb_index_functions): New global.
(dwarf2_initialize_objfile): New function.
(process_psymtab_comp_unit): Update.
(add_partial_subprogram): Likewise.
(dwarf2_psymtab_to_symtab): Likewise.
(psymtab_to_symtab_1): Use dw2_do_instantiate_symtab.
(process_full_comp_unit): Update.
(find_file_and_directory): New function.
(read_file_scope): Use find_file_and_directory.
(dwarf2_per_cu_objfile): Update.
(dwarf2_per_cu_addr_size): Update.
(dwarf2_per_cu_offset_size): Update.
(dwarf2_free_objfile): Free the index, if needed.
(dwarf2_per_objfile_free): Unmap the index, if needed.
(struct strtab_entry): New.
(hash_strtab_entry): New function.
(eq_strtab_entry): Likewise.
(create_strtab): Likewise.
(add_string): Likewise.
(struct symtab_index_entry): New.
(struct mapped_symtab): New.
(hash_symtab_entry): New function.
(eq_symtab_entry): Likewise.
(delete_symtab_entry): Likewise.
(create_index_table): Likewise.
(create_mapped_symtab): Likewise.
(cleanup_mapped_symtab): Likewise.
(find_slot): Likewise.
(hash_expand): Likewise.
(add_index_entry): Likewise.
(add_indices_to_cpool): Likewise.
(write_hash_table): Likewise.
(add_address_entry): Likewise.
(write_psymbols): Likewise.
(write_obstack): Likewise.
(unlink_if_set): Likewise.
(write_psymtabs_to_index): Likewise.
(save_gdb_index_command): Likewise.
(_initialize_dwarf2_read): Install "save gdb-index"
command.
(create_all_comp_units): Initialize 'objfile' field of CU.
(dwarf2_locate_sections): Check for .gdb_index.
* psymtab.h (dwarf2_gdb_index_functions): Declare.
* symfile.h (dwarf2_initialize_objfile): Declare.
gdb/doc
* gdb.texinfo (Index Files): New node.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 41 |
2 files changed, 45 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 1daed98..6d0a3a4 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,9 @@ 2010-07-13 Tom Tromey <tromey@redhat.com> + * gdb.texinfo (Index Files): New node. + +2010-07-13 Tom Tromey <tromey@redhat.com> + * gdb.texinfo (GDB/MI Variable Objects): Remove extra 'for'. 2010-07-13 Tom Tromey <tromey@redhat.com> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 3b3d331..ba5ab75 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -14289,6 +14289,7 @@ program. To debug a core dump of a previous run, you must also tell @menu * Files:: Commands to specify files * Separate Debug Files:: Debugging information in separate files +* Index Files:: Index files speed up GDB * Symbol Errors:: Errors reading symbol files * Data Files:: GDB data files @end menu @@ -15178,6 +15179,46 @@ gnu_debuglink_crc32 (unsigned long crc, This computation does not apply to the ``build ID'' method. +@node Index Files +@section Index Files Speed Up @value{GDBN} +@cindex index files +@cindex @samp{.gdb_index} section + +When @value{GDBN} finds a symbol file, it scans the symbols in the +file in order to construct an internal symbol table. This lets most +@value{GDBN} operations work quickly---at the cost of a delay early +on. For large programs, this delay can be quite lengthy, so +@value{GDBN} provides a way to build an index, which speeds up +startup. + +The index is stored as a section in the symbol file. @value{GDBN} can +write the index to a file, then you can put it into the symbol file +using @command{objcopy}. + +To create an index file, use the @code{save gdb-index} command: + +@table @code +@item save gdb-index @var{directory} +@kindex save gdb-index +Create an index file for each symbol file currently known by +@value{GDBN}. Each file is named after its corresponding symbol file, +with @samp{.gdb-index} appended, and is written into the given +@var{directory}. +@end table + +Once you have created an index file you can merge it into your symbol +file, here named @file{symfile}, using @command{objcopy}: + +@smallexample +$ objcopy --add-section .gdb_index=symfile.gdb-index \ + --set-section-flags .gdb_index=readonly symfile symfile +@end smallexample + +There are currently some limitation on indices. They only work when +for DWARF debugging information, not stabs. And, they do not +currently work for programs using Ada. + + @node Symbol Errors @section Errors Reading Symbol Files |