@@ -70,7 +70,7 @@ class GNATfuzzPlugin(Module):
7070 X ("description" ).children ("Launch gnatfuzz fuzz" ),
7171 X ("command-line" ).children (),
7272 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 (
7474 X (
7575 "spin" ,
7676 line = "1" ,
@@ -83,6 +83,25 @@ class GNATfuzzPlugin(Module):
8383 max = "32" ,
8484 tip = "The number of cores to use. Use 0 for automatic." ,
8585 ),
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+ ),
86105 ),
87106 ),
88107 X (
@@ -439,13 +458,20 @@ def gnatfuzz_analyze_file_workflow(self, task):
439458 return
440459 self .process_analyze_messages ()
441460
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+
442466 def gnatfuzz_analyze_project (self ):
443467 """Action to launch the 'gnatfuzz analyze' workflow"""
468+ self .clear_analyze_messages ()
444469 workflows .task_workflow (
445470 "gnatfuzz analyze" , self .gnatfuzz_analyze_project_workflow
446471 )
447472
448473 def gnatfuzz_analyze_file (self ):
474+ self .clear_analyze_messages ()
449475 """Action to launch the 'gnatfuzz analyze' workflow on a file"""
450476 workflows .task_workflow ("gnatfuzz analyze" , self .gnatfuzz_analyze_file_workflow )
451477
@@ -484,7 +510,7 @@ def gnatfuzz_fuzz_workflow(self, task):
484510 for variable , value in GPS .Project .scenario_variables ().items ():
485511 # We pass all -X switches except the ones that are internal
486512 # to gnatfuzz.
487- if not variable .startswith ("GNATFUZZ" ):
513+ if not ( variable .startswith ("GNATFUZZ" ) or variable == "AFL_MODE " ):
488514 args .append (f"-X{ variable } ={ value } " )
489515
490516 args .extend (
0 commit comments