Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: ZCoder on September 15, 2016, 06:00:09 pm
-
Hi. Sorry for my bad English. I can`t debug my code in code::blocks. I place breakpoints in my code and then press the debug/continue button. It opens a window and waits for my inputs. When I write variables and click enter it just exits from the program. When I was using windows 7 it worked but in windows 10 is not working. PLEASE HELP!
-
When I was using windows 7 it worked but in windows 10 is not working. PLEASE HELP!
The EXACT same program?
I write variables and click enter it just exits from the program.
is it a valid input?
does it work if you run it without debugger?
-
Yes, I`ve tested the exact same program. and yes I enter a valid input, when I run without debugger it works.
-
That sounds suspiciously like your code is invoking undefined behaviour somewhere. If so,
a) symptoms are not expected to be consistent between OSes, OS versions, and linking (including debugging) options - or even within them!
b) it may well be impossible to tell where it does so, on this forum, because it's a programming problem, not a Code::Blocks one. You'll need to ask in a more specialised forum, such as StackOverflow.
Sorry.
-
The CB Dev that does debugger stuff; always says to turn on the debugger log and the post the log.
I am NOT a person who uses the debugger; so, can't help you do this steps.
Settings -> Debugger settings
Checkmark "full (debug) log"
CB Version and debugger version is also info they normally want to have.
Tim S.
-
I wrote a simple code to check debug, but this time not worked too. Code:
#include <iostream>
using namespace std;
int a,b;
int main()
{
cin>>a>>b;
a=a+b;
cout<<a<<" "<<b<<endl;
}
When I run it without debugger it works but with debugger when I enter, for example 4 5 , it does nothing, exits from the program.
I think that it is not a programming problem.
-
The CB Dev that does debugger stuff; always says to turn on the debugger log and the post the log.
I am NOT a person who uses the debugger; so, can't help you do this steps.
Settings -> Debugger settings
Checkmark "full (debug) log"
CB Version and debugger version is also info they normally want to have.
Tim S.
-
This is my debugger log.
-
HaHa, you are trying to debug a "release" version of your executable.
See the log:
Reading symbols from C:\Users\ZCoder\Desktop\C++\for_debug\bin\Release\for_debug.exe...(no debugging symbols found)...done.
You need a "debug" version of your executable.
My guess is "C:\Users\ZCoder\Desktop\C++\for_debug\bin\Debug\for_debug.exe"
-
How can I change this?
-
Just switch the target to debug.
See this http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks and our manual.
-
Thank you for your help :D! It is fixed now. I changed release to debug as shown in this picture.