SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: piyushj on April 04, 2016, 02:10:02 pm

Title: Support for Debugging STL library in C++
Post by: piyushj on April 04, 2016, 02:10:02 pm
Hi,

Is these any plan to support stl containers in slickedit?
I cannot see even simple vectors values, like in visual studio when debugging?
Title: Re: Support for Debugging STL library in C++
Post by: Dennis on April 04, 2016, 05:19:31 pm
What platform, and are you using the GDB debugger integration or the WinDBG debugger integration?

GDB debugger integration definitely supports this, however, it can be disabled in the debugger options.
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 04, 2016, 05:35:03 pm
(http://s18.postimg.org/ixfpcu4ux/stl.png)

using windows 7 x64, mingw gcc, see image -- i cannot see value in debugger.
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 04, 2016, 05:40:25 pm
For reference, see visual studio display !
(http://s15.postimg.org/4qjqil4mz/image.png)

It looks ages behind.
Title: Re: Support for Debugging STL library in C++
Post by: Dennis on April 04, 2016, 06:05:42 pm
Go to Debug > Debugger Options... > General?

Do you have "Enable Python pretty printing" turned off ?

Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 05, 2016, 03:59:10 pm
it's on.
can u share a screenshot where it actually shows useful info?
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 05, 2016, 04:00:05 pm
(http://s21.postimg.org/ltoy7u1ef/slickissue.png)
Title: Re: Support for Debugging STL library in C++
Post by: Dennis on April 05, 2016, 04:42:22 pm
Try this:

1) Macro > Set Macro Variable... > def_debug_logging > 1

2) Run a debug session, reproduce the problem.

3) Also do this (with the example you have), from the SlickEdit command line:
      debug_send_command p v

3) Macro > Set Macro Variable... > def_debug_logging > 0

4) Grab "logs/debug.log" from your SlickEdit configuration directory and attach it here.
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 05, 2016, 10:55:31 pm
Debug logs
https://www.dropbox.com/s/rtyy1nre4ufpblw/debug.log?dl=1
Title: Re: Support for Debugging STL library in C++
Post by: Dennis on April 05, 2016, 11:37:40 pm
Try plugging this modified version of libstdc++/printers.py into your SlickEdit installation directory.  Make a backup of your original in case if you have problems with it.

slickedit/plugins/com_slickedit.base/sysconfig/vsdebug/python/libstdcxx/v6/printers.py
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 06, 2016, 06:35:43 am
still same  :(

I restarted the slickedit
(http://s29.postimg.org/8h4bmu9nb/stl2.png)
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 06, 2016, 06:53:12 am
b/w i am using mingw w64 (x86_64-5.3.0-release-posix-seh-rt_v4-rev0)
Title: Re: Support for Debugging STL library in C++
Post by: Dennis on April 06, 2016, 03:17:51 pm
You could try using the matching mingw version of GDB and turning off the option to "Disable auto-loading of scripts".  You can point SlickEdit at your mingw GDB using the Debug > Debugger Options... > GDB Configurations.

It looks like that particular version of GCC/libstdc++ generates different debugging information, because 'v' doesn't even show up as a std::vector according to GDB, which is why the Python script does not recognize it as such.
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 07, 2016, 08:52:48 pm
particular version of GCC/libstdc++ ??

Care to tell me which version of mingw gcc works  ??? ? i highly doubt, it was ever tested.
mingw-32 wont work as it is not python enabled.

 I have tested removing entire config, reinstalling slickedit - nothing works. i have tried both with 32 and 64 bit of mingw in windows 7 x64 .

Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 07, 2016, 09:07:59 pm
Here my entire debugging system has crashed.
Now nothing works even after a fresh install.

(http://oi66.tinypic.com/osa7es.jpg)

Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 08, 2016, 12:47:40 pm
Finally got it working for vector, map, deque etc.
But doesn't work on stack and queue.
(http://s24.postimg.org/s6wrgv40l/stl4.png)

Debug logs --
https://www.dropbox.com/s/rtyy1nre4ufpblw/debug.log?dl=1
Please look into this issue.

@pointing to ming gdb worked ! but only partially.

Also, in same setup, free codeblocks works fine, unlike slickedit.
Title: Re: Support for Debugging STL library in C++
Post by: Dennis on April 08, 2016, 03:22:13 pm
I will check your debug logs, thanks for sending them.

Unfortunately, this is a forever-catching-up sort of issue.  The GDB/Python pretty printing integration is a poorly designed mechanism with respect to the GDB/MI (machine interface).  No attempt is made for the output of pretty printers to conform to the MI protocol, or to honor simple settings such as limits on how many elements of an array to print before stopping.  Try to print an oversized or uninitialized array, and GDB will hang and eventually run out of memory.  So, every release, they change something and create something new for debugger implementors to chase down and work around.  It's not going to change, but I felt like I should explain why we can not always keep up with this particular ever-changing target.
Title: Re: Support for Debugging STL library in C++
Post by: piyushj on April 15, 2016, 04:22:17 pm
Thanks. It's all fixed in new version.
 ;D ;D ;D