gdb/
[deliverable/binutils-gdb.git] / gdb / target.h
index ea27b2ce31049b9219f5be3abe34b3603af2efbb..4625d520e52b00fb8580c15d103146e87d23966b 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, 2009, 2010
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by John Gilmore.
@@ -127,7 +127,7 @@ enum target_waitkind
 
     /* The program has entered or returned from a system call.  On
        HP-UX, this is used in the hardware watchpoint implementation.
-       The syscall's unique integer ID number is in value.syscall_id */
+       The syscall's unique integer ID number is in value.syscall_id */
 
     TARGET_WAITKIND_SYSCALL_ENTRY,
     TARGET_WAITKIND_SYSCALL_RETURN,
@@ -140,11 +140,11 @@ enum target_waitkind
     /* An event has occured, but we should wait again.
        Remote_async_wait() returns this when there is an event
        on the inferior, but the rest of the world is not interested in
-       it. The inferior has not stopped, but has just sent some output
-       to the console, for instance. In this case, we want to go back
+       it.  The inferior has not stopped, but has just sent some output
+       to the console, for instance.  In this case, we want to go back
        to the event loop and wait there for another event from the
        inferior, rather than being stuck in the remote_async_wait()
-       function. This way the event loop is responsive to other events,
+       function. sThis way the event loop is responsive to other events,
        like for instance the user typing.  */
     TARGET_WAITKIND_IGNORE,
 
@@ -213,7 +213,7 @@ enum inferior_event_type
     INF_EXEC_COMPLETE,
     /* We are called to do some stuff after the inferior stops, but we
        are expected to reenter the proceed() and
-       handle_inferior_event() functions. This is used only in case of
+       handle_inferior_event() functions.  This is used only in case of
        'step n' like commands.  */
     INF_EXEC_CONTINUE
   };
@@ -256,7 +256,8 @@ enum target_object
   /* Currently loaded libraries, in XML format.  */
   TARGET_OBJECT_LIBRARIES,
   /* Get OS specific data.  The ANNEX specifies the type (running
-     processes, etc.).  */
+     processes, etc.).  The data being transfered is expected to follow
+     the DTD specified in features/osdata.dtd.  */
   TARGET_OBJECT_OSDATA,
   /* Extra signal info.  Usually the contents of `siginfo_t' on unix
      platforms.  */
@@ -265,7 +266,16 @@ enum target_object
   TARGET_OBJECT_THREADS,
   /* Collected static trace data.  */
   TARGET_OBJECT_STATIC_TRACE_DATA,
-  /* Possible future objects: TARGET_OBJECT_FILE, ... */
+  /* The HP-UX registers (those that can be obtained or modified by using
+     the TT_LWP_RUREGS/TT_LWP_WUREGS ttrace requests).  */
+  TARGET_OBJECT_HPUX_UREGS,
+  /* The HP-UX shared library linkage pointer.  ANNEX should be a string
+     image of the code address whose linkage pointer we are looking for.
+
+     The size of the data transfered is always 8 bytes (the size of an
+     address on ia64).  */
+  TARGET_OBJECT_HPUX_SOLIB_GOT,
+  /* Possible future objects: TARGET_OBJECT_FILE, ...  */
 };
 
 /* Enumeration of the kinds of traceframe searches that a target may
@@ -301,7 +311,7 @@ extern LONGEST target_read (struct target_ops *ops,
 
 struct memory_read_result
   {
-    /* First address that was read. */
+    /* First address that was read.  */
     ULONGEST begin;
     /* Past-the-end address.  */
     ULONGEST end;
@@ -452,7 +462,11 @@ struct target_ops
     int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *);
     int (*to_watchpoint_addr_within_range) (struct target_ops *,
                                            CORE_ADDR, CORE_ADDR, int);
+
+    /* Documentation of this routine is provided with the corresponding
+       target_* macro.  */
     int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int);
+
     int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int,
                                              struct expression *);
     void (*to_terminal_init) (void);
@@ -467,12 +481,12 @@ struct target_ops
     void (*to_create_inferior) (struct target_ops *, 
                                char *, char *, char **, int);
     void (*to_post_startup_inferior) (ptid_t);
-    void (*to_insert_fork_catchpoint) (int);
+    int (*to_insert_fork_catchpoint) (int);
     int (*to_remove_fork_catchpoint) (int);
