Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: cacb on August 29, 2014, 10:21:06 pm

Title: Debugging wxString on Linux
Post by: cacb on August 29, 2014, 10:21:06 pm
Apologise if this is a common question, but I have not found the answer.

I am running Code::Blocks svn 9854 built from Jens Lody's tarball. OS is Kubuntu 14.04

I am debugging a wxWidgets program with many wxString variables. In the Watches debugging window I am able to find the value of a wxString variable "name" only via

name
    => expand "m_impl"
            => expand "_M_dataplus"
                  the value i want is then in "_M_p"

This is cumbersome. Is there some way I can customise Code::Blocks or gdb to expand this more directly and naturally? Optimally, I want the string value to be shown in the second column, next to the variable name. I would prefer this to happen automatically.

Is there a way to do it?

Title: Re: Debugging wxString on Linux
Post by: oBFusCATed on August 30, 2014, 01:01:43 am
Yes, search for python pretty printers in the forum and in the internet...

Also check the repository of wxwigets for the appropriate scripts...
Title: Re: Debugging wxString on Linux
Post by: cacb on August 30, 2014, 05:42:37 pm
Yes, search for python pretty printers in the forum and in the internet...

Also check the repository of wxwigets for the appropriate scripts...

Thank you. Unfortunately I cannot figure it out. I sort of understand I need gdb with Python support, but I am at a loss to understand if my gdb 7.7 under Kubuntu 14.04 has what it takes. I also understand that "the appropriate script" must be put "somewhere" to make things work.

I wish it was simpler.
Title: Re: Debugging wxString on Linux
Post by: oBFusCATed on August 30, 2014, 05:47:40 pm
I wish it was simpler.
It is not that complex and for wx3 it should work by default... as it should for the stl std::string for example.

The starting point is here: https://sourceware.org/gdb/current/onlinedocs/gdb/Pretty-Printing.html
Title: Re: Debugging wxString on Linux
Post by: cacb on August 30, 2014, 05:51:18 pm
I wish it was simpler.
It is not that complex and for wx3 it should work by default... as it should for the stl std::string for example.

The starting point is here: https://sourceware.org/gdb/current/onlinedocs/gdb/Pretty-Printing.html

Thank you again, I shall look that up! Btw. I am using wx3.0.1 and wxString debugging is NOT working by default here.