[Bug 241773] lldb does not display external variables properly.

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Nov 2 17:43:51 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241773

--- Comment #6 from Ed Maste <emaste at freebsd.org> ---
Tried to reproduce on -current with

lldb version 11.0.0 (git at github.com:llvm/llvm-project.git revision
llvmorg-11.0.0-rc2-0-g414f32a9e86)
  clang revision llvmorg-11.0.0-rc2-0-g414f32a9e86
  llvm revision llvmorg-11.0.0-rc2-0-g414f32a9e86

$ make
rm -f testlib.o testlib.so testprog
cc -Wall -g -c -fPIC -o testlib.o testlib.c
cc  -shared -Wl,-export-dynamic -o testlib.so testlib.o
cc -Wall -g -o testprog ./testlib.so testprog.c
./testprog
sock = 5, id = aa
Size of testlib.c is 311 bytes.
id = aa
sock = 5

$ lldb ./testprog
(lldb) target create "./testprog"
Current executable set to '/home/emaste/bugs/pr241773/testprog' (x86_64).
(lldb) b main
Breakpoint 1: where = testprog`main + 22 at testprog.c:8:2, address =
0x0000000000201976
(lldb) run
Process 2340 launching
Process 2340 launched: '/home/emaste/bugs/pr241773/testprog' (x86_64)
Process 2340 stopped
* thread #1, name = 'testprog', stop reason = breakpoint 1.1
    frame #0: 0x0000000000201976 testprog`main(argc=1, argv=0x00007fffffffe720)
at testprog.c:8:2
   5   
   6    void testfunc(void);
   7    int main(int argc, char **argv) {
-> 8     testfunc();
   9     printf ("id = %s\n", id);
   10    printf ("sock = %d\n", sock);
   11    return 0;
(lldb) n
sock = 5, id = aa
Size of testlib.c is 311 bytes.
Process 2340 stopped
* thread #1, name = 'testprog', stop reason = step over
    frame #0: 0x000000000020197b testprog`main(argc=1, argv=0x00007fffffffe720)
at testprog.c:9:2
   6    void testfunc(void);
   7    int main(int argc, char **argv) {
   8     testfunc();
-> 9     printf ("id = %s\n", id);
   10    printf ("sock = %d\n", sock);
   11    return 0;
   12   }
(lldb) p id
(char [4]) $0 = ""
(lldb) p sock
(int) $1 = 0
(lldb) c
id = aa
sock = 5
Process 2340 resuming
Process 2340 exited with status = 0 (0x00000000) 
(lldb) ^D

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-toolchain mailing list