34

gdb-colour-filter: Colorify gdb backtrace

 4 years ago
source link: https://www.tuicool.com/articles/fmQVfia
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

GDB Colour Filter

colourify backtrace output in GDB with Python API

Overview

GDB Colour Filterimplements frame filter for GDB Python API. There could be several chained filters. GDB calls this filter on each element(frame) of backtrace. All frame filter has a priority from the lowest (0) to the high. This filter is defined for the lowest priority so it is the last filter that is called before printing stack trace.

IZb2Ij2.png!web

Installation

Installation is quite straight forward. It is needed only put color_filter.py in some directory and include it into your .gdbinit file. In order to do the first step one could clone whole repository

git clone https://github.com/daskol/gdb-colour-filter.git .gdb/gdb-colour-filter

or just download could_filter.py in the specified directory.

mkdir -p .gdb/gdb-colour-filter
    wget -O .gdb/gdb-colour-filter/colour_filter.py \
        https://raw.githubusercontent.com/daskol/gdb-colour-filter/master/colour_filter.py

After that colour_filter.py should be included in .gdbinit in following manner.

source .gdb/gdb-colour-filter/colour_filter.py

Credits

© Daniel Bershatsky < [email protected] >, 2018


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK