From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114486 invoked by alias); 8 Mar 2015 07:18:28 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 114448 invoked by uid 48); 8 Mar 2015 07:18:24 -0000 From: "rjshaw at netspace dot net.au" To: gdb-prs@sourceware.org Subject: [Bug gdb/18090] New: Binary is truncated to zero size when testing gdbserver and gdb in same directory on same pc Date: Sun, 08 Mar 2015 12:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.9 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rjshaw at netspace dot net.au X-Bugzilla-Status: NEW 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00396.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18090 Bug ID: 18090 Summary: Binary is truncated to zero size when testing gdbserver and gdb in same directory on same pc Product: gdb Version: 7.9 Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: rjshaw at netspace dot net.au Hi, I started in /home/russell/myprogdir/ gdbserver main:1234 myprog then i do in gdb: (gdb) target extended-remote main:1234 Remote debugging using main:1234 (gdb) cd /home/russell/myprogdir Working directory /home/russell/myprogdir. (gdb) file myprog Reading symbols from myprog...done. (gdb) remote put myprog myprog Successfully sent file "myprog". When testing with gdbserver invoked on the same pc (main) in the same directory (/home/russell/myprogdir), "myprog" is truncated to 0 bytes by "remote put myprog myprog". "remote put" should first copy myprog to /tmp, open the remote myprog for writing (which truncates it), then copy from /tmp. Another way is to note the source and dest are the same, and skip the copying. -- You are receiving this mail because: You are on the CC list for the bug.