• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revisão129d1afcc50c0aa3cf69fb3c5d4d8c825bec1061 (tree)
Hora2022-10-22 03:27:11
AutorSimon Marchi <simon.marchi@poly...>
CommiterSimon Marchi

Mensagem de Log

gdb: make inherit_abstract_dies use vector iterators

Small cleanup to use std::vector iterators rather than raw pointers.

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: I8d50dbb3f2d8dad7ff94066a578d523f1f31b590

Mudança Sumário

Diff

--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -11952,29 +11952,28 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
1195211952 if (!offsets.empty ())
1195311953 {
1195411954 std::sort (offsets.begin (), offsets.end ());
11955- sect_offset *offsets_end = offsets.data () + offsets.size ();
11956- for (sect_offset *offsetp = offsets.data () + 1;
11957- offsetp < offsets_end;
11958- offsetp++)
11959- if (offsetp[-1] == *offsetp)
11955+
11956+ for (auto offsets_it = offsets.begin () + 1;
11957+ offsets_it < offsets.end ();
11958+ ++offsets_it)
11959+ if (*(offsets_it - 1) == *offsets_it)
1196011960 complaint (_("Multiple children of DIE %s refer "
1196111961 "to DIE %s as their abstract origin"),
1196211962 sect_offset_str (die->sect_off),
11963- sect_offset_str (*offsetp));
11963+ sect_offset_str (*offsets_it));
1196411964 }
1196511965
11966- sect_offset *offsetp = offsets.data ();
11967- sect_offset *offsets_end = offsets.data () + offsets.size ();
11966+ auto offsets_it = offsets.begin ();
1196811967 die_info *origin_child_die = origin_die->child;
1196911968 while (origin_child_die != nullptr && origin_child_die->tag != 0)
1197011969 {
1197111970 /* Is ORIGIN_CHILD_DIE referenced by any of the DIE children? */
11972- while (offsetp < offsets_end
11973- && *offsetp < origin_child_die->sect_off)
11974- offsetp++;
11971+ while (offsets_it < offsets.end ()
11972+ && *offsets_it < origin_child_die->sect_off)
11973+ ++offsets_it;
1197511974
11976- if (offsetp >= offsets_end
11977- || *offsetp > origin_child_die->sect_off)
11975+ if (offsets_it == offsets.end ()
11976+ || *offsets_it > origin_child_die->sect_off)
1197811977 {
1197911978 /* Found that ORIGIN_CHILD_DIE is really not referenced.
1198011979 Check whether we're already processing ORIGIN_CHILD_DIE.