From: Tom Tromey <tom@tromey.com>
To: Yifei Zheng <zheng432@purdue.edu>
Cc: gdb@sourceware.org
Subject: Re: How to implement a new Python command that takes values from tty?
Date: Wed, 04 Oct 2017 21:19:00 -0000 [thread overview]
Message-ID: <87lgkqlig7.fsf@tromey.com> (raw)
In-Reply-To: <42da207c-05cf-9648-bba7-650611a7bff4@purdue.edu> (Yifei Zheng's message of "Tue, 3 Oct 2017 18:41:56 -0400")
>>>>> "Yifei" == Yifei Zheng <zheng432@purdue.edu> writes:
Yifei> I have written a few gdb pretty-printers using Python but this time
Yifei> I'm trying to write a new command in Python. I want it to take
Yifei> arguments from gdb and somewhat works like gdb's print. (It's a
Yifei> special printer for some kind of std::vector).
I'm curious why not write a pretty-printer for this case as well?
Yifei> How can I let gdb evaluates the expression for me so that I don't have
Yifei> to parse it, and then give me the value instead of the name?
You want gdb.parse_and_eval.
Tom
next prev parent reply other threads:[~2017-10-04 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 22:42 Yifei Zheng
2017-10-04 21:19 ` Tom Tromey [this message]
2017-10-04 21:34 ` Yifei Zheng
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=87lgkqlig7.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb@sourceware.org \
--cc=zheng432@purdue.edu \
/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