/* only allocate multiples of 4 byte */
if (size % 4)
{
/* only allocate multiples of 4 byte */
if (size % 4)
{
- LOG_ERROR("BUG: code tried to allocate unaligned number of bytes, padding");
- size = CEIL(size, 4);
+ LOG_ERROR("BUG: code tried to allocate unaligned number of bytes (0x%08x), padding", ((unsigned)(size)));
+ size = (size + 3) & (~3);
}
/* see if there's already a matching working area */
}
/* see if there's already a matching working area */
- LOG_WARNING("not enough working area available(requested %d, free %d)", size, free_size);
+ LOG_WARNING("not enough working area available(requested %u, free %u)",
+ (unsigned)(size), (unsigned)(free_size));
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
}
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
}
int target_write_buffer(struct target_s *target, uint32_t address, uint32_t size, uint8_t *buffer)
{
int retval;
int target_write_buffer(struct target_s *target, uint32_t address, uint32_t size, uint8_t *buffer)
{
int retval;
- LOG_DEBUG("writing buffer of %i byte at 0x%8.8x", size, address);
+ LOG_DEBUG("writing buffer of %i byte at 0x%8.8x",
+ (int)size, (unsigned)address);
if (!target_was_examined(target))
{
if (!target_was_examined(target))
{
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
- LOG_ERROR("address+size wrapped(0x%08x, 0x%08x)", address, size);
+ LOG_ERROR("address+size wrapped(0x%08x, 0x%08x)",
+ (unsigned)address,
+ (unsigned)size);
int target_read_buffer(struct target_s *target, uint32_t address, uint32_t size, uint8_t *buffer)
{
int retval;
int target_read_buffer(struct target_s *target, uint32_t address, uint32_t size, uint8_t *buffer)
{
int retval;
- LOG_DEBUG("reading buffer of %i byte at 0x%8.8x", size, address);
+ LOG_DEBUG("reading buffer of %i byte at 0x%8.8x",
+ (int)size, (unsigned)address);
if (!target_was_examined(target))
{
if (!target_was_examined(target))
{
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
- LOG_ERROR("address+size wrapped(0x%08x, 0x%08x)", address, size);
+ LOG_ERROR("address+size wrapped(0x%08" PRIx32 ", 0x%08" PRIx32 ")",
+ address,
+ size);
buffer = malloc(size);
if (buffer == NULL)
{
buffer = malloc(size);
if (buffer == NULL)
{
- LOG_ERROR("error allocating buffer for section (%d bytes)", size);
+ LOG_ERROR("error allocating buffer for section (%d bytes)", (int)size);
return ERROR_INVALID_ARGUMENTS;
}
retval = target_read_buffer(target, address, size, buffer);
return ERROR_INVALID_ARGUMENTS;
}
retval = target_read_buffer(target, address, size, buffer);
if (retval == ERROR_OK)
{
*value = target_buffer_get_u32(target, value_buf);
if (retval == ERROR_OK)
{
*value = target_buffer_get_u32(target, value_buf);
- LOG_DEBUG("address: 0x%8.8x, value: 0x%8.8x", address, *value);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%8.8" PRIx32 "",
+ address,
+ *value);
- LOG_DEBUG("address: 0x%8.8x failed", address);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 " failed",
+ address);
if (retval == ERROR_OK)
{
*value = target_buffer_get_u16(target, value_buf);
if (retval == ERROR_OK)
{
*value = target_buffer_get_u16(target, value_buf);
- LOG_DEBUG("address: 0x%8.8x, value: 0x%4.4x", address, *value);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%4.4x",
+ address,
+ *value);
- LOG_DEBUG("address: 0x%8.8x failed", address);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 " failed",
+ address);
if (retval == ERROR_OK)
{
if (retval == ERROR_OK)
{
- LOG_DEBUG("address: 0x%8.8x, value: 0x%2.2x", address, *value);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%2.2x",
+ address,
+ *value);
- LOG_DEBUG("address: 0x%8.8x failed", address);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 " failed",
+ address);
- LOG_DEBUG("address: 0x%8.8x, value: 0x%8.8x", address, value);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%8.8" PRIx32 "",
+ address,
+ value);
target_buffer_set_u32(target, value_buf, value);
if ((retval = target_write_memory(target, address, 4, 1, value_buf)) != ERROR_OK)
target_buffer_set_u32(target, value_buf, value);
if ((retval = target_write_memory(target, address, 4, 1, value_buf)) != ERROR_OK)
- LOG_DEBUG("address: 0x%8.8x, value: 0x%8.8x", address, value);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%8.8x",
+ address,
+ value);
target_buffer_set_u16(target, value_buf, value);
if ((retval = target_write_memory(target, address, 2, 1, value_buf)) != ERROR_OK)
target_buffer_set_u16(target, value_buf, value);
if ((retval = target_write_memory(target, address, 2, 1, value_buf)) != ERROR_OK)
- LOG_DEBUG("address: 0x%8.8x, value: 0x%2.2x", address, value);
+ LOG_DEBUG("address: 0x%8.8" PRIx32 ", value: 0x%2.2x",
+ address, value);
if ((retval = target_write_memory(target, address, 1, 1, &value)) != ERROR_OK)
{
if ((retval = target_write_memory(target, address, 1, 1, &value)) != ERROR_OK)
{
for (i = 0; i < cache->num_regs; i++)
{
value = buf_to_str(cache->reg_list[i].value, cache->reg_list[i].size, 16);
for (i = 0; i < cache->num_regs; i++)
{
value = buf_to_str(cache->reg_list[i].value, cache->reg_list[i].size, 16);
- command_print(cmd_ctx, "(%i) %s (/%i): 0x%s (dirty: %i, valid: %i)", count++, cache->reg_list[i].name, cache->reg_list[i].size, value, cache->reg_list[i].dirty, cache->reg_list[i].valid);
+ command_print(cmd_ctx, "(%i) %s (/%i): 0x%s (dirty: %i, valid: %i)",
+ count++,
+ cache->reg_list[i].name,
+ (int)(cache->reg_list[i].size),
+ value,
+ cache->reg_list[i].dirty,
+ cache->reg_list[i].valid);
free(value);
}
cache = cache->next;
free(value);
}
cache = cache->next;
arch_type->get(reg);
}
value = buf_to_str(reg->value, reg->size, 16);
arch_type->get(reg);
}
value = buf_to_str(reg->value, reg->size, 16);
- command_print(cmd_ctx, "%s (/%i): 0x%s", reg->name, reg->size, value);
+ command_print(cmd_ctx, "%s (/%i): 0x%s", reg->name, (int)(reg->size), value);
free(value);
return ERROR_OK;
}
free(value);
return ERROR_OK;
}
arch_type->set(reg, buf);
value = buf_to_str(reg->value, reg->size, 16);
arch_type->set(reg, buf);
value = buf_to_str(reg->value, reg->size, 16);
- command_print(cmd_ctx, "%s (/%i): 0x%s", reg->name, reg->size, value);
+ command_print(cmd_ctx, "%s (/%i): 0x%s", reg->name, (int)(reg->size), value);
{
output_len += snprintf(output + output_len,
sizeof(output) - output_len,
{
output_len += snprintf(output + output_len,
sizeof(output) - output_len,
- "0x%8.8x: ", address + (i*size));
+ "0x%8.8x: ",
+ (unsigned)(address + (i*size)));
buffer = malloc(image.sections[i].size);
if (buffer == NULL)
{
buffer = malloc(image.sections[i].size);
if (buffer == NULL)
{
- command_print(cmd_ctx, "error allocating buffer for section (%d bytes)", image.sections[i].size);
+ command_print(cmd_ctx,
+ "error allocating buffer for section (%d bytes)",
+ (int)(image.sections[i].size));
break;
}
image_size += length;
break;
}
image_size += length;
- command_print(cmd_ctx, "%u byte written at address 0x%8.8x", length, image.sections[i].base_address+offset);
+ command_print(cmd_ctx, "%u byte written at address 0x%8.8" PRIx32 "",
+ (unsigned int)length,
+ image.sections[i].base_address+offset);
- command_print(cmd_ctx, "downloaded %u byte in %s", image_size, duration_text);
+ command_print(cmd_ctx, "downloaded %u byte in %s",
+ (unsigned int)image_size,
+ duration_text);
buffer = malloc(image.sections[i].size);
if (buffer == NULL)
{
buffer = malloc(image.sections[i].size);
if (buffer == NULL)
{
- command_print(cmd_ctx, "error allocating buffer for section (%d bytes)", image.sections[i].size);
+ command_print(cmd_ctx,
+ "error allocating buffer for section (%d bytes)",
+ (int)(image.sections[i].size));
break;
}
if ((retval = image_read_section(&image, i, 0x0, image.sections[i].size, buffer, &buf_cnt)) != ERROR_OK)
break;
}
if ((retval = image_read_section(&image, i, 0x0, image.sections[i].size, buffer, &buf_cnt)) != ERROR_OK)
{
if (data[t] != buffer[t])
{
{
if (data[t] != buffer[t])
{
- command_print(cmd_ctx, "Verify operation failed address 0x%08x. Was 0x%02x instead of 0x%02x\n", t + image.sections[i].base_address, data[t], buffer[t]);
+ command_print(cmd_ctx,
+ "Verify operation failed address 0x%08x. Was 0x%02x instead of 0x%02x\n",
+ (unsigned)(t + image.sections[i].base_address),
+ data[t],
+ buffer[t]);
free(data);
free(buffer);
retval=ERROR_FAIL;
free(data);
free(buffer);
retval=ERROR_FAIL;
- command_print(cmd_ctx, "address 0x%08x length 0x%08x", image.sections[i].base_address, buf_cnt);
+ command_print(cmd_ctx, "address 0x%08" PRIx32 " length 0x%08" PRIx32 "",
+ image.sections[i].base_address,
+ buf_cnt);
- command_print(cmd_ctx, "verified %u bytes in %s", image_size, duration_text);
+ command_print(cmd_ctx, "verified %u bytes in %s",
+ (unsigned int)image_size,
+ duration_text);
{
char* buf = buf_to_str(breakpoint->orig_instr,
breakpoint->length, 16);
{
char* buf = buf_to_str(breakpoint->orig_instr,
breakpoint->length, 16);
- command_print(cmd_ctx, "0x%8.8x, 0x%x, %i, 0x%s",
- breakpoint->address, breakpoint->length,
+ command_print(cmd_ctx, "0x%8.8" PRIx32 ", 0x%x, %i, 0x%s",
+ breakpoint->address,
+ breakpoint->length,
breakpoint->set, buf);
free(buf);
}
else
{
breakpoint->set, buf);
free(buf);
}
else
{
- command_print(cmd_ctx, "0x%8.8x, 0x%x, %i",
- breakpoint->address, breakpoint->length, breakpoint->set);
+ command_print(cmd_ctx, "0x%8.8" PRIx32 ", 0x%x, %i",
+ breakpoint->address,
+ breakpoint->length, breakpoint->set);
}
breakpoint = breakpoint->next;
}
breakpoint = breakpoint->next;
target_t *target = get_current_target(cmd_ctx);
int retval = breakpoint_add(target, addr, length, hw);
if (ERROR_OK == retval)
target_t *target = get_current_target(cmd_ctx);
int retval = breakpoint_add(target, addr, length, hw);
if (ERROR_OK == retval)
- command_print(cmd_ctx, "breakpoint set at 0x%8.8x", addr);
+ command_print(cmd_ctx, "breakpoint set at 0x%8.8" PRIx32 "", addr);
else
LOG_ERROR("Failure setting breakpoint");
return retval;
else
LOG_ERROR("Failure setting breakpoint");
return retval;
- command_print(cmd_ctx, "address: 0x%8.8x, len: 0x%8.8x, r/w/a: %i, value: 0x%8.8x, mask: 0x%8.8x", watchpoint->address, watchpoint->length, watchpoint->rw, watchpoint->value, watchpoint->mask);
+ command_print(cmd_ctx,
+ "address: 0x%8.8" PRIx32 ", len: 0x%8.8x, r/w/a: %i, value: 0x%8.8" PRIx32 ", mask: 0x%8.8" PRIx32 "",
+ watchpoint->address,
+ watchpoint->length,
+ (int)(watchpoint->rw),
+ watchpoint->value,
+ watchpoint->mask);
watchpoint = watchpoint->next;
}
return ERROR_OK;
watchpoint = watchpoint->next;
}
return ERROR_OK;
target_t *target = get_current_target(cmd_ctx);
retval = target->type->virt2phys(target, va, &pa);
if (retval == ERROR_OK)
target_t *target = get_current_target(cmd_ctx);
retval = target->type->virt2phys(target, va, &pa);
if (retval == ERROR_OK)
- command_print(cmd_ctx, "Physical address 0x%08x", pa);
+ command_print(cmd_ctx, "Physical address 0x%08" PRIx32 "", pa);
} else {
char buf[100];
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
} else {
char buf[100];
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
- sprintf(buf, "mem2array address: 0x%08x is not aligned for %d byte reads", addr, width);
+ sprintf(buf, "mem2array address: 0x%08" PRIx32 " is not aligned for %" PRId32 " byte reads",
+ addr,
+ width);
Jim_AppendStrings(interp, Jim_GetResult(interp), buf , NULL);
return JIM_ERR;
}
Jim_AppendStrings(interp, Jim_GetResult(interp), buf , NULL);
return JIM_ERR;
}
retval = target_read_memory( target, addr, width, count, buffer );
if (retval != ERROR_OK) {
/* BOO !*/
retval = target_read_memory( target, addr, width, count, buffer );
if (retval != ERROR_OK) {
/* BOO !*/
- LOG_ERROR("mem2array: Read @ 0x%08x, w=%d, cnt=%d, failed", addr, width, count);
+ LOG_ERROR("mem2array: Read @ 0x%08x, w=%d, cnt=%d, failed",
+ (unsigned int)addr,
+ (int)width,
+ (int)count);
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
Jim_AppendStrings(interp, Jim_GetResult(interp), "mem2array: cannot read memory", NULL);
e = JIM_ERR;
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
Jim_AppendStrings(interp, Jim_GetResult(interp), "mem2array: cannot read memory", NULL);
e = JIM_ERR;
} else {
char buf[100];
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
} else {
char buf[100];
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
- sprintf(buf, "array2mem address: 0x%08x is not aligned for %d byte reads", addr, width);
+ sprintf(buf, "array2mem address: 0x%08x is not aligned for %d byte reads",
+ (unsigned int)addr,
+ (int)width);
Jim_AppendStrings(interp, Jim_GetResult(interp), buf , NULL);
return JIM_ERR;
}
Jim_AppendStrings(interp, Jim_GetResult(interp), buf , NULL);
return JIM_ERR;
}
retval = target_write_memory(target, addr, width, count, buffer);
if (retval != ERROR_OK) {
/* BOO !*/
retval = target_write_memory(target, addr, width, count, buffer);
if (retval != ERROR_OK) {
/* BOO !*/
- LOG_ERROR("array2mem: Write @ 0x%08x, w=%d, cnt=%d, failed", addr, width, count);
+ LOG_ERROR("array2mem: Write @ 0x%08x, w=%d, cnt=%d, failed",
+ (unsigned int)addr,
+ (int)width,
+ (int)count);
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
Jim_AppendStrings(interp, Jim_GetResult(interp), "array2mem: cannot read memory", NULL);
e = JIM_ERR;
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
Jim_AppendStrings(interp, Jim_GetResult(interp), "array2mem: cannot read memory", NULL);
e = JIM_ERR;
target_t *target;
LOG_DEBUG( "**all*targets: event: %d, %s",
target_t *target;
LOG_DEBUG( "**all*targets: event: %d, %s",
- e,
- Jim_Nvp_value2name_simple( nvp_target_event, e )->name );
+ (int)e,
+ Jim_Nvp_value2name_simple( nvp_target_event, e )->name );
target = all_targets;
while (target){
target = all_targets;
while (target){
buffer = malloc(image.sections[i].size);
if (buffer == NULL)
{
buffer = malloc(image.sections[i].size);
if (buffer == NULL)
{
- command_print(cmd_ctx, "error allocating buffer for section (%d bytes)", image.sections[i].size);
+ command_print(cmd_ctx, "error allocating buffer for section (%d bytes)",
+ (int)(image.sections[i].size));
fastload[i].length=length;
image_size += length;
fastload[i].length=length;
image_size += length;
- command_print(cmd_ctx, "%u byte written at address 0x%8.8x", length, image.sections[i].base_address+offset);
+ command_print(cmd_ctx, "%u byte written at address 0x%8.8x",
+ (unsigned int)length,
+ ((unsigned int)(image.sections[i].base_address+offset)));
duration_stop_measure(&duration, &duration_text);
if (retval==ERROR_OK)
{
duration_stop_measure(&duration, &duration_text);
if (retval==ERROR_OK)
{
- command_print(cmd_ctx, "Loaded %u bytes in %s", image_size, duration_text);
+ command_print(cmd_ctx, "Loaded %u bytes in %s", (unsigned int)image_size, duration_text);
command_print(cmd_ctx, "NB!!! image has not been loaded to target, issue a subsequent 'fast_load' to do so.");
}
free(duration_text);
command_print(cmd_ctx, "NB!!! image has not been loaded to target, issue a subsequent 'fast_load' to do so.");
}
free(duration_text);
for (i=0; i<fastload_num;i++)
{
target_t *target = get_current_target(cmd_ctx);
for (i=0; i<fastload_num;i++)
{
target_t *target = get_current_target(cmd_ctx);
- command_print(cmd_ctx, "Write to 0x%08x, length 0x%08x", fastload[i].address, fastload[i].length);
+ command_print(cmd_ctx, "Write to 0x%08x, length 0x%08x",
+ (unsigned int)(fastload[i].address),
+ (unsigned int)(fastload[i].length));
if (retval==ERROR_OK)
{
retval = target_write_buffer(target, fastload[i].address, fastload[i].length, fastload[i].data);
if (retval==ERROR_OK)
{
retval = target_write_buffer(target, fastload[i].address, fastload[i].length, fastload[i].data);
command_print(cmd_ctx, "Loaded image %f kBytes/s", (float)(size/1024.0)/((float)(after-ms)/1000.0));
return retval;
}
command_print(cmd_ctx, "Loaded image %f kBytes/s", (float)(size/1024.0)/((float)(after-ms)/1000.0));
return retval;
}
+
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)