News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Debugging wxString on Linux

Started by cacb, August 29, 2014, 10:21:06 PM

Previous topic - Next topic

cacb

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?


oBFusCATed

Yes, search for python pretty printers in the forum and in the internet...

Also check the repository of wxwigets for the appropriate scripts...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

cacb

Quote from: 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...

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.

oBFusCATed

Quote from: cacb on August 30, 2014, 05:42:37 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

cacb

Quote from: oBFusCATed on August 30, 2014, 05:47:40 PM
Quote from: cacb on August 30, 2014, 05:42:37 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.