shared code. */
struct process_stratum_target
{
- /* Allows target to re-initialize connection-specific settings. */
- void (*handle_new_gdb_connection) (void);
-
- /* If not NULL, target-specific routine to process monitor command.
- Returns 1 if handled, or 0 to perform default processing. */
- int (*handle_monitor_command) (char *);
-
- /* Returns the core given a thread, or -1 if not known. */
- int (*core_of_thread) (ptid_t);
-
- /* Read loadmaps. Read LEN bytes at OFFSET into a buffer at MYADDR. */
- int (*read_loadmap) (const char *annex, CORE_ADDR offset,
- unsigned char *myaddr, unsigned int len);
-
- /* Target specific qSupported support. FEATURES is an array of
- features with COUNT elements. */
- void (*process_qsupported) (char **features, int count);
-
- /* Return 1 if the target supports tracepoints, 0 (or leave the
- callback NULL) otherwise. */
- int (*supports_tracepoints) (void);
-
/* Read PC from REGCACHE. */
CORE_ADDR (*read_pc) (struct regcache *regcache);
/* Returns true if exec events are supported. */
virtual bool supports_exec_events ();
+
+ /* Allows target to re-initialize connection-specific settings. */
+ virtual void handle_new_gdb_connection ();
+
+ /* The target-specific routine to process monitor command.
+ Returns 1 if handled, or 0 to perform default processing. */
+ virtual int handle_monitor_command (char *mon);
+
+ /* Returns the core given a thread, or -1 if not known. */
+ virtual int core_of_thread (ptid_t ptid);
+
+ /* Returns true if the read_loadmap target op is supported. */
+ virtual bool supports_read_loadmap ();
+
+ /* Read loadmaps. Read LEN bytes at OFFSET into a buffer at MYADDR. */
+ virtual int read_loadmap (const char *annex, CORE_ADDR offset,
+ unsigned char *myaddr, unsigned int len);
+
+ /* Target specific qSupported support. FEATURES is an array of
+ features with COUNT elements. */
+ virtual void process_qsupported (char **features, int count);
+
+ /* Return true if the target supports tracepoints, false otherwise. */
+ virtual bool supports_tracepoints ();
};
extern process_stratum_target *the_target;
the_target->pt->supports_exec_events ()
#define target_handle_new_gdb_connection() \
- do \
- { \
- if (the_target->handle_new_gdb_connection != NULL) \
- (*the_target->handle_new_gdb_connection) (); \
- } while (0)
+ the_target->pt->handle_new_gdb_connection ()
#define detach_inferior(proc) \
the_target->pt->detach (proc)
the_target->pt->async (enable)
#define target_process_qsupported(features, count) \
- do \
- { \
- if (the_target->process_qsupported) \
- the_target->process_qsupported (features, count); \
- } while (0)
+ the_target->pt->process_qsupported (features, count)
#define target_supports_catch_syscall() \
(the_target->supports_catch_syscall ? \
? (*the_target->get_ipa_tdesc_idx) () : 0)
#define target_supports_tracepoints() \
- (the_target->supports_tracepoints \
- ? (*the_target->supports_tracepoints) () : 0)
+ the_target->pt->supports_tracepoints ()
#define target_supports_fast_tracepoints() \
(the_target->install_fast_tracepoint_jump_pad != NULL)
void done_accessing_memory (void);
#define target_core_of_thread(ptid) \
- (the_target->core_of_thread ? (*the_target->core_of_thread) (ptid) \
- : -1)
+ the_target->pt->core_of_thread (ptid)
#define target_thread_name(ptid) \
(the_target->thread_name ? (*the_target->thread_name) (ptid) \