-    void (*to_insert_vfork_catchpoint) (int);
+    int (*to_insert_vfork_catchpoint) (int);
     int (*to_remove_vfork_catchpoint) (int);
     int (*to_follow_fork) (struct target_ops *, int);
-    void (*to_insert_exec_catchpoint) (int);
+    int (*to_insert_exec_catchpoint) (int);
     int (*to_remove_exec_catchpoint) (int);
     int (*to_set_syscall_catchpoint) (int, int, int, int, int *);
     int (*to_has_exited) (int, int, int *);
@@ -483,6 +497,7 @@ struct target_ops
     void (*to_find_new_threads) (struct target_ops *);
     char *(*to_pid_to_str) (struct target_ops *, ptid_t);
     char *(*to_extra_thread_info) (struct thread_info *);
+    char *(*to_thread_name) (struct thread_info *);
     void (*to_stop) (ptid_t);
     void (*to_rcmd) (char *command, struct ui_file *output);
     char *(*to_pid_to_exec_file) (int pid);
@@ -558,7 +573,7 @@ struct target_ops
        RAM.  The returned memory regions should not overlap.
 
        The order of regions does not matter; target_memory_map will
-       sort regions by starting address. For that reason, this
+       sort regions by starting address.  For that reason, this
        function should not be called directly except via
        target_memory_map.
 
@@ -664,7 +679,7 @@ struct target_ops
    /* Ask the target to find a trace frame of the given type TYPE,
       using NUM, ADDR1, and ADDR2 as search parameters.  Returns the
       number of the trace frame, and also the tracepoint number at
-      TPP.  If no trace frame matches, return -1. May throw if the
+      TPP.  If no trace frame matches, return -1.  May throw if the
       operation fails.  */
     int (*to_trace_find) (enum trace_find_type type, int num,
                          ULONGEST addr1, ULONGEST addr2, int *tpp);
@@ -692,8 +707,9 @@ struct target_ops
        This information is updated only when:
        - update_thread_list is called
        - thread stops
-       If the core cannot be determined -- either for the specified thread, or
-       right now, or in this debug session, or for this target -- return -1.  */
+       If the core cannot be determined -- either for the specified
+       thread, or right now, or in this debug session, or for this
+       target -- return -1.  */
     int (*to_core_of_thread) (struct target_ops *, ptid_t ptid);
 
     /* Verify that the memory in the [MEMADDR, MEMADDR+SIZE) range
@@ -865,11 +881,11 @@ void target_flash_done (void);
 /* Describes a request for a memory write operation.  */
 struct memory_write_request
   {
-    /* Begining address that must be written. */
+    /* Begining address that must be written.  */
     ULONGEST begin;
-    /* Past-the-end address. */
+    /* Past-the-end address.  */
     ULONGEST end;
-    /* The data to write. */
+    /* The data to write.  */
     gdb_byte *data;
     /* A callback baton for progress reporting for this request.  */
     void *baton;
@@ -1027,7 +1043,8 @@ void target_create_inferior (char *exec_file, char *args,
 
 /* On some targets, we can catch an inferior fork or vfork event when
    it occurs.  These functions insert/remove an already-created
-   catchpoint for such events.  */
+   catchpoint for such events.  They return  0 for success, 1 if the
+   catchpoint type is not supported and -1 for failure.  */
 
 #define target_insert_fork_catchpoint(pid) \
      (*current_target.to_insert_fork_catchpoint) (pid)
@@ -1053,7 +1070,8 @@ int target_follow_fork (int follow_child);
 
 /* On some targets, we can catch an inferior exec event when it
    occurs.  These functions insert/remove an already-created
-   catchpoint for such events.  */
+   catchpoint for such events.  They return  0 for success, 1 if the
+   catchpoint type is not supported and -1 for failure.  */
 
 #define target_insert_exec_catchpoint(pid) \
      (*current_target.to_insert_exec_catchpoint) (pid)
@@ -1076,7 +1094,10 @@ int target_follow_fork (int follow_child);
 
    TABLE is an array of ints, indexed by syscall number.  An element in
    this array is nonzero if that syscall should be caught.  This argument
-   only matters if ANY_COUNT is zero.  */
+   only matters if ANY_COUNT is zero.
+
+   Return 0 for success, 1 if syscall catchpoints are not supported or -1
+   for failure.  */
 
 #define target_set_syscall_catchpoint(pid, needed, any_count, table_size, table) \
      (*current_target.to_set_syscall_catchpoint) (pid, needed, any_count, \
@@ -1182,27 +1203,27 @@ extern int default_child_has_execution (struct target_ops *ops);
    cludge until async mode is a strict superset of sync mode.  */
 extern int target_async_permitted;
 
-/* Can the target support asynchronous execution? */
+/* Can the target support asynchronous execution?  */
 #define target_can_async_p() (current_target.to_can_async_p ())
 
-/* Is the target in asynchronous execution mode? */
+/* Is the target in asynchronous execution mode?  */
 #define target_is_async_p() (current_target.to_is_async_p ())
 
 int target_supports_non_stop (void);
 
-/* Put the target in async mode with the specified callback function. */
+/* Put the target in async mode with the specified callback function.  */
 #define target_async(CALLBACK,CONTEXT) \
      (current_target.to_async ((CALLBACK), (CONTEXT)))
 
-/* This is to be used ONLY within call_function_by_hand(). It provides
+/* This is to be used ONLY within call_function_by_hand().  It provides
    a workaround, to have inferior function calls done in sychronous
-   mode, even though the target is asynchronous. After
+   mode, even though the target is asynchronous.  After
    target_async_mask(0) is called, calls to target_can_async_p() will
    return FALSE , so that target_resume() will not try to start the
-   target asynchronously. After the inferior stops, we IMMEDIATELY
+   target asynchronously.  After the inferior stops, we IMMEDIATELY
    restore the previous nature of the target, by calling
-   target_async_mask(1). After that, target_can_async_p() will return
-   TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
+   target_async_mask(1).  After that, target_can_async_p() will return
+   TRUE.  ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
 
    FIXME ezannoni 1999-12-13: we won't need this once we move
    the turning async on and off to the single execution commands,
@@ -1226,6 +1247,11 @@ extern char *normal_pid_to_str (ptid_t ptid);
 #define target_extra_thread_info(TP) \
      (current_target.to_extra_thread_info (TP))
 
+/* Return the thread's name.  A NULL result means that the target
+   could not determine this thread's name.  */
+
+extern char *target_thread_name (struct thread_info *);
+
 /* Attempts to find the pathname of the executable file
    that was run to create a specified process.
 
@@ -1301,6 +1327,9 @@ extern char *normal_pid_to_str (ptid_t ptid);
 #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
  (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
 
+/* Returns the number of debug registers needed to watch the given
+   memory region, or zero if not supported.  */
+
 #define target_region_ok_for_hw_watchpoint(addr, len) \
     (*current_target.to_region_ok_for_hw_watchpoint) (addr, len)
 
@@ -1525,13 +1554,17 @@ extern struct target_section_table *target_get_section_table
 
 /* From mem-break.c */
 
-extern int memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int memory_remove_breakpoint (struct gdbarch *,
+                                    struct bp_target_info *);
 
-extern int memory_insert_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int memory_insert_breakpoint (struct gdbarch *,
+                                    struct bp_target_info *);
 
-extern int default_memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int default_memory_remove_breakpoint (struct gdbarch *,
+                                            struct bp_target_info *);
 
-extern int default_memory_insert_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int default_memory_insert_breakpoint (struct gdbarch *,
+                                            struct bp_target_info *);
 
 
 /* From target.c */
@@ -1568,7 +1601,7 @@ extern int remote_debug;
 
 /* Speed in bits per second, or -1 which means don't mess with the speed.  */
 extern int baud_rate;
-/* Timeout limit for response from target. */
+/* Timeout limit for response from target.  */
 extern int remote_timeout;
 
 \f
@@ -1601,11 +1634,9 @@ extern int may_stop;
 extern void update_target_permissions (void);
 
 \f
-/* Imported from machine dependent code */
+/* Imported from machine dependent code */
 
-/* Blank target vector entries are initialized to target_ignore. */
+/* Blank target vector entries are initialized to target_ignore.  */
 void target_ignore (void);
 
-extern struct target_ops deprecated_child_ops;
-
 #endif /* !defined (TARGET_H) */
This page took 0.028321 seconds and 4 git commands to generate.