2002-05-15 Nick Clifton <nickc@cambridge.redhat.com>
[deliverable/binutils-gdb.git] / gdb / target.h
index 457308c3c60a54587f209651ed2eb11b217a56f5..1797fc1d3e35953fbc1c7d3c57c1405c0582d55e 100644 (file)
@@ -1,6 +1,6 @@
 /* Interface between GDB and target environments, including files and processes
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001 Free Software Foundation, Inc.
+   2000, 2001, 2002 Free Software Foundation, Inc.
    Contributed by Cygnus Support.  Written by John Gilmore.
 
    This file is part of GDB.
@@ -313,6 +313,12 @@ 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 *), 
+                                  void *);
+    char * (*to_make_corefile_notes) (bfd *, int *);
     int to_magic;
     /* Need sub-structure for target machine related rather than comm related?
      */
@@ -432,10 +438,10 @@ extern void target_detach (char *, int);
     (*current_target.to_resume) (ptid, step, siggnal);                 \
   } while (0)
 
-/* Wait for process pid to do something.  PTID = -1 to wait for any pid
-   to do something.  Return pid of child, or -1 in case of error;
+/* Wait for process pid to do something.  PTID = -1 to wait for any
+   pid to do something.  Return pid of child, or -1 in case of error;
    store status through argument pointer STATUS.  Note that it is
-   *not* OK to return_to_top_level out of target_wait without popping
+   _NOT_ OK to throw_exception() out of target_wait() without popping
    the debugging target from the stack; GDB isn't prepared to get back
    to the prompt with a debugging target but without the frame cache,
    stop_pc, etc., set up.  */
@@ -999,6 +1005,23 @@ extern void (*target_new_objfile_hook) (struct objfile *);
 #define target_pid_to_exec_file(pid) \
      (current_target.to_pid_to_exec_file) (pid)
 
+/*
+ * 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.  
+ */
+
+#define target_find_memory_regions(FUNC, DATA) \
+     (current_target.to_find_memory_regions) (FUNC, DATA)
+
+/*
+ * Compose corefile .note section.
+ */
+
+#define target_make_corefile_notes(BFD, SIZE_P) \
+     (current_target.to_make_corefile_notes) (BFD, SIZE_P)
+
 /* Hook to call target-dependent code after reading in a new symbol table.  */
 
 #ifndef TARGET_SYMFILE_POSTREAD
@@ -1049,17 +1072,6 @@ extern void (*target_new_objfile_hook) (struct objfile *);
      ((LONGEST)(byte_count) <= REGISTER_SIZE)
 #endif
 
-/* However, some addresses may not be profitable to use hardware to watch,
-   or may be difficult to understand when the addressed object is out of
-   scope, and hence should be unwatched.  On some targets, this may have
-   severe performance penalties, such that we might as well use regular
-   watchpoints, and save (possibly precious) hardware watchpoints for other
-   locations.  */
-
-#if !defined(TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT)
-#define TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT(pid,start,len) 0
-#endif
-
 
 /* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes.  TYPE is 0
    for write, 1 for read, and 2 for read/write accesses.  Returns 0 for
@@ -1172,7 +1184,8 @@ extern int default_memory_remove_breakpoint (CORE_ADDR, char *);
 
 extern int default_memory_insert_breakpoint (CORE_ADDR, char *);
 
-extern breakpoint_from_pc_fn memory_breakpoint_from_pc;
+extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr,
+                                                      int *lenptr);
 
 
 /* From target.c */
@@ -1253,12 +1266,4 @@ extern void push_remote_target (char *name, int from_tty);
 /* Blank target vector entries are initialized to target_ignore. */
 void target_ignore (void);
 
-/* Macro for getting target's idea of a frame pointer.
-   FIXME: GDB's whole scheme for dealing with "frames" and
-   "frame pointers" needs a serious shakedown.  */
-#ifndef TARGET_VIRTUAL_FRAME_POINTER
-#define TARGET_VIRTUAL_FRAME_POINTER(ADDR, REGP, OFFP) \
-   do { *(REGP) = FP_REGNUM; *(OFFP) =  0; } while (0)
-#endif /* TARGET_VIRTUAL_FRAME_POINTER */
-
 #endif /* !defined (TARGET_H) */
This page took 0.024378 seconds and 4 git commands to generate.