News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Windows 10 Debugger is not working :(

Started by ZCoder, September 15, 2016, 06:00:09 PM

Previous topic - Next topic

ZCoder

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!

BlueHazzard

Quote from: ZCoder on September 15, 2016, 06:00:09 PM
When I was using windows 7 it worked but in windows 10 is not working. PLEASE HELP!
The EXACT same program?

Quote from: ZCoder on September 15, 2016, 06:00:09 PM
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?

ZCoder

Yes, I`ve tested the exact same program. and yes I enter a valid input, when I run without debugger it works.

rlb

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.
Richard Bos

stahta01

#4
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ZCoder

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.

oBFusCATed

Quote from: stahta01 on September 16, 2016, 05:49:18 PM
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ZCoder


ollydbg

HaHa, you are trying to debug a "release" version of your executable.
See the log:
QuoteReading 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"
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ZCoder


oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ZCoder

Thank you for your help :D! It is fixed now. I changed release to debug as shown in this picture.