MrA*_*man 4 debugging gdb gdbinit
我似乎无法在 gdb 中禁用分页。我已经阅读了所有建议添加set pagination off或set height 0或添加set height unlimited到我的 ~/.gdbinit 文件的各种答案,并且我已经尝试了所有这些,但是 gdb 似乎忽略了所有这些。当我启动 gdb 时,它显然在读取 ~/.gdbinit 文件,因为我可以设置自动加载安全路径,但是每次启动时,我都必须再次按 Enter 才能启动 gdb,这非常令人沮丧. 就好像它只是完全忽略了分页关闭命令。我也尝试将这些命令添加到系统范围的 gdbinit(在/etc/gdb/gdbinit),但这也不起作用。
就其价值而言,我正在运行带有 GDB 版本的 Xubuntu 18.04 (GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git)。.gdbinit 文件当前读取:
set auto-load safe-path /
#set height 0
#set height unlimited
set pagination off
Run Code Online (Sandbox Code Playgroud)
编辑:为了澄清,出于各种原因,我必须让我的终端相当短(约 13 行左右)。当我启动 GDB 时,我会看到以下内容:
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
---Type <return> to continue, or q <return> to quit---
Run Code Online (Sandbox Code Playgroud)
点击 后<return>,将显示其余的介绍消息,我可以开始使用 GDB。这对我来说不是理想的行为,如果没有发生这种分页,我会更喜欢。
点击 后,将显示其余的介绍消息,我可以开始使用 GDB。
转载。
问题是 GDB在读取~/.gdbinit. 由于版权不适合,并且.gdbinit尚未阅读,因此您会收到分页提示。
解决方法很简单:抑制版权标志,就像这样:gdb -q ...。