<div dir="ltr">Hello Everyone,<div><br></div><div>I was working on issues with debug information in FLANG, struck in a issue</div><div>Test case:</div><div> subroutine sub(a,b,c,d,e)<br>                integer a, e<br>                real b<br>                double precision c, a_s<br>                character (len=1) d<br>                a_s = b + e<br>                e = e + c<br>        end<br>        program main<br>                integer a<br>                real b<br>                double precision c<br>                character (len=1) d<br>                integer arr(4)<br>                arr(4) = 21<br>                a=789<br>                b=2.0<br>                c=3.d0<br>                d='S'<br>                call sub(a,b,c,d,arr(4))<br>        end<br></div><div><br></div><div>When, putting  a breakpoint at subroutine sub and running the program.  GDB emits  --</div><div>Breakpoint 1, sub (a=<error reading variable: Cannot access memory at address 0xffffe1d000000315>, b=<error reading variable: Cannot access memory at address 0x31540000000>,<br>    c=<error reading variable: Cannot access memory at address 0x4008000000000000>, d=<error reading variable: Cannot access memory at address 0x800000000000053>,<br>    e=<error reading variable: Cannot access memory at address 0x15>) at test1.f90:1<br>1               subroutine sub(a,b,c,d,e)<br></div><div><br></div><div>GDB is not able access subroutine arguments.</div><div><br></div><div>.debug_loc section contents</div><div><br></div><div>    00000000 00000000002010f0 000000000020113c (DW_OP_breg5 (rdi): 0; DW_OP_deref)<br>    00000015 <End of list><br>    00000025 00000000002010f0 00000000002010fa (DW_OP_breg4 (rsi): 0; DW_OP_deref)<br>    0000003a 00000000002010fa 000000000020113c (DW_OP_breg7 (rsp): -24; DW_OP_deref; DW_OP_deref)<br>    00000050 <End of list><br>    00000060 00000000002010f0 00000000002010ff (DW_OP_breg1 (rdx): 0; DW_OP_deref)<br>    00000075 00000000002010ff 000000000020113c (DW_OP_breg7 (rsp): -32; DW_OP_deref; DW_OP_deref)<br>    0000008b <End of list><br>    0000009b 00000000002010f0 0000000000201112 (DW_OP_breg2 (rcx): 0; DW_OP_deref)<br>    000000b0 <End of list><br>    000000c0 00000000002010f0 0000000000201104 (DW_OP_breg8 (r8): 0; DW_OP_deref)<br>    000000d5 0000000000201104 000000000020113c (DW_OP_breg7 (rsp): -40; DW_OP_deref; DW_OP_deref)<br>    000000eb <End of list><br></div><div><br></div><div>On analzsing the stack and memory using content of location list, it seems arguments are their but location list description incorrect.</div><div><br></div><div>Can anybody help me with this.</div><div><br></div><div>Thanks in anticipation!</div><div>Sourabh Singh Tomar</div></div>