dwarf/line: do not consider end of sequence entries valid (#2235)
This is needed to fix the problem we have with 1.15.4+ after the backport is applied to it. The DWARF standard isn't clear on what should happen with the end_of_sequence opcode but this is consistent with debug/dwarf.LineReader as well as gdb.
This commit is contained in:
parent
731f5ed346
commit
34ffa2e763
@ -43,6 +43,7 @@ type DebugLineInfo struct {
|
|||||||
// if normalizeBackslash is true all backslashes (\) will be converted into forward slashes (/)
|
// if normalizeBackslash is true all backslashes (\) will be converted into forward slashes (/)
|
||||||
normalizeBackslash bool
|
normalizeBackslash bool
|
||||||
ptrSize int
|
ptrSize int
|
||||||
|
endSeqIsValid bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileEntry struct {
|
type FileEntry struct {
|
||||||
|
|||||||
@ -543,7 +543,7 @@ func fixedadvancepc(sm *StateMachine, buf *bytes.Buffer) {
|
|||||||
|
|
||||||
func endsequence(sm *StateMachine, buf *bytes.Buffer) {
|
func endsequence(sm *StateMachine, buf *bytes.Buffer) {
|
||||||
sm.endSeq = true
|
sm.endSeq = true
|
||||||
sm.valid = true
|
sm.valid = sm.dbl.endSeqIsValid
|
||||||
}
|
}
|
||||||
|
|
||||||
func setaddress(sm *StateMachine, buf *bytes.Buffer) {
|
func setaddress(sm *StateMachine, buf *bytes.Buffer) {
|
||||||
|
|||||||
@ -80,6 +80,7 @@ func TestGrafana(t *testing.T) {
|
|||||||
cuname, _ := e.Val(dwarf.AttrName).(string)
|
cuname, _ := e.Val(dwarf.AttrName).(string)
|
||||||
|
|
||||||
lineInfo := Parse(e.Val(dwarf.AttrCompDir).(string), debugLineBuffer, t.Logf, 0, false, 8)
|
lineInfo := Parse(e.Val(dwarf.AttrCompDir).(string), debugLineBuffer, t.Logf, 0, false, 8)
|
||||||
|
lineInfo.endSeqIsValid = true
|
||||||
sm := newStateMachine(lineInfo, lineInfo.Instructions, 8)
|
sm := newStateMachine(lineInfo, lineInfo.Instructions, 8)
|
||||||
|
|
||||||
lnrdr, err := data.LineReader(e)
|
lnrdr, err := data.LineReader(e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user