Re: Help using the GDB C++ STL pretty-printers / xmethods

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 8 May 2022 at 20:44, Paul Smith <paul@xxxxxxxxxxxxxxxxx> wrote:
>
> On Sun, 2022-05-08 at 09:16 +0100, Jonathan Wakely wrote:
> > > gdb.set_convenience_variable('mgr', val['mgr'])
> > > init = gdb.parse_and_eval('$mgr->initialized')
> > >
> > > This will use the xmethod to evaluate the expression.
> >
> > And then:
> >
> > if init:
> >     return gdb.parse_and_eval('*$mgr')
>
> Unfortunately, this doesn't work :(.  I can't do it from the GDB
> command line or python (I have tried both with the same results).
> Something about convenience variables doesn't play well with xmethods
> (or maybe this xmethod implementation specifically?)

You're right, sorry. It doesn't work for me with a convenience variable.

But since what you want is something that works in arbitrary Python
code, not just within GDB, doesn't pybind11 already do everything you
want?
https://github.com/pybind/pybind11



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux