From: SReddie AT cybec DOT com DOT au (Steven Reddie) Subject: Re: beta18: building gdb gives incomplete import table [and other problems]??? 29 Dec 1997 18:36:42 -0800 Message-ID: <34A82DA4.742F3EDD.cygnus.gnu-win32@cybec.com.au> References: <34A7414B DOT F9935C9E AT cybec DOT com DOT au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: gnu-win32 AT cygnus DOT com Further to yesterdays post, I have succeeded in getting gdb to compile and run but I am still confused about what's going on. The linker still seems faulty. The full steps are below. Note that this is using the "normal" 4.16 distribution of the gdb source. I first do a standard ./configure. To get it to compile, I had to add "-D_MSC_VER -D__WIN32__ -DWIN32" to CFLAGS in Makefile. I also had to add four empty functions (I'll worry about their contents later) to gdb/win32-nat.c -- I think these were: void unix_to_dos_path( char*, char* ); void dos_to_unix_path( char*, char* ); void cygwin32_unix_to_dos_path_keep_rel( char*, char* ); void cygwin32_dos_to_unix_path_keep_rel( char*, char* ); This would successfully compile but crash immediately when executed. The crash was on the call to GetModuleHandle() which is called from cygwin_crt0. To fix this crash, I removed the -lkernel32 from the gdb/Makefile and re-linked. It appears that the -lkernel32 somehow looses the import table from libcygwin32.a. Next, it crashes in ScreenRows() and ScreenCols(). I replaced the calls to these functions in readline/readline.c and gdb/utils.c with 24 and 80 respectively. I haven't yet fully investigated what the cause of this is. After recompiling these files and re-linking, it works great. I hard-coded unix_to_dos_path() to return "F:\gdb-4.16\gdb\test.exe" and it actually runs my test program correctly. I'm guessing that the linker is somehow screwing up the construction of the import table. Maybe the calls to these functions are in .a files that when linked-in don't bring their import declarations with them. If this has been fixed in a patch or someone knows of a work-around I would very much appreciate to hear about it. Additional info for bug report: Unpatched cygwin32 beta 18 distribution. Running under NT 4.0. Building gdb 4.16 with "./configure". Regards, Steven Reddie - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".