This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] gdb/testsuite/gdb.trace: Deduplicate set_point assembly.


Marcin KoÅcielnicki <koriakin@0x04.net> writes:

> +/* TRACEPOINT_ASM expands to an assembly instruction large enough to fit
> +   a fast tracepoint jump.  The parameter is the label where we'll set
> +   tracepoints and breakpoints.  */
> +
> +#if (defined __x86_64__ || defined __i386__)
> +
> +static void
> +x86_trace_dummy ()
> +{
> +  int x = 0;
> +  int y = x + 4;
> +}
> +
> +#define TRACEPOINT_ASM(name) \
> +  asm ("    .global " SYMBOL(name) "\n" \
> +       SYMBOL(name) ":\n" \
> +       "    call " SYMBOL(x86_trace_dummy) "\n" \
> +       )
> +
> +#elif (defined __aarch64__)
> +
> +#define TRACEPOINT_ASM(name) \
> +  asm ("    .global " SYMBOL(name) "\n" \
> +       SYMBOL(name) ":\n" \
> +       "    nop\n" \
> +       )
> +
> +#else

TRACEPOINT_ASM isn't a good name to me.  How about
FAST_TRACEPOINT_LABEL?

Otherwise the patch looks good to me.

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]