public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Unbreak DJGPP port of GDB
@ 2015-05-24 15:19 Eli Zaretskii
  2015-05-28  8:47 ` Yao Qi
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2015-05-24 15:19 UTC (permalink / raw)
  To: gdb-patches

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-09 18:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 15:19 [PATCH] Unbreak DJGPP port of GDB Eli Zaretskii
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

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).