mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-15 03:48:11 +08:00
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:
@ -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. */
|
||||
|
Reference in New Issue
Block a user