Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier backtrace readability through colour #15

Open
drewnoakes opened this issue Jan 13, 2014 · 3 comments
Open

Easier backtrace readability through colour #15

drewnoakes opened this issue Jan 13, 2014 · 3 comments

Comments

@drewnoakes
Copy link

Firstly, thanks for this project.

I think the readability of backtraces could be greatly improved by using different colours for the different components of the outputs.

image

(Yes I am debugging a deadlock!)

I feel a little colour would break down the slab of text and clearly separate key features:

  • The primary function name in line
  • Argument lists within params
  • Source path and line number

It seems as though a regexp could be made for this purpose.

@gdbinit
Copy link
Owner

gdbinit commented Jan 13, 2014

Hello,

Backtrace is an internal gdb command which gdb scripting has no control whatsoever.
To modify its output the gdb source code must be modified. The problem is which colors to use due to different people using different terminal configurations.
A potential hack could be to redirect output to a temporary file and insert colors there. Might work, check the latest commits for the entrypoint breakpoint that has code for redirection.

Best,
fG!

@drewnoakes
Copy link
Author

Thanks for the explanation, @fg!.

@sashanicolas
Copy link

You can do it using GDB's Python API: the Frame Filter API and Frame Decorator API.
In fact, the project https://github.com/daskol/gdb-colour-filter already did this. I'm using it.

(I know it's been 4 years, but I got here, maybe others have and will too.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants