};
/* Return a pretty printed form of TARGET_OPTIONS. */
-extern std::string target_options_to_string (int target_options);
+extern std::string target_options_to_string (target_wait_flags target_options);
/* Possible types of events that the inferior handler will have to
deal with. */
current target. inferior_ptid may also be null_ptid on
entry. */
virtual ptid_t wait (ptid_t, struct target_waitstatus *,
- int TARGET_DEBUG_PRINTER (target_debug_print_options))
+ target_wait_flags options)
TARGET_DEFAULT_FUNC (default_target_wait);
virtual void fetch_registers (struct regcache *, int)
TARGET_DEFAULT_IGNORE ();
virtual bool supports_evaluation_of_breakpoint_conditions ()
TARGET_DEFAULT_RETURN (false);
+ /* Does this target support native dumpcore API? */
+ virtual bool supports_dumpcore ()
+ TARGET_DEFAULT_RETURN (false);
+
+ /* Generate the core file with native target API. */
+ virtual void dumpcore (const char *filename)
+ TARGET_DEFAULT_IGNORE ();
+
/* Does this target support evaluation of breakpoint commands on its
end? */
virtual bool can_run_breakpoint_commands ()
extern ptid_t default_target_wait (struct target_ops *ops,
ptid_t ptid,
struct target_waitstatus *status,
- int options);
+ target_wait_flags options);
/* Fetch at least register REGNO, or all regs if regno == -1. No result. */
#define target_supports_evaluation_of_breakpoint_conditions() \
(current_top_target ()->supports_evaluation_of_breakpoint_conditions) ()
+/* Does this target support dumpcore API? */
+
+#define target_supports_dumpcore() \
+ (current_top_target ()->supports_dumpcore) ()
+
+/* Generate the core file with target API. */
+
+#define target_dumpcore(x) \
+ (current_top_target ()->dumpcore (x))
+
/* Returns true if this target can handle breakpoint commands
on its end. */
#define target_can_run_breakpoint_commands() \
(current_top_target ()->can_run_breakpoint_commands) ()
-extern int target_read_string (CORE_ADDR, gdb::unique_xmalloc_ptr<char> *,
- int, int *);
+/* Read a string from target memory at address MEMADDR. The string
+ will be at most LEN bytes long (note that excess bytes may be read
+ in some cases -- but these will not be returned). Returns nullptr
+ on error. */
+
+extern gdb::unique_xmalloc_ptr<char> target_read_string
+ (CORE_ADDR memaddr, int len, int *bytes_read = nullptr);
/* For target_read_memory see target/target.h. */