[SYCL] Fix debug info generation when integration footer is present
Two changes were made:
- Driver passes an absolute path to an original source file through
-main-file-nameif integration footer is enabled. - Clang CodeGen uses the file specified through -main-file-name to
calculate checksum for the main file, if
-fsycl-use-main-file-nameoption is passed.
These changes help to fix two known issues with debugging caused by integration footer presence, without redesigning the integration footer approach.
Those issues are:
- several conflicting entries in
.debug_linesection, causing gdbl 1,100command to fail:(gdb) l 1,100 Specified first line '1' is ambiguous: file: "/tmp/t.cpp", line number: 1, symbol: "???" file: "t.cpp", line number: 1, symbol: "???" - missing checksum for the main file on Windows, causing breakpoints not being hit
This is a draft PR, which is intended to be a proof of concept that we can fix debug info issues (known at the moment) caused by integration footer presence without redesigning the footer itself.
Those issues are:
- several conflicting entries in
.debug_linesection, causing gdbl 1,100command to fail:(gdb) l 1,100 Specified first line '1' is ambiguous: file: "/tmp/t.cpp", line number: 1, symbol: "???" file: "t.cpp", line number: 1, symbol: "???" - missing checksum for the main file on Windows, causing breakpoints not being hit
I will move this back to draft state to prevent accidental merge, because I've realized that I don't have a proper test for one of the main fixes in this PR
I will move this back to draft state to prevent accidental merge, because I've realized that I don't have a proper test for one of the main fixes in this PR
Done, I've re-implemented the test, so it now checks what actually needs to be checked
Moved back to draft, because the issue with checksums is still present: it seems like more changes in CGDebugInfo.cpp is needed