aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-x86-64-low.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-11-02 19:54:44 +0000
committerDaniel Jacobowitz <drow@false.org>2005-11-02 19:54:44 +0000
commit011a70c2eabce3b9cecb285e975c1e8cba67ed8c (patch)
tree70a1459797932452542523dd97878721477edf2c /gdb/gdbserver/linux-x86-64-low.c
parenta92e0d0a05994802735c51f6eda8d922597b5c13 (diff)
downloadgdb-011a70c2eabce3b9cecb285e975c1e8cba67ed8c.zip
gdb-011a70c2eabce3b9cecb285e975c1e8cba67ed8c.tar.gz
gdb-011a70c2eabce3b9cecb285e975c1e8cba67ed8c.tar.bz2
* configure.srv (x86_64-*-linux*): Turn on thread_db support.
* linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len) (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New. (the_low_target): Update.
Diffstat (limited to 'gdb/gdbserver/linux-x86-64-low.c')
-rw-r--r--gdb/gdbserver/linux-x86-64-low.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c
index fa7440d..fdf5ee1 100644
--- a/gdb/gdbserver/linux-x86-64-low.c
+++ b/gdb/gdbserver/linux-x86-64-low.c
@@ -1,6 +1,6 @@
/* GNU/Linux/x86-64 specific low level interface, for the remote server
for GDB.
- Copyright 2002, 2004
+ Copyright 2002, 2004, 2005
Free Software Foundation, Inc.
This file is part of GDB.
@@ -129,9 +129,53 @@ struct regset_info target_regsets[] = {
{ 0, 0, -1, -1, NULL, NULL }
};
+static const unsigned char x86_64_breakpoint[] = { 0xCC };
+#define x86_64_breakpoint_len 1
+
+extern int debug_threads;
+
+static CORE_ADDR
+x86_64_get_pc ()
+{
+ unsigned long pc;
+
+ collect_register_by_name ("rip", &pc);
+
+ if (debug_threads)
+ fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc);
+ return pc;
+}
+
+static void
+x86_64_set_pc (CORE_ADDR newpc)
+{
+ if (debug_threads)
+ fprintf (stderr, "set pc to %08lx\n", (long) newpc);
+ supply_register_by_name ("rip", &newpc);
+}
+
+static int
+x86_64_breakpoint_at (CORE_ADDR pc)
+{
+ unsigned char c;
+
+ read_inferior_memory (pc, &c, 1);
+ if (c == 0xCC)
+ return 1;
+
+ return 0;
+}
+
struct linux_target_ops the_low_target = {
-1,
NULL,
NULL,
NULL,
+ x86_64_get_pc,
+ x86_64_set_pc,
+ x86_64_breakpoint,
+ x86_64_breakpoint_len,
+ NULL,
+ 1,
+ x86_64_breakpoint_at,
};