aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2014-11-17 15:22:48 +0000
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-11-19 10:03:32 +0100
commit0d7b2549024f66cb98dd173b6f339673df1b0ea1 (patch)
tree9812c48f2c6416e37cb5b2957506f28069480bbc /gdb
parent2b0f535a446c682c3dc7c1276e2cbc747bfae163 (diff)
downloadgdb-0d7b2549024f66cb98dd173b6f339673df1b0ea1.zip
gdb-0d7b2549024f66cb98dd173b6f339673df1b0ea1.tar.gz
gdb-0d7b2549024f66cb98dd173b6f339673df1b0ea1.tar.bz2
Use 2-byte instead of 4-byte NOP on S390 in 'bp-permanent' test case
The bp-permanent test case assumes that a NOP is exactly as long as a software breakpoint. This is not the case for the S390 "nop" instruction, which is 4 bytes long, while a software breakpoint is just 2 bytes long. The "nopr" instruction has the right size and can be used instead. Without this patch the test case fails on S390 when trying to continue after SIGTRAP on the permanent breakpoint: ... Continuing. Program received signal SIGILL, Illegal instruction. test () at /home/arnez/src/binutils-gdb/gdb/testsuite/gdb.base/bp-permanent.c:40 40 NOP; /* after permanent bp */ (gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0: basics: stop at permanent breakpoint With this patch the test case succeeds without any FAILs. gdb/testsuite/ChangeLog: * gdb.base/bp-permanent.c (NOP): Define as 2-byte instead of 4-byte instruction on S390.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/bp-permanent.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e18366d..ee200ad 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-19 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * gdb.base/bp-permanent.c (NOP): Define as 2-byte instead of
+ 4-byte instruction on S390.
+
2014-11-19 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/arr_arr: New testcase.
diff --git a/gdb/testsuite/gdb.base/bp-permanent.c b/gdb/testsuite/gdb.base/bp-permanent.c
index a45a922..64cfb4d 100644
--- a/gdb/testsuite/gdb.base/bp-permanent.c
+++ b/gdb/testsuite/gdb.base/bp-permanent.c
@@ -21,7 +21,14 @@
#include <unistd.h>
#endif
+/* NOP instruction: must have the same size as the breakpoint
+ instruction. */
+
+#if defined(__s390__) || defined(__s390x__)
+#define NOP asm("nopr 0")
+#else
#define NOP asm("nop")
+#endif
/* Buffer holding the breakpoint instruction. */
unsigned char buffer[16];