如何在交互式调试期间突出显示和着色gdb输出? [英] How to highlight and color gdb output during interactive debugging?

查看:3579
本文介绍了如何在交互式调试期间突出显示和着色gdb输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请不要回复我应该使用ddd,nemiver,emacs,vim或任何其他前端,我只是喜欢gdb,因为它是,但希望看到其输出与一些终端颜色。

解决方案

.gdbinit



您可以调整〜/ .gdbinit 有颜色。您可以使用mammon的 .gdbinit ,其位于此处:





在旁注中,同样的想法也是



(void)walker



另一个类似的项目使用GDB的Python支持来提供更多的可扩展性,所以这是值得检查:或



voltron




Please don't reply I should use ddd, nemiver, emacs, vim, or any other front-end, I just prefer gdb as it is, but would like to see its output with some terminal colors.

解决方案

.gdbinit

You can tweak your ~/.gdbinit to have colors. You can use mammon's .gdbinit which is available here:

http://reverse.put.as/gdbinit/

You can tweak it as much as you want too. I found this thanks to this SO answer. Here's the kind of output that you can obtain:

A GitHub repository is also available: https://github.com/gdbinit/Gdbinit

On a side note, the same idea was also applied to lldb.

GDB Dashboard

Following the same concept, GDB Dashboard provides a modular visual interface for GDB in Python.

(void)walker

Another similar project uses GDB's Python support to provide more extensibility, so this is worth checking out: https://github.com/dholm/voidwalker

@dholm also provides his own .gdbinit inspired from the previous one.

pwndbg

Some projects provide a set of useful functions, including improved display. This is the case for PEDA or pwndbg. The latter gives the following description:

A PEDA replacement. In the spirit of our good friend windbg, pwndbg is pronounced pwnd-bag.

  • Speed
  • Resiliency
  • Clean code

It provides commands to support debugging and exploit development similar to the ones from PEDA, and better display (although this is not the main focus of the project). The software is still under development, and has not been properly released yet.

voltron

The project description states:

Voltron is an extensible debugger UI for hackers. It allows you to attach utility views running in other terminals to your debugger (LLDB or GDB), displaying helpful information such as disassembly, stack contents, register values, etc, while still giving you the same debugger CLI you're used to.

You can modify your .gdbinit to automatically integrate it. However, the display itself is outside of GDB (e.g. in a tmux split).

这篇关于如何在交互式调试期间突出显示和着色gdb输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