aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-05 12:02:16 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-05 12:02:16 +0200
commitad7d294798bac1b8da37cf303e44ade90689bb1c (patch)
treef257dff51474a5f6b7c831db8915c06633dadcbd
parentc58e46ddd1b4c4e11e36b914bf83e50fe097ba18 (diff)
tools/syz-execprog: dump coverage in text format
There is no point in using sancov, it does not do anything other than transforming binary format to a useful text format. Write out text format directly.
-rw-r--r--tools/syz-execprog/execprog.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go
index 90c8b32e7..59bb33a21 100644
--- a/tools/syz-execprog/execprog.go
+++ b/tools/syz-execprog/execprog.go
@@ -7,7 +7,6 @@ package main
import (
"bytes"
- "encoding/binary"
"flag"
"fmt"
"io/ioutil"
@@ -169,18 +168,14 @@ func main() {
fmt.Printf("RESULT: no calls executed\n")
}
if *flagCoverFile != "" {
- // Coverage is dumped in sanitizer format.
- // github.com/google/sanitizers/tools/sancov command can be used to dump PCs,
- // then they can be piped via addr2line to symbolize.
for i, inf := range info {
fmt.Printf("call #%v: signal %v, coverage %v\n", i, len(inf.Signal), len(inf.Cover))
if len(inf.Cover) == 0 {
continue
}
buf := new(bytes.Buffer)
- binary.Write(buf, binary.LittleEndian, uint64(0xC0BFFFFFFFFFFF64))
for _, pc := range inf.Cover {
- binary.Write(buf, binary.LittleEndian, cover.RestorePC(pc, 0xffffffff))
+ fmt.Fprintf(buf, "0x%x\n", cover.RestorePC(pc, 0xffffffff))
}
err := osutil.WriteFile(fmt.Sprintf("%v.%v", *flagCoverFile, i), buf.Bytes())
if err != nil {