New command 'types'

Lists all the types defined in the debugged program.
This commit is contained in:
aarzilli
2016-02-22 16:08:45 +01:00
committed by Derek Parker
parent 14a92352bc
commit c8f4cee97d
8 changed files with 113 additions and 14 deletions

View File

@ -75,6 +75,7 @@ func DebugCommands(client service.Client) *Commands {
{aliases: []string{"set"}, cmdFn: g0f0(setVar), helpMsg: "Changes the value of a variable."},
{aliases: []string{"sources"}, cmdFn: filterSortAndOutput(sources), helpMsg: "Print list of source files, optionally filtered by a regexp."},
{aliases: []string{"funcs"}, cmdFn: filterSortAndOutput(funcs), helpMsg: "Print list of functions, optionally filtered by a regexp."},
{aliases: []string{"types"}, cmdFn: filterSortAndOutput(types), helpMsg: "Print list of types, optionally filtered by a regexp."},
{aliases: []string{"args"}, cmdFn: filterSortAndOutput(g0f0filter(args)), helpMsg: "Print function arguments, optionally filtered by a regexp."},
{aliases: []string{"locals"}, cmdFn: filterSortAndOutput(g0f0filter(locals)), helpMsg: "Print function locals, optionally filtered by a regexp."},
{aliases: []string{"vars"}, cmdFn: filterSortAndOutput(vars), helpMsg: "Print package variables, optionally filtered by a regexp."},
@ -703,6 +704,10 @@ func funcs(t *Term, filter string) ([]string, error) {
return t.client.ListFunctions(filter)
}
func types(t *Term, filter string) ([]string, error) {
return t.client.ListTypes(filter)
}
func args(t *Term, scope api.EvalScope, filter string) ([]string, error) {
vars, err := t.client.ListFunctionArgs(scope)
if err != nil {