Author Topic: Watching std::string in debugger causes segfault?!?  (Read 33353 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Watching std::string in debugger causes segfault?!?
« Reply #15 on: February 06, 2014, 12:18:11 pm »
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.
Hi, elimcodmartinez and others, I finally found that the segment issue was caused by a gdb bug, see details in this link: FYI: GDB has a big bug to support MinGW GCC (4.7.x and later)

I'm using MinGW gdb, not sure how cygwin gdb works on this issue.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.