2004-02-14 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / target.h
index 2fb3381e7a2cd162f7e89df73f28c4f805c9a3d2..2d8ce372fc5141208e0fd64e780dea00627c8630 100644 (file)
@@ -1,7 +1,7 @@
 /* Interface between GDB and target environments, including files and processes
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by John Gilmore.
 
@@ -35,8 +35,8 @@ struct target_ops;
    specific to the communications interface between us and the
    target.
 
-   A TARGET is an interface between the debugger and a particular 
-   kind of file or process.  Targets can be STACKED in STRATA, 
+   A TARGET is an interface between the debugger and a particular
+   kind of file or process.  Targets can be STACKED in STRATA,
    so that more than one target can potentially respond to a request.
    In particular, memory accesses will walk down the stack of targets
    until they find a target that is interested in handling that particular
@@ -155,7 +155,7 @@ enum inferior_event_type
     INF_QUIT_REQ,
     /* Process a normal inferior event which will result in target_wait
        being called.  */
-    INF_REG_EVENT, 
+    INF_REG_EVENT,
     /* Deal with an error on the inferior.  */
     INF_ERROR,
     /* We are called because a timer went off.  */
@@ -186,7 +186,7 @@ enum target_signal target_signal_from_name (char *);
    Return the number of bytes actually transfered, zero when no
    further transfer is possible, and -1 when the transfer is not
    supported.
-   
+
    NOTE: cagney/2003-10-17: The current interface does not support a
    "retry" mechanism.  Instead it assumes that at least one byte will
    be transfered on each call.
@@ -211,10 +211,10 @@ enum target_signal target_signal_from_name (char *);
    to locally take responsibility for something it didn't have to
    worry about.
 
