This is an automated email from Gerrit.

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

-- gerrit

commit 49402099ac5ed0071ac320ae136d52b3702c53d1
Author: Alamy Liu <[email protected]>
Date:   Mon Aug 10 13:57:44 2015 -0700

    Better debug information to know how many bits were displayed
    
    Original debugging message
    fields[0].in_value[672]: 0xFFFFFFFFFFFFFFFF5BA004775BA00477
    fields[0].out_value[10]: 0x03FF
    fields[0].in_value[10]: 0x0311
    
    Enhanced debugging message
    fields[0].in_value[128/672]: 0xFFFFFFFFFFFFFFFF5BA004775BA00477
    fields[0].out_value[10/10]: 0x03FF
    fields[0].in_value[10/10]: 0x0311
    
    * DEBUG_JTAG_IOZ defines the maximum bits to display
    
    Change-Id: I0e9d44e63c40433802a32de0a11875da346e94d1
    Signed-off-by: Alamy Liu <[email protected]>

diff --git a/src/jtag/commands.c b/src/jtag/commands.c
index 750ebab..9de9fcf 100644
--- a/src/jtag/commands.c
+++ b/src/jtag/commands.c
@@ -190,13 +190,14 @@ int jtag_build_buffer(const struct scan_command *cmd, 
uint8_t **buffer)
        for (i = 0; i < cmd->num_fields; i++) {
                if (cmd->fields[i].out_value) {
 #ifdef _DEBUG_JTAG_IO_
+                       int num_bits = cmd->fields[i].num_bits;
+                       int cvrt_bits = (num_bits > DEBUG_JTAG_IOZ)
+                                       ? DEBUG_JTAG_IOZ : num_bits;
                        char *char_buf = buf_to_str(cmd->fields[i].out_value,
-                               (cmd->fields[i].num_bits > DEBUG_JTAG_IOZ)
-                                       ? DEBUG_JTAG_IOZ
-                                       : cmd->fields[i].num_bits, 16);
+                                       cvrt_bits, 16);
 
-                       LOG_DEBUG("fields[%i].out_value[%i]: 0x%s", i,
-                                       cmd->fields[i].num_bits, char_buf);
+                       LOG_DEBUG("fields[%i].out_value[%i/%i]: 0x%s", i,
+                                       cvrt_bits, num_bits, char_buf);
                        free(char_buf);
 #endif
                        buf_set_buf(cmd->fields[i].out_value, 0, *buffer,
@@ -233,13 +234,12 @@ int jtag_read_buffer(uint8_t *buffer, const struct 
scan_command *cmd)
                                        malloc(DIV_ROUND_UP(num_bits, 8)), 0, 
num_bits);
 
 #ifdef _DEBUG_JTAG_IO_
-                       char *char_buf = buf_to_str(captured,
-                                       (num_bits > DEBUG_JTAG_IOZ)
-                                               ? DEBUG_JTAG_IOZ
-                                               : num_bits, 16);
+                       int cvrt_bits = (num_bits > DEBUG_JTAG_IOZ)
+                                       ? DEBUG_JTAG_IOZ : num_bits;
+                       char *char_buf = buf_to_str(captured, cvrt_bits, 16);
 
-                       LOG_DEBUG("fields[%i].in_value[%i]: 0x%s",
-                                       i, num_bits, char_buf);
+                       LOG_DEBUG("fields[%i].in_value[%i/%i]: 0x%s",
+                                       i, cvrt_bits, num_bits, char_buf);
                        free(char_buf);
 #endif
 

-- 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to