]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* inf-ptrace.c (inf_ptrace_xfer_partial): Use PIOD_WRITE_I instead
authorMark Kettenis <kettenis@gnu.org>
Mon, 21 Nov 2005 09:16:07 +0000 (09:16 +0000)
committerMark Kettenis <kettenis@gnu.org>
Mon, 21 Nov 2005 09:16:07 +0000 (09:16 +0000)
of PIOD_WRITE_D.

gdb/ChangeLog
gdb/inf-ptrace.c

index 1896536bbad452233aece046c1f5c95be710847c..d3c9cacba0516441cdd4598bd36c4104228262c7 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-20  Mark Kettenis  <kettenis@gnu.org>
+
+       * inf-ptrace.c (inf_ptrace_xfer_partial): Use PIOD_WRITE_I instead
+       of PIOD_WRITE_D.
+
 2005-11-18  Andrew Stubbs  <andrew.stubbs@st.com>
 
        * mi/mi-main.c (mi_load_progress): Ensure the use of the correct mi
index d12d1ad321433092e752c865eba75532ef7175e7..f3c399ea30981489f021aa9d09e2f286f53841f7 100644 (file)
@@ -462,8 +462,12 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
        struct ptrace_io_desc piod;
 
        /* NOTE: We assume that there are no distinct address spaces
-          for instruction and data.  */
-       piod.piod_op = writebuf ? PIOD_WRITE_D : PIOD_READ_D;
+          for instruction and data.  However, on OpenBSD 3.9 and
+          later, PIOD_WRITE_D doesn't allow changing memory that's
+          mapped read-only.  Since most code segments will be
+          read-only, using PIOD_WRITE_D will prevent us from
+          inserting breakpoints, so we use PIOD_WRITE_I instead.  */
+       piod.piod_op = writebuf ? PIOD_WRITE_I : PIOD_READ_D;
        piod.piod_addr = writebuf ? (void *) writebuf : readbuf;
        piod.piod_offs = (void *) (long) offset;
        piod.piod_len = len;