Я пытаюсь получить обратную трассировку при достижении строки в коде C.
Я передаю командный файл в gdb, и он работает, за исключением случаев, когда он достигает точки останова, ничего не происходит.
Я использую Debian Testing с версией gdb 9.1-3
мой код скомпилирован с CFLAGS:
-Og -g3 -m32 -gdwarf-4 -fvar-tracking-assignments -w
g cc версия (Debian 9.3.0-10) 9.3.0
использование других версий dwarf, похоже, не имеет никакого значения.
Файл команд, которые я включаю:
set confirm off
set pagination off
set logging file gdbrogue.txt
set logging overwrite on
set logging on
set breakpoint pending on
#set trace-commands on
directory /home/me/src/github/rogue-54-for-rogomatic
symbol-file -readnow /usr/local/bin/rogue
skip file hardscroll.c
skip file hashmap.c
skip file lib_addch.c
skip file lib_addstr.c
skip file lib_clreol.c
skip file lib_erase.c
skip file lib_getch.c
skip file lib_move.c
skip file lib_mvcur.c
skip file lib_refresh.c
skip file lib_touch.c
skip file lib_tparm.c
skip file lib_tputs.c
skip file lib_winch.c
skip file lib_window.c
skip file tty_update.c
skip function look
skip function msg
skip function read
skip function unctrl
skip function __kernel_vsyscall
define my_prt_mlist
set $current = mlist
while ($current > 0)
printf "curr %p prev %p next %p\n", $current, $current->l_prev, $current->l_next
printf " t_type %c\n", $current->t_type
printf " t_pos.y %d t_pos.x %d\n", $current->t_pos.y, $current->t_pos.x
if ($current->t_dest > 0)
printf " t_dest->y %d t_dest->x %d\n", $current->t_dest->y, $current->t_dest->x
end
set $current = $current->l_next
end
end
break chase.c:32 if (level == 7)
commands
printf "player(y,x) (%d,%d)\n", player.t_pos.y, player.t_pos.x
my_prt_mlist
end
break chase.c:455 if (level == 7)
commands
printf "player(y,x) (%d,%d)\n", player.t_pos.y, player.t_pos.x
my_prt_mlist
backtrace full
end
while (level < 7)
next
end
while (level == 7)
step
end
while (level > 7)
next
end
выход показывает, что достигнут разрыв, но не отображается обратный след?
roomin (cp=0x582403cc) at chase.c:445
445 roomin(coord *cp) {
452 if (((cp->x > MAXCOLS) || (cp->y > MAXLINES)) ||
454 msg("in some bizarre place (%d, %d)", unc(*cp));
Breakpoint 2, roomin (cp=0x582403cc) at chase.c:455
455 return NULL;
do_chase (th=0x5823ede0) at chase.c:142
142 door = (chat(th->t_pos.y, th->t_pos.x) == DOOR);
Есть идеи, что я здесь делаю неправильно или это ошибка gdb / g cc?
Я искал похожие проблемы и ответы, но, похоже, ни у кого нет этой конкретной проблемы c.
Спасибо! :)