debug.cc (9960:501c7384a5bc) debug.cc (9983:2cce74fe359e)
1/*
2 * Copyright (c) 2003-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;

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

32#include <Python.h>
33
34#include <string>
35#include <vector>
36
37#include "base/debug.hh"
38#include "sim/debug.hh"
39#include "sim/eventq_impl.hh"
1/*
2 * Copyright (c) 2003-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;

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

32#include <Python.h>
33
34#include <string>
35#include <vector>
36
37#include "base/debug.hh"
38#include "sim/debug.hh"
39#include "sim/eventq_impl.hh"
40#include "sim/global_event.hh"
40#include "sim/sim_events.hh"
41#include "sim/sim_exit.hh"
42
43using namespace std;
44
45//
46// Debug event: place a breakpoint on the process function and
47// schedule the event to break at a particular cycle
48//
41#include "sim/sim_events.hh"
42#include "sim/sim_exit.hh"
43
44using namespace std;
45
46//
47// Debug event: place a breakpoint on the process function and
48// schedule the event to break at a particular cycle
49//
49struct DebugBreakEvent : public Event
50struct DebugBreakEvent : public GlobalEvent
50{
51{
51 DebugBreakEvent();
52 DebugBreakEvent(Tick when);
52 void process(); // process event
53 virtual const char *description() const;
54};
55
56//
57// constructor: schedule at specified time
58//
53 void process(); // process event
54 virtual const char *description() const;
55};
56
57//
58// constructor: schedule at specified time
59//
59DebugBreakEvent::DebugBreakEvent()
60 : Event(Debug_Break_Pri, AutoDelete)
60DebugBreakEvent::DebugBreakEvent(Tick when)
61 : GlobalEvent(when, Debug_Break_Pri, AutoDelete)
61{
62}
63
64//
65// handle debug event: set debugger breakpoint on this function
66//
67void
68DebugBreakEvent::process()

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

79
80//
81// handy function to schedule DebugBreakEvent on main event queue
82// (callable from debugger)
83//
84void
85schedBreak(Tick when)
86{
62{
63}
64
65//
66// handle debug event: set debugger breakpoint on this function
67//
68void
69DebugBreakEvent::process()

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

80
81//
82// handy function to schedule DebugBreakEvent on main event queue
83// (callable from debugger)
84//
85void
86schedBreak(Tick when)
87{
87 mainEventQueue.schedule(new DebugBreakEvent, when);
88 new DebugBreakEvent(when);
88 warn("need to stop all queues");
89}
90
91///
92/// Function to cause the simulator to take a checkpoint from the debugger
93///
94void
95takeCheckpoint(Tick when)
96{
97 if (!when)
98 when = curTick() + 1;
99 exitSimLoop("checkpoint", 0, when, 0);
100}
101
102void
103eventqDump()
104{
89 warn("need to stop all queues");
90}
91
92///
93/// Function to cause the simulator to take a checkpoint from the debugger
94///
95void
96takeCheckpoint(Tick when)
97{
98 if (!when)
99 when = curTick() + 1;
100 exitSimLoop("checkpoint", 0, when, 0);
101}
102
103void
104eventqDump()
105{
105 mainEventQueue.dump();
106 warn("need to dump all queues");
106 for (uint32_t i = 0; i < numMainEventQueues; ++i) {
107 mainEventQueue[i]->dump();
108 }
107}
108
109void
110py_interact()
111{
112 PyObject *globals;
113 PyObject *locals;
114

--- 26 unchanged lines hidden ---
109}
110
111void
112py_interact()
113{
114 PyObject *globals;
115 PyObject *locals;
116

--- 26 unchanged lines hidden ---