summaryrefslogtreecommitdiff
path: root/gdb/i386-linux-nat.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-03-28 08:35:14 +0000
committerMark Kettenis <kettenis@gnu.org>2001-03-28 08:35:14 +0000
commit507ad826183234077cd4c6884a9d7de32b409198 (patch)
tree3b75d656e875cf785313b6a082d3a65a3719ef49 /gdb/i386-linux-nat.c
parent03e6e928aab694d02d037fe24abf460be35f8dd9 (diff)
downloadgdb-507ad826183234077cd4c6884a9d7de32b409198.tar.gz
* i386-linux-nat.c (i386_linux_dr_get): Return 0 if ptrace call
fails instead of calling perror_with_name. This should fix debugging remote i386 targets with a native Linux/x86 GDB. Add FIXME for this hack.
Diffstat (limited to 'gdb/i386-linux-nat.c')
-rw-r--r--gdb/i386-linux-nat.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index aac92896343..66b0159e723 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -712,11 +712,20 @@ i386_linux_dr_get (int regnum)
one thread. */
tid = PIDGET (inferior_pid);
+ /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
+ ptrace call fails breaks debugging remote targets. The correct
+ way to fix this is to add the hardware breakpoint and watchpoint
+ stuff to the target vectore. For now, just return zero if the
+ ptrace call fails. */
errno = 0;
value = ptrace (PT_READ_U, tid,
offsetof (struct user, u_debugreg[regnum]), 0);
if (errno != 0)
+#if 0
perror_with_name ("Couldn't read debug register");
+#else
+ return 0;
+#endif
return value;
}