Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I attach the Delphi debugger to 64-bit IIS 7.5?

I'm running Delphi XE on Windows 7 Pro 64 and IIS 7.5, developing an ISAPI application. IIS is configured correctly (including allowing 32-bit code to run in an ISAPI process). The ISAPI process runs properly.

In Delphi I'm trying to attach to the ISAPI process running on localHost to step through my ISAPI.dll code: Run->Attach to Process->InetInfo.exe.

I've done this a thousand times with Windows XP and IIS 5, but in this new environment I cannot attach to the ISAPI process. I get an error message in the IDE when attempting to attach:

Unable to create process - the request is not supported

This is costing me lots of time — I have to pump out debug strings for every line of code, run the app, and then look at my debug strings, etc.

Why can't I attach to the ISAPI process? Is this is an IIS 7.5 configuration issue? Perhaps related to 32/64-bit problems because IIS is native 64-bit and Delphi debugger is 32-bit?

like image 296
Vector Avatar asked May 05 '11 14:05

Vector


5 Answers

Learn it here, http://blogs.msdn.com/b/david.wang/archive/2006/06/21/isapi-filter-and-the-iis6-process-model.aspx

To make it clear, in iis worker process isolation mode, w3wp.exe is the process that loads your isapi filters, so you should attach to it instead of inetinfo.exe.

like image 100
Lex Li Avatar answered Nov 19 '22 12:11

Lex Li


You might wanna check this out: http://www.embarcadero.com/products/delphi/64-bit

like image 28
Olaf Monien Avatar answered Nov 19 '22 13:11

Olaf Monien


If IIS 64bit is using an ISAPI.DLL which is a 32-bit module, it must be using an 32bit loader process. You could use ProcessExplorer to find which process is loading your ISAPI.DLL and attach Delphi to that process.

like image 2
Fabricio Araujo Avatar answered Nov 19 '22 13:11

Fabricio Araujo


You can debug your 32 bit ISAPI dll on a x64 bit machine by setting the "Enable 32 bit application" to true in the advanced app pool settings in IIS 7.5.

In Delphi you specify the "C:\Windows\System32\inetsrv\w3wp.exe" as the host application with the params "-debug". Start the Delphi IDE as admin and off you go. If you need more control over how w3wp is started you figure out available options using the command C:\Windows\System32\inetsrv\w3wp.exe -?

Hope this helps!

like image 2
Johan Sundström Avatar answered Nov 19 '22 12:11

Johan Sundström


You can debug your Delphi ISAPI Web Application under IIS 7.5 with the following tool http://www.eggcentric.com/ISAPIDebug.htm. (You will need to set up the ISAPIFwd.ini file)

like image 1
Paul Klink Avatar answered Nov 19 '22 13:11

Paul Klink