From: Paul F. <fer...@gm...> - 2015-02-21 07:24:37
|
Hi, On Fri, Feb 20, 2015 at 04:31:13PM +0000, Kent Brinkley wrote: > I want to do something every simple in a tcl script, is there a way to extract > the contents of register. If I do ... > >reg r1 [expr [reg pc]] - to assign the contents of the pc to r1 it fails to do > so. Here's the trick: reg r1 [lindex [ocd_reg pc] 2] ocd_reg is needed because of a silly wrapper around all of OpenOCD commands, lindex just extracts the third element of the list as returned by reg (list elements separated by spaces, the third element is the value). Just tried it on hardware, seems to work just fine. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |