This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] gdb/testsuite/gdb.trace: Deduplicate set_point assembly.
- From: Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 11 Nov 2015 13:42:14 +0100
- Subject: Re: [PATCH 2/2] gdb/testsuite/gdb.trace: Deduplicate set_point assembly.
- Authentication-results: sourceware.org; auth=none
- References: <1447154499-22247-1-git-send-email-koriakin at 0x04 dot net> <1447154499-22247-2-git-send-email-koriakin at 0x04 dot net> <86pozhvseg dot fsf at gmail dot com>
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!