mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
*: Show return values on CLI trace
This patch allows the `trace` CLI subcommand to display return values of a function. Additionally, it will also display information on where the function exited, which could also be helpful in determining the path taken during function execution. Fixes #388
This commit is contained in:
committed by
Alessandro Arzilli
parent
4db9939845
commit
3129aa7330
@ -405,13 +405,13 @@ func (scope *EvalScope) PtrSize() int {
|
||||
return scope.BinInfo.Arch.PtrSize()
|
||||
}
|
||||
|
||||
// NoGError returned when a G could not be found
|
||||
// ErrNoGoroutine returned when a G could not be found
|
||||
// for a specific thread.
|
||||
type NoGError struct {
|
||||
type ErrNoGoroutine struct {
|
||||
tid int
|
||||
}
|
||||
|
||||
func (ng NoGError) Error() string {
|
||||
func (ng ErrNoGoroutine) Error() string {
|
||||
return fmt.Sprintf("no G executing on thread %d", ng.tid)
|
||||
}
|
||||
|
||||
@ -433,7 +433,7 @@ func (v *Variable) parseG() (*G, error) {
|
||||
if thread, ok := mem.(Thread); ok {
|
||||
id = thread.ThreadID()
|
||||
}
|
||||
return nil, NoGError{tid: id}
|
||||
return nil, ErrNoGoroutine{tid: id}
|
||||
}
|
||||
for {
|
||||
if _, isptr := v.RealType.(*godwarf.PtrType); !isptr {
|
||||
|
||||
Reference in New Issue
Block a user