Author: martin
Date: 2007-10-31 12:47:58 -0500 (Wed, 31 Oct 2007)
New Revision: 88586

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/debug-debugger.c
   trunk/mono/mono/mini/debug-mini.h
   trunk/mono/mono/mini/mini-amd64.c
   trunk/mono/mono/mini/mini-trampolines.c
   trunk/mono/mono/mini/mini-x86.c
Log:
Revert the debugger breakpoint code.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2007-10-31 17:47:47 UTC (rev 88585)
+++ trunk/mono/mono/mini/ChangeLog      2007-10-31 17:47:58 UTC (rev 88586)
@@ -5,21 +5,6 @@
 
 2007-10-30  Martin Baulig  <[EMAIL PROTECTED]>
 
-       * mini-trampolines.c
-       (mono_magic_trampoline): Call mono_debugger_trampoline_compiled().
-
-       * mini-amd64.c
-       (_mono_debugger_breakpoint_info_area): New public variable.
-       (mono_debugger_breakpoint_table): New public variable.
-       (mono_debugger_remove_breakpoints_from_code): New method.
-       (mono_arch_get_vcall_slot): Call it here to remove breakpoints.
-
-       * mini-x86.c
-       (_mono_debugger_breakpoint_info_area): New public variable.
-       (mono_debugger_breakpoint_table): New public variable.
-       (mono_debugger_remove_breakpoints_from_code): New method.
-       (mono_arch_get_vcall_slot): Call it here to remove breakpoints.
-
        * debug-mini.h
        (mono_debugger_thread_created): Added `MonoThread *' argument.
        (mono_debugger_extended_notification): New public method.

Modified: trunk/mono/mono/mini/debug-debugger.c
===================================================================
--- trunk/mono/mono/mini/debug-debugger.c       2007-10-31 17:47:47 UTC (rev 
88585)
+++ trunk/mono/mono/mini/debug-debugger.c       2007-10-31 17:47:58 UTC (rev 
88586)
@@ -137,8 +137,8 @@
        &mono_debugger_thread_table,
 
        &debugger_executable_code_buffer,
-       &_mono_debugger_breakpoint_info_area,
-       &mono_debugger_breakpoint_table,
+       NULL, /* &_mono_debugger_breakpoint_info_area, */
+       NULL, /* &mono_debugger_breakpoint_table, */
 
        EXECUTABLE_CODE_BUFFER_SIZE,
        MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE,

Modified: trunk/mono/mono/mini/debug-mini.h
===================================================================
--- trunk/mono/mono/mini/debug-mini.h   2007-10-31 17:47:47 UTC (rev 88585)
+++ trunk/mono/mono/mini/debug-mini.h   2007-10-31 17:47:58 UTC (rev 88586)
@@ -28,19 +28,6 @@
 mono_debugger_trampoline_compiled (MonoMethod *method, const guint8 *code);
 
 /*
- * Debugger breakpoint interface.
- */
-
-typedef struct _MonoDebuggerBreakpointInfo MonoDebuggerBreakpointInfo;
-
-#define MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE    256
-extern volatile const MonoDebuggerBreakpointInfo 
*_mono_debugger_breakpoint_info_area;
-extern volatile const MonoDebuggerBreakpointInfo 
**mono_debugger_breakpoint_table;
-
-gboolean
-mono_debugger_remove_breakpoints_from_code (const guint8 *orig_address, guint8 
*code, int size);
-
-/*
  * This is the old breakpoint interface.
  * It isn't used by the debugger anymore, but still when using the `--break' 
command
  * line argument.

Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c   2007-10-31 17:47:47 UTC (rev 88585)
+++ trunk/mono/mono/mini/mini-amd64.c   2007-10-31 17:47:58 UTC (rev 88586)
@@ -26,7 +26,6 @@
 
 #include "trace.h"
 #include "mini-amd64.h"
-#include "debug-mini.h"
 #include "inssel.h"
 #include "cpu-amd64.h"
 
@@ -5239,68 +5238,13 @@
        return 3;
 }
 
