* solib-svr4.c (svr4_truncate_ptr): New function.
[deliverable/binutils-gdb.git] / gdb / target.h
index fa805830aa08eef3c1ef5e92fa8774aeb7e15a55..3d17becdfd1719957495340080feedd58dec6fa4 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.
@@ -196,9 +196,9 @@ struct target_ops
     void (*to_require_attach) (char *, int);
     void (*to_detach) (char *, int);
     void (*to_require_detach) (int, char *, int);
-    void (*to_resume) (int, int, enum target_signal);
-    int (*to_wait) (int, struct target_waitstatus *);
-    void (*to_post_wait) (int, int);
+    void (*to_resume) (ptid_t, int, enum target_signal);
+    ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
+    void (*to_post_wait) (ptid_t, int);
     void (*to_fetch_registers) (int);
     void (*to_store_registers) (int);
     void (*to_prepare_to_store) (void);
@@ -261,7 +261,7 @@ struct target_ops
     void (*to_load) (char *, int);
     int (*to_lookup_symbol) (char *, CORE_ADDR *);
     void (*to_create_inferior) (char *, char *, char **);
-    void (*to_post_startup_inferior) (int);
+    void (*to_post_startup_inferior) (ptid_t);
     void (*to_acknowledge_created_inferior) (int);
     void (*to_clone_and_follow_inferior) (int, int *);
     void (*to_post_follow_inferior_by_clone) (void);
@@ -281,10 +281,10 @@ struct target_ops
     int (*to_has_exited) (int, int, int *);
     void (*to_mourn_inferior) (void);
     int (*to_can_run) (void);
-    void (*to_notice_signals) (int pid);
-    int (*to_thread_alive) (int pid);
+    void (*to_notice_signals) (ptid_t ptid);
+    int (*to_thread_alive) (ptid_t ptid);
     void (*to_find_new_threads) (void);
-    char *(*to_pid_to_str) (int);
+    char *(*to_pid_to_str) (ptid_t);
     char *(*to_extra_thread_info) (struct thread_info *);
     void (*to_stop) (void);
     int (*to_query) (int /*char */ , char *, char *, int *);
@@ -294,7 +294,6 @@ struct target_ops
                                                             int);
     struct exception_event_record *(*to_get_current_exception_event) (void);
     char *(*to_pid_to_exec_file) (int pid);
-    char *(*to_core_file_to_sym_file) (char *);
     enum strata to_stratum;
     struct target_ops
      *DONT_USE;                        /* formerly to_next */
@@ -314,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?
      */
@@ -422,18 +427,18 @@ extern void target_detach (char *, int);
 #define target_require_detach(pid, args, from_tty)     \
      (*current_target.to_require_detach) (pid, args, from_tty)
 
-/* Resume execution of the target process PID.  STEP says whether to
+/* Resume execution of the target process PTID.  STEP says whether to
    single-step or to run free; SIGGNAL is the signal to be given to
    the target, or TARGET_SIGNAL_0 for no signal.  The caller may not
    pass TARGET_SIGNAL_DEFAULT.  */
 
-#define        target_resume(pid, step, siggnal)                               \
+#define        target_resume(ptid, step, siggnal)                              \
   do {                                                                 \
     dcache_invalidate(target_dcache);                                  \
-    (*current_target.to_resume) (pid, step, siggnal);                  \
+    (*current_target.to_resume) (ptid, step, siggnal);                 \
   } while (0)
 
-/* Wait for process pid to do something.  Pid = -1 to wait for any pid
+/* 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
@@ -441,8 +446,8 @@ extern void target_detach (char *, int);
    to the prompt with a debugging target but without the frame cache,
    stop_pc, etc., set up.  */
 
-#define        target_wait(pid, status)                \
-     (*current_target.to_wait) (pid, status)
+#define        target_wait(ptid, status)               \
+     (*current_target.to_wait) (ptid, status)
 
 /* The target_wait operation waits for a process event to occur, and
    thereby stop the process.
@@ -454,8 +459,8 @@ extern void target_detach (char *, int);
    This operation provides a target-specific hook that allows the
    necessary bookkeeping to be performed to track such sequences.  */
 
-#define target_post_wait(pid, status) \
-     (*current_target.to_post_wait) (pid, status)
+#define target_post_wait(ptid, status) \
+     (*current_target.to_post_wait) (ptid, status)
 
 /* Fetch at least register REGNO, or all regs if regno == -1.  No result.  */
 
@@ -515,9 +520,9 @@ extern char *child_core_file_to_sym_file (char *);
 extern void child_post_attach (int);
 #endif
 
-extern void child_post_wait (int, int);
+extern void child_post_wait (ptid_t, int);
 
-extern void child_post_startup_inferior (int);
+extern void child_post_startup_inferior (ptid_t);
 
 extern void child_acknowledge_created_inferior (int);
 
@@ -555,7 +560,7 @@ extern int child_has_syscall_event (int, enum target_waitkind *, int *);
 
 extern int child_has_exited (int, int, int *);
 
-extern int child_thread_alive (int);
+extern int child_thread_alive (ptid_t);
 
 /* From exec.c */
 
@@ -641,7 +646,7 @@ extern void target_load (char *arg, int from_tty);
 #define target_lookup_symbol(name, addrp) \
      (*current_target.to_lookup_symbol) (name, addrp)
 
-/* Start an inferior process and set inferior_pid to its pid.
+/* Start an inferior process and set inferior_ptid to its pid.
    EXEC_FILE is the file to run.
    ALLARGS is a string containing the arguments to the program.
    ENV is the environment vector to pass.  Errors reported with error().
@@ -661,8 +666,8 @@ extern void target_load (char *arg, int from_tty);
 
    Such targets will supply an appropriate definition for this function.  */
 
-#define target_post_startup_inferior(pid) \
-     (*current_target.to_post_startup_inferior) (pid)
+#define target_post_startup_inferior(ptid) \
+     (*current_target.to_post_startup_inferior) (ptid)
 
 /* On some targets, the sequence of starting up an inferior requires
    some synchronization between gdb and the new inferior process, PID.  */
@@ -804,13 +809,13 @@ extern void target_load (char *arg, int from_tty);
 
 /* post process changes to signal handling in the inferior.  */
 
-#define target_notice_signals(pid) \
-     (*current_target.to_notice_signals) (pid)
+#define target_notice_signals(ptid) \
+     (*current_target.to_notice_signals) (ptid)
 
 /* Check to see if a thread is still alive.  */
 
-#define target_thread_alive(pid) \
-     (*current_target.to_thread_alive) (pid)
+#define target_thread_alive(ptid) \
+     (*current_target.to_thread_alive) (ptid)
 
 /* Query for new threads and add them to the thread list.  */
 
@@ -945,7 +950,7 @@ extern void target_link (char *, CORE_ADDR *);
 #ifndef target_tid_to_str
 #define target_tid_to_str(PID) \
      target_pid_to_str (PID)
-extern char *normal_pid_to_str (int pid);
+extern char *normal_pid_to_str (ptid_t ptid);
 #endif
 
 /* Return a short string describing extra information about PID,
@@ -1000,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
@@ -1050,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
@@ -1251,21 +1262,7 @@ extern void push_remote_target (char *name, int from_tty);
 \f
 /* Imported from machine dependent code */
 
-#ifndef SOFTWARE_SINGLE_STEP_P
-#define SOFTWARE_SINGLE_STEP_P() 0
-#define SOFTWARE_SINGLE_STEP(sig,bp_p) \
-     (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
-#endif /* SOFTWARE_SINGLE_STEP_P */
-
 /* 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.026374 seconds and 4 git commands to generate.