<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
p.msipheader4d0fcdd7, li.msipheader4d0fcdd7, div.msipheader4d0fcdd7
{mso-style-name:msipheader4d0fcdd7;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="msipheader4d0fcdd7" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">CC: LLVM-list<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This behavior(line table entries) is not seen with “C” test case:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">$tot-clang -g $PWD/main.c -emit-llvm -S -o - | awk /DIFile/<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">!1 = !DIFile(filename: "/home/main.c", directory: "/home/")<o:p></o:p></p>
<p class="MsoNormal">!8 = !DIFile(filename: "main.c", directory: "/home/")<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">$tot-clang -g $PWD/main.c -c -o - | llvm-dwarfdump -debug-line –<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal">file_names[ 1]:<o:p></o:p></p>
<p class="MsoNormal"> name: "main.c"<o:p></o:p></p>
<p class="MsoNormal"> dir_index: 0<o:p></o:p></p>
<p class="MsoNormal"> mod_time: 0x00000000<o:p></o:p></p>
<p class="MsoNormal"> length: 0x00000000<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--Sourabh<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org">llvm-dev-bounces@lists.llvm.org</a>>
<b>On Behalf Of </b>Tomar, Sourabh Singh via llvm-dev<br>
<b>Sent:</b> Tuesday, September 1, 2020 11:10 PM<br>
<b>To:</b> Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>><br>
<b>Cc:</b> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>; <a href="mailto:cfe-dev@lists.llvm.org">
cfe-dev@lists.llvm.org</a> Developers <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [llvm-dev] Filename's in DIBuileder<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<p class="msipheader4d0fcdd7" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks Paul.<br>
It’s reproducible both DIFile and debug_line(multiple directory entries).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">$tot-clang++ -g $PWD/test.cpp -c -o - | llvm-dwarfdump -debug-line –<o:p></o:p></p>
<p class="MsoNormal">[…]<br>
include_directories[ 1] = "/home/"<o:p></o:p></p>
<p class="MsoNormal">file_names[ 1]:<o:p></o:p></p>
<p class="MsoNormal"> name: "test.cpp"<o:p></o:p></p>
<p class="MsoNormal"> dir_index: 0<o:p></o:p></p>
<p class="MsoNormal"> mod_time: 0x00000000<o:p></o:p></p>
<p class="MsoNormal"> length: 0x00000000<o:p></o:p></p>
<p class="MsoNormal">file_names[ 2]:<o:p></o:p></p>
<p class="MsoNormal"> name: "test.cpp"<o:p></o:p></p>
<p class="MsoNormal"> dir_index: 1<o:p></o:p></p>
<p class="MsoNormal"> mod_time: 0x00000000<o:p></o:p></p>
<p class="MsoNormal"> length: 0x00000000<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--Sourabh<o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>>
<br>
<b>Sent:</b> Tuesday, September 1, 2020 10:40 PM<br>
<b>To:</b> Tomar, Sourabh Singh <<a href="mailto:SourabhSingh.Tomar@amd.com">SourabhSingh.Tomar@amd.com</a>>; Umesh Kalappa <<a href="mailto:umesh.kalappa0@gmail.com">umesh.kalappa0@gmail.com</a>>;
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a> Developers <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>>; 'llvm-dev@lists.llvm.org' <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
<b>Subject:</b> RE: [llvm-dev] Filename's in DIBuileder<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<p class="MsoNormal">Try using $PWD/test.cpp on the clang command line. I am seeing the duplicate DIFile entries, but not yet able to reproduce a .debug_line section with multiple directory entries.<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org">llvm-dev-bounces@lists.llvm.org</a>>
<b>On Behalf Of </b>Tomar, Sourabh Singh via llvm-dev<br>
<b>Sent:</b> Tuesday, September 1, 2020 1:07 PM<br>
<b>To:</b> Umesh Kalappa <<a href="mailto:umesh.kalappa0@gmail.com">umesh.kalappa0@gmail.com</a>>;
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a> Developers <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Cc:</b> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [llvm-dev] Filename's in DIBuileder<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="msipheader4d0fcdd7" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Didn’t observed this on trunk(Using attached test.cpp): Trunk at 29ae4485950ed76faa94dabbd13bbe91d2b5c750<o:p></o:p></p>
<p class="MsoNormal"><br>
$clang++ -std=c++14 -g test.cpp -c -S -emit-llvm -o - | awk /DIFile/<o:p></o:p></p>
<p class="MsoNormal">!3 = !DIFile(filename: "test.cpp", directory: "/home/")<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">$ clang++ -std=c++14 -g test.cpp -c -o - | llvm-dwarfdump -debug-line -<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal">file_names[ 1]:<o:p></o:p></p>
<p class="MsoNormal"> name: "test.cpp"<o:p></o:p></p>
<p class="MsoNormal"> dir_index: 0<o:p></o:p></p>
<p class="MsoNormal"> mod_time: 0x00000000<o:p></o:p></p>
<p class="MsoNormal"> length: 0x00000000<o:p></o:p></p>
<p class="MsoNormal">[…]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Did I missed something, while reproducing ? ? <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--Sourabh<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org">llvm-dev-bounces@lists.llvm.org</a>>
<b>On Behalf Of </b>Umesh Kalappa via llvm-dev<br>
<b>Sent:</b> Tuesday, September 1, 2020 9:50 PM<br>
<b>To:</b> LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>;
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a> Developers <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> [llvm-dev] Filename's in DIBuileder<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi All ,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you <br>
~Umesh <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>