summaryrefslogtreecommitdiff
path: root/gdb/corefile.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-01-01 22:02:02 +0000
committerPedro Alves <pedro@codesourcery.com>2009-01-01 22:02:02 +0000
commit8877c09eea2fef8be9ec8fd2b8ef8e238a4eeaab (patch)
tree13790f4308c4c98e04af6a6e4873a2a48194c4a8 /gdb/corefile.c
parent10174d3f99d4d5ffd2fe549da8e9ad2bc75b2613 (diff)
downloadgdb-8877c09eea2fef8be9ec8fd2b8ef8e238a4eeaab.tar.gz
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.
Diffstat (limited to 'gdb/corefile.c')
-rw-r--r--gdb/corefile.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c
index af2d1a3633b..c477660e54c 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -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. */