pc_event.cc (8670:aae12ce9f34c) | pc_event.cc (8793:5f25086326ac) |
---|---|
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; --- 22 unchanged lines hidden (view full) --- 31 32#include <algorithm> 33#include <map> 34#include <string> 35#include <utility> 36 37#include "base/debug.hh" 38#include "base/trace.hh" | 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; --- 22 unchanged lines hidden (view full) --- 31 32#include <algorithm> 33#include <map> 34#include <string> 35#include <utility> 36 37#include "base/debug.hh" 38#include "base/trace.hh" |
39#include "config/full_system.hh" | |
40#include "cpu/base.hh" 41#include "cpu/pc_event.hh" 42#include "cpu/thread_context.hh" 43#include "debug/PCEvent.hh" 44#include "sim/core.hh" 45#include "sim/system.hh" 46 47using namespace std; --- 31 unchanged lines hidden (view full) --- 79 event->pc(), event->descr()); 80 81 return true; 82} 83 84bool 85PCEventQueue::doService(ThreadContext *tc) 86{ | 39#include "cpu/base.hh" 40#include "cpu/pc_event.hh" 41#include "cpu/thread_context.hh" 42#include "debug/PCEvent.hh" 43#include "sim/core.hh" 44#include "sim/system.hh" 45 46using namespace std; --- 31 unchanged lines hidden (view full) --- 78 event->pc(), event->descr()); 79 80 return true; 81} 82 83bool 84PCEventQueue::doService(ThreadContext *tc) 85{ |
87 // This will fail to break on Alpha PALcode addresses, but that is 88 // a rare use case. 89 Addr pc = tc->instAddr(); | 86 Addr pc = tc->instAddr() & ~0x3; |
90 int serviced = 0; 91 range_t range = equal_range(pc); 92 for (iterator i = range.first; i != range.second; ++i) { 93 // Make sure that the pc wasn't changed as the side effect of 94 // another event. This for example, prevents two invocations 95 // of the SkipFuncEvent. Maybe we should have separate PC 96 // event queues for each processor? | 87 int serviced = 0; 88 range_t range = equal_range(pc); 89 for (iterator i = range.first; i != range.second; ++i) { 90 // Make sure that the pc wasn't changed as the side effect of 91 // another event. This for example, prevents two invocations 92 // of the SkipFuncEvent. Maybe we should have separate PC 93 // event queues for each processor? |
97 if (pc != tc->instAddr()) | 94 if (pc != (tc->instAddr() & ~0x3)) |
98 continue; 99 100 DPRINTF(PCEvent, "PC based event serviced at %#x: %s\n", 101 (*i)->pc(), (*i)->descr()); 102 103 (*i)->process(tc); 104 ++serviced; 105 } --- 29 unchanged lines hidden (view full) --- 135{ 136 StringWrap name(tc->getCpuPtr()->name() + ".break_event"); 137 DPRINTFN("break event %s triggered\n", descr()); 138 Debug::breakpoint(); 139 if (remove) 140 delete this; 141} 142 | 95 continue; 96 97 DPRINTF(PCEvent, "PC based event serviced at %#x: %s\n", 98 (*i)->pc(), (*i)->descr()); 99 100 (*i)->process(tc); 101 ++serviced; 102 } --- 29 unchanged lines hidden (view full) --- 132{ 133 StringWrap name(tc->getCpuPtr()->name() + ".break_event"); 134 DPRINTFN("break event %s triggered\n", descr()); 135 Debug::breakpoint(); 136 if (remove) 137 delete this; 138} 139 |
143#if FULL_SYSTEM | |
144void 145sched_break_pc_sys(System *sys, Addr addr) 146{ 147 new BreakPCEvent(&sys->pcEventQueue, "debug break", addr, true); 148} 149 150void 151sched_break_pc(Addr addr) 152{ 153 for (vector<System *>::iterator sysi = System::systemList.begin(); 154 sysi != System::systemList.end(); ++sysi) { 155 sched_break_pc_sys(*sysi, addr); 156 } 157 158} | 140void 141sched_break_pc_sys(System *sys, Addr addr) 142{ 143 new BreakPCEvent(&sys->pcEventQueue, "debug break", addr, true); 144} 145 146void 147sched_break_pc(Addr addr) 148{ 149 for (vector<System *>::iterator sysi = System::systemList.begin(); 150 sysi != System::systemList.end(); ++sysi) { 151 sched_break_pc_sys(*sysi, addr); 152 } 153 154} |
159#endif | |