使用更少的gdb传呼机 [英] Using less as gdb pager
问题描述
我注意到在GDB中,当发出长输出的命令(如 info变量
)时,输出一次显示一页,按 enter
向下并显示 q
退出.
I noticed that in GDB, when issuing commands with long output like info variables
, the output is displayed one page at time, pressing enter
to go down and q
to quit.
是否可以将默认的寻呼机替换为另一个寻呼机,例如 less
,以便我可以上下导航,退出,搜索等?
Is it possible to replace the default pager with another one, such as less
, so that I can navigate up and down, quitting, searching, etc?
推荐答案
是否可以将默认寻呼机替换为另一个寻呼机
Is it possible to replace the default pager with another one
否:GDB不会调用外部程序来显示输出,它只是在每屏满时暂停输出(并且您可以使其不按设置高度0
暂停">).
No: GDB doesn't call into external program to display the output, it simply pauses the output every screenfull (and you can make it not pause by set height 0
).
除了在 emacs
内部运行外,您还可以使用 screen
或 tmux
(了解它们通常会为您提供很多帮助情况),或要求GDB记录输出(设置登录
),然后使用所需的任何 $ PAGER
在 gdb.txt
中进行搜索.
In addtion to running inside emacs
, you could also use screen
or tmux
(learning them will generally help you in a lot of other situations), or ask GDB to log output (set logging on
) and then search in gdb.txt
with any $PAGER
you want.
这篇关于使用更少的gdb传呼机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!