support arch:
sim x86
sim x86_64
arm32 all series
If we need to support more architectures in the future,
just add the 'g_tcbinfo' of the corresponding architecture
support thread command:
1. thread <id>
switch thread
2. info thread
list all thread info
3. thread apply [all | id list] command
like this:
thread apply all bt
thread apply all bt full
thread apply 1 2 4 bt
thread apply all info r
4. nxsetregs
Set registers to the specified values.
Usage: nxsetregs [regs]
Etc: nxsetregs
nxsetregs g_current_regs[0]
nxsetregs tcb->xcp.regs
Nxsetregs g_pidhash[0].tcb->xcp.regs
Default regs is g_current_regs[0],if regs is NULL,
it will not set registers.
Because NuttX enters exception_common during a crash,
this assembly function manipulates the stack pointer (sp),
causing GDB to be unable to trace back to the first context of the crash.
Instead, it shows the context of the interrupt stack. By using nxsetregs,
it is possible to forcefully set the first context to
the one before the interrupt occurred.
Notice:
Switching threads is achieved by setting registers,
so registers need to be restored before continue,
please use 'c' to continue instead of 'continue'
Signed-off-by: anjiahao <anjiahao@xiaomi.com>