2009-01-01 Pedro Alves <pedro@codesourcery.com>

PR breakpoints/9681:
	* exceptions.h (enum errors): New error type, MEMORY_ERROR.
	* corefile.c (memory_error): Rewrite to throw a MEMORY_ERROR.
	* breakpoint.c (fetch_watchpoint_value): Ignore MEMORY_ERRORs, but
	retrow all other exceptions.

2009-01-01  Pedro Alves  <pedro@codesourcery.com>

	PR breakpoints/9681:
	* gdb.base/watchpoint.exp: Add regression test.
This commit is contained in:
Pedro Alves
2009-01-01 22:02:03 +00:00
parent 023b0f5cef
commit ccc57cf9e6
6 changed files with 60 additions and 20 deletions

View File

@ -205,30 +205,22 @@ Use the \"file\" or \"exec-file\" command."));
}
/* Report a memory error with error(). */
/* Report a memory error by throwing a MEMORY_ERROR error. */
void
memory_error (int status, CORE_ADDR memaddr)
{
struct ui_file *tmp_stream = mem_fileopen ();
make_cleanup_ui_file_delete (tmp_stream);
if (status == EIO)
{
/* Actually, address between memaddr and memaddr + len
was out of bounds. */
fprintf_unfiltered (tmp_stream, "Cannot access memory at address ");
fputs_filtered (paddress (memaddr), tmp_stream);
}
/* Actually, address between memaddr and memaddr + len was out of
bounds. */
throw_error (MEMORY_ERROR,
_("Cannot access memory at address %s"),
paddress (memaddr));
else
{
fprintf_filtered (tmp_stream, "Error accessing memory address ");
fputs_filtered (paddress (memaddr), tmp_stream);
fprintf_filtered (tmp_stream, ": %s.",
safe_strerror (status));
}
error_stream (tmp_stream);
throw_error (MEMORY_ERROR,
_("Error accessing memory address %s: %s."),
paddress (memaddr),
safe_strerror (status));
}
/* Same as target_read_memory, but report an error if can't read. */