remote_gdb.cc (10595:25ecfc14f73f) remote_gdb.cc (10601:6efb37480d87)
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2010 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

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

230 for (int i = 0; i < GdbFloatArchRegs; i++)
231 context->setFloatRegBits(i, gdbregs.regs32[GdbIntRegs + i]);
232 // FCR, FIR
233 context->setFloatRegBits(FLOATREG_FCCR,
234 gdbregs.regs32[GdbIntRegs + GdbFloatArchRegs + 0]);
235 context->setFloatRegBits(FLOATREG_FIR,
236 gdbregs.regs32[GdbIntRegs + GdbFloatArchRegs + 1]);
237}
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2010 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

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

230 for (int i = 0; i < GdbFloatArchRegs; i++)
231 context->setFloatRegBits(i, gdbregs.regs32[GdbIntRegs + i]);
232 // FCR, FIR
233 context->setFloatRegBits(FLOATREG_FCCR,
234 gdbregs.regs32[GdbIntRegs + GdbFloatArchRegs + 0]);
235 context->setFloatRegBits(FLOATREG_FIR,
236 gdbregs.regs32[GdbIntRegs + GdbFloatArchRegs + 1]);
237}
238
239void
240RemoteGDB::clearSingleStep()
241{
242 DPRINTF(GDBMisc, "clearSingleStep bt_addr=%#x nt_addr=%#x\n",
243 takenBkpt, notTakenBkpt);
244
245 if (takenBkpt != 0)
246 clearTempBreakpoint(takenBkpt);
247
248 if (notTakenBkpt != 0)
249 clearTempBreakpoint(notTakenBkpt);
250}
251
252void
253RemoteGDB::setSingleStep()
254{
255 PCState pc = context->pcState();
256 PCState bpc;
257 bool set_bt = false;
258
259 // User was stopped at pc, e.g. the instruction at pc was not
260 // executed.
261 MachInst inst = read<MachInst>(pc.pc());
262 StaticInstPtr si = context->getDecoderPtr()->decode(inst, pc.pc());
263 if (si->hasBranchTarget(pc, context, bpc)) {
264 // Don't bother setting a breakpoint on the taken branch if it
265 // is the same as the next npc
266 if (bpc.npc() != pc.nnpc())
267 set_bt = true;
268 }
269
270 DPRINTF(GDBMisc, "setSingleStep bt_addr=%#x nt_addr=%#x\n",
271 takenBkpt, notTakenBkpt);
272
273 notTakenBkpt = pc.nnpc();
274 setTempBreakpoint(notTakenBkpt);
275
276 if (set_bt) {
277 takenBkpt = bpc.npc();
278 setTempBreakpoint(takenBkpt);
279 }
280}
281