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

Marcin Kościelnicki koriakin@0x04.net
Wed Nov 11 12:42:00 GMT 2015


On 11/11/15 09:42, Yao Qi wrote:
> 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.
>

Yeah, that sounds better, will push with FAST_TRACEPOINT_LABEL.

Thanks!



More information about the Gdb-patches mailing list