|
From: Florian K. <br...@ac...> - 2012-07-24 02:55:18
|
Currently, when we encounter an invalid opcode we report the wrong address. Specifically, the address being reported is the address of the insn immediately following the one that could not be decoded. This could easily be fixed in disInstr_S390_WRK by setting the insn address in the guest state (guest_IA) to be the address of the invalid insn. However, doing so would also make none/tests/s390x/op_exception run in an endless loop. That testcase mimics what s390 does when it encounters an invalid opcode: raise an exception, continue executing with the next insn. It is therefore necessary, after receiving the SIGILL, to advance the guest_IA by the size of the invalid insn at some proper point to avoid the infinite loop. This is what this patch does. There are three pieces - vex-patch which sticks the correct address into guest_IA so we get the correct address in the complaint - exe-patch which applies first_ip_delta also in the case where we only want a single frame in the back-trace (this is an independent issue really, that surfaced when I was reading the code) - s390-patch contains the bits to advance the guest_IA and .exp adjustments. I've verified by hand that the correct addresses are being reported. Note: line numbers in .exp files are off due to busted debug info from GCC Regtested on s390, ppc64, x86-64 with no new regressions. If somebody can think of a better way to approach this, please let me know. Florian |