Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging c# in the command line

Just for fun, how close can we get to debug an application in C# using only the command-line out-of-the-box? No other software, just the command-line. That is, for instance, is there a way to peek at the values of variables, interact with output, etc. like the VS debugger does?

EDIT: And just for completeness' sake, here is the mono equivalent: http://mono-project.com/Guide:Debugger, although it doesn't seem to be very stable.

Thanks.

like image 436
Dervin Thunk Avatar asked Nov 01 '09 10:11

Dervin Thunk


People also ask

What is debugging in C?

Debugging is a methodical process of finding and reducing the number of bugs (or defects) in a computer program, thus making it behave as originally expected. There are two main types of errors that need debugging: ▶ Compile-time: These occur due to misuse of language constructs, such as syntax errors.

Is there a debugger for C?

Execute the C program in gdb debugger You can start running the program using the run command in the gdb debugger. You can also give command line arguments to the program via run args. The example program we used here does not requires any command line arguments so let us give run, and start the program execution.

Is debug hard C?

Compared to other programming languages, C can be a more difficult language to debug and figure out errors within code, no matter if it is logic or syntax-based.


1 Answers

You can use the CLR debugger, which is part of the framework installation; and does not depend on VS.

An alternative (and more appropiate for your question) is MDbg, which is a command line debugger for managed code.

like image 159
driis Avatar answered Sep 23 '22 05:09

driis