简体   繁体   English

如何通过 TUI 或 CGDB 在 GDB 中使用颜色?

[英]How to use colors in GDB with TUI or CGDB?

I set a color for the GDB prompt by adding this line to ~/.gdbinit :我通过将此行添加到~/.gdbinitGDB提示设置颜色:

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

This works fine in GDB, until I open the TUI .这在 GDB 中工作正常,直到我打开TUI It then discards the colors and shows the raw color codes.然后丢弃颜色并显示原始颜色代码。 The same thing happens if I use CGDB .如果我使用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?这是 2015 年。有什么办法可以让我在 GDB 中同时拥有这两种颜色,还可以在终端的子窗口(如 TUI/CGDB)中查看我正在调试的源代码?

This gdb bug was fixed a while ago (2018).此 gdb 错误已在不久前(2018 年)修复。 Also, gdb added colorizing to the CLI and to the TUI.此外,gdb 为 CLI 和 TUI 添加了着色。 This first showed up, I believe, in GDB 9.1.我相信,这首先出现在 GDB 9.1 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM