From e927c9fccb149b2a7bbdce1efd1a07d4367444a2 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Wed, 11 Jun 2014 15:42:34 +0100 Subject: [PATCH] Merge error handling This commit makes all error handling in i386-low.c use internal_error rather than fatal and error. gdb/gdbserver/ 2014-06-18 Gary Benson * i386-low.c (i386_length_and_rw_bits): Use internal_error instead of fatal and error. (i386_handle_nonaligned_watchpoint): Likewise. --- gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/i386-low.c | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 47a538f0262..91dc4983f68 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2014-06-18 Gary Benson + + * i386-low.c (i386_length_and_rw_bits): Use internal_error + instead of fatal and error. + (i386_handle_nonaligned_watchpoint): Likewise. + 2014-06-18 Gary Benson * i386-low.c (i386_get_debug_register_length): New macro. diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c index b154fcdb0e8..54dd4b8eaf2 100644 --- a/gdb/gdbserver/i386-low.c +++ b/gdb/gdbserver/i386-low.c @@ -225,7 +225,9 @@ i386_length_and_rw_bits (int len, enum target_hw_bp_type type) rw = DR_RW_WRITE; break; case hw_read: - fatal ("The i386 doesn't support data-read watchpoints.\n"); + internal_error (__FILE__, __LINE__, + _("The i386 doesn't support " + "data-read watchpoints.\n")); case hw_access: rw = DR_RW_READ; break; @@ -236,8 +238,8 @@ i386_length_and_rw_bits (int len, enum target_hw_bp_type type) break; #endif default: - error ("\ -Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n", + internal_error (__FILE__, __LINE__, _("\ +Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n"), (int) type); } @@ -254,8 +256,8 @@ Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n", return (DR_LEN_8 | rw); /* ELSE FALL THROUGH */ default: - error ("\ -Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n", len); + internal_error (__FILE__, __LINE__, _("\ +Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len); } } @@ -401,10 +403,9 @@ i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, else if (what == WP_REMOVE) retval = i386_remove_aligned_watchpoint (state, addr, len_rw); else - fatal ("\ -Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n", - (int) what); - + internal_error (__FILE__, __LINE__, _("\ +Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"), + (int) what); if (retval) break; } -- 2.30.2