tools/nuttx-gdbinit: remove unsafed function call from script

Some time nuttx will receive SIGSEGV while executing the function:

| Thread 1 "nuttx" received signal SIGSEGV, Segmentation fault.
| 0xf7bab4a0 in __sanitizer::common_flags_dont_use () from /lib/i386-linux-gnu/libasan.so.6
| The program being debugged was signaled while in a function called from GDB.
| GDB has restored the context to what it was before the call.
| Evaluation of the expression containing the function
| (up_check_tcbstack) will be abandoned.

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-05-06 12:10:09 +08:00 committed by Xiang Xiao
parent 0da1599e9e
commit 0460165f9a

View file

@ -80,9 +80,6 @@ define _examine_target
set $_target_max_tasks = g_npidhash
python if (type(gdb.lookup_global_symbol("up_check_tcbstack")) is gdb.Symbol) : \
gdb.execute("set $_target_has_stack_coloration = 1")
printf "target examined\n"
python print("_target_arch.name=" + _target_arch.name())
@ -104,15 +101,9 @@ define _print_thread
printf " "
end
if ($_target_has_stack_coloration)
set $stack_used = up_check_tcbstack($tcb)
else
set $stack_used = 0
end
printf "%d Thread 0x%x (Name: %s, State: %s, Priority: %d, Stack: %d/%d) PC: 0x%x in ", \
printf "%d Thread 0x%x (Name: %s, State: %s, Priority: %d, Stack: %d) PC: 0x%x in ", \
$tcb->pid, $tcb, $tcb->name, g_statenames[$tcb->task_state], $tcb->sched_priority, \
$stack_used, $tcb->adj_stack_size, $tcb->xcp.regs[$_pc_reg_idx]
$tcb->adj_stack_size, $tcb->xcp.regs[$_pc_reg_idx]
python _symbol = gdb.execute("info symbol $tcb->xcp.regs[$_pc_reg_idx]", to_string=True); \
print(_symbol.split()[0] + "()")
end