Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Allow cancelled byte transfer in ptrace(2) again



details:   https://anonhg.NetBSD.org/src/rev/0c1d112f5c3e
branches:  trunk
changeset: 450981:0c1d112f5c3e
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu May 02 00:23:01 2019 +0000

description:
Allow cancelled byte transfer in ptrace(2) again

Current GDB depends on it on NetBSD (which is probably a GDB support bug).

In future GDB will be examined for this and this code revisited.

diffstat:

 sys/kern/sys_ptrace_common.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 20af7cd4ff36 -r 0c1d112f5c3e sys/kern/sys_ptrace_common.c
--- a/sys/kern/sys_ptrace_common.c      Wed May 01 23:44:16 2019 +0000
+++ b/sys/kern/sys_ptrace_common.c      Thu May 02 00:23:01 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_ptrace_common.c,v 1.51 2019/05/01 17:02:40 kamil Exp $     */
+/*     $NetBSD: sys_ptrace_common.c,v 1.52 2019/05/02 00:23:01 kamil Exp $     */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.51 2019/05/01 17:02:40 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.52 2019/05/02 00:23:01 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -1106,10 +1106,12 @@
                piod.piod_op = write ? PIOD_WRITE_D : PIOD_READ_D;
                if ((error = ptrace_doio(l, t, lt, &piod, addr, true)) != 0)
                        break;
+#if 0 // XXX: GDB depends on it
                if (piod.piod_len < sizeof(tmp)) {
                        error = EIO;
                        break;
                }
+#endif
                if (!write)
                        *retval = tmp;
                break;
@@ -1123,10 +1125,12 @@
                }
                if ((error = ptrace_doio(l, t, lt, &piod, addr, false)) != 0)
                        break;
+#if 0 // XXX: GDB depends on it
                if (piod.piod_len < 1) {
                        error = EIO;
                        break;
                }
+#endif
                error = ptm->ptm_copyout_piod(&piod, addr, data);
                break;
 



Home | Main Index | Thread Index | Old Index