
#
# Standard Helios Debugger startup file.
#

alias home	[view $loc]
alias safequit	[dialog -p [Quit (y/n) ? ] -q ans ; quit]
alias ?		print
alias wp	watchpoint
alias bp	breakpoint
alias tu	[thread -u]
alias td	[thread -d]
alias del	delete

alias mkalias	[dialog -p [Alias name: ] name ; dialog -p [Alias text: ] text ; alias $name $text]
alias mkdefine	[dialog -p [Define name: ] name ; dialog -p [Define text: ] text ; define $name $text]
alias mkkey	[dialog -p [Key name: ] name ; dialog -p [Command: ] text ; key $name $text]
alias dohelp	[menu -t [Help Menu] \
			help -l [General help] \
			[help Commands] -l [Commands] \
			[help Expressions] -l [Expressions] \
			[help Macros] -l [Macros] \
		]

#
# Control keys
#
key ctrl-a	[mkalias]
key ctrl-b	[breakpoint -t $curloc]
key ctrl-c	[stop -a]
key ctrl-d	[mkdefine]
key ctrl-e	[edit]
key ctrl-f	[dialog -p [Find string: ] str ; search $str]
key ctrl-g	[go]
key ctrl-h	[home]
key ctrl-k	[dialog -p [Kill this process (y/n) ? ] -q ans ; kill]
key ctrl-l	[refresh]
key ctrl-o	[step -o]
key ctrl-p	[printenv]
key ctrl-q	[safequit]
key ctrl-r	[go -r]
key ctrl-s	[step]
key ctrl-t	[timeout]
key ctrl-u	[go -u $curloc]
key ctrl-v	[dialog -p [view location: ] vloc ; view $vloc]
key ctrl-w	[where]

#
# Special keys
#
key delete	[stop -a]
key help	[dohelp]
key home	[home]
key return	[print $txt]
key space	[$buf]
key undo	[safequit]
key .		[dialog -p "> " cmd ; do $cmd]

#
# Function keys
#
key f1		[menu -t [General Menu] \
			[dohelp] -l [Help] \
			[version] -l [Display version] \
			[dialog -p [Command file ? ] cmdfile ; input $cmdfile] -l [Execute command file] \
			[safequit] -l [Quit] \
		]
key f2		[menu -t [Monitor Menu] \
			[print $txt] -l [Print $txt] \
			[print -i $txt] -l [Print with indirection $txt] \
			[whatis $txt] -l [Whatis $txt] \
			[breakpoint $curloc] -l [Set breakpoint at line $curline of $curfile] \
			[watchpoint $txt] -l [Watch $txt] \
		]
key f3		[menu -t [Control Menu] \
			[step] -l [Single step] \
			[step -o] -l [Step over] \
			[dialog -p [Step count ? ] count ; step -c $count] -l [Step with count] \
			[go -r] -l [Return from function] \
			[go -u $curloc] -l [Goto $curloc] \
			[go] -l Go \
			[stop] -l [Stop] \
		]
key f4		[menu -t [Process control] \
			[free] -l [Free process] \
			[free -a] -l [Free task] \
			[kill] -l [Kill process] \
			[kill -a] -l [Kill task] \
		]
key f5		[menu -t [Macro Menu] \
			[mkalias] -l [Create an command alias] \
			[mkdefine] -l [Create a define macro] \
			[mkkey] -l [Create a key binding] \
		]
key f6		[menu -t [Development Menu] \
			[pwd] -l [Print current directory] \
			[dialog -p [Directory ? ] dir ; cd $dir] -l [Change current directory] \
			[printenv] -l [Display program environment] \
			[edit] -l [Edit $file] \
			[make] -l [Make program] \
			[shell] -l [Helios shell] \
		]
key f7		[menu -t [List Menu] \
			[list -a] -l [List command aliases] \
			[list -d] -l [List define macros] \
			[list -k] -l [List key bindings] \
			[list -b] -l [List breakpoints] \
			[list -w] -l [List watchpoints] \
		]
key f8		[menu -t [Delete Menu] \
			[dialog -p "Alias name ? " name ; unalias $name] -l [Delete a command alias] \
			[dialog -p "Define name ? " name ; undefine $name] -l [Delete a define macro] \
			[dialog -p "Key name ? " name ; key -o $name] -l [Delete a key binding] \
			[dialog -p "Breakpoint location ? " name ; breakpoint -o $name] -l [Delete a breakpoint] \
			[dialog -p "Watchpoint number ? " name ; delete -w $name] -l [Delete a watchpoint] \
		]
key f9		[menu -t [Search Menu] \
			[dialog -p [String ? ] str ; search $str] -l [Search for string] \
			[dialog -p [String ? ] str ; search -b $str] -l [Reverse search] \
			[search -w] -l [Find next] \
			[search -b -w] -l [Find previous] \
		]

key shift-f1	[thread -d]
key shift-f2	[thread -u]
key shift-f3	[cursor -g]
key shift-f4	[cursor -s]
key shift-f5	[window -g]
key shift-f6	[window -s]

#
# Cursor keys
#
key left	[cursor -l]
key right	[cursor -r]
key up		[cursor -u]
key down	[cursor -d]
#
# Note : on certain machines, it is not possible to detect shifted arrow 
# keys. Furthermore, PageUp & PageDown are PC-specific
#
key shift-left	[cursor -s]
key shift-right	[cursor -g]
key shift-up	[thread -u]
key shift-down	[thread -d]
key pagedown    [page -d]
key pageup      [page -u]
#
# Move around the screen a bit faster ...
#
key f10		[cursor -r ; cursor -r ; cursor -r ; cursor -r]
key shift-f10	[cursor -l ; cursor -l ; cursor -l ; cursor -l]
