This is an automated email from Gerrit.

Evan Hunter ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/2888

-- gerrit

commit 90e2329300250fae83a226bc331ac175d5fbda92
Author: Evan Hunter <[email protected]>
Date:   Thu Jul 23 13:33:54 2015 +0100

    MSYS2: Fix printf errors about 64-bit types when compiling on MSYS2-MinGW32
    
    The following errors were occuring:
    error: format ‘%lld’ expects argument of type ‘long long int’, but argument 
6 has type ‘int64_t’ [-Werror=format=]
    
    Change-Id: I3571162e92d5e0ed14a79579d54755a4fd192db5
    Signed-off-by: Evan Hunter <[email protected]>

diff --git a/src/jtag/core.c b/src/jtag/core.c
index 74c2731..56560bf 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -1236,14 +1236,14 @@ static int jtag_validate_ircapture(void)
                if ((val & tap->ir_capture_mask) != tap->ir_capture_value) {
                        LOG_ERROR("%s: IR capture error; saw 0x%0*" PRIx64 " 
not 0x%0*" PRIx32,
                                jtag_tap_name(tap),
-                               (tap->ir_length + 7) / tap->ir_length, val,
+                               (tap->ir_length + 7) / tap->ir_length, 
(unsigned long long) val,
                                (tap->ir_length + 7) / tap->ir_length, 
tap->ir_capture_value);
 
                        retval = ERROR_JTAG_INIT_FAILED;
                        goto done;
                }
                LOG_DEBUG("%s: IR capture 0x%0*" PRIx64, jtag_tap_name(tap),
-                       (tap->ir_length + 7) / tap->ir_length, val);
+                       (tap->ir_length + 7) / tap->ir_length, (unsigned long 
long) val);
                chain_pos += tap->ir_length;
        }
 
diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c
index 1ce6807..63887c1 100644
--- a/src/rtos/FreeRTOS.c
+++ b/src/rtos/FreeRTOS.c
@@ -172,7 +172,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                        param->thread_count_width,
                        (uint8_t *)&thread_list_size);
        LOG_DEBUG("FreeRTOS: Read uxCurrentNumberOfTasks at 0x%" PRIx64 ", 
value %d\r\n",
-                                                                               
rtos->symbols[FreeRTOS_VAL_uxCurrentNumberOfTasks].address,
+                                                                               
(unsigned long long) rtos->symbols[FreeRTOS_VAL_uxCurrentNumberOfTasks].address,
                                                                                
thread_list_size);
 
        if (retval != ERROR_OK) {
@@ -193,8 +193,8 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                return retval;
        }
        LOG_DEBUG("FreeRTOS: Read pxCurrentTCB at 0x%" PRIx64 ", value 0x%" 
PRIx64 "\r\n",
-                                                                               
rtos->symbols[FreeRTOS_VAL_pxCurrentTCB].address,
-                                                                               
rtos->current_thread);
+                                                                               
(unsigned long long) rtos->symbols[FreeRTOS_VAL_pxCurrentTCB].address,
+                                                                               
(unsigned long long) rtos->current_thread);
 
        if ((thread_list_size  == 0) || (rtos->current_thread == 0)) {
                /* Either : No RTOS threads - there is always at least the 
current execution though */
@@ -243,11 +243,11 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
        if (retval != ERROR_OK)
                return retval;
        LOG_DEBUG("FreeRTOS: Read uxTopUsedPriority at 0x%" PRIx64 ", value %" 
PRId64 "\r\n",
-                                                                               
rtos->symbols[FreeRTOS_VAL_uxTopUsedPriority].address,
-                                                                               
max_used_priority);
+                                                                               
(unsigned long long) rtos->symbols[FreeRTOS_VAL_uxTopUsedPriority].address,
+                                                                               
(unsigned long long) max_used_priority);
        if (max_used_priority > FREERTOS_MAX_PRIORITIES) {
                LOG_ERROR("FreeRTOS maximum used priority is unreasonably big, 
not proceeding: %" PRId64 "",
-                       max_used_priority);
+                       (unsigned long long) max_used_priority);
                return ERROR_FAIL;
        }
 
@@ -255,7 +255,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                malloc(sizeof(symbol_address_t) *
                        (max_used_priority+1 + 5));
        if (!list_of_lists) {
-               LOG_ERROR("Error allocating memory for %" PRId64 " priorities", 
max_used_priority);
+               LOG_ERROR("Error allocating memory for %" PRId64 " priorities", 
(unsigned long long) max_used_priority);
                return ERROR_FAIL;
        }
 
