This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Debugging with cygwin tools
- From: Alberto Luaces <aluaces at udc dot es>
- To: cygwin at cygwin dot com
- Date: Thu, 04 Oct 2007 13:10:07 +0200
- Subject: Debugging with cygwin tools
Hello,
I am just starting to learn how to use the debugging tools available in
Cygwin. To do so, I have a test program deliberately designed to crash:
#include <iostream>
int main()
{
int *p=0;
*p=9;
return 0;
}
I have compiled it with debugging information:
g++ -g -O0 -o core core.cpp
Then I try to run it with gdb:
gdb core.exe
(gdb) b main
Breakpoint 1 at 0x401175: file core.cpp, line 4.
(gdb) r
Starting program: /home/Demostración/testsC++/core.exe
Error: dll starting at 0x77d41000 not found.
Segmentation fault (core dumped)
As seen, gdb crashes without even start the program.
Then, I am trying to get a core dump:
$ export CYGWIN=error_start=c:\\cygwin\\bin\\dumper.exe
$ ./core
*** starting debugger for pid 2664, tid 544
but the program 'dump.exe' never returns and no core file is generated.
My system is running WinXP-64. I have read on the archives that
dumper.exe should work correctly but it is not.
How can I finally debug my program?
Alberto
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/