From: "Doug Evans" <dje@google.com>
To: gdb@sourceware.org
Subject: use of python to pretty-print STL structures, etc.
Date: Fri, 21 Dec 2007 21:57:00 -0000 [thread overview]
Message-ID: <e394668d0712211357v2f097e98w4d2b09f6b75ca8fa@mail.gmail.com> (raw)
Hi. Python scripting support will eventually be added to gdb. I'd
like to better understand folks's views on if/how Python will help
with one sore spot in gdb, namely the printing of c++ data structures
in a way that is useful to the programmer, instead of the raw dump
that is done today.
e.g. instead of
#include <string>
string s ("hello");
int main () { return 0; }
(gdb) p s
$1 = {static npos = 4294967295,
_M_dataplus = {<std::allocator<char>> =
{<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data
fields>}, _M_p = 0x9783014 "hello"}}
and staring at the output to find what one wants, or doing "p
s._M_dataplus._M_p", programmers would often rather just do something
like "p s" and get "hello". Similarily for vectors, etc.
As I understand it, and I'm sure you'll correct me if I'm wrong :-),
the plan is to solve this problem with the new Python scripting
support.
I realize there's no real design as of yet (at least that I'm aware
of), but my question is whether folks have thought about what it would
look like from the command line.
At a very basic level, do folks envision keeping the current cli u/i
(*1) and enhancing it to provide python-providable extensions? Have
folks thought about how they would like the above problem to be solved
(with python or without)?
---
(*1): One can replace the implementation as desired, it's the u/i I'm
concerned with in this message.
next reply other threads:[~2007-12-21 21:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-21 21:57 Doug Evans [this message]
2007-12-21 22:45 ` Vladimir Prus
2007-12-22 7:17 ` Jim Blandy
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=e394668d0712211357v2f097e98w4d2b09f6b75ca8fa@mail.gmail.com \
--to=dje@google.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