debugging - 无法在 gdb 中禁用分页

标签 debugging gdb gdbinit

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

对于它的值(value),我正在运行带有 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。这对我来说不是理想的行为,如果没有发生这种分页,我会更喜欢。

最佳答案

After hitting , the rest of the intro message is displayed, and I can start using GDB.


转载。
问题是 GDB 在读取 ~/.gdbinit 之前打印了版权横幅。 .由于版权不合适,并且由于 .gdbinit尚未阅读,您会收到分页提示。
解决方案很简单:取消版权横幅,如下所示:gdb -q ... .

关于debugging - 无法在 gdb 中禁用分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61471492/

相关文章:

c - 无法从 .gdbinit 获取文件源

java - 更改 java/android 中调试和生产的值

与释放 C 中的内存混淆?

batch-file - 如何让 gdb 重复获取堆栈跟踪?

c - Linux 堆结构和 malloc() 和 free() 的行为

arm - 加载符号后 GDB 自动执行命令

iphone - 反调试怎么处理库打补丁?

javascript - Android 工作室 - 调试 Javascript

debugging - 如何调试 Mobicents 媒体服务器