<div dir="ltr"><div>Hi All ,</div><div><br></div><div>We have a scenario in our debugger to handle the file index in the debug_ine info like <br><br>$llvm-dwarfdump -debug-line test.o <br>file_names[  1]:<br>           name: "test.cpp"<br>      dir_index: 0<br>       mod_time: 0x00000000<br>         length: 0x00000000<br>file_names[  2]:<br>           name: "test.cpp"<br>      dir_index: 1<br>       mod_time: 0x00000000<br>         length: 0x00000000<br><br>Address            Line   Column File   ISA Discriminator Flags<br>------------------ ------ ------ ------ --- ------------- -------------<br>0x0000000000000000     12      0      1   0             0  is_stmt<br>0x0000000000000008     13      1      1   0             0  is_stmt prologue_end<br>0x0000000000000010     16      0      1   0             0  is_stmt<br>0x0000000000000018     17      1      1   0             0  is_stmt prologue_end<br>0x0000000000000020     20      0      1   0             0  is_stmt<br>0x0000000000000028     21      9      1   0             0  is_stmt prologue_end<br>0x000000000000002f     22      9      1   0             0  is_stmt<br>0x0000000000000032     22     10      1   0             0<br>0x0000000000000035     22      7      1   0             0<br>0x000000000000003c     23      1      1   0             0  is_stmt<br>0x0000000000000040     25      0      1   0             0  is_stmt<br>0x0000000000000044     25     13      1   0             0  is_stmt prologue_end<br>0x0000000000000080      0      0      2   0             0  is_stmt<br>0x000000000000008b      0      0      2   0             0  is_stmt end_sequence<br><br><br>the debug info is emitted by the DIBuilder like <br><br>!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")<br>!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)<br><br>!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")<br>!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)<br><br>Latest clang trunk used like <br><br>$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp<br><br>and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.<br><br>the scenario is that why the file-name 's are different is both cases  ,where "ZN4test4procEv" is the user defined function and "_GLOBAL__sub_I_test.cpp"<br>is generated for the static initialisation ,which leads to the  two file index like 1 and 2 for  two files in the filename table ,that confuse our debugger .<br><br>So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.</div><div><br></div><div>Thank you <br>~Umesh <br></div></div>