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: Debugging with cygwin tools


Alberto Luaces Fernández wrote:

[snip]
> thanks for the tips, I will check the PATH and look for missing DLLs
> then, although my program is nothing more than a main function
> dereferencing a null pointer, so it should not have any special
> dependencies.

It doesn't.

> The missing DLL message was a bit misleading because gdb crashes after
> printing it, so I thought it was an error message from gdb.exe and not
> from my program.

You are probably right, gdb has a lot of dependencies:

gdb.exe -> /usr/bin/gdb.exe
cygwin1.dll     -> /usr/bin/cygwin1.dll
cygiconv-2.dll  -> /usr/bin/cygiconv-2.dll
cygintl-3.dll   -> /usr/bin/cygintl-3.dll
cygncurses-8.dll        -> /usr/bin/cygncurses-8.dll
comdlg32.dll    -> /c/WINDOWS/system32/comdlg32.dll
gdi32.dll       -> /c/WINDOWS/system32/gdi32.dll
kernel32.dll    -> /c/WINDOWS/system32/kernel32.dll
shell32.dll     -> /c/WINDOWS/system32/shell32.dll
user32.dll      -> /c/WINDOWS/system32/user32.dll
tcl84.dll       -> /usr/bin/tcl84.dll
tk84.dll        -> /usr/bin/tk84.dll
comctl32.dll    -> /c/WINDOWS/system32/comctl32.dll
imm32.dll       -> /c/WINDOWS/system32/imm32.dll
advapi32.dll    -> /c/WINDOWS/system32/advapi32.dll
ntdll.dll       -> /c/WINDOWS/system32/ntdll.dll
msvcrt.dll      -> /c/WINDOWS/system32/msvcrt.dll
rpcrt4.dll      -> /c/WINDOWS/system32/rpcrt4.dll
shlwapi.dll     -> /c/WINDOWS/system32/shlwapi.dll

But it was running until you used "r", so it would be interesting to know what
was the dll loaded at the address given by the error.  Your program only uses
cygwin1.dll and Windows' dlls.

> Maybe the non 7-bit ASCII character found on my user name (Demostración)
> is causing some issues with PATH, could I try to rename my home
> directory directly or would I need to change something more?

Don't change anything, gdb debugs your program fine no mater if the directory
you are in has an accent or not (or spaces):

$ gdb core.exe
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) list
1       #include <iostream>
2
3       int main()
4       {
5               int *p=0;
6
7               *p=9;
8
9               return 0;
10      }
(gdb) b main
Breakpoint 1 at 0x401175: file core.cc, line 4.
(gdb) r
Starting program: /c/Documents and Settings/René/core.exe
Loaded symbols for /c/WINDOWS/system32/ntdll.dll
Loaded symbols for /c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINDOWS/system32/advapi32.dll
Loaded symbols for /c/WINDOWS/system32/rpcrt4.dll

Breakpoint 1, main () at core.cc:4
4       {
(gdb) info files
Symbols from "/c/Documents and Settings/René/core.exe".
Win32 child process:
        Using the running image of child thread 3492.0x868.
        While running this, GDB does not access memory from...
Local exec file:
        `/c/Documents and Settings/René/core.exe', file type pei-i386.
        Entry point: 0x401000
        0x00401000 - 0x00441288 is .text
        0x00442000 - 0x00442160 is .data
        0x00443000 - 0x00445664 is .rdata
        0x00446000 - 0x0044ab60 is .bss
        0x0044b000 - 0x0044b6cc is .idata
        0x7c901000 - 0x7c97b6fe is .text in /c/WINDOWS/system32/ntdll.dll
        0x7c97c000 - 0x7c97f200 is .data in /c/WINDOWS/system32/ntdll.dll
        0x7c981000 - 0x7c9ace78 is .rsrc in /c/WINDOWS/system32/ntdll.dll
        0x7c9ad000 - 0x7c9afe88 is .reloc in /c/WINDOWS/system32/ntdll.dll
        0x7c801000 - 0x7c883111 is .text in /c/WINDOWS/system32/kernel32.dll
        0x7c884000 - 0x7c886400 is .data in /c/WINDOWS/system32/kernel32.dll
        0x7c889000 - 0x7c8eeee8 is .rsrc in /c/WINDOWS/system32/kernel32.dll
        0x7c8ef000 - 0x7c8f4bec is .reloc in /c/WINDOWS/system32/kernel32.dll
        0x61001000 - 0x610fcaf4 is .text in /usr/bin/cygwin1.dll
        0x610fd000 - 0x610ff710 is .autoload_text in /usr/bin/cygwin1.dll
        0x61100000 - 0x6110af70 is .data in /usr/bin/cygwin1.dll
        0x6110b000 - 0x6113e520 is .rdata in /usr/bin/cygwin1.dll
        0x6113f000 - 0x611483d0 is .bss in /usr/bin/cygwin1.dll
        0x61149000 - 0x61150c9b is .edata in /usr/bin/cygwin1.dll
        0x61151000 - 0x61151448 is .rsrc in /usr/bin/cygwin1.dll
        0x61152000 - 0x6116210c is .reloc in /usr/bin/cygwin1.dll
---Type <return> to continue, or q <return> to quit---
        0x61163000 - 0x61163104 is .cygwin_dll_common in /usr/bin/cygwin1.dll
        0x61165000 - 0x61170000 is .idata in /usr/bin/cygwin1.dll
        0x61170000 - 0x61200000 is .cygheap in /usr/bin/cygwin1.dll
        0x77dd1000 - 0x77e452d9 is .text in /c/WINDOWS/system32/advapi32.dll
        0x77e46000 - 0x77e48c00 is .data in /c/WINDOWS/system32/advapi32.dll
        0x77e4b000 - 0x77e65980 is .rsrc in /c/WINDOWS/system32/advapi32.dll
        0x77e66000 - 0x77e6ab38 is .reloc in /c/WINDOWS/system32/advapi32.dll
        0x77e71000 - 0x77ef2beb is .text in /c/WINDOWS/system32/rpcrt4.dll
        0x77ef3000 - 0x77ef990a is .orpc in /c/WINDOWS/system32/rpcrt4.dll
        0x77efa000 - 0x77efaa00 is .data in /c/WINDOWS/system32/rpcrt4.dll
        0x77efb000 - 0x77efb408 is .rsrc in /c/WINDOWS/system32/rpcrt4.dll
        0x77efc000 - 0x77f003f8 is .reloc in /c/WINDOWS/system32/rpcrt4.dll
(gdb)

> At least I have now several things to try...

Yep.
-- 
René Berber


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