-   NOTE: cagney/2003-10-17: For backward compatibility with the
-   "target_query" method that this replaced, when BUF, OFFSET and LEN
-   are NULL/zero, return the "minimum" buffer size.  See "remote.c"
-   for further information.  */
+   NOTE: cagney/2003-10-17: With a TARGET_OBJECT_KOD object, for
+   backward compatibility with the "target_query" method that this
+   replaced, when OFFSET and LEN are both zero, return the "minimum"
+   buffer size.  See "remote.c" for further information.  */
 
 enum target_object
 {
@@ -223,9 +223,15 @@ enum target_object
   /* AVR target specific transfer.  See "avr-tdep.c" and "remote.c".  */
   TARGET_OBJECT_AVR,
   /* Transfer up-to LEN bytes of memory starting at OFFSET.  */
-  TARGET_OBJECT_MEMORY
-  /* Possible future ojbects: TARGET_OJBECT_FILE, TARGET_OBJECT_PROC,
-     TARGET_OBJECT_AUXV, ...  */
+  TARGET_OBJECT_MEMORY,
+  /* Kernel Unwind Table.  See "ia64-tdep.c".  */
+  TARGET_OBJECT_UNWIND_TABLE,
+  /* Transfer auxilliary vector.  */
+  TARGET_OBJECT_AUXV,
+  /* StackGhost cookie.  See "sparc-tdep.c".  */
+  TARGET_OBJECT_WCOOKIE
+
+  /* Possible future objects: TARGET_OBJECT_FILE, TARGET_OBJECT_PROC, ... */
 };
 
 extern LONGEST target_read_partial (struct target_ops *ops,
@@ -280,6 +286,8 @@ struct target_ops
     char *to_doc;              /* Documentation.  Does not include trailing
                                   newline, and starts with a one-line descrip-
                                   tion (probably similar to to_longname).  */
+    /* Per-target scratch pad.  */
+    void *to_data;
     /* The open routine takes the rest of the parameters from the
        command, and (if successful) pushes a new target onto the
        stack.  Targets should supply this routine, if only to provide
@@ -320,7 +328,7 @@ struct target_ops
        something at MEMADDR + N.  */
 
     int (*to_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
-                          int len, int write, 
+                          int len, int write,
                           struct mem_attrib *attrib,
                           struct target_ops *target);
 
@@ -388,10 +396,10 @@ struct target_ops
     void (*to_async) (void (*cb) (enum inferior_event_type, void *context),
                      void *context);
     int to_async_mask_value;
-    int (*to_find_memory_regions) (int (*) (CORE_ADDR, 
-                                           unsigned long, 
-                                           int, int, int, 
-                                           void *), 
+    int (*to_find_memory_regions) (int (*) (CORE_ADDR,
+                                           unsigned long,
+                                           int, int, int,
+                                           void *),
                                   void *);
     char * (*to_make_corefile_notes) (bfd *, int *);
 
@@ -404,15 +412,13 @@ struct target_ops
                                              struct objfile *objfile,
                                              CORE_ADDR offset);
 
-    /* See above.  */
-    LONGEST (*to_read_partial) (struct target_ops *ops,
-                               enum target_object object,
-                               const char *annex, void *buf, 
+    /* Perform partial transfers on OBJECT.  See target_read_partial
+       and target_write_partial for details of each variant.  One, and
+       only one, of readbuf or writebuf must be non-NULL.  */
+    LONGEST (*to_xfer_partial) (struct target_ops *ops,
+                               enum target_object object, const char *annex,
+                               void *readbuf, const void *writebuf,
                                ULONGEST offset, LONGEST len);
-    LONGEST (*to_write_partial) (struct target_ops *ops,
-                                enum target_object object,
-                                const char *annex, const void *buf,
-                                ULONGEST offset, LONGEST len);
 
     int to_magic;
     /* Need sub-structure for target machine related rather than comm related?
@@ -449,9 +455,9 @@ void target_close (struct target_ops *targ, int quitting);
 /* Attaches to a process on the target side.  Arguments are as passed
    to the `attach' command by the user.  This routine can be called
    when the target is not on the target-stack, if the target_can_run
-   routine returns 1; in that case, it must push itself onto the stack.  
+   routine returns 1; in that case, it must push itself onto the stack.
    Upon exit, the target should be ready for normal operations, and
-   should be ready to deliver the status of the process immediately 
+   should be ready to deliver the status of the process immediately
    (without waiting) to an upcoming target_wait call.  */
 
 #define        target_attach(args, from_tty)   \
@@ -546,10 +552,10 @@ extern int target_read_memory (CORE_ADDR memaddr, char *myaddr, int len);
 
 extern int target_write_memory (CORE_ADDR memaddr, char *myaddr, int len);
 
-extern int xfer_memory (CORE_ADDR, char *, int, int, 
+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, 
+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
@@ -627,8 +633,8 @@ extern void print_section_info (struct target_ops *, bfd *);
      (*current_target.to_insert_breakpoint) (addr, save)
 
 /* Remove a breakpoint at address ADDR in the target machine.
-   SAVE is a pointer to the same save area 
-   that was previously passed to target_insert_breakpoint.  
+   SAVE is a pointer to the same save area
+   that was previously passed to target_insert_breakpoint.
    Result is 0 for success, or an errno value.  */
 
 #define        target_remove_breakpoint(addr, save)    \
@@ -780,7 +786,7 @@ extern void target_load (char *arg, int from_tty);
      (*current_target.to_has_exited) (pid,wait_status,exit_status)
 
 /* The debugger has completed a blocking wait() call.  There is now
-   some process event that must be processed.  This function should 
+   some process event that must be processed.  This function should
    be defined by those targets that require the debugger to perform
    cleanup or internal state changes in response to the process event.  */
 
@@ -824,7 +830,7 @@ extern void target_load (char *arg, int from_tty);
 
 
 /* Get the symbol information for a breakpointable routine called when
-   an exception event occurs. 
+   an exception event occurs.
    Intended mainly for C++, and for those
    platforms/implementations where such a callback mechanism is available,
    e.g. HP-UX with ANSI C++ (aCC).  Some compilers (e.g. g++) support
@@ -908,7 +914,7 @@ extern void target_load (char *arg, int from_tty);
 #define        target_async_mask_value \
      (current_target.to_async_mask_value)
 
-extern int target_async_mask (int mask);     
+extern int target_async_mask (int mask);
 
 extern void target_link (char *, CORE_ADDR *);
 
@@ -936,7 +942,7 @@ extern char *normal_pid_to_str (ptid_t ptid);
  * New Objfile Event Hook:
  *
  * Sometimes a GDB component wants to get notified whenever a new
- * objfile is loaded.  Mainly this is used by thread-debugging 
+ * objfile is loaded.  Mainly this is used by thread-debugging
  * implementations that need to know when symbols for the target
  * thread implemenation are available.
  *
@@ -981,7 +987,7 @@ extern void (*target_new_objfile_hook) (struct objfile *);
  * Iterator function for target memory regions.
  * Calls a callback function once for each memory region 'mapped'
  * in the child process.  Defined as a simple macro rather than
- * as a function macro so that it can be tested for nullity.  
+ * as a function macro so that it can be tested for nullity.
  */
 
 #define target_find_memory_regions(FUNC, DATA) \
@@ -1038,7 +1044,7 @@ extern void (*target_new_objfile_hook) (struct objfile *);
 
 /* Provide defaults for hardware watchpoint functions.  */
 
-/* If the *_hw_beakpoint functions have not been defined 
+/* If the *_hw_beakpoint functions have not been defined
    elsewhere use the definitions in the target vector.  */
 
 /* Returns non-zero if we can set a hardware watchpoint of type TYPE.  TYPE is
@@ -1082,13 +1088,6 @@ extern void (*target_new_objfile_hook) (struct objfile *);
     (*current_target.to_stopped_data_address) ()
 #endif
 
-/* If defined, then we need to decr pc by this much after a hardware break-
-   point.  Presumably this overrides DECR_PC_AFTER_BREAK...  */
-
-#ifndef DECR_PC_AFTER_HW_BREAK
-#define DECR_PC_AFTER_HW_BREAK 0
-#endif
-
 /* Sometimes gdb may pick up what appears to be a valid target address
    from a minimal symbol, but the value really means, essentially,
    "This is an index into a table which is populated when the inferior
@@ -1154,7 +1153,7 @@ struct section_table
     CORE_ADDR addr;            /* Lowest address in section */
     CORE_ADDR endaddr;         /* 1+highest address in section */
 
-    sec_ptr the_bfd_section;
+    struct bfd_section *the_bfd_section;
 
     bfd *bfd;                  /* BFD file pointer */
   };
This page took 0.029685 seconds and 4 git commands to generate.