x86: don't open-code PREFIX_NONE
[deliverable/binutils-gdb.git] / gdb / target.h
index e1a1d7a9226b493a8f42a0c981c1f0022f62d9d2..ee93c5cf3959a1d8deadde821c38edb07a970e74 100644 (file)
@@ -470,8 +470,15 @@ struct target_ops
     virtual void attach (const char *, int);
     virtual void post_attach (int)
       TARGET_DEFAULT_IGNORE ();
+
+    /* Detaches from the inferior.  Note that on targets that support
+       async execution (i.e., targets where it is possible to detach
+       from programs with threads running), the target is responsible
+       for removing breakpoints from the program before the actual
+       detach, otherwise the program dies when it hits one.  */
     virtual void detach (inferior *, int)
       TARGET_DEFAULT_IGNORE ();
+
     virtual void disconnect (const char *, int)
       TARGET_DEFAULT_NORETURN (tcomplain ());
     virtual void resume (ptid_t,
@@ -680,8 +687,8 @@ struct target_ops
       TARGET_DEFAULT_RETURN (NULL);
     virtual void log_command (const char *)
       TARGET_DEFAULT_IGNORE ();
-    virtual target_section_table *get_section_table ()
-      TARGET_DEFAULT_RETURN (NULL);
+    virtual const target_section_table *get_section_table ()
+      TARGET_DEFAULT_RETURN (default_get_section_table ());
 
     /* Provide default values for all "must have" methods.  */
     virtual bool has_all_memory () { return false; }
@@ -1866,7 +1873,7 @@ extern enum auto_boolean target_non_stop_enabled;
 /* Is the target in non-stop mode?  Some targets control the inferior
    in non-stop mode even with "set non-stop off".  Always true if "set
    non-stop" is on.  */
-extern int target_is_non_stop_p (void);
+extern bool target_is_non_stop_p ();
 
 /* Return true if at least one inferior has a non-stop target.  */
 extern bool exists_non_stop_target ();
@@ -2385,6 +2392,20 @@ extern void push_target (target_ops_up &&);
 
 extern int unpush_target (struct target_ops *);
 
+/* A unique_ptr helper to unpush a target.  */
+
+struct target_unpusher
+{
+  void operator() (struct target_ops *ops) const
+  {
+    unpush_target (ops);
+  }
+};
+
+/* A unique_ptr that unpushes a target on destruction.  */
+
+typedef std::unique_ptr<struct target_ops, target_unpusher> target_unpush_up;
+
 extern void target_pre_inferior (int);
 
 extern void target_preopen (int);
@@ -2406,15 +2427,19 @@ extern CORE_ADDR target_translate_tls_address (struct objfile *objfile,
                                               CORE_ADDR offset);
 
 /* Return the "section" containing the specified address.  */
-struct target_section *target_section_by_addr (struct target_ops *target,
-                                              CORE_ADDR addr);
+const struct target_section *target_section_by_addr (struct target_ops *target,
+                                                    CORE_ADDR addr);
 
 /* Return the target section table this target (or the targets
    beneath) currently manipulate.  */
 
-extern target_section_table *target_get_section_table
+extern const target_section_table *target_get_section_table
   (struct target_ops *target);
 
+/* Default implementation of get_section_table for dummy_target.  */
+
+extern const target_section_table *default_get_section_table ();
+
 /* From mem-break.c */
 
 extern int memory_remove_breakpoint (struct target_ops *,
@@ -2473,15 +2498,6 @@ extern gdb::optional<gdb::char_vector> target_get_osdata (const char *type);
 
 /* Stuff that should be shared among the various remote targets.  */
 
-/* Debugging level.  0 is off, and non-zero values mean to print some debug
-   information (higher values, more information).  */
-extern int remote_debug;
-
-/* Speed in bits per second, or -1 which means don't mess with the speed.  */
-extern int baud_rate;
-
-/* Parity for serial port  */
-extern int serial_parity;
 
 /* Timeout limit for response from target.  */
 extern int remote_timeout;
This page took 0.024848 seconds and 4 git commands to generate.