This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use 2-byte instead of 4-byte NOP on S390 in 'bp-permanent' test case


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]