Not today.
Solution: Add a sub command to the target object command,
1) re-impliment the handle_reg_command as a JIM command.
http://sourceforge.net/p/openocd/code/ci/master/tree/src/target/target.c#l2444
<http://sourceforge.net/p/openocd/code/ci/master/tree/src/target/target.c#l2444>
2) add an entry to the target instance command table:
http://sourceforge.net/p/openocd/code/ci/master/tree/src/target/target.c#l4897
<http://sourceforge.net/p/openocd/code/ci/master/tree/src/target/target.c#l4897>
New command should recognize: Register numbers and target specific register
names.
Then something like this would work:
set x [$target reg -get NAME]
echo [format “Reg: 0x%08x, or %d” $x $x ]
Probably a: “-set” command would be good!
In some cases it might be good to have:
$target reg -pretty-print NAME
That might expand all the flag bits in a status register into human form.
Another example:
$target reg -get-field REGNAME FILENAME
$target reg -set-field REGNAME FILENAME
The advantage of the target instance (object commands) is you could … do
something like this:
$core0 halt
$core1 halt
set core0_pc [$core0 reg -get PC]
set core1_pc [$core1 reg -get PC]
-Duane.
> On Feb 20, 2015, at 8:31 AM, Kent Brinkley <[email protected]> wrote:
>
> Hello,
>
> 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
> r1 (/32): 0x94D3F5E8
> >reg pc
> pc (/32): 0xBFC00000
> >reg r1 [expr [reg pc]] - to assign the contents of the pc to r1 it fails to
> >do so.
> > reg r1
> r1 (/32): 0x94D3F5E8
>
> What am I overlooking here?
>
> Thanks for your help,
> Kent
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________
>
> <http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________>
> OpenOCD-devel mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/openocd-devel
> <https://lists.sourceforge.net/lists/listinfo/openocd-devel>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel