Use 2-byte instead of 4-byte NOP on S390 in 'bp-permanent' test case
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Mon, 17 Nov 2014 15:22:48 +0000 (15:22 +0000)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Wed, 19 Nov 2014 09:03:32 +0000 (10:03 +0100)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/bp-permanent.c

index e18366d8adb993cbb2e3c44236306f91a5f21643..ee200ad9abc961147f0257b00616f11d5ee4ff9c 100644 (file)
@@ -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.
index a45a922e8f34c8e5dc5575c49b2a6c964fbeef2d..64cfb4db43e8bbc393496a99333ff2441ffb298f 100644 (file)
 #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];
This page took 0.030507 seconds and 4 git commands to generate.