From: Tom Tromey <tromey@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb_init argument ARGS is a string rather than a list
Date: Thu, 15 May 2014 18:17:00 -0000 [thread overview]
Message-ID: <87fvkaaoup.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1399626515-29231-1-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Fri, 9 May 2014 17:08:35 +0800")
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> but GDB thinks it is a list. In default_gdb_init (callee of gdb_init),
Yao> set gdb_test_file_name [file rootname [file tail [lindex $args 0]]]
Yao> Fortunately, simple strings are also lists in tcl, so "[lindex $args 0]"
Yao> is equivalent to "$args" if args is a string.
The "args" parameter is special in Tcl. It signals a "rest" parameter
and so causes a single argument to be list-ified by the interpreter:
% proc l {args} { return [llength $args] }
% l {a b c}
1
% proc r {a} { return [llength $a] }
% r {a b c}
3
So while the current code is a bit odd, I think it is also
correct-enough.
Yao> - return [eval default_gdb_init $args]
Yao> + return [eval default_gdb_init $test_file_name]
If you want to proceed with this you will need to remove the "eval"
here.
Tom
next prev parent reply other threads:[~2014-05-15 18:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 9:11 Yao Qi
2014-05-15 18:17 ` Tom Tromey [this message]
2014-05-19 3:40 ` Yao Qi
2014-05-19 13:59 ` Tom Tromey
2014-05-20 6:09 ` Yao Qi
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=87fvkaaoup.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/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