Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Sergei Golubchik <vuvova@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Duel reloaded: Duel.py (and a PrettyPrinter decorator)
Date: Mon, 19 Jun 2017 09:18:00 -0000	[thread overview]
Message-ID: <2dcff9eb662d42f4d8be8d12295c7d64@polymtl.ca> (raw)
In-Reply-To: <20170619090342.GA9305@meddwl.fritz.box>

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


  reply	other threads:[~2017-06-19  9:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19  9:04 Sergei Golubchik
2017-06-19  9:18 ` Simon Marchi [this message]
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=2dcff9eb662d42f4d8be8d12295c7d64@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb@sourceware.org \
    --cc=vuvova@gmail.com \
    /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