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

login
register
mail settings
Submitter Ian Taylor
Date May 16, 2012, 5:36 a.m.
Message ID <mcrfwb01yby.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/159519/
State New
Headers show

Comments

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

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())