+class any_static_probe_ops : public static_probe_ops
+{
+public:
+ /* See probe.h. */
+ bool is_linespec (const char **linespecp) const override;
+
+ /* See probe.h. */
+ void get_probes (std::vector<std::unique_ptr<probe>> *probesp,
+ struct objfile *objfile) const override;
+
+ /* See probe.h. */
+ const char *type_name () const override;
+
+ /* See probe.h. */
+ std::vector<struct info_probe_column> gen_info_probes_table_header
+ () const override;
+};
+
+/* Static operations associated with a generic probe. */
+
+const any_static_probe_ops any_static_probe_ops {};
+
+/* A helper for parse_probes that decodes a probe specification in
+ SEARCH_PSPACE. It appends matching SALs to RESULT. */
+
+static void
+parse_probes_in_pspace (const static_probe_ops *spops,
+ struct program_space *search_pspace,
+ const char *objfile_namestr,
+ const char *provider,
+ const char *name,
+ std::vector<symtab_and_line> *result)
+{
+ for (objfile *objfile : search_pspace->objfiles ())
+ {
+ if (!objfile->sf || !objfile->sf->sym_probe_fns)
+ continue;
+
+ if (objfile_namestr
+ && FILENAME_CMP (objfile_name (objfile), objfile_namestr) != 0
+ && FILENAME_CMP (lbasename (objfile_name (objfile)),
+ objfile_namestr) != 0)
+ continue;
+
+ const std::vector<std::unique_ptr<probe>> &probes
+ = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
+
+ for (auto &p : probes)
+ {
+ if (spops != &any_static_probe_ops && p->get_static_ops () != spops)
+ continue;
+
+ if (provider != NULL && p->get_provider () != provider)
+ continue;
+
+ if (p->get_name () != name)
+ continue;
+
+ symtab_and_line sal;
+ sal.pc = p->get_relocated_address (objfile);
+ sal.explicit_pc = 1;
+ sal.section = find_pc_overlay (sal.pc);
+ sal.pspace = search_pspace;
+ sal.prob = p.get ();
+ sal.objfile = objfile;
+
+ result->push_back (std::move (sal));
+ }
+ }
+}