aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-11-21 09:11:44 +0000
committerMark Kettenis <kettenis@gnu.org>2005-11-21 09:11:44 +0000
commitb457b3dd73986fa2289adecf6ebd4a1a0545ab34 (patch)
treeb14ad13057c689e833bbeeb15c4fb25db7dd260e /gdb
parent5e1f64305e028cd9fd7c8b5befb9d11934845cb8 (diff)
downloadgdb-b457b3dd73986fa2289adecf6ebd4a1a0545ab34.zip
gdb-b457b3dd73986fa2289adecf6ebd4a1a0545ab34.tar.gz
gdb-b457b3dd73986fa2289adecf6ebd4a1a0545ab34.tar.bz2
* inf-ptrace.c (inf_ptrace_xfer_partial): Use PIOD_WRITE_I instead
of PIOD_WRITE_D.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/inf-ptrace.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3ef2cd9..1d0b6c7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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-19 Jim Blandy <jimb@redhat.com>
* tracepoint.c (memrange_absolute): New enum constant.
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index d12d1ad..f3c399e 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -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;