Skip to content

Commit

Permalink
tools/nuttx-gdbinit: remove unsafed function call from script
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
anchao authored and xiaoxiang781216 committed May 7, 2023
1 parent 0da1599 commit 0460165
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions tools/nuttx-gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand All @@ -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
Expand Down

0 comments on commit 0460165

Please sign in to comment.