Remote debugging from Mac to Linux container

Hey everyone, new Rust enthusiast here.

I've been trying to set up my environment so I can debug my Docker containers. I compile my Rust code as a build step and then run it as the entrypoint.

So far so good, the problem is when I try to debug my container remotely.

I've seen some people running gdbserver on the container and connecting to it from VSCode using CodeLLDB, using a very similar launch.json file as the one here. However, LLDB can't find the debug symbols, even after I copy the compiled binary from my docker container to my host machine where LLDB is running. I also tried setting up SourceMap but to no avail.

Running LLDB on the terminal is also a no go. Interestingly enough, GDB can find the symbols and debug correctly. The only problem with that is that the GDB extensions for VSCode aren't that great (for example, they can't pretty print pointers such as &str).

Does anyone have any tips for me here? Been fighting this setup for quite a while now and can't seem to find a working solution.

Thanks!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.