* linux-low.c (linux_prepare_to_access_memory): New.

(linux_unprepare_to_access_memory): New.
	(linux_target_ops): Install them.
	* server.c (read_memory): Rename to ...
	(gdb_read_memory): ... this.  Use
	prepare_to_access_memory/prepare_to_access_memory.
	(write_memory): Rename to ...
	(gdb_write_memory): ... this.  Use
	prepare_to_access_memory/prepare_to_access_memory.
	(handle_search_memory_1): Adjust.
	(process_serial_event): Adjust.
	* target.h (struct target_ops): New fields
	prepare_to_access_memory and unprepare_to_access_memory.
	(prepare_to_access_memory, unprepare_to_access_memory): New.
	* linux-x86-low.c (x86_insert_point, x86_remove_point): Use
	prepare_to_access_memory/prepare_to_access_memory.
	* nto-low.c (nto_target_ops): Adjust.
	* spu-low.c (spu_target_ops): Adjust.
	* win32-low.c (win32_target_ops): Adjust.
This commit is contained in:
Pedro Alves
2010-08-26 23:17:22 +00:00
parent ae53ffa4b6
commit 90d74c301f
8 changed files with 128 additions and 13 deletions

View File

@@ -546,7 +546,7 @@ i386_dr_low_get_status (void)
return x86_linux_dr_get (ptid, DR_STATUS);
}
/* Watchpoint support. */
/* Breakpoint/Watchpoint support. */
static int
x86_insert_point (char type, CORE_ADDR addr, int len)
@@ -555,7 +555,16 @@ x86_insert_point (char type, CORE_ADDR addr, int len)
switch (type)
{
case '0':
return set_gdb_breakpoint_at (addr);
{
int ret;
ret = prepare_to_access_memory ();
if (ret)
return -1;
ret = set_gdb_breakpoint_at (addr);
unprepare_to_access_memory ();
return ret;
}
case '2':
case '3':
case '4':
@@ -574,7 +583,16 @@ x86_remove_point (char type, CORE_ADDR addr, int len)
switch (type)
{
case '0':
return delete_gdb_breakpoint_at (addr);
{
int ret;
ret = prepare_to_access_memory ();
if (ret)
return -1;
ret = delete_gdb_breakpoint_at (addr);
unprepare_to_access_memory ();
return ret;
}
case '2':
case '3':
case '4':