I am trying to pass arguments to main function while calling the program to execute through the debugger but it does not work. The debugger has automatically enabled me semihosting on my target (in ELF) but I cannot pass any arguments in main().
My test program is something like :
int main(int argc, char *argv[]) {
printf("%d\n",argc); return 0;
}
so I want to print the number of arguments that passed. I call the debugger using a script file and inside that script I have load the .axf file and set the parameters like:
set semihosting args "Hello" "World"cd "path-to-Workspace"
set debug-from mainrun "Hello" "World"
The debugger keeps answering me [target] 0
So what an i doing wrong? There is not much information for that in the internet and I cannot find any relevant information about it.