gdb_server: add target_debug_reason for program exit detection

Currently, there is no way to notify gdb that program has exited.
Add new target_debug_reason called DBG_REASON_EXIT to notify gdb
the condition has occured. If the debug reason is DBG_REASON_EXIT,
gdb_server will send 'W' packet to tell gdb the process has exited.

Change-Id: I7a371da292716a3e6ac4cc2c31b009a651fe047a
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1242
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Hsiangkai Wang
2013-03-06 09:39:52 +08:00
committed by Spencer Oliver
parent 0a4c8990c2
commit 399561eafa
4 changed files with 42 additions and 30 deletions
+7 -1
View File
@@ -1921,7 +1921,13 @@ int nds32_examine_debug_reason(struct nds32 *nds32)
&instruction))
return ERROR_FAIL;
target->debug_reason = DBG_REASON_BREAKPOINT;
/* hit 'break 0x7FFF' */
if ((instruction.info.opc_6 == 0x32) &&
(instruction.info.sub_opc == 0xA) &&
(instruction.info.imm == 0x7FFF)) {
target->debug_reason = DBG_REASON_EXIT;
} else
target->debug_reason = DBG_REASON_BREAKPOINT;
}
break;
case NDS32_DEBUG_DATA_ADDR_WATCHPOINT_PRECISE: