GDB copyright headers update after running GDB's copyright.py script.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.trace / trace-common.h
CommitLineData
430e004e
MK
1/* This testcase is part of GDB, the GNU debugger.
2
618f726f 3 Copyright 2011-2016 Free Software Foundation, Inc.
430e004e
MK
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18#ifdef SYMBOL_PREFIX
19#define SYMBOL(str) SYMBOL_PREFIX #str
20#else
21#define SYMBOL(str) #str
22#endif
23
24/* FAST_TRACEPOINT_LABEL expands to an assembly instruction large enough to fit
25 a fast tracepoint jump. The parameter is the label where we'll set
26 tracepoints and breakpoints. */
27
28#if (defined __x86_64__ || defined __i386__)
29
30static void
31x86_trace_dummy ()
32{
33 int x = 0;
34 int y = x + 4;
35}
36
37#define FAST_TRACEPOINT_LABEL(name) \
38 asm (" .global " SYMBOL(name) "\n" \
39 SYMBOL(name) ":\n" \
40 " call " SYMBOL(x86_trace_dummy) "\n" \
41 )
42
43#elif (defined __aarch64__)
44
45#define FAST_TRACEPOINT_LABEL(name) \
46 asm (" .global " SYMBOL(name) "\n" \
47 SYMBOL(name) ":\n" \
48 " nop\n" \
49 )
50
51#else
52
53#error "unsupported architecture for trace tests"
54
55#endif
This page took 0.039244 seconds and 4 git commands to generate.