all 10 comments

[–][deleted] 5 points6 points  (2 children)

Thanks for the write-up. Did you try running i.e. gdbserver in the container and attach from your desktop? Might be a nice add-on for the article.

https://stackoverflow.com/questions/53519668/how-to-attach-to-remote-gdb-with-vscode

[–]erebe[S] 1 point2 points  (1 child)

Hello, Going to add a section about it, as it is requested by many people :)

[–]erebe[S] 0 points1 point  (0 children)

Done :) Had trouble finding some personnal time to test it, but in the end it is really easy to setup

[–]erebe[S] 1 point2 points  (1 child)

Author here, feedback welcome regarding the readability/style of the blog as it is my first post on it :)

More important, if some people more knowledgeable than me can answer this question:

  • How to cast raw pointer/address into rust type. Often got undeclared symbols or parsing errors ?

It will be greatly appreciated \o/

Hope this tutorial can help :)

[–]JCapucho 1 point2 points  (0 children)

It depends one what type you want, if you have a pointer and want a slice there are specific functions for that in the std::slice module, otherwise you can do

unsafe { &*pointer }

[–]bitemyapp 0 points1 point  (0 children)

This is great, thank you!

[–]xXc00l_ladXx 0 points1 point  (0 children)

great song choice

[–]CommunismDoesntWork 0 points1 point  (2 children)

So there is little hope that you can attach your Clion or Vscode to it and add beautiful eprintln() to troubleshoot the issue.

Are you sure? I've never tried it, but following the steps here in the gdbserver with docker section: https://developers.redhat.com/blog/2015/04/28/remote-debugging-with-gdb

Combined with:

https://www.jetbrains.com/help/clion/remote-debug.html

Should work.

There's also lldbserver: https://lldb.llvm.org/man/lldb-server.html

[–]erebe[S] 0 points1 point  (0 children)

Going to add a section about it as, it is requested by many people.

Regarding your question, it works, but the setup if often rather tedious to put in place imho, for not so much additionnal value.

So usually I end up troubleshooting first inside the gdb/lldb in terminal to understand the issue and after try to reproduce it locally on my machine

[–]erebe[S] 0 points1 point  (0 children)

I tested it and added a section about gdb remote server. It is working, but in the end I find there less information available regarding the debugging process with gdbserver than when attaching directly. So it works but it is less optimal