openocd: use proper format with uint32_t

Modify the format strings to properly handle uint32_t data types.

Change-Id: I4de49bf02c9e37b72240224c23fc83abe8a4fa83
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5819
Tested-by: jenkins
This commit is contained in:
Antonio Borneo 2020-08-18 18:56:53 +02:00
parent 99add6227f
commit d3249fd45a
5 changed files with 14 additions and 14 deletions

View File

@ -119,7 +119,7 @@ int xilinx_read_bit_file(struct xilinx_bit_file *bit_file, const char *filename)
if (read_section(input_file, 4, 'e', &bit_file->length, &bit_file->data) != ERROR_OK)
return ERROR_PLD_FILE_LOAD_FAILED;
LOG_DEBUG("bit_file: %s %s %s,%s %" PRIi32 "", bit_file->source_file, bit_file->part_name,
LOG_DEBUG("bit_file: %s %s %s,%s %" PRIu32 "", bit_file->source_file, bit_file->part_name,
bit_file->date, bit_file->time, bit_file->length);
fclose(input_file);

View File

@ -248,7 +248,7 @@ static const struct rtos_register_stacking *get_stacking_info_arm926ejs(const st
LOG_DEBUG(" solicited stack");
return param->stacking_info + 0;
} else {
LOG_DEBUG(" interrupt stack: %u", flag);
LOG_DEBUG(" interrupt stack: %" PRIu32, flag);
return param->stacking_info + 1;
}
}

View File

@ -281,7 +281,7 @@ static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id,
struct reg *reg = register_get_by_number(curr->reg_cache, reg_num, true);
if (!reg) {
LOG_ERROR("Couldn't find register %d in thread %" PRId64 ".", reg_num,
LOG_ERROR("Couldn't find register %" PRIu32 " in thread %" PRId64 ".", reg_num,
thread_id);
return ERROR_FAIL;
}

View File

@ -1483,13 +1483,13 @@ static char *linux_ps_command(struct target *target)
if (temp->context)
tmp +=
sprintf(tmp,
"%" PRId32 "\t\t%" PRId32 "\t\t%" PRIx32 "\t\t%s\n",
"%" PRIu32 "\t\t%" PRIu32 "\t\t%" PRIx32 "\t\t%s\n",
temp->pid, temp->oncpu,
temp->asid, temp->name);
else
tmp +=
sprintf(tmp,
"%" PRId32 "\t\t%" PRId32 "\t\t%" PRIx32 "\t\t%s\n",
"%" PRIu32 "\t\t%" PRIu32 "\t\t%" PRIx32 "\t\t%s\n",
temp->pid, temp->oncpu,
temp->asid, temp->name);
}

View File

@ -1388,8 +1388,8 @@ static int gdb_set_register_packet(struct connection *connection,
}
if (chars != (DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2)) {
LOG_ERROR("gdb sent %d bits for a %d-bit register (%s)",
(int) chars * 4, reg_list[reg_num]->size, reg_list[reg_num]->name);
LOG_ERROR("gdb sent %zu bits for a %" PRIu32 "-bit register (%s)",
chars * 4, reg_list[reg_num]->size, reg_list[reg_num]->name);
free(bin_buf);
free(reg_list);
return ERROR_SERVER_REMOTE_CLOSED;
@ -2050,7 +2050,7 @@ static int gdb_generate_reg_type_description(struct target *target,
}
/* <vector id="id" type="type" count="count"/> */
xml_printf(&retval, tdesc, pos, size,
"<vector id=\"%s\" type=\"%s\" count=\"%d\"/>\n",
"<vector id=\"%s\" type=\"%s\" count=\"%" PRIu32 "\"/>\n",
type->id, type->reg_type_vector->type->id,
type->reg_type_vector->count);
@ -2097,11 +2097,11 @@ static int gdb_generate_reg_type_description(struct target *target,
* <field name="name" start="start" end="end"/> ...
* </struct> */
xml_printf(&retval, tdesc, pos, size,
"<struct id=\"%s\" size=\"%d\">\n",
"<struct id=\"%s\" size=\"%" PRIu32 "\">\n",
type->id, type->reg_type_struct->size);
while (field != NULL) {
xml_printf(&retval, tdesc, pos, size,
"<field name=\"%s\" start=\"%d\" end=\"%d\" type=\"%s\" />\n",
"<field name=\"%s\" start=\"%" PRIu32 "\" end=\"%" PRIu32 "\" type=\"%s\" />\n",
field->name, field->bitfield->start, field->bitfield->end,
gdb_get_reg_type_name(field->bitfield->type));
@ -2142,14 +2142,14 @@ static int gdb_generate_reg_type_description(struct target *target,
* <field name="name" start="start" end="end"/> ...
* </flags> */
xml_printf(&retval, tdesc, pos, size,
"<flags id=\"%s\" size=\"%d\">\n",
"<flags id=\"%s\" size=\"%" PRIu32 "\">\n",
type->id, type->reg_type_flags->size);
struct reg_data_type_flags_field *field;
field = type->reg_type_flags->fields;
while (field != NULL) {
xml_printf(&retval, tdesc, pos, size,
"<field name=\"%s\" start=\"%d\" end=\"%d\" type=\"%s\" />\n",
"<field name=\"%s\" start=\"%" PRIu32 "\" end=\"%" PRIu32 "\" type=\"%s\" />\n",
field->name, field->bitfield->start, field->bitfield->end,
gdb_get_reg_type_name(field->bitfield->type));
@ -2302,9 +2302,9 @@ static int gdb_generate_target_description(struct target *target, char **tdesc_o
xml_printf(&retval, &tdesc, &pos, &size,
"<reg name=\"%s\"", reg_list[i]->name);
xml_printf(&retval, &tdesc, &pos, &size,
" bitsize=\"%d\"", reg_list[i]->size);
" bitsize=\"%" PRIu32 "\"", reg_list[i]->size);
xml_printf(&retval, &tdesc, &pos, &size,
" regnum=\"%d\"", reg_list[i]->number);
" regnum=\"%" PRIu32 "\"", reg_list[i]->number);
if (reg_list[i]->caller_save)
xml_printf(&retval, &tdesc, &pos, &size,
" save-restore=\"yes\"");