Files
eiffel-org/documentation/current/eiffelstudio/eiffelstudio-reference/debugger/execution-commands/attach-application.wiki
halw f74bf46fd7 Author:halw
Date:2012-10-03T14:35:11.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1196 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
2012-10-03 14:35:11 +00:00

24 lines
1.7 KiB
Plaintext

[[Property:title|Attach application]]
[[Property:link_title|]]
[[Property:weight|0]]
[[Property:uuid|e369df0f-2e1f-5730-ae67-cd7b60b55c5f]]
Usually when you want to debug an application, you launch it from EiffelStudio and the debugger is automatically attached to the execution of the application.
However for specific needs (such as server development), you might want to start the execution outside EiffelStudio, and then attach EiffelStudio's debugger to it.
Requirements:
* The application should be compiled in workbench mode.
* EiffelStudio should be open on the project which was used to compile the application.
How to make it work?
* On the application side, at some point you will need to provide a port number, and at that point the application will wait for the debugger.
To speciffy the port number you have two possibilities:
* setting the <code>ISE_DBG_PORTNUM</code> environment variable to a specific port number. When the environment variable is set, the application after starting will immediately put itself in a mode where it will wait for EiffelStudio to attach the process
* calling <eiffel>{RT_DEBUGGER}.rt_workbench_wait_for_debugger (a_port_number: INTEGER)</eiffel> from the program itself. In this case, the program will put itself in a mode where it will wait for EiffelStudio to attach the process when you call this routine.
To attach the process from EiffelStudio, follow the menu path <code>Execution->Attach Debuggee</code> and provide the same port number as specified above.
(Note that you can add the associated command to the execution tool bar.)
At this point EiffelStudio is able to debug the application just as if the application had been launched by EiffelStudio.