This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] Copy file to host if it is remote
- From: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- To: 'Yao Qi' <yao at codesourcery dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 22 Jul 2013 09:57:40 +0000
- Subject: RE: [PATCH] Copy file to host if it is remote
- References: <1374451994-5545-1-git-send-email-yao at codesourcery dot com> <0377C58828D86C4588AEEC42FC3B85A7176330EA at IRSMSX105 dot ger dot corp dot intel dot com> <51ECFEC0 dot 4020500 at codesourcery dot com>
> On 07/22/2013 05:05 PM, Agovic, Sanimir wrote:
> > mi_gdb_load should already trigger the download of binfile to the host,
>
> Hi Sanimir,
> mi_gdb_load has already handled the case to download binfile to the
> host, you are right. We don't have to re-download binfile in
> mi-var-cmd.exp, however, we still have to download file in
> mi-basics.exp, because mi_gdb_load is not used. See the comments in it:
>
Indeed, thus I quoted only your change in mi-var-cmd.exp =D
>
> I didn't see errors or fails due to this, because gdb is running
> cygwin?
>
At least I expect it to fail on Windows as the binary is locked by the OS.
> Anyway, the re-downloading is unnecessary, and thanks for
> pointing this out. In the updated patch, remote_download is only
> invoked in mi-basics.exp. In mi-var-cmd.exp, remote_download is not
> invoked. Is it OK to you?
>
lgtm. Unfortunately I cannot approve your patches.
-Sanimir
>
> --
> Yao (éå)
>
> gdb/testsuite:
>
> 2013-07-22 Yao Qi <yao@codesourcery.com>
>
> * gdb.mi/mi-var-cmd.exp: If host is remote, use ${testfile} on
> host.
> * gdb.mi/mi-basics.exp (test_exec_and_symbol_mi_operatons):
> Likewise. If host is remote, copy ${binfile} to host.
> ---
> gdb/testsuite/gdb.mi/mi-basics.exp | 15 +++++++++++----
> gdb/testsuite/gdb.mi/mi-var-cmd.exp | 8 +++++++-
> 2 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
> index c8bb3f7..f4ffa05 100644
> --- a/gdb/testsuite/gdb.mi/mi-basics.exp
> +++ b/gdb/testsuite/gdb.mi/mi-basics.exp
> @@ -71,13 +71,20 @@ proc test_mi_interpreter_selection {} {
>
> proc test_exec_and_symbol_mi_operatons {} {
> global mi_gdb_prompt
> - global binfile
> + global binfile testfile
> +
> + if [is_remote host] {
> + set filename ${testfile}
> + remote_download host ${binfile} ${filename}
> + } else {
> + set filename ${binfile}
> + }
>
> # Load symbols and specify executable on a single operation
> # Tests:
> # -file-exec-and-symbols
>
> - if [mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\\^done" \
> + if [mi_gdb_test "-file-exec-and-symbols ${filename}" "\\\^done" \
> "file-exec-and-symbols operation"] {
> note "Skipping all other MI tests."
> return 0
> @@ -98,11 +105,11 @@ proc test_exec_and_symbol_mi_operatons {} {
> # "\\\^done" \
> # "file-clear operation"
>
> - mi_gdb_test "-file-exec-file ${binfile}" \
> + mi_gdb_test "-file-exec-file ${filename}" \
> "\\\^done" \
> "file-exec-file operation"
>
> - mi_gdb_test "-file-symbol-file ${binfile}" \
> + mi_gdb_test "-file-symbol-file ${filename}" \
> "\\\^done" \
> "file-symbol-file operation"
>
> diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
> index 6addea6..731130d 100644
> --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
> +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
> @@ -558,7 +558,13 @@ mi_gdb_test "-var-update selected_a" \
>
> "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\"
> ,new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \
> "update selected_a in do_special_tests"
>
> -mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\^done" \
> +if [is_remote host] {
> + set filename ${testfile}
> +} else {
> + set filename ${binfile}
> +}
> +
> +mi_gdb_test "-file-exec-and-symbols ${filename}" "\\^done" \
> "floating varobj invalidation"
>
> mi_delete_varobj selected_a "delete selected_a"
> --
> 1.7.7.6
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052