Debugging with GiNaC
Hi all, I'm trying to debug with GiNaC objects. I am aware of the dbgprint() function, however, this function can't be found for a numeric or a symbol. GiNaC::basic has this function, but it can't be found for numeric or symbol. The strange thing also is that gdb can't find any function listed in the class reference of, say, numeric. So the basic question is: How can i print the contents of GiNaC::numeric and GiNaC::symbol while debugging? Thank you very much, kind regards, Patrick
On Wed, 01 Aug 2018 08:17:08 +0200, Patrick Schulz <pschulz@posteo.de> said:
PB> Hi all, I'm trying to debug with GiNaC objects. I am aware of PB> the dbgprint() function, however, this function can't be found PB> for a numeric or a symbol. GiNaC::basic has this function, but PB> it can't be found for numeric or symbol. The strange thing also PB> is that gdb can't find any function listed in the class PB> reference of, say, numeric. PB> So the basic question is: How can i print the contents of PB> GiNaC::numeric and GiNaC::symbol while debugging? The line std:cerr << "x=" << x << std::endl; effectively replaces dbgprint() in all case. You do need dbgprinttree() for more complicated cases (but not for symbols and numerics). Happy debugging! -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/
Hello, 01.08.2018, 10:26, "Patrick Schulz" <pschulz@posteo.de>:
I'm trying to debug with GiNaC objects. I am aware of the dbgprint() function, however, this function can't be found for a numeric or a symbol.
That's not quite correct. dbgprint is a virtual method, so both numeric and symbol use the implementation from the parent class (i.e. basic).
So the basic question is: How can i print the contents of GiNaC::numeric and GiNaC::symbol while debugging?
Type in call e.dbgprint() in gdb. Alternatively one can use gdb pretty printers (see the attached patch). Best regards, Alexey
participants (3)
-
Alexey Sheplyakov
-
Patrick Schulz
-
Vladimir V. Kisil