From: "\"Markus Bühren\"" <bhr2@gmx.de>
To: gdb@sourceware.org
Subject: Quotes after --args
Date: Fri, 08 Jun 2012 14:21:00 -0000 [thread overview]
Message-ID: <20120608142102.302310@gmx.net> (raw)
In-Reply-To: <1339164112.4081.ezmlm@sourceware.org>
Hi,
I am using the GNU gdb 6.8 under Windows. I am trying to run a program that is invoked like
test.exe -f "my testfile.txt"
in batch mode. This is my command line:
gdb --eval-command=run --batch --args test.exe -f "my testfile.txt"
My program should get two arguments, '-f' and 'my testfile.txt'. However, replacing my actual program test.exe by a program that just prints the input arguments, I get the following result:
C:\>gdb --eval-command=run --batch --args test.exe -f "my testfile.txt"
[New thread 6180.0xad0]
argv[0] = >>C:/test.exe<<
argv[1] = >>-f<<
argv[2] = >>my\<<
argv[3] = >>testfile.txt<<
Program exited normally.
Can you help me to avoid that the file name is splitted into two arguments, with replacing the blank ' ' after 'my' by a backslash '\'? I have tried a lot of combinations of double double quotes '""', escaped double quotes '\"' and so on but I did not manage to get the file name passed as a single argument into my program.
Yours
Markus
PS: Renaming the file is not an option - actually, I already simplified matters here to a file name with a blank in it.
PPS: For your reference, this is the C code of my simple program returning the arguments:
#include <stdio.h>
void main(int argc, char *argv[])
{
int k;
for(k = 0; k < argc; k++)
{
printf("argv[%d] = >>%s<<\n", k, argv[k]);
}
}
next parent reply other threads:[~2012-06-08 14:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1339164112.4081.ezmlm@sourceware.org>
2012-06-08 14:21 ` "Markus Bühren" [this message]
2012-06-08 14:50 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120608142102.302310@gmx.net \
--to=bhr2@gmx.de \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox