aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ipc/ipc.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go
index 8abf54054..a28eedcfa 100644
--- a/pkg/ipc/ipc.go
+++ b/pkg/ipc/ipc.go
@@ -477,6 +477,20 @@ func (env *Env) readOutCoverage(p *prog.Prog) (info []CallInfo, err0 error) {
}
info[callIndex].Comps = compMap
}
+ if env.config.Flags&FlagSignal != 0 {
+ // This is fallback coverage used when no real coverage available.
+ // We use syscall number or-ed with returned errno value as signal.
+ // At least this gives us all combinations of syscall+errno.
+ for i := range info {
+ ci := &info[i]
+ if len(ci.Signal) != 0 {
+ continue
+ }
+ num := p.Calls[i].Meta.ID
+ sig := uint32(num<<16) | uint32(ci.Errno)&0x3ff
+ ci.Signal = []uint32{sig}
+ }
+ }
return
}