kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

Debug symbols should be generated as portable pdb files instead of mdb

JonnyOThan opened this issue ยท 6 comments

commented

I'm not familiar with monodevelop or mdb at all. Normally when I'm debugging KSP mods (with Visual Studio on windows), I use the portable pdb format as generated by Visual Studio.

According to this post, monodevelop can also use these: mono/mono#7107 (comment)

And it sounds like there's a way to generate them from mono directly, but I'm not sure how.

commented

I have some work in progress to move over to using rules_dotnet (see #694) rather than using custom bazel scripts that call mcs directly. This is already used in the ksp2 repo.

I'll have to check if that can generate pdb rather than mdb. Might come "for free".

commented

I've been poking around at this a bit and I'm not really sure if it's possible on mono-4.5. The documentation is really hard to find; all I could really get is "mcs supports the same build options as csc." But that doesn't seem to be true.

msc build option: -debug[+|-], -g Generate debugging information

csc build options:

-debug[+|-]                   Emit debugging information
-debug:{full|pdbonly|portable|embedded}
                              Specify debugging type ('full' is default,
                              'portable' is a cross-platform format,
                              'embedded' is a cross-platform format embedded into
                              the target .dll or .exe)

Passing -debug:portable to msc doesn't seem to work.

commented

Maybe there is a tool to convert from one to the other?

commented

There is one (pdb2mdb) to convert a native (full) pdb to mdb format, but I'm not sure about the opposite direction.

In any case I can probably just compile the few libs I need with VS. Does bazel generate the csproj files themselves, or is that OK to just edit in place?

commented

csproj files are not generated. You can freely edit anything that's not in any of the bazel-* directories. All the generated code is placed in there to keep it separate from the handwritten source.

This might be a helpful place to look for more info: https://forum.kerbalspaceprogram.com/topic/102909-ksp-plugin-debugging-and-profiling-for-visual-studio-and-monodevelop-on-all-os/

commented

It looks like rules_dotnet already generates pdb rather than mdb. See the krpc-core repository.

So once my changes in #694 to transition to rules_dotnet in this repo are done, bazel will generate pdb :)