aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorNoah Moroze <noahmoroze@gmail.com>2024-05-15 22:39:12 -0400
committerAntonio Borneo <borneo.antonio@gmail.com>2024-06-08 08:42:34 +0000
commiteecba412cd8a6d515c925d87fe53e79881305517 (patch)
tree95f47621392a8bc6b835575fd57840d578dcd3a4 /tcl
parentc7c4d4d48c63c1048414779f633641ea4e9657c8 (diff)
downloadriscv-openocd-eecba412cd8a6d515c925d87fe53e79881305517.zip
riscv-openocd-eecba412cd8a6d515c925d87fe53e79881305517.tar.gz
riscv-openocd-eecba412cd8a6d515c925d87fe53e79881305517.tar.bz2
tcl/memory: fix syntax errors
Using a command in an expression requires a bracketed command substitution. These syntax errors were caught by tclint v0.2.5 (https://github.com/nmoroze/tclint): ``` tclint tcl/memory.tcl | grep "syntax error" ``` Change-Id: I510d46222f4fb02d6ef73121b231d5b2df77e5c0 Signed-off-by: Noah Moroze <noahmoroze@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8279 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Diffstat (limited to 'tcl')
-rw-r--r--tcl/memory.tcl4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcl/memory.tcl b/tcl/memory.tcl
index b111749..8b93b51 100644
--- a/tcl/memory.tcl
+++ b/tcl/memory.tcl
@@ -66,10 +66,10 @@ proc iswithin { ADDRESS BASE LEN } {
proc address_info { ADDRESS } {
foreach WHERE { FLASH RAM MMREGS XMEM UNKNOWN } {
- if { info exists $WHERE } {
+ if { [info exists $WHERE] } {
set lmt [set N_[set WHERE]]
for { set region 0 } { $region < $lmt } { incr region } {
- if { iswithin $ADDRESS $WHERE($region,BASE) $WHERE($region,LEN) } {
+ if { [iswithin $ADDRESS $WHERE($region,BASE) $WHERE($region,LEN)] } {
return "$WHERE $region";
}
}