Author Topic: Windows 10 Debugger is not working :(  (Read 13737 times)

Offline ZCoder

  • Single posting newcomer
  • *
  • Posts: 6
Windows 10 Debugger is not working :(
« 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!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Windows 10 Debugger is not working :(
« Reply #1 on: September 15, 2016, 08:53:08 pm »
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?

Offline ZCoder

  • Single posting newcomer
  • *
  • Posts: 6
Re: Windows 10 Debugger is not working :(
« Reply #2 on: September 16, 2016, 12:45:50 pm »
Yes, I`ve tested the exact same program. and yes I enter a valid input, when I run without debugger it works.

Offline rlb

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Windows 10 Debugger is not working :(
« Reply #3 on: September 16, 2016, 04:42:57 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Windows 10 Debugger is not working :(
« Reply #4 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.
« Last Edit: September 16, 2016, 05:52:41 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ZCoder

  • Single posting newcomer
  • *
  • Posts: 6
Re: Windows 10 Debugger is not working :(
« Reply #5 on: September 16, 2016, 09:34:56 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Windows 10 Debugger is not working :(
« Reply #6 on: September 17, 2016, 12:36:00 am »
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!]

Offline ZCoder

  • Single posting newcomer
  • *
  • Posts: 6
Re: Windows 10 Debugger is not working :(
« Reply #7 on: September 17, 2016, 11:44:42 am »
This is my debugger log.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Windows 10 Debugger is not working :(
« Reply #8 on: September 17, 2016, 04:09:12 pm »
HaHa, you are trying to debug a "release" version of your executable.
See the log:
Quote
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"
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.

Offline ZCoder

  • Single posting newcomer
  • *
  • Posts: 6
Re: Windows 10 Debugger is not working :(
« Reply #9 on: September 17, 2016, 06:57:01 pm »
How can I change this?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Windows 10 Debugger is not working :(
« Reply #10 on: September 17, 2016, 11:06:39 pm »
Just switch the target to debug.

See this http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks and our manual.
(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!]

Offline ZCoder

  • Single posting newcomer
  • *
  • Posts: 6
Re: Windows 10 Debugger is not working :(
« Reply #11 on: September 17, 2016, 11:38:24 pm »
Thank you for your help :D! It is fixed now. I changed release to debug as shown in this picture.