/* Generic static probe support for GDB.
- Copyright (C) 2012-2019 Free Software Foundation, Inc.
+ Copyright (C) 2012-2022 Free Software Foundation, Inc.
This file is part of GDB.
#include "progspace.h"
#include "filenames.h"
#include "linespec.h"
-#include "gdb_regex.h"
+#include "gdbsupport/gdb_regex.h"
#include "frame.h"
#include "arch-utils.h"
#include "value.h"
#include "location.h"
#include <ctype.h>
#include <algorithm>
-#include "common/gdb_optional.h"
+#include "gdbsupport/gdb_optional.h"
/* Class that implements the static probe methods for "any" probe. */
}
else
{
- struct program_space *pspace;
-
- ALL_PSPACES (pspace)
+ for (struct program_space *pspace : program_spaces)
parse_probes_in_pspace (spops, pspace, objfile_namestr,
provider, name, &result);
}
std::string canon (arg_start, arg_end - arg_start);
canonical->special_display = 1;
canonical->pre_expanded = 1;
- canonical->location = new_probe_location (canon.c_str ());
+ canonical->location = new_probe_location (std::move (canon));
}
return result;
ui_out_emit_tuple tuple_emitter (current_uiout, "probe");
current_uiout->field_string ("type", probe_type);
- current_uiout->field_string ("provider",
- probe.prob->get_provider ().c_str ());
- current_uiout->field_string ("name", probe.prob->get_name ().c_str ());
+ current_uiout->field_string ("provider", probe.prob->get_provider ());
+ current_uiout->field_string ("name", probe.prob->get_name ());
current_uiout->field_core_addr ("addr", probe.prob->get_gdbarch (),
probe.prob->get_relocated_address
(probe.objfile));
if (!probe.prob)
return NULL;
- n_args = probe.prob->get_argument_count (frame);
+ n_args = probe.prob->get_argument_count (get_frame_arch (frame));
if (n >= n_args)
return NULL;
subcommand.\n\
If you do not specify any argument, or specify `all', then the command\n\
will show information about all types of probes."),
- &info_probes_cmdlist, "info probes ",
- 0/*allow-unknown*/, &infolist);
+ &info_probes_cmdlist, 0/*allow-unknown*/, &infolist);
return &info_probes_cmdlist;
}
if (pc_probe.prob == NULL)
error (_("No probe at PC %s"), core_addr_to_string (pc));
- n_args = pc_probe.prob->get_argument_count (frame);
+ n_args = pc_probe.prob->get_argument_count (arch);
if (sel == -1)
return value_from_longest (builtin_type (arch)->builtin_int, n_args);
int sel = (int) (uintptr_t) data;
struct bound_probe pc_probe;
int n_args;
- struct frame_info *frame = get_selected_frame (NULL);
/* SEL == -1 means "_probe_argc". */
gdb_assert (sel >= -1);
if (pc_probe.prob == NULL)
error (_("No probe at PC %s"), core_addr_to_string (pc));
- n_args = pc_probe.prob->get_argument_count (frame);
+ n_args = pc_probe.prob->get_argument_count (expr->gdbarch);
if (sel == -1)
{
{
compute_probe_arg,
compile_probe_arg,
- NULL
};
std::vector<const static_probe_ops *> all_static_probe_ops;
+void _initialize_probe ();
void
-_initialize_probe (void)
+_initialize_probe ()
{
all_static_probe_ops.push_back (&any_static_probe_ops);