Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't disable pagination in gdb

I can't seem to disable pagination in gdb. I've read all of the various answers suggesting to add set pagination off or set height 0 or set height unlimited to my ~/.gdbinit file, and I've tried all of them, but gdb seems to be ignoring them all. When I start gdb, it is clearly reading the ~/.gdbinit file, as I am able to set the auto-load safe-path, however every time I start, I have to hit enter again to start gdb, which is intensely frustrating. It's as if it's just completely ignoring the pagination off command. I've also tried adding these commands to the system-wide gdbinit (in /etc/gdb/gdbinit), but this didn't work either.

For what it's worth, I'm running Xubuntu 18.04 with GDB version (GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git). The .gdbinit file currently reads:

set auto-load safe-path /
#set height 0
#set height unlimited
set pagination off

EDIT: To clarify, for various reasons I have to have my terminal fairly short (~13 lines or so). When I start GDB, I am greeted by the following:

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

After hitting <return>, the rest of the intro message is displayed, and I can start using GDB. This is not desirable behaviour for me, and I would prefer if this pagination did not occur.

like image 318
MrAzzaman Avatar asked Mar 03 '23 12:03

MrAzzaman


1 Answers

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

Reproduced.

The issue is that GDB prints the copyright banner before it reads ~/.gdbinit. Since the copyright doesn't fit, and since the .gdbinit hasn't yet been read, you get the pagination prompt.

Solution is trivial: suppress the copyright banner, like so: gdb -q ....

like image 76
Employed Russian Avatar answered Mar 07 '23 00:03

Employed Russian