diff options
author | Zoltan Varga <vargaz@gmail.com> | 2009-10-12 16:02:21 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2009-10-12 16:02:21 +0400 |
commit | dab64ac1b846859a61db9e16faed198fa680feae (patch) | |
tree | 503f0941f390e0d0f9ba83f5a1ffd300b1f8c072 /data | |
parent | c67cb792f68e50f10302d353e8a79637b702dff0 (diff) |
2009-10-12 Zoltan Varga <vargaz@gmail.com>
* mono-gdb.py: Update this to gdb 7.0.
* mono-gdbinit: Removed, no longer needed.
svn path=/trunk/mono/; revision=143957
Diffstat (limited to 'data')
-rw-r--r-- | data/gdb/ChangeLog | 6 | ||||
-rw-r--r-- | data/gdb/mono-gdb.py | 57 | ||||
-rw-r--r-- | data/gdb/mono-gdbinit | 20 |
3 files changed, 10 insertions, 73 deletions
diff --git a/data/gdb/ChangeLog b/data/gdb/ChangeLog index 5ae92a02312..5197ee5b75a 100644 --- a/data/gdb/ChangeLog +++ b/data/gdb/ChangeLog @@ -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 diff --git a/data/gdb/mono-gdb.py b/data/gdb/mono-gdb.py index c360d658f6a..bde4d588f09 100644 --- a/data/gdb/mono-gdb.py +++ b/data/gdb/mono-gdb.py @@ -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 index aed152c5e28..00000000000 --- a/data/gdb/mono-gdbinit +++ /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 |