Run command at gdb breakpoint, neither c or cont works

柔情痞子 提交于 2019-12-24 08:17:41

问题


I'm trying to run a command that prints information when a breakpoint is hit:

(gdb) break XXX
(gdb) command
> printf "xx=%p, yy=%d\n", p1, p2
> end

It seems to work, I see lots of outputs.

But suddenly it stopped working, and I saw a line says:

---Type <return> to continue, or q <return> to quit---

Am I missing something? I don't need to see anything on the screen now, 'cause I already enabled logging in gdb.


回答1:


But suddenly it stopped working, and I saw a line says:

Try run set pagination off or set height unlimited before you run your program. This is from doc:

If you specify a height of either unlimited or zero lines, GDB does not pause during output no matter how long the output is. This is useful if output is to a file or to an editor buffer. ... Turning pagination off is the alternative to set height unlimited.

References:

  • http://sourceware.org/gdb/onlinedocs/gdb/Screen-Size.html


来源:https://stackoverflow.com/questions/24588615/run-command-at-gdb-breakpoint-neither-c-or-cont-works

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!