Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29594 Discussions

Two Dev Studio projects connected by CALL SYSTEM

Robinson__Donald
Beginner
1,859 Views
I use CVF 6.6c. I have two projects A and B; eachcreates aconsole programa.exe or b.exe. Within A, this line:
call system ("b.exe")
occurs. Is it possible to set up Dev Studio so that when this line is executed while running/debugging project A, control passes to the 2nd instance of Dev Studio running project B, and then back to A when B is done? If so, examples or references would be very welcome.
Thanks,
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
1,859 Views

I don't know of a seamless way. One method I can think of is to insert:

use DFWIN

!DEC$IF DEFINED(DEBUG)
CALL DebugBreak()
!DEC$ENDIF

as the first statement of program B. When process B is started, DebugBreak will raise a debugging exception and you will be prompted by Windows to start another instance of debugger (probably Visual Studio). Then, you can proceed as if it were a breakpoint, but you will (probably) have to work with two instances of Visual Studio.

Also, as these are two distinct processes, you won't be able to "regain control" when B is done. However, if you're debugging A, you can simply insert a breakpoint after call to system.

Jugoslav

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,859 Views

P.S. I inserted "DEC$IF DEFINED" lines with the idea that you certainly don't want this to happen in production (Release) version. If you type "DEBUG" in Project/Settings/Fortran/Predefined preprocessor symbols for "Win32 Debug configuration", symbol "DEBUG" will be defined -- and thus DebugBreak executed -- only for Debug configuration; Release will not be affected.

Jugoslav

0 Kudos
Steven_L_Intel1
Employee
1,859 Views
It's not clear to me what you want to do, but you can run DEVENV.EXE to start the second instance of Developer Studio - you can pass it the path to the .dsw file of the workspace if you want. Then you can start execution of the second program and have it stop in the debugger.
0 Kudos
Robinson__Donald
Beginner
1,859 Views

Thanks -

I'll try that: it sounds like it has possibilities. I had already been using an approach similar to the one proposed by Jugoslav.

0 Kudos
Reply