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,
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; }
/* 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 ();
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);
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 *,
/* 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;