+2008-04-17 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * linux-low.c (disabled_regsets, num_regsets): New.
+ (use_regsets_p): Delete.
+ (linux_wait_for_process): Clear disabled_regsets.
+ (regsets_fetch_inferior_registers): Check and set it.
+ (regsets_store_inferior_registers): Likewise.
+ (linux_fetch_registers, linux_store_registers): Do not use
+ use_regsets_p.
+ (initialize_low): Allocate disabled_regsets.
+
2008-04-14 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (LIBOBJS): New.
#define PTRACE_XFER_TYPE long
#ifdef HAVE_LINUX_REGSETS
-static int use_regsets_p = 1;
+static char *disabled_regsets;
+static int num_regsets;
#endif
#define pid_of(proc) ((proc)->head.id)
if (new_inferior)
{
the_low_target.arch_setup ();
+#ifdef HAVE_LINUX_REGSETS
+ memset (disabled_regsets, 0, num_regsets);
+#endif
new_inferior = 0;
}
void *buf;
int res;
- if (regset->size == 0)
+ if (regset->size == 0 || disabled_regsets[regset - target_regsets])
{
regset ++;
continue;
{
if (errno == EIO)
{
- /* If we get EIO on the first regset, do not try regsets again.
- If we get EIO on a later regset, disable that regset. */
- if (regset == target_regsets)
- {
- use_regsets_p = 0;
- return -1;
- }
- else
- {
- regset->size = 0;
- continue;
- }
+ /* If we get EIO on a regset, do not try it again for
+ this process. */
+ disabled_regsets[regset - target_regsets] = 1;
+ continue;
}
else
{
void *buf;
int res;
- if (regset->size == 0)
+ if (regset->size == 0 || disabled_regsets[regset - target_regsets])
{
regset ++;
continue;
{
if (errno == EIO)
{
- /* If we get EIO on the first regset, do not try regsets again.
- If we get EIO on a later regset, disable that regset. */
- if (regset == target_regsets)
- {
- use_regsets_p = 0;
- return -1;
- }
- else
- {
- regset->size = 0;
- continue;
- }
+ /* If we get EIO on a regset, do not try it again for
+ this process. */
+ disabled_regsets[regset - target_regsets] = 1;
+ continue;
}
else
{
linux_fetch_registers (int regno)
{
#ifdef HAVE_LINUX_REGSETS
- if (use_regsets_p)
- {
- if (regsets_fetch_inferior_registers () == 0)
- return;
- }
+ if (regsets_fetch_inferior_registers () == 0)
+ return;
#endif
#ifdef HAVE_LINUX_USRREGS
usr_fetch_inferior_registers (regno);
linux_store_registers (int regno)
{
#ifdef HAVE_LINUX_REGSETS
- if (use_regsets_p)
- {
- if (regsets_store_inferior_registers () == 0)
- return;
- }
+ if (regsets_store_inferior_registers () == 0)
+ return;
#endif
#ifdef HAVE_LINUX_USRREGS
usr_store_inferior_registers (regno);
the_low_target.breakpoint_len);
linux_init_signals ();
linux_test_for_tracefork ();
+#ifdef HAVE_LINUX_REGSETS
+ for (num_regsets = 0; target_regsets[num_regsets].size >= 0; num_regsets++)
+ ;
+ disabled_regsets = malloc (num_regsets);
+#endif
}