News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to make C::B gdb debugger watch display the content of a wxString ?

Started by tomay3000, April 25, 2017, 03:19:11 AM

Previous topic - Next topic

tomay3000

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

oBFusCATed

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!]

sam_gonfle

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.

oBFusCATed

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!]

sam_gonfle


oBFusCATed

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!]

sam_gonfle

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 .
 

BlueHazzard