forked from auracaster/openocd
openocd: don't test 'debug_level' directly
Use the macro 'LOG_LEVEL_IS()' to test 'debug_level'. While there, use the macro 'LOG_LVL_*' in place of the numeric value. Skip all riscv code, as it is going to be updated soon from the external fork. Change-Id: Icad7e879e040d3b9cf1cc004c433f28725017493 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/9070 Tested-by: jenkins
This commit is contained in:
@@ -769,7 +769,7 @@ static int arc_exit_debug(struct target *target)
|
||||
target->state = TARGET_HALTED;
|
||||
CHECK_RETVAL(target_call_event_callbacks(target, TARGET_EVENT_HALTED));
|
||||
|
||||
if (debug_level >= LOG_LVL_DEBUG) {
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) {
|
||||
LOG_TARGET_DEBUG(target, "core stopped (halted) debug-reg: 0x%08" PRIx32, value);
|
||||
CHECK_RETVAL(arc_jtag_read_aux_reg_one(&arc->jtag_info, AUX_STATUS32_REG, &value));
|
||||
LOG_TARGET_DEBUG(target, "core STATUS32: 0x%08" PRIx32, value);
|
||||
@@ -824,7 +824,7 @@ static int arc_halt(struct target *target)
|
||||
CHECK_RETVAL(target_call_event_callbacks(target, TARGET_EVENT_HALTED));
|
||||
|
||||
/* some more debug information */
|
||||
if (debug_level >= LOG_LVL_DEBUG) {
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) {
|
||||
LOG_TARGET_DEBUG(target, "core stopped (halted) DEGUB-REG: 0x%08" PRIx32, value);
|
||||
CHECK_RETVAL(arc_get_register_value(target, "status32", &value));
|
||||
LOG_TARGET_DEBUG(target, "core STATUS32: 0x%08" PRIx32, value);
|
||||
@@ -1148,7 +1148,7 @@ static int arc_arch_state(struct target *target)
|
||||
{
|
||||
uint32_t pc_value;
|
||||
|
||||
if (debug_level < LOG_LVL_DEBUG)
|
||||
if (!LOG_LEVEL_IS(LOG_LVL_DEBUG))
|
||||
return ERROR_OK;
|
||||
|
||||
CHECK_RETVAL(arc_get_register_value(target, "pc", &pc_value));
|
||||
|
||||
@@ -323,7 +323,7 @@ static int arm720t_soft_reset_halt(struct target *target)
|
||||
return retval;
|
||||
} else
|
||||
break;
|
||||
if (debug_level >= 3)
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG))
|
||||
alive_sleep(100);
|
||||
else
|
||||
keep_alive();
|
||||
|
||||
@@ -637,7 +637,7 @@ int arm7_9_execute_sys_speed(struct target *target)
|
||||
if ((buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1))
|
||||
&& (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_SYSCOMP, 1)))
|
||||
break;
|
||||
if (debug_level >= 3)
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG))
|
||||
alive_sleep(100);
|
||||
else
|
||||
keep_alive();
|
||||
@@ -1088,7 +1088,7 @@ int arm7_9_soft_reset_halt(struct target *target)
|
||||
retval = jtag_execute_queue();
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
if (debug_level >= 3)
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG))
|
||||
alive_sleep(100);
|
||||
else
|
||||
keep_alive();
|
||||
|
||||
@@ -746,7 +746,7 @@ int arm920t_soft_reset_halt(struct target *target)
|
||||
return retval;
|
||||
} else
|
||||
break;
|
||||
if (debug_level >= 3) {
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) {
|
||||
/* do not eat all CPU, time out after 1 se*/
|
||||
alive_sleep(100);
|
||||
} else
|
||||
|
||||
@@ -544,7 +544,7 @@ int arm926ejs_soft_reset_halt(struct target *target)
|
||||
return retval;
|
||||
} else
|
||||
break;
|
||||
if (debug_level >= 1) {
|
||||
if (LOG_LEVEL_IS(LOG_LVL_WARNING)) {
|
||||
/* do not eat all CPU, time out after 1 se*/
|
||||
alive_sleep(100);
|
||||
} else
|
||||
|
||||
@@ -400,7 +400,7 @@ static int xscale_read_tx(struct target *target, int consume)
|
||||
}
|
||||
if (!((!(field0_in & 1)) && consume))
|
||||
goto done;
|
||||
if (debug_level >= 3) {
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) {
|
||||
LOG_DEBUG("waiting 100ms");
|
||||
alive_sleep(100); /* avoid flooding the logs */
|
||||
} else
|
||||
@@ -471,7 +471,7 @@ static int xscale_write_rx(struct target *target)
|
||||
}
|
||||
if (!(field0_in & 1))
|
||||
goto done;
|
||||
if (debug_level >= 3) {
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) {
|
||||
LOG_DEBUG("waiting 100ms");
|
||||
alive_sleep(100); /* avoid flooding the logs */
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user