File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
src/fuzz_introspector/frontends/src Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -175,16 +175,19 @@ def __init__(self, source_code_files: list[str]):
175
175
for item in src .functions + src .methods
176
176
]
177
177
178
- def dump_module_logic (self , report_name : str ):
178
+ def dump_module_logic (self , report_name : str , entry_function : str = '' ):
179
179
"""Dumps the data for the module in full."""
180
180
logger .info ('Dumping project-wide logic.' )
181
181
report = {'report' : 'name' }
182
182
report ['sources' ] = []
183
183
184
+ # Log entry function if provided
185
+ if entry_function :
186
+ report ['Fuzzing method' ] = entry_function
187
+
184
188
# Find all functions
185
189
function_list = []
186
190
for source_code in self .source_code_files :
187
-
188
191
report ['sources' ].append ({
189
192
'source_file' :
190
193
source_code .source_file ,
Original file line number Diff line number Diff line change @@ -125,15 +125,18 @@ def process_go_project(target_dir, out):
125
125
# Create and dump project
126
126
logger .info ('Creating base project.' )
127
127
project = frontend_go .Project (source_codes )
128
- project .dump_module_logic (os .path .join (out , 'report.yaml' ))
129
128
130
129
# Process calltree
131
- for idx , harness in enumerate (project .get_source_codes_with_harnesses ()):
132
- logger .info ('Extracting calltree for %s' , harness .source_file )
130
+ for harness in project .get_source_codes_with_harnesses ():
131
+ harness_name = harness .source_file .split ('/' )[- 1 ].split ('.' )[0 ]
132
+ logger .info (f'Dump functions/methods for { harness_name } ' )
133
+ target = os .path .join (out , f'fuzzerLogFile-{ harness_name } .data.yaml' )
134
+ project .dump_module_logic (target , harness .get_entry_function_name ())
135
+
136
+ logger .info (f'Extracting calltree for { harness_name } ' )
133
137
calltree = project .extract_calltree (harness .source_file , harness )
134
- with open (os .path .join (out , f'fuzzer-calltree-{ idx } ' ),
135
- 'w' ,
136
- encoding = 'utf-8' ) as f :
138
+ target = os .path .join (out , f'fuzzerLogFile-{ harness_name } .data' )
139
+ with open (target , 'w' , encoding = 'utf-8' ) as f :
137
140
f .write (calltree )
138
141
139
142
You can’t perform that action at this time.
0 commit comments