示例#1
0
void
_initialize_i386_linux_nat (void)
{
  struct target_ops *t;

  /* Fill in the generic GNU/Linux methods.  */
  t = linux_target ();

  i386_use_watchpoints (t);

  i386_dr_low.set_control = i386_linux_dr_set_control;
  i386_dr_low.set_addr = i386_linux_dr_set_addr;
  i386_dr_low.reset_addr = i386_linux_dr_reset_addr;
  i386_dr_low.get_status = i386_linux_dr_get_status;
  i386_dr_low.unset_status = i386_linux_dr_unset_status;
  i386_set_debug_register_length (4);

  /* Override the default ptrace resume method.  */
  t->to_resume = i386_linux_resume;

  /* Override the GNU/Linux inferior startup hook.  */
  super_post_startup_inferior = t->to_post_startup_inferior;
  t->to_post_startup_inferior = i386_linux_child_post_startup_inferior;

  /* Add our register access methods.  */
  t->to_fetch_registers = i386_linux_fetch_inferior_registers;
  t->to_store_registers = i386_linux_store_inferior_registers;

  t->to_read_description = i386_linux_read_description;

  /* Register the target.  */
  linux_nat_add_target (t);
  linux_nat_set_new_thread (t, i386_linux_new_thread);
}
示例#2
0
void
_initialize_ppc_linux_nat (void)
{
  struct target_ops *t;

  /* Fill in the generic GNU/Linux methods.  */
  t = linux_target ();

  /* Add our register access methods.  */
  t->to_fetch_registers = ppc_linux_fetch_inferior_registers;
  t->to_store_registers = ppc_linux_store_inferior_registers;

  /* Add our watchpoint methods.  */
  t->to_can_use_hw_breakpoint = ppc_linux_check_watch_resources;
  t->to_region_ok_for_hw_watchpoint = ppc_linux_region_ok_for_hw_watchpoint;
  t->to_insert_watchpoint = ppc_linux_insert_watchpoint;
  t->to_remove_watchpoint = ppc_linux_remove_watchpoint;
  t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
  t->to_stopped_data_address = ppc_linux_stopped_data_address;
  t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range;

  t->to_read_description = ppc_linux_read_description;

  /* Register the target.  */
  linux_nat_add_target (t);
  linux_nat_set_new_thread (t, ppc_linux_new_thread);
}
void
x86_linux_add_target (struct target_ops *t)
{
  linux_nat_add_target (t);
  linux_nat_set_new_thread (t, x86_linux_new_thread);
  linux_nat_set_new_fork (t, x86_linux_new_fork);
  linux_nat_set_forget_process (t, x86_forget_process);
  linux_nat_set_prepare_to_resume (t, x86_linux_prepare_to_resume);
}
示例#4
0
void
_initialize_amd64_linux_nat (void)
{
  struct target_ops *t;

  amd64_native_gregset32_reg_offset = amd64_linux_gregset32_reg_offset;
  amd64_native_gregset32_num_regs = I386_LINUX_NUM_REGS;
  amd64_native_gregset64_reg_offset = amd64_linux_gregset_reg_offset;
  amd64_native_gregset64_num_regs = AMD64_LINUX_NUM_REGS;

  gdb_assert (ARRAY_SIZE (amd64_linux_gregset32_reg_offset)
	      == amd64_native_gregset32_num_regs);

  /* Fill in the generic GNU/Linux methods.  */
  t = linux_target ();

  i386_use_watchpoints (t);

  i386_dr_low.set_control = amd64_linux_dr_set_control;
  i386_dr_low.set_addr = amd64_linux_dr_set_addr;
  i386_dr_low.get_addr = amd64_linux_dr_get_addr;
  i386_dr_low.get_status = amd64_linux_dr_get_status;
  i386_dr_low.get_control = amd64_linux_dr_get_control;
  i386_set_debug_register_length (8);

  /* Override the GNU/Linux inferior startup hook.  */
  super_post_startup_inferior = t->to_post_startup_inferior;
  t->to_post_startup_inferior = amd64_linux_child_post_startup_inferior;

  /* Add our register access methods.  */
  t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
  t->to_store_registers = amd64_linux_store_inferior_registers;

  t->to_read_description = amd64_linux_read_description;

  /* Register the target.  */
  linux_nat_add_target (t);
  linux_nat_set_new_thread (t, amd64_linux_new_thread);
  linux_nat_set_siginfo_fixup (t, amd64_linux_siginfo_fixup);
  linux_nat_set_prepare_to_resume (t, amd64_linux_prepare_to_resume);
}
示例#5
0
void
_initialize_ia64_linux_nat (void)
{
  struct target_ops *t;

  /* Fill in the generic GNU/Linux methods.  */
  t = linux_target ();

  /* Override the default fetch/store register routines.  */
  t->to_fetch_registers = ia64_linux_fetch_registers;
  t->to_store_registers = ia64_linux_store_registers;

  /* Override the default to_xfer_partial.  */
  super_xfer_partial = t->to_xfer_partial;
  t->to_xfer_partial = ia64_linux_xfer_partial;

  /* Override watchpoint routines.  */

  /* The IA-64 architecture can step over a watch point (without triggering
     it again) if the "dd" (data debug fault disable) bit in the processor
     status word is set.

     This PSR bit is set in ia64_linux_stopped_by_watchpoint when the
     code there has determined that a hardware watchpoint has indeed
     been hit.  The CPU will then be able to execute one instruction
     without triggering a watchpoint.  */

  t->to_have_steppable_watchpoint = 1;
  t->to_can_use_hw_breakpoint = ia64_linux_can_use_hw_breakpoint;
  t->to_stopped_by_watchpoint = ia64_linux_stopped_by_watchpoint;
  t->to_stopped_data_address = ia64_linux_stopped_data_address;
  t->to_insert_watchpoint = ia64_linux_insert_watchpoint;
  t->to_remove_watchpoint = ia64_linux_remove_watchpoint;

  /* Register the target.  */
  linux_nat_add_target (t);
  linux_nat_set_new_thread (t, ia64_linux_new_thread);
  linux_nat_set_status_is_event (t, ia64_linux_status_is_event);
}