GDB (API)
Defines | Functions | Variables
/home/stan/gdb/src/gdb/target.c File Reference
#include "defs.h"
#include <errno.h>
#include "gdb_string.h"
#include "target.h"
#include "gdbcmd.h"
#include "symtab.h"
#include "inferior.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "dcache.h"
#include <signal.h>
#include "regcache.h"
#include "gdb_assert.h"
#include "gdbcore.h"
#include "exceptions.h"
#include "target-descriptions.h"
#include "gdbthread.h"
#include "solib.h"
#include "exec.h"
#include "inline-frame.h"
#include "tracepoint.h"
#include "gdb/fileio.h"
#include "agent.h"

Go to the source code of this file.

Defines

#define DEFAULT_ALLOCSIZE   10
#define INHERIT(FIELD, TARGET)
#define de_fault(field, value)
#define CASE(X)   case X: return #X
#define MIN(A, B)   (((A) <= (B)) ? (A) : (B))
#define SEARCH_CHUNK_SIZE   16000
#define DO_TARG_OPTION(OPT)   ret = do_option (&target_options, ret, OPT, #OPT)

Functions

void target_dcache_invalidate (void)
int default_child_has_all_memory (struct target_ops *ops)
int default_child_has_memory (struct target_ops *ops)
int default_child_has_stack (struct target_ops *ops)
int default_child_has_registers (struct target_ops *ops)
int default_child_has_execution (struct target_ops *ops, ptid_t the_ptid)
int target_has_all_memory_1 (void)
int target_has_memory_1 (void)
int target_has_stack_1 (void)
int target_has_registers_1 (void)
int target_has_execution_1 (ptid_t the_ptid)
int target_has_execution_current (void)
void complete_target_initialization (struct target_ops *t)
void add_target_with_completer (struct target_ops *t, completer_ftype *completer)
void add_target (struct target_ops *t)
void add_deprecated_target_alias (struct target_ops *t, char *alias)
void target_ignore (void)
void target_kill (void)
void target_load (char *arg, int from_tty)
void target_create_inferior (char *exec_file, char *args, char **env, int from_tty)
void target_terminal_inferior (void)
void noprocess (void)
void push_target (struct target_ops *t)
int unpush_target (struct target_ops *t)
void pop_all_targets_above (enum strata above_stratum)
void pop_all_targets (void)
int target_is_pushed (struct target_ops *t)
CORE_ADDR target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
const char * target_xfer_error_to_string (enum target_xfer_error err)
int target_read_string (CORE_ADDR memaddr, char **string, int len, int *errnop)
struct target_section_tabletarget_get_section_table (struct target_ops *target)
struct target_sectiontarget_section_by_addr (struct target_ops *target, CORE_ADDR addr)
struct cleanup * make_show_memory_breakpoints_cleanup (int show)
LONGEST target_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, void *readbuf, const void *writebuf, ULONGEST offset, LONGEST len)
int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
int target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
 VEC (mem_region_s)
void target_flash_erase (ULONGEST address, LONGEST length)
void target_flash_done (void)
LONGEST target_read (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
void free_memory_read_result_vector (void *x)
 VEC (memory_read_result_s)
LONGEST target_write_with_progress (struct target_ops *ops, enum target_object object, const char *annex, const gdb_byte *buf, ULONGEST offset, LONGEST len, void(*progress)(ULONGEST, void *), void *baton)
LONGEST target_write (struct target_ops *ops, enum target_object object, const char *annex, const gdb_byte *buf, ULONGEST offset, LONGEST len)
LONGEST target_read_alloc (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte **buf_p)
char * target_read_stralloc (struct target_ops *ops, enum target_object object, const char *annex)
void get_target_memory (struct target_ops *ops, CORE_ADDR addr, gdb_byte *buf, LONGEST len)
ULONGEST get_target_memory_unsigned (struct target_ops *ops, CORE_ADDR addr, int len, enum bfd_endian byte_order)
int target_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
int target_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
void target_pre_inferior (int from_tty)
void target_preopen (int from_tty)
void target_detach (char *args, int from_tty)
void target_disconnect (char *args, int from_tty)
ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
char * target_pid_to_str (ptid_t ptid)
char * target_thread_name (struct thread_info *info)
void target_resume (ptid_t ptid, int step, enum gdb_signal signal)
void target_pass_signals (int numsigs, unsigned char *pass_signals)
void target_program_signals (int numsigs, unsigned char *program_signals)
int target_follow_fork (int follow_child, int detach_fork)
void target_mourn_inferior (void)
struct target_desc * target_read_description (struct target_ops *target)
int simple_search_memory (struct target_ops *ops, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
int target_search_memory (CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
void target_require_runnable (void)
void find_default_attach (struct target_ops *ops, char *args, int from_tty)
void find_default_create_inferior (struct target_ops *ops, char *exec_file, char *allargs, char **env, int from_tty)
int target_supports_non_stop (void)
int target_info_proc (char *args, enum info_proc_what what)
int target_supports_disable_randomization (void)
char * target_get_osdata (const char *type)
struct address_space * target_thread_address_space (ptid_t ptid)
int target_fileio_open (const char *filename, int flags, int mode, int *target_errno)
int target_fileio_pwrite (int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno)
int target_fileio_pread (int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno)
int target_fileio_close (int fd, int *target_errno)
int target_fileio_unlink (const char *filename, int *target_errno)
char * target_fileio_readlink (const char *filename, int *target_errno)
LONGEST target_fileio_read_alloc (const char *filename, gdb_byte **buf_p)
char * target_fileio_read_stralloc (const char *filename)
struct target_opsfind_target_beneath (struct target_ops *t)
void generic_mourn_inferior (void)
char * normal_pid_to_str (ptid_t ptid)
void target_close (struct target_ops *targ)
void target_attach (char *args, int from_tty)
int target_thread_alive (ptid_t ptid)
void target_find_new_threads (void)
void target_stop (ptid_t ptid)
char * target_options_to_string (int target_options)
void target_fetch_registers (struct regcache *regcache, int regno)
void target_store_registers (struct regcache *regcache, int regno)
int target_core_of_thread (ptid_t ptid)
int target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
int target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
int target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
int target_masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask)
int target_ranged_break_num_registers (void)
int target_supports_btrace (void)
struct btrace_target_infotarget_enable_btrace (ptid_t ptid)
void target_disable_btrace (struct btrace_target_info *btinfo)
void target_teardown_btrace (struct btrace_target_info *btinfo)
 VEC (btrace_block_s)
void target_stop_recording (void)
void target_info_record (void)
void target_save_record (const char *filename)
int target_supports_delete_record (void)
void target_delete_record (void)
int target_record_is_replaying (void)
void target_goto_record_begin (void)
void target_goto_record_end (void)
void target_goto_record (ULONGEST insn)
void target_insn_history (int size, int flags)
void target_insn_history_from (ULONGEST from, int size, int flags)
void target_insn_history_range (ULONGEST begin, ULONGEST end, int flags)
void target_call_history (int size, int flags)
void target_call_history_from (ULONGEST begin, int size, int flags)
void target_call_history_range (ULONGEST begin, ULONGEST end, int flags)
void update_target_permissions (void)
void initialize_targets (void)

Variables

int target_async_permitted = 0

Define Documentation

#define CASE (   X)    case X: return #X
#define de_fault (   field,
  value 
)
Value:
if (!current_target.field)               \
    current_target.field = value
#define DEFAULT_ALLOCSIZE   10
#define DO_TARG_OPTION (   OPT)    ret = do_option (&target_options, ret, OPT, #OPT)
#define INHERIT (   FIELD,
  TARGET 
)
Value:
if (!current_target.FIELD) \
        current_target.FIELD = (TARGET)->FIELD
#define MIN (   A,
  B 
)    (((A) <= (B)) ? (A) : (B))

Definition at line 1251 of file target.c.

#define SEARCH_CHUNK_SIZE   16000

Function Documentation

void add_deprecated_target_alias ( struct target_ops t,
char *  alias 
)

Definition at line 456 of file target.c.

void add_target ( struct target_ops t)

Definition at line 448 of file target.c.

void add_target_with_completer ( struct target_ops t,
completer_ftype *  completer 
)

Definition at line 409 of file target.c.

Definition at line 382 of file target.c.

Definition at line 261 of file target.c.

int default_child_has_execution ( struct target_ops ops,
ptid_t  the_ptid 
)

Definition at line 301 of file target.c.

Definition at line 271 of file target.c.

Definition at line 291 of file target.c.

Definition at line 281 of file target.c.

void find_default_attach ( struct target_ops ops,
char *  args,
int  from_tty 
)

Definition at line 3115 of file target.c.

void find_default_create_inferior ( struct target_ops ops,
char *  exec_file,
char *  allargs,
char **  env,
int  from_tty 
)

Definition at line 3125 of file target.c.

struct target_ops* find_target_beneath ( struct target_ops t) [read]

Definition at line 3643 of file target.c.

void free_memory_read_result_vector ( void *  x)

Definition at line 2204 of file target.c.

void generic_mourn_inferior ( void  )

Definition at line 3652 of file target.c.

void get_target_memory ( struct target_ops ops,
CORE_ADDR  addr,
gdb_byte buf,
LONGEST  len 
)

Definition at line 2435 of file target.c.

ULONGEST get_target_memory_unsigned ( struct target_ops ops,
CORE_ADDR  addr,
int  len,
enum bfd_endian  byte_order 
)

Definition at line 2448 of file target.c.

void initialize_targets ( void  )

Definition at line 5073 of file target.c.

struct cleanup* make_show_memory_breakpoints_cleanup ( int  show) [read]

Definition at line 1701 of file target.c.

void noprocess ( void  )

Definition at line 554 of file target.c.

char* normal_pid_to_str ( ptid_t  ptid)

Definition at line 3688 of file target.c.

void pop_all_targets ( void  )

Definition at line 1108 of file target.c.

void pop_all_targets_above ( enum strata  above_stratum)

Definition at line 1091 of file target.c.

void push_target ( struct target_ops t)

Definition at line 1005 of file target.c.

int simple_search_memory ( struct target_ops ops,
CORE_ADDR  start_addr,
ULONGEST  search_space_len,
const gdb_byte pattern,
ULONGEST  pattern_len,
CORE_ADDR found_addrp 
)

Definition at line 2892 of file target.c.

void target_attach ( char *  args,
int  from_tty 
)

Definition at line 3793 of file target.c.

void target_call_history ( int  size,
int  flags 
)

Definition at line 4404 of file target.c.

void target_call_history_from ( ULONGEST  begin,
int  size,
int  flags 
)

Definition at line 4421 of file target.c.

void target_call_history_range ( ULONGEST  begin,
ULONGEST  end,
int  flags 
)

Definition at line 4438 of file target.c.

void target_close ( struct target_ops targ)

Definition at line 3779 of file target.c.

Definition at line 4001 of file target.c.

void target_create_inferior ( char *  exec_file,
char *  args,
char **  env,
int  from_tty 
)

Definition at line 501 of file target.c.

void target_dcache_invalidate ( void  )

Definition at line 244 of file target.c.

void target_delete_record ( void  )

Definition at line 4271 of file target.c.

void target_detach ( char *  args,
int  from_tty 
)

Definition at line 2608 of file target.c.

void target_disable_btrace ( struct btrace_target_info btinfo)

Definition at line 4162 of file target.c.

void target_disconnect ( char *  args,
int  from_tty 
)

Definition at line 2639 of file target.c.

Definition at line 4147 of file target.c.

void target_fetch_registers ( struct regcache *  regcache,
int  regno 
)

Definition at line 3960 of file target.c.

int target_fileio_close ( int  fd,
int target_errno 
)

Definition at line 3405 of file target.c.

int target_fileio_open ( const char *  filename,
int  flags,
int  mode,
int target_errno 
)

Definition at line 3318 of file target.c.

int target_fileio_pread ( int  fd,
gdb_byte read_buf,
int  len,
ULONGEST  offset,
int target_errno 
)

Definition at line 3376 of file target.c.

int target_fileio_pwrite ( int  fd,
const gdb_byte write_buf,
int  len,
ULONGEST  offset,
int target_errno 
)

Definition at line 3346 of file target.c.

LONGEST target_fileio_read_alloc ( const char *  filename,
gdb_byte **  buf_p 
)

Definition at line 3557 of file target.c.

char* target_fileio_read_stralloc ( const char *  filename)

Definition at line 3569 of file target.c.

char* target_fileio_readlink ( const char *  filename,
int target_errno 
)

Definition at line 3456 of file target.c.

int target_fileio_unlink ( const char *  filename,
int target_errno 
)

Definition at line 3430 of file target.c.

void target_find_new_threads ( void  )

Definition at line 3837 of file target.c.

void target_flash_done ( void  )

Definition at line 1936 of file target.c.

void target_flash_erase ( ULONGEST  address,
LONGEST  length 
)

Definition at line 1918 of file target.c.

int target_follow_fork ( int  follow_child,
int  detach_fork 
)

Definition at line 2816 of file target.c.

char* target_get_osdata ( const char *  type)

Definition at line 3245 of file target.c.

struct target_section_table* target_get_section_table ( struct target_ops target) [read]

Definition at line 1327 of file target.c.

void target_goto_record ( ULONGEST  insn)

Definition at line 4336 of file target.c.

void target_goto_record_begin ( void  )

Definition at line 4302 of file target.c.

void target_goto_record_end ( void  )

Definition at line 4319 of file target.c.

Definition at line 313 of file target.c.

Definition at line 361 of file target.c.

Definition at line 373 of file target.c.

Definition at line 325 of file target.c.

Definition at line 349 of file target.c.

int target_has_stack_1 ( void  )

Definition at line 337 of file target.c.

void target_ignore ( void  )

Definition at line 471 of file target.c.

int target_info_proc ( char *  args,
enum info_proc_what  what 
)

Definition at line 3192 of file target.c.

void target_info_record ( void  )

Definition at line 4223 of file target.c.

int target_insert_breakpoint ( struct gdbarch *  gdbarch,
struct bp_target_info bp_tgt 
)

Definition at line 2459 of file target.c.

Definition at line 4050 of file target.c.

void target_insn_history ( int  size,
int  flags 
)

Definition at line 4353 of file target.c.

void target_insn_history_from ( ULONGEST  from,
int  size,
int  flags 
)

Definition at line 4370 of file target.c.

void target_insn_history_range ( ULONGEST  begin,
ULONGEST  end,
int  flags 
)

Definition at line 4387 of file target.c.

int target_is_pushed ( struct target_ops t)

Definition at line 1116 of file target.c.

void target_kill ( void  )

Definition at line 476 of file target.c.

void target_load ( char *  arg,
int  from_tty 
)

Definition at line 494 of file target.c.

Definition at line 4104 of file target.c.

void target_mourn_inferior ( void  )

Definition at line 2840 of file target.c.

char* target_options_to_string ( int  target_options)

Definition at line 3905 of file target.c.

void target_pass_signals ( int  numsigs,
unsigned char *  pass_signals 
)

Definition at line 2753 of file target.c.

char* target_pid_to_str ( ptid_t  ptid)

Definition at line 2696 of file target.c.

void target_pre_inferior ( int  from_tty)

Definition at line 2521 of file target.c.

void target_preopen ( int  from_tty)

Definition at line 2582 of file target.c.

void target_program_signals ( int  numsigs,
unsigned char *  program_signals 
)

Definition at line 2783 of file target.c.

Definition at line 4119 of file target.c.

LONGEST target_read ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte buf,
ULONGEST  offset,
LONGEST  len 
)

Definition at line 2046 of file target.c.

LONGEST target_read_alloc ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte **  buf_p 
)

Definition at line 2388 of file target.c.

struct target_desc* target_read_description ( struct target_ops target) [read]

Definition at line 2869 of file target.c.

int target_read_memory ( CORE_ADDR  memaddr,
gdb_byte myaddr,
ssize_t  len 
)

Definition at line 1802 of file target.c.

int target_read_stack ( CORE_ADDR  memaddr,
gdb_byte myaddr,
ssize_t  len 
)

Definition at line 1818 of file target.c.

char* target_read_stralloc ( struct target_ops ops,
enum target_object  object,
const char *  annex 
)

Definition at line 2401 of file target.c.

int target_read_string ( CORE_ADDR  memaddr,
char **  string,
int  len,
int errnop 
)

Definition at line 1260 of file target.c.

Definition at line 4288 of file target.c.

int target_remove_breakpoint ( struct gdbarch *  gdbarch,
struct bp_target_info bp_tgt 
)

Definition at line 2472 of file target.c.

Definition at line 4077 of file target.c.

void target_require_runnable ( void  )

Definition at line 3046 of file target.c.

void target_resume ( ptid_t  ptid,
int  step,
enum gdb_signal  signal 
)

Definition at line 2724 of file target.c.

void target_save_record ( const char *  filename)

Definition at line 4240 of file target.c.

int target_search_memory ( CORE_ADDR  start_addr,
ULONGEST  search_space_len,
const gdb_byte pattern,
ULONGEST  pattern_len,
CORE_ADDR found_addrp 
)

Definition at line 3002 of file target.c.

struct target_section* target_section_by_addr ( struct target_ops target,
CORE_ADDR  addr 
) [read]

Definition at line 1344 of file target.c.

void target_stop ( ptid_t  ptid)

Definition at line 3855 of file target.c.

void target_stop_recording ( void  )

Definition at line 4206 of file target.c.

void target_store_registers ( struct regcache *  regcache,
int  regno 
)

Definition at line 3977 of file target.c.

Definition at line 4133 of file target.c.

Definition at line 4257 of file target.c.

Definition at line 3233 of file target.c.

Definition at line 3178 of file target.c.

void target_teardown_btrace ( struct btrace_target_info btinfo)

Definition at line 4176 of file target.c.

void target_terminal_inferior ( void  )

Definition at line 524 of file target.c.

struct address_space* target_thread_address_space ( ptid_t  ptid) [read]

Definition at line 3266 of file target.c.

Definition at line 3814 of file target.c.

char* target_thread_name ( struct thread_info info)

Definition at line 2710 of file target.c.

CORE_ADDR target_translate_tls_address ( struct objfile objfile,
CORE_ADDR  offset 
)

Definition at line 1141 of file target.c.

int target_verify_memory ( const gdb_byte data,
CORE_ADDR  memaddr,
ULONGEST  size 
)

Definition at line 4023 of file target.c.

ptid_t target_wait ( ptid_t  ptid,
struct target_waitstatus status,
int  options 
)

Definition at line 2662 of file target.c.

LONGEST target_write ( struct target_ops ops,
enum target_object  object,
const char *  annex,
const gdb_byte buf,
ULONGEST  offset,
LONGEST  len 
)

Definition at line 2315 of file target.c.

int target_write_memory ( CORE_ADDR  memaddr,
const gdb_byte myaddr,
ssize_t  len 
)

Definition at line 1838 of file target.c.

int target_write_raw_memory ( CORE_ADDR  memaddr,
const gdb_byte myaddr,
ssize_t  len 
)

Definition at line 1857 of file target.c.

LONGEST target_write_with_progress ( struct target_ops ops,
enum target_object  object,
const char *  annex,
const gdb_byte buf,
ULONGEST  offset,
LONGEST  len,
void(*)(ULONGEST, void *)  progress,
void *  baton 
)

Definition at line 2280 of file target.c.

Definition at line 1236 of file target.c.

LONGEST target_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
void *  readbuf,
const void *  writebuf,
ULONGEST  offset,
LONGEST  len 
)

Definition at line 1713 of file target.c.

int unpush_target ( struct target_ops t)

Definition at line 1052 of file target.c.

void update_target_permissions ( void  )

Definition at line 5028 of file target.c.

Definition at line 1871 of file target.c.

Definition at line 2217 of file target.c.

Definition at line 4189 of file target.c.


Variable Documentation

Definition at line 4987 of file target.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines