diff options
| author | Alessandro Arzilli <alessandro.arzilli@gmail.com> | 2017-05-02 16:46:01 +0200 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2017-05-18 23:10:50 +0000 |
| commit | 2ad41a30906ca1d0736f7efc40da60cb519a9f89 (patch) | |
| tree | 6b9c06e71157988d6c324ec005fb2fb87e9a5b6b /src/cmd/internal/obj/data.go | |
| parent | 0f0a51f1d12bb009034a38c69aa786ba62ca41e2 (diff) | |
| download | go-2ad41a30906ca1d0736f7efc40da60cb519a9f89.tar.xz | |
cmd/compile: output DWARF lexical blocks for local variables
Change compiler and linker to emit DWARF lexical blocks in .debug_info
section when compiling with -N -l.
Version of debug_info is updated from DWARF v2 to DWARF v3 since
version 2 does not allow lexical blocks with discontinuous PC ranges.
Remaining open problems:
- scope information is removed from inlined functions
- variables records do not have DW_AT_start_scope attributes so a
variable will shadow other variables with the same name as soon as its
containing scope begins, even before its declaration.
Updates #6913.
Updates #12899.
Change-Id: Idc6808788512ea20e7e45bcf782453acb416fb49
Reviewed-on: https://go-review.googlesource.com/40095
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/internal/obj/data.go')
| -rw-r--r-- | src/cmd/internal/obj/data.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go index 8b1bdb1056..23d1809e0c 100644 --- a/src/cmd/internal/obj/data.go +++ b/src/cmd/internal/obj/data.go @@ -120,7 +120,8 @@ func (s *LSym) WriteInt(ctxt *Link, off int64, siz int, i int64) { // WriteAddr writes an address of size siz into s at offset off. // rsym and roff specify the relocation for the address. func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) { - if siz != ctxt.Arch.PtrSize { + // Allow 4-byte addresses for DWARF. + if siz != ctxt.Arch.PtrSize && siz != 4 { ctxt.Diag("WriteAddr: bad address size %d in %s", siz, s.Name) } s.prepwrite(ctxt, off, siz) |
