Hi all,
I’m returning to Mojo after a little while away and on a new operating system that is not part of the Ubuntu family (it’s Open Mandriva). While I can get Mojo to run normally, the debugger is a different story. Some of these issues have already been raised in other threads (which I will reference in this post), but I’m going to outline where I’m out for clarity and documentation purposes.
Issue 1: libedit.so.2
not found
This problem has been raised a number of times it seems in different forms:
- Cannot run Mojo REPL after successful installation
- [BUG] Failed to start the Kernel. OSError: libedit.so.2: cannot open shared object file: No such file or directory. View Jupyter log for further details.
The solution to this is fairly simple, albeit a bit annoying, which is to create a symlink like so: ln -s libedit.so.0.0.75 libedit.so.2
. Though this resolves the issue when running mojo debug --vscode ...
, it doesn’t fix it when trying to run a debugging session via VS Code as the VS Code extension installs and uses a separate copy of the Max SDK from what I remember?
Issue 2: No LZMA support found + incorrect debugger behavior with breakpoints
After implementing the workaround fix for #1 above and running mojo debug --vscode <file>.mojo
I get the following red warnings (though the program does run properly without breakpoints):
warning: (x86_64) /usr/lib64/ld-linux-x86-64.so.2 No LZMA support found for reading .gnu_debugdata section
warning: (x86_64) /lib64/libm.so.6 No LZMA support found for reading .gnu_debugdata section
warning: (x86_64) /lib64/libdl.so.2 No LZMA support found for reading .gnu_debugdata section
warning: (x86_64) /lib64/libc.so.6 No LZMA support found for reading .gnu_debugdata section
warning: (x86_64) JIT(0x7fff68009000)(0x00007fff68009000) [MojoTypeSystem::getDeclForDie]: DW_TAG_structure_type has an empty name. Die = 0x0000000000000256.
I’m not sure if this is related to the second part of this, which is that the debugger doesn’t operate properly from here forward when using breakpoints. Some of the observations I have had with regards to the weird debugger behavior are the following:
- Many symbols do not seem to resolve to normal values as I’ve seen them do in the past. For example, something like
var args = argv()
doesn’t show me what I believe it used to (which was a list of strings more or less). This is what I see.
- If I step through the program, the path of execution seems to bounce around a lot in ways I wouldn’t expect. For instance, in the following little program, if I place a breakpoint on line 8 and 12, stepping through the program will result in multiple bounces back and forth between line 12 and line 6 for seemingly no reason.
I would really like to get the Mojo debugger working properly on my system as I’m eager to delve deeper in the language and start building some things. Any help figuring this out would be greatly appreciated!