diff --git a/proctl/proctl_linux_amd64.go b/proctl/proctl_linux_amd64.go index 3575bfa3..56d5b6c9 100644 --- a/proctl/proctl_linux_amd64.go +++ b/proctl/proctl_linux_amd64.go @@ -109,13 +109,17 @@ func (dbp *DebuggedProcess) findExecutable() (*elf.File, error) { func (dbp *DebuggedProcess) parseDebugFrame(exe *elf.File, wg *sync.WaitGroup) { defer wg.Done() - debugFrame, err := exe.Section(".debug_frame").Data() - if err != nil { - fmt.Println("could not get .debug_frame section", err) + if sec := exe.Section(".debug_frame"); sec != nil { + debugFrame, err := exe.Section(".debug_frame").Data() + if err != nil { + fmt.Println("could not get .debug_frame section", err) + os.Exit(1) + } + dbp.FrameEntries = frame.Parse(debugFrame) + } else { + fmt.Println("No debug symbols found") os.Exit(1) } - - dbp.FrameEntries = frame.Parse(debugFrame) } func (dbp *DebuggedProcess) obtainGoSymbols(exe *elf.File, wg *sync.WaitGroup) {