GDBserver
Classes | Macros | Functions | Variables
target.h File Reference
#include <sys/types.h>
#include "target/target.h"
#include "target/resume.h"
#include "target/wait.h"
#include "target/waitstatus.h"
#include "mem-break.h"
#include "btrace-common.h"
#include <vector>

Go to the source code of this file.

Classes

struct  thread_resume
 
struct  target_ops
 

Macros

#define create_inferior(program, program_args)   (*the_target->create_inferior) (program, program_args)
 
#define target_post_create_inferior()
 
#define myattach(pid)   (*the_target->attach) (pid)
 
#define target_supports_fork_events()
 
#define target_supports_vfork_events()
 
#define target_supports_exec_events()
 
#define target_handle_new_gdb_connection()
 
#define detach_inferior(pid)   (*the_target->detach) (pid)
 
#define mythread_alive(pid)   (*the_target->thread_alive) (pid)
 
#define fetch_inferior_registers(regcache, regno)   (*the_target->fetch_registers) (regcache, regno)
 
#define store_inferior_registers(regcache, regno)   (*the_target->store_registers) (regcache, regno)
 
#define join_inferior(pid)   (*the_target->join) (pid)
 
#define target_supports_non_stop()   (the_target->supports_non_stop ? (*the_target->supports_non_stop ) () : 0)
 
#define target_async(enable)   (the_target->async ? (*the_target->async) (enable) : 0)
 
#define target_process_qsupported(features, count)
 
#define target_supports_catch_syscall()
 
#define target_get_ipa_tdesc_idx()
 
#define target_supports_tracepoints()
 
#define target_supports_fast_tracepoints()   (the_target->install_fast_tracepoint_jump_pad != NULL)
 
#define target_get_min_fast_tracepoint_insn_len()
 
#define thread_stopped(thread)   (*the_target->thread_stopped) (thread)
 
#define pause_all(freeze)
 
#define unpause_all(unfreeze)
 
#define stabilize_threads()
 
#define install_fast_tracepoint_jump_pad(tpoint, tpaddr, collector, lockaddr, orig_size, jump_entry, trampoline, trampoline_size, jjump_pad_insn, jjump_pad_insn_size, adjusted_insn_addr, adjusted_insn_addr_end, err)
 
#define target_emit_ops()   (the_target->emit_ops ? (*the_target->emit_ops) () : NULL)
 
#define target_supports_disable_randomization()
 
#define target_supports_agent()
 
#define target_supports_btrace(format)
 
#define target_enable_btrace(ptid, conf)   (*the_target->enable_btrace) (ptid, conf)
 
#define target_disable_btrace(tinfo)   (*the_target->disable_btrace) (tinfo)
 
#define target_read_btrace(tinfo, buffer, type)   (*the_target->read_btrace) (tinfo, buffer, type)
 
#define target_read_btrace_conf(tinfo, buffer)   (*the_target->read_btrace_conf) (tinfo, buffer)
 
#define target_supports_range_stepping()
 
#define target_supports_stopped_by_sw_breakpoint()
 
#define target_stopped_by_sw_breakpoint()
 
#define target_supports_stopped_by_hw_breakpoint()
 
#define target_supports_hardware_single_step()
 
#define target_stopped_by_hw_breakpoint()
 
#define target_breakpoint_kind_from_pc(pcptr)
 
#define target_breakpoint_kind_from_current_state(pcptr)
 
#define target_supports_software_single_step()
 
#define target_core_of_thread(ptid)
 
#define target_thread_name(ptid)
 
#define target_thread_handle(ptid, handle, handle_len)
 

Functions

void set_target_ops (struct target_ops *)
 
int kill_inferior (int)
 
int start_non_stop (int nonstop)
 
ptid_t mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options, int connected_wait)
 
int prepare_to_access_memory (void)
 
void done_accessing_memory (void)
 
int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 
int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
 
int set_desired_thread ()
 
const char * target_pid_to_str (ptid_t)
 
int target_can_do_hardware_single_step (void)
 
int default_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
 

Variables

struct target_opsthe_target
 

Macro Definition Documentation

◆ create_inferior

#define create_inferior (   program,
  program_args 
)    (*the_target->create_inferior) (program, program_args)

Definition at line 489 of file target.h.

Referenced by captured_main(), handle_v_run(), and process_serial_event().

◆ detach_inferior

#define detach_inferior (   pid)    (*the_target->detach) (pid)

Definition at line 523 of file target.h.

Referenced by detach_or_kill_for_exit(), and handle_detach().

◆ fetch_inferior_registers

#define fetch_inferior_registers (   regcache,
  regno 
)    (*the_target->fetch_registers) (regcache, regno)

Definition at line 529 of file target.h.

Referenced by get_thread_regcache(), ppc_arch_setup(), and s390_arch_setup().

◆ install_fast_tracepoint_jump_pad

#define install_fast_tracepoint_jump_pad (   tpoint,
  tpaddr,
  collector,
  lockaddr,
  orig_size,
  jump_entry,
  trampoline,
  trampoline_size,
  jjump_pad_insn,
  jjump_pad_insn_size,
  adjusted_insn_addr,
  adjusted_insn_addr_end,
  err 
)
Value:
collector,lockaddr, \
orig_size, jump_entry, \
trampoline, \
trampoline_size, \
jjump_pad_insn, \
jjump_pad_insn_size, \
adjusted_insn_addr, \
adjusted_insn_addr_end, \
err)
struct target_ops * the_target
Definition: target.c:24
int(* install_fast_tracepoint_jump_pad)(CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector, CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry, CORE_ADDR *trampoline, ULONGEST *trampoline_size, unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size, CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end, char *err)
Definition: target.h:362

Definition at line 594 of file target.h.

Referenced by install_fast_tracepoint().

◆ join_inferior

#define join_inferior (   pid)    (*the_target->join) (pid)

Definition at line 535 of file target.h.

Referenced by handle_detach().

◆ myattach

#define myattach (   pid)    (*the_target->attach) (pid)

Definition at line 499 of file target.h.

Referenced by attach_inferior().

◆ mythread_alive

#define mythread_alive (   pid)    (*the_target->thread_alive) (pid)

Definition at line 526 of file target.h.

Referenced by prepare_to_access_memory(), and process_serial_event().

◆ pause_all

#define pause_all (   freeze)
Value:
do \
{ \
(*the_target->pause_all) (freeze); \
} while (0)
struct target_ops * the_target
Definition: target.c:24
void(* pause_all)(int freeze)
Definition: target.h:336

Definition at line 573 of file target.h.

Referenced by clear_installed_tracepoints(), cmd_qtdp(), cmd_qtstart(), cmd_qtstatus(), handle_status(), run_inferior_command(), stop_tracing(), and upload_fast_traceframes().

◆ stabilize_threads

#define stabilize_threads ( )
Value:
do \
{ \
} while (0)
struct target_ops * the_target
Definition: target.c:24
void(* stabilize_threads)(void)
Definition: target.h:345

Definition at line 587 of file target.h.

Referenced by cmd_qtdp(), cmd_qtstart(), handle_status(), linux_detach(), and linux_wait_1().

◆ store_inferior_registers

#define store_inferior_registers (   regcache,
  regno 
)    (*the_target->store_registers) (regcache, regno)

Definition at line 532 of file target.h.

Referenced by regcache_invalidate_thread().

◆ target_async

#define target_async (   enable)    (the_target->async ? (*the_target->async) (enable) : 0)

Definition at line 541 of file target.h.

Referenced by handle_accept_event().

◆ target_breakpoint_kind_from_current_state

#define target_breakpoint_kind_from_current_state (   pcptr)
Value:
#define target_breakpoint_kind_from_pc(pcptr)
Definition: target.h:666
struct target_ops * the_target
Definition: target.c:24
int(* breakpoint_kind_from_current_state)(CORE_ADDR *pcptr)
Definition: target.h:467

Definition at line 671 of file target.h.

◆ target_breakpoint_kind_from_pc

#define target_breakpoint_kind_from_pc (   pcptr)
Value:
struct target_ops * the_target
Definition: target.c:24
int(* breakpoint_kind_from_pc)(CORE_ADDR *pcptr)
Definition: target.h:452
int default_breakpoint_kind_from_pc(CORE_ADDR *pcptr)
Definition: target.c:351

Definition at line 666 of file target.h.

Referenced by set_breakpoint_type_at().

◆ target_core_of_thread

#define target_core_of_thread (   ptid)
Value:
: -1)
struct target_ops * the_target
Definition: target.c:24
int(* core_of_thread)(ptid_t)
Definition: target.h:306

Definition at line 693 of file target.h.

Referenced by handle_qxfer_threads_worker(), and prepare_resume_reply().

◆ target_disable_btrace

#define target_disable_btrace (   tinfo)    (*the_target->disable_btrace) (tinfo)

Definition at line 633 of file target.h.

Referenced by handle_btrace_disable(), and remove_thread().

◆ target_emit_ops

#define target_emit_ops ( )    (the_target->emit_ops ? (*the_target->emit_ops) () : NULL)

◆ target_enable_btrace

#define target_enable_btrace (   ptid,
  conf 
)    (*the_target->enable_btrace) (ptid, conf)

Definition at line 630 of file target.h.

Referenced by handle_btrace_enable_bts(), and handle_btrace_enable_pt().

◆ target_get_ipa_tdesc_idx

#define target_get_ipa_tdesc_idx ( )
Value:
int(* get_ipa_tdesc_idx)(void)
Definition: target.h:477
struct target_ops * the_target
Definition: target.c:24

Definition at line 555 of file target.h.

Referenced by cmd_qtstart().

◆ target_get_min_fast_tracepoint_insn_len

#define target_get_min_fast_tracepoint_insn_len ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* get_min_fast_tracepoint_insn_len)(void)
Definition: target.h:384

Definition at line 566 of file target.h.

Referenced by cmd_qtminftpilen(), and install_fast_tracepoint().

◆ target_handle_new_gdb_connection

#define target_handle_new_gdb_connection ( )
Value:
do \
{ \
} while (0)
struct target_ops * the_target
Definition: target.c:24
void(* handle_new_gdb_connection)(void)
Definition: target.h:299

Definition at line 516 of file target.h.

Referenced by handle_query().

◆ target_post_create_inferior

#define target_post_create_inferior ( )
Value:
do \
{ \
} while (0)
void(* post_create_inferior)(void)
Definition: target.h:81
struct target_ops * the_target
Definition: target.c:24

Definition at line 492 of file target.h.

Referenced by post_fork_inferior().

◆ target_process_qsupported

#define target_process_qsupported (   features,
  count 
)
Value:
do \
{ \
the_target->process_qsupported (features, count); \
} while (0)
struct target_ops * the_target
Definition: target.c:24
void(* process_qsupported)(char **features, int count)
Definition: target.h:314

Definition at line 544 of file target.h.

Referenced by handle_query().

◆ target_read_btrace

#define target_read_btrace (   tinfo,
  buffer,
  type 
)    (*the_target->read_btrace) (tinfo, buffer, type)

Definition at line 636 of file target.h.

Referenced by handle_qxfer_btrace().

◆ target_read_btrace_conf

#define target_read_btrace_conf (   tinfo,
  buffer 
)    (*the_target->read_btrace_conf) (tinfo, buffer)

Definition at line 639 of file target.h.

Referenced by handle_qxfer_btrace_conf().

◆ target_stopped_by_hw_breakpoint

#define target_stopped_by_hw_breakpoint ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* stopped_by_hw_breakpoint)(void)
Definition: target.h:225

Definition at line 662 of file target.h.

Referenced by prepare_resume_reply().

◆ target_stopped_by_sw_breakpoint

#define target_stopped_by_sw_breakpoint ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* stopped_by_sw_breakpoint)(void)
Definition: target.h:218

Definition at line 650 of file target.h.

Referenced by prepare_resume_reply().

◆ target_supports_agent

#define target_supports_agent ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_agent)(void)
Definition: target.h:392

Definition at line 622 of file target.h.

Referenced by handle_query().

◆ target_supports_btrace

#define target_supports_btrace (   format)
Value:
? (*the_target->supports_btrace) (the_target, format) : 0)
int(* supports_btrace)(struct target_ops *, enum btrace_format)
Definition: target.h:395
struct target_ops * the_target
Definition: target.c:24

Definition at line 626 of file target.h.

Referenced by supported_btrace_packets().

◆ target_supports_catch_syscall

#define target_supports_catch_syscall ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_catch_syscall)(void)
Definition: target.h:474

Definition at line 551 of file target.h.

Referenced by handle_general_set(), and handle_query().

◆ target_supports_disable_randomization

#define target_supports_disable_randomization ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_disable_randomization)(void)
Definition: target.h:380

Definition at line 618 of file target.h.

Referenced by handle_query().

◆ target_supports_exec_events

#define target_supports_exec_events ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_exec_events)(void)
Definition: target.h:296

Definition at line 512 of file target.h.

Referenced by handle_query().

◆ target_supports_fast_tracepoints

#define target_supports_fast_tracepoints ( )    (the_target->install_fast_tracepoint_jump_pad != NULL)

Definition at line 563 of file target.h.

Referenced by handle_query().

◆ target_supports_fork_events

#define target_supports_fork_events ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_fork_events)(void)
Definition: target.h:290

Definition at line 504 of file target.h.

Referenced by handle_query().

◆ target_supports_hardware_single_step

#define target_supports_hardware_single_step ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_hardware_single_step)(void)
Definition: target.h:232

Definition at line 658 of file target.h.

Referenced by handle_query(), and handle_v_requests().

◆ target_supports_non_stop

#define target_supports_non_stop ( )    (the_target->supports_non_stop ? (*the_target->supports_non_stop ) () : 0)

Definition at line 538 of file target.h.

Referenced by handle_query().

◆ target_supports_range_stepping

#define target_supports_range_stepping ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_range_stepping)(void)
Definition: target.h:418

Definition at line 642 of file target.h.

Referenced by handle_v_requests().

◆ target_supports_software_single_step

#define target_supports_software_single_step ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_software_single_step)(void)
Definition: target.h:470

Definition at line 676 of file target.h.

Referenced by handle_query(), and handle_v_requests().

◆ target_supports_stopped_by_hw_breakpoint

#define target_supports_stopped_by_hw_breakpoint ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_stopped_by_hw_breakpoint)(void)
Definition: target.h:229

Definition at line 654 of file target.h.

Referenced by handle_query().

◆ target_supports_stopped_by_sw_breakpoint

#define target_supports_stopped_by_sw_breakpoint ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_stopped_by_sw_breakpoint)(void)
Definition: target.h:222

Definition at line 646 of file target.h.

Referenced by handle_query().

◆ target_supports_tracepoints

#define target_supports_tracepoints ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_tracepoints)(void)
Definition: target.h:318

Definition at line 559 of file target.h.

Referenced by captured_main(), handle_general_set(), and handle_query().

◆ target_supports_vfork_events

#define target_supports_vfork_events ( )
Value:
struct target_ops * the_target
Definition: target.c:24
int(* supports_vfork_events)(void)
Definition: target.h:293

Definition at line 508 of file target.h.

Referenced by handle_query().

◆ target_thread_handle

#define target_thread_handle (   ptid,
  handle,
  handle_len 
)
Value:
(ptid, handle, handle_len) \
: false)
struct target_ops * the_target
Definition: target.c:24
bool(* thread_handle)(ptid_t ptid, gdb_byte **handle, int *handle_len)
Definition: target.h:482

Definition at line 701 of file target.h.

Referenced by handle_qxfer_threads_worker().

◆ target_thread_name

#define target_thread_name (   ptid)
Value:
: NULL)
const char *(* thread_name)(ptid_t thread)
Definition: target.h:461
struct target_ops * the_target
Definition: target.c:24

Definition at line 697 of file target.h.

Referenced by handle_qxfer_threads_worker().

◆ thread_stopped

#define thread_stopped (   thread)    (*the_target->thread_stopped) (thread)

Definition at line 570 of file target.h.

Referenced by prepare_to_access_memory(), and queue_stop_reply_callback().

◆ unpause_all

#define unpause_all (   unfreeze)
Value:
do \
{ \
(*the_target->unpause_all) (unfreeze); \
} while (0)
struct target_ops * the_target
Definition: target.c:24
void(* unpause_all)(int unfreeze)
Definition: target.h:342

Definition at line 580 of file target.h.

Referenced by clear_installed_tracepoints(), cmd_qtdp(), cmd_qtstart(), cmd_qtstatus(), run_inferior_command(), stop_tracing(), and upload_fast_traceframes().

Function Documentation

◆ default_breakpoint_kind_from_pc()

int default_breakpoint_kind_from_pc ( CORE_ADDR pcptr)

Definition at line 351 of file target.c.

References gdb_assert, target_ops::sw_breakpoint_from_kind, and the_target.

Referenced by linux_breakpoint_kind_from_pc().

◆ done_accessing_memory()

void done_accessing_memory ( void  )

◆ kill_inferior()

int kill_inferior ( int  )

◆ mywait()

ptid_t mywait ( ptid_t  ptid,
struct target_waitstatus *  ourstatus,
int  options,
int  connected_wait 
)

◆ prepare_to_access_memory()

int prepare_to_access_memory ( void  )

◆ read_inferior_memory()

int read_inferior_memory ( CORE_ADDR  memaddr,
unsigned char *  myaddr,
int  len 
)

◆ set_desired_thread()

int set_desired_thread ( )

◆ set_target_ops()

void set_target_ops ( struct target_ops )

Definition at line 299 of file target.c.

References the_target, and XNEW.

Referenced by initialize_low().

◆ start_non_stop()

int start_non_stop ( int  nonstop)

Definition at line 285 of file target.c.

References target_ops::start_non_stop, and the_target.

Referenced by captured_main(), handle_detach(), and handle_general_set().

◆ target_can_do_hardware_single_step()

int target_can_do_hardware_single_step ( void  )

Definition at line 340 of file target.c.

◆ target_pid_to_str()

const char* target_pid_to_str ( ptid_t  )

◆ write_inferior_memory()

int write_inferior_memory ( CORE_ADDR  memaddr,
const unsigned char *  myaddr,
int  len 
)

Variable Documentation

◆ the_target

struct target_ops* the_target

Definition at line 24 of file target.c.

Referenced by aarch64_breakpoint_at(), arm_breakpoint_at(), arm_get_hwcap(), arm_get_syscall_trapinfo(), arm_sigreturn_next_pc(), bp_opcode(), bp_size(), cris_breakpoint_at(), default_breakpoint_kind_from_pc(), delete_raw_breakpoint(), done_accessing_memory(), getpkt(), handle_open(), handle_query(), handle_qxfer_auxv(), handle_qxfer_btrace(), handle_qxfer_btrace_conf(), handle_qxfer_exec_file(), handle_qxfer_fdpic(), handle_qxfer_libraries_svr4(), handle_qxfer_osdata(), handle_qxfer_siginfo(), handle_qxfer_spu(), handle_readlink(), handle_setfs(), handle_unlink(), handle_v_requests(), hostio_error(), input_interrupt(), insert_memory_breakpoint(), kill_inferior(), linux_detach(), linux_kill(), linux_wait_1(), lynx_detach(), lynx_kill(), m32r_breakpoint_at(), mips_breakpoint_at(), nios2_breakpoint_at(), parse_spufs_run(), ppc_breakpoint_at(), ppc_get_auxv(), ppc_get_pc(), ppc_set_pc(), prepare_resume_reply(), prepare_to_access_memory(), putpkt_binary_1(), queue_stop_reply_callback(), read_inferior_memory(), regcache_read_pc(), regcache_write_pc(), reinsert_raw_breakpoint(), resume(), s390_get_hwcap(), set_raw_breakpoint_at(), set_target_ops(), sh_breakpoint_at(), sparc_breakpoint_at(), sparc_fill_gregset_to_stack(), sparc_store_gregset_from_stack(), start_non_stop(), target_continue(), target_continue_no_signal(), target_mourn_inferior(), target_stop_and_wait(), target_supports_multi_process(), target_wait(), tic6x_breakpoint_at(), tile_breakpoint_at(), uninsert_raw_breakpoint(), validate_inserted_breakpoint(), write_inferior_memory(), x86_breakpoint_at(), xtensa_breakpoint_at(), and z_type_supported().