/* Target-dependent code for UltraSPARC.
- Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
This file is part of GDB.
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))
{
ULONGEST addr, endaddr;
++v_idx;
}
printf_filtered ("\n");
- gdb_flush (gdb_stdout);
vaddr += maxelts;
}
}
/* Store floating fields of element ELEMENT of an "parameter array"
that has type TYPE and is stored at BITPOS in VALBUF in the
- apropriate registers of REGCACHE. This function can be called
+ appropriate registers of REGCACHE. This function can be called
recursively and therefore handles floating types in addition to
structures. */
static CORE_ADDR
sparc64_store_arguments (struct regcache *regcache, int nargs,
struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
+ function_call_return_method return_method,
+ CORE_ADDR struct_addr)
{
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. */
- if (struct_return)
+ if (return_method == return_method_struct)
num_elements++;
for (i = 0; i < nargs; i++)
/* The psABI says that "Every stack frame must be 16-byte aligned." */
sp &= ~0xf;
- /* Now we store the arguments in to the "paramater array". Some
+ /* Now we store the arguments in to the "parameter array". Some
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
contents of any unused memory or registers in the "parameter
array" are undefined. */
- if (struct_return)
+ if (return_method == return_method_struct)
{
regcache_cooked_write_unsigned (regcache, SPARC_O0_REGNUM, struct_addr);
element++;
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,
- int struct_return, CORE_ADDR struct_addr)
+ function_call_return_method return_method,
+ CORE_ADDR struct_addr)
{
/* 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);
/* Allocate the register save area. */
sp -= 16 * 8;