nds32: always polling after gdb attached
Do not turn on/off polling as leave/enter debug mode. Enable polling after gdb attached, and disable polling after gdb detached. Change-Id: Id64459b86f44937af7ea5ccfe2cd13e31732eecf Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1574 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
parent
9288a59aa1
commit
54d8a801b2
|
@ -2161,8 +2161,6 @@ int nds32_assert_reset(struct target *target)
|
||||||
struct aice_port_s *aice = target_to_aice(target);
|
struct aice_port_s *aice = target_to_aice(target);
|
||||||
struct nds32_cpu_version *cpu_version = &(nds32->cpu_version);
|
struct nds32_cpu_version *cpu_version = &(nds32->cpu_version);
|
||||||
|
|
||||||
jtag_poll_set_enabled(true);
|
|
||||||
|
|
||||||
if (target->reset_halt) {
|
if (target->reset_halt) {
|
||||||
if ((nds32->soft_reset_halt)
|
if ((nds32->soft_reset_halt)
|
||||||
|| (nds32->edm.version < 0x51)
|
|| (nds32->edm.version < 0x51)
|
||||||
|
@ -2205,7 +2203,9 @@ static int nds32_gdb_attach(struct nds32 *nds32)
|
||||||
}
|
}
|
||||||
|
|
||||||
target_halt(nds32->target);
|
target_halt(nds32->target);
|
||||||
target_poll(nds32->target);
|
|
||||||
|
/* turn on polling */
|
||||||
|
jtag_poll_set_enabled(true);
|
||||||
|
|
||||||
gdb_attached = true;
|
gdb_attached = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,8 +287,6 @@ static int nds32_v2_debug_entry(struct nds32 *nds32, bool enable_watchpoint)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("nds32_v2_debug_entry");
|
LOG_DEBUG("nds32_v2_debug_entry");
|
||||||
|
|
||||||
jtag_poll_set_enabled(false);
|
|
||||||
|
|
||||||
if (nds32->virtual_hosting)
|
if (nds32->virtual_hosting)
|
||||||
LOG_WARNING("<-- TARGET WARNING! Virtual hosting is not supported "
|
LOG_WARNING("<-- TARGET WARNING! Virtual hosting is not supported "
|
||||||
"under V1/V2 architecture. -->");
|
"under V1/V2 architecture. -->");
|
||||||
|
@ -387,8 +385,6 @@ static int nds32_v2_leave_debug_state(struct nds32 *nds32, bool enable_watchpoin
|
||||||
|
|
||||||
register_cache_invalidate(nds32->core_cache);
|
register_cache_invalidate(nds32->core_cache);
|
||||||
|
|
||||||
jtag_poll_set_enabled(true);
|
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,10 +422,6 @@ static int nds32_v2_deassert_reset(struct target *target)
|
||||||
retval = target_halt(target);
|
retval = target_halt(target);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
/* call target_poll() to avoid "Halt timed out" */
|
|
||||||
CHECK_RETVAL(target_poll(target));
|
|
||||||
} else {
|
|
||||||
jtag_poll_set_enabled(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
|
|
@ -254,12 +254,8 @@ static int nds32_v3_deassert_reset(struct target *target)
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* call target_poll() to avoid "Halt timed out" */
|
|
||||||
CHECK_RETVAL(target_poll(target));
|
|
||||||
} else {
|
} else {
|
||||||
/* reset-halt */
|
/* reset-halt */
|
||||||
jtag_poll_set_enabled(false);
|
|
||||||
|
|
||||||
struct nds32_v3_common *nds32_v3 = target_to_nds32_v3(target);
|
struct nds32_v3_common *nds32_v3 = target_to_nds32_v3(target);
|
||||||
struct nds32 *nds32 = &(nds32_v3->nds32);
|
struct nds32 *nds32 = &(nds32_v3->nds32);
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
|
|
|
@ -71,8 +71,6 @@ static int nds32_v3_debug_entry(struct nds32 *nds32, bool enable_watchpoint)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("nds32_v3_debug_entry");
|
LOG_DEBUG("nds32_v3_debug_entry");
|
||||||
|
|
||||||
jtag_poll_set_enabled(false);
|
|
||||||
|
|
||||||
enum target_state backup_state = nds32->target->state;
|
enum target_state backup_state = nds32->target->state;
|
||||||
nds32->target->state = TARGET_HALTED;
|
nds32->target->state = TARGET_HALTED;
|
||||||
|
|
||||||
|
@ -117,8 +115,6 @@ static int nds32_v3_debug_entry(struct nds32 *nds32, bool enable_watchpoint)
|
||||||
if (enable_watchpoint)
|
if (enable_watchpoint)
|
||||||
CHECK_RETVAL(v3_common_callback->activate_hardware_watchpoint(nds32->target));
|
CHECK_RETVAL(v3_common_callback->activate_hardware_watchpoint(nds32->target));
|
||||||
|
|
||||||
jtag_poll_set_enabled(true);
|
|
||||||
|
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,9 +224,6 @@ static int nds32_v3_leave_debug_state(struct nds32 *nds32, bool enable_watchpoin
|
||||||
target_add_breakpoint(target, &syscall_breakpoint);
|
target_add_breakpoint(target, &syscall_breakpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable polling */
|
|
||||||
jtag_poll_set_enabled(true);
|
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,10 +235,7 @@ static int nds32_v3m_deassert_reset(struct target *target)
|
||||||
retval = target_halt(target);
|
retval = target_halt(target);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
/* call target_poll() to avoid "Halt timed out" */
|
|
||||||
CHECK_RETVAL(target_poll(target));
|
|
||||||
} else {
|
|
||||||
jtag_poll_set_enabled(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
|
Loading…
Reference in New Issue