gdb failure just exits

Answered

I've had some issues where I Debug an executable. CLion builds it, seems to start the debug but then just prints out 

    The process has finished with exit code 0 (or similar). 

There's no error, no log, no nothing, doesn't even get to main(). 

I eventually worked out that gdb itself was failing name demangling on the executable (if you run gdb by hand you see that). It seems that CLion then accepts the default which is to shut down gdb, exits and shows exit code 0. 

It would be rather better if at least it showed what had happened, and even better if it showed what happened, ignored the error (you can do that manually) and continued. Yes that name wouldn't be demangled, but at least you can debug. 

I eventually worked around it by compiling gdb, a later version, and using that as a custom GDB once I'd guessed why it was failing. 

3 comments
Comment actions Permalink

Hi! Thank you for the detailed description. I've created an issue in our tracker, please feel free to comment or upvote.

0
Comment actions Permalink

Rols, may I ask you to share an example of code that causes the debugger to crash? It would help up investigating the issue and implementing the workaround you suggested.

If it's possible, please attach to the issue linked by my colleague above. Thanks.

0
Comment actions Permalink

Created an example from a name mangling bug filed against GDB and attached to the issue - which I also upvoted. You should be able to detect that GDB exited badly and dump out what it printed I think. 

0

Please sign in to leave a comment.