remote_gdb.cc (10595:25ecfc14f73f) remote_gdb.cc (10601:6efb37480d87)
1/*
2 * Copyright 2014 Google Inc.
3 * Copyright (c) 2010, 2013 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 147 unchanged lines hidden (view full) ---

156#include "mem/port.hh"
157#include "sim/full_system.hh"
158#include "sim/system.hh"
159
160using namespace std;
161using namespace ArmISA;
162
163RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc)
1/*
2 * Copyright 2014 Google Inc.
3 * Copyright (c) 2010, 2013 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 147 unchanged lines hidden (view full) ---

156#include "mem/port.hh"
157#include "sim/full_system.hh"
158#include "sim/system.hh"
159
160using namespace std;
161using namespace ArmISA;
162
163RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc)
164 : BaseRemoteGDB(_system, tc, GDB_REG_BYTES),
165 notTakenBkpt(0), takenBkpt(0)
164 : BaseRemoteGDB(_system, tc, GDB_REG_BYTES)
166{
167}
168
169/*
170 * Determine if the mapping at va..(va+len) is valid.
171 */
172bool
173RemoteGDB::acc(Addr va, size_t len)

--- 135 unchanged lines hidden (view full) ---

309 for (int i = 0; i < NumFloatV7ArchRegs; ++i)
310 context->setFloatRegBits(i, gdbregs.regs32[GDB32_F0 + i]);
311
312 //FPSCR
313 context->setMiscReg(MISCREG_FPSCR, gdbregs.regs32[GDB32_FPSCR]);
314 }
315}
316
165{
166}
167
168/*
169 * Determine if the mapping at va..(va+len) is valid.
170 */
171bool
172RemoteGDB::acc(Addr va, size_t len)

--- 135 unchanged lines hidden (view full) ---

308 for (int i = 0; i < NumFloatV7ArchRegs; ++i)
309 context->setFloatRegBits(i, gdbregs.regs32[GDB32_F0 + i]);
310
311 //FPSCR
312 context->setMiscReg(MISCREG_FPSCR, gdbregs.regs32[GDB32_FPSCR]);
313 }
314}
315
317void
318RemoteGDB::clearSingleStep()
319{
320 DPRINTF(GDBMisc, "clearSingleStep bt_addr=%#x nt_addr=%#x\n",
321 takenBkpt, notTakenBkpt);
322
323 if (takenBkpt != 0)
324 clearTempBreakpoint(takenBkpt);
325
326 if (notTakenBkpt != 0)
327 clearTempBreakpoint(notTakenBkpt);
328}
329
330void
331RemoteGDB::setSingleStep()
332{
333 PCState pc = context->pcState();
334 PCState bpc;
335 bool set_bt = false;
336
337 // User was stopped at pc, e.g. the instruction at pc was not
338 // executed.
339 MachInst inst = read<MachInst>(pc.pc());
340 StaticInstPtr si = context->getDecoderPtr()->decode(inst, pc.pc());
341 if (si->hasBranchTarget(pc, context, bpc)) {
342 // Don't bother setting a breakpoint on the taken branch if it
343 // is the same as the next pc
344 if (bpc.pc() != pc.npc())
345 set_bt = true;
346 }
347
348 DPRINTF(GDBMisc, "setSingleStep bt_addr=%#x nt_addr=%#x\n",
349 takenBkpt, notTakenBkpt);
350
351 setTempBreakpoint(notTakenBkpt = pc.npc());
352
353 if (set_bt)
354 setTempBreakpoint(takenBkpt = bpc.pc());
355}
356
357// Write bytes to kernel address space for debugger.
358bool
359RemoteGDB::write(Addr vaddr, size_t size, const char *data)
360{
361 return BaseRemoteGDB::write(vaddr, size, data);
362}
363
316// Write bytes to kernel address space for debugger.
317bool
318RemoteGDB::write(Addr vaddr, size_t size, const char *data)
319{
320 return BaseRemoteGDB::write(vaddr, size, data);
321}
322