-struct _MonoDebuggerBreakpointInfo {
-       const guint8 *address;
-       guint8 saved_byte;
-};
-
-static MonoDebuggerBreakpointInfo breakpoint_info_area 
[MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE];
-static volatile const MonoDebuggerBreakpointInfo *breakpoint_table 
[MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE];
-
-volatile const MonoDebuggerBreakpointInfo *_mono_debugger_breakpoint_info_area 
= breakpoint_info_area;
-volatile const MonoDebuggerBreakpointInfo **mono_debugger_breakpoint_table = 
breakpoint_table;
-
-/*
- * Removes breakpoints from target memory.
- *
- * @orig_address:
- * The original memory address.
- *
- * @code:
- * A copy of @size bytes from that memory area, which we can modify.
- *
- * Returns:
- * TRUE if there were any breakpoints in that area, FALSE if not.
- */
-gboolean
-mono_debugger_remove_breakpoints_from_code (const guint8 *orig_address, guint8 
*code, int size)
-{
-       gboolean found_breakpoint = FALSE;
-       int i;
-
-       for (i = 0; i < MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE; i++) {
-               volatile const MonoDebuggerBreakpointInfo *info = 
mono_debugger_breakpoint_table [i];
-               int offset;
-
-               if (!info)
-                       continue;
-
-               if ((info->address < orig_address) || (info->address > 
orig_address + size))
-                       continue;
-
-               if (!found_breakpoint) {
-                       memcpy (code, orig_address, size);
-                       found_breakpoint = TRUE;
-               }
-
-               offset = info->address - orig_address;
-               code [offset] = info->saved_byte;
-       }
-
-       return found_breakpoint;
-}
-
 gpointer
 mono_arch_get_vcall_slot (guint8 *code, gpointer *regs, int *displacement)
 {
-       guint8 buf [16];
        guint32 reg;
        gint32 disp;
        guint8 rex = 0;
 
-       if (mono_debugger_remove_breakpoints_from_code (code - 9, buf, sizeof 
(buf)))
-               code = buf + 9;
-
        *displacement = 0;
 
        /* go to the start of the call instruction

Modified: trunk/mono/mono/mini/mini-trampolines.c
===================================================================
--- trunk/mono/mono/mini/mini-trampolines.c     2007-10-31 17:47:47 UTC (rev 
88585)
+++ trunk/mono/mono/mini/mini-trampolines.c     2007-10-31 17:47:58 UTC (rev 
88586)
@@ -121,8 +121,6 @@
        addr = mono_compile_method (m);
        g_assert (addr);
 
-       mono_debugger_trampoline_compiled (m, addr);
-
        /* the method was jumped to */
        if (!code)
                return addr;

Modified: trunk/mono/mono/mini/mini-x86.c
===================================================================
--- trunk/mono/mono/mini/mini-x86.c     2007-10-31 17:47:47 UTC (rev 88585)
+++ trunk/mono/mono/mini/mini-x86.c     2007-10-31 17:47:58 UTC (rev 88586)
@@ -23,7 +23,6 @@
 
 #include "trace.h"
 #include "mini-x86.h"
-#include "debug-mini.h"
 #include "inssel.h"
 #include "cpu-x86.h"
 
@@ -4446,67 +4445,12 @@
        }
 }
 
-struct _MonoDebuggerBreakpointInfo {
-       const guint8 *address;
-       guint8 saved_byte;
-};
-
-static MonoDebuggerBreakpointInfo breakpoint_info_area 
[MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE];
-static volatile const MonoDebuggerBreakpointInfo *breakpoint_table 
[MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE];
-
-volatile const MonoDebuggerBreakpointInfo *_mono_debugger_breakpoint_info_area 
= breakpoint_info_area;
-volatile const MonoDebuggerBreakpointInfo **mono_debugger_breakpoint_table = 
breakpoint_table;
-
-/*
- * Removes breakpoints from target memory.
- *
- * @orig_address:
- * The original memory address.
- *
- * @code:
- * A copy of @size bytes from that memory area, which we can modify.
- *
- * Returns:
- * TRUE if there were any breakpoints in that area, FALSE if not.
- */
-gboolean
-mono_debugger_remove_breakpoints_from_code (const guint8 *orig_address, guint8 
*code, int size)
-{
-       gboolean found_breakpoint = FALSE;
-       int i;
-
-       for (i = 0; i < MONO_DEBUGGER_BREAKPOINT_TABLE_SIZE; i++) {
-               volatile const MonoDebuggerBreakpointInfo *info = 
mono_debugger_breakpoint_table [i];
-               int offset;
-
-               if (!info)
-                       continue;
-
-               if ((info->address < orig_address) || (info->address > 
orig_address + size))
-                       continue;
-
-               if (!found_breakpoint) {
-                       memcpy (code, orig_address, size);
-                       found_breakpoint = TRUE;
-               }
-
-               offset = info->address - orig_address;
-               code [offset] = info->saved_byte;
-       }
-
-       return found_breakpoint;
-}
-
 gpointer
 mono_arch_get_vcall_slot (guint8 *code, gpointer *regs, int *displacement)
 {
-       guint8 buf [16];
        guint8 reg = 0;
        gint32 disp = 0;
 
-       if (mono_debugger_remove_breakpoints_from_code (code - 8, buf, sizeof 
(buf)))
-               code = buf + 8;
-
        *displacement = 0;
 
        /* go to the start of the call instruction

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to