gdb/
[deliverable/binutils-gdb.git] / gdb / gdbserver / mem-break.c
index 6edc88327e9716fddd7259d8df6a131346100095..19233e05269f042d6a790240530113d3f830314f 100644 (file)
@@ -1,6 +1,5 @@
 /* Memory breakpoint operations for the remote server for GDB.
-   Copyright 2002
-   Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
 
    Contributed by MontaVista Software.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "server.h"
 
-const char *breakpoint_data;
+const unsigned char *breakpoint_data;
 int breakpoint_len;
 
 #define MAX_BREAKPOINT_LEN 8
@@ -114,6 +113,14 @@ find_breakpoint_at (CORE_ADDR where)
   return NULL;
 }
 
+void
+delete_breakpoint_at (CORE_ADDR addr)
+{
+  struct breakpoint *bp = find_breakpoint_at (addr);
+  if (bp != NULL)
+    delete_breakpoint (bp);
+}
+
 static void
 reinsert_breakpoint_handler (CORE_ADDR stop_pc)
 {
@@ -203,14 +210,14 @@ check_breakpoints (CORE_ADDR stop_pc)
 }
 
 void
-set_breakpoint_data (const char *bp_data, int bp_len)
+set_breakpoint_data (const unsigned char *bp_data, int bp_len)
 {
   breakpoint_data = bp_data;
   breakpoint_len = bp_len;
 }
 
 void
-check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len)
+check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
 {
   struct breakpoint *bp = breakpoints;
   CORE_ADDR mem_end = mem_addr + mem_len;
@@ -243,7 +250,7 @@ check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len)
 }
 
 void
-check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len)
+check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
 {
   struct breakpoint *bp = breakpoints;
   CORE_ADDR mem_end = mem_addr + mem_len;
@@ -276,5 +283,3 @@ check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len)
        memcpy (buf + buf_offset, breakpoint_data + copy_offset, copy_len);
     }
 }
-
-
This page took 0.024174 seconds and 4 git commands to generate.