• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修订版d4b0ea16296c8ba432e5110d696acdd6979216e4 (tree)
时间2020-05-13 04:24:51
作者Simon Marchi <simon.marchi@poly...>
CommiterSimon Marchi

Log Message

Pass dwarf2_per_bfd instead of dwarf2_per_objfile to some index-related functions

All these functions actually only need to receive a dwarf2_per_bfd, pass
that instead of dwarf2_per_objfile.

gdb/ChangeLog:

* dwarf2/read.c (create_cu_from_index_list): Replace
dwarf2_per_objfile parameter with dwarf2_per_bfd.
(create_cus_from_index_list): Likewise.
(create_cus_from_index): Likewise.
(create_signatured_type_table_from_index): Likewise.
(create_cus_from_debug_names_list): Likewise.
(create_cus_from_debug_names): Likewise.
(dwarf2_read_gdb_index): Update.
(dwarf2_read_debug_names): Update.

更改概述

差异

--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2474,20 +2474,20 @@ dwarf2_per_bfd::allocate_signatured_type ()
24742474 return result;
24752475 }
24762476
2477-/* Return a new dwarf2_per_cu_data allocated on the dwarf2_per_objfile
2477+/* Return a new dwarf2_per_cu_data allocated on the per-bfd
24782478 obstack, and constructed with the specified field values. */
24792479
24802480 static dwarf2_per_cu_data *
2481-create_cu_from_index_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
2482- struct dwarf2_section_info *section,
2483- int is_dwz,
2484- sect_offset sect_off, ULONGEST length)
2481+create_cu_from_index_list (dwarf2_per_bfd *per_bfd,
2482+ struct dwarf2_section_info *section,
2483+ int is_dwz,
2484+ sect_offset sect_off, ULONGEST length)
24852485 {
2486- dwarf2_per_cu_data *the_cu = dwarf2_per_objfile->per_bfd->allocate_per_cu ();
2486+ dwarf2_per_cu_data *the_cu = per_bfd->allocate_per_cu ();
24872487 the_cu->sect_off = sect_off;
24882488 the_cu->length = length;
24892489 the_cu->section = section;
2490- the_cu->v.quick = OBSTACK_ZALLOC (&dwarf2_per_objfile->per_bfd->obstack,
2490+ the_cu->v.quick = OBSTACK_ZALLOC (&per_bfd->obstack,
24912491 struct dwarf2_per_cu_quick_data);
24922492 the_cu->is_dwz = is_dwz;
24932493 return the_cu;
@@ -2497,7 +2497,7 @@ create_cu_from_index_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
24972497 CUs. */
24982498
24992499 static void
2500-create_cus_from_index_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
2500+create_cus_from_index_list (dwarf2_per_bfd *per_bfd,
25012501 const gdb_byte *cu_list, offset_type n_elements,
25022502 struct dwarf2_section_info *section,
25032503 int is_dwz)
@@ -2512,32 +2512,31 @@ create_cus_from_index_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
25122512 cu_list += 2 * 8;
25132513
25142514 dwarf2_per_cu_data *per_cu
2515- = create_cu_from_index_list (dwarf2_per_objfile, section, is_dwz,
2516- sect_off, length);
2517- dwarf2_per_objfile->per_bfd->all_comp_units.push_back (per_cu);
2515+ = create_cu_from_index_list (per_bfd, section, is_dwz, sect_off,
2516+ length);
2517+ per_bfd->all_comp_units.push_back (per_cu);
25182518 }
25192519 }
25202520
25212521 /* Read the CU list from the mapped index, and use it to create all
2522- the CU objects for this objfile. */
2522+ the CU objects for PER_BFD. */
25232523
25242524 static void
2525-create_cus_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
2525+create_cus_from_index (dwarf2_per_bfd *per_bfd,
25262526 const gdb_byte *cu_list, offset_type cu_list_elements,
25272527 const gdb_byte *dwz_list, offset_type dwz_elements)
25282528 {
2529- gdb_assert (dwarf2_per_objfile->per_bfd->all_comp_units.empty ());
2530- dwarf2_per_objfile->per_bfd->all_comp_units.reserve
2531- ((cu_list_elements + dwz_elements) / 2);
2529+ gdb_assert (per_bfd->all_comp_units.empty ());
2530+ per_bfd->all_comp_units.reserve ((cu_list_elements + dwz_elements) / 2);
25322531
2533- create_cus_from_index_list (dwarf2_per_objfile, cu_list, cu_list_elements,
2534- &dwarf2_per_objfile->per_bfd->info, 0);
2532+ create_cus_from_index_list (per_bfd, cu_list, cu_list_elements,
2533+ &per_bfd->info, 0);
25352534
25362535 if (dwz_elements == 0)
25372536 return;
25382537
2539- dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd);
2540- create_cus_from_index_list (dwarf2_per_objfile, dwz_list, dwz_elements,
2538+ dwz_file *dwz = dwarf2_get_dwz_file (per_bfd);
2539+ create_cus_from_index_list (per_bfd, dwz_list, dwz_elements,
25412540 &dwz->info, 1);
25422541 }
25432542
@@ -2545,13 +2544,11 @@ create_cus_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
25452544
25462545 static void
25472546 create_signatured_type_table_from_index
2548- (struct dwarf2_per_objfile *dwarf2_per_objfile,
2549- struct dwarf2_section_info *section,
2550- const gdb_byte *bytes,
2551- offset_type elements)
2547+ (dwarf2_per_bfd *per_bfd, struct dwarf2_section_info *section,
2548+ const gdb_byte *bytes, offset_type elements)
25522549 {
2553- gdb_assert (dwarf2_per_objfile->per_bfd->all_type_units.empty ());
2554- dwarf2_per_objfile->per_bfd->all_type_units.reserve (elements / 3);
2550+ gdb_assert (per_bfd->all_type_units.empty ());
2551+ per_bfd->all_type_units.reserve (elements / 3);
25552552
25562553 htab_up sig_types_hash = allocate_signatured_type_table ();
25572554
@@ -2571,23 +2568,23 @@ create_signatured_type_table_from_index
25712568 signature = extract_unsigned_integer (bytes + 16, 8, BFD_ENDIAN_LITTLE);
25722569 bytes += 3 * 8;
25732570
2574- sig_type = dwarf2_per_objfile->per_bfd->allocate_signatured_type ();
2571+ sig_type = per_bfd->allocate_signatured_type ();
25752572 sig_type->signature = signature;
25762573 sig_type->type_offset_in_tu = type_offset_in_tu;
25772574 sig_type->per_cu.is_debug_types = 1;
25782575 sig_type->per_cu.section = section;
25792576 sig_type->per_cu.sect_off = sect_off;
25802577 sig_type->per_cu.v.quick
2581- = OBSTACK_ZALLOC (&dwarf2_per_objfile->per_bfd->obstack,
2578+ = OBSTACK_ZALLOC (&per_bfd->obstack,
25822579 struct dwarf2_per_cu_quick_data);
25832580
25842581 slot = htab_find_slot (sig_types_hash.get (), sig_type, INSERT);
25852582 *slot = sig_type;
25862583
2587- dwarf2_per_objfile->per_bfd->all_type_units.push_back (sig_type);
2584+ per_bfd->all_type_units.push_back (sig_type);
25882585 }
25892586
2590- dwarf2_per_objfile->per_bfd->signatured_types = std::move (sig_types_hash);
2587+ per_bfd->signatured_types = std::move (sig_types_hash);
25912588 }
25922589
25932590 /* Create the signatured type hash table from .debug_names. */
@@ -3106,7 +3103,7 @@ dwarf2_read_gdb_index
31063103 }
31073104 }
31083105
3109- create_cus_from_index (dwarf2_per_objfile, cu_list, cu_list_elements,
3106+ create_cus_from_index (dwarf2_per_objfile->per_bfd, cu_list, cu_list_elements,
31103107 dwz_list, dwz_list_elements);
31113108
31123109 if (types_list_elements)
@@ -3118,8 +3115,9 @@ dwarf2_read_gdb_index
31183115
31193116 dwarf2_section_info *section = &dwarf2_per_objfile->per_bfd->types[0];
31203117
3121- create_signatured_type_table_from_index (dwarf2_per_objfile, section,
3122- types_list, types_list_elements);
3118+ create_signatured_type_table_from_index (dwarf2_per_objfile->per_bfd,
3119+ section, types_list,
3120+ types_list_elements);
31233121 }
31243122
31253123 create_addrmap_from_index (dwarf2_per_objfile, map.get ());
@@ -5079,7 +5077,7 @@ read_debug_names_from_section (struct objfile *objfile,
50795077 list. */
50805078
50815079 static void
5082-create_cus_from_debug_names_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
5080+create_cus_from_debug_names_list (dwarf2_per_bfd *per_bfd,
50835081 const mapped_debug_names &map,
50845082 dwarf2_section_info &section,
50855083 bool is_dwz)
@@ -5098,9 +5096,8 @@ create_cus_from_debug_names_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
50985096 the next CU as end of this CU. We create the CUs here with length 0,
50995097 and in cutu_reader::cutu_reader we'll fill in the actual length. */
51005098 dwarf2_per_cu_data *per_cu
5101- = create_cu_from_index_list (dwarf2_per_objfile, &section, is_dwz,
5102- sect_off, 0);
5103- dwarf2_per_objfile->per_bfd->all_comp_units.push_back (per_cu);
5099+ = create_cu_from_index_list (per_bfd, &section, is_dwz, sect_off, 0);
5100+ per_bfd->all_comp_units.push_back (per_cu);
51045101 }
51055102 }
51065103
@@ -5122,9 +5119,9 @@ create_cus_from_debug_names_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
51225119 {
51235120 const ULONGEST length = sect_off_next - sect_off_prev;
51245121 dwarf2_per_cu_data *per_cu
5125- = create_cu_from_index_list (dwarf2_per_objfile, &section, is_dwz,
5122+ = create_cu_from_index_list (per_bfd, &section, is_dwz,
51265123 sect_off_prev, length);
5127- dwarf2_per_objfile->per_bfd->all_comp_units.push_back (per_cu);
5124+ per_bfd->all_comp_units.push_back (per_cu);
51285125 }
51295126 sect_off_prev = sect_off_next;
51305127 }
@@ -5134,22 +5131,21 @@ create_cus_from_debug_names_list (struct dwarf2_per_objfile *dwarf2_per_objfile,
51345131 the CU objects for this dwarf2_per_objfile. */
51355132
51365133 static void
5137-create_cus_from_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
5134+create_cus_from_debug_names (dwarf2_per_bfd *per_bfd,
51385135 const mapped_debug_names &map,
51395136 const mapped_debug_names &dwz_map)
51405137 {
5141- gdb_assert (dwarf2_per_objfile->per_bfd->all_comp_units.empty ());
5142- dwarf2_per_objfile->per_bfd->all_comp_units.reserve (map.cu_count + dwz_map.cu_count);
5138+ gdb_assert (per_bfd->all_comp_units.empty ());
5139+ per_bfd->all_comp_units.reserve (map.cu_count + dwz_map.cu_count);
51435140
5144- create_cus_from_debug_names_list (dwarf2_per_objfile, map,
5145- dwarf2_per_objfile->per_bfd->info,
5141+ create_cus_from_debug_names_list (per_bfd, map, per_bfd->info,
51465142 false /* is_dwz */);
51475143
51485144 if (dwz_map.cu_count == 0)
51495145 return;
51505146
5151- dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd);
5152- create_cus_from_debug_names_list (dwarf2_per_objfile, dwz_map, dwz->info,
5147+ dwz_file *dwz = dwarf2_get_dwz_file (per_bfd);
5148+ create_cus_from_debug_names_list (per_bfd, dwz_map, dwz->info,
51535149 true /* is_dwz */);
51545150 }
51555151
@@ -5188,7 +5184,7 @@ dwarf2_read_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile)
51885184 }
51895185 }
51905186
5191- create_cus_from_debug_names (dwarf2_per_objfile, *map, dwz_map);
5187+ create_cus_from_debug_names (dwarf2_per_objfile->per_bfd, *map, dwz_map);
51925188
51935189 if (map->tu_count != 0)
51945190 {