-
Notifications
You must be signed in to change notification settings - Fork 0
/
alias.go
48 lines (42 loc) · 939 Bytes
/
alias.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @file
* Functions for dealing with command aliases.
*
* Example aliases: b for breakpoint_set, r for run, etc.
*/
package command
import "strings"
/**
* Mapping between DBGp commands and their aliases.
*/
var shortCmdFullCmdMap map[string]string = map[string]string{
"b": "breakpoint_set",
"bg": "breakpoint_get",
"br": "breakpoint_remove",
"bl": "breakpoint_list",
"vl": "context_get",
"ev": "eval",
"var": "property_get",
"r": "run",
"stk": "stack_get",
"sr": "source",
"src": "source",
"s": "status",
"si": "step_into",
"so": "step_out",
"sv": "step_over",
"sov": "step_over",
"st": "stop",
}
/**
* Determine the real name for an alias.
*
* Non-aliases are assumed to be DBGp command names.
*/
func resolveAlias(potentialAlias string) (DBGpCmd string) {
DBGpCmd, ok := shortCmdFullCmdMap[potentialAlias]
if !ok {
DBGpCmd = strings.ToLower(potentialAlias)
}
return DBGpCmd
}