Dont panic if .debug_frame section is not found. Log and exit

This commit is contained in:
epipho 2015-01-21 01:31:37 -05:00 committed by Derek Parker
parent d9c3488f12
commit d7e535f25b

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