How to use colors in GDB with TUI or CGDB?
Asked Answered
T

1

12

I set a color for the GDB prompt by adding this line to ~/.gdbinit:

set prompt \033[0;32m(gdb) \033[0m

This works fine in GDB, until I open the TUI. It then discards the colors and shows the raw color codes. The same thing happens if I use CGDB.

This is 2015. Is there any way I can have both colors in GDB and also view the source code I'm debugging in a subwindow (like in TUI/CGDB) at the terminal?

Trudytrue answered 13/5, 2015 at 3:54 Comment(3)
You can't in gdb with tui. See this bug sourceware.org/bugzilla/show_bug.cgi?id=14126.Fructify
Give up on TUI. Use GDB Dashboard: github.com/cyrus-and/gdb-dashboardCarefree
See also this great answer about extending GDB to display source code and to color GDB output. This answer is not about GDB TUI nor CGDB.Mullinax
G
4

This gdb bug was fixed a while ago (2018). Also, gdb added colorizing to the CLI and to the TUI. This first showed up, I believe, in GDB 9.1.

Galantine answered 24/2, 2020 at 21:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.