2009-10-12 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Mon, 12 Oct 2009 12:02:21 +0000 (12:02 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 12 Oct 2009 12:02:21 +0000 (12:02 -0000)
* mono-gdb.py: Update this to gdb 7.0.

* mono-gdbinit: Removed, no longer needed.

svn path=/trunk/mono/; revision=143957

data/gdb/ChangeLog
data/gdb/mono-gdb.py
data/gdb/mono-gdbinit [deleted file]

index 5ae92a02312c6661a764fa22a7a2b4de83552a42..5197ee5b75a7f05264dbfca9a0a64d05b1de4d00 100644 (file)
@@ -1,3 +1,9 @@
+2009-10-12  Zoltan Varga  <vargaz@gmail.com>
+
+       * mono-gdb.py: Update this to gdb 7.0.
+
+       * mono-gdbinit: Removed, no longer needed.
+
 2009-10-09  Zoltan Varga  <vargaz@gmail.com>
 
        * mono-gdb.py (MonoSupport.run_hook): Set MONO_XDEBUG to 'gdb' to activate
index c360d658f6a230b164943d4c285df1ef8a8d06d1..bde4d588f09a390ec1ef261943d008ea2e043d27 100644 (file)
@@ -4,15 +4,10 @@
 #
 
 #
-# This is a mono support mode for a python-enabled gdb:
-# http://sourceware.org/gdb/wiki/PythonGdb
+# This is a mono support mode for gdb 7.0 and later
 # Usage:
-# - copy/symlink this file, plus mono-gdbinit to the directory where the mono 
-#   executable lives.
-# - run mono under gdb, or attach to a mono process using gdb
-# - Type 'xdb' in gdb to load/reload the debugging info emitted by the runtime.
-# - The debug info is emitted to a file called xdb.s in the current working directory.
-#   When attaching to a mono process, make sure you are in the same directory.
+# - copy/symlink this file to the directory where the mono executable lives.
+# - run mono under gdb, or attach to a mono process started with --debug=gdb using gdb.
 #
 
 import os
@@ -196,52 +191,8 @@ def register_csharp_printers(obj):
 
 register_csharp_printers (gdb.current_objfile())
 
-class MonoSupport(object):
-
-    def __init__(self):
-        self.s_size = 0
-
-    def run_hook(self):
-        if os.access ("xdb.s", os.F_OK):
-            os.remove ("xdb.s")
-        gdb.execute ("set environment MONO_XDEBUG gdb")
-        
-    def stop_hook(self):
-        # Called when the program is stopped
-        # Need to recompile+reload the xdb.s file if needed
-        # FIXME: Need to detect half-written files created when the child is
-        # interrupted while executing the xdb.s writing code
-        # FIXME: Handle appdomain unload
-        if os.access ("xdb.s", os.F_OK):
-            new_size = os.stat ("xdb.s").st_size
-            if new_size > self.s_size:
-                sofile = "xdb.so"
-                gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o" % sofile)
-                # FIXME: This prints messages which couldn't be turned off
-                gdb.execute ("add-symbol-file %s 0" % sofile)
-                self.s_size = new_size
-
-class RunHook (gdb.Command):
-    def __init__ (self):
-        super (RunHook, self).__init__ ("hook-run", gdb.COMMAND_NONE,
-                                        gdb.COMPLETE_COMMAND, pre_hook_of="run")
-
-    def invoke(self, arg, from_tty):
-        mono_support.run_hook ()
+gdb.execute ("set environment MONO_XDEBUG gdb")
 
 print "Mono support loaded."
 
-mono_support = MonoSupport ()
-
-# This depends on the changes in gdb-python.diff to work
-#RunHook ()
-
-# Register our hooks
-# This currently cannot be done from python code
 
-exec_file = gdb.current_objfile ().filename
-# FIXME: Is there a way to detect symbolic links ?
-if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
-    exec_file = os.readlink (exec_file)
-exec_dir = os.path.dirname (exec_file)
-gdb.execute ("source %s/%s-gdbinit" % (exec_dir, os.path.basename (exec_file)))
diff --git a/data/gdb/mono-gdbinit b/data/gdb/mono-gdbinit
deleted file mode 100644 (file)
index aed152c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Loaded by mono-gdb.py
-
-# FIXME: According to gdb docs, this is called _before_ anything is printed
-# Got broken by this patch:
-# http://sourceware.org/ml/gdb-patches/2008-09/msg00193.html
-# FIXME: This seems to cause crashes inside gdb
-#define hook-stop
-#         python mono_support.stop_hook ()
-#end
-define hook-backtrace
-          python mono_support.stop_hook ()
-end
-
-define hook-run
-          python mono_support.run_hook ()
-end
-
-define xdb
-          python mono_support.stop_hook ()
-end