@@ -70,7 +70,7 @@ class GNATfuzzPlugin(Module):
70
70
X ("description" ).children ("Launch gnatfuzz fuzz" ),
71
71
X ("command-line" ).children (),
72
72
X ("iconname" ).children ("gps-build-all-symbolic" ),
73
- X ("switches" , command = "gnatfuzz" , columns = "2" , lines = "2 " ).children (
73
+ X ("switches" , command = "gnatfuzz" , columns = "2" , lines = "1 " ).children (
74
74
X (
75
75
"spin" ,
76
76
line = "1" ,
@@ -83,6 +83,25 @@ class GNATfuzzPlugin(Module):
83
83
max = "32" ,
84
84
tip = "The number of cores to use. Use 0 for automatic." ,
85
85
),
86
+ X (
87
+ "combo" ,
88
+ line = "1" ,
89
+ column = "1" ,
90
+ label = "AFL mode" ,
91
+ separator = "=" ,
92
+ switch = "--afl-mode" ,
93
+ default = "PERSIST" ,
94
+ tip = "The AFL run mode. See the AFL++ documentation." ,
95
+ ).children (
96
+ X ("combo-entry" , label = "PLAIN" , value = "afl_plain" ),
97
+ X ("combo-entry" , label = "PERSIST" , value = "afl_persist" ),
98
+ X ("combo-entry" , label = "DEFER" , value = "afl_defer" ),
99
+ X (
100
+ "combo-entry" ,
101
+ label = "DEFER_AND_PERSIST" ,
102
+ value = "afl_defer_and_persist" ,
103
+ ),
104
+ ),
86
105
),
87
106
),
88
107
X (
@@ -439,13 +458,20 @@ def gnatfuzz_analyze_file_workflow(self, task):
439
458
return
440
459
self .process_analyze_messages ()
441
460
461
+ def clear_analyze_messages (self ):
462
+ """Clear messages generated by 'gnatfuzz analyze'"""
463
+ for m in GPS .Message .list (category = "Fuzzable Subprograms" ):
464
+ m .remove ()
465
+
442
466
def gnatfuzz_analyze_project (self ):
443
467
"""Action to launch the 'gnatfuzz analyze' workflow"""
468
+ self .clear_analyze_messages ()
444
469
workflows .task_workflow (
445
470
"gnatfuzz analyze" , self .gnatfuzz_analyze_project_workflow
446
471
)
447
472
448
473
def gnatfuzz_analyze_file (self ):
474
+ self .clear_analyze_messages ()
449
475
"""Action to launch the 'gnatfuzz analyze' workflow on a file"""
450
476
workflows .task_workflow ("gnatfuzz analyze" , self .gnatfuzz_analyze_file_workflow )
451
477
@@ -484,7 +510,7 @@ def gnatfuzz_fuzz_workflow(self, task):
484
510
for variable , value in GPS .Project .scenario_variables ().items ():
485
511
# We pass all -X switches except the ones that are internal
486
512
# to gnatfuzz.
487
- if not variable .startswith ("GNATFUZZ" ):
513
+ if not ( variable .startswith ("GNATFUZZ" ) or variable == "AFL_MODE " ):
488
514
args .append (f"-X{ variable } ={ value } " )
489
515
490
516
args .extend (
0 commit comments