[RFC] [gdb/cli] Add maintenance ignore-probes

Tom Tromey tom@tromey.com
Tue Dec 13 15:58:41 GMT 2022


>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> There's a command "disable probes", but SystemTap probes cannot be disabled.
Tom> Add a command "maintenance ignore-probes" that ignores probes during
Tom> get_probes, such that we can easily pretend to use a glibc without say,
Tom> the longjmp probe:

The idea seems sound to me.

Tom> Note that as with "disable probes", running "maint ignore-probes" without
Tom> arguments ignores all probes.

I didn't know about "disable probes" but I see now it's a DTrace thing.

Tom> +/* Implementation of the `maintenance ignore-probes' command.  */
Tom> +
Tom> +static void
Tom> +ignore_probes_command (const char *arg, int from_tty)
Tom> +{
Tom> +  std::string ignore_provider, ignore_probe_name, ignore_objname;
Tom> +
Tom> +  parse_probe_linespec ((const char *) arg, &ignore_provider,
Tom> +			&ignore_probe_name, &ignore_objname);

The cast there isn't needed.  I'm going to remove the other casts like
this in a second.

Also, maybe if arg==nullptr, this could set ignore_probes_p = false?
That would give a way to undo the change.

Tom> +  add_cmd ("ignore-probes", class_maintenance, ignore_probes_command, _("\
Tom> +Ignore probes.\n\
Tom> +Usage: ignore probes [PROVIDER [NAME [OBJECT]]]\n\

Missing the "-" in "ignore-probes".

Tom> +all defined probes.  Only supported for SystemTap probes"),

Probably should end with a "."

Tom


More information about the Gdb-patches mailing list