User forums > Help

Watching std::string in debugger causes segfault?!?

<< < (3/4) > >>

ollydbg:

--- Quote from: jens on March 04, 2013, 05:53:03 pm ---
--- Quote from: ollydbg on March 04, 2013, 04:06:08 pm ---
--- Quote from: jens on March 03, 2013, 12:49:25 pm ---And on windows it also works fine with ollydbg's gdb with pretty printer enabled and TDM's gcc 4.7.1 shipped with C::B 12.11.

--- End quote ---

--- End quote ---

What I meant, was that I have used the pretty printer (watch-scripts disabled).
With the watch-scripts I get the segfault also.

With gdb from TDM and watch-scripts disabled I don't get the segfault, and the value is visible, but hidden in the deep of the string-structure.

--- End quote ---
Oh, sorry, I was wrong. Your testing result is the same as mine.

ascholer:
Agree - with python pretty printer and disabled watch scripts, everything is fine.

But my goal is to provide students a self-contained, reasonable size .zip that they can unpack and run. Don't really want to try to shoehorn Python into that (haven't researched to see how big a package would be needed, but guessing it won't be trivial sized). Hence the desire to stick with the old school watch scripts - also since we are talking about a package targeted at relatively inexperienced students, why I don't want to say "just add a random call to foo.c_str() if you need to debug it".

Spent a while trying every lead I could find to disable the optimizations in gcc 4.7.1 and nothing seemed to work. If anyone knows the magic words to disable, please let me know.

ollydbg:
@ascholer
For python enabled GDB, I think you can just put the python installed files in the <YourMinGWGCC>/bin folder, then distribute them. This is a portable way that you don't need to install python in the target PCs.

ascholer:
@ollydbg Thanks for the tip - I'll experiment with that.

Hacked up a version of the gdb_types.script file that doesn't set up any function calls in Evaluate_StlString but instead does work in Parse_StlString to strip things down to the "string" part of the std:string.

But I'll explore a portable pretty print solution, if for no other reason than it looks like you are the main "debugger dev" and you are focused on that.

elimcodmartinez:
I'm afraid it still (nearly) happens for long strings. Seen in 13.12 for Windows using Cygwin 32bits debugger.
Sometimes it regains control but may stay unresponsive for several seconds.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version