I'd like to work on a mod and I want to be able to put breakpoints during debug. I'm using VSCode. Is this possible with VSCode or any other IDE?
Mod development using debug breakpoints?
You cannot put breakpoints in plugins because they are not executed by your IDE etc. You could manually debug all information you want though with Puts (haha but not kidding)
misticos
You cannot put breakpoints in plugins because they are not executed by your IDE etc. You could manually debug all information you want though with Puts (haha but not kidding)
Thanks, I was afraid it probably wasn't possible. I was thinking more along the lines of Xdebug for debugging remote PHP in an IDE. It would be interesting to hear from someone who's written an extensive plugin like "Raidable Bases" and what their (probably painful) approach is. What is yours? What IDE are you using?
ps - Thanks for all the work you've done. I'm using a few of you plugins on my dev server.
Rider on top for me. And tbh debugging plugins is a bit of pain but I just do #define DEBUG in the beginning and later #if DEBUG then print debug info, that helps alot and it doesnt affect performance when disabled.
I checked out Rider having used JB products, namely IDEA, in the past, but just stuck with VS2019 for these mods. What are some pros of Rider? I wanted to use VSCode, but didn't want to spend the time to figure out all of the referencing. I'll probably go the same route with the #debug def. Thanks!misticos
Rider on top for me. And tbh debugging plugins is a bit of pain but I just do #define DEBUG in the beginning and later #if DEBUG then print debug info, that helps alot and it doesnt affect performance when disabled.
VS code setup was pretty easy. I just installed the Omnisharp extension and pasted the .csproj file from VS. For each plugin project, I now simply paste the same csproj file and just rename it.
Rider UI is just much nicer, the auto completion and quick fixes are 10 times better and there are more of such in general. give it a try and you'll see in a week or less
I might move over eventually.WhiteThunder
VS code setup was pretty easy. I just installed the Omnisharp extension and pasted the .csproj file from VS. For each plugin project, I now simply paste the same csproj file and just rename it.
misticos
Rider UI is just much nicer, the auto completion and quick fixes are 10 times better and there are more of such in general. give it a try and you'll see in a week or less
I always liked the JB tools. I'll check it out. Has anyone tried to attach the debugger to the running server process and debug that way? I'd like to be able to peek into the memory and suss out information. If not, I guess the decompile the dlls is the best we can do?
You can determine almost everything you need to know by examining the assemblies and using plugins to query objects at runtime. It just takes some experience to know where to look, which can be developed within a few months of actively developing plugins.
WhiteThunder
You can determine almost everything you need to know by examining the assemblies and using plugins to query objects at runtime. It just takes some experience to know where to look, which can be developed within a few months of actively developing plugins.
Yeah, experience is key. Wulf seems to think its possible in this thread, so that's why I'd like to get more information about attaching to a process for debugging.
https://umod.org/community/rust/1723-debug-define-in-plugins?page=1#post-7
I'm not sure what I was thinking of with that answer, but what I was saying was that it isn't really possible out of the box in your IDE without something to run though the plugin.RustWardYeah, experience is key. Wulf seems to think its possible in this thread, so that's why I'd like to get more information about attaching to a process for debugging.
https://umod.org/community/rust/1723-debug-define-in-plugins?page=1#post-7
It is possible to debug built unity games with dnSpy. Not sure if it works for Rust in particular, but probably it does.
https://github.com/dnSpy/dnSpy/wiki/Debugging-Unity-Games
Yeah, but main thing would be a debugging a plugin in the IDE I think vs. on the server directly.2CHEVSKII
It is possible to debug built unity games with dnSpy. Not sure if it works for Rust in particular, but probably it does.
https://github.com/dnSpy/dnSpy/wiki/Debugging-Unity-Games
Well, I think it is not possible then. Not until someone digs into dbSpy debug protocol and find a way to tie it up with VS or rider or whatever.Wulf
Yeah, but main thing would be a debugging a plugin in the IDE I think vs. on the server directly.
Forgot to mention that when debugging your plugin in the way I mentioned, you would probably need to precompile it down to extension, or inject directly to Oxide.Rust for example, not sure if debugger could aquire type information without doing so.