Gdb Debugging Issue

Answered

Hi I am debugging something using the debugger via Clion. I have it pointed to my own version of gdb, and I am setting a break point and then calling a function from the gdb console after my break point is hit. For example: print func(x)

func(x) is a built in debug function that helps dump some debug info, however after I make the call to my debug function, my process is forced to exit and I get this message:

"Evaluation hung: call func(e)
This may be caused by something like a deadlock or an infinite loop.
To prevent this from happening when variables are calculated, please toggle 'Enable value renderers' off.

Process finished with exit code 0"

If I do them same manually running the gdb from the console and set the breakpoint, I see no issue like this from within gdb after the print call. In other words, the issue only happens when i am using gdb from within clion. Any help would be appreciated. 

0
2 comments

Hello! What GDB version do you use? Does the problem happen if you use the bundled GDB in CLion? 

Please enable debugger logging as described here, reproduce the issue and send the resulting idea.log file to clion-support at jetbrains.com. Thanks. Do not forget to disable debug logging after that. Note that logs might contain private user's information (like file paths and names). 

0

Figured it out, will write for future reference for anyone who runs into this:

It is not a gdb issue, but an issue related to a debug execution timeout setting in clion. It turns out that if you want to evaluate a function via "print func()" from clion debugger using gdb under the hood, and if your func() can take a long time( in my example, my func() is a function that allows commands from standard input and won't exit until it is commanded to exit ), you will run into an issue where clion will just timeout and kill your process after 30 seconds, if func() has not exited in 30 seconds.

This 30 second timer can be extended by doing ( ctrl + shift + a ), and typing "registry" and then enter. And then adjusting the "cidr.debugger.timeout.eveluate" setting to a larger number. It is set by default to 30000ms which is 30 seconds, but can be made larger to prevent such a timeout. 

2

Please sign in to leave a comment.