OK, first, below is some simple code. Nothing special, after all, I wrote it. Now, the first thing I do, before I do anything having to do with the debugger is I set a couple of compile options. Since I am not compiling this as a project, but just as a single file, I went to
Tools:Compiler Options:Compiler:Add The Following Cammands When Calling The Compiler
and added
-g3 -O0
The first command generates maximum symbol table information to support debug operation, the last turns OFF optimization.
So now, I go to Execute: Compile on the following promised simple code:
#include<iostream>
using namespace std;
int main(void)
{
int j;
for (int i = 0; i <= 10; i++)
{
cout << "This is what that idiot wayne said to do\n";
j = i + 3;
}
system("pause");
return 0;
}
(Your compile log is always useful when you have a problem, remember to post it all, like this, and not just any errors)
Now, before I go to the debugger, theres one more thing I will do. I will click in the little "gutter" to the left of the code, in this case, I chose the cout line of code. When I click in the right place, the line turns red, and little red circle with a green checkmark appears in the gutter. I have set a breakpoint to stop the code at the cout statement.
Now, I fire up and start the debugger by going to
Debug:Debug
This starts the code up, and it runs to my breakpoint. Now, the breakpoint line, which was red, turns blue. Now, suppose I want to put some watchpoints on some variables. If I hold my cursor over the variable "i", a watch appears in the debug window to the left of the code stating
i = 0
Do the same to j, and I get another watch that states:
j = 4370436
You, the astute observer will have already noticed that j has not been assigned yet, so what I am seeing is garbage in the memory location for j.
Now, if I got down to the bottom, and hit "Next Step", the blue line moves down one line, and now I have a red and a blue line. j still has its non-sense value, as the debugger has stopped before the line of code is executed. One more "Next Step", and the debug window has
i = 0
j = 3
And you can hit continue, to take you from breakpoint to breakpoint....the sort of stuff you should be comfortable with.
Did this get you started? If you are still having problems, try to be specific about what you did, what you did it to etc...
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you have a question, please start a new thread, and give the basic information discussed in the link about how to ask a question in the "Forum FAQ" thread please.
Keep in mind a simple example is the best wat to get help...
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are there any special considerations for Win32 GUI Programs ? I am writing a wx-Widgets app, but I cannot seem to get the debugger operating correctly.
Difficult to give a code example.
I appear to be setting breakpoints, but then pressing 'debug' just runs without stopping. When I do manage to get it to stop on sections of code, I clear the breakpoint, but pressing 'Continue', when that particular function being debugged is entered again causes the 'cleared' breakpoint to appear again....
Not sure how to explain this better, or what to do.
I CAN get simple console examples to debug properly though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i have read the basic3 and searched on the forum for this problem
but i didn't find something helpful
win xp , dev-cpp 4.9.9.2
i can't get the debugger go step by step,
i have put breakpoint ,it doesn't stop till the end
is the some problem like this guy:
Are there any special considerations for Win32 GUI Programs ? I am writing a wx-Widgets app, but I cannot seem to get the debugger operating correctly.
Difficult to give a code example.
I appear to be setting breakpoints, but then pressing 'debug' just runs without stopping. When I do manage to get it to stop on sections of code, I clear the breakpoint, but pressing 'Continue', when that particular function being debugged is entered again causes the 'cleared' breakpoint to appear again....
Not sure how to explain this better, or what to do.
I CAN get simple console examples to debug properly though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I run the example I get the same log as you got. But when I try to run the program it gives error 'source file not compiled' .
I re-run compile. Same thing. Help!
JRH
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Basic Debugging - Getting Started:
OK, first, below is some simple code. Nothing special, after all, I wrote it. Now, the first thing I do, before I do anything having to do with the debugger is I set a couple of compile options. Since I am not compiling this as a project, but just as a single file, I went to
Tools:Compiler Options:Compiler:Add The Following Cammands When Calling The Compiler
and added
-g3 -O0
The first command generates maximum symbol table information to support debug operation, the last turns OFF optimization.
So now, I go to Execute: Compile on the following promised simple code:
#include<iostream>
using namespace std;
int main(void)
{
int j;
for (int i = 0; i <= 10; i++)
{
cout << "This is what that idiot wayne said to do\n";
j = i + 3;
}
system("pause");
return 0;
}
Here is my compile log:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\mycstuff\detest.cpp" -o "C:\mycstuff\detest.exe" -g3 -O0 -traditional-cpp -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
Execution terminated
Compilation successful
(Your compile log is always useful when you have a problem, remember to post it all, like this, and not just any errors)
Now, before I go to the debugger, theres one more thing I will do. I will click in the little "gutter" to the left of the code, in this case, I chose the cout line of code. When I click in the right place, the line turns red, and little red circle with a green checkmark appears in the gutter. I have set a breakpoint to stop the code at the cout statement.
Now, I fire up and start the debugger by going to
Debug:Debug
This starts the code up, and it runs to my breakpoint. Now, the breakpoint line, which was red, turns blue. Now, suppose I want to put some watchpoints on some variables. If I hold my cursor over the variable "i", a watch appears in the debug window to the left of the code stating
i = 0
Do the same to j, and I get another watch that states:
j = 4370436
You, the astute observer will have already noticed that j has not been assigned yet, so what I am seeing is garbage in the memory location for j.
Now, if I got down to the bottom, and hit "Next Step", the blue line moves down one line, and now I have a red and a blue line. j still has its non-sense value, as the debugger has stopped before the line of code is executed. One more "Next Step", and the debug window has
i = 0
j = 3
And you can hit continue, to take you from breakpoint to breakpoint....the sort of stuff you should be comfortable with.
Did this get you started? If you are still having problems, try to be specific about what you did, what you did it to etc...
Wayne
Here is my output from debug window:
Reading symbols from c:\cpp\myserver.exe
done
frames-invalid
compiler options are correct but i'm not able to debug
Piotr
If you have a question, please start a new thread, and give the basic information discussed in the link about how to ask a question in the "Forum FAQ" thread please.
Keep in mind a simple example is the best wat to get help...
Wayne
Are there any special considerations for Win32 GUI Programs ? I am writing a wx-Widgets app, but I cannot seem to get the debugger operating correctly.
Difficult to give a code example.
I appear to be setting breakpoints, but then pressing 'debug' just runs without stopping. When I do manage to get it to stop on sections of code, I clear the breakpoint, but pressing 'Continue', when that particular function being debugged is entered again causes the 'cleared' breakpoint to appear again....
Not sure how to explain this better, or what to do.
I CAN get simple console examples to debug properly though.
i have read the basic3 and searched on the forum for this problem
but i didn't find something helpful
win xp , dev-cpp 4.9.9.2
i can't get the debugger go step by step,
i have put breakpoint ,it doesn't stop till the end
is the some problem like this guy:
Are there any special considerations for Win32 GUI Programs ? I am writing a wx-Widgets app, but I cannot seem to get the debugger operating correctly.
Difficult to give a code example.
I appear to be setting breakpoints, but then pressing 'debug' just runs without stopping. When I do manage to get it to stop on sections of code, I clear the breakpoint, but pressing 'Continue', when that particular function being debugged is entered again causes the 'cleared' breakpoint to appear again....
Not sure how to explain this better, or what to do.
I CAN get simple console examples to debug properly though.
The debugger is shit.
When I run the example I get the same log as you got. But when I try to run the program it gives error 'source file not compiled' .
I re-run compile. Same thing. Help!
JRH
JRH,
A couple of post above yours is a post that asked you to not ask a question on this thread, please start a separate thread.
Thanks,and when you do, please post your Basic 3, and what you did to compile...
Wayne
To get this to work I had to do:
right click the project name:project options:parameters
and add the -g3 -O0 there.
Changing it in the Tools menu did not give the desired compile log. The log I got after my changes is:
Compiler: Default compiler
Building Makefile: "C:\rw778grafika\temp\Makefile.win"
Finding dependencies for file: C:\rw778grafika\temp\testdebugger.cpp
Executing make...
make.exe -f "C:\rw778grafika\temp\Makefile.win" all
g++.exe -DDEBUG testdebugger.o -o "debugtest.exe" -L"C:/Dev-Cpp/lib" -g3
Execution terminated
Compilation successful
Perhaps I wasn't supposed to use a project, but I cant get Devc++ to compile a standalone file...
Wayne asked you to start a new threat!
On the other side, this useful threat is at least visible now..:P
It doesn't have to be visible - it is linked through the thread "Please Read Before Posting a Question"
Wayne
Threads that start with RT are not the appropriate venue for asking questions.
Please go back to the original thread you started and post your Basic 3.
Wayne