From 0fc4ed805bd2e68385b9c2607340a1e79d70015b Mon Sep 17 00:00:00 2001 From: aarzilli Date: Tue, 28 Nov 2017 15:42:50 +0100 Subject: [PATCH] dwarf/line: fix output for the last line of a compile unit The last entry of the debug_line table is supposed to be valid for every PC address greater than its address. --- pkg/dwarf/line/state_machine.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/dwarf/line/state_machine.go b/pkg/dwarf/line/state_machine.go index 72641e50..e8273c13 100644 --- a/pkg/dwarf/line/state_machine.go +++ b/pkg/dwarf/line/state_machine.go @@ -236,6 +236,9 @@ func (sm *StateMachine) PCToLine(pc uint64) (string, int, bool) { break } } + if sm.valid { + return sm.file, sm.line, true + } return "", 0, false }