From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22729 invoked by alias); 11 Mar 2008 15:06:16 -0000 Received: (qmail 22716 invoked by uid 22791); 11 Mar 2008 15:06:15 -0000 X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.174) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Mar 2008 15:05:46 +0000 Received: by wf-out-1314.google.com with SMTP id 29so2413551wff.24 for ; Tue, 11 Mar 2008 08:05:45 -0700 (PDT) Received: by 10.142.171.6 with SMTP id t6mr2689232wfe.117.1205247944682; Tue, 11 Mar 2008 08:05:44 -0700 (PDT) Received: by 10.115.72.11 with HTTP; Tue, 11 Mar 2008 08:05:44 -0700 (PDT) Message-ID: <4024fa2d0803110805ob860320i5684c361f388c80f@mail.gmail.com> Date: Tue, 11 Mar 2008 15:25:00 -0000 From: "Taras D" To: gdb@sourceware.org Subject: Re: stack trace and breaking before crash In-Reply-To: <47D55B70.1FA6B10C@dessent.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4024fa2d0803100747g289cf2abl248dbc80b007356a@mail.gmail.com> <4024fa2d0803100824t788d284cq438043063335c750@mail.gmail.com> <47D55B70.1FA6B10C@dessent.net> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00118.txt.bz2 On 3/11/08, Brian Dessent wrote: > > > inspection of the stack/variables/etc. The exception I'm getting is: > > Exception: STATUS_ACCESS_VIOLATION at eip=610AE0E9. I've tried typing > > Oh, and that address range is inside the DLL so you won't get any > symbols without first building Cygwin with debug symbols. You can use > the .dbg symbols file from the -src package, although the paths will be > wrong so gdb won't be able to display source locations. > > Brian > First I executed the following command at my bash prompt: export CYGWIN=error_start=c:\cygwin\bin\gdb.exe When I run a program which deliberately tries to access address 0, gdb starts in another window. However, the stack trace just shows junk: (gdb) bt #0 0x7c901231 in ntdll!DbgUiConnectToDbg () from /cygdrive/c/WINDOWS/system32/ntdll.dll #1 0x7c9507a8 in ntdll!KiIntSystemCall () from /cygdrive/c/WINDOWS/system32/ntdll.dll #2 0x00000005 in ?? () #3 0x00000004 in ?? () #4 0x00000001 in ?? () #5 0x186fffd0 in ?? () #6 0x00000246 in ?? () #7 0xffffffff in ?? () #8 0x7c90ee18 in strchr () from /cygdrive/c/WINDOWS/system32/ntdll.dll #9 0x7c9507c8 in ntdll!KiIntSystemCall () from /cygdrive/c/WINDOWS/system32/ntdll.dll #10 0x00000000 in ?? () (gdb) I'm not sure if this is where I require to build Cygwin with debug symbols. The message at: http://www.mail-archive.com/cygwin@cygwin.com/msg71279.html suggests typing continue 'to see if gdb switches to the failing instruction'. I tried this: (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. [Switching to thread 8024.0x2324] 0x00401160 in printNull (pInt=0x0) at error.cpp:8 8 cout << *pInt << endl; (gdb) bt #0 0x00401160 in printNull (pInt=0x0) at error.cpp:8 #1 0x004011f2 in main () at error.cpp:18 (gdb) This is working - I'm not quite sure why you have to 'continue', you may be able to provide a reason. On 3/11/08, Brian Dessent wrote: > Set error_start to dumper to get a real core dump instead of the stack > trace file. Then load the core into gdb. I tried this by executing: export CYGWIN=error_start=c:\cygwin\bin\dumper.exe at the bash prompt. After running the program the error.exe.core file is produced. However loading this core into gdb doesn't provide much info: (gdb) core error.exe.core warning: core file may not match specified executable file. Loaded symbols for /home/Liz/c_code/error.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 Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll #0 0x7c90eb94 in ntdll!LdrAccessResource () from /cygdrive/c/WINDOWS/system32/ntdll.dll (gdb) bt #0 0x7c90eb94 in ntdll!LdrAccessResource () from /cygdrive/c/WINDOWS/system32/ntdll.dll #1 0x00000000 in ?? () (gdb) What am I doing wrong here? I'd like to get this 'core' option working as the other option starts gdb in a DOS command prompt, which prevents you from using any other type of interface with gdb (emacs/gui/etc)