summaryrefslogtreecommitdiff
path: root/src/startup.tcl
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-16 07:22:17 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-16 07:22:17 +0000
commit396d73ad0cf2f12f2eac1af2ba82ff4878dd78de (patch)
tree3b70c162c0f912732a07e8a7ce5828c962144971 /src/startup.tcl
parent8766d396176a277cf1af4ce9a0bbc20d62fe8eb5 (diff)
downloadopenocd_libswd-396d73ad0cf2f12f2eac1af2ba82ff4878dd78de.tar.gz
openocd_libswd-396d73ad0cf2f12f2eac1af2ba82ff4878dd78de.tar.bz2
openocd_libswd-396d73ad0cf2f12f2eac1af2ba82ff4878dd78de.tar.xz
openocd_libswd-396d73ad0cf2f12f2eac1af2ba82ff4878dd78de.zip
better error messages for target event scripts.
git-svn-id: svn://svn.berlios.de/openocd/trunk@810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/startup.tcl')
-rw-r--r--src/startup.tcl16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/startup.tcl b/src/startup.tcl
index dc3a0895..1f1d1e21 100644
--- a/src/startup.tcl
+++ b/src/startup.tcl
@@ -11,7 +11,6 @@
# Commands can be more than one word and they are stored
# as "flash banks" "help text x x x"
-global ocd_helptext
set ocd_helptext {}
proc add_help_text {cmd cmd_help} {
@@ -123,3 +122,18 @@ proc unknown {args} {
# the command twice.
return ""
}
+
+
+proc target_script {target_num eventname scriptname} {
+ if {[string compare $eventname reset]==0} {
+ set eventname post_reset
+ }
+
+ # This is the script we invoke
+ proc "target_[set eventname]_[set target_num]" {} "script $scriptname"
+
+}
+
+#add_help_text target_script "xxx"
+add_help_text target_script "<target#> <event=reset/pre_reset/post_halt/pre_resume/gdb_program_config> <script_file>"
+