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

Problem Debugging With Command Arguments

Michael_Stramel
Beginner
785 Views
I'm running Composer XE 2011 in Visual Studio 2008 Pro. My application requires that an input file and output file be provided at run time.

The command line equivalent would be the following:

myprogram.exe < input_file > output_file

Under configuration properties -> debugging I've set the following items.

Command arguments:

< C:\\myworkindir\\input_file > C:\\myworkingdir\\output_file

Working directory:

C:\\myworkingdir

Here is where it seems to get strange. If I Start Debugging (F5), the application proceeds as if there are no command arguments, tries to write to the standard output instead of my redirected ouput_file, and burps when it gets to the point in the code where it should be reading from the input_file.

However, if I Start Without Debugging (Ctrl+F5), I have no such issues and the application runs successfully. Fortunately for me the portion of the code that I am debugging comes after a large database read that takes about a minute. Therefore I'm able to attach the debugger to the process before it reaches the code that I need to debug. With a pre-set breakpoint after the database read I'm able to go on my merry way debugging my code.

However, this is obviously not the optimal solution. Any ideas why my command arguments seem to be missed when I Start Debugging?

Thank you.



0 Kudos
1 Reply
Steven_L_Intel1
Employee
785 Views
I can reproduce this. VS2008 is inexplicably ignoring the redirect in debug mode. VS2010 handles this correctly. I know that earlier versions of VS had various problems with redirection specified in command arguments, but thought they were resolved by VS2008. Apparently not....

http://connect.microsoft.com/VisualStudio/feedback/details/333493/cant-redirect-stdin-stdout-for-debugging
0 Kudos
Reply