DBG_REASON_SINGLESTEP = 4,
DBG_REASON_NOTHALTED = 5,
DBG_REASON_EXIT = 6,
- DBG_REASON_UNDEFINED = 7,
+ DBG_REASON_EXC_CATCH = 7,
+ DBG_REASON_UNDEFINED = 8,
};
enum target_endianness {
/* file-I/O information for host to do syscall */
struct gdb_fileio_info *fileio_info;
+
+ char *gdb_port_override; /* target-specific override for gdb_port */
+
+ /* The semihosting information, extracted from the target. */
+ struct semihosting *semihosting;
};
struct target_list {
struct gdb_fileio_info {
char *identifier;
- uint32_t param_1;
- uint32_t param_2;
- uint32_t param_3;
- uint32_t param_4;
+ uint64_t param_1;
+ uint64_t param_2;
+ uint64_t param_3;
+ uint64_t param_4;
};
+/** Returns a description of the endianness for the specified target. */
+static inline const char *target_endianness(struct target *target)
+{
+ return (target->endianness == TARGET_ENDIAN_UNKNOWN) ? "unknown" :
+ (target->endianness == TARGET_BIG_ENDIAN) ? "big endian" : "little endian";
+}
+
/** Returns the instance-specific name of the specified target. */
static inline const char *target_name(struct target *target)
{
enum target_event event;
struct Jim_Interp *interp;
struct Jim_Obj *body;
- int has_percent;
struct target_event_action *next;
};
int (*callback)(struct target *target, size_t len, uint8_t *data, void *priv);
};
+enum target_timer_type {
+ TARGET_TIMER_TYPE_ONESHOT,
+ TARGET_TIMER_TYPE_PERIODIC
+};
+
struct target_timer_callback {
int (*callback)(void *priv);
- int time_ms;
- int periodic;
+ unsigned int time_ms;
+ enum target_timer_type type;
bool removed;
struct timeval when;
void *priv;
* or much more rarely than specified
*/
int target_register_timer_callback(int (*callback)(void *priv),
- int time_ms, int periodic, void *priv);
+ unsigned int time_ms, enum target_timer_type type, void *priv);
int target_unregister_timer_callback(int (*callback)(void *priv), void *priv);
int target_call_timer_callbacks(void);
/**
struct target *get_target_by_num(int num);
struct target *get_current_target(struct command_context *cmd_ctx);
+struct target *get_current_target_or_null(struct command_context *cmd_ctx);
struct target *get_target(const char *id);
/**
int target_hit_watchpoint(struct target *target,
struct watchpoint **watchpoint);
+/**
+ * Obtain the architecture for GDB.
+ *
+ * This routine is a wrapper for target->type->get_gdb_arch.
+ */
+const char *target_get_gdb_arch(struct target *target);
+
/**
* Obtain the registers for GDB.
*
struct reg **reg_list[], int *reg_list_size,
enum target_register_class reg_class);
+/**
+ * Check if @a target allows GDB connections.
+ *
+ * Some target do not implement the necessary code required by GDB.
+ */
+bool target_supports_gdb_connection(struct target *target);
+
/**
* Step the target.
*
*/
int target_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c);
+/**
+ * Return the highest accessible address for this target.
+ */
+target_addr_t target_address_max(struct target *target);
+/**
+ * Return the number of address bits this target supports.
+ *
+ * This routine is a wrapper for target->type->address_bits.
+ */
+unsigned target_address_bits(struct target *target);
/** Return the *name* of this targets current state */
const char *target_state_name(struct target *target);
#define ERROR_TARGET_TRANSLATION_FAULT (-309)
#define ERROR_TARGET_NOT_RUNNING (-310)
#define ERROR_TARGET_NOT_EXAMINED (-311)
+#define ERROR_TARGET_DUPLICATE_BREAKPOINT (-312)
extern bool get_target_reset_nag(void);