summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2005-05-10 13:48:59 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2005-05-10 13:48:59 +0000
commitb0ded00b3ffade930e4617b01d5c8241e3f404da (patch)
tree18b4d0f8896f6f2f769a7f67ac3567afab5b880c
parent20d7ce9bf2a66377ddcacbf4a9bc8dd312b9f33d (diff)
downloadbinutils-gdb-b0ded00b3ffade930e4617b01d5c8241e3f404da.tar.gz
* linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
(s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions. (the_low_target): Add new members.
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/linux-s390-low.c44
2 files changed, 49 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index abb182adcfb..6c8fd3ae73d 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-10 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
+ (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
+ (the_low_target): Add new members.
+
2005-05-04 Daniel Jacobowitz <dan@codesourcery.com>
* proc-service.c (ps_lgetregs): Search all_processes instead of
diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c
index d1a94fb791b..724e092aa05 100644
--- a/gdb/gdbserver/linux-s390-low.c
+++ b/gdb/gdbserver/linux-s390-low.c
@@ -1,6 +1,6 @@
/* GNU/Linux S/390 specific low level interface, for the remote server
for GDB.
- Copyright 2001, 2002
+ Copyright 2001, 2002, 2005
Free Software Foundation, Inc.
This file is part of GDB.
@@ -75,9 +75,51 @@ s390_cannot_store_register (int regno)
return 0;
}
+
+static const char s390_breakpoint[] = { 0, 1 };
+#define s390_breakpoint_len 2
+
+static CORE_ADDR
+s390_get_pc ()
+{
+ unsigned long pc;
+ collect_register_by_name ("pswa", &pc);
+#ifndef __s390x__
+ pc &= 0x7fffffff;
+#endif
+ return pc;
+}
+
+static void
+s390_set_pc (CORE_ADDR newpc)
+{
+ unsigned long pc = newpc;
+#ifndef __s390x__
+ pc |= 0x80000000;
+#endif
+ supply_register_by_name ("pswa", &pc);
+}
+
+static int
+s390_breakpoint_at (CORE_ADDR pc)
+{
+ unsigned char c[s390_breakpoint_len];
+ read_inferior_memory (pc, c, s390_breakpoint_len);
+ return memcmp (c, s390_breakpoint, s390_breakpoint_len) == 0;
+}
+
+
struct linux_target_ops the_low_target = {
s390_num_regs,
s390_regmap,
s390_cannot_fetch_register,
s390_cannot_store_register,
+ s390_get_pc,
+ s390_set_pc,
+ s390_breakpoint,
+ s390_breakpoint_len,
+ NULL,
+ s390_breakpoint_len,
+ s390_breakpoint_at,
};
+