stacktrace.hh (10279:faa9dfc465ef) stacktrace.hh (10417:710ee116eb68)
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * Copyright (c) 2007-2008 The Florida State University
4 * Copyright (c) 2009 The University of Edinburgh
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

68 bool decodePrologue(Addr sp, Addr callpc, Addr func, int &size, Addr &ra);
69 bool decodeSave(MachInst inst, int &reg, int &disp);
70 bool decodeStack(MachInst inst, int &disp);
71
72 void trace(ThreadContext *tc, bool is_call);
73
74 public:
75 StackTrace();
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * Copyright (c) 2007-2008 The Florida State University
4 * Copyright (c) 2009 The University of Edinburgh
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

68 bool decodePrologue(Addr sp, Addr callpc, Addr func, int &size, Addr &ra);
69 bool decodeSave(MachInst inst, int &reg, int &disp);
70 bool decodeStack(MachInst inst, int &disp);
71
72 void trace(ThreadContext *tc, bool is_call);
73
74 public:
75 StackTrace();
76 StackTrace(ThreadContext *tc, StaticInstPtr inst);
76 StackTrace(ThreadContext *tc, const StaticInstPtr &inst);
77 ~StackTrace();
78
79 void
80 clear()
81 {
82 tc = 0;
83 stack.clear();
84 }
85
86 bool
87 valid() const
88 {
89 return tc != NULL;
90 }
91
77 ~StackTrace();
78
79 void
80 clear()
81 {
82 tc = 0;
83 stack.clear();
84 }
85
86 bool
87 valid() const
88 {
89 return tc != NULL;
90 }
91
92 bool trace(ThreadContext *tc, StaticInstPtr inst);
92 bool trace(ThreadContext *tc, const StaticInstPtr &inst);
93
94 public:
95 const std::vector<Addr> &
96 getstack() const
97 {
98 return stack;
99 }
100

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

118 void
119 dprintf()
120 {
121 }
122#endif
123};
124
125inline bool
93
94 public:
95 const std::vector<Addr> &
96 getstack() const
97 {
98 return stack;
99 }
100

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

118 void
119 dprintf()
120 {
121 }
122#endif
123};
124
125inline bool
126StackTrace::trace(ThreadContext *tc, StaticInstPtr inst)
126StackTrace::trace(ThreadContext *tc, const StaticInstPtr &inst)
127{
128 if (!inst->isCall() && !inst->isReturn())
129 return false;
130
131 if (valid())
132 clear();
133
134 trace(tc, !inst->isReturn());
135 return true;
136}
137
138} // namespace PowerISA
139
140#endif // __ARCH_POWER_STACKTRACE_HH__
127{
128 if (!inst->isCall() && !inst->isReturn())
129 return false;
130
131 if (valid())
132 clear();
133
134 trace(tc, !inst->isReturn());
135 return true;
136}
137
138} // namespace PowerISA
139
140#endif // __ARCH_POWER_STACKTRACE_HH__