https://bugs.llvm.org/show_bug.cgi?id=39724

            Bug ID: 39724
           Summary: [DebugInfo] Arguments are lost after a call across TUs
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected],
                    [email protected], [email protected],
                    [email protected], [email protected], [email protected]

Testcase (two TUs):

a.c:

extern void other_func(long int, long int, long int);

__attribute__((noinline))
        int fn1 (long int x, long int y, long int z) {
                        int l = x * 2;
                                int q = y * z;
                                other_func(x, y, z);
                                        return l + q;
        }

__attribute__((noinline)) long int
fn2 (long int a, long int b, long int c)
{
          long int q = 2 * a;
            return fn1 (5, 6, 7);
}

int main(void) {
                return fn2(14, 23, 34);
}

b.c:

void other_func(long int a, long int b, long int c) {}


built with: ${CC} a.c b.c -O3 -g


clang + lldb:

Process 38226 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0000000100000f64 a.out`fn1(x=5, y=<unavailable>,
z=<unavailable>) at optout.c:8:12 [opt]
   5      int l = x * 2;
   6      int q = y * z;
   7      other_func(x, y, z);
-> 8      return l + q;
   9    }
   10   
   11   __attribute__((noinline)) long int
(lldb) frame var 
(long) x = 5
(long) y = <variable not available>

(long) z = <variable not available>

(int) q = 42
(int) l = <no location, value may have been optimized out>

gcc + gdb:

fn1 (x=x@entry=5, y=y@entry=6, z=z@entry=7) at opt.c:5
5                               int l = x * 2;
(gdb) n
7                                       other_func(x, y, z);
(gdb) n
8                                               return l + q;
(gdb) info locals
l = 10
q = 42
(gdb) info args
x = 5
y = 6
z = 7

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to