remote_gdb.cc (8706:b1838faf3bcc) | remote_gdb.cc (8783:8cd08c045cab) |
---|---|
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 | 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 "config/full_system.hh" 126 127#if FULL_SYSTEM | |
128#include "arch/vtophys.hh" | 125#include "arch/vtophys.hh" |
129#include "mem/fs_translating_port_proxy.hh" 130#endif 131 | |
132#include "base/intmath.hh" 133#include "base/remote_gdb.hh" 134#include "base/socket.hh" 135#include "base/trace.hh" 136#include "config/the_isa.hh" 137#include "cpu/static_inst.hh" 138#include "cpu/thread_context.hh" 139#include "debug/GDBAll.hh" 140#include "mem/port.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" |
141#include "mem/se_translating_port_proxy.hh" | 135#include "mem/translating_port.hh" 136#include "mem/vport.hh" |
142#include "sim/system.hh" 143 144using namespace std; 145using namespace Debug; 146using namespace TheISA; 147 148#ifndef NDEBUG 149vector<BaseRemoteGDB *> debuggers; --- 309 unchanged lines hidden (view full) --- 459 460 if (vaddr < 10) { 461 DPRINTF(GDBRead, "read: reading memory location zero!\n"); 462 vaddr = lastaddr + lastsize; 463 } 464 465 DPRINTF(GDBRead, "read: addr=%#x, size=%d", vaddr, size); 466 | 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 |
467#if FULL_SYSTEM 468 FSTranslatingPortProxy *port = context->getVirtProxy(); 469#else 470 SETranslatingPortProxy *port = context->getMemProxy(); 471#endif 472 port->readBlob(vaddr, (uint8_t*)data, size); | 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 } |
473 474#if TRACING_ON 475 if (DTRACE(GDBRead)) { 476 if (DTRACE(GDBExtra)) { 477 char buf[1024]; 478 mem2hex(buf, data, size); 479 DPRINTFNR(": %s\n", buf); 480 } else --- 20 unchanged lines hidden (view full) --- 501 DPRINTFN("write: addr=%#x, size=%d", vaddr, size); 502 if (DTRACE(GDBExtra)) { 503 char buf[1024]; 504 mem2hex(buf, data, size); 505 DPRINTFNR(": %s\n", buf); 506 } else 507 DPRINTFNR("\n"); 508 } | 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 } |
509#if FULL_SYSTEM 510 FSTranslatingPortProxy *port = context->getVirtProxy(); 511#else 512 SETranslatingPortProxy *port = context->getMemProxy(); 513#endif 514 port->writeBlob(vaddr, (uint8_t*)data, size); 515#if !FULL_SYSTEM 516 delete port; 517#endif | 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 } |
518 519 return true; 520} 521 522PCEventQueue *BaseRemoteGDB::getPcEventQueue() 523{ 524 return &system->pcEventQueue; 525} --- 117 unchanged lines hidden (view full) --- 643 bool ret; 644 645 if (!attached) 646 return false; 647 648 bufferSize = gdbregs.bytes() * 2 + 256; 649 buffer = (char*)malloc(bufferSize); 650 | 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 |
651 DPRINTF(GDBMisc, "trap: PC=%s\n", context->pcState()); | 646 TheISA::PCState pc = context->pcState(); 647 DPRINTF(GDBMisc, "trap: PC=%s\n", pc); |
652 653 clearSingleStep(); 654 655 /* 656 * The first entry to this function is normally through 657 * a breakpoint trap in kgdb_connect(), in which case we 658 * must advance past the breakpoint because gdb will not. 659 * --- 365 unchanged lines hidden --- | 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 --- |