-
-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
- REG_NAMES, 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 = REGISTER_NAME (regno);
- if (! regname || regname[0] == '\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 = REGISTER_NAME (regno);
- if (! regname || regname[0] == '\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;
-}
-
-