Author Topic: How to make C::B gdb debugger watch display the content of a wxString ?  (Read 4455 times)

Offline tomay3000

  • Multiple posting newcomer
  • *
  • Posts: 61
Hello,
How to make C::B gdb debugger watch display the content of a wxString stored in m_impl to be displayed directly in wxString field in the watch grid (so I don't have to expand wxString object each time I want to see the content of m_impl).

Help me please  :'(

Thank you for your understanding.

I am using Windows XP SP3 32bit under VMware Workstation, with C::B svn 11021 and TDM-GCC-32 v5.1.0 and wxWidgets 3.1.0
« Last Edit: April 25, 2017, 03:22:09 am by tomay3000 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Find the gdb pretty printer script in the wx project for your version and search how to enable it in codeblocks.
You need python enabled gdb for this to work.
(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 sam_gonfle

  • Single posting newcomer
  • *
  • Posts: 3
Re: How to make C::B gdb debugger watch display the content of a wxString ?
« Reply #2 on: August 14, 2017, 10:23:50 pm »
hi,
I have the same problem.
wxString are displayed in the watch tab when local under string->m_impl->..->_M_P_.
If the same string is added as watch , nothing works. If the string is global, nothing works.
If the cursor hover on the string, i have
Quote
[debug]> whatis strTrv
[debug]type = wxString
[debug]>>>>>>cb_gdb:
[debug]> output &strTrv
[debug](wxString *) 0xdcafb90>>>>>>cb_gdb:
[debug]> output /c strTrv.m_pchData[0]@((wxStringData*)strTrv.m_pchData - 1)->nDataLength
[debug]No symbol "wxStringData" in current context.
[debug]>>>>>>cb_gdb:

As for every C::B's update, it's a nightmare to be able to  debug the wxString. I  spent a lot of time to make it work for previous versions of C::B or wxWidgets and of course, i don't remember what i've done before. I tried whith another debbuger ( TDM ) with python-> not working.
copying print.py stuff from wxWidgets -> not working
forums are most of time a waste of time, problem is known since more then 10 years...
I don't feel like spending days to configurate a single debugger, so i tried another ide : Netbeans.
it works perfectly !!!
Hope i've been a bit more helpfull for tomay3000.
regards.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: How to make C::B gdb debugger watch display the content of a wxString ?
« Reply #3 on: August 14, 2017, 11:40:51 pm »
sam_gonfle:
I guess not... You've not mentioned any version information for any of the components you've tried.
wxString changed in wx3.x, so old scripts (for wx2.8) don't work any more.
Also the defaults in C::B are only meant to work with wx2.8.
(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 sam_gonfle

  • Single posting newcomer
  • *
  • Posts: 3
Re: How to make C::B gdb debugger watch display the content of a wxString ?
« Reply #4 on: August 15, 2017, 12:22:03 am »

wx 3.1.0
i've not tried wx 2.8 it's a relic

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: How to make C::B gdb debugger watch display the content of a wxString ?
« Reply #5 on: August 15, 2017, 01:12:05 am »
Still not enough information like cb version, compiler, debugger version, os...

For wx3.1 you should setup gdb enabled python.
(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 sam_gonfle

  • Single posting newcomer
  • *
  • Posts: 3
Re: How to make C::B gdb debugger watch display the content of a wxString ?
« Reply #6 on: August 15, 2017, 09:38:41 pm »
C::B 16.01
gdb 7.6.1 , gcc, ... standard toolchain installed with/by C::B 16.01
Windows


btw: when C::B starts, it restore the first project in the workspace as the active prj, wichever the active proj saved was .
 

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: How to make C::B gdb debugger watch display the content of a wxString ?
« Reply #7 on: August 15, 2017, 10:37:59 pm »
Quote
gdb 7.6.1
i don't think this debugger is python enabled. You will need to check this. Here are some links that will help you:
http://wiki.codeblocks.org/index.php/Pretty_Printers
http://forums.codeblocks.org/index.php?topic=16633.0