This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use 2-byte instead of 4-byte NOP on S390 in 'bp-permanent' test case
- From: Pedro Alves <palves at redhat dot com>
- To: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>, gdb-patches at sourceware dot org
- Date: Mon, 17 Nov 2014 17:18:18 +0000
- Subject: Re: [PATCH] Use 2-byte instead of 4-byte NOP on S390 in 'bp-permanent' test case
- Authentication-results: sourceware.org; auth=none
- References: <874mtxssee dot fsf at br87z6lw dot de dot ibm dot com>
Hi Andreas,
Thanks.
On 11/17/2014 04:28 PM, Andreas Arnez wrote:
> The bp-permanent test case assumes that a NOP is exactly as long as a
> software breakpoint.
Ah. It'd be good to add a comment mentioning this assumption,
where the NOPs are defined. Could you do that?
> 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)
Yeah, if the instruction was originally 4 bytes, and then we poke a 2-byte
breakpoint, when GDB skips the breakpoint manually, advancing 2 bytes,
then the PC ends up pointing at the middle of the original instruction...
The patch is OK.
Thanks,
Pedro Alves