X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fjit-debug;h=66b4411ff07d901618781294ddfce48e13eb31d4;hb=c9ed8b45ec296b041abfc1365dd6220ebbfa3345;hp=0c98f3944d10e5ee92a2dd18678423d6d8227a40;hpb=a93abb929c11b53bb83b17ab13e496523380d3b7;p=mono.git diff --git a/web/jit-debug b/web/jit-debug index 0c98f3944d1..66b4411ff07 100644 --- a/web/jit-debug +++ b/web/jit-debug @@ -1,7 +1,7 @@ * Debugging information - Compile your programs using the `-g' flag in MCS, that will generate a file - with the extension .dbg containing the dwarf symbols for your executable. + Compile your programs using the `-g' flag in MCS, that will all a special + resource containing debugging information to your executable. To get stack traces with line number information, you need to run your program like this: @@ -13,6 +13,42 @@ Notice that the program will need to be compiled with the -g flag and that running with --debug will slow down the execution. +* Debugging with GDB + + If you use GDB to debug your mono process, you can use the function + mono_print_method_from_ip(void *address) to obtain the name of a method + given an address. + + For example: + +
+(gdb) where
+#0  ves_icall_System_String_GetHashCode (me=0x80795d0) at string-icalls.c:861
+#1  0x0817f490 in ?? ()
+#2  0x0817f42a in ?? ()
+#3  0x0817f266 in ?? ()
+#4  0x0817f1a5 in ?? ()
+
+ + You can now use: + +
+(gdb) p mono_print_method_from_ip (0x0817f490)
+IP 0x817f490 at offset 0x28 of method (wrapper managed-to-native) System.String:GetHashCode () (0x817f468 0x817f4a4)
+$1 = void
+(gdb) p mono_print_method_from_ip (0x0817f42a)
+IP 0x817f42a at offset 0x52 of method System.Collections.Hashtable:GetHash (object) (0x817f3d8 0x817f43b)
+$2 = void
+
+ + Mono support libraries use a couple of signals internally that + confuse gdb, you might want to add this to your .gdbinit file: + +
+	handle SIGPWR nostop noprint 
+	handle SIGXCPU nostop noprint 
+
+ * Mono Debugger The Mono debugger is written in C# and can debug both managed @@ -24,13 +60,14 @@ href="http://lists.ximian.com/archives/public/mono-list/2003-January/011415.html">post. The debugger contains both Gtk# and command line interfaces. - The debugging file format used in Dwarf (its already supported + The debugging file format used in Dwarf (it's already supported by our class libraries and the Mono C# compiler; To debug C applications, you need a recent GCC, or to pass the -gdwarf-2 flag to gcc). - The debugger is available now, you can get it from here + You can download the releases from Martin Baulig's + home page. @@ -38,4 +75,4 @@ - \ No newline at end of file +