This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 252205 - No source code shown when attaching to process on OS X with lldb-mi
Summary: No source code shown when attaching to process on OS X with lldb-mi
Status: RESOLVED INCOMPLETE
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: henk89
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-02 16:14 UTC by PerMildner
Modified: 2015-08-07 12:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
GDB log (18.58 KB, text/plain)
2015-07-15 14:00 UTC, PerMildner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description PerMildner 2015-05-02 16:14:01 UTC
Compiled simple C program and attached with NetBeans using lldb-mi. Can pause and show backtrace but there is no source shown when selecting the stack frame corresponding to my code. Instead an error dialog, similar to Bug 252204, appears when I select a stack frame.

The variables view shows the local variables.

Note that I have no project. I want to use NetBeans as a plain attachable debugger.

Reproduce with the same steps as in Bug 252204 but attach to the following program:


#include <stdio.h>
#include <unistd.h>

int main(int argc, char const *argv[])
{
  int tick = 0;
  while (tick++ < 10000) {
    fprintf(stderr, "Tick %d\n", tick);
    fflush(stderr);
    sleep(1);
  }
  return 0;
}

compile and run with:
bash$ cc --version
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
bash$ cc -g -Wall -Werror test.c -o test
bash$ ./test

The Debugger Log shows
###BEGIN
This log is saved to: /var/folders/yt/g4309t6d6m50dn_g25g551rc0000gn/T/gdb-cmds7538633196453937621.log
NB build: 201505020001
(gdb)
-file-exec-and-symbols "/Users/perm/.gdbinit"
(gdb)
(gdb)
error: 'settings set' takes more arguments
error: 'settings set' takes more arguments
(gdb)
Process 14737 stopped
    frame #0: 0x00007fff8d05a48a libsystem_kernel.dylib`__semwait_signal + 10
libsystem_kernel.dylib`__semwait_signal:
->  0x7fff8d05a48a <+10>: jae    0x7fff8d05a494            ; <+20>
    0x7fff8d05a48c <+12>: movq   %rax, %rdi
    0x7fff8d05a48f <+15>: jmp    0x7fff8d055c78            ; cerror
    0x7fff8d05a494 <+20>: retq   

(gdb)
Process 14737 stopped
    frame #0: 0x00007fff8d05a48a libsystem_kernel.dylib`__semwait_signal + 10
libsystem_kernel.dylib`__semwait_signal:
->  0x7fff8d05a48a <+10>: jae    0x7fff8d05a494            ; <+20>
    0x7fff8d05a48c <+12>: movq   %rax, %rdi
    0x7fff8d05a48f <+15>: jmp    0x7fff8d055c78            ; cerror
    0x7fff8d05a494 <+20>: retq   

(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
MI: Error: Command Args. Validation failed. Mandatory args not found: s, e. Not all arguments or options were recognised: --
(gdb)
(gdb)
MI: Error: Command Args. Validation failed. Mandatory args not found: s, e. Not all arguments or options were recognised: --
(gdb)
(gdb)
(gdb)
(gdb)
MI parse error while parsing 'result list': Expected , or ] but got SYM (var0"')
(gdb)
MI parse error while parsing 'result list': Expected , or ] but got SYM (var1"')
(gdb)
MI parse error while parsing 'result list': Expected , or ] but got SYM (var2"')
(gdb)

###END

Same setup as in Bug 252204:

NetBeans ID Dev 201505020001

llvm, lldb from git, April 21 2015 (git log in in llvm/tools/lldb shows latest commit 0cdf53f1cd80adc95a6b098af2ff55ac9de07e3c)

OS X 10.10.3, Xcode 6.3.1.
Comment 1 henk89 2015-07-15 13:38:30 UTC
Please provide me with a gdb log. Its location is shown in the first line in the debugger console.
Comment 2 PerMildner 2015-07-15 14:00:01 UTC
Created attachment 154656 [details]
GDB log

I have updated to Xcode 6.4 since the original bug report:
bash-3.2$ cc --version
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.4.0
Thread model: posix
bash-3.2$ cc -g -Wall -Werror test.c -o test
bash-3.2$ ./test
Tick 1
Comment 3 henk89 2015-07-15 15:47:11 UTC
It looks like there is no symbolic info in the binary being debugged or maybe there is an incompatibility issue. Are you able to debug in the command line mode?

BTW, disassembly should work in the next nightly build.
Comment 4 PerMildner 2015-07-15 21:11:19 UTC
Source debugging works from the command line, both with lldb and with gdb:

bash-3.2$ LLDB_DEBUGSERVER_PATH=~/bin/llvm-git/bin/debugserver ~/bin/llvm-git/bin/lldb -- ./test
(lldb) target create "./test"
Current executable set to './test' (x86_64).
(lldb) run
Process 69493 launched: './test' (x86_64)
Tick 1
Tick 2
Tick 3
  C-c C-cProcess 69493 stopped
...
(lldb) up
...
(lldb) 
...
(lldb) 
frame #3: 0x0000000100000f40 test`main(argc=1, argv=0x00007fff5fbff8d0) + 112 at test.c:10
   7      while (tick++ < 10000) {
   8        fprintf(stderr, "Tick %d\n", tick);
   9        fflush(stderr);
-> 10       sleep(1);
   11     }
   12     return 0;
   13   }
(lldb)
Comment 5 henk89 2015-07-28 08:57:00 UTC
Have you tried the latest build yet?