This is the mail archive of the
mailing list for the Archer project.
Re: pretty printing of smart pointers and making function calls
> You can work around this a little by having the base printer also print
> the pointed-to value. This is what the libstdc++ iterator printers do
> (for now).
I'm not sure I understand you correctly. Do you mean that if the user asks for a
value of variable a and pretty printer knows that it's a pointer then along with
pointer address it should print the value the pointer points too? Anyway some
reference to document or example would be useful here.
> Yes, it can be done. What you have to do is get the address of the
> function as a value. There's no super way to do this right now:
The link above mentions gdb.parse_and_eval() which does exactly what I need.
> However, you usually don't want to call functions when pretty-printing.
> For one thing, this means core-file debugging won't work.
> It is better, when possible, to do everything in Python instead.
But you are right that this doesn't work with core-file. Is there any way to
check in Python whether I debug alive process or see its dead body?