Commit 90fe9c7c authored by Cherry Zhang's avatar Cherry Zhang

[dev.link] cmd/internal/obj: convert "\" to "/" in file path

The old code does this. Do the same.

Change-Id: Ibf32ac347d6425e19ad0bc664c6b43ab5eba9c5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/201022
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarThan McIntosh <thanm@google.com>
parent 928623ca
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
"cmd/internal/goobj2" "cmd/internal/goobj2"
"cmd/internal/objabi" "cmd/internal/objabi"
"fmt" "fmt"
"path/filepath"
"strings" "strings"
) )
...@@ -200,11 +201,11 @@ func (w *writer) StringTable() { ...@@ -200,11 +201,11 @@ func (w *writer) StringTable() {
} }
pc := &s.Func.Pcln pc := &s.Func.Pcln
for _, f := range pc.File { for _, f := range pc.File {
w.AddString(f) w.AddString(filepath.ToSlash(f))
} }
for _, call := range pc.InlTree.nodes { for _, call := range pc.InlTree.nodes {
f, _ := linkgetlineFromPos(w.ctxt, call.Pos) f, _ := linkgetlineFromPos(w.ctxt, call.Pos)
w.AddString(f) w.AddString(filepath.ToSlash(f))
} }
}) })
for _, f := range w.ctxt.PosTable.DebugLinesFileTable() { for _, f := range w.ctxt.PosTable.DebugLinesFileTable() {
...@@ -242,8 +243,12 @@ func (w *writer) Sym(s *LSym) { ...@@ -242,8 +243,12 @@ func (w *writer) Sym(s *LSym) {
if s.TopFrame() { if s.TopFrame() {
flag |= goobj2.SymFlagTopFrame flag |= goobj2.SymFlagTopFrame
} }
name := s.Name
if strings.HasPrefix(name, "gofile..") {
name = filepath.ToSlash(name)
}
o := goobj2.Sym{ o := goobj2.Sym{
Name: s.Name, Name: name,
ABI: abi, ABI: abi,
Type: uint8(s.Type), Type: uint8(s.Type),
Flag: flag, Flag: flag,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment