* exec.c (xfer_memory): Add attrib argument.
[deliverable/binutils-gdb.git] / gdb / target.h
index 5c651496f749df6e7d4361404d58fba213ca7220..d007bbab4786dfe3eaf4a1a4d5785de2d98f0107 100644 (file)
@@ -1,5 +1,5 @@
 /* Interface between GDB and target environments, including files and processes
-   Copyright 1990-1994, 1999, 2000 Free Software Foundation, Inc.
+   Copyright 1990-1994, 1999, 2000, 2001 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by John Gilmore.
 
    This file is part of GDB.
@@ -43,6 +43,8 @@
 
 #include "bfd.h"
 #include "symtab.h"
+#include "dcache.h"
+#include "memattr.h"
 
 enum strata
   {
@@ -239,6 +241,8 @@ enum target_signal
        of the protocol.  Note that in some GDB's TARGET_SIGNAL_REALTIME_32
        is number 76.  */
     TARGET_SIGNAL_REALTIME_32,
+    /* Yet another pain, IRIX 6 has SIG64.  */
+    TARGET_SIGNAL_REALTIME_64,
 
 #if defined(MACH) || defined(__MACH__)
     /* Mach exceptions */
@@ -360,7 +364,9 @@ struct target_ops
        something at MEMADDR + N.  */
 
     int (*to_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
-                          int len, int write, struct target_ops * target);
+                          int len, int write, 
+                          struct mem_attrib *attrib,
+                          struct target_ops *target);
 
 #if 0
     /* Enable this after 4.12.  */
@@ -487,8 +493,11 @@ extern struct target_stack_item *target_stack;
    and (if successful) pushes a new target onto the stack.
    Targets should supply this routine, if only to provide an error message.  */
 
-#define        target_open(name, from_tty)     \
-     (*current_target.to_open) (name, from_tty)
+#define        target_open(name, from_tty)                                     \
+  do {                                                                 \
+    dcache_invalidate (target_dcache);                                 \
+    (*current_target.to_open) (name, from_tty);                                \
+  } while (0)
 
 /* Does whatever cleanup is required for a target that we are no longer
    going to be calling.  Argument says whether we are quitting gdb and
@@ -560,8 +569,11 @@ extern void target_detach (char *, int);
    the target, or TARGET_SIGNAL_0 for no signal.  The caller may not
    pass TARGET_SIGNAL_DEFAULT.  */
 
-#define        target_resume(pid, step, siggnal)       \
-     (*current_target.to_resume) (pid, step, siggnal)
+#define        target_resume(pid, step, siggnal)                               \
+  do {                                                                 \
+    dcache_invalidate(target_dcache);                                  \
+    (*current_target.to_resume) (pid, step, siggnal);                  \
+  } while (0)
 
 /* Wait for process pid to do something.  Pid = -1 to wait for any pid
    to do something.  Return pid of child, or -1 in case of error;
@@ -608,16 +620,22 @@ extern void target_detach (char *, int);
 #define        target_prepare_to_store()       \
      (*current_target.to_prepare_to_store) ()
 
+extern DCACHE *target_dcache;
+
+extern int do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+                          struct mem_attrib *attrib);
+
 extern int target_read_string (CORE_ADDR, char **, int, int *);
 
 extern int target_read_memory (CORE_ADDR memaddr, char *myaddr, int len);
 
-extern int target_write_memory (CORE_ADDR, char *, int);
+extern int target_write_memory (CORE_ADDR memaddr, char *myaddr, int len);
 
-extern int xfer_memory (CORE_ADDR, char *, int, int, struct target_ops *);
+extern int xfer_memory (CORE_ADDR, char *, int, int, 
+                       struct mem_attrib *, struct target_ops *);
 
-extern int
-child_xfer_memory (CORE_ADDR, char *, int, int, struct target_ops *);
+extern int child_xfer_memory (CORE_ADDR, char *, int, int, 
+                             struct mem_attrib *, struct target_ops *);
 
 /* Make a single attempt at transfering LEN bytes.  On a successful
    transfer, the number of bytes actually transfered is returned and
@@ -1124,13 +1142,13 @@ extern void (*target_new_objfile_hook) (struct objfile *);
 #define target_pid_to_exec_file(pid) \
      (current_target.to_pid_to_exec_file) (pid)
 
-/* Hook to call target-dependant code after reading in a new symbol table.  */
+/* Hook to call target-dependent code after reading in a new symbol table.  */
 
 #ifndef TARGET_SYMFILE_POSTREAD
 #define TARGET_SYMFILE_POSTREAD(OBJFILE)
 #endif
 
-/* Hook to call target dependant code just after inferior target process has
+/* Hook to call target dependent code just after inferior target process has
    started.  */
 
 #ifndef TARGET_CREATE_INFERIOR_HOOK
@@ -1171,7 +1189,7 @@ extern void (*target_new_objfile_hook) (struct objfile *);
 
 #if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
 #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \
-     (LONGEST)(byte_count) <= REGISTER_SIZE
+     ((LONGEST)(byte_count) <= REGISTER_SIZE)
 #endif
 
 /* However, some addresses may not be profitable to use hardware to watch,
This page took 0.024269 seconds and 4 git commands to generate.