mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 10:47:27 +08:00 
			
		
		
		
	Do not panic on incorrect command arity
This commit is contained in:
		| @ -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]) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Derek Parker
					Derek Parker