#import "gdb.h"
#import "SegmentManagerThreads.h"
extern RegionManager *regionManager;
extern int current_core_thread;

void core_get_registers(regnum)
{
  ThreadInfo tInfo;
  SegmentManager *coreManager = (SegmentManager *)regionManager;

  [coreManager threadInfo: &tInfo forThreadNum: current_core_thread];
  memcpy(registers, tInfo.intRegs->dreg,
	 sizeof(tInfo.intRegs->dreg) + sizeof(tInfo.intRegs->areg));
  *(int *)(registers + REGISTER_BYTE(PS_REGNUM)) = (int)tInfo.intRegs->sr;
  *(int *)(registers + REGISTER_BYTE(PC_REGNUM)) = tInfo.intRegs->pc;
  memcpy(registers + (REGISTER_BYTE(FP0_REGNUM)), tInfo.fpRegs, 
	 sizeof(tInfo.fpRegs));
  registers_fetched();
}

