Support of gdb for Windows 64 native systems

Pedro Alves pedro_alves@portugalmail.pt
Sun Oct 14 11:44:00 GMT 2007


Joel Brobecker wrote:
>> Not sure who you're asking that, but, I'm not doing or going to do
>> anything, since you're already about to :)
> 
> OK :). I don't have much time these days, and in fact, I wasn't
> really supposed to dedicate the 4+ hours I have already spent on
> this, but since we seem to be on a roll, I'll try to spend some
> time on it next week to start the process and get us a minimal
> MinGW debugger.
> 

Nah, nah, na-na-naaah.  I've done it, and I said wouldn't  :)

Seriously, and rethinking a bit after sleep, it is safer to do
it from scratch, so the copyright issues are cleared.

The initial changes are pretty mechanic, so, here goes.

What's done:

	- Added mingw.mh, mingw.mt as copies from the cygwin files.
	- Updated configure.tgt to set gdb_target.
	- Disabled cygwin specific functionality in win32-nat.c.  As can
	be seen, the changes are very small.
	- profs.h isn't needed anymore, since I've implemented cygwin cross-core 
support a few weeks ago (in i386-cygwin-tdep.c).  The include can be
	unconditionally removed.

What's next:

	Test with a mingw built libexpat to test dll support.

	win32_pid_to_exec_file:  Could be done with GetModuleFileNameEx
	from PSAPI and/or with toolhelp.

	Rename a few things, which really aren't cygwin specific, like:
		* cygwin_get_dr6 -> win32_get_dr6
		* i386-cygwin-tdep.h -> i386-win32-tdep.h
		* nm-cygwin.h -> nm-cygming.h

What's disabled:
	Use a shell to start the subprocess.

I'm sure there are other problems, but it is useable already.

cygcheck.exe ./gdb.exe
.\gdb.exe
   C:\WINDOWS\system32\KERNEL32.dll
     C:\WINDOWS\system32\ntdll.dll
   C:\WINDOWS\system32\msvcrt.dll
   C:\WINDOWS\system32\USER32.dll
     C:\WINDOWS\system32\GDI32.dll
   C:\WINDOWS\system32\WS2_32.DLL
     C:\WINDOWS\system32\WS2HELP.dll
       C:\WINDOWS\system32\ADVAPI32.dll
         C:\WINDOWS\system32\RPCRT4.dll
           C:\WINDOWS\system32\Secur32.dll

build-gdb_mingw\gdb>gdb ./gdb.exe
GNU gdb 6.7.50-20071012-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32"...
Setting up the environment for debugging gdb.
During symbol reading, struct/union type gets multiply defined: struct type.
Breakpoint 1 at 0x40b513: file ../../gdb-server_submit/src/gdb/utils.c, line 817
.
Breakpoint 2 at 0x4185c6: file ../../gdb-server_submit/src/gdb/cli/cli-cmds.c, l
ine 199.
(top-gdb) start
Breakpoint 3 at 0x401309: file ../../gdb-server_submit/src/gdb/gdb.c, line 28.
Starting program: D:\cegccsf\cegcc\cegcc\src\build-gdb_mingw\gdb/./gdb.exe
warning: Can not parse XML library list; XML support was disabled at compile tim
e
main (argc=1, argv=0x3d24f0) at ../../gdb-server_submit/src/gdb/gdb.c:28
28        memset (&args, 0, sizeof args);

Cheers,
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw.diff
Type: text/x-diff
Size: 7187 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20071014/e0b74a46/attachment.bin>


More information about the Gdb mailing list