Skip to content
Snippets Groups Projects
Commit cf24c0fa authored by David Malcolm's avatar David Malcolm
Browse files

sarif-replay: support "cached" logical locations [§3.33.3]


Some SARIF files offload most of the properties within logical locations
in the results to an array of "cached" instances in
theRun.logicalLocations, so the information can be consolidated (and to
support the "parentIndex" property, which is PR 116176).

Support such files in sarif-replay.

gcc/ChangeLog:
	* libsarifreplay.cc (sarif_replayer::handle_run_obj): Pass run to
	handle_result_obj.
	(sarif_replayer::handle_result_obj): Add run_obj param and pass it
	to handle_location_object and handle_thread_flow_object.
	(sarif_replayer::handle_thread_flow_object): Add run_obj param and
	pass it to handle_thread_flow_location_object.
	(sarif_replayer::handle_thread_flow_location_object): Add run_obj
	param and pass it to handle_location_object.
	(sarif_replayer::handle_location_object): Add run_obj param and
	pass it to handle_logical_location_object.
	(sarif_replayer::handle_logical_location_object): Add run_obj
	param.  If the run_obj is non-null and has "logicalLocations",
	then use these "cached" logical locations if we see an "index"
	property, as per §3.33.3

gcc/testsuite/ChangeLog:
	* sarif-replay.dg/2.1.0-invalid/3.33.3-index-out-of-range.sarif:
	New test.
	* sarif-replay.dg/2.1.0-valid/spec-example-4.sarif: Update expected
	output to reflect that we now find the function name for the
	events in the path.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 8ca6bbf8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment