summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/change-loc.h
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2015-11-10 12:12:00 +0100
committerMarcin Koƛcielnicki <koriakin@0x04.net>2015-11-10 20:06:38 +0100
commit53cc68ee4292b0833129d6fa6630d19fec333034 (patch)
tree396354cecaee3c30b7b27579defbddb723dc710c /gdb/testsuite/gdb.trace/change-loc.h
parent6e7675a70f5a375159f94354fb6f38519303a73d (diff)
downloadbinutils-gdb-53cc68ee4292b0833129d6fa6630d19fec333034.tar.gz
gdb/testsuite/gdb.trace: Deduplicate set_point assembly.users/mwk/trace-test-cleanup
The assembly code for emitting the proper tracepointable instruction was duplicated in many places. Keep it in one place, to reduce work needed for new targets. gdb/testsuite/ChangeLog: * gdb.trace/change-loc.h: include "trace-common.h", remove SYMBOL macro. (func5): Removed. (func4): Use TRACEPOINT_ASM. * gdb.trace/ftrace-lock.c: include "trace-common.h", remove SYMBOL macro. (func): Removed. (thread_function): Use TRACEPOINT_ASM. * gdb.trace/ftrace.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (marker): Use TRACEPOINT_ASM. * gdb.trace/pendshr1.c: include "trace-common.h", remove SYMBOL macro. (pendfunc1): Remove. (pendfunc): Use TRACEPOINT_ASM. * gdb.trace/pendshr2.c: include "trace-common.h", remove SYMBOL macro. (foo): Remove. (pendfunc2): Use TRACEPOINT_ASM. * gdb.trace/trace-break.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (marker): Use TRACEPOINT_ASM. * gdb.trace/trace-common.h: New header. * gdb.trace/trace-condition.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (marker): Use TRACEPOINT_ASM. * gdb.trace/trace-mt.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (thread_function): Use TRACEPOINT_ASM.
Diffstat (limited to 'gdb/testsuite/gdb.trace/change-loc.h')
-rw-r--r--gdb/testsuite/gdb.trace/change-loc.h24
1 files changed, 2 insertions, 22 deletions
diff --git a/gdb/testsuite/gdb.trace/change-loc.h b/gdb/testsuite/gdb.trace/change-loc.h
index 8201455d1fb..aaf823aa2d0 100644
--- a/gdb/testsuite/gdb.trace/change-loc.h
+++ b/gdb/testsuite/gdb.trace/change-loc.h
@@ -15,30 +15,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#ifdef SYMBOL_PREFIX
-#define SYMBOL(str) SYMBOL_PREFIX #str
-#else
-#define SYMBOL(str) #str
-#endif
-
-/* Called from asm. */
-static void __attribute__((used))
-func5 (void)
-{}
+#include "trace-common.h"
static void
func4 (void)
{
- /* `set_tracepoint' is the label where we'll set multiple tracepoints and
- breakpoints at. The insn at the label must the large enough to
- fit a fast tracepoint jump. */
- asm (" .global " SYMBOL(set_tracepoint) "\n"
- SYMBOL(set_tracepoint) ":\n"
-#if (defined __x86_64__ || defined __i386__)
- " call " SYMBOL(func5) "\n"
-#elif (defined __aarch64__)
- " nop\n"
-#endif
- );
-
+ TRACEPOINT_ASM(set_tracepoint);
}