@@ -16,8 +16,18 @@ import (
1616 "github.com/google/syzkaller/pkg/osutil"
1717)
1818
19+ type DiffBugStatus string
20+
21+ const (
22+ DiffBugStatusPending DiffBugStatus = "pending"
23+ DiffBugStatusVerifying DiffBugStatus = "verifying"
24+ DiffBugStatusCompleted DiffBugStatus = "completed"
25+ DiffBugStatusIgnored DiffBugStatus = "ignored"
26+ )
27+
1928type DiffBug struct {
2029 Title string
30+ Status DiffBugStatus
2131 Base DiffBugInfo
2232 Patched DiffBugInfo
2333}
@@ -49,8 +59,15 @@ type DiffFuzzerStore struct {
4959 bugs map [string ]* DiffBug
5060}
5161
62+ func (s * DiffFuzzerStore ) UpdateStatus (title string , status DiffBugStatus ) {
63+ s .patch (title , func (obj * DiffBug ) {
64+ obj .Status = status
65+ })
66+ }
67+
5268func (s * DiffFuzzerStore ) BaseCrashed (title string , report []byte ) {
5369 s .patch (title , func (obj * DiffBug ) {
70+ obj .Status = DiffBugStatusCompleted
5471 obj .Base .Crashes ++
5572 if len (report ) > 0 {
5673 obj .Base .Report = s .saveFile (title , "base_report" , report )
@@ -67,6 +84,7 @@ func (s *DiffFuzzerStore) EverCrashedBase(title string) bool {
6784
6885func (s * DiffFuzzerStore ) BaseNotCrashed (title string ) {
6986 s .patch (title , func (obj * DiffBug ) {
87+ obj .Status = DiffBugStatusCompleted
7088 if obj .Base .Crashes == 0 {
7189 obj .Base .NotCrashed = true
7290 }
@@ -131,7 +149,7 @@ func (s *DiffFuzzerStore) PlainTextDump() []byte {
131149 })
132150 var buf bytes.Buffer
133151 w := tabwriter .NewWriter (& buf , 0 , 0 , 1 , ' ' , 0 )
134- fmt .Fprintln (w , "Title\t On-Base\t On-Patched" )
152+ fmt .Fprintln (w , "Title\t On-Base\t On-Patched\t Status " )
135153
136154 printInfo := func (info * DiffBugInfo ) {
137155 if info .Crashes > 0 {
@@ -147,7 +165,7 @@ func (s *DiffFuzzerStore) PlainTextDump() []byte {
147165 printInfo (& item .Base )
148166 fmt .Fprintf (w , "\t " )
149167 printInfo (& item .Patched )
150- fmt .Fprintf (w , "\n " )
168+ fmt .Fprintf (w , "\t %s \n " , item . Status )
151169 }
152170 w .Flush ()
153171 return buf .Bytes ()
0 commit comments