Running Rimworld under a debugger for DLL modding

Started by justarandomgeek, March 05, 2015, 04:24:44 PM

Previous topic - Next topic

justarandomgeek

I'm trying to sort out a particularly hairy bit of code for managing networks between Things (well, technically ThingComps) for my in-progress Signals mod, but it's very difficult to see what's going on without a debugger attached. Is there any way to run RimWorld such that I can drop breakpoints in the code for my mod and step through it? If it makes a difference, I'm using SharpDevelop instead of Visual Studio, but afaik they should be interchangeable for this purpose (and since Unity is using Mono, SharpDevelop is actually a little bit more closely related!).

When I try, it seems like the debugger never really attaches, possibly because of something Unity/Mono does under the hood?

I know this must be possible, I just can't seem to make it work...

soulkata


justarandomgeek

Quote from: soulkata on March 05, 2015, 08:49:32 PM
No Debbuger, insted use Log.Message("");

Uhg. That's what I'm doing now, but that's going to get annoying quickly...

mipen

What I do is put a Log.Message() between each line, so if there is a null reference I can see exactly where it happens. I also use it to report values of variables and what not to see exactly what is going on. Not exactly elegant but it gets the job done

justarandomgeek

Oh yes, I'm quite familiar with log-only style debugging, it's just so much more of a pain, and I was just hoping there was a way to use some real tools! I did manage to sort out the particular issue that prompted this last night with some very verbose logging though.

justarandomgeek

I suppose I should add this here too, for the benefit of anyone else looking for this answer:

I PM'd Tynan about this the other day also, and he said he's not aware of any way to do this, and suspects that it is somewhere between difficult and impossible.

skullywag

im assuming the unity monodevelop debugger is not suitable for this or not compatible?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

StorymasterQ

Quote from: justarandomgeek on March 07, 2015, 11:18:25 AM
I suppose I should add this here too, for the benefit of anyone else looking for this answer:

I PM'd Tynan about this the other day also, and he said he's not aware of any way to do this, and suspects that it is somewhere between difficult and impossible.

Sounds like a job for McKay.
Quote from: Stargate Wiki
"I'm Dr. Rodney McKay, alright? Difficult takes a few seconds; impossible, a few minutes."
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here