This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use gdb_produce_source
- From: Tom Tromey <tromey at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 06 Dec 2013 12:19:15 -0700
- Subject: Re: [PATCH] Use gdb_produce_source
- Authentication-results: sourceware.org; auth=none
- References: <1385620331-32650-1-git-send-email-yao at codesourcery dot com>
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> 2013-11-28 Yao Qi <yao@codesourcery.com>
Yao> * lib/gdb.exp (support_complex_tests): Use gdb_produce_source.
Yao> (is_elf_target, is_ilp32_target, is_ilp64_target): Likewise.
Yao> (is_64_target, is_amd64_regs_target): Likewise.
Yao> (skip_altivec_tests, skip_vsx_tests, skip_btrace_tests): Likewise.
Ok.
Yao> - set f [open $src "w"]
Yao> - puts $f "int main() {"
Yao> - puts $f "_Complex float cf;"
Yao> - puts $f "_Complex double cd;"
Yao> - puts $f "_Complex long double cld;"
Yao> - puts $f " return 0; }"
Yao> - close $f
Yao> + set list {
Yao> + "int main() {"
Yao> + "_Complex float cf;"
Yao> + "_Complex double cd;"
Yao> + "_Complex long double cld;"
Yao> + " return 0; }"
Yao> + }
Yao> + gdb_produce_source $src [join $list \n]
There's a more idiomatic approach, which is to just take advantage of
Tcl's string-based nature. That is:
gdb_produce_source $src {
int main() {
_Complex float cf;
...
}
}
Tom