Re: [OpenOCD-devel] command_run_line changing target override

2019-06-07 Thread Christopher Head
Digging more deeply, it seems that there is another problem in command_run_line 
as well, which also makes it non-reentrant: it changes the context on the 
interp before running the command, then deletes the context rather than 
changing it back to its previous value after the command finishes.

Still not sure what the right fix is. I’m not an expert on the guts of JimTCL.
-- 
Christopher Head

signature.asc
Description: PGP signature
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] command_run_line changing target override

2019-06-07 Thread Christopher Head
Hi folks,
My OpenOCD config file tries to work with 0.10.0 and also current master. In 
this attempt, it does this in a target event handler, because the “dap 
memaccess” command syntax changed between the two versions:

catch {
  dap memaccess 16
} err
catch {
  [[target current] cget -dap] memaccess 16
} err

Since commit 0840414f (removal of ocd_ prefix), this breaks: the first catch 
block runs “dap memaccess”. That command does not exist, so ultimately the 
“usage” command is invoked via command_run_linef, which calls command_run_line, 
which sets context->current_target_override to NULL. Which of course breaks the 
event handler’s attempt to operate on the proper target in subsequent 
operations.

What is the proper fix for this? Should this be changed in OpenOCD, or should I 
write my script a different way?

Thanks!
-- 
Christopher Head

signature.asc
Description: PGP signature
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel