This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stacktrace in cygwin gdb after uncaught exception


Christopher Faylor <cgf-no-personal-reply-please <at> cygwin.com> writes:
> gdb does not just exit with an uncaught exception.  It responds to a SIGSEGV
> the same way as linux.

Hmm, I guess that's good that it's supposed to be doing what I want it to, but I
can't get it to work.

If I debug this example program with gdb:


int main() {

  throw -1;

  return 0;
}


I see the following with gdb on Cygwin (Windows XP Professional) and Fedora
Linux respectively:


GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r
Starting program: /cygdrive/c/Documents and Settings/rboder/bob/bob.exe 
Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll

Program exited with code 0400.


GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".
(gdb) r
Starting program: /home/icanoop/bob.exe 
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0x81b000
terminate called after throwing an instance of 'int'

Program received signal SIGABRT, Aborted.
0x0081b410 in __kernel_vsyscall ()
(gdb) bt
#0  0x0081b410 in __kernel_vsyscall ()
#1  0x00861f90 in raise () from /lib/libc.so.6
#2  0x00863678 in abort () from /lib/libc.so.6
#3  0x001cf41e in __gnu_cxx::__verbose_terminate_handler () from
/usr/lib/libstdc++.so.6
#4  0x001cd115 in __gxx_personality_v0 () from /usr/lib/libstdc++.so.6
#5  0x001cd14a in std::terminate () from /usr/lib/libstdc++.so.6
#6  0x001cd27e in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0x080484e7 in main () at bob.cpp:3


Can you get a stack trace when you debug that program on Cygwin?

Thanks,
--
Ryan
http://bitwiserlabs.com



--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]