Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 8 Nov 2005 10:12:47 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: running gdb and attaching back: why doesn't this work? Message-ID: <20051108151247.GB22923@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <20051108071317 DOT 63276 DOT qmail AT web36307 DOT mail DOT mud DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051108071317.63276.qmail@web36307.mail.mud.yahoo.com> User-Agent: Mutt/1.5.8i On Mon, Nov 07, 2005 at 11:13:17PM -0800, mario rossi wrote: >Hi, >I've been trying to run gdb from a thread to get a >stack trace of such thread...but it doesn't seem to >work as expected under cygwin. The code I tried is >attached below. > >The output I get from the code is: > >[Switching to thread 3420.0xab0] >* 4 thread 3420.0xab0 0x77f75a59 in >ntdll!DbgUiConnectToDbg () from >/c/WINDOWS/System32/ntdll.dll > 3 thread 3420.0xe24 0x7ffe0304 in ?? () > 2 thread 3420.0xfa4 0x7ffe0304 in ?? () > 1 thread 3420.0xffc 0x7ffe0304 in ?? () >[Switching to thread 1 (thread 3420.0xffc)]#0 >0x7ffe0304 in ?? () >#0 0x7ffe0304 in ?? () >#1 0x77f5c524 in ntdll!ZwWaitForMultipleObjects () >from >/c/WINDOWS/System32/ntdll.dll >#2 0x77e75f0b in WaitForMultipleObjectsEx () from >/c/WINDOWS/system32/kernel32.dll >#3 0x00000002 in ?? () >#4 0x0022dc1c in ?? () >#5 0x00000001 in ?? () >#6 0x00000000 in ?? () from > >Now, thread 1 is in fact the one running main() and >the called functions, but it doesn't show the proper >stack trace. I can verifty that thread 1 is the right >one by attaching one more gdb started manually to the >very same app. If I do that and type "info threads" I >get: >* 4 thread 3420.0xfc0 0x77f75a59 in >ntdll!DbgUiConnectToDbg () from >/c/WINDOWS/System32/ntdll.dll > 3 thread 3420.0xe24 0x7ffe0304 in ?? () > 2 thread 3420.0xfa4 0x7ffe0304 in ?? () > 1 thread 3420.0xffc f () at test.c:31 > >Any Idea what might be wrong, and how to solve it? If you are inspecting a stack trace from a thread that is running in a kernel function, then unfortunately, there is no stack frame information available and the trace will be either wrong or incomplete. It's an annoyance, I know. cgf -- 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/