6

我似乎无法在 gdb 中禁用分页。set pagination off我已经阅读了所有建议向我的 ~/.gdbinit 文件添加或set height 0或添加的各种答案set height unlimited,并且我已经尝试了所有这些答案,但 gdb 似乎都忽略了它们。当我启动 gdb 时,它显然正在读取 ~/.gdbinit 文件,因为我可以设置自动加载安全路径,但是每次启动时,我都必须再次按 enter 才能启动 gdb,这非常令人沮丧. 就好像它只是完全忽略了分页关闭命令。我也尝试将这些命令添加到系统范围的 gdbinit(in /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

编辑:澄清一下,由于各种原因,我的终端必须相当短(大约 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---

点击 后<return>,将显示其余的介绍信息,我可以开始使用 GDB。这对我来说不是可取的行为,如果没有发生这种分页,我会更喜欢。

4

1 回答 1

9

点击 后,将显示其余的介绍信息,我可以开始使用 GDB。

转载。

问题是 GDB读取~/.gdbinit. 由于版权不适合,并且由于.gdbinit尚未阅读,因此您会收到分页提示。

解决方案很简单:禁止版权横幅,如下所示:gdb -q ....

于 2020-04-28T05:09:30.560 回答