What causes a Sigtrap in a Debug Session

前端 未结 2 1531
逝去的感伤
逝去的感伤 2020-12-09 07:34

In my c++ program I\'m using a library which will \"send?\" a Sigtrap on a certain operations when I\'m debugging it (using gdb as a debugger). I can then choose whether I w

2条回答
  •  有刺的猬
    2020-12-09 08:17

    While working in Eclipse with minGW/gcc compiler, I realized it's reacting very bad with vectors in my code, resulting to an unclear SIGTRAP signal and sometimes even showing abnormal debugger behavior (i.e. jumping somewhere up in the code and continuing execution of the code in reverse order!).

    I have copied the files from my project into the VisualStudio and resolved the issues, then copied the changes back to eclipse and voila, worked like a charm. The reasons were like vector initialization differences with reserve() and resize() functions, or trying to access elements out of the bounds of the vector array.

    Hope this will help someone else.

提交回复
热议问题