-
-int
-sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
-{
- char *regname;
-
- if (simulator == NULL) {
- return 0;
- }
-
- /* GDB will sometimes ask for the contents of a register named "";
- we ignore such requests, and leave garbage in *BUF. In GDB
- terms, the empty string means "the register with this number is
- not present in the currently selected architecture variant."
- That's following the kludge we're using for the MIPS processors.
- But there are loops that just walk through the entire list of
- names and try to get everything. */
- regname = gdbarch_register_name (current_gdbarch, regno);
- /* FIXME: ezannoni 2002/04/15 Remove the 'vr' and 'vscr' check
- once AltiVec support is committed. */
- if (! regname || regname[0] == '\0'
- || (regname[0] == 'v' && regname[1] == 'r')
- || (strcmp (regname, "vscr") == 0))
- return -1;
-
- TRACE(trace_gdb, ("sim_fetch_register(regno=%d(%s), buf=0x%lx)\n",
- regno, regname, (long)buf));
- psim_read_register(simulator, MAX_NR_PROCESSORS,
- buf, regname, raw_transfer);
- return -1;
-}
-
-
-int
-sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
-{
- char *regname;
-
- if (simulator == NULL)
- return 0;
-
- /* See comments in sim_fetch_register, above. */
- regname = gdbarch_register_name (current_gdbarch, regno);
- /* FIXME: ezannoni 2002/04/15 Remove the 'vr' and 'vscr' check
- once AltiVec support is committed. */
- if (! regname || regname[0] == '\0'
- || (regname[0] == 'v' && regname[1] == 'r')
- || (strcmp (regname, "vscr") == 0))
- return -1;
-
- TRACE(trace_gdb, ("sim_store_register(regno=%d(%s), buf=0x%lx)\n",
- regno, regname, (long)buf));
- psim_write_register(simulator, MAX_NR_PROCESSORS,
- buf, regname, raw_transfer);
- return -1;
-}
-
-