Do not panic on incorrect command arity
This commit is contained in:
parent
2f91684e7a
commit
2ea8ff1e74
@ -124,6 +124,10 @@ func next(p *proctl.DebuggedProcess, args ...string) error {
|
||||
}
|
||||
|
||||
func clear(p *proctl.DebuggedProcess, args ...string) error {
|
||||
if len(args) == 0 {
|
||||
return fmt.Errorf("not enough arguments")
|
||||
}
|
||||
|
||||
var (
|
||||
fn *gosym.Func
|
||||
pc uint64
|
||||
@ -167,6 +171,10 @@ func clear(p *proctl.DebuggedProcess, args ...string) error {
|
||||
}
|
||||
|
||||
func breakpoint(p *proctl.DebuggedProcess, args ...string) error {
|
||||
if len(args) == 0 {
|
||||
return fmt.Errorf("not enough arguments")
|
||||
}
|
||||
|
||||
var (
|
||||
fn *gosym.Func
|
||||
pc uint64
|
||||
@ -211,7 +219,7 @@ 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")
|
||||
return fmt.Errorf("not enough arguments")
|
||||
}
|
||||
|
||||
val, err := p.EvalSymbol(args[0])
|
||||
|
Loading…
Reference in New Issue
Block a user