Mail Archives: cygwin/2006/08/28/14:02:08
--Apple-Mail-8-239764117
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
> You will likely get better results here if you build the
> cygwin1.dll locally
> as debug or download cygwin1.dbg for a snapshot cygwin1.dll. See
> <www.cygwin.com/snapshots>
I think getting a stack trace for each of the threads would probably
be very useful for tracking this down, so I downloaded the 2006-08-18
snapshots of both cygwin1-20060818.dll.bz2 and
cygwin1-20060818.dbg.bz2, decompressed them with bunzip2, stripped
the timestamp, swapped the original cygwin1.dll with the snapshot
version, and placed the .dbg alongside it (all in c:/cygwin/bin)
But unfortunately, I still don't get debugging symbols when attaching
to a process.
Here's a bit of test code I'm running for illustration (test.cc):
#include <iostream>
#include <unistd.h>
using namespace std;
int main() {
sleep(5);
cout << "Hello World!" << endl;
return 0;
}
Compiled with g++ -g test.cc -o test
Pretty straightforward.
I *do* get the symbols when I launch with gdb, e.g. gdb test.exe.
It's still a little odd though because I can set a breakpoint like
test.cc:7, and check the stack and see main() listed, but then if I
step into sleep (or just set a breakpoint on sleep to begin with),
any stack traces while within cygwin code go back to listing '??' for
*my* code. (no main is listed, just a '??' for the bottom stack
frame). That's kind of strange.
So this shows the cygwin symbols are there and available at least. I
can step through sleep() and get all kinds of fun stuff in winsup.
It's a different story if I attach to a running process however. If
I do something like 'gdb test.exe 1824' during that 5 second window,
and then try to view the stack (which is what I need to do to get the
stack trace in my main program we're trying to debug, since it forks
into several processes), then I just get a couple Windows DLL calls
at the top, and a whole series of '??' for everything that came
before it. (Full console dump attached at end)
So, what's up with that?
-ethan
PS First attempt of this email got kicked back because it had a text/
html mime type alongside the text/plain. Oh my god, that's the end
of the world, let me tell you.
Can't your list server just strip the html version if you dislike
html so much? And even so, is HTML really so bad? Wouldn't it be
nice to have syntax-highlighted code samples? *actual* bold text
instead of ASCII art highlights? Real bullet-lists that word wrap
properly? <blockquote>-wrapped quotes instead of '>' indented messes?
Considering all of the mail programs I've used will automatically
also send a plain text version for the luddites out there, and even
so, last I checked even the console based mail readers (e.g. pine)
can parse HTML, so I don't see what the problem is here. *shrug*
Annnnyway...
--Apple-Mail-8-239764117
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
x-unix-mode=0700;
name=cygwin-debug.txt
Content-Disposition: attachment;
filename=cygwin-debug.txt
ejt AT MidnightSun2 ~
$ gdb test.exe 1824
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"...
Attaching to program `/home/ejt/test.exe', process 4004
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/winmm.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/user32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/gdi32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/lpk.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/usp10.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/msvcrt.dll
[Switching to thread 4004.0xf78]
(gdb) info threads
* 3 thread 4004.0xf78 0x7c901231 in ntdll!DbgUiConnectToDbg ()
from /cygdrive/c/WINDOWS/system32/ntdll.dll
2 thread 4004.0xc10 0x7c90eb94 in ntdll!LdrAccessResource ()
from /cygdrive/c/WINDOWS/system32/ntdll.dll
1 thread 4004.0x2bc 0x7c90eb94 in ntdll!LdrAccessResource ()
from /cygdrive/c/WINDOWS/system32/ntdll.dll
(gdb) thread 1
[Switching to thread 1 (thread 4004.0x2bc)]#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 0x7c90e9ab in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/WINDOWS/system32/ntdll.dll
#2 0x7c8094f2 in KERNEL32!CreateFileMappingA () from /cygdrive/c/WINDOWS/system32/kernel32.dll
#3 0x00000002 in ?? ()
#4 0x0022ca88 in ?? ()
#5 0x00000001 in ?? ()
#6 0x00000000 in ?? ()
(gdb) thread 2
[Switching to thread 2 (thread 4004.0xc10)]#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 0x7c90e288 in ntdll!ZwReadFile () from /cygdrive/c/WINDOWS/system32/ntdll.dll
#2 0x7c801875 in ReadFile () from /cygdrive/c/WINDOWS/system32/kernel32.dll
#3 0x00000754 in ?? ()
#4 0x00000000 in ?? ()
(gdb) thread 3
[Switching to thread 3 (thread 4004.0xf78)]#0 0x7c901231 in ntdll!DbgUiConnectToDbg ()
from /cygdrive/c/WINDOWS/system32/ntdll.dll
(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 0x18c7ffd0 in ?? ()
#6 0x00000000 in ?? ()
(gdb)
--Apple-Mail-8-239764117
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
--Apple-Mail-8-239764117
Content-Type: text/plain; charset=us-ascii
--
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/
--Apple-Mail-8-239764117--
- Raw text -