better error messages for target event scripts.

git-svn-id: svn://svn.berlios.de/openocd/trunk@810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe
2008-07-16 07:22:17 +00:00
parent 8766d39617
commit 396d73ad0c
4 changed files with 20 additions and 40 deletions

View File

@@ -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>"