digitalmars.D.ldc - Can't seem to debug D apps on Mac OS Mojave
- Andrej Mitrovic (83/83) Jun 08 2019 Hi,
- Andrej Mitrovic (4/5) Jun 08 2019 Also this might not be the best place to post this since it's not
- Andrej Mitrovic (3/8) Jun 08 2019 I'll repost it to D.learn later unless someone posts a working
- Andrej Mitrovic (4/5) Jun 08 2019 Sorry guys, it looks like using LLDB with a binary built with LDC
- Jacob Carlborg (4/10) Jun 09 2019 https://issues.dlang.org/show_bug.cgi?id=18527
Hi, I'm trying out using LLDB with both the shipped version on Mac OS Mojave (lldb-1001.0.13.3), and also the one provided by Homebrew (lldb version 8.0.0), however I have issues: I can't seem to print out any variables. It works for C++ apps built with -g, but not for D apps, e.g.: Code: ----- ~/dev/d master * $ cat test.d module test; void main ( ) { int x = 1; int y = 2; int z = x + y; } $ /dev/d master * $ dmd --version DMD64 D Compiler v2.086.0 $ dmd -g test.d -oftest ----- With built-in LLDB: ----- $ ~/dev/d master * $ lldb --version lldb-1001.0.13.3 $ ~/dev/d master * $ lldb ./test (lldb) target create "./test" Current executable set to './test' (x86_64). (lldb) b test.d : 7 Breakpoint 1: where = test`_Dmain + 24, address = 0x0000000100000e90 (lldb) r Process 19968 launched: '/Users/andrejmitrovic/dev/d/test' (x86_64) Process 19968 stopped breakpoint 1.1 5 6 int y = 2; 7 -> 8 int z = x + y; 9 } Target 0: (test) stopped. (lldb) p x error: use of undeclared identifier 'x' (lldb) p y error: use of undeclared identifier 'y' (lldb) frame variable (lldb) ----- With the one provided by homebrew: ----- $ export PATH="/usr/local/opt/llvm/bin:$PATH" $ lldb --version lldb version 8.0.0 ~/dev/d master * $ lldb ./test (lldb) target create "./test" Current executable set to './test' (x86_64). (lldb) b test.d : 7 Breakpoint 1: where = test`_Dmain + 24, address = 0x0000000100000e90 (lldb) r Process 20098 launched: '/Users/andrejmitrovic/dev/d/test' (x86_64) Process 20098 stopped breakpoint 1.1 5 6 int y = 2; 7 -> 8 int z = x + y; 9 } (lldb) p x error: use of undeclared identifier 'x' (lldb) p y error: use of undeclared identifier 'y' (lldb) frame variable (lldb) ----- Is there some extra step that's needed to get it working on Mac OS? I'm having the same issue trying to use GDB (after going through all the certificate stuff..)
Jun 08 2019
On Saturday, 8 June 2019 at 10:15:23 UTC, Andrej Mitrovic wrote:HiAlso this might not be the best place to post this since it's not that relevant to LDC itself, but maybe someone knows something more here since it's LLVM-related.
Jun 08 2019
On Saturday, 8 June 2019 at 10:16:31 UTC, Andrej Mitrovic wrote:On Saturday, 8 June 2019 at 10:15:23 UTC, Andrej Mitrovic wrote:I'll repost it to D.learn later unless someone posts a working solution. :)HiAlso this might not be the best place to post this since it's not that relevant to LDC itself, but maybe someone knows something more here since it's LLVM-related.
Jun 08 2019
On Saturday, 8 June 2019 at 10:15:23 UTC, Andrej Mitrovic wrote:Hi,Sorry guys, it looks like using LLDB with a binary built with LDC works fine. It's trying to use it with a dmd-built binary that it fails. So I'll post about that somewhere else.
Jun 08 2019
On 2019-06-08 12:28, Andrej Mitrovic wrote:On Saturday, 8 June 2019 at 10:15:23 UTC, Andrej Mitrovic wrote:https://issues.dlang.org/show_bug.cgi?id=18527 -- /Jacob CarlborgHi,Sorry guys, it looks like using LLDB with a binary built with LDC works fine. It's trying to use it with a dmd-built binary that it fails. So I'll post about that somewhere else.
Jun 09 2019