Guard against insufficient args to print cmd

This commit is contained in:
Derek Parker
2014-10-17 08:25:40 -05:00
parent 5331dad93d
commit 5286c0180e

View File

@ -159,6 +159,10 @@ func breakpoint(p *proctl.DebuggedProcess, args ...string) error {
}
func printVar(p *proctl.DebuggedProcess, args ...string) error {
if len(args) == 0 {
return fmt.Errorf("Not enough arguments to print command")
}
val, err := p.EvalSymbol(args[0])
if err != nil {
return err