1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 108 unchanged lines hidden (view full) --- 117 */ 118 119#include <sys/signal.h> 120#include <unistd.h> 121 122#include <cstdio> 123#include <string> 124 |
125#include "arch/vtophys.hh" |
126#include "base/intmath.hh" 127#include "base/remote_gdb.hh" 128#include "base/socket.hh" 129#include "base/trace.hh" 130#include "config/the_isa.hh" 131#include "cpu/static_inst.hh" 132#include "cpu/thread_context.hh" 133#include "debug/GDBAll.hh" 134#include "mem/port.hh" |
135#include "mem/translating_port.hh" 136#include "mem/vport.hh" |
137#include "sim/system.hh" 138 139using namespace std; 140using namespace Debug; 141using namespace TheISA; 142 143#ifndef NDEBUG 144vector<BaseRemoteGDB *> debuggers; --- 309 unchanged lines hidden (view full) --- 454 455 if (vaddr < 10) { 456 DPRINTF(GDBRead, "read: reading memory location zero!\n"); 457 vaddr = lastaddr + lastsize; 458 } 459 460 DPRINTF(GDBRead, "read: addr=%#x, size=%d", vaddr, size); 461 |
462 if (FullSystem) { 463 VirtualPort *port = context->getVirtPort(); 464 port->readBlob(vaddr, (uint8_t*)data, size); 465 } else { 466 TranslatingPort *port = context->getMemPort(); 467 port->readBlob(vaddr, (uint8_t*)data, size); 468 } |
469 470#if TRACING_ON 471 if (DTRACE(GDBRead)) { 472 if (DTRACE(GDBExtra)) { 473 char buf[1024]; 474 mem2hex(buf, data, size); 475 DPRINTFNR(": %s\n", buf); 476 } else --- 20 unchanged lines hidden (view full) --- 497 DPRINTFN("write: addr=%#x, size=%d", vaddr, size); 498 if (DTRACE(GDBExtra)) { 499 char buf[1024]; 500 mem2hex(buf, data, size); 501 DPRINTFNR(": %s\n", buf); 502 } else 503 DPRINTFNR("\n"); 504 } |
505 if (FullSystem) { 506 VirtualPort *port = context->getVirtPort(); 507 port->writeBlob(vaddr, (uint8_t*)data, size); 508 } else { 509 TranslatingPort *port = context->getMemPort(); 510 port->writeBlob(vaddr, (uint8_t*)data, size); 511 delete port; 512 } |
513 514 return true; 515} 516 517PCEventQueue *BaseRemoteGDB::getPcEventQueue() 518{ 519 return &system->pcEventQueue; 520} --- 117 unchanged lines hidden (view full) --- 638 bool ret; 639 640 if (!attached) 641 return false; 642 643 bufferSize = gdbregs.bytes() * 2 + 256; 644 buffer = (char*)malloc(bufferSize); 645 |
646 TheISA::PCState pc = context->pcState(); 647 DPRINTF(GDBMisc, "trap: PC=%s\n", pc); |
648 649 clearSingleStep(); 650 651 /* 652 * The first entry to this function is normally through 653 * a breakpoint trap in kgdb_connect(), in which case we 654 * must advance past the breakpoint because gdb will not. 655 * --- 365 unchanged lines hidden --- |