- ALL_OBJFILES (objfile)
- {
- if (!objfile->sf || !objfile->sf->sym_probe_fns
- || objfile->sect_index_text == -1)
- continue;
-
- /* If this proves too inefficient, we can replace with a hash. */
- const std::vector<probe *> &probes
- = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
- for (probe *p : probes)
- if (p->get_relocated_address (objfile) == pc)
- {
- result.objfile = objfile;
- result.prob = p;
- return result;
- }
- }
+ for (objfile *objfile : current_program_space->objfiles ())
+ {
+ if (!objfile->sf || !objfile->sf->sym_probe_fns
+ || objfile->sect_index_text == -1)
+ continue;
+
+ /* If this proves too inefficient, we can replace with a hash. */
+ const std::vector<std::unique_ptr<probe>> &probes
+ = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
+ for (auto &p : probes)
+ if (p->get_relocated_address (objfile) == pc)
+ {
+ result.objfile = objfile;
+ result.prob = p.get ();
+ return result;
+ }
+ }