Debug argument file location when running AppTRK on the target and CodeWarroir on a linux host. Can not find file.

cancel
Showing results for 
Search instead for 
Did you mean: 

Debug argument file location when running AppTRK on the target and CodeWarroir on a linux host. Can not find file.

218 Views
brianlarsen
Contributor I

Hello,

I am running my application on the P2020DS while running Linux on the target and running CodeWarroirs 10.4 on Debian 7.5 on the host.

I am unable to get my application to locate the argument files that I am trying to pass into my application. I have the argument files located in my CodeWarrior Linux Project on the host and on target in the location /usr/local/bin and it still can not find them. I feel like this should be listed somewhere in your documentation, but I am unable to find it....

Thanks,

Brian

Labels (1)
0 Kudos
4 Replies

85 Views
catalindemergia
Contributor IV

Hi,

If you want to pass arguments you have two options

- add them one by one in the Arguments tab from the Debug Configurations window

- add just one argument that represents a path and then in your main.c do a fopen from that path

  and parse your arguments

regards,

Catalin

0 Kudos

85 Views
brianlarsen
Contributor I

I am able to pass arguments just fine. The issue is the software does not
know where to find the file, Does it need to be local on the host or the target
in the linux file system (/usr/local/bin) where the executable gets copied and
AppTRK runs it?

 

Neither one seems to work. I have the file in my project directory in CodeWarrior, and I put a copy of it
in /usr/local/bin on the target.

 

This application does run on the host locally just fine and it can find all
the files I am trying to read. It also runs just fine when I am running on the
target without CodeWarrior or the AppTRK running. Any ideas why it might not be
able to find it or where the file needs to be copied?

0 Kudos

85 Views
catalindemergia
Contributor IV

Hi,

Code Warrior does not support the passing of the arguments from a file when debugging an application.

If what you are trying to do is pass the arguments (argc, argv) from a file instead of listing them in the Arguments tab,

there is no local file you can use to do that from Code Warrior.

I was suggesting to pass the name of that file (that contains arguments) , lets's say "file.args" to the app, that the main()

function will receive fine as you sad, and then do a fopen("./file.args"). provided that file.args exists on the target in the same

directory where your app is, it can read the arguments from the file.

regards,

Catalin

0 Kudos

85 Views
brianlarsen
Contributor I


I was trying to read a file, and pass the path to a file to read. the file has to be located in /home/root on the target. not in the same directory as the application on the host or the tartget.

Thanks for the help.

0 Kudos