From: Sergei Golubchik <vuvova@gmail.com>
To: gdb@sourceware.org
Subject: Duel reloaded: Duel.py (and a PrettyPrinter decorator)
Date: Mon, 19 Jun 2017 09:04:00 -0000 [thread overview]
Message-ID: <20170619090342.GA9305@meddwl.fritz.box> (raw)
Hi,
If you've never heard about Duel - it's an insanely cool data
exploration language for gdb. Specifically designed to print out complex
data structures in one command. Created as a public domain patch for gdb
in 1993, but never got accepted for licensing reasons.
Still, Duel is super-convenient, for example, to print the whole linked
list one writes just
(gdb) dl head-->next->val
and to print field 'name' of every element in an array of structures,
one writes
(gdb) dl arr[..100].name
I've recently rewritten it in Python, so it doesn't need to be compiled
with gdb anymore, one can load it run-time (e.g. from .gdbinit).
Here it is: https://github.com/vuvova/gdb-tools
This repository also includes a helper to simplify writing pretty
printers. It removes all the boilerplate code that gdb requires, you
only need to write the value-to-string function itself.
Enjoy!
Regards,
Sergei
next reply other threads:[~2017-06-19 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 9:04 Sergei Golubchik [this message]
2017-06-19 9:18 ` Simon Marchi
2017-06-19 9:34 ` Sergei Golubchik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170619090342.GA9305@meddwl.fritz.box \
--to=vuvova@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox