pass NULL to TARGET_DEFAULT_RETURN when appropriate
[deliverable/binutils-gdb.git] / gdb / target.h
index 1437cc4c9174069037f4cdb8c608f2ec7e817dd1..79805d13afcdfd907b74b8ee624eb097ba72c4c8 100644 (file)
@@ -409,7 +409,8 @@ struct target_ops
       TARGET_DEFAULT_IGNORE ();
     void (*to_detach) (struct target_ops *ops, const char *, int)
       TARGET_DEFAULT_IGNORE ();
-    void (*to_disconnect) (struct target_ops *, char *, int);
+    void (*to_disconnect) (struct target_ops *, char *, int)
+      TARGET_DEFAULT_NORETURN (tcomplain ());
     void (*to_resume) (struct target_ops *, ptid_t, int, enum gdb_signal)
       TARGET_DEFAULT_NORETURN (noprocess ());
     ptid_t (*to_wait) (struct target_ops *,
@@ -546,7 +547,8 @@ struct target_ops
       TARGET_DEFAULT_RETURN (0);
     void (*to_mourn_inferior) (struct target_ops *)
       TARGET_DEFAULT_FUNC (default_mourn_inferior);
-    int (*to_can_run) (struct target_ops *);
+    int (*to_can_run) (struct target_ops *)
+      TARGET_DEFAULT_RETURN (0);
 
     /* Documentation of this routine is provided with the corresponding
        target_* macro.  */
@@ -565,20 +567,20 @@ struct target_ops
     char *(*to_pid_to_str) (struct target_ops *, ptid_t)
       TARGET_DEFAULT_FUNC (default_pid_to_str);
     char *(*to_extra_thread_info) (struct target_ops *, struct thread_info *)
-      TARGET_DEFAULT_RETURN (0);
+      TARGET_DEFAULT_RETURN (NULL);
     char *(*to_thread_name) (struct target_ops *, struct thread_info *)
-      TARGET_DEFAULT_RETURN (0);
+      TARGET_DEFAULT_RETURN (NULL);
     void (*to_stop) (struct target_ops *, ptid_t)
       TARGET_DEFAULT_IGNORE ();
     void (*to_rcmd) (struct target_ops *,
                     char *command, struct ui_file *output)
       TARGET_DEFAULT_FUNC (default_rcmd);
     char *(*to_pid_to_exec_file) (struct target_ops *, int pid)
-      TARGET_DEFAULT_RETURN (0);
+      TARGET_DEFAULT_RETURN (NULL);
     void (*to_log_command) (struct target_ops *, const char *)
       TARGET_DEFAULT_IGNORE ();
     struct target_section_table *(*to_get_section_table) (struct target_ops *)
-      TARGET_DEFAULT_RETURN (0);
+      TARGET_DEFAULT_RETURN (NULL);
     enum strata to_stratum;
     int (*to_has_all_memory) (struct target_ops *);
     int (*to_has_memory) (struct target_ops *);
@@ -670,7 +672,7 @@ struct target_ops
        change unexpectedly, it should be invalidated, and higher
        layers will re-fetch it.  */
     VEC(mem_region_s) *(*to_memory_map) (struct target_ops *)
-      TARGET_DEFAULT_RETURN (0);
+      TARGET_DEFAULT_RETURN (NULL);
 
     /* Erases the region of flash memory starting at ADDRESS, of
        length LENGTH.
@@ -688,10 +690,12 @@ struct target_ops
     void (*to_flash_done) (struct target_ops *)
       TARGET_DEFAULT_NORETURN (tcomplain ());
 
-    /* Describe the architecture-specific features of this target.
-       Returns the description found, or NULL if no description
-       was available.  */
-    const struct target_desc *(*to_read_description) (struct target_ops *ops);
+    /* Describe the architecture-specific features of this target.  If
+       OPS doesn't have a description, this should delegate to the
+       "beneath" target.  Returns the description found, or NULL if no
+       description was available.  */
+    const struct target_desc *(*to_read_description) (struct target_ops *ops)
+        TARGET_DEFAULT_RETURN (NULL);
 
     /* Build the PTID of the thread on which a given task is running,
        based on LWP and THREAD.  These values are extracted from the
@@ -983,7 +987,7 @@ struct target_ops
        cache data; higher layers take care of caching, invalidating,
        and re-fetching when necessary.  */
     struct traceframe_info *(*to_traceframe_info) (struct target_ops *)
-      TARGET_DEFAULT_RETURN (0);
+      TARGET_DEFAULT_RETURN (NULL);
 
     /* Ask the target to use or not to use agent according to USE.  Return 1
        successful, 0 otherwise.  */
This page took 0.025004 seconds and 4 git commands to generate.