1 * A debugging session using a symbol file which has been created by MCS.
3 Let's assume we have the following C# application which we want to debug:
10 public struct MyStruct {
16 public static void Main ()
24 my_struct.c = 23323.5235;
29 First of all, we need to compile it with MCS, assemble the generated .s file and
30 create the .il files for all referenced assemblies which were not compiled with MCS:
34 $ as -o Foo-debug.o Foo-debug.s
35 $ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
38 Now we can start the JIT in the debugger:
41 $ gdb ~/monocvs/mono/mono/jit/mono
42 (gdb) r --dwarf-plus --debug Foo:Main ./Foo.exe
43 Starting program: /home/martin/monocvs/mono/mono/jit/mono --dwarf-plus --debug Foo:Main ./Foo.exe
44 Program received signal SIGTRAP, Trace/breakpoint trap.
46 (gdb) call mono_debug_make_symbols ()
47 (gdb) add-symbol-file Foo-debug.o
48 (gdb) add-symbol-file /tmp/corlib.o
50 #0 Main () at ./Foo.cs:11
51 11 public static void Main ()
53 Main () at ./Foo.cs:13
60 18 my_struct.b = test;
62 19 my_struct.c = 23323.5235;
68 my_struct = { a = 5, b = 512, c = 23323.5235 }