Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ulrich Weigand <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: uweigand@de.ibm.com (Ulrich Weigand),
	mark.kettenis@xs4all.nl (Mark Kettenis),
	manjo@austin.ibm.com, gdb-patches@sources.redhat.com,
	jjohnstn@redhat.com (Jeff Johnston),
	davidm@hpl.hp.com (David Mosberger)
Subject: [committed] s390 watchpoints (Re: [RFC/RFA] Target vectors for native Linux targets)
Date: Sun, 11 Sep 2005 22:02:00 -0000	[thread overview]
Message-ID: <200509112201.j8BM1aZs016764@53v30g15.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20050910181140.GA4484@nevyn.them.org> from "Daniel Jacobowitz" at Sep 10, 2005 02:11:40 PM

Daniel Jacobowitz wrote:

> Here's what I'm checking in, in the interests of progress.  I'll be
> glad to help with any problems it causes, including the ia64 corefile
> issue.

Thanks, Dan!

This implements the s390 watchpoint bits.  I've also removed KERNEL_U_SIZE
-which is no longer used anywhere- and PTRACE_ARG3_TYPE and PTRACE_XFER_TYPE
-which are picked up by autoconf tests- from config/s390/nm-linux.h, making
that file empty except for the FETCH_INFERIOR_REGISTERS define.

Tested on s390-ibm-linux and s390x-ibm-linux, applied to mainline.

Bye,
Ulrich

ChangeLog:

	* config/s390/nm-linux.h (KERNEL_U_SIZE): Remove.
	(PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Likewise.
	(s390_stopped_by_watchpoint, s390_insert_watchpoint,
	s390_remove_watchpoint, TARGET_CAN_USE_HARDWARE_WATCHPOINT,
	TARGET_REGION_OK_FOR_HW_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT,
	STOPPED_BY_WATCHPOINT, target_insert_watchpoint,
	target_remove_watchpoint): Likewise.
	* s390-nat.c: Remove include of <sys/user.h>.
	(kernel_u_size): Remove.
	(s390_stopped_by_watchpoint): Make static.
	(s390_insert_watchpoint, s390_remove_watchpoint): Likewise.
	(s390_can_use_hw_breakpoint): New function.
	(s390_region_size_ok_for_hw_watchpoint): Likewise.
	(_initialize_s390_nat): Add watchpoint methods to target.

diff -ur gdb-head/gdb.orig/config/s390/nm-linux.h gdb-head/gdb/config/s390/nm-linux.h
--- gdb-head/gdb.orig/config/s390/nm-linux.h	2004-09-13 16:06:04.000000000 +0200
+++ gdb-head/gdb/config/s390/nm-linux.h	2005-09-06 16:38:51.000000000 +0200
@@ -30,33 +30,7 @@
 
 /* ptrace access.  */
 
-#define PTRACE_ARG3_TYPE long
-#define PTRACE_XFER_TYPE long
-
 #define FETCH_INFERIOR_REGISTERS
 
-#define KERNEL_U_SIZE kernel_u_size()
-extern int kernel_u_size (void);
-
-
-/* Hardware watchpoints.  */
-
-extern int s390_stopped_by_watchpoint (void);
-extern int s390_insert_watchpoint (CORE_ADDR addr, int len);
-extern int s390_remove_watchpoint (CORE_ADDR addr, int len);
-
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
-#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr, len) 1
-#define HAVE_CONTINUABLE_WATCHPOINT 1
-
-#define STOPPED_BY_WATCHPOINT(w) \
-  s390_stopped_by_watchpoint ()
-
-#define target_insert_watchpoint(addr, len, type) \
-  s390_insert_watchpoint (addr, len)
-
-#define target_remove_watchpoint(addr, len, type) \
-  s390_remove_watchpoint (addr, len)
-
 
 #endif /* nm_linux.h */
diff -ur gdb-head/gdb.orig/s390-nat.c gdb-head/gdb/s390-nat.c
--- gdb-head/gdb.orig/s390-nat.c	2005-09-05 19:05:27.000000000 +0200
+++ gdb-head/gdb/s390-nat.c	2005-09-06 16:39:45.000000000 +0200
@@ -34,7 +34,6 @@
 #include <sys/ptrace.h>
 #include <asm/types.h>
 #include <sys/procfs.h>
-#include <sys/user.h>
 #include <sys/ucontext.h>
 
 
@@ -250,7 +249,7 @@
 
 static struct watch_area *watch_base = NULL;
 
-int
+static int
 s390_stopped_by_watchpoint (void)
 {
   per_lowcore_bits per_lowcore;
@@ -310,7 +309,7 @@
     perror_with_name (_("Couldn't modify watchpoint status"));
 }
 
-int
+static int
 s390_insert_watchpoint (CORE_ADDR addr, int len)
 {
   struct watch_area *area = xmalloc (sizeof (struct watch_area));
@@ -327,7 +326,7 @@
   return 0;
 }
 
-int
+static int
 s390_remove_watchpoint (CORE_ADDR addr, int len)
 {
   struct watch_area *area, **parea;
@@ -352,13 +351,19 @@
   return 0;
 }
 
+static int
+s390_can_use_hw_breakpoint (int type, int cnt, int othertype)
+{
+  return 1;
+}
 
-int
-kernel_u_size (void)
+static int
+s390_region_size_ok_for_hw_watchpoint (int cnt)
 {
-  return sizeof (struct user);
+  return 1;
 }
 
+
 void _initialize_s390_nat (void);
 
 void
@@ -373,6 +378,14 @@
   t->to_fetch_registers = s390_linux_fetch_inferior_registers;
   t->to_store_registers = s390_linux_store_inferior_registers;
 
+  /* Add our watchpoint methods.  */
+  t->to_can_use_hw_breakpoint = s390_can_use_hw_breakpoint;
+  t->to_region_size_ok_for_hw_watchpoint = s390_region_size_ok_for_hw_watchpoint;
+  t->to_have_continuable_watchpoint = 1;
+  t->to_stopped_by_watchpoint = s390_stopped_by_watchpoint;
+  t->to_insert_watchpoint = s390_insert_watchpoint;
+  t->to_remove_watchpoint = s390_remove_watchpoint;
+
   /* Register the target.  */
   add_target (t);
 }

-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2005-09-11 22:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-17 18:30 [RFC] GDB patches for hw watchpoints Manoj Iyer
2005-08-17 18:46 ` Eli Zaretskii
2005-08-17 23:03 ` Mark Kettenis
2005-08-19  0:53   ` [RFC/RFA] Target vectors for native Linux targets Ulrich Weigand
2005-08-21 10:48     ` Mark Kettenis
2005-08-21 15:21       ` Ulrich Weigand
2005-08-21 15:53         ` Mark Kettenis
2005-09-04 15:48           ` Daniel Jacobowitz
2005-09-04 22:48     ` Daniel Jacobowitz
2005-09-05 17:32       ` Ulrich Weigand
2005-09-10 18:13         ` Daniel Jacobowitz
2005-09-11 22:02           ` Ulrich Weigand [this message]
2005-09-11 23:09             ` [committed] s390 watchpoints (Re: [RFC/RFA] Target vectors for native Linux targets) Daniel Jacobowitz
2005-09-18  1:20 ` [RFC] GDB patches for hw watchpoints Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200509112201.j8BM1aZs016764@53v30g15.boeblingen.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=davidm@hpl.hp.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@redhat.com \
    --cc=manjo@austin.ibm.com \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox