* linux-low.c (fetch_register): Avoid passing a non string literal
format to `error'. (usr_store_inferior_registers): Ditto.
This commit is contained in:
parent
19941bfa37
commit
f52cd8cdd8
|
@ -1,3 +1,9 @@
|
||||||
|
2010-03-15 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
* linux-low.c (fetch_register): Avoid passing a non string literal
|
||||||
|
format to `error'.
|
||||||
|
(usr_store_inferior_registers): Ditto.
|
||||||
|
|
||||||
2010-03-14 Pedro Alves <pedro@codesourcery.com>
|
2010-03-14 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
* linux-low.c (linux_write_memory): Bail out early if peeking
|
* linux-low.c (linux_write_memory): Bail out early if peeking
|
||||||
|
|
|
@ -2217,23 +2217,13 @@ fetch_register (struct regcache *regcache, int regno)
|
||||||
(PTRACE_ARG3_TYPE) (uintptr_t) regaddr, 0);
|
(PTRACE_ARG3_TYPE) (uintptr_t) regaddr, 0);
|
||||||
regaddr += sizeof (PTRACE_XFER_TYPE);
|
regaddr += sizeof (PTRACE_XFER_TYPE);
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
{
|
error ("reading register %d: %s", regno, strerror (errno));
|
||||||
/* Warning, not error, in case we are attached; sometimes the
|
|
||||||
kernel doesn't let us at the registers. */
|
|
||||||
char *err = strerror (errno);
|
|
||||||
char *msg = alloca (strlen (err) + 128);
|
|
||||||
sprintf (msg, "reading register %d: %s", regno, err);
|
|
||||||
error (msg);
|
|
||||||
goto error_exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (the_low_target.supply_ptrace_register)
|
if (the_low_target.supply_ptrace_register)
|
||||||
the_low_target.supply_ptrace_register (regcache, regno, buf);
|
the_low_target.supply_ptrace_register (regcache, regno, buf);
|
||||||
else
|
else
|
||||||
supply_register (regcache, regno, buf);
|
supply_register (regcache, regno, buf);
|
||||||
|
|
||||||
error_exit:;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fetch all registers, or just one, from the child process. */
|
/* Fetch all registers, or just one, from the child process. */
|
||||||
|
@ -2299,14 +2289,7 @@ usr_store_inferior_registers (struct regcache *regcache, int regno)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((*the_low_target.cannot_store_register) (regno) == 0)
|
if ((*the_low_target.cannot_store_register) (regno) == 0)
|
||||||
{
|
error ("writing register %d: %s", regno, strerror (errno));
|
||||||
char *err = strerror (errno);
|
|
||||||
char *msg = alloca (strlen (err) + 128);
|
|
||||||
sprintf (msg, "writing register %d: %s",
|
|
||||||
regno, err);
|
|
||||||
error (msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
regaddr += sizeof (PTRACE_XFER_TYPE);
|
regaddr += sizeof (PTRACE_XFER_TYPE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue