mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 20:20:40 +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 {
|
func clear(p *proctl.DebuggedProcess, args ...string) error {
|
||||||
|
if len(args) == 0 {
|
||||||
|
return fmt.Errorf("not enough arguments")
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
fn *gosym.Func
|
fn *gosym.Func
|
||||||
pc uint64
|
pc uint64
|
||||||
@ -167,6 +171,10 @@ func clear(p *proctl.DebuggedProcess, args ...string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func breakpoint(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 (
|
var (
|
||||||
fn *gosym.Func
|
fn *gosym.Func
|
||||||
pc uint64
|
pc uint64
|
||||||
@ -211,7 +219,7 @@ func breakpoint(p *proctl.DebuggedProcess, args ...string) error {
|
|||||||
|
|
||||||
func printVar(p *proctl.DebuggedProcess, args ...string) error {
|
func printVar(p *proctl.DebuggedProcess, args ...string) error {
|
||||||
if len(args) == 0 {
|
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])
|
val, err := p.EvalSymbol(args[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user