running gdb and attaching back: why doesn't this work?

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Tue Nov 8 15:21:00 GMT 2005


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/



More information about the Cygwin mailing list