问题
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