I'm trying to debug a program which takes on the command line a couple of arguments. Inside the main I print out the arguments as follows:
int main (int argc, char **argv)
{
for (int i = 0; i < argc; i++) {
printf("param%d=%s\n", i, argv[i]);
}
when I run my program without gdb, like this
"program img.jpg 1 2"
I get as output:
param0: program
param1: img.jpg
param2: 1
param3: 2
When I run it with gdb like this:
"program img.jpg 1 2"
I only get
param0: img.jpg
on one hand img.jpg
should be param1, also param2 and 3 are missing.
Is there a special way to specify command line params to gdb that I'm missing?