This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]