Re: [PATCH 4/9] New gdbarch functions: dtrace_probe_argument, dtrace_probe_is_enabled, dtrace_enable_probe, dtrace_disable_probe.

Sergio Durigan Junior
2014-10-02T21:34:29Z

On Friday, September 26 2014, Jose E. Marchesi wrote:

> This patch adds several gdbarch functions (along with the
> corresponding predicates): `dtrace_probe_argument',
> `dtrace_probe_is_enabled', `dtrace_enable_probe' and
> `dtrace_disable_probe'. These functions will be implemented by
> target-specific code, and called from the DTrace probes implementation
> in order to calculate the value of probe arguments, and manipulate
> is-enabled probes.

Thanks for the patch. Comments below.

> diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
> index 2a8bca8..0458134 100755
> --- a/gdb/gdbarch.sh
> +++ b/gdb/gdbarch.sh
> @@ -944,6 +944,21 @@ M:int:stap_is_single_operand:const char *s:s
> # parser), and should advance the buffer pointer (p->arg).
> M:int:stap_parse_special_token:struct stap_parse_info *p:p
>
> +# DTrace related functions.
> +
> +# The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
> +# NARG must be >= 0.
> +M:void:dtrace_probe_argument:struct parser_state *pstate, int narg:pstate, narg

This function is responsible for parsing the argument, right? I'd
prefer if you named it "dtrace_parse_probe_argument". WDYT?

> +# True if the given ADDR does not contain the instruction sequence
> +# corresponding to a disabled DTrace is-enabled probe.
> +M:int:dtrace_probe_is_enabled:CORE_ADDR addr:addr
> +
> +# Enable a DTrace is-enabled probe at ADDR.
> +M:void:dtrace_enable_probe:CORE_ADDR addr:addr
> +
> +# Disable a DTrace is-enabled probe at ADDR.
> +M:void:dtrace_disable_probe:CORE_ADDR addr:addr
>
> # True if the list of shared libraries is one and only for all
> # processes, as opposed to a list of shared libraries per inferior.
> @@ -1146,6 +1161,7 @@ struct syscall;
> struct agent_expr;
> struct axs_value;
> struct stap_parse_info;
> +struct parser_state;
> struct ravenscar_arch_ops;
> struct elf_internal_linux_prpsinfo;

--
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible