summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/trace-break.c
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-11 21:44:04 +0100
commit430e004ef7ecb3f75fc3c6642c9fdfb1d85a3694 (patch)
treeb2e394177479e5ed63088ef277a011122d9e89a3 /gdb/testsuite/gdb.trace/trace-break.c
parent4397c913d5640ba61316d3e631d544cf768b5a36 (diff)
downloadbinutils-gdb-430e004ef7ecb3f75fc3c6642c9fdfb1d85a3694.tar.gz
gdb/testsuite/gdb.trace: Deduplicate set_point assembly.
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 FAST_TRACEPOINT_LABEL. * gdb.trace/ftrace-lock.c: include "trace-common.h", remove SYMBOL macro. (func): Removed. (thread_function): Use FAST_TRACEPOINT_LABEL. * gdb.trace/ftrace.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (marker): Use FAST_TRACEPOINT_LABEL. * gdb.trace/pendshr1.c: include "trace-common.h", remove SYMBOL macro. (pendfunc1): Remove. (pendfunc): Use FAST_TRACEPOINT_LABEL. * gdb.trace/pendshr2.c: include "trace-common.h", remove SYMBOL macro. (foo): Remove. (pendfunc2): Use FAST_TRACEPOINT_LABEL. * gdb.trace/trace-break.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (marker): Use FAST_TRACEPOINT_LABEL. * gdb.trace/trace-common.h: New header. * gdb.trace/trace-condition.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (marker): Use FAST_TRACEPOINT_LABEL. * gdb.trace/trace-mt.c: include "trace-common.h", remove SYMBOL macro. (func): Remove. (thread_function): Use FAST_TRACEPOINT_LABEL.
Diffstat (limited to 'gdb/testsuite/gdb.trace/trace-break.c')
-rw-r--r--gdb/testsuite/gdb.trace/trace-break.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/gdb/testsuite/gdb.trace/trace-break.c b/gdb/testsuite/gdb.trace/trace-break.c
index 66bbe53c685..cb6d14b3f6a 100644
--- a/gdb/testsuite/gdb.trace/trace-break.c
+++ b/gdb/testsuite/gdb.trace/trace-break.c
@@ -15,16 +15,7 @@
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))
-func (void)
-{}
+#include "trace-common.h"
static void
marker (void)
@@ -34,26 +25,9 @@ marker (void)
int a = 0;
int b = a;
- /* `set_point' 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_point) "\n"
- SYMBOL(set_point) ":\n"
-#if (defined __x86_64__ || defined __i386__)
- " call " SYMBOL(func) "\n"
-#elif (defined __aarch64__)
- " nop\n"
-#endif
- );
+ FAST_TRACEPOINT_LABEL(set_point);
- asm (" .global " SYMBOL(after_set_point) "\n"
- SYMBOL(after_set_point) ":\n"
-#if (defined __x86_64__ || defined __i386__)
- " call " SYMBOL(func) "\n"
-#elif (defined __aarch64__)
- " nop\n"
-#endif
- );
+ FAST_TRACEPOINT_LABEL(after_set_point);
}
static void