How to get GDB to do a 'list' after every step?

前端 未结 3 934
庸人自扰
庸人自扰 2020-12-09 04:05

I can step along with gdb, but I have to give the \"list\" command every time I want to see where I am in source code.

(gdb) next
351     int right = get_va         


        
3条回答
  •  -上瘾入骨i
    2020-12-09 04:41

    You can use a GDB macro for this:

    (gdb) def n
    Type commands for definition of "n".
    End with a line saying just "end".
    >next
    >list
    >end
    

    If you want an arrow pointing at the current line, you might consider using a GDB front-end instead (e.g. M-x gdb in Emacs).

提交回复
热议问题