Line 27... |
Line 27... |
#
|
#
|
# Author(s):
|
# Author(s):
|
# - Olivier Girard, olgirard@gmail.com
|
# - Olivier Girard, olgirard@gmail.com
|
#
|
#
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
# $Rev: 119 $
|
# $Rev: 124 $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedDate: 2011-06-24 14:35:53 +0200 (Fri, 24 Jun 2011) $
|
# $LastChangedDate: 2011-10-27 09:38:36 +0200 (Thu, 27 Oct 2011) $
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
|
|
global mem_breakpoint
|
global mem_breakpoint
|
|
|
###############################################################################
|
###############################################################################
|
Line 351... |
Line 351... |
}
|
}
|
|
|
# Clear status
|
# Clear status
|
ClrStatus
|
ClrStatus
|
|
|
|
# Read current PC value
|
|
set pc [ReadReg 0]
|
|
|
# Incremental step
|
# Incremental step
|
StepCPU
|
StepCPU
|
|
|
return [rsp_stop_reply $sock "s"]
|
return [rsp_stop_reply $sock "s" $pc]
|
}
|
}
|
|
|
|
|
#-----------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------#
|
# The `C', `c', `S', `s', `vCont', `vAttach', `vRun', `vStopped', and `?' #
|
# The `C', `c', `S', `s', `vCont', `vAttach', `vRun', `vStopped', and `?' #
|
# packets can receive any of the below as a reply. Except for `?' and #
|
# packets can receive any of the below as a reply. Except for `?' and #
|
# `vStopped', that reply is only returned when the target halts. #
|
# `vStopped', that reply is only returned when the target halts. #
|
#-----------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------#
|
proc rsp_stop_reply {sock cmd} {
|
proc rsp_stop_reply {sock cmd {opt_val "0"}} {
|
|
|
# Wait until halted
|
# Wait until halted
|
while {![IsHalted]} {
|
while {![IsHalted]} {
|
|
|
# Wait a few milliseconds to prevent the gui from freezing
|
# Wait a few milliseconds to prevent the gui from freezing
|
Line 389... |
Line 392... |
set pc [ReadReg 0]
|
set pc [ReadReg 0]
|
regexp {0x(..)(..)} $pc match pc_hi pc_lo
|
regexp {0x(..)(..)} $pc match pc_hi pc_lo
|
set r4 [ReadReg 4]
|
set r4 [ReadReg 4]
|
regexp {0x(..)(..)} $r4 match r4_hi r4_lo
|
regexp {0x(..)(..)} $r4 match r4_hi r4_lo
|
|
|
|
# In case of a single step command, make sure that the PC
|
|
# value changes. If not, return an error otherwise GDB will
|
|
# end-up in an infinite loop.
|
|
if {$cmd == "s"} {
|
|
if {$opt_val == $pc} {
|
|
return "E05"
|
|
}
|
|
}
|
# return "S05"
|
# return "S05"
|
return "T0500:$pc_lo$pc_hi;04:$r4_lo$r4_hi;"
|
return "T0500:$pc_lo$pc_hi;04:$r4_lo$r4_hi;"
|
}
|
}
|
|
|
|
|