From 0460165f9a68c6bbc8a71bf3b10cf466ef4d7802 Mon Sep 17 00:00:00 2001 From: chao an Date: Sat, 6 May 2023 12:10:09 +0800 Subject: [PATCH] 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 --- tools/nuttx-gdbinit | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tools/nuttx-gdbinit b/tools/nuttx-gdbinit index b071e043a1..52093681a4 100644 --- a/tools/nuttx-gdbinit +++ b/tools/nuttx-gdbinit @@ -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