Skip to content

Commit 0460165

Browse files
anchaoxiaoxiang781216
authored andcommitted
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>
1 parent 0da1599 commit 0460165

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

tools/nuttx-gdbinit

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ define _examine_target
8080

8181
set $_target_max_tasks = g_npidhash
8282

83-
python if (type(gdb.lookup_global_symbol("up_check_tcbstack")) is gdb.Symbol) : \
84-
gdb.execute("set $_target_has_stack_coloration = 1")
85-
8683
printf "target examined\n"
8784
python print("_target_arch.name=" + _target_arch.name())
8885

@@ -104,15 +101,9 @@ define _print_thread
104101
printf " "
105102
end
106103

107-
if ($_target_has_stack_coloration)
108-
set $stack_used = up_check_tcbstack($tcb)
109-
else
110-
set $stack_used = 0
111-
end
112-
113-
printf "%d Thread 0x%x (Name: %s, State: %s, Priority: %d, Stack: %d/%d) PC: 0x%x in ", \
104+
printf "%d Thread 0x%x (Name: %s, State: %s, Priority: %d, Stack: %d) PC: 0x%x in ", \
114105
$tcb->pid, $tcb, $tcb->name, g_statenames[$tcb->task_state], $tcb->sched_priority, \
115-
$stack_used, $tcb->adj_stack_size, $tcb->xcp.regs[$_pc_reg_idx]
106+
$tcb->adj_stack_size, $tcb->xcp.regs[$_pc_reg_idx]
116107
python _symbol = gdb.execute("info symbol $tcb->xcp.regs[$_pc_reg_idx]", to_string=True); \
117108
print(_symbol.split()[0] + "()")
118109
end

0 commit comments

Comments
 (0)