remote_gdb.cc (8541:27aaee8ec7cc) | remote_gdb.cc (8782:10c9297e14d5) |
---|---|
1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 120 unchanged lines hidden (view full) --- 129 * "Stub" to allow remote cpu to debug over a serial line using gdb. 130 */ 131 132#include <sys/signal.h> 133#include <unistd.h> 134 135#include <string> 136 | 1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 120 unchanged lines hidden (view full) --- 129 * "Stub" to allow remote cpu to debug over a serial line using gdb. 130 */ 131 132#include <sys/signal.h> 133#include <unistd.h> 134 135#include <string> 136 |
137#include "config/full_system.hh" 138#if FULL_SYSTEM 139#include "arch/arm/vtophys.hh" 140#endif 141 | |
142#include "arch/arm/pagetable.hh" 143#include "arch/arm/registers.hh" 144#include "arch/arm/remote_gdb.hh" 145#include "arch/arm/utility.hh" 146#include "arch/arm/vtophys.hh" 147#include "base/intmath.hh" 148#include "base/remote_gdb.hh" 149#include "base/socket.hh" 150#include "base/trace.hh" 151#include "cpu/decode.hh" 152#include "cpu/static_inst.hh" 153#include "cpu/thread_context.hh" 154#include "cpu/thread_state.hh" 155#include "debug/GDBAcc.hh" 156#include "debug/GDBMisc.hh" 157#include "mem/page_table.hh" 158#include "mem/physical.hh" 159#include "mem/port.hh" | 137#include "arch/arm/pagetable.hh" 138#include "arch/arm/registers.hh" 139#include "arch/arm/remote_gdb.hh" 140#include "arch/arm/utility.hh" 141#include "arch/arm/vtophys.hh" 142#include "base/intmath.hh" 143#include "base/remote_gdb.hh" 144#include "base/socket.hh" 145#include "base/trace.hh" 146#include "cpu/decode.hh" 147#include "cpu/static_inst.hh" 148#include "cpu/thread_context.hh" 149#include "cpu/thread_state.hh" 150#include "debug/GDBAcc.hh" 151#include "debug/GDBMisc.hh" 152#include "mem/page_table.hh" 153#include "mem/physical.hh" 154#include "mem/port.hh" |
155#include "sim/full_system.hh" |
|
160#include "sim/system.hh" 161 162using namespace std; 163using namespace ArmISA; 164 165RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc) 166 : BaseRemoteGDB(_system, tc, NUMREGS) 167{ 168} 169 170/* 171 * Determine if the mapping at va..(va+len) is valid. 172 */ 173bool 174RemoteGDB::acc(Addr va, size_t len) 175{ | 156#include "sim/system.hh" 157 158using namespace std; 159using namespace ArmISA; 160 161RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc) 162 : BaseRemoteGDB(_system, tc, NUMREGS) 163{ 164} 165 166/* 167 * Determine if the mapping at va..(va+len) is valid. 168 */ 169bool 170RemoteGDB::acc(Addr va, size_t len) 171{ |
176#if FULL_SYSTEM 177 Addr last_va; 178 va = truncPage(va); 179 last_va = roundPage(va + len); | 172 if (FullSystem) { 173 Addr last_va; 174 va = truncPage(va); 175 last_va = roundPage(va + len); |
180 | 176 |
181 do { 182 if (virtvalid(context, va)) { 183 return true; 184 } 185 va += PageBytes; 186 } while (va < last_va); | 177 do { 178 if (virtvalid(context, va)) { 179 return true; 180 } 181 va += PageBytes; 182 } while (va < last_va); |
187 | 183 |
188 DPRINTF(GDBAcc, "acc: %#x mapping is valid\n", va); 189 return true; 190#else 191 TlbEntry entry; 192 //Check to make sure the first byte is mapped into the processes address 193 //space. 194 if (context->getProcessPtr()->pTable->lookup(va, entry)) | 184 DPRINTF(GDBAcc, "acc: %#x mapping is valid\n", va); |
195 return true; | 185 return true; |
196 return false; 197#endif | 186 } else { 187 TlbEntry entry; 188 //Check to make sure the first byte is mapped into the processes address 189 //space. 190 if (context->getProcessPtr()->pTable->lookup(va, entry)) 191 return true; 192 return false; 193 } |
198} 199 200/* 201 * Translate the kernel debugger register format into the GDB register 202 * format. 203 */ 204void 205RemoteGDB::getregs() --- 144 unchanged lines hidden --- | 194} 195 196/* 197 * Translate the kernel debugger register format into the GDB register 198 * format. 199 */ 200void 201RemoteGDB::getregs() --- 144 unchanged lines hidden --- |