This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch rfc] Add NUM_REGS pseudo regs to MIPS
- From: steve at asicdesigners dot com (Steve Watt)
- To: Andrew Cagney <ac131313 at redhat dot com>, Steve Watt <steve at asicdesigners dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 21 Jul 2003 15:57:46 -0700
- Subject: Re: [patch rfc] Add NUM_REGS pseudo regs to MIPS
On Jul 21, 18:07, Andrew Cagney wrote:
} Subject: Re: [patch rfc] Add NUM_REGS pseudo regs to MIPS
}
} > (top-gdb) info stack
} > #0 internal_error (file=0x824e580 "../../combined/gdb/mips-tdep.c", line=5671,
} > string=0x824e555 "%s: Assertion `%s' failed.") at ../../combined/gdb/utils.c:807
} > #1 0x080dd45c in mips_register_sim_regno (regnum=90)
} > at ../../combined/gdb/mips-tdep.c:5671
} > #2 0x080cb037 in gdbarch_register_sim_regno (gdbarch=0x83179d8, reg_nr=90)
} > at ../../combined/gdb/gdbarch.c:3983
} > #3 0x08127e0f in gdbsim_fetch_register (regno=90) at ../../combined/gdb/remote-sim.c:299
} > #4 0x08094450 in legacy_read_register_gen (regnum=90,
} > myaddr=0xbffff0f0 "Ððÿ¿Øy1\b\030ñÿ¿\020\227\f\bØy1\bZ")
} > at ../../combined/gdb/regcache.c:730
} > #5 0x0809453e in regcache_raw_read (regcache=0x8323000, regnum=90, buf=0xbffff0f0)
} > at ../../combined/gdb/regcache.c:748
} > #6 0x0809499a in regcache_cooked_read (regcache=0x8323000, regnum=90, buf=0xbffff0f0)
} > at ../../combined/gdb/regcache.c:838
}
} It went wrong here. It tests (regnum < ->nr_raw_registers), but for
} legacy targets NR_RAW_REGISTERS == NUM_REGS + NUM_PSEUDO_REGS :-(
}
} The correct fix is to just delete a heap of code, however ...
}
} From regcache.c:
}
} > if ((!gdbarch_pseudo_register_read_p (gdbarch)
} > && !gdbarch_pseudo_register_write_p (gdbarch)
} > && !gdbarch_register_type_p (gdbarch))
} > || REGISTER_BYTE_P () || REGISTER_RAW_SIZE_P ())
} > {
} > descr->legacy_p = 1;
} > init_legacy_regcache_descr (gdbarch, descr);
} > return descr;
} > }
}
} can you try removing the two || ... clauses I added 2003-07-03?
}
} I think my change may have fixed some legacy code but broke others :-(
Well, that fixes it. That's my favorite kind of bug fix, but also my
favorite (not!) kind of repercussion.
At least I've got a toy I can play with again!
Thanks for the help, and good luck on the Right Fix. Let me know if
there's something more you want checked.
Steve
--
Steve Watt KD6GGD PP-ASEL-IA Email at home: steve@watt.com
Chelsio Communications http://www.chelsio.com/ work: steve@chelsio.com
510 N. Pastoria Ave Voice: +1 408 962 3627
Sunnyvale, CA, USA, 94085 Fax: +1 408 730 2580