This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Fix DWARF line lookup for different line info


This patch to libgo fixes the DWARF line lookup when one function has
different types of lines.  This happens when the line info includes,
e.g., discriminators.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu and power64-unknown-linux-gnu.  Committed to
mainline and 4.7 branch.

Ian

diff -r 28ec41c37bcf libgo/go/debug/dwarf/line.go
--- a/libgo/go/debug/dwarf/line.go	Fri Apr 20 11:38:11 2012 -0700
+++ b/libgo/go/debug/dwarf/line.go	Fri Apr 20 11:40:46 2012 -0700
@@ -415,6 +415,10 @@
 	if newLineInfo {
 		if len(lines) > 0 {
 			sort.Sort(lines[len(lines)-1].addrs)
+			p := &lines[len(lines)-1]
+			if len(p.addrs) > 0 && address > p.addrs[len(p.addrs)-1].pc {
+				p.addrs = append(p.addrs, oneLineInfo{address, p.addrs[len(p.addrs)-1].line})
+			}
 		}
 		lines = append(lines, mapLineInfo{line: lineInfo})
 	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]