* lib/gdb.exp (get_hexadecimal_valueof): New procedure.
[deliverable/binutils-gdb.git] / gdb / target.h
index 65201eb645c091e190a122c980635d8871e53e6b..916d8e949df99dec3a55954117043e7b0c2c7c85 100644 (file)
@@ -1,7 +1,7 @@
 /* Interface between GDB and target environments, including files and processes
 
    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by John Gilmore.
@@ -151,6 +151,10 @@ struct target_waitstatus
     value;
   };
 
+/* Return a pretty printed form of target_waitstatus.
+   Space for the result is malloc'd, caller must free.  */
+extern char *target_waitstatus_to_string (const struct target_waitstatus *);
+
 /* Possible types of events that the inferior handler will have to
    deal with.  */
 enum inferior_event_type
@@ -174,13 +178,13 @@ enum inferior_event_type
   };
 
 /* Return the string for a signal.  */
-extern char *target_signal_to_string (enum target_signal);
+extern const char *target_signal_to_string (enum target_signal);
 
 /* Return the name (SIGHUP, etc.) for a signal.  */
-extern char *target_signal_to_name (enum target_signal);
+extern const char *target_signal_to_name (enum target_signal);
 
 /* Given a name (SIGHUP, etc.), return its signal.  */
-enum target_signal target_signal_from_name (char *);
+enum target_signal target_signal_from_name (const char *);
 \f
 /* Target objects which can be transfered using target_read,
    target_write, et cetera.  */
@@ -217,7 +221,10 @@ enum target_object
   TARGET_OBJECT_LIBRARIES,
   /* Get OS specific data.  The ANNEX specifies the type (running
      processes, etc.).  */
-  TARGET_OBJECT_OSDATA
+  TARGET_OBJECT_OSDATA,
+  /* Extra signal info.  Usually the contents of `siginfo_t' on unix
+     platforms.  */
+  TARGET_OBJECT_SIGNAL_INFO,
   /* Possible future objects: TARGET_OBJECT_FILE, ... */
 };
 
@@ -299,15 +306,6 @@ extern void get_target_memory (struct target_ops *ops, CORE_ADDR addr,
 extern ULONGEST get_target_memory_unsigned (struct target_ops *ops,
                                            CORE_ADDR addr, int len);
 \f
-
-/* If certain kinds of activity happen, target_wait should perform
-   callbacks.  */
-/* Right now we just call (*TARGET_ACTIVITY_FUNCTION) if I/O is possible
-   on TARGET_ACTIVITY_FD.  */
-extern int target_activity_fd;
-/* Returns zero to leave the inferior alone, one to interrupt it.  */
-extern int (*target_activity_function) (void);
-\f
 struct thread_info;            /* fwd decl for parameter list below: */
 
 struct target_ops
@@ -335,7 +333,8 @@ struct target_ops
     void (*to_detach) (struct target_ops *ops, char *, int);
     void (*to_disconnect) (struct target_ops *, char *, int);
     void (*to_resume) (ptid_t, int, enum target_signal);
-    ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
+    ptid_t (*to_wait) (struct target_ops *,
+                     ptid_t, struct target_waitstatus *);
     void (*to_fetch_registers) (struct regcache *, int);
     void (*to_store_registers) (struct regcache *, int);
     void (*to_prepare_to_store) (struct regcache *);
@@ -407,7 +406,7 @@ struct target_ops
     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) (ptid_t);
+    char *(*to_pid_to_str) (struct target_ops *, ptid_t);
     char *(*to_extra_thread_info) (struct thread_info *);
     void (*to_stop) (ptid_t);
     void (*to_rcmd) (char *command, struct ui_file *output);
@@ -443,7 +442,8 @@ struct target_ops
        or executable file given by OBJFILE.  If that block of
        thread-local storage hasn't been allocated yet, this function
        may return an error.  */
-    CORE_ADDR (*to_get_thread_local_address) (ptid_t ptid,
+    CORE_ADDR (*to_get_thread_local_address) (struct target_ops *ops,
+                                             ptid_t ptid,
                                              CORE_ADDR load_module_addr,
                                              CORE_ADDR offset);
 
@@ -630,8 +630,7 @@ extern void target_resume (ptid_t ptid, int step, enum target_signal signal);
    to the prompt with a debugging target but without the frame cache,
    stop_pc, etc., set up.  */
 
-#define        target_wait(ptid, status)               \
-     (*current_target.to_wait) (ptid, status)
+extern ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status);
 
 /* Fetch at least register REGNO, or all regs if regno == -1.  No result.  */
 
@@ -1018,14 +1017,9 @@ int target_supports_non_stop (void);
    `process xyz', but on some systems it may contain
    `process xyz thread abc'.  */
 
-#undef target_pid_to_str
-#define target_pid_to_str(PID) current_target.to_pid_to_str (PID)
+extern char *target_pid_to_str (ptid_t ptid);
 
-#ifndef target_tid_to_str
-#define target_tid_to_str(PID) \
-     target_pid_to_str (PID)
 extern char *normal_pid_to_str (ptid_t ptid);
-#endif
 
 /* Return a short string describing extra information about PID,
    e.g. "sleeping", "runnable", "running on LWP 3".  Null return value
@@ -1066,13 +1060,6 @@ extern char *normal_pid_to_str (ptid_t ptid);
 #define target_make_corefile_notes(BFD, SIZE_P) \
      (current_target.to_make_corefile_notes) (BFD, SIZE_P)
 
-/* Thread-local values.  */
-#define target_get_thread_local_address \
-    (current_target.to_get_thread_local_address)
-#define target_get_thread_local_address_p() \
-    (target_get_thread_local_address != NULL)
-
-
 /* Hardware watchpoint interfaces.  */
 
 /* Returns non-zero if we were stopped by a hardware watchpoint (memory read or
@@ -1138,14 +1125,9 @@ extern char *normal_pid_to_str (ptid_t ptid);
      (*current_target.to_remove_hw_breakpoint) (bp_tgt)
 #endif
 
-extern int target_stopped_data_address_p (struct target_ops *);
-
 #ifndef target_stopped_data_address
 #define target_stopped_data_address(target, x) \
     (*target.to_stopped_data_address) (target, x)
-#else
-/* Horrible hack to get around existing macros :-(.  */
-#define target_stopped_data_address_p(CURRENT_TARGET) (1)
 #endif
 
 #define target_watchpoint_addr_within_range(target, addr, start, length) \
@@ -1266,7 +1248,7 @@ extern int default_memory_insert_breakpoint (struct gdbarch *, struct bp_target_
 
 extern void initialize_targets (void);
 
-extern void noprocess (void);
+extern NORETURN void noprocess (void) ATTR_NORETURN;
 
 extern void target_require_runnable (void);
 
@@ -1286,6 +1268,12 @@ extern int target_resize_to_sections (struct target_ops *target,
 
 extern void remove_target_sections (bfd *abfd);
 
+/* Read OS data object of type TYPE from the target, and return it in
+   XML format.  The result is NUL-terminated and returned as a string,
+   allocated using xmalloc.  If an error occurs or the transfer is
+   unsupported, NULL is returned.  Empty objects are returned as
+   allocated but empty strings.  */
+
 extern char *target_get_osdata (const char *type);
 
 \f
This page took 0.026321 seconds and 4 git commands to generate.