Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using less as gdb pager

Tags:

gdb

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.

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?

like image 747
AkiRoss Avatar asked Apr 21 '13 14:04

AkiRoss


1 Answers

Is it possible to replace the default pager with another one

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

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.

like image 54
Employed Russian Avatar answered Sep 30 '22 11:09

Employed Russian