Index | Thread | Search

From:
Yuichiro NAITO <naito.yuichiro@gmail.com>
Subject:
Re: lldb: Show consistent stack pointer value with GDB
To:
takeasou.masato@gmail.com
Cc:
tech@openbsd.org, robert@openbsd.org
Date:
Wed, 27 Nov 2024 10:19:17 +0900

Download raw body.

Thread
From: ASOU Masato <takeasou.masato@gmail.com>
Subject: Re: lldb: Show consistent stack pointer value with GDB
Date: Fri, 22 Nov 2024 12:46:00 +0900

> I made a mistake when applying Naito's patch.
> Broken lldb:
> 
> $ doas lldb bsd.0 -c bsd.0.core
> doas (asou@asou-lldb-kernel.soum.co.jp) password:
> (lldb) target create "bsd.0" --core "bsd.0.core"
> Core file '/var/crash/bsd.0.core' (x86_64) was loaded.
> (lldb) register read
> General Purpose Registers:
>        rbp = 0xffff80001cb01ca0
>        rsp = 0xffff80001cb01a50
>        rip = 0xffff80001cb01cd0
>              ^^^^^^^^^^^^^^^^^^ This is stack area.
> 21 registers were unavailable.
> 
> (lldb) bt
> * thread #1, name = 'Crashed Thread'
>   * frame #0: 0xffff80001cb01cd0
>     frame #1: 0xffffffff8188f51c bsd.0`boot + 268
>     frame #2: 0xffffffff81750548 bsd.0`reboot + 104
>     frame #3: 0xffffffff817504da bsd.0`sys_reboot + 154
>     frame #4: 0xffffffff81597807 bsd.0`syscall + 1511
>     frame #5: 0xffffffff82312134 bsd.0`Xsyscall_meltdown + 308
>     frame #6: 0xffffffff82312055 bsd.0`Xsyscall_meltdown + 85
>     frame #7: 0xffff80001cb01e00
>     frame #8: 0x0000083fba322fab
> (lldb)
> 
> 
> And I corrected mistake.
> Corrected lldb:
> 
> $ doas lldb bsd.0 -c bsd.0.core
> doas (asou@asou-lldb-kernel.soum.co.jp) password:
> (lldb) target create "bsd.0" --core "bsd.0.core"
> Core file '/var/crash/bsd.0.core' (x86_64) was loaded.
> (lldb) register read
> General Purpose Registers:
>        rbp = 0xffff80001cb01ca0
>        rsp = 0xffff80001cb01a50
>        rip = 0xffffffff8188fda3  bsd.0`dumpsys + 1795
>              ^^^^^^^^^^^^^^^^^^ This is instruction area.
> 21 registers were unavailable.
> 
> (lldb) bt
> * thread #1, name = 'Crashed Thread'
>   * frame #0: 0xffffffff8188fda3 bsd.0`dumpsys + 1795
>     frame #1: 0xffffffff8188f51c bsd.0`boot + 268
>     frame #2: 0xffffffff81750548 bsd.0`reboot + 104
>     frame #3: 0xffffffff817504da bsd.0`sys_reboot + 154
>     frame #4: 0xffffffff81597807 bsd.0`syscall + 1511
>     frame #5: 0xffffffff82312134 bsd.0`Xsyscall_meltdown + 308
>     frame #6: 0xffffffff82312055 bsd.0`Xsyscall_meltdown + 85
>     frame #7: 0xffff80001cb01e00
>     frame #8: 0x0000083fba322fab
> (lldb)
> 
> ok, comments?

After applying your patch, the lldb source code becomes the same
as my patched code. I think your fix is correct to my intention.
Could you please commit to the source tree?

-- 
Yuichiro NAITO (naito.yuichiro@gmail.com)