summaryrefslogtreecommitdiffstats
path: root/gdb/corefile.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-01-01 22:02:03 +0000
committerPedro Alves <palves@redhat.com>2009-01-01 22:02:03 +0000
commitccc57cf9e6782a19d8bccb1fdd0d02dd6ab98702 (patch)
tree8f5a92c1161105aae211fbdd06369748a2eee8e3 /gdb/corefile.c
parent023b0f5cefb067d6338e9bfd2987e4ed54b8b379 (diff)
downloadppe42-binutils-ccc57cf9e6782a19d8bccb1fdd0d02dd6ab98702.tar.gz
ppe42-binutils-ccc57cf9e6782a19d8bccb1fdd0d02dd6ab98702.zip
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 af2d1a3633..c477660e54 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. */
OpenPOWER on IntegriCloud