Re: How to implement a new Python command that takes values from tty?

Tom Tromey
2017-10-04T21:19:28Z

>>>>> "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