From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CCFF03858C74; Mon, 20 Mar 2023 12:21:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCFF03858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679314894; bh=w2MGSOKAfgO5fempn/guJdIcKx1F8aj4J7HWbFZKDoo=; h=From:To:Subject:Date:From; b=BaZ9mK92fEuoOOD0FmIpMqQteDy6YVJZVaTlX+zUcMlOezy4W9hKMizbT0v4dQaje TOmPSMvwBaNIM8J2C9cPaeTfSRjoUgO3F6/2VmyWufWOQewJ5W/oYznKr3VeEWptHA d6SebMS3S2XI2XPRCQhKEI7gfb/6+cVX3fJXPNsA= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/30250] New: [gdb/testsuite] remotedir review Date: Mon, 20 Mar 2023 12:21:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30250 Bug ID: 30250 Summary: [gdb/testsuite] remotedir review Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: testsuite Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Board variable remotedir is documented as intended for remote target: ... name example description remotedir /tmp/runtest.[pid] Directory on the remote target in which executables are downloaded and executed ... I didn't spot anything target-specific though in the implementation, so I wonder if it can also be used for remote host. Anyway, first looking at the implementation: .... if { [board_info $dest exists remotedir] } { set remotedir [board_info $dest remotedir] set status [remote_exec $dest mkdir "-p $remotedir"] if { [lindex $status 0] !=3D 0 } { perror "Couldn't create remote directory $remotedir on $dest" return "" } set destfile $remotedir/$destfile } ... it looks odd to me to hardcode "/" as path separator, but perhaps that's considered ok because it's not enabled by default. I see something similar= for nfsdir. Then, the implementation doesn't look complete. That is, remote_exec and remote_download both take remotedir into account, = but not remote_upload. So, say we have remotedir=3D/tmp, and we have an exec ./a.out on build/host= , and=20 the exec generates ./bla.txt. A remote_download of a.out to target gives us /tmp/a.out. Doing a remote_exec of /tmp/a.out gives us /tmp/bla.txt. Then doing a remote_upload from host of ./bla.txt doesn't work, we need to = use ./tmp/bla.txt. I don't see any reason why remote_upload cannot do the same as remote_downl= oad. Finally, target_compile uses this style remote_upload for host, so if we wa= nt remote host to work with remotedir, we need to fix this. I'd start out with a local override of remote_upload, then try to upstream = the change. --=20 You are receiving this mail because: You are on the CC list for the bug.=