public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] Unbreak DJGPP port of GDB
Date: Sun, 24 May 2015 15:19:00 -0000	[thread overview]
Message-ID: <83zj4uypea.fsf@gnu.org> (raw)

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;
 }
 

             reply	other threads:[~2015-05-24 15:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-24 15:19 Eli Zaretskii [this message]
2015-05-28  8:47 ` Yao Qi
2015-05-28 14:42   ` Eli Zaretskii
2015-05-30 10:11     ` Eli Zaretskii
2015-06-03 22:01       ` Joel Brobecker
2015-06-04  2:41         ` Eli Zaretskii
2015-06-04  4:08           ` Joel Brobecker
2015-06-04 14:57             ` Eli Zaretskii
2015-06-09 18:36               ` Joel Brobecker
2015-06-09 18:50                 ` Eli Zaretskii
2015-06-09 18:56                   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zj4uypea.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).