75 for (i = 0; i <
length; i++) {
78 line_len += snprintf(line + line_len, 128 - line_len,
"%8.8" PRIx32
" ",
le_to_h_u32(data + (4*i)));
81 line_len += snprintf(line + line_len, 128 - line_len,
"%4.4x ",
le_to_h_u16(data + (2*i)));
84 line_len += snprintf(line + line_len, 128 - line_len,
"%2.2x ", data[i]);
88 if ((i%8 == 7) || (i ==
length - 1)) {
127 if (((request & 0xff00) >> 8) == 0)
175 int do_all_targets = 0;
197 }
while (
target && do_all_targets);
206 int do_all_targets = 0;
237 }
while (
target && do_all_targets);
265 }
else if (!strcmp(
CMD_ARGV[0],
"disable")) {
276 (receiving) ? (
charmsg_mode ?
"charmsg" :
"enabled") :
"disabled");
283 .handler = handle_target_request_debugmsgs_command,
285 .help =
"display and/or modify reception of debug messages from target",
286 .usage =
"['enable'|'charmsg'|'disable']",
292 .
name =
"target_request",
294 .help =
"target request command group",
Support functions to access arbitrary bits in a byte array.
void command_print(struct command_invocation *cmd, const char *format,...)
void command_output_text(struct command_context *context, const char *data)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static int register_commands(struct command_context *cmd_ctx, const char *cmd_prefix, const struct command_registration *cmds)
Register one or more commands in the specified context, as children of parent (or top-level commends,...
#define LOG_USER_N(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
size_t size
Size of the control block search area.
struct debug_msg_receiver * next
struct command_context * cmd_ctx
int(* target_request_data)(struct target *target, uint32_t size, uint8_t *buffer)
struct debug_msg_receiver * dbgmsg
struct target_type * type
struct target * all_targets
struct target * get_current_target(struct command_context *cmd_ctx)
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified target.
static const struct command_registration target_req_command_handlers[]
int target_request_register_commands(struct command_context *cmd_ctx)
static int target_hexmsg(struct target *target, int size, uint32_t length)
bool target_got_message(void)
Read and clear the flag as to whether we got a message.
int delete_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target)
static int target_charmsg(struct target *target, uint8_t msg)
static int add_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target)
static int target_asciimsg(struct target *target, uint32_t length)
static const struct command_registration target_req_exec_command_handlers[]
int target_request(struct target *target, uint32_t request)
static struct debug_msg_receiver * find_debug_msg_receiver(struct command_context *cmd_ctx, struct target *target)
COMMAND_HANDLER(handle_target_request_debugmsgs_command)
enum target_req_cmd target_req_cmd_t
int trace_point(struct target *target, uint32_t number)
static uint16_t le_to_h_u16(const uint8_t *buf)
#define DIV_ROUND_UP(m, n)
Rounds m up to the nearest multiple of n using division.
static uint32_t le_to_h_u32(const uint8_t *buf)