OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or_debug_proxy/] [src/] [gdb.c] - Diff between revs 47 and 79

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 47 Rev 79
Line 434... Line 434...
 
 
 
 
        if ((TARGET_SIGNAL_TRAP == rsp.sigval) && (NULL != mp_hash_lookup (BP_MEMORY, temp_uint32)))
        if ((TARGET_SIGNAL_TRAP == rsp.sigval) && (NULL != mp_hash_lookup (BP_MEMORY, temp_uint32)))
          {
          {
            if (stallState != STALLED)
            if (stallState != STALLED)
              // This is a quick fix for a strange situation seen in some of the simulators where
              // This is a quick fix for a strange situation seen in some of 
              // the sw bp would be detected, but the stalled state variable wasn't updated correctly
              // the simulators where the sw bp would be detected, but the 
              // indicating that last time it checked, it wasn't set but the processor has now hit the
              // stalled state variable wasn't updated correctly indicating 
              // breakpoint. So run rsp_check_for_exception() to bring everything up to date.
              // that last time it checked, it wasn't set but the processor 
 
              // had hit the breakpoint. So run rsp_check_for_exception() to 
 
              // bring everything up to date.
              rsp_check_for_exception();
              rsp_check_for_exception();
 
 
            if(DEBUG_GDB) printf("Software breakpoint hit at 0x%08x. Rolling back NPC to this instruction\n", temp_uint32);
            if(DEBUG_GDB) printf("Software breakpoint hit at 0x%08x. Rolling back NPC to this instruction\n", temp_uint32);
 
 
            set_npc (temp_uint32);
            set_npc (temp_uint32);
Line 740... Line 742...
 
 
  fcntl(rsp.client_fd, F_SETFL, flags | O_NONBLOCK);
  fcntl(rsp.client_fd, F_SETFL, flags | O_NONBLOCK);
#else
#else
  /* Otherwise, use the old way of doing it */
  /* Otherwise, use the old way of doing it */
  flags = 1;
  flags = 1;
  ioctl(fd, FIOBIO, &flags);
  ioctl(rsp.client_fd, FIOBIO, &flags);
#endif
#endif
 
 
 
  /* Set socket to be non-blocking.
 
 
 
     We do this because when we're given a continue, or step
  /* Set socket to be non-blocking */
     instruction,command we set the processor stall off, then instantly check
 
 
  /* We do this because when we're given a continue, or step
 
     instruction,command we set the processor stall off, then instnatly check
 
     if it's stopped. If it hasn't then we drop through and wait for input
     if it's stopped. If it hasn't then we drop through and wait for input
     from GDB. Obviously this will cause problems when it will stop after we
     from GDB. Obviously this will cause problems when it will stop after we
     do the check. So now, rsp_peek() has been implemented to simply check if
     do the check. So now, rsp_peek() been implemented to simply check if
     there's an incoming command from GDB (only interested in interrupt
     there's an incoming command from GDB (although, mainly interested in
     commands), otherwise it returns back to and poll the processor's PPC and
     int. commands), otherwise it returns back to poll the processor's
     stall bit. It can only do this if the socket is non-blocking.
     stall bit. It can only do this if the socket is non-blocking.
 
 
     At first test, simply adding this line appeared to give no problems with
     At first test, simply adding this line appeared to give no problems with
     the existing code. No "simulation" of blocking behaviour on the
     the existing code. No "simulation" of blocking behaviour on the
     non-blocking socket was required (in the event that a read/write throws
     non-blocking socket was required (in the event that a read/write throws
     back a EWOULDBLOCK error, as was looked to be the case in the previous
     back a EWOULDBLOCK error, as was looked to be the case in the previous
     GDB handling code) -- Julius
     GDB handling code) -- Julius
  */
  */
 
 
  if (ioctl(rsp.client_fd, FIONBIO, (char *)&optval) > 0 )
  if (ioctl(rsp.client_fd, FIONBIO, (char *)&optval) > 0 )
    {
    {
      perror("ioctl() failed");
      perror("ioctl() failed");
      close(rsp.client_fd);
      close(rsp.client_fd);
      close(tmp_fd);
      close(tmp_fd);
Line 3670... Line 3671...
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
static void
static void
reset_or1k (void)
reset_or1k (void)
{
{
 
 
  err = dbg_cpu0_write_ctrl(0, 0x02);  /* reset or1k */
  //err = dbg_cpu0_write_ctrl(0, 0x02);  /* reset or1k */
 
 
  if(err > 0 && DEBUG_GDB)printf("Error %d in reset_or1k()\n", err);
  //if(err > 0 && DEBUG_GDB)printf("Error %d in reset_or1k()\n", err);
 
 
}       /* reset_or1k () */
}       /* reset_or1k () */
 
 
 
 
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.