proc: print runtime.curg._panic.arg on unrecovered-panic breakpoint (#833)

You usually want to know the reason for the panic when a panic happens,
it can be printed manually this is a small quality of life improvement.
This commit is contained in:
Alessandro Arzilli 2017-05-09 19:32:16 +02:00 committed by Derek Parker
parent 98a4ff7a9f
commit 862145f874
2 changed files with 2 additions and 0 deletions

@ -267,6 +267,7 @@ func Connect(addr string, path string, pid int, attempts int) (*Process, error)
bp, err := p.SetBreakpoint(panicpc, proc.UserBreakpoint, nil)
if err == nil {
bp.Name = "unrecovered-panic"
bp.Variables = []string{"runtime.curg._panic.arg"}
bp.ID = -1
p.breakpointIDCounter--
}

@ -418,6 +418,7 @@ func initializeDebugProcess(dbp *Process, path string, attach bool) (*Process, e
bp, err := dbp.SetBreakpoint(panicpc, proc.UserBreakpoint, nil)
if err == nil {
bp.Name = "unrecovered-panic"
bp.Variables = []string{"runtime.curg._panic.arg"}
bp.ID = -1
dbp.breakpointIDCounter--
}