summaryrefslogtreecommitdiff
path: root/arch/s390/kernel/dis.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2011-12-27 11:27:32 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-12-27 11:27:14 +0100
commit2fa1d4fce599809e6bd7d95756709a5faef30710 (patch)
treee3f3c4e48b1df462c4412839865b5be363e1ac12 /arch/s390/kernel/dis.c
parent02834eece0786b6e9c77029f0bfb597052a2e86f (diff)
[S390] disassembler: mark exception causing instructions
If an exception happens the PSW either points to the instruction that caused the exception or to the instruction that follows the exception causing instruction, depending on the exception type. Since the inkernel disassembler adds a ">" in front of the disassembly many people assume incorrectly that the instruction that is pointed to must be the cause of the exception. To make people aware that this is not necessarily the case add a different character in front of the disassembled instruction that precedes the current instructions. The output now looks like this: Krnl PSW : 0704200180000000 0000000000120de8 (test_function+0x0/0x100) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3 Krnl GPRS: 000003ff00000000 0000000000120de4 000000000091bb40 0000000000000001 000003fffd2ea000 0000000030fb7df8 0000000030fb7f10 000003ffffa113c8 000000000091bb40 000003fffd2ea000 0000000000000002 0000000030fb7f10 000000003f290240 0000000000606220 00000000002cfb5c 0000000030fb7d58 Krnl Code: 0000000000120ddc: b90400a9 lgr %r10,%r9 0000000000120de0: a7f4ff88 brc 15,120cf0 #0000000000120de4: a7f40001 brc 15,120de6 >0000000000120de8: a7f13f80 tmll %r15,16256 0000000000120dec: eb8ff0580024 stmg %r8,%r15,88(%r15) 0000000000120df2: a7840001 brc 8,120df4 0000000000120df6: b90400ef lgr %r14,%r15 0000000000120dfa: a7fbffb8 aghi %r15,-72 Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/dis.c')
-rw-r--r--arch/s390/kernel/dis.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index 45df6d456aa1..e2f847599c8e 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -1578,10 +1578,15 @@ void show_code(struct pt_regs *regs)
ptr += sprintf(ptr, "%s Code:", mode);
hops = 0;
while (start < end && hops < 8) {
- *ptr++ = (start == 32) ? '>' : ' ';
+ opsize = insn_length(code[start]);
+ if (start + opsize == 32)
+ *ptr++ = '#';
+ else if (start == 32)
+ *ptr++ = '>';
+ else
+ *ptr++ = ' ';
addr = regs->psw.addr + start - 32;
ptr += sprintf(ptr, ONELONG, addr);
- opsize = insn_length(code[start]);
if (start + opsize >= end)
break;
for (i = 0; i < opsize; i++)