Debugger not working on Windows (CLion)

已回答

I have code that works perfectly on Ubuntu 17.04, but that has significant issues on Windows 10. While I don't know the reason for this, considering that cmake should be compatible with all OSes, and I am not using any OS-specific libraries, this is not the issue. The issue is that, I cannot debug.

When attempting debugging, all output is just ignored. I have multiple printf() statements at the start, that display when Run, but do not display in Debug mode. The weird part is that they DO end up displaying if I press enough newlines. Note, this only happens on Debug mode, in basic Run mode this it displays everything as it should.

What is happening? Windows has the most recent version of CLion, whereas Linux has CLion 2017.2. However I doubt that an update would break debugging.

0

Hi! 

Please try to disable buffering by entering the following string of code before any printing: 

setbuf(stdout, 0);

Does it help?

3
Avatar
Permanently deleted user

Hey! It does help, but why? Also I can't help but notice that Run makes whatever has been inputted via scanf to be printed again, and Debug using this method doesn't repeat back what the input was.

Thanks though!

0

Unfortunately, we have some issues with Run and Debug windows.

Here is the issue about the fact that an input appears twice - https://youtrack.jetbrains.com/issue/CPP-2580. You can try the suggested workaround: Open Registry via Help | Find Action, type run.processes.with.pty and disable this pty setting.

And here are the issues related to the fact that an output is not printed in the Debug window: https://youtrack.jetbrains.com/issue/CPP-11220 (macOS, but might be related) and https://youtrack.jetbrains.com/issue/CPP-10733 (please see the comments).

Feel free to comment or upvote these tickets. Follow them to get updates.

 

0

请先登录再写评论。