Question Linux Debugger Recommendations : Is GDB Effective in Debugging C# Code? (Mono Platform)

benjm-ma

Member
Joined
Jun 2, 2020
Messages
14
Programming Experience
1-3
I also write C programs and would like to know if I can also use GDB to the fullest of its capabilities when debugging C# programs. I know it's possible and needs to be configured, but wanted to know if some features are lacking when it comes to debugging C# code. Is it not worth using in favor of debuggers made specifically for C#?

Right now my needs are simple, nonetheless I'd rather use a debugger that I can rely on for any project then have to change later down the road. But maybe that wouldn't be a big deal... Nonetheless I'm looking for those experienced in using it and even any recommendations on a debugger that would be worth learning (under my current Linux environment) as I make my way through C#.

Keep in mind I do not use an IDE, so debuggers integrated into an IDE are not an option.

Thanks in advance.
 
Well on the mono develop site it there is documented support and configuration for gdb, however according to this stack answer gdb is "not very helpful for C# debugging unless you wish to debug parts of the mono runtime itself". Of the alternatives suggested, it seems that mdb is deprecated and mono-soft-debugger is the only option here according to that stack-overflow answer.
However, mono-soft-debugger is bundled with their IDE mono-develop... So I will need to build this program (sdb) in-order to use it on the command-line. sdb apparently behaves like gdb...

Why not develop better C# support with gdb as opposed to just creating a new debugger altogether?
I suppose better integration, however in the end, are these debuggers really providing anything that gdb can't by extending it?
 
My understanding of the other debuggers is that they actually interact with the Mono VM directly to get information. gbd knows nothing about the Mono VM and so it wouldn't make sense for the Mono developers to modify gbd. I think that the best that Mono developers can do is to create more gbd extensions that can make gbd act more like sdb, because a typical C# programmer will be interested in the higher level C# code, as opposed to the lower level Mono code.
 
My understanding of the other debuggers is that they actually interact with the Mono VM directly to get information. gbd knows nothing about the Mono VM and so it wouldn't make sense for the Mono developers to modify gbd. I think that the best that Mono developers can do is to create more gbd extensions that can make gbd act more like sdb, because a typical C# programmer will be interested in the higher level C# code, as opposed to the lower level Mono code.
This really makes sense. I do wonder if they would have to put in more work to make an official extension that behaves like sdb rather than just create and maintain their own debugger as they did that seamlessly integrates itself into their toolchain. Nonetheless, I suppose If I am so adamant to use GDB with C#, I can extend it myself. This is FOSS after-all.
 
Back
Top Bottom