snprintf (filename, sizeof filename, "/proc/%ld/adi/maps", (long) pid);
gdb::unique_xmalloc_ptr<char> data
= target_fileio_read_stralloc (NULL, filename);
if (data)
{
adi_stat_t adi_stat = get_adi_info (pid);
snprintf (filename, sizeof filename, "/proc/%ld/adi/maps", (long) pid);
gdb::unique_xmalloc_ptr<char> data
= target_fileio_read_stralloc (NULL, filename);
if (data)
{
adi_stat_t adi_stat = get_adi_info (pid);
- char *line;
- for (line = strtok (data.get (), "\n"); line; line = strtok (NULL, "\n"))
+ char *saveptr;
+ for (char *line = strtok_r (data.get (), "\n", &saveptr);
+ line;
+ line = strtok_r (NULL, "\n", &saveptr))
error(_("Address at %s is not in ADI maps"),
paddress (target_gdbarch (), vaddr * ast.blksize));
}
error(_("Address at %s is not in ADI maps"),
paddress (target_gdbarch (), vaddr * ast.blksize));
}
error(_("Address at %s is not in ADI maps"),
paddress (target_gdbarch (), vaddr * ast.blksize));
}
error(_("Address at %s is not in ADI maps"),
paddress (target_gdbarch (), vaddr * ast.blksize));
}
/* make sure program is active and adi is available */
if (!target_has_execution)
error (_("ADI command requires a live process/thread"));
/* make sure program is active and adi is available */
if (!target_has_execution)
error (_("ADI command requires a live process/thread"));
version = parse_and_eval_long (q);
if (version < 0 || version > ast.max_version)
error (_("Invalid ADI version tag %d"), version);
version = parse_and_eval_long (q);
if (version < 0 || version > ast.max_version)
error (_("Invalid ADI version tag %d"), version);
/* Store floating fields of element ELEMENT of an "parameter array"
that has type TYPE and is stored at BITPOS in VALBUF in the
/* Store floating fields of element ELEMENT of an "parameter array"
that has type TYPE and is stored at BITPOS in VALBUF in the
static CORE_ADDR
sparc64_store_arguments (struct regcache *regcache, int nargs,
struct value **args, CORE_ADDR sp,
static CORE_ADDR
sparc64_store_arguments (struct regcache *regcache, int nargs,
struct value **args, CORE_ADDR sp,
{
struct gdbarch *gdbarch = regcache->arch ();
/* Number of extended words in the "parameter array". */
{
struct gdbarch *gdbarch = regcache->arch ();
/* Number of extended words in the "parameter array". */
/* First we calculate the number of extended words in the "parameter
array". While doing so we also convert some of the arguments. */
/* First we calculate the number of extended words in the "parameter
array". While doing so we also convert some of the arguments. */
Integer or Pointer arguments and Structure or Union arguments
will be passed in %o registers. Some Floating arguments and
floating members of structures are passed in floating-point
Integer or Pointer arguments and Structure or Union arguments
will be passed in %o registers. Some Floating arguments and
floating members of structures are passed in floating-point
sparc64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
sparc64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
{
/* Set return address. */
regcache_cooked_write_unsigned (regcache, SPARC_O7_REGNUM, bp_addr - 8);
/* Set up function arguments. */
{
/* Set return address. */
regcache_cooked_write_unsigned (regcache, SPARC_O7_REGNUM, bp_addr - 8);
/* Set up function arguments. */
- sp = sparc64_store_arguments (regcache, nargs, args, sp,
- struct_return, struct_addr);
+ sp = sparc64_store_arguments (regcache, nargs, args, sp, return_method,
+ struct_addr);