32 #include "elf/common.h" 62 else if (readbuf != NULL)
63 l =
read (fd, readbuf, (
size_t) len);
65 l = write (fd, writebuf, (
size_t) len);
92 size_t auxv_pair_size = 2 * ptr_size;
137 if (data_address == 0)
142 if (writebuf != NULL)
156 if (
offset >= auxv_pair_size)
180 block &= -auxv_pair_size;
186 if (
block <= auxv_pair_size)
189 block = auxv_pair_size;
193 data_address +=
block;
200 while (
block >= auxv_pair_size)
202 retval += auxv_pair_size;
210 readbuf += auxv_pair_size;
211 block -= auxv_pair_size;
269 if (endptr - ptr < sizeof_auxv_field * 2)
273 ptr += sizeof_auxv_field;
275 ptr += sizeof_auxv_field;
435 NULL, val, -1, file, &opts);
448 const char *
name =
"???";
449 const char *description =
"";
454 #define TAG(tag, text, kind) \ 455 case tag: name = #tag; description = text; format = kind; break 473 TAG (AT_HWCAP,
_(
"Machine-dependent CPU capability hints"),
480 TAG (AT_BASE_PLATFORM,
_(
"String identifying base platform"),
487 TAG (AT_SYSINFO_EHDR,
_(
"System-supplied DSO's ELF header"),
489 TAG (AT_L1I_CACHESHAPE,
_(
"L1 Instruction cache information"),
499 TAG (AT_SUN_LDSHDR,
_(
"Dynamic linker's section headers"),
501 TAG (AT_SUN_LDNAME,
_(
"String giving name of dynamic linker"),
505 TAG (AT_SUN_HWCAP,
_(
"Machine-dependent CPU capability hints"),
510 TAG (AT_SUN_EMUL_EXECFD,
_(
"COFF executable file descriptor"),
512 TAG (AT_SUN_EXECNAME,
515 TAG (AT_SUN_LDDATA,
_(
"Dynamic linker's data segment address"),
517 TAG (AT_SUN_AUXFLAGS,
558 error (
_(
"The program has no auxiliary information now."));
564 error (
_(
"No auxiliary vector found, or failed reading it."));
566 error (
_(
"Auxiliary vector is empty."));
574 _(
"Display the inferior's auxiliary vector.\n\ 575 This is information provided by the operating system at program startup."));
struct gdbarch * target_gdbarch(void)
ssize_t read(int fd, void *buf, size_t count)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
int ptid_get_pid(const ptid_t &ptid)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
static enum target_xfer_status procfs_xfer_auxv(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
char * plongest(LONGEST l)
LONGEST target_read_alloc(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte **buf_p)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
struct observer * observer_attach_executable_changed(observer_executable_changed_ftype *f)
int fprint_target_auxv(struct ui_file *file, struct target_ops *ops)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
static void invalidate_auxv_cache(void)
int gdbarch_auxv_parse(struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void default_print_auxv_entry(struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val)
int default_auxv_parse(struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
int gdbarch_auxv_parse_p(struct gdbarch *gdbarch)
void gdbarch_print_auxv_entry(struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val)
struct target_ops current_target
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
static const struct inferior_data * auxv_inferior_data
int target_auxv_search(struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp)
static struct auxv_info * get_auxv_inferior_data(struct target_ops *ops)
#define MSYMBOL_SIZE(msymbol)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
#define TAG(tag, text, kind)
static void invalidate_auxv_cache_inf(struct inferior *inf)
int target_auxv_parse(struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
char * xstrprintf(const char *format,...)
struct observer * observer_attach_inferior_appeared(observer_inferior_appeared_ftype *f)
int(* to_auxv_parse)(struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) TARGET_DEFAULT_FUNC(default_auxv_parse)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct type * builtin_data_ptr
struct minimal_symbol * minsym
void get_user_print_options(struct value_print_options *opts)
void fprint_auxv_entry(struct ui_file *file, const char *name, const char *description, enum auxv_format format, CORE_ADDR type, CORE_ADDR val)
void _initialize_auxv(void)
int gdb_open_cloexec(const char *filename, int flags, unsigned long mode)
static enum target_xfer_status ld_so_xfer_auxv(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
struct inferior * current_inferior(void)
unsigned long long ULONGEST
enum target_xfer_status memory_xfer_auxv(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
static void auxv_inferior_data_cleanup(struct inferior *inf, void *arg)
static void info_auxv_command(const char *cmd, int from_tty)
#define TYPE_LENGTH(thistype)
int val_print_string(struct type *elttype, const char *encoding, CORE_ADDR addr, int len, struct ui_file *stream, const struct value_print_options *options)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
void error(const char *fmt,...)