1 /* Generic static probe support for GDB.
3 Copyright (C) 2012-2017 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "cli/cli-cmds.h"
24 #include "cli/cli-utils.h"
27 #include "progspace.h"
28 #include "filenames.h"
30 #include "gdb_regex.h"
32 #include "arch-utils.h"
39 #include "common/gdb_optional.h"
41 /* A helper for parse_probes that decodes a probe specification in
42 SEARCH_PSPACE. It appends matching SALs to RESULT. */
45 parse_probes_in_pspace (const struct probe_ops *probe_ops,
46 struct program_space *search_pspace,
47 const char *objfile_namestr,
50 std::vector<symtab_and_line> *result)
52 struct objfile *objfile;
54 ALL_PSPACE_OBJFILES (search_pspace, objfile)
56 if (!objfile->sf || !objfile->sf->sym_probe_fns)
60 && FILENAME_CMP (objfile_name (objfile), objfile_namestr) != 0
61 && FILENAME_CMP (lbasename (objfile_name (objfile)),
62 objfile_namestr) != 0)
65 const std::vector<probe *> &probes
66 = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
68 for (struct probe *probe : probes)
70 if (probe_ops != &probe_ops_any && probe->pops != probe_ops)
73 if (provider && strcmp (probe->provider, provider) != 0)
76 if (strcmp (probe->name, name) != 0)
80 sal.pc = get_probe_address (probe, objfile);
82 sal.section = find_pc_overlay (sal.pc);
83 sal.pspace = search_pspace;
85 sal.objfile = objfile;
87 result->push_back (std::move (sal));
92 /* See definition in probe.h. */
94 std::vector<symtab_and_line>
95 parse_probes (const struct event_location *location,
96 struct program_space *search_pspace,
97 struct linespec_result *canonical)
100 char *objfile_namestr = NULL, *provider = NULL, *name, *p;
101 struct cleanup *cleanup;
102 const struct probe_ops *probe_ops;
103 const char *arg_start, *cs;
105 gdb_assert (event_location_type (location) == PROBE_LOCATION);
106 arg_start = get_probe_location (location);
109 probe_ops = probe_linespec_to_ops (&cs);
110 if (probe_ops == NULL)
111 error (_("'%s' is not a probe linespec"), arg_start);
114 arg = skip_spaces (arg);
116 error (_("argument to `%s' missing"), arg_start);
118 arg_end = skip_to_space (arg);
120 /* We make a copy here so we can write over parts with impunity. */
121 arg = savestring (arg, arg_end - arg);
122 cleanup = make_cleanup (xfree, arg);
124 /* Extract each word from the argument, separated by ":"s. */
125 p = strchr (arg, ':');
128 /* This is `-p name'. */
136 p = strchr (hold, ':');
139 /* This is `-p provider:name'. */
145 /* This is `-p objfile:provider:name'. */
147 objfile_namestr = arg;
154 error (_("no probe name specified"));
155 if (provider && *provider == '\0')
156 error (_("invalid provider name"));
157 if (objfile_namestr && *objfile_namestr == '\0')
158 error (_("invalid objfile name"));
160 std::vector<symtab_and_line> result;
161 if (search_pspace != NULL)
163 parse_probes_in_pspace (probe_ops, search_pspace, objfile_namestr,
164 provider, name, &result);
168 struct program_space *pspace;
171 parse_probes_in_pspace (probe_ops, pspace, objfile_namestr,
172 provider, name, &result);
177 throw_error (NOT_FOUND_ERROR,
178 _("No probe matching objfile=`%s', provider=`%s', name=`%s'"),
179 objfile_namestr ? objfile_namestr : _("<any>"),
180 provider ? provider : _("<any>"),
188 canon = savestring (arg_start, arg_end - arg_start);
189 make_cleanup (xfree, canon);
190 canonical->special_display = 1;
191 canonical->pre_expanded = 1;
192 canonical->location = new_probe_location (canon);
195 do_cleanups (cleanup);
200 /* See definition in probe.h. */
203 find_probes_in_objfile (struct objfile *objfile, const char *provider,
206 VEC (probe_p) *result = NULL;
208 if (!objfile->sf || !objfile->sf->sym_probe_fns)
211 const std::vector<probe *> &probes
212 = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
213 for (struct probe *probe : probes)
215 if (strcmp (probe->provider, provider) != 0)
218 if (strcmp (probe->name, name) != 0)
221 VEC_safe_push (probe_p, result, probe);
227 /* See definition in probe.h. */
230 find_probe_by_pc (CORE_ADDR pc)
232 struct objfile *objfile;
233 struct bound_probe result;
235 result.objfile = NULL;
238 ALL_OBJFILES (objfile)
240 if (!objfile->sf || !objfile->sf->sym_probe_fns
241 || objfile->sect_index_text == -1)
244 /* If this proves too inefficient, we can replace with a hash. */
245 const std::vector<probe *> &probes
246 = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
247 for (struct probe *probe : probes)
248 if (get_probe_address (probe, objfile) == pc)
250 result.objfile = objfile;
251 result.probe = probe;
261 /* Make a vector of probes matching OBJNAME, PROVIDER, and PROBE_NAME.
262 If POPS is not NULL, only probes of this certain probe_ops will match.
263 Each argument is a regexp, or NULL, which matches anything. */
265 static std::vector<bound_probe>
266 collect_probes (const std::string &objname, const std::string &provider,
267 const std::string &probe_name, const struct probe_ops *pops)
269 struct objfile *objfile;
270 std::vector<bound_probe> result;
271 gdb::optional<compiled_regex> obj_pat, prov_pat, probe_pat;
273 if (!provider.empty ())
274 prov_pat.emplace (provider.c_str (), REG_NOSUB,
275 _("Invalid provider regexp"));
276 if (!probe_name.empty ())
277 probe_pat.emplace (probe_name.c_str (), REG_NOSUB,
278 _("Invalid probe regexp"));
279 if (!objname.empty ())
280 obj_pat.emplace (objname.c_str (), REG_NOSUB,
281 _("Invalid object file regexp"));
283 ALL_OBJFILES (objfile)
285 if (! objfile->sf || ! objfile->sf->sym_probe_fns)
290 if (obj_pat->exec (objfile_name (objfile), 0, NULL, 0) != 0)
294 const std::vector<probe *> &probes
295 = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
297 for (struct probe *probe : probes)
299 if (pops != NULL && probe->pops != pops)
303 && prov_pat->exec (probe->provider, 0, NULL, 0) != 0)
307 && probe_pat->exec (probe->name, 0, NULL, 0) != 0)
310 result.emplace_back (probe, objfile);
317 /* A qsort comparison function for bound_probe_s objects. */
320 compare_probes (const bound_probe &a, const bound_probe &b)
324 v = strcmp (a.probe->provider, b.probe->provider);
328 v = strcmp (a.probe->name, b.probe->name);
332 if (a.probe->address != b.probe->address)
333 return a.probe->address < b.probe->address;
335 return strcmp (objfile_name (a.objfile), objfile_name (b.objfile)) < 0;
338 /* Helper function that generate entries in the ui_out table being
339 crafted by `info_probes_for_ops'. */
342 gen_ui_out_table_header_info (const std::vector<bound_probe> &probes,
343 const struct probe_ops *p)
345 /* `headings' refers to the names of the columns when printing `info
347 VEC (info_probe_column_s) *headings = NULL;
349 info_probe_column_s *column;
350 size_t headings_size;
353 gdb_assert (p != NULL);
355 if (p->gen_info_probes_table_header == NULL
356 && p->gen_info_probes_table_values == NULL)
359 gdb_assert (p->gen_info_probes_table_header != NULL
360 && p->gen_info_probes_table_values != NULL);
362 c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings);
363 p->gen_info_probes_table_header (&headings);
365 headings_size = VEC_length (info_probe_column_s, headings);
368 VEC_iterate (info_probe_column_s, headings, ix, column);
371 size_t size_max = strlen (column->print_name);
373 for (const bound_probe &probe : probes)
375 /* `probe_fields' refers to the values of each new field that this
376 probe will display. */
377 VEC (const_char_ptr) *probe_fields = NULL;
382 if (probe.probe->pops != p)
385 c2 = make_cleanup (VEC_cleanup (const_char_ptr), &probe_fields);
386 p->gen_info_probes_table_values (probe.probe, &probe_fields);
388 gdb_assert (VEC_length (const_char_ptr, probe_fields)
391 for (kx = 0; VEC_iterate (const_char_ptr, probe_fields, kx, val);
394 /* It is valid to have a NULL value here, which means that the
395 backend does not have something to write and this particular
396 field should be skipped. */
400 size_max = std::max (strlen (val), size_max);
405 current_uiout->table_header (size_max, ui_left,
406 column->field_name, column->print_name);
412 /* Helper function to print not-applicable strings for all the extra
413 columns defined in a probe_ops. */
416 print_ui_out_not_applicables (const struct probe_ops *pops)
419 VEC (info_probe_column_s) *headings = NULL;
420 info_probe_column_s *column;
423 if (pops->gen_info_probes_table_header == NULL)
426 c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings);
427 pops->gen_info_probes_table_header (&headings);
430 VEC_iterate (info_probe_column_s, headings, ix, column);
432 current_uiout->field_string (column->field_name, _("n/a"));
437 /* Helper function to print extra information about a probe and an objfile
438 represented by PROBE. */
441 print_ui_out_info (struct probe *probe)
445 /* `values' refers to the actual values of each new field in the output
446 of `info probe'. `headings' refers to the names of each new field. */
447 VEC (const_char_ptr) *values = NULL;
448 VEC (info_probe_column_s) *headings = NULL;
449 info_probe_column_s *column;
452 gdb_assert (probe != NULL);
453 gdb_assert (probe->pops != NULL);
455 if (probe->pops->gen_info_probes_table_header == NULL
456 && probe->pops->gen_info_probes_table_values == NULL)
459 gdb_assert (probe->pops->gen_info_probes_table_header != NULL
460 && probe->pops->gen_info_probes_table_values != NULL);
462 c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings);
463 make_cleanup (VEC_cleanup (const_char_ptr), &values);
465 probe->pops->gen_info_probes_table_header (&headings);
466 probe->pops->gen_info_probes_table_values (probe, &values);
468 gdb_assert (VEC_length (info_probe_column_s, headings)
469 == VEC_length (const_char_ptr, values));
472 VEC_iterate (info_probe_column_s, headings, ix, column);
475 const char *val = VEC_index (const_char_ptr, values, j++);
478 current_uiout->field_skip (column->field_name);
480 current_uiout->field_string (column->field_name, val);
486 /* Helper function that returns the number of extra fields which POPS will
490 get_number_extra_fields (const struct probe_ops *pops)
492 VEC (info_probe_column_s) *headings = NULL;
496 if (pops->gen_info_probes_table_header == NULL)
499 c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings);
500 pops->gen_info_probes_table_header (&headings);
502 n = VEC_length (info_probe_column_s, headings);
509 /* Helper function that returns 1 if there is a probe in PROBES
510 featuring the given POPS. It returns 0 otherwise. */
513 exists_probe_with_pops (const std::vector<bound_probe> &probes,
514 const struct probe_ops *pops)
516 struct bound_probe *probe;
519 for (const bound_probe &probe : probes)
520 if (probe.probe->pops == pops)
526 /* Helper function that parses a probe linespec of the form [PROVIDER
527 [PROBE [OBJNAME]]] from the provided string STR. */
530 parse_probe_linespec (const char *str, std::string *provider,
531 std::string *probe_name, std::string *objname)
533 *probe_name = *objname = "";
535 *provider = extract_arg (&str);
536 if (!provider->empty ())
538 *probe_name = extract_arg (&str);
539 if (!probe_name->empty ())
540 *objname = extract_arg (&str);
544 /* See comment in probe.h. */
547 info_probes_for_ops (const char *arg, int from_tty,
548 const struct probe_ops *pops)
550 std::string provider, probe_name, objname;
551 struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
553 int ui_out_extra_fields = 0;
555 size_t size_name = strlen ("Name");
556 size_t size_objname = strlen ("Object");
557 size_t size_provider = strlen ("Provider");
558 size_t size_type = strlen ("Type");
559 struct gdbarch *gdbarch = get_current_arch ();
561 parse_probe_linespec (arg, &provider, &probe_name, &objname);
563 std::vector<bound_probe> probes
564 = collect_probes (objname, provider, probe_name, pops);
568 const struct probe_ops *po;
571 /* If the probe_ops is NULL, it means the user has requested a "simple"
572 `info probes', i.e., she wants to print all information about all
573 probes. For that, we have to identify how many extra fields we will
574 need to add in the ui_out table.
576 To do that, we iterate over all probe_ops, querying each one about
577 its extra fields, and incrementing `ui_out_extra_fields' to reflect
578 that number. But note that we ignore the probe_ops for which no probes
579 are defined with the given search criteria. */
581 for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix)
582 if (exists_probe_with_pops (probes, po))
583 ui_out_extra_fields += get_number_extra_fields (po);
586 ui_out_extra_fields = get_number_extra_fields (pops);
589 ui_out_emit_table table_emitter (current_uiout,
590 5 + ui_out_extra_fields,
591 probes.size (), "StaticProbes");
593 std::sort (probes.begin (), probes.end (), compare_probes);
595 /* What's the size of an address in our architecture? */
596 size_addr = gdbarch_addr_bit (gdbarch) == 64 ? 18 : 10;
598 /* Determining the maximum size of each field (`type', `provider',
599 `name' and `objname'). */
600 for (const bound_probe &probe : probes)
602 const char *probe_type = probe.probe->pops->type_name (probe.probe);
604 size_type = std::max (strlen (probe_type), size_type);
605 size_name = std::max (strlen (probe.probe->name), size_name);
606 size_provider = std::max (strlen (probe.probe->provider), size_provider);
607 size_objname = std::max (strlen (objfile_name (probe.objfile)),
611 current_uiout->table_header (size_type, ui_left, "type", _("Type"));
612 current_uiout->table_header (size_provider, ui_left, "provider",
614 current_uiout->table_header (size_name, ui_left, "name", _("Name"));
615 current_uiout->table_header (size_addr, ui_left, "addr", _("Where"));
619 const struct probe_ops *po;
622 /* We have to generate the table header for each new probe type
623 that we will print. Note that this excludes probe types not
624 having any defined probe with the search criteria. */
625 for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix)
626 if (exists_probe_with_pops (probes, po))
627 gen_ui_out_table_header_info (probes, po);
630 gen_ui_out_table_header_info (probes, pops);
632 current_uiout->table_header (size_objname, ui_left, "object", _("Object"));
633 current_uiout->table_body ();
635 for (const bound_probe &probe : probes)
637 const char *probe_type = probe.probe->pops->type_name (probe.probe);
639 ui_out_emit_tuple tuple_emitter (current_uiout, "probe");
641 current_uiout->field_string ("type",probe_type);
642 current_uiout->field_string ("provider", probe.probe->provider);
643 current_uiout->field_string ("name", probe.probe->name);
644 current_uiout->field_core_addr ("addr", probe.probe->arch,
645 get_probe_address (probe.probe,
650 const struct probe_ops *po;
653 for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po);
655 if (probe.probe->pops == po)
656 print_ui_out_info (probe.probe);
657 else if (exists_probe_with_pops (probes, po))
658 print_ui_out_not_applicables (po);
661 print_ui_out_info (probe.probe);
663 current_uiout->field_string ("object",
664 objfile_name (probe.objfile));
665 current_uiout->text ("\n");
668 any_found = !probes.empty ();
670 do_cleanups (cleanup);
673 current_uiout->message (_("No probes matched.\n"));
676 /* Implementation of the `info probes' command. */
679 info_probes_command (char *arg, int from_tty)
681 info_probes_for_ops (arg, from_tty, NULL);
684 /* Implementation of the `enable probes' command. */
687 enable_probes_command (char *arg, int from_tty)
689 std::string provider, probe_name, objname;
690 struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
692 parse_probe_linespec ((const char *) arg, &provider, &probe_name, &objname);
694 std::vector<bound_probe> probes
695 = collect_probes (objname, provider, probe_name, NULL);
698 current_uiout->message (_("No probes matched.\n"));
699 do_cleanups (cleanup);
703 /* Enable the selected probes, provided their backends support the
704 notion of enabling a probe. */
705 for (const bound_probe &probe: probes)
707 const struct probe_ops *pops = probe.probe->pops;
709 if (pops->enable_probe != NULL)
711 pops->enable_probe (probe.probe);
712 current_uiout->message (_("Probe %s:%s enabled.\n"),
713 probe.probe->provider, probe.probe->name);
716 current_uiout->message (_("Probe %s:%s cannot be enabled.\n"),
717 probe.probe->provider, probe.probe->name);
720 do_cleanups (cleanup);
723 /* Implementation of the `disable probes' command. */
726 disable_probes_command (char *arg, int from_tty)
728 std::string provider, probe_name, objname;
729 struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
731 parse_probe_linespec ((const char *) arg, &provider, &probe_name, &objname);
733 std::vector<bound_probe> probes
734 = collect_probes (objname, provider, probe_name, NULL /* pops */);
737 current_uiout->message (_("No probes matched.\n"));
738 do_cleanups (cleanup);
742 /* Disable the selected probes, provided their backends support the
743 notion of enabling a probe. */
744 for (const bound_probe &probe : probes)
746 const struct probe_ops *pops = probe.probe->pops;
748 if (pops->disable_probe != NULL)
750 pops->disable_probe (probe.probe);
751 current_uiout->message (_("Probe %s:%s disabled.\n"),
752 probe.probe->provider, probe.probe->name);
755 current_uiout->message (_("Probe %s:%s cannot be disabled.\n"),
756 probe.probe->provider, probe.probe->name);
759 do_cleanups (cleanup);
762 /* See comments in probe.h. */
765 get_probe_address (struct probe *probe, struct objfile *objfile)
767 return probe->pops->get_probe_address (probe, objfile);
770 /* See comments in probe.h. */
773 get_probe_argument_count (struct probe *probe, struct frame_info *frame)
775 return probe->pops->get_probe_argument_count (probe, frame);
778 /* See comments in probe.h. */
781 can_evaluate_probe_arguments (struct probe *probe)
783 return probe->pops->can_evaluate_probe_arguments (probe);
786 /* See comments in probe.h. */
789 evaluate_probe_argument (struct probe *probe, unsigned n,
790 struct frame_info *frame)
792 return probe->pops->evaluate_probe_argument (probe, n, frame);
795 /* See comments in probe.h. */
798 probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
800 struct bound_probe probe;
803 probe = find_probe_by_pc (get_frame_pc (frame));
807 n_args = get_probe_argument_count (probe.probe, frame);
811 return evaluate_probe_argument (probe.probe, n, frame);
814 /* See comment in probe.h. */
816 const struct probe_ops *
817 probe_linespec_to_ops (const char **linespecp)
820 const struct probe_ops *probe_ops;
822 for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, probe_ops); ix++)
823 if (probe_ops->is_linespec (linespecp))
829 /* See comment in probe.h. */
832 probe_is_linespec_by_keyword (const char **linespecp, const char *const *keywords)
834 const char *s = *linespecp;
835 const char *const *csp;
837 for (csp = keywords; *csp; csp++)
839 const char *keyword = *csp;
840 size_t len = strlen (keyword);
842 if (strncmp (s, keyword, len) == 0 && isspace (s[len]))
844 *linespecp += len + 1;
852 /* Implementation of `is_linespec' method for `struct probe_ops'. */
855 probe_any_is_linespec (const char **linespecp)
857 static const char *const keywords[] = { "-p", "-probe", NULL };
859 return probe_is_linespec_by_keyword (linespecp, keywords);
862 /* Dummy method used for `probe_ops_any'. */
865 probe_any_get_probes (std::vector<probe *> *probesp, struct objfile *objfile)
867 /* No probes can be provided by this dummy backend. */
870 /* Operations associated with a generic probe. */
872 const struct probe_ops probe_ops_any =
874 probe_any_is_linespec,
875 probe_any_get_probes,
878 /* See comments in probe.h. */
880 struct cmd_list_element **
881 info_probes_cmdlist_get (void)
883 static struct cmd_list_element *info_probes_cmdlist;
885 if (info_probes_cmdlist == NULL)
886 add_prefix_cmd ("probes", class_info, info_probes_command,
888 Show available static probes.\n\
889 Usage: info probes [all|TYPE [ARGS]]\n\
890 TYPE specifies the type of the probe, and can be one of the following:\n\
892 If you specify TYPE, there may be additional arguments needed by the\n\
894 If you do not specify any argument, or specify `all', then the command\n\
895 will show information about all types of probes."),
896 &info_probes_cmdlist, "info probes ",
897 0/*allow-unknown*/, &infolist);
899 return &info_probes_cmdlist;
904 /* This is called to compute the value of one of the $_probe_arg*
905 convenience variables. */
907 static struct value *
908 compute_probe_arg (struct gdbarch *arch, struct internalvar *ivar,
911 struct frame_info *frame = get_selected_frame (_("No frame selected"));
912 CORE_ADDR pc = get_frame_pc (frame);
913 int sel = (int) (uintptr_t) data;
914 struct bound_probe pc_probe;
915 const struct sym_probe_fns *pc_probe_fns;
918 /* SEL == -1 means "_probe_argc". */
919 gdb_assert (sel >= -1);
921 pc_probe = find_probe_by_pc (pc);
922 if (pc_probe.probe == NULL)
923 error (_("No probe at PC %s"), core_addr_to_string (pc));
925 n_args = get_probe_argument_count (pc_probe.probe, frame);
927 return value_from_longest (builtin_type (arch)->builtin_int, n_args);
930 error (_("Invalid probe argument %d -- probe has %u arguments available"),
933 return evaluate_probe_argument (pc_probe.probe, sel, frame);
936 /* This is called to compile one of the $_probe_arg* convenience
937 variables into an agent expression. */
940 compile_probe_arg (struct internalvar *ivar, struct agent_expr *expr,
941 struct axs_value *value, void *data)
943 CORE_ADDR pc = expr->scope;
944 int sel = (int) (uintptr_t) data;
945 struct bound_probe pc_probe;
946 const struct sym_probe_fns *pc_probe_fns;
948 struct frame_info *frame = get_selected_frame (NULL);
950 /* SEL == -1 means "_probe_argc". */
951 gdb_assert (sel >= -1);
953 pc_probe = find_probe_by_pc (pc);
954 if (pc_probe.probe == NULL)
955 error (_("No probe at PC %s"), core_addr_to_string (pc));
957 n_args = get_probe_argument_count (pc_probe.probe, frame);
961 value->kind = axs_rvalue;
962 value->type = builtin_type (expr->gdbarch)->builtin_int;
963 ax_const_l (expr, n_args);
967 gdb_assert (sel >= 0);
969 error (_("Invalid probe argument %d -- probe has %d arguments available"),
972 pc_probe.probe->pops->compile_to_ax (pc_probe.probe, expr, value, sel);
975 static const struct internalvar_funcs probe_funcs =
983 VEC (probe_ops_cp) *all_probe_ops;
986 _initialize_probe (void)
988 VEC_safe_push (probe_ops_cp, all_probe_ops, &probe_ops_any);
990 create_internalvar_type_lazy ("_probe_argc", &probe_funcs,
991 (void *) (uintptr_t) -1);
992 create_internalvar_type_lazy ("_probe_arg0", &probe_funcs,
993 (void *) (uintptr_t) 0);
994 create_internalvar_type_lazy ("_probe_arg1", &probe_funcs,
995 (void *) (uintptr_t) 1);
996 create_internalvar_type_lazy ("_probe_arg2", &probe_funcs,
997 (void *) (uintptr_t) 2);
998 create_internalvar_type_lazy ("_probe_arg3", &probe_funcs,
999 (void *) (uintptr_t) 3);
1000 create_internalvar_type_lazy ("_probe_arg4", &probe_funcs,
1001 (void *) (uintptr_t) 4);
1002 create_internalvar_type_lazy ("_probe_arg5", &probe_funcs,
1003 (void *) (uintptr_t) 5);
1004 create_internalvar_type_lazy ("_probe_arg6", &probe_funcs,
1005 (void *) (uintptr_t) 6);
1006 create_internalvar_type_lazy ("_probe_arg7", &probe_funcs,
1007 (void *) (uintptr_t) 7);
1008 create_internalvar_type_lazy ("_probe_arg8", &probe_funcs,
1009 (void *) (uintptr_t) 8);
1010 create_internalvar_type_lazy ("_probe_arg9", &probe_funcs,
1011 (void *) (uintptr_t) 9);
1012 create_internalvar_type_lazy ("_probe_arg10", &probe_funcs,
1013 (void *) (uintptr_t) 10);
1014 create_internalvar_type_lazy ("_probe_arg11", &probe_funcs,
1015 (void *) (uintptr_t) 11);
1017 add_cmd ("all", class_info, info_probes_command,
1019 Show information about all type of probes."),
1020 info_probes_cmdlist_get ());
1022 add_cmd ("probes", class_breakpoint, enable_probes_command, _("\
1024 Usage: enable probes [PROVIDER [NAME [OBJECT]]]\n\
1025 Each argument is a regular expression, used to select probes.\n\
1026 PROVIDER matches probe provider names.\n\
1027 NAME matches the probe names.\n\
1028 OBJECT matches the executable or shared library name.\n\
1029 If you do not specify any argument then the command will enable\n\
1030 all defined probes."),
1033 add_cmd ("probes", class_breakpoint, disable_probes_command, _("\
1035 Usage: disable probes [PROVIDER [NAME [OBJECT]]]\n\
1036 Each argument is a regular expression, used to select probes.\n\
1037 PROVIDER matches probe provider names.\n\
1038 NAME matches the probe names.\n\
1039 OBJECT matches the executable or shared library name.\n\
1040 If you do not specify any argument then the command will disable\n\
1041 all defined probes."),