Author Topic: Debugging wxString on Linux  (Read 4542 times)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Debugging wxString on Linux
« 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?


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging wxString on Linux
« Reply #1 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...
(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!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Debugging wxString on Linux
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging wxString on Linux
« Reply #3 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
(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!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Debugging wxString on Linux
« Reply #4 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.