Re: [External Mail]Re: GDB can't show QEMU ARM thread call stack/threads

2025-01-24 Thread Peter Barada
Neo, Thanks for the explanation - I've modified my gdbstub to inspect xPSR and if STKALIGN is set then "unalign" the stack pointer. With this change I'm able to inspect threads and unwind callstacks from the captured Nuttx-12.6 crash dumps. I'll look at creating a patch to threads.py to hand

Re: [External Mail]Re: GDB can't show QEMU ARM thread call stack/threads

2025-01-24 Thread Xu Neo
Trying again with the screenshot in text of what's going on. > It happens that NuttX release 12.6.0 generates code that has SP not aligned to 4 bytes as shown below, right before triggering SVC. ``` │ 170 /* SVC with SYS_ call number and two parameters */ │ │ 171 │ │ 172 static inline uintptr_t

Re: [External Mail]Re: GDB can't show QEMU ARM thread call stack/threads

2025-01-24 Thread Xu Neo
It turns out the issue comes from the wrong SP register value getting restored by python script. TLDR, If you happen to met that GDB cannot unwind correctly, try set $sp=$sp+4 The issue is that when an exception happened, armv7-m could push 4 bytes to stack, to make sure SP is 8bytes aligned. Se

Re: [External Mail]Re: GDB can't show QEMU ARM thread call stack/threads

2025-01-23 Thread Peter Barada
On 1/23/25 21:27, 徐兴良 wrote: Hi Peter, The error message reported in version 12.8.0 means that macro `CONFIG_NFILE_DESCRIPTORS_PER_BLOCK` is failed to parse. It may due to insufficient debug level(`-g3`). But it won't affect other commands like `info threads` etc. > Looking further, I g

Re: [External Mail]Re: GDB can't show QEMU ARM thread call stack/threads

2025-01-23 Thread 徐兴良
Hi Peter, The error message reported in version 12.8.0 means that macro `CONFIG_NFILE_DESCRIPTORS_PER_BLOCK` is failed to parse. It may due to insufficient debug level(`-g3`). But it won't affect other commands like `info threads` etc. > Looking further, I got the GDB command args wrong for