I'd like to have gdb tui open in the regs layout by default. Is there a way to set that in ~/.gdbinit
or some other configuration file?
Asked
Active
Viewed 1,494 times
2

StudentsTea
- 329
- 4
- 16
1 Answers
3
You can put any gdb command you want in ~/.gdbinit
, including layout reg
. This is what I have in mine.
set disassembly-flavor intel
layout reg
set print static-members off
set print pretty on
macro define offsetof(t, f) &((t *) 0)->f) # https://stackoverflow.com/questions/1768620/how-do-i-show-what-fields-a-struct-has-in-gdb#comment78715348_1770422
(See also the bottom of the x86 tag wiki for more gdb / asm-debugging tips).

Peter Cordes
- 328,167
- 45
- 605
- 847
-
1Oh, weird! I think GDB's parser stops as soon as it has a complete, parsable command in interactive mode, but not when it reads from ~/.gdbinit I had a typo on the command line: layout regs, which works on the command line, but not in the init file. Thank you! That worked! – StudentsTea Apr 13 '18 at 19:30