@@ -286,7 +286,8 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                        return retval;
                }
                LOG_DEBUG("FreeRTOS: Read thread count for list %d at 0x%" 
PRIx64 ", value %" PRId64 "\r\n",
-                                                                               
i, list_of_lists[i], list_thread_count);
+                                                                               
i, (unsigned long long) list_of_lists[i],
+                                                                               
(unsigned long long) list_thread_count);
 
                if (list_thread_count == 0)
                        continue;
@@ -304,7 +305,8 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                        return retval;
                }
                LOG_DEBUG("FreeRTOS: Read first item for list %d at 0x%" PRIx64 
", value 0x%" PRIx64 "\r\n",
-                                                                               
i, list_of_lists[i] + param->list_next_offset, list_elem_ptr);
+                                                                               
i, (unsigned long long) (list_of_lists[i] + param->list_next_offset),
+                                                                               
(unsigned long long) list_elem_ptr);
 
                while ((list_thread_count > 0) && (list_elem_ptr != 0) &&
                                (list_elem_ptr != prev_list_elem_ptr) &&
@@ -321,8 +323,8 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                                return retval;
                        }
                        LOG_DEBUG("FreeRTOS: Read Thread ID at 0x%" PRIx64 ", 
value 0x%" PRIx64 "\r\n",
-                                                                               
list_elem_ptr + param->list_elem_content_offset,
-                                                                               
rtos->thread_details[tasks_found].threadid);
+                                                                               
(unsigned long long) (list_elem_ptr + param->list_elem_content_offset),
+                                                                               
(unsigned long long) rtos->thread_details[tasks_found].threadid);
 
                        /* get thread name */
 
@@ -341,7 +343,8 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                        }
                        tmp_str[FREERTOS_THREAD_NAME_STR_SIZE-1] = '\x00';
                        LOG_DEBUG("FreeRTOS: Read Thread Name at 0x%" PRIx64 ", 
value \"%s\"\r\n",
-                                                                               
rtos->thread_details[tasks_found].threadid + param->thread_name_offset,
+                                                                               
(unsigned long long) (rtos->thread_details[tasks_found].threadid
+                                                                               
                        + param->thread_name_offset),
                                                                                
tmp_str);
 
                        if (tmp_str[0] == '\x00')
@@ -377,8 +380,8 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
                                return retval;
                        }
                        LOG_DEBUG("FreeRTOS: Read next thread location at 0x%" 
PRIx64 ", value 0x%" PRIx64 "\r\n",
-                                                                               
prev_list_elem_ptr + param->list_elem_next_offset,
-                                                                               
list_elem_ptr);
+                                                                               
(unsigned long long) (prev_list_elem_ptr + param->list_elem_next_offset),
+                                                                               
(unsigned long long) list_elem_ptr);
                }
        }
 
@@ -415,8 +418,8 @@ static int FreeRTOS_get_thread_reg_list(struct rtos *rtos, 
int64_t thread_id, ch
                return retval;
        }
        LOG_DEBUG("FreeRTOS: Read stack pointer at 0x%" PRIx64 ", value 0x%" 
PRIx64 "\r\n",
-                                                                               
thread_id + param->thread_stack_offset,
-                                                                               
stack_ptr);
+                                                                               
(unsigned long long) (thread_id + param->thread_stack_offset),
+                                                                               
(unsigned long long) stack_ptr);
 
        return rtos_generic_stack_read(rtos->target, param->stacking_info, 
stack_ptr, hex_reg_list);
 }
diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index c28236d..93b9136 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -218,7 +218,7 @@ static int linux_os_thread_reg_list(struct rtos *rtos,
                        LOG_ERROR
                        (
                                "current thread %" PRIx64 ": no target to 
perform access of core id %" PRIx32,
-                               thread_id,
+                               (unsigned long long) thread_id,
                                next->core_id);
                        return ERROR_FAIL;
                }
@@ -699,7 +699,7 @@ struct current_thread *add_current_thread(struct 
current_thread *currents,
 struct threads *liste_del_task(struct threads *task_list, struct threads **t,
        struct threads *prev)
 {
-       LOG_INFO("del task %" PRId64, (*t)->threadid);
+       LOG_INFO("del task %" PRId64, (unsigned long long) (*t)->threadid);
        prev->next = (*t)->next;
 
        if (prev == task_list)
@@ -840,8 +840,8 @@ int linux_get_tasks(struct target *target, int context)
        /*  check that all current threads have been identified  */
 
        LOG_INFO("complete time %" PRId64 ", thread mean %" PRId64 "\n",
-               (timeval_ms() - start),
-               (timeval_ms() - start) / linux_os->threadid_count);
+               (unsigned long long) (timeval_ms() - start),
+               (unsigned long long) ((timeval_ms() - start) / 
linux_os->threadid_count));
 
        LOG_INFO("threadid count %d", linux_os->threadid_count);
        free(t);
@@ -1110,7 +1110,7 @@ static int linux_task_update(struct target *target, int 
context)
        }
 
        LOG_INFO("update thread done %" PRId64 ", mean%" PRId64 "\n",
-               (timeval_ms() - start), (timeval_ms() - start) / loop);
+               (unsigned long long) (timeval_ms() - start), (unsigned long 
long) ((timeval_ms() - start) / loop));
        free(t);
        linux_os->threads_needs_update = 0;
        return ERROR_OK;
@@ -1142,7 +1142,7 @@ int linux_gdb_thread_packet(struct target *target,
        struct threads *temp = linux_os->thread_list;
 
        while (temp != NULL) {
-               tmp_str += sprintf(tmp_str, "%016" PRIx64, temp->threadid);
+               tmp_str += sprintf(tmp_str, "%016" PRIx64, (unsigned long long) 
temp->threadid);
                temp = temp->next;
                if (temp)
                        tmp_str += sprintf(tmp_str, ",");
@@ -1177,7 +1177,7 @@ int linux_gdb_thread_update(struct target *target,
                char *tmp_strr = out_strr;
                tmp_strr += sprintf(tmp_strr, "m");
                /*LOG_INFO("CHAR MALLOC & M DONE");*/
-               tmp_strr += sprintf(tmp_strr, "%016" PRIx64, temp->threadid);
+               tmp_strr += sprintf(tmp_strr, "%016" PRIx64, (unsigned long 
long) temp->threadid);
 
                temp = temp->next;
 
@@ -1185,7 +1185,7 @@ int linux_gdb_thread_update(struct target *target,
                        /*LOG_INFO("INTO GDB THREAD UPDATE WHILE");*/
                        tmp_strr += sprintf(tmp_strr, ",");
                        tmp_strr +=
-                               sprintf(tmp_strr, "%016" PRIx64, 
temp->threadid);
+                               sprintf(tmp_strr, "%016" PRIx64, (unsigned long 
long) temp->threadid);
                        temp = temp->next;
                }
 
diff --git a/src/rtos/mqx.c b/src/rtos/mqx.c
index 0ba462c..1a5f7d3 100644
--- a/src/rtos/mqx.c
+++ b/src/rtos/mqx.c
@@ -527,7 +527,7 @@ static int mqx_get_thread_reg_list(
                }
        }
        if (!my_task_addr) {
-               LOG_ERROR("MQX_RTOS - threadid %" PRId64 " does not match any 
task", thread_id);
+               LOG_ERROR("MQX_RTOS - threadid %" PRId64 " does not match any 
task", (unsigned long long) thread_id);
                return ERROR_FAIL;
        }
        /* get task stack head address */
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 3420d06..b0e935e 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -354,7 +354,7 @@ int rtos_thread_packet(struct connection *connection, char 
const *packet, int pa
                                char *tmp_str = out_str;
                                for (i = 0; i < target->rtos->thread_count; 
i++) {
                                        tmp_str += sprintf(tmp_str, "%c%016" 
PRIx64, i == 0 ? 'm' : ',',
-                                                                               
target->rtos->thread_details[i].threadid);
+                                                                               
(unsigned long long) target->rtos->thread_details[i].threadid);
                                }
                                gdb_put_packet(connection, out_str, 
strlen(out_str));
                                free(out_str);
@@ -381,7 +381,7 @@ int rtos_thread_packet(struct connection *connection, char 
const *packet, int pa
                if (target->rtos != NULL) {
                        char buffer[19];
                        int size;
-                       size = snprintf(buffer, 19, "QC%016" PRIx64, 
target->rtos->current_thread);
+                       size = snprintf(buffer, 19, "QC%016" PRIx64, (unsigned 
long long) target->rtos->current_thread);
                        gdb_put_packet(connection, buffer, size);
                } else
                        gdb_put_packet(connection, "QC0", 3);
@@ -409,7 +409,7 @@ int rtos_thread_packet(struct connection *connection, char 
const *packet, int pa
                if ((packet[1] == 'g') && (target->rtos != NULL)) {
                        sscanf(packet, "Hg%16" SCNx64, 
&target->rtos->current_threadid);
                        LOG_DEBUG("RTOS: GDB requested to set current thread to 
0x%" PRIx64 "\r\n",
-                                                                               
target->rtos->current_threadid);
+                                                                               
(unsigned long long) target->rtos->current_threadid);
                }
                gdb_put_packet(connection, "OK", 2);
                return ERROR_OK;
@@ -430,8 +430,8 @@ int rtos_get_gdb_reg_list(struct connection *connection)
 
                LOG_DEBUG("RTOS: getting register list for thread 0x%" PRIx64
                                  ", target->rtos->current_thread=0x%" PRIx64 
"\r\n",
-                                                                               
current_threadid,
-                                                                               
target->rtos->current_thread);
+                                                                               
(unsigned long long) current_threadid,
+                                                                               
(unsigned long long) target->rtos->current_thread);
 
                target->rtos->type->get_thread_reg_list(target->rtos,
                        current_threadid,
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 4a33a30..3788f32 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -759,7 +759,8 @@ static void gdb_signal_reply(struct target *target, struct 
connection *connectio
 
                current_thread[0] = '\0';
                if (target->rtos != NULL) {
-                       snprintf(current_thread, sizeof(current_thread), 
"thread:%016" PRIx64 ";", target->rtos->current_thread);
+                       snprintf(current_thread, sizeof(current_thread), 
"thread:%016" PRIx64 ";",
+                                                                       
(unsigned long long) target->rtos->current_thread);
                        target->rtos->current_threadid = 
target->rtos->current_thread;
                }
 
diff --git a/src/target/lakemont.c b/src/target/lakemont.c
index 17b0c12..a173f96 100644
--- a/src/target/lakemont.c
+++ b/src/target/lakemont.c
@@ -655,7 +655,7 @@ static int read_hw_reg(struct target *t, int reg, uint32_t 
*regval, uint8_t cach
        }
        LOG_DEBUG("reg=%s, op=0x%016" PRIx64 ", val=0x%08" PRIx32,
                        x86_32->cache->reg_list[reg].name,
-                       arch_info->op,
+                       (unsigned long long) arch_info->op,
                        *regval);
        return ERROR_OK;
 }
@@ -673,7 +673,7 @@ static int write_hw_reg(struct target *t, int reg, uint32_t 
regval, uint8_t cach
        buf_set_u32(reg_buf, 0, 32, regval);
        LOG_DEBUG("reg=%s, op=0x%016" PRIx64 ", val=0x%08" PRIx32,
                        x86_32->cache->reg_list[reg].name,
-                       arch_info->op,
+                       (unsigned long long) arch_info->op,
                        regval);
 
        scan.out[0] = RDWRPDR;
@@ -770,7 +770,7 @@ static int submit_instruction(struct target *t, int num)
 
 static int submit_reg_pir(struct target *t, int num)
 {
-       LOG_DEBUG("reg %s op=0x%016" PRIx64, regs[num].name, regs[num].op);
+       LOG_DEBUG("reg %s op=0x%016" PRIx64, regs[num].name, (unsigned long 
long) regs[num].op);
        int err = submit_pir(t, regs[num].op);
        if (err != ERROR_OK) {
                LOG_ERROR("%s error submitting pir", __func__);
@@ -782,7 +782,7 @@ static int submit_reg_pir(struct target *t, int num)
 static int submit_instruction_pir(struct target *t, int num)
 {
        LOG_DEBUG("%s op=0x%016" PRIx64, instructions[num].name,
-                       instructions[num].op);
+                       (unsigned long long) instructions[num].op);
        int err = submit_pir(t, instructions[num].op);
        if (err != ERROR_OK) {
                LOG_ERROR("%s error submitting pir", __func__);
diff --git a/src/target/target.c b/src/target/target.c
index 4ea445f..a0c1895 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -2151,12 +2151,12 @@ int target_read_u64(struct target *target, uint64_t 
address, uint64_t *value)
        if (retval == ERROR_OK) {
                *value = target_buffer_get_u64(target, value_buf);
                LOG_DEBUG("address: 0x%" PRIx64 ", value: 0x%16.16" PRIx64 "",
-                                 address,
-                                 *value);
+                                 (unsigned long long) address,
+                                 (unsigned long long) *value);
        } else {
                *value = 0x0;
                LOG_DEBUG("address: 0x%" PRIx64 " failed",
-                                 address);
+                                 (unsigned long long) address);
        }
 
        return retval;
@@ -2242,8 +2242,8 @@ int target_write_u64(struct target *target, uint64_t 
address, uint64_t value)
        }
 
        LOG_DEBUG("address: 0x%" PRIx64 ", value: 0x%16.16" PRIx64 "",
-                         address,
-                         value);
+                         (unsigned long long) address,
+                         (unsigned long long) value);
 
        target_buffer_set_u64(target, value_buf, value);
        retval = target_write_memory(target, address, 8, 1, value_buf);

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to