llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Fix debug info generation when integration footer is present

Open AlexeySachkov opened this issue 4 years ago • 4 comments

Two changes were made:

  1. Driver passes an absolute path to an original source file through -main-file-name if integration footer is enabled.
  2. Clang CodeGen uses the file specified through -main-file-name to calculate checksum for the main file, if -fsycl-use-main-file-name option 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_line section, causing gdb l 1,100 command 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

AlexeySachkov avatar Dec 21 '21 10:12 AlexeySachkov

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_line section, causing gdb l 1,100 command 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

AlexeySachkov avatar Dec 21 '21 10:12 AlexeySachkov

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

AlexeySachkov avatar Jan 25 '22 09:01 AlexeySachkov

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

AlexeySachkov avatar Jan 25 '22 12:01 AlexeySachkov

Moved back to draft, because the issue with checksums is still present: it seems like more changes in CGDebugInfo.cpp is needed

AlexeySachkov avatar Jan 28 '22 15:01 AlexeySachkov