+2014-08-28 Gary Benson <gbenson@redhat.com>
+
+ * 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.
+
2014-08-19 Tom Tromey <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
{
struct process_info *proc = get_thread_process (thread);
- if (proc->tdesc == NULL)
- fatal ("no target description");
+ gdb_assert (proc->tdesc != NULL);
regcache = new_register_cache (proc->tdesc);
set_inferior_regcache_data (thread, regcache);
regcache->register_status = xcalloc (1, tdesc->num_registers);
gdb_assert (REG_UNAVAILABLE == 0);
#else
- fatal ("init_register_cache: can't allocate memory from the heap");
+ gdb_assert_not_reached ("can't allocate memory from the heap");
#endif
}
else
for (i = 0; i < tdesc->num_registers; i++)
if (strcmp (name, tdesc->reg_defs[i].name) == 0)
return &tdesc->reg_defs[i];
- fatal ("Unknown register %s requested", name);
- return 0;
+ internal_error (__FILE__, __LINE__, "Unknown register %s requested",
+ name);
}
int
for (i = 0; i < tdesc->num_registers; i++)
if (strcmp (name, tdesc->reg_defs[i].name) == 0)
return i;
- fatal ("Unknown register %s requested", name);
- return -1;
+ internal_error (__FILE__, __LINE__, "Unknown register %s requested",
+ name);
}
struct reg *
{
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_jump_pad_buffer,
&gdb_jump_pad_head))
- fatal ("error extracting jump_pad_buffer");
+ {
+ internal_error (__FILE__, __LINE__,
+ "error extracting jump_pad_buffer");
+ }
}
return gdb_jump_pad_head;
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_trampoline_buffer,
&trampoline_buffer_tail))
{
- fatal ("error extracting trampoline_buffer");
- return 0;
+ internal_error (__FILE__, __LINE__,
+ "error extracting trampoline_buffer");
}
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_trampoline_buffer_end,
&trampoline_buffer_head))
{
- fatal ("error extracting trampoline_buffer_end");
- return 0;
+ internal_error (__FILE__, __LINE__,
+ "error extracting trampoline_buffer_end");
}
}
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_trampoline_buffer_end,
&trampoline_end))
{
- fatal ("error extracting trampoline_buffer_end");
- return 0;
+ internal_error (__FILE__, __LINE__,
+ "error extracting trampoline_buffer_end");
}
if (buf)
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_trampoline_buffer_error,
&errbuf))
{
- fatal ("error extracting errbuf");
- return 0;
+ internal_error (__FILE__, __LINE__,
+ "error extracting errbuf");
}
read_inferior_memory (errbuf, (unsigned char *) buf, 100);
if (agent_loaded_p ())
{
if (write_inferior_integer (ipa_sym_addrs.addr_tracing, 1))
- fatal ("Error setting tracing variable in lib");
+ {
+ internal_error (__FILE__, __LINE__,
+ "Error setting tracing variable in lib");
+ }
if (write_inferior_data_pointer (ipa_sym_addrs.addr_stopping_tracepoint,
0))
- fatal ("Error clearing stopping_tracepoint variable in lib");
+ {
+ internal_error (__FILE__, __LINE__,
+ "Error clearing stopping_tracepoint variable"
+ " in lib");
+ }
if (write_inferior_integer (ipa_sym_addrs.addr_trace_buffer_is_full, 0))
- fatal ("Error clearing trace_buffer_is_full variable in lib");
+ {
+ internal_error (__FILE__, __LINE__,
+ "Error clearing trace_buffer_is_full variable"
+ " in lib");
+ }
stop_tracing_bkpt = set_breakpoint_at (ipa_sym_addrs.addr_stop_tracing,
stop_tracing_handler);
if (agent_loaded_p ())
{
if (write_inferior_integer (ipa_sym_addrs.addr_tracing, 0))
- fatal ("Error clearing tracing variable in lib");
+ {
+ internal_error (__FILE__, __LINE__,
+ "Error clearing tracing variable in lib");
+ }
}
tracing_stop_time = get_timestamp ();
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_jump_pad_buffer,
&ipa_gdb_jump_pad_buffer))
- fatal ("error extracting `gdb_jump_pad_buffer'");
+ {
+ internal_error (__FILE__, __LINE__,
+ "error extracting `gdb_jump_pad_buffer'");
+ }
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_jump_pad_buffer_end,
&ipa_gdb_jump_pad_buffer_end))
- fatal ("error extracting `gdb_jump_pad_buffer_end'");
+ {
+ internal_error (__FILE__, __LINE__,
+ "error extracting `gdb_jump_pad_buffer_end'");
+ }
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_trampoline_buffer,
&ipa_gdb_trampoline_buffer))
- fatal ("error extracting `gdb_trampoline_buffer'");
+ {
+ internal_error (__FILE__, __LINE__,
+ "error extracting `gdb_trampoline_buffer'");
+ }
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_trampoline_buffer_end,
&ipa_gdb_trampoline_buffer_end))
- fatal ("error extracting `gdb_trampoline_buffer_end'");
+ {
+ internal_error (__FILE__, __LINE__,
+ "error extracting `gdb_trampoline_buffer_end'");
+ }
if (ipa_gdb_jump_pad_buffer <= stop_pc
&& stop_pc < ipa_gdb_jump_pad_buffer_end)
/* We have the pointer *address*, need what it points to. */
if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_tp_heap_buffer,
&target_tp_heap))
- fatal ("could get target heap head pointer");
+ {
+ internal_error (__FILE__, __LINE__,
+ "couldn't get target heap head pointer");
+ }
}
ptr = target_tp_heap;
if (read_inferior_data_pointer (tp_prev->obj_addr_on_target
+ offsetof (struct tracepoint, next),
&tp_prev_target_next_addr))
- fatal ("error reading `tp_prev->next'");
+ {
+ internal_error (__FILE__, __LINE__,
+ "error reading `tp_prev->next'");
+ }
/* tpoint->next = tp_prev->next */
write_inferior_data_ptr (tpoint->obj_addr_on_target
name_addr);
}
- if (tsv->getter != NULL)
- {
- fatal ("what to do with these?");
- }
+ gdb_assert (tsv->getter == NULL);
}
if (prev_ptr != 0)
error ("Uploading: couldn't read traceframe at %s\n", paddress (tf));
if (ipa_tframe.tpnum == 0)
- fatal ("Uploading: No (more) fast traceframes, but "
- "ipa_traceframe_count == %u??\n",
- ipa_traceframe_write_count - ipa_traceframe_read_count);
+ {
+ internal_error (__FILE__, __LINE__,
+ "Uploading: No (more) fast traceframes, but"
+ " ipa_traceframe_count == %u??\n",
+ ipa_traceframe_write_count
+ - ipa_traceframe_read_count);
+ }
/* Note that this will be incorrect for multi-location
tracepoints... */