I have looked for documentation on this and found nothing. I have MinGW installed and it works great. I just don't know how to use the debugger.
Given some simple code, say in a file called "mycode.cpp":
int main()
{
int temp = 0;
for (int i = 0; i < 5; ++i)
temp += i;
return 0;
}
...how would I debug this. What are the commands that I use to debug code with MinGW and GDB in windows? Can I step through the code via the command line like in Visual Studio? If so what commands do I use to do that?
Are there any tutorials for using GDB out there? I couldn't find any, but if anyone could direct me to one that would be great too. I'm tired of writing tons of std::cout
statements to debug complex code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…