Filename's in DIBuileder

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Filename's in DIBuileder

Hubert Tong via cfe-dev
Hi All ,

We have a scenario in our debugger to handle the file index in the debug_ine info like

$llvm-dwarfdump -debug-line test.o
file_names[  1]:
           name: "test.cpp"
      dir_index: 0
       mod_time: 0x00000000
         length: 0x00000000
file_names[  2]:
           name: "test.cpp"
      dir_index: 1
       mod_time: 0x00000000
         length: 0x00000000

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000     12      0      1   0             0  is_stmt
0x0000000000000008     13      1      1   0             0  is_stmt prologue_end
0x0000000000000010     16      0      1   0             0  is_stmt
0x0000000000000018     17      1      1   0             0  is_stmt prologue_end
0x0000000000000020     20      0      1   0             0  is_stmt
0x0000000000000028     21      9      1   0             0  is_stmt prologue_end
0x000000000000002f     22      9      1   0             0  is_stmt
0x0000000000000032     22     10      1   0             0
0x0000000000000035     22      7      1   0             0
0x000000000000003c     23      1      1   0             0  is_stmt
0x0000000000000040     25      0      1   0             0  is_stmt
0x0000000000000044     25     13      1   0             0  is_stmt prologue_end
0x0000000000000080      0      0      2   0             0  is_stmt
0x000000000000008b      0      0      2   0             0  is_stmt end_sequence


the debug info is emitted by the DIBuilder like

!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")
!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)

!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")
!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)

Latest clang trunk used like

$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp

and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.

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"
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 .

So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.

Thank you
~Umesh 

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

test.cpp (316 bytes) Download Attachment
test.ll (11K) Download Attachment
test.s (33K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Filename's in DIBuileder

Hubert Tong via cfe-dev

[AMD Official Use Only - Internal Distribution Only]

 

Didn’t observed this on trunk(Using attached test.cpp): Trunk at 29ae4485950ed76faa94dabbd13bbe91d2b5c750


$clang++ -std=c++14 -g test.cpp -c -S -emit-llvm -o - | awk /DIFile/

!3 = !DIFile(filename: "test.cpp", directory: "/home/")

 

$ clang++ -std=c++14 -g test.cpp -c -o - | llvm-dwarfdump -debug-line -

[…]

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

Did I missed something, while reproducing ? ?

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Umesh Kalappa via llvm-dev
Sent: Tuesday, September 1, 2020 9:50 PM
To: LLVM Developers Mailing List <[hidden email]>; [hidden email] Developers <[hidden email]>
Subject: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

Hi All ,

 

We have a scenario in our debugger to handle the file index in the debug_ine info like

$llvm-dwarfdump -debug-line test.o
file_names[  1]:
           name: "test.cpp"
      dir_index: 0
       mod_time: 0x00000000
         length: 0x00000000
file_names[  2]:
           name: "test.cpp"
      dir_index: 1
       mod_time: 0x00000000
         length: 0x00000000

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000     12      0      1   0             0  is_stmt
0x0000000000000008     13      1      1   0             0  is_stmt prologue_end
0x0000000000000010     16      0      1   0             0  is_stmt
0x0000000000000018     17      1      1   0             0  is_stmt prologue_end
0x0000000000000020     20      0      1   0             0  is_stmt
0x0000000000000028     21      9      1   0             0  is_stmt prologue_end
0x000000000000002f     22      9      1   0             0  is_stmt
0x0000000000000032     22     10      1   0             0
0x0000000000000035     22      7      1   0             0
0x000000000000003c     23      1      1   0             0  is_stmt
0x0000000000000040     25      0      1   0             0  is_stmt
0x0000000000000044     25     13      1   0             0  is_stmt prologue_end
0x0000000000000080      0      0      2   0             0  is_stmt
0x000000000000008b      0      0      2   0             0  is_stmt end_sequence


the debug info is emitted by the DIBuilder like

!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")
!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)

!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")
!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)

Latest clang trunk used like

$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp

and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.

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"
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 .

So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.

 

Thank you
~Umesh 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Filename's in DIBuileder

Hubert Tong via cfe-dev

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.

--paulr

 

From: llvm-dev <[hidden email]> On Behalf Of Tomar, Sourabh Singh via llvm-dev
Sent: Tuesday, September 1, 2020 1:07 PM
To: Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>
Cc: [hidden email]
Subject: Re: [llvm-dev] Filename's in DIBuileder

 

[AMD Official Use Only - Internal Distribution Only]

 

Didn’t observed this on trunk(Using attached test.cpp): Trunk at 29ae4485950ed76faa94dabbd13bbe91d2b5c750


$clang++ -std=c++14 -g test.cpp -c -S -emit-llvm -o - | awk /DIFile/

!3 = !DIFile(filename: "test.cpp", directory: "/home/")

 

$ clang++ -std=c++14 -g test.cpp -c -o - | llvm-dwarfdump -debug-line -

[…]

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

Did I missed something, while reproducing ? ?

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Umesh Kalappa via llvm-dev
Sent: Tuesday, September 1, 2020 9:50 PM
To: LLVM Developers Mailing List <[hidden email]>; [hidden email] Developers <[hidden email]>
Subject: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

Hi All ,

 

We have a scenario in our debugger to handle the file index in the debug_ine info like

$llvm-dwarfdump -debug-line test.o
file_names[  1]:
           name: "test.cpp"
      dir_index: 0
       mod_time: 0x00000000
         length: 0x00000000
file_names[  2]:
           name: "test.cpp"
      dir_index: 1
       mod_time: 0x00000000
         length: 0x00000000

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000     12      0      1   0             0  is_stmt
0x0000000000000008     13      1      1   0             0  is_stmt prologue_end
0x0000000000000010     16      0      1   0             0  is_stmt
0x0000000000000018     17      1      1   0             0  is_stmt prologue_end
0x0000000000000020     20      0      1   0             0  is_stmt
0x0000000000000028     21      9      1   0             0  is_stmt prologue_end
0x000000000000002f     22      9      1   0             0  is_stmt
0x0000000000000032     22     10      1   0             0
0x0000000000000035     22      7      1   0             0
0x000000000000003c     23      1      1   0             0  is_stmt
0x0000000000000040     25      0      1   0             0  is_stmt
0x0000000000000044     25     13      1   0             0  is_stmt prologue_end
0x0000000000000080      0      0      2   0             0  is_stmt
0x000000000000008b      0      0      2   0             0  is_stmt end_sequence


the debug info is emitted by the DIBuilder like

!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")
!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)

!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")
!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)

Latest clang trunk used like

$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp

and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.

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"
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 .

So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.

 

Thank you
~Umesh 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Filename's in DIBuileder

Hubert Tong via cfe-dev

[AMD Official Use Only - Internal Distribution Only]

 

 

Thanks Paul.
It’s reproducible both DIFile and debug_line(multiple directory entries).

 

$tot-clang++ -g  $PWD/test.cpp -c -o - | llvm-dwarfdump -debug-line –

[…]
include_directories[  1] = "/home/"

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

file_names[  2]:

           name: "test.cpp"

      dir_index: 1

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

--Sourabh

From: Robinson, Paul <[hidden email]>
Sent: Tuesday, September 1, 2020 10:40 PM
To: Tomar, Sourabh Singh <[hidden email]>; Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

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.

--paulr

 

From: llvm-dev <[hidden email]> On Behalf Of Tomar, Sourabh Singh via llvm-dev
Sent: Tuesday, September 1, 2020 1:07 PM
To: Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>
Cc: [hidden email]
Subject: Re: [llvm-dev] Filename's in DIBuileder

 

[AMD Official Use Only - Internal Distribution Only]

 

Didn’t observed this on trunk(Using attached test.cpp): Trunk at 29ae4485950ed76faa94dabbd13bbe91d2b5c750


$clang++ -std=c++14 -g test.cpp -c -S -emit-llvm -o - | awk /DIFile/

!3 = !DIFile(filename: "test.cpp", directory: "/home/")

 

$ clang++ -std=c++14 -g test.cpp -c -o - | llvm-dwarfdump -debug-line -

[…]

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

Did I missed something, while reproducing ? ?

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Umesh Kalappa via llvm-dev
Sent: Tuesday, September 1, 2020 9:50 PM
To: LLVM Developers Mailing List <[hidden email]>; [hidden email] Developers <[hidden email]>
Subject: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

Hi All ,

 

We have a scenario in our debugger to handle the file index in the debug_ine info like

$llvm-dwarfdump -debug-line test.o
file_names[  1]:
           name: "test.cpp"
      dir_index: 0
       mod_time: 0x00000000
         length: 0x00000000
file_names[  2]:
           name: "test.cpp"
      dir_index: 1
       mod_time: 0x00000000
         length: 0x00000000

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000     12      0      1   0             0  is_stmt
0x0000000000000008     13      1      1   0             0  is_stmt prologue_end
0x0000000000000010     16      0      1   0             0  is_stmt
0x0000000000000018     17      1      1   0             0  is_stmt prologue_end
0x0000000000000020     20      0      1   0             0  is_stmt
0x0000000000000028     21      9      1   0             0  is_stmt prologue_end
0x000000000000002f     22      9      1   0             0  is_stmt
0x0000000000000032     22     10      1   0             0
0x0000000000000035     22      7      1   0             0
0x000000000000003c     23      1      1   0             0  is_stmt
0x0000000000000040     25      0      1   0             0  is_stmt
0x0000000000000044     25     13      1   0             0  is_stmt prologue_end
0x0000000000000080      0      0      2   0             0  is_stmt
0x000000000000008b      0      0      2   0             0  is_stmt end_sequence


the debug info is emitted by the DIBuilder like

!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")
!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)

!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")
!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)

Latest clang trunk used like

$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp

and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.

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"
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 .

So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.

 

Thank you
~Umesh 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Filename's in DIBuileder

Hubert Tong via cfe-dev

[AMD Official Use Only - Internal Distribution Only]

 

This behavior(line table entries) is not seen with “C” test case:

 

$tot-clang -g $PWD/main.c -emit-llvm -S -o - | awk /DIFile/

 

!1 = !DIFile(filename: "/home/main.c", directory: "/home/")

!8 = !DIFile(filename: "main.c", directory: "/home/")

 

$tot-clang -g $PWD/main.c -c -o - | llvm-dwarfdump -debug-line –

[…]

file_names[  1]:

           name: "main.c"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Tomar, Sourabh Singh via llvm-dev
Sent: Tuesday, September 1, 2020 11:10 PM
To: Robinson, Paul <[hidden email]>
Cc: [hidden email]; [hidden email] Developers <[hidden email]>
Subject: Re: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

[AMD Official Use Only - Internal Distribution Only]

 

 

Thanks Paul.
It’s reproducible both DIFile and debug_line(multiple directory entries).

 

$tot-clang++ -g  $PWD/test.cpp -c -o - | llvm-dwarfdump -debug-line –

[…]
include_directories[  1] = "/home/"

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

file_names[  2]:

           name: "test.cpp"

      dir_index: 1

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

--Sourabh

From: Robinson, Paul <[hidden email]>
Sent: Tuesday, September 1, 2020 10:40 PM
To: Tomar, Sourabh Singh <[hidden email]>; Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

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.

--paulr

 

From: llvm-dev <[hidden email]> On Behalf Of Tomar, Sourabh Singh via llvm-dev
Sent: Tuesday, September 1, 2020 1:07 PM
To: Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>
Cc: [hidden email]
Subject: Re: [llvm-dev] Filename's in DIBuileder

 

[AMD Official Use Only - Internal Distribution Only]

 

Didn’t observed this on trunk(Using attached test.cpp): Trunk at 29ae4485950ed76faa94dabbd13bbe91d2b5c750


$clang++ -std=c++14 -g test.cpp -c -S -emit-llvm -o - | awk /DIFile/

!3 = !DIFile(filename: "test.cpp", directory: "/home/")

 

$ clang++ -std=c++14 -g test.cpp -c -o - | llvm-dwarfdump -debug-line -

[…]

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

Did I missed something, while reproducing ? ?

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Umesh Kalappa via llvm-dev
Sent: Tuesday, September 1, 2020 9:50 PM
To: LLVM Developers Mailing List <[hidden email]>; [hidden email] Developers <[hidden email]>
Subject: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

Hi All ,

 

We have a scenario in our debugger to handle the file index in the debug_ine info like

$llvm-dwarfdump -debug-line test.o
file_names[  1]:
           name: "test.cpp"
      dir_index: 0
       mod_time: 0x00000000
         length: 0x00000000
file_names[  2]:
           name: "test.cpp"
      dir_index: 1
       mod_time: 0x00000000
         length: 0x00000000

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000     12      0      1   0             0  is_stmt
0x0000000000000008     13      1      1   0             0  is_stmt prologue_end
0x0000000000000010     16      0      1   0             0  is_stmt
0x0000000000000018     17      1      1   0             0  is_stmt prologue_end
0x0000000000000020     20      0      1   0             0  is_stmt
0x0000000000000028     21      9      1   0             0  is_stmt prologue_end
0x000000000000002f     22      9      1   0             0  is_stmt
0x0000000000000032     22     10      1   0             0
0x0000000000000035     22      7      1   0             0
0x000000000000003c     23      1      1   0             0  is_stmt
0x0000000000000040     25      0      1   0             0  is_stmt
0x0000000000000044     25     13      1   0             0  is_stmt prologue_end
0x0000000000000080      0      0      2   0             0  is_stmt
0x000000000000008b      0      0      2   0             0  is_stmt end_sequence


the debug info is emitted by the DIBuilder like

!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")
!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)

!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")
!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)

Latest clang trunk used like

$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp

and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.

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"
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 .

So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.

 

Thank you
~Umesh 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Filename's in DIBuileder

Hubert Tong via cfe-dev

[AMD Official Use Only - Internal Distribution Only]

 

CC: LLVM-list

 

This behavior(line table entries) is not seen with “C” test case:

 

$tot-clang -g $PWD/main.c -emit-llvm -S -o - | awk /DIFile/

 

!1 = !DIFile(filename: "/home/main.c", directory: "/home/")

!8 = !DIFile(filename: "main.c", directory: "/home/")

 

$tot-clang -g $PWD/main.c -c -o - | llvm-dwarfdump -debug-line –

[…]

file_names[  1]:

           name: "main.c"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Tomar, Sourabh Singh via llvm-dev
Sent: Tuesday, September 1, 2020 11:10 PM
To: Robinson, Paul <[hidden email]>
Cc: [hidden email]; [hidden email] Developers <[hidden email]>
Subject: Re: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

[AMD Official Use Only - Internal Distribution Only]

 

 

Thanks Paul.
It’s reproducible both DIFile and debug_line(multiple directory entries).

 

$tot-clang++ -g  $PWD/test.cpp -c -o - | llvm-dwarfdump -debug-line –

[…]
include_directories[  1] = "/home/"

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

file_names[  2]:

           name: "test.cpp"

      dir_index: 1

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

--Sourabh

From: Robinson, Paul <[hidden email]>
Sent: Tuesday, September 1, 2020 10:40 PM
To: Tomar, Sourabh Singh <[hidden email]>; Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

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.

--paulr

 

From: llvm-dev <[hidden email]> On Behalf Of Tomar, Sourabh Singh via llvm-dev
Sent: Tuesday, September 1, 2020 1:07 PM
To: Umesh Kalappa <[hidden email]>; [hidden email] Developers <[hidden email]>
Cc: [hidden email]
Subject: Re: [llvm-dev] Filename's in DIBuileder

 

[AMD Official Use Only - Internal Distribution Only]

 

Didn’t observed this on trunk(Using attached test.cpp): Trunk at 29ae4485950ed76faa94dabbd13bbe91d2b5c750


$clang++ -std=c++14 -g test.cpp -c -S -emit-llvm -o - | awk /DIFile/

!3 = !DIFile(filename: "test.cpp", directory: "/home/")

 

$ clang++ -std=c++14 -g test.cpp -c -o - | llvm-dwarfdump -debug-line -

[…]

file_names[  1]:

           name: "test.cpp"

      dir_index: 0

       mod_time: 0x00000000

         length: 0x00000000

[…]

 

Did I missed something, while reproducing ? ?

 

--Sourabh

 

From: llvm-dev <[hidden email]> On Behalf Of Umesh Kalappa via llvm-dev
Sent: Tuesday, September 1, 2020 9:50 PM
To: LLVM Developers Mailing List <[hidden email]>; [hidden email] Developers <[hidden email]>
Subject: [llvm-dev] Filename's in DIBuileder

 

[CAUTION: External Email]

Hi All ,

 

We have a scenario in our debugger to handle the file index in the debug_ine info like

$llvm-dwarfdump -debug-line test.o
file_names[  1]:
           name: "test.cpp"
      dir_index: 0
       mod_time: 0x00000000
         length: 0x00000000
file_names[  2]:
           name: "test.cpp"
      dir_index: 1
       mod_time: 0x00000000
         length: 0x00000000

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000     12      0      1   0             0  is_stmt
0x0000000000000008     13      1      1   0             0  is_stmt prologue_end
0x0000000000000010     16      0      1   0             0  is_stmt
0x0000000000000018     17      1      1   0             0  is_stmt prologue_end
0x0000000000000020     20      0      1   0             0  is_stmt
0x0000000000000028     21      9      1   0             0  is_stmt prologue_end
0x000000000000002f     22      9      1   0             0  is_stmt
0x0000000000000032     22     10      1   0             0
0x0000000000000035     22      7      1   0             0
0x000000000000003c     23      1      1   0             0  is_stmt
0x0000000000000040     25      0      1   0             0  is_stmt
0x0000000000000044     25     13      1   0             0  is_stmt prologue_end
0x0000000000000080      0      0      2   0             0  is_stmt
0x000000000000008b      0      0      2   0             0  is_stmt end_sequence


the debug info is emitted by the DIBuilder like

!3 = !DIFile(filename: "/folk/tmp/test/test.cpp", directory: "/folk/tmp/test")
!45 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test.cpp", scope: !3, file: !3, type: !46, flags: DIFlagArtificial, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)

!8 = !DIFile(filename: "test.cpp", directory: "/folk/tmp/test")
!16 = !DISubprogram(name: "proc", linkageName: "_ZN4test4procEv", scope: !9, file: !8, line: 8, type: !12, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)

Latest clang trunk used like

$clang -std=c++14  -g -eimit-llvm -S   /folk/tmp/test/test.cpp

and the respective files like test.cc ,test.ll and test.s are attached in the mail for the reference.

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"
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 .

So we like to hear from experts here  ,before we investigate the DIBuilder to fix the same.

 

Thank you
~Umesh 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev