* Duel reloaded: Duel.py (and a PrettyPrinter decorator)
@ 2017-06-19 9:04 Sergei Golubchik
2017-06-19 9:18 ` Simon Marchi
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Golubchik @ 2017-06-19 9:04 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Duel reloaded: Duel.py (and a PrettyPrinter decorator)
2017-06-19 9:04 Duel reloaded: Duel.py (and a PrettyPrinter decorator) Sergei Golubchik
@ 2017-06-19 9:18 ` Simon Marchi
2017-06-19 9:34 ` Sergei Golubchik
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2017-06-19 9:18 UTC (permalink / raw)
To: Sergei Golubchik; +Cc: gdb
On 2017-06-19 11:03, Sergei Golubchik wrote:
> 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
That's indeed very nice, I didn't know about it. The alternative of
these lines using only built-in gdb features would be to write a small
while loop, I guess. So I can see how this can be convenient.
> 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.
I really like using an annotation for declaring a pretty printer. I
wonder if we could (legally-wise and technically-wise) steal that idea
:).
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Duel reloaded: Duel.py (and a PrettyPrinter decorator)
2017-06-19 9:18 ` Simon Marchi
@ 2017-06-19 9:34 ` Sergei Golubchik
0 siblings, 0 replies; 3+ messages in thread
From: Sergei Golubchik @ 2017-06-19 9:34 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb
Hi, Simon!
> > 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.
>
> I really like using an annotation for declaring a pretty printer. I
> wonder if we could (legally-wise and technically-wise) steal that idea
> :).
For upstream gdb? As far as I'm concerned - yes, on both points :)
Regards,
Sergei
Chief Architect MariaDB
and security@mariadb.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-19 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 9:04 Duel reloaded: Duel.py (and a PrettyPrinter decorator) Sergei Golubchik
2017-06-19 9:18 ` Simon Marchi
2017-06-19 9:34 ` Sergei Golubchik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox