the auxv type field as a parameter. */
static int
-generic_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp,
+generic_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp,
int sizeof_auxv_type)
{
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
const int sizeof_auxv_val = ptr_type->length ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- gdb_byte *ptr = *readptr;
+ const gdb_byte *ptr = *readptr;
if (endptr == ptr)
return 0;
/* See auxv.h. */
int
-default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+default_auxv_parse (struct target_ops *ops, const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{
struct gdbarch *gdbarch = target_gdbarch ();
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
/* See auxv.h. */
int
-svr4_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+svr4_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{
struct type *int_type = builtin_type (gdbarch)->builtin_int;
const int sizeof_auxv_type = int_type->length ();
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */
int
-target_auxv_parse (gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+target_auxv_parse (const gdb_byte **readptr, const gdb_byte *endptr,
+ CORE_ADDR *typep, CORE_ADDR *valp)
{
struct gdbarch *gdbarch = target_gdbarch();
if (!info->data)
return -1;
- gdb_byte *data = info->data->data ();
- gdb_byte *ptr = data;
+ const gdb_byte *data = info->data->data ();
+ const gdb_byte *ptr = data;
size_t len = info->data->size ();
while (1)
if (!info->data)
return -1;
- gdb_byte *data = info->data->data ();
- gdb_byte *ptr = data;
+ const gdb_byte *data = info->data->data ();
+ const gdb_byte *ptr = data;
size_t len = info->data->size ();
while (target_auxv_parse (&ptr, data + len, &type, &val) > 0)
Return 0 if *READPTR is already at the end of the buffer.
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */
-extern int default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep,
+extern int default_auxv_parse (struct target_ops *ops, const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep,
CORE_ADDR *valp);
/* The SVR4 psABI implementation of to_auxv_parse, that uses an int to
Return 0 if *READPTR is already at the end of the buffer.
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */
-extern int svr4_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep,
+extern int svr4_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep,
CORE_ADDR *valp);
/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
Return 0 if *READPTR is already at the end of the buffer.
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */
-extern int target_auxv_parse (gdb_byte **readptr, gdb_byte *endptr,
+extern int target_auxv_parse (const gdb_byte **readptr, const gdb_byte *endptr,
CORE_ADDR *typep, CORE_ADDR *valp);
/* Extract the auxiliary vector entry with a_type matching MATCH.
type="int",
name="auxv_parse",
params=[
- ("gdb_byte **", "readptr"),
- ("gdb_byte *", "endptr"),
+ ("const gdb_byte **", "readptr"),
+ ("const gdb_byte *", "endptr"),
("CORE_ADDR *", "typep"),
("CORE_ADDR *", "valp"),
],
extern bool gdbarch_auxv_parse_p (struct gdbarch *gdbarch);
-typedef int (gdbarch_auxv_parse_ftype) (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
-extern int gdbarch_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
+typedef int (gdbarch_auxv_parse_ftype) (struct gdbarch *gdbarch, const gdb_byte **readptr, const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
+extern int gdbarch_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr, const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
extern void set_gdbarch_auxv_parse (struct gdbarch *gdbarch, gdbarch_auxv_parse_ftype *auxv_parse);
/* Print the description of a single auxv entry described by TYPE and VAL
}
int
-gdbarch_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+gdbarch_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr, const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->auxv_parse != NULL);
const struct target_desc *read_description () override;
- int auxv_parse (gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+ int auxv_parse (const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
override;
/* Override linux_nat_target low methods. */
}
int
-ppc_linux_nat_target::auxv_parse (gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep,
+ppc_linux_nat_target::auxv_parse (const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep,
CORE_ADDR *valp)
{
int tid = inferior_ptid.lwp ();
int sizeof_auxv_field = ppc_linux_target_wordsize (tid);
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- gdb_byte *ptr = *readptr;
+ const gdb_byte *ptr = *readptr;
if (endptr == ptr)
return 0;
/* Detect target architecture. */
const struct target_desc *read_description () override;
- int auxv_parse (gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+ int auxv_parse (const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
override;
/* Override linux_nat_target low methods. */
}
int
-s390_linux_nat_target::auxv_parse (gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep,
+s390_linux_nat_target::auxv_parse (const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep,
CORE_ADDR *valp)
{
int sizeof_auxv_field = s390_target_wordsize ();
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- gdb_byte *ptr = *readptr;
+ const gdb_byte *ptr = *readptr;
if (endptr == ptr)
return 0;
target_debug_do_print (host_address_to_string (X))
#define target_debug_print_gdb_byte_p(X) \
target_debug_do_print (host_address_to_string (X))
-#define target_debug_print_gdb_byte_pp(X) \
+#define target_debug_print_const_gdb_byte_pp(X) \
target_debug_do_print (host_address_to_string (*(X)))
#define target_debug_print_enum_gdb_signal(X) \
target_debug_do_print (gdb_signal_to_name (X))
void flash_done () override;
const struct target_desc *read_description () override;
ptid_t get_ada_task_ptid (long arg0, ULONGEST arg1) override;
- int auxv_parse (gdb_byte **arg0, gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3) override;
+ int auxv_parse (const gdb_byte **arg0, const gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3) override;
int search_memory (CORE_ADDR arg0, ULONGEST arg1, const gdb_byte *arg2, ULONGEST arg3, CORE_ADDR *arg4) override;
bool can_execute_reverse () override;
enum exec_direction_kind execution_direction () override;
void flash_done () override;
const struct target_desc *read_description () override;
ptid_t get_ada_task_ptid (long arg0, ULONGEST arg1) override;
- int auxv_parse (gdb_byte **arg0, gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3) override;
+ int auxv_parse (const gdb_byte **arg0, const gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3) override;
int search_memory (CORE_ADDR arg0, ULONGEST arg1, const gdb_byte *arg2, ULONGEST arg3, CORE_ADDR *arg4) override;
bool can_execute_reverse () override;
enum exec_direction_kind execution_direction () override;
}
int
-target_ops::auxv_parse (gdb_byte **arg0, gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3)
+target_ops::auxv_parse (const gdb_byte **arg0, const gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3)
{
return this->beneath ()->auxv_parse (arg0, arg1, arg2, arg3);
}
int
-dummy_target::auxv_parse (gdb_byte **arg0, gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3)
+dummy_target::auxv_parse (const gdb_byte **arg0, const gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3)
{
return default_auxv_parse (this, arg0, arg1, arg2, arg3);
}
int
-debug_target::auxv_parse (gdb_byte **arg0, gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3)
+debug_target::auxv_parse (const gdb_byte **arg0, const gdb_byte *arg1, CORE_ADDR *arg2, CORE_ADDR *arg3)
{
int result;
gdb_printf (gdb_stdlog, "-> %s->auxv_parse (...)\n", this->beneath ()->shortname ());
result = this->beneath ()->auxv_parse (arg0, arg1, arg2, arg3);
gdb_printf (gdb_stdlog, "<- %s->auxv_parse (", this->beneath ()->shortname ());
- target_debug_print_gdb_byte_pp (arg0);
+ target_debug_print_const_gdb_byte_pp (arg0);
gdb_puts (", ", gdb_stdlog);
- target_debug_print_gdb_byte_p (arg1);
+ target_debug_print_const_gdb_byte_p (arg1);
gdb_puts (", ", gdb_stdlog);
target_debug_print_CORE_ADDR_p (arg2);
gdb_puts (", ", gdb_stdlog);
Return 0 if *READPTR is already at the end of the buffer.
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */
- virtual int auxv_parse (gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+ virtual int auxv_parse (const gdb_byte **readptr,
+ const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
TARGET_DEFAULT_FUNC (default_auxv_parse);
/* Search SEARCH_SPACE_LEN bytes beginning at START_ADDR for the