libgo patch committed: Fix handling of LineSetFile in DWARF line info

Submitted by Ian Taylor on May 16, 2012, 5:36 a.m.

Details

Message ID mcrfwb01yby.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Taylor May 16, 2012, 5:36 a.m.
This libgo patch fixes the handling of LineSetFile aka DW_LNS_set_file
in DWARF line info.  The DWARF number is one-based, but I am using it to
index into a zero-based array.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline and 4.7 branch.

Ian

Patch hide | download patch | download mbox

diff -r dd8c9c38c8c7 libgo/go/debug/dwarf/line.go
--- a/libgo/go/debug/dwarf/line.go	Tue May 15 17:25:30 2012 -0700
+++ b/libgo/go/debug/dwarf/line.go	Tue May 15 22:33:39 2012 -0700
@@ -359,7 +359,7 @@ 
 					b.error("DWARF file number out of range")
 					return
 				}
-				lineInfo.Filename = hdr.files[i]
+				lineInfo.Filename = hdr.files[i-1]
 				newLineInfo = true
 			case LineSetColumn:
 				lineInfo.Column = int(b.uint())