From: btuysser@qualcomm.com (Bijan Tuysserkani)
Subject: msvc dll / LoadLibrary and GDB
22 Jul 1997 19:25:31 -0700
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <3.0.1.32.19970722200602.009753e0.cygnus.gnu-win32@smtphost-co.qualcomm.com>
References: <9707221606.AA22398@hagar.aspentec.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: btuysser@smtphost-co.qualcomm.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Original-To: gnu-win32@cygnus.com
In-Reply-To: <Pine.A32.3.90.970722202640.29204A-100000@solid.ssd.ornl.go
 v>
Original-Sender: owner-gnu-win32@cygnus.com

Hi,

I try to implement a remote extension for GDB and use 
a DLL (produced with msvc) for the windows functionality.

These are my steps so far :

1.) I have foo.dll, foo.def
2.) build foo.a with dlltool --def foo.def --dllname foo.dll --output-lib
foo.a
3.) gcc -o test_prg test_prg.c foo.a

This compiles fine, but when I try to run it I get a memory reference error 
from windows NT. I ran it under GDB and Windows gives me that error when
the dll library gets implicitly loaded.

So I used an alternative :

1.) Use LoadLibrary to load the dll explicitly
2.) Use GetProcAddress to get function pointers to the dll-functions

That works fine for my test_prg.c, but if I include that in the remote-xxx.c 
of my GDB extension, GDB will work fine, execute the right functions correct
and hang up if you try to leave GDB. I do only have to use LoadLibrary to 
make GDB hang after typing 'quit'.

Does anybody have any comments or solutions to the stuff above?

Thanks in advance,
	Bijan
                                                          /\
                                                  .  /\  /  \
------------------------------------------------ / \/  \/    \
Bijan Tuysserkani                               /      /      \
Qualcomm Inc.                                                  \
5450 Western Ave.                             
Boulder, CO  80301                        (303) 473-6852 (voice)
btuysser@qualcomm.com                     (303) 473-6665 (fax)

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
