From patchwork Sun May 24 15:19:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 6904 Received: (qmail 34241 invoked by alias); 24 May 2015 15:19:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 34229 invoked by uid 89); 24 May 2015 15:19:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout21.012.net.il Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 May 2015 15:19:22 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NOV004000UX5X00@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Sun, 24 May 2015 18:19:19 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOV004QZ1864R30@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Sun, 24 May 2015 18:19:19 +0300 (IDT) Date: Sun, 24 May 2015 18:19:09 +0300 From: Eli Zaretskii Subject: [PATCH] Unbreak DJGPP port of GDB To: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83zj4uypea.fsf@gnu.org> X-IsSubscribed: yes It turns out the DJGPP (a.k.a. "go32") port of GDB was broken more than a year ago, by commits 9b40951 and bd265cd. It stayed broken ever since. Lately, Andris Pavenis bisected the bug and posted the results here: http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp/2015/05/24/04:17:40 Looking into those changesets, I've found that the problem was due to incorrect handling of values returned by functions 'read_child' and 'write_child', which are part of the DJGPP native debug support. The patch below fixes that. I will push it in a few days (with an appropriate ChangeLog entry), if no one objects. Thanks. diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index f3966cd..4f5c2d2 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -587,10 +587,12 @@ else res = read_child (memaddr, readbuf, len); - if (res <= 0) + /* read_child and write_child return zero on success, non-zero on + failure. */ + if (res != 0) return TARGET_XFER_E_IO; - *xfered_len = res; + *xfered_len = len; return TARGET_XFER_OK; }