Skip to content

Commit

Permalink
pkg/report: cleanPath for frame.File
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangenj committed Jul 8, 2024
1 parent 0e85f12 commit 5b79a5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/report/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"strings"
"time"

"github.com/google/syzkaller/pkg/cover/backend"
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/pkg/report/crash"
"github.com/google/syzkaller/pkg/symbolizer"
Expand Down Expand Up @@ -484,10 +485,8 @@ func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, err
}
var symbolized []byte
for _, frame := range frames {
file := frame.File
file = strings.TrimPrefix(file, strip)
file = strings.TrimLeft(file, "./")
info := fmt.Sprintf(" %v:%v", file, frame.Line)
path, _ := backend.CleanPath(frame.File, ctx.kernelObj, ctx.kernelSrc, ctx.kernelBuildSrc, nil)
info := fmt.Sprintf(" %v:%v", path, frame.Line)
modified := append([]byte{}, line...)
modified = replace(modified, match[7], match[7], []byte(info))
if frame.Inline {
Expand Down

0 comments on commit 5b79a5d

Please sign in to comment.