aboutsummaryrefslogtreecommitdiff
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
commitb9511b9a9a06835ac22efe5e37f54aec65f3219e (patch)
tree5993ad2fb2c6226c09abd7d8f07a74357c736097
parent30a1def20d43b665660f606caa2dbe1c0b88b8e3 (diff)
downloadgdb-b9511b9a9a06835ac22efe5e37f54aec65f3219e.zip
gdb-b9511b9a9a06835ac22efe5e37f54aec65f3219e.tar.gz
gdb-b9511b9a9a06835ac22efe5e37f54aec65f3219e.tar.bz2
* 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.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/i386-linux-nat.c9
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f23e5e3..e0e89ef 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2001-03-28 Mark Kettenis <kettenis@gnu.org>
+
+ * 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.
+
2001-03-19 J.T. Conklin <jtc@redback.com>
* arch-utils.c (#include "gdbthread.h"): Removed.
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index aac9289..66b0159 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;
}