Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Arguments for Run vs Debug(Run and Debug perform differently despite same configuration)
Arguments for Run vs Debug [message #743280] Fri, 21 October 2011 09:53 Go to next message
Dimitri Drapkin is currently offline Dimitri DrapkinFriend
Messages: 6
Registered: October 2011
Junior Member
Hallo everybody!

Previously I worked with text editors (vi) for C-Programming under Linux, but now think the time has come to use something more intuitive Smile

I managed to import my code to Eclipse CDT, I can compile and debug everything (that's the nice part Smile.

My program needs some arguments which are normally read from a file, so a call from the terminal looks like user@pc:~/workingdirectory/myprog < paramfile

So I created a debug configuration specifying the working directory and "<paramfile" (without quotes) in the arguments tab. If I click debug, everything works fine.

If I click run with the same configuration no arguements are read from the file, so I have to enter everything manually. I have searched everywhere but seem to be the only one with such a problem.

Maybe somebody has a hint for me? It would help me a lot!

Thank U in advance.
Dimitri


Re: Arguments for Run vs Debug [message #743423 is a reply to message #743280] Fri, 21 October 2011 13:11 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
The Run launch uses a slightly different coding path that the Debug launch.
There may be a bug in the Run path when it comes to <paramfile (I'm not sure this was every tried before).
You may want to write a bugzilla on it.

Marc
Re: Arguments for Run vs Debug [message #743608 is a reply to message #743423] Fri, 21 October 2011 15:59 Go to previous messageGo to next message
Dimitri Drapkin is currently offline Dimitri DrapkinFriend
Messages: 6
Registered: October 2011
Junior Member
Thank You for a quick reply! I do not quite understand what the coding path should be - I specify the complete path to paramfile in the "working directory". I would like to understand what actually happens when I click "Run" or "Debug".

I would expect Eclipse to do
" cd workingdirectory
~/binarypath/binary arguments", however it does not seem to happen. Is it possible to view the command lines Eclipse executes, when Run is pressed? In the Console window I see only the output of my program.

In the program I have
printf("Enter specification file name: ");
fscanf(stdin,"%s", fname);

In "Run" I see just this line "Enter specification file name: " in the console window. I can enter the name, then it will proceed until the next prompt. In Debug the file is read and everything goes through. Hmm...
Re: Arguments for Run vs Debug [message #743727 is a reply to message #743608] Fri, 21 October 2011 17:42 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Sorry, I wasn't clear. When you Run and when you Debug, does not run the same piece of Eclipse code, so it is quite possible that they behave differently.

> Is it possible to view the command lines Eclipse executes, when Run is pressed

I don't know of a way.

I tried and I can reproduce your problem.
I think opening a bug is the right thing.

Marc
Re: Arguments for Run vs Debug [message #744725 is a reply to message #743727] Sat, 22 October 2011 09:41 Go to previous messageGo to next message
Yevgeny Shifrin is currently offline Yevgeny ShifrinFriend
Messages: 208
Registered: July 2009
Senior Member
You can use the following link to open a bug regarding this issue: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT&format=guided
Re: Arguments for Run vs Debug [message #746354 is a reply to message #744725] Sun, 23 October 2011 11:21 Go to previous message
Dimitri Drapkin is currently offline Dimitri DrapkinFriend
Messages: 6
Registered: October 2011
Junior Member
Hm, I am really puzzled. With an Eclipse experience of three days I do not really feel comfortable opening a bug. However, even this simple program reproduces the problem:

#include <stdio.h>
#include <stdlib.h>

int main(void) {
char text[100];

printf("Enter some text: ");
fscanf(stdin,"%s", text);
printf("\n %s \n",text);
return EXIT_SUCCESS;
}

Maybe you guys could try it out as well, when entering the text not from the console but from some file with argument <textfile in Run configuration.
In bugzilla I have to specify a CDT component. Which one should it be?

The bug is so basic, I can hardly believe nobody noticed it before. I tried different version of Eclipse - always there...
Previous Topic:gdb help
Next Topic:defining an external toolchain
Goto Forum:
  


Current Time: Sat Apr 27 04:45:57 GMT 2024

Powered by FUDForum. Page generated in 0.03442 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top