• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine 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

Revisionbd3914c7808027e0b4a90b308718f7e5defb641b (tree)
Zeit2020-05-13 04:24:51
AutorSimon Marchi <simon.marchi@effi...>
CommiterSimon Marchi

Log Message

Add dwarf2_per_objfile parameter to free_one_cached_comp_unit

This allows removing some references to
dwarf2_per_cu_data::dwarf2_per_objfile.

gdb/ChangeLog:

* dwarf2/read.h (struct dwarf2_queue_item): Add
dwarf2_per_objfile parameter, assign new parameter.
<per_objfile>: New field.
* dwarf2/read.c (free_one_cached_comp_unit): Add
dwarf2_per_objfile parameter.
(queue_comp_unit): Likewise.
(dw2_do_instantiate_symtab): Update.
(process_psymtab_comp_unit): Update.
(maybe_queue_comp_unit): Add dwarf2_per_objfile parameter.
(process_imported_unit_die): Update.
(queue_and_load_dwo_tu): Update.
(follow_die_offset): Update.
(follow_die_sig_1): Update.

Ändern Zusammenfassung

Diff

--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1568,7 +1568,8 @@ static void prepare_one_comp_unit (struct dwarf2_cu *cu,
15681568
15691569 static void age_cached_comp_units (struct dwarf2_per_objfile *dwarf2_per_objfile);
15701570
1571-static void free_one_cached_comp_unit (struct dwarf2_per_cu_data *);
1571+static void free_one_cached_comp_unit (dwarf2_per_cu_data *target_per_cu,
1572+ dwarf2_per_objfile *per_objfile);
15721573
15731574 static struct type *set_die_type (struct die_info *, struct type *,
15741575 struct dwarf2_cu *);
@@ -1602,7 +1603,8 @@ static struct type *get_die_type_at_offset (sect_offset,
16021603
16031604 static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
16041605
1605-static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu,
1606+static void queue_comp_unit (dwarf2_per_cu_data *per_cu,
1607+ dwarf2_per_objfile *per_objfile,
16061608 enum language pretend_language);
16071609
16081610 static void process_queue (struct dwarf2_per_objfile *dwarf2_per_objfile);
@@ -1642,7 +1644,7 @@ dwarf2_queue_item::~dwarf2_queue_item ()
16421644 if (per_cu->queued)
16431645 {
16441646 if (per_cu->cu != NULL)
1645- free_one_cached_comp_unit (per_cu);
1647+ free_one_cached_comp_unit (per_cu, per_objfile);
16461648 per_cu->queued = 0;
16471649 }
16481650 }
@@ -2381,7 +2383,7 @@ dw2_do_instantiate_symtab (dwarf2_per_cu_data *per_cu,
23812383
23822384 if (!dwarf2_per_objfile->symtab_set_p (per_cu))
23832385 {
2384- queue_comp_unit (per_cu, language_minimal);
2386+ queue_comp_unit (per_cu, dwarf2_per_objfile, language_minimal);
23852387 load_cu (per_cu, dwarf2_per_objfile, skip_partial);
23862388
23872389 /* If we just loaded a CU from a DWO, and we're working with an index
@@ -7541,7 +7543,7 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
75417543 read in the compilation unit (see load_partial_dies).
75427544 This problem could be avoided, but the benefit is unclear. */
75437545 if (this_cu->cu != NULL)
7544- free_one_cached_comp_unit (this_cu);
7546+ free_one_cached_comp_unit (this_cu, per_objfile);
75457547
75467548 cutu_reader reader (this_cu, per_objfile, NULL, 0, false);
75477549
@@ -8899,11 +8901,12 @@ dwarf2_psymtab::read_symtab (struct objfile *objfile)
88998901 /* Add PER_CU to the queue. */
89008902
89018903 static void
8902-queue_comp_unit (struct dwarf2_per_cu_data *per_cu,
8904+queue_comp_unit (dwarf2_per_cu_data *per_cu,
8905+ dwarf2_per_objfile *per_objfile,
89038906 enum language pretend_language)
89048907 {
89058908 per_cu->queued = 1;
8906- per_cu->per_bfd->queue.emplace (per_cu, pretend_language);
8909+ per_cu->per_bfd->queue.emplace (per_cu, per_objfile, pretend_language);
89078910 }
89088911
89098912 /* If PER_CU is not yet queued, add it to the queue.
@@ -8917,7 +8920,8 @@ queue_comp_unit (struct dwarf2_per_cu_data *per_cu,
89178920
89188921 static int
89198922 maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu,
8920- struct dwarf2_per_cu_data *per_cu,
8923+ dwarf2_per_cu_data *per_cu,
8924+ dwarf2_per_objfile *per_objfile,
89218925 enum language pretend_language)
89228926 {
89238927 /* We may arrive here during partial symbol reading, if we need full
@@ -8948,7 +8952,7 @@ maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu,
89488952 }
89498953
89508954 /* Add it to the queue. */
8951- queue_comp_unit (per_cu, pretend_language);
8955+ queue_comp_unit (per_cu, per_objfile, pretend_language);
89528956
89538957 return 1;
89548958 }
@@ -9909,7 +9913,7 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
99099913 return;
99109914
99119915 /* If necessary, add it to the queue and load its DIEs. */
9912- if (maybe_queue_comp_unit (cu, per_cu, cu->language))
9916+ if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language))
99139917 load_full_comp_unit (per_cu, per_objfile, false, cu->language);
99149918
99159919 cu->per_cu->imported_symtabs_push (per_cu);
@@ -12823,7 +12827,7 @@ queue_and_load_dwo_tu (void **slot, void *info)
1282312827 /* We pass NULL for DEPENDENT_CU because we don't yet know if there's
1282412828 a real dependency of PER_CU on SIG_TYPE. That is detected later
1282512829 while processing PER_CU. */
12826- if (maybe_queue_comp_unit (NULL, sig_cu, cu->language))
12830+ if (maybe_queue_comp_unit (NULL, sig_cu, cu->per_objfile, cu->language))
1282712831 load_full_type_unit (sig_cu, cu->per_objfile);
1282812832 cu->per_cu->imported_symtabs_push (sig_cu);
1282912833 }
@@ -22208,7 +22212,7 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz,
2220822212 dwarf2_per_objfile);
2220922213
2221022214 /* If necessary, add it to the queue and load its DIEs. */
22211- if (maybe_queue_comp_unit (cu, per_cu, cu->language))
22215+ if (maybe_queue_comp_unit (cu, per_cu, dwarf2_per_objfile, cu->language))
2221222216 load_full_comp_unit (per_cu, dwarf2_per_objfile, false, cu->language);
2221322217
2221422218 target_cu = per_cu->cu;
@@ -22571,6 +22575,8 @@ follow_die_sig_1 (struct die_info *src_die, struct signatured_type *sig_type,
2257122575 struct die_info temp_die;
2257222576 struct dwarf2_cu *sig_cu, *cu = *ref_cu;
2257322577 struct die_info *die;
22578+ dwarf2_per_objfile *dwarf2_per_objfile = (*ref_cu)->per_objfile;
22579+
2257422580
2257522581 /* While it might be nice to assert sig_type->type == NULL here,
2257622582 we can get here for DW_AT_imported_declaration where we need
@@ -22578,8 +22584,9 @@ follow_die_sig_1 (struct die_info *src_die, struct signatured_type *sig_type,
2257822584
2257922585 /* If necessary, add it to the queue and load its DIEs. */
2258022586
22581- if (maybe_queue_comp_unit (*ref_cu, &sig_type->per_cu, language_minimal))
22582- read_signatured_type (sig_type, (*ref_cu)->per_objfile);
22587+ if (maybe_queue_comp_unit (*ref_cu, &sig_type->per_cu, dwarf2_per_objfile,
22588+ language_minimal))
22589+ read_signatured_type (sig_type, dwarf2_per_objfile);
2258322590
2258422591 sig_cu = sig_type->per_cu.cu;
2258522592 gdb_assert (sig_cu != NULL);
@@ -22589,8 +22596,6 @@ follow_die_sig_1 (struct die_info *src_die, struct signatured_type *sig_type,
2258922596 to_underlying (temp_die.sect_off));
2259022597 if (die)
2259122598 {
22592- struct dwarf2_per_objfile *dwarf2_per_objfile = (*ref_cu)->per_objfile;
22593-
2259422599 /* For .gdb_index version 7 keep track of included TUs.
2259522600 http://sourceware.org/bugzilla/show_bug.cgi?id=15021. */
2259622601 if (dwarf2_per_objfile->per_bfd->index_table != NULL
@@ -23568,11 +23573,10 @@ age_cached_comp_units (struct dwarf2_per_objfile *dwarf2_per_objfile)
2356823573 /* Remove a single compilation unit from the cache. */
2356923574
2357023575 static void
23571-free_one_cached_comp_unit (struct dwarf2_per_cu_data *target_per_cu)
23576+free_one_cached_comp_unit (dwarf2_per_cu_data *target_per_cu,
23577+ dwarf2_per_objfile *dwarf2_per_objfile)
2357223578 {
2357323579 struct dwarf2_per_cu_data *per_cu, **last_chain;
23574- struct dwarf2_per_objfile *dwarf2_per_objfile
23575- = target_per_cu->dwarf2_per_objfile;
2357623580
2357723581 per_cu = dwarf2_per_objfile->per_bfd->read_in_chain;
2357823582 last_chain = &dwarf2_per_objfile->per_bfd->read_in_chain;
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -52,8 +52,10 @@ struct signatured_type;
5252 for. */
5353 struct dwarf2_queue_item
5454 {
55- dwarf2_queue_item (dwarf2_per_cu_data *cu, enum language lang)
55+ dwarf2_queue_item (dwarf2_per_cu_data *cu, dwarf2_per_objfile *per_objfile,
56+ enum language lang)
5657 : per_cu (cu),
58+ per_objfile (per_objfile),
5759 pretend_language (lang)
5860 {
5961 }
@@ -62,7 +64,8 @@ struct dwarf2_queue_item
6264
6365 DISABLE_COPY_AND_ASSIGN (dwarf2_queue_item);
6466
65- struct dwarf2_per_cu_data *per_cu;
67+ dwarf2_per_cu_data *per_cu;
68+ dwarf2_per_objfile *per_objfile;
6669 enum language pretend_language;
6770 };
6871