* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Nathan Binkert
- * Boris Shingarov
*/
/*
#include <sstream>
#include <string>
-#include "arch/vtophys.hh"
#include "base/intmath.hh"
#include "base/socket.hh"
#include "base/trace.hh"
#include "cpu/static_inst.hh"
#include "cpu/thread_context.hh"
#include "debug/GDBAll.hh"
-#include "mem/fs_translating_port_proxy.hh"
#include "mem/port.hh"
-#include "mem/se_translating_port_proxy.hh"
+#include "mem/port_proxy.hh"
#include "sim/full_system.hh"
#include "sim/system.hh"
std::map<Addr, HardBreakpoint *> hardBreakMap;
-EventQueue *
-getComInstEventQueue(ThreadContext *tc)
-{
- return tc->getCpuPtr()->comInstEventQueue[tc->threadId()];
-}
-
}
BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, int _port) :
bool
BaseRemoteGDB::read(Addr vaddr, size_t size, char *data)
{
- static Addr lastaddr = 0;
- static size_t lastsize = 0;
-
- if (vaddr < 10) {
- DPRINTF(GDBRead, "read: reading memory location zero!\n");
- vaddr = lastaddr + lastsize;
- }
-
DPRINTF(GDBRead, "read: addr=%#x, size=%d", vaddr, size);
PortProxy &proxy = tc->getVirtProxy();
bool
BaseRemoteGDB::write(Addr vaddr, size_t size, const char *data)
{
- static Addr lastaddr = 0;
- static size_t lastsize = 0;
-
- if (vaddr < 10) {
- DPRINTF(GDBWrite, "write: writing memory location zero!\n");
- vaddr = lastaddr + lastsize;
- }
-
if (DTRACE(GDBWrite)) {
DPRINTFN("write: addr=%#x, size=%d", vaddr, size);
if (DTRACE(GDBExtra)) {
HardBreakpoint *&bkpt = hardBreakMap[addr];
if (bkpt == 0)
- bkpt = new HardBreakpoint(this, &sys->pcEventQueue, addr);
+ bkpt = new HardBreakpoint(this, sys, addr);
bkpt->refcount++;
}
void
BaseRemoteGDB::scheduleInstCommitEvent(Event *ev, int delta)
{
- EventQueue *eq = getComInstEventQueue(tc);
// Here "ticks" aren't simulator ticks which measure time, they're
// instructions committed by the CPU.
- eq->schedule(ev, eq->getCurTick() + delta);
+ tc->scheduleInstCountEvent(ev, tc->getCurrentInstCount() + delta);
}
void
BaseRemoteGDB::descheduleInstCommitEvent(Event *ev)
{
if (ev->scheduled())
- getComInstEventQueue(tc)->deschedule(ev);
+ tc->descheduleInstCountEvent(ev);
}
std::map<char, BaseRemoteGDB::GdbCommand> BaseRemoteGDB::command_map = {