From 38e08fcac0966f52dac0ec97870fdea4de304d86 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Wed, 6 Aug 2014 11:56:25 +0100 Subject: Straightforward fatal to internal_error conversions This commit replaces most of the calls to fatal that represent internal errors with calls to internal_error, either directly or via gdb_assert and gdb_assert_not_reached. gdb/gdbserver/ChangeLog: * inferiors.c (get_thread_process): Replace check with gdb_assert. * linux-low.c (linux_wait_for_event_filtered): Replace fatal with internal_error. (linux_resume_one_lwp): Likewise. * linux-x86-low.c (x86_siginfo_fixup): Replace checks with gdb_assert. * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal with internal_error. * regcache.c (get_thread_regcache): Replace check with gdb_assert. (init_register_cache): Replace fatal with gdb_assert_not_reached. (find_register_by_name): Replace fatal with internal_error. (find_regno): Likewise. * tdesc.c (init_target_desc): Replace check with gdb_assert. * thread-db.c (thread_db_create_event): Likewise. (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (get_jump_space_head): Replace fatal with internal_error. (claim_trampoline_space): Likewise. (have_fast_tracepoint_trampoline_buffer): Likewise. (cmd_qtstart): Likewise. (stop_tracing): Likewise. (fast_tracepoint_collecting): Likewise. (target_malloc): Likewise. (download_tracepoint): Likewise. (download_trace_state_variables): Replace check with gdb_assert. (upload_fast_traceframes): Replace fatal with internal_error. --- gdb/gdbserver/thread-db.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gdb/gdbserver/thread-db.c') diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index d69c9e4..eabfe20 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -193,8 +193,7 @@ thread_db_create_event (CORE_ADDR where) struct lwp_info *lwp; struct thread_db *thread_db = current_process ()->private->thread_db; - if (thread_db->td_ta_event_getmsg_p == NULL) - fatal ("unexpected thread_db->td_ta_event_getmsg_p == NULL"); + gdb_assert (thread_db->td_ta_event_getmsg_p != NULL); if (debug_threads) debug_printf ("Thread creation event.\n"); @@ -561,8 +560,7 @@ thread_db_load_search (void) struct thread_db *tdb; struct process_info *proc = current_process (); - if (proc->private->thread_db != NULL) - fatal ("unexpected: proc->private->thread_db != NULL"); + gdb_assert (proc->private->thread_db == NULL); tdb = xcalloc (1, sizeof (*tdb)); proc->private->thread_db = tdb; @@ -607,8 +605,7 @@ try_thread_db_load_1 (void *handle) struct thread_db *tdb; struct process_info *proc = current_process (); - if (proc->private->thread_db != NULL) - fatal ("unexpected: proc->private->thread_db != NULL"); + gdb_assert (proc->private->thread_db == NULL); tdb = xcalloc (1, sizeof (*tdb)); proc->private->thread_db = tdb; -- cgit v1.1