libdragon icon indicating copy to clipboard operation
libdragon copied to clipboard

Backtrace broken in case exception is triggered in tail call

Open rasky opened this issue 9 months ago • 0 comments

80003570 <xflow>:
80003570:       27bdffe8        addiu   sp,sp,-24
80003574:       ffa50008        sd      a1,8(sp)
80003578:       10800006        beqz    a0,80003594 <xflow+0x24>
8000357c:       ffa50010        sd      a1,16(sp)
80003580:       dfa30008        ld      v1,8(sp)
80003584:       2402ffff        li      v0,-1
80003588:       000217fc        dsll32  v0,v0,0x1f
8000358c:       00621026        xor     v0,v1,v0
80003590:       ffa20010        sd      v0,16(sp)
80003594:       d7a00010        ldc1    $f0,16(sp)
80003598:       24050022        li      a1,34
8000359c:       f7a00000        sdc1    $f0,0(sp)
800035a0:       d7ac0000        ldc1    $f12,0(sp)
800035a4:       d7a00008        ldc1    $f0,8(sp)
800035a8:       27bd0018        addiu   sp,sp,24
800035ac:       08000d50        j       80003540 <with_errno>
800035b0:       462c0302        mul.d   $f12,$f0,$f12                  <--------------
800035b4:       00000000        nop

Backtrace is broken if an exception is triggered in the specified instruction, because the stack frame was already popped but the tracing engine doesn't know it.

rasky avatar May 27 '24 12:05 rasky