beta18: building gdb gives incomplete import table [and other problems]???

Steven Reddie SReddie@cybec.com.au
Mon Dec 29 15:44:00 GMT 1997


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@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list