On Fri, 8 Apr 2022 14:18:50 GMT, Maxim Kartashev <d...@openjdk.java.net> wrote:
>> @magicus >>> Is it possible to pass the ".file" directive on the command line? >> >> I don't think so. Your other idea works quite well, though. If you have this >> in the source >> >> .file THIS_FILE >> >> and you specify this on the command line >> >> -DTHIS_FILE='"src/hotspot/os_cpu/linux_x86/linux_x86_64.S"' >> >> you get the same reproducible and debuggable result. > >> @mkartashev Why don't you try building with clang as two different users, in >> two different directories, and see if the build is non-reproducible without >> this patch, but is reproducible with it (incl. your suggested change to >> include clang as well)? > > I'm going to do this on Mac, but perhaps not in the immediate future. If > someone has the time for this right now, please jump ahead of me in the line. @mkartashev yes you're right, here's the dwarf for the compilation unit that I changed to add the .file to: COMPILE_UNIT<header overall offset = 0x00c0e8d7>: < 0><0x0000000b> DW_TAG_compile_unit DW_AT_stmt_list 0x0022146d DW_AT_low_pc 0x004707c0 DW_AT_high_pc 0x00470a40 DW_AT_name atomic_linux_aarch64.S DW_AT_comp_dir make/hotspot DW_AT_producer GNU AS 2.27 DW_AT_language DW_LANG_Mips_Assembler So it needs the full source path specifying as you said. Note however -debug-prefix-map has affected the DW_AT_comp_dir, removing the absolute workspace folder. Note, previously this is what the same entry had: COMPILE_UNIT<header overall offset = 0x00c0e8d7>: < 0><0x0000000b> DW_TAG_compile_unit DW_AT_stmt_list 0x00224f82 DW_AT_low_pc 0x004707c0 DW_AT_high_pc 0x00470a40 DW_AT_name /home/andrew2/jdk/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S DW_AT_comp_dir /home/andrew2/jdk/make/hotspot DW_AT_producer GNU AS 2.27 DW_AT_language DW_LANG_Mips_Assembler So I am thinking adding a .file directive to the .S file specifying the "full source path" should do the trick thanks to -debug-prefix-map, I will do a test.. ------------- PR: https://git.openjdk.java.net/jdk/pull/8124