https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122622

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <[email protected]>:

https://gcc.gnu.org/g:67d4031d3525c1a45a6865425921ecbc9a62d873

commit r16-6966-g67d4031d3525c1a45a6865425921ecbc9a62d873
Author: David Malcolm <[email protected]>
Date:   Wed Jan 21 20:28:39 2026 -0500

    sarif-replay: improve path output when source is unavailable [PR122622]

    For cases where sarif-replay can't find the source, text output with
    -fdiagnostics-path-format=inline-events and HTML output both lead to
    the event locations and messages in replayed execution paths not being
    printed at all.

    Fixed thusly.

    gcc/ChangeLog:
            PR diagnostics/122622
            * diagnostics/paths-output.cc: Include "diagnostics/file-cache.h".
            (event_range::print_as_text): Generalize the fallback logic for
            special locations to also cover the case where source-printing
            will fail, and show the location for that case.
            (event_range::print_as_html): Likewise.
            (event_range::can_print_source_p): New.

    gcc/testsuite/ChangeLog:
            PR diagnostics/122622
            *
sarif-replay.dg/2.1.0-valid/missing-source-pr122622-check-html.py:
            New test script.
            * sarif-replay.dg/2.1.0-valid/missing-source-pr122622.sarif: New
            test.
            * sarif-replay.dg/2.1.0-valid/spec-example-4.sarif: Update
            expected output to reflect showing event locations and text.
            * sarif-replay.dg/2.1.0-valid/tutorial-example.sarif: Likewise.

    Signed-off-by: David Malcolm <[email protected]>

Reply via email to