xcore / tool_axe

An XCore Emulator
Other
15 stars 8 forks source link

Interface Exposure #15

Closed graymalkin closed 10 years ago

graymalkin commented 10 years ago

Exposed functions needed to attach an AXE simulation to the xgdb debugger.

Debug printfs have been removed, and test summary is:

Testing Time: 18.59s
********************
Failing Tests (1):
    axe :: SystemCalls/overlays.xc

  Expected Passes    : 74
  Unexpected Failures: 1
rlsosborne commented 10 years ago

This doesn't address my previous comment about node IDs / JTAG IDs - would you be able to look at this. The other thing is that there are lots of separate, unconnected changes here. It would make it easier to review if this was split into several pull requests.

rlsosborne commented 10 years ago

I've manually merged these changes in (with some tidying up). I think I've included all the necessary changes, but let me know if I've missed anything. One thing that I noticed is that the watchpoints should take into account the size of the access, for example a 4byte access at address x should hit a watchpoint set for address x + 1. Are you able to take a look at this?

graymalkin commented 10 years ago

Assuming I understand correctly, I think this should be handled by gdb, as it sets watchpoints on an address range. AXE checks through the list of watchpoints in a set and checks the current address is/isn't within a watch point range. This is done by the WatchpointManager::isWatchpointAddress method.

bool WatchpointManager::isWatchpointAddress(WatchpointType t, uint32_t address)
{
    watchpointsIterator = watchpoints.begin();
    while(watchpointsIterator != watchpoints.end())
    {
        if((*watchpointsIterator).first == t &&                 // Check same type
            (*watchpointsIterator).second.first <= address &&   // Check addr >= lower bound
            (*watchpointsIterator).second.second >= address)    // Check addr <= upper bound
            return true;
        std::advance(watchpointsIterator, 1);
    }
    return false;
}