/* Fetch a byte on behalf of the opcode decoder. HANDLE contains the memory address of the next byte to fetch. If successful, the address in the handle is updated and the byte fetched is returned as the value of the function. If not successful, -1 is returned. */ static int rx_get_opcode_byte (void *handle) { struct rx_get_opcode_byte_handle *opcdata = (struct rx_get_opcode_byte_handle *) handle; int status; gdb_byte byte; status = target_read_code (opcdata->pc, &byte, 1); if (status == 0) { opcdata->pc += 1; return byte; } else return -1; }
/* Like target_read_memory, but slightly different parameters. */ static int dis_asm_read_memory (bfd_vma memaddr, gdb_byte *myaddr, unsigned int len, struct disassemble_info *info) { return target_read_code (memaddr, myaddr, len); }