ARM: Decode neon memory instructions.
[gem5.git] / src / arch / alpha / stacktrace.hh
index 834abbc2f6eca9ceac7ad0ef742a0db403219293..c09ab357630f8c406d9c75a6861cfa221c3c02d9 100644 (file)
 
 class ThreadContext;
 
-namespace AlphaISA
-{
-    class StackTrace;
+namespace AlphaISA {
 
-    class ProcessInfo
-    {
-      private:
-        ThreadContext *tc;
+class StackTrace;
 
-        int thread_info_size;
-        int task_struct_size;
-        int task_off;
-        int pid_off;
-        int name_off;
+class ProcessInfo
+{
+  private:
+    ThreadContext *tc;
 
-      public:
-        ProcessInfo(ThreadContext *_tc);
+    int thread_info_size;
+    int task_struct_size;
+    int task_off;
+    int pid_off;
+    int name_off;
 
-        Addr task(Addr ksp) const;
-        int pid(Addr ksp) const;
-        std::string name(Addr ksp) const;
-    };
+  public:
+    ProcessInfo(ThreadContext *_tc);
 
-    class StackTrace
-    {
-      protected:
-        typedef TheISA::MachInst MachInst;
-      private:
-        ThreadContext *tc;
-        std::vector<Addr> stack;
+    Addr task(Addr ksp) const;
+    int pid(Addr ksp) const;
+    std::string name(Addr ksp) const;
+};
 
-      private:
-        bool isEntry(Addr addr);
-        bool decodePrologue(Addr sp, Addr callpc, Addr func, int &size, Addr &ra);
-        bool decodeSave(MachInst inst, int &reg, int &disp);
-        bool decodeStack(MachInst inst, int &disp);
+class StackTrace
+{
+  private:
+    ThreadContext *tc;
+    std::vector<Addr> stack;
 
-        void trace(ThreadContext *tc, bool is_call);
+  private:
+    bool isEntry(Addr addr);
+    bool decodePrologue(Addr sp, Addr callpc, Addr func, int &size, Addr &ra);
+    bool decodeSave(MachInst inst, int &reg, int &disp);
+    bool decodeStack(MachInst inst, int &disp);
 
-      public:
-        StackTrace();
-        StackTrace(ThreadContext *tc, StaticInstPtr inst);
-        ~StackTrace();
+    void trace(ThreadContext *tc, bool is_call);
 
-        void clear()
-        {
-            tc = 0;
-            stack.clear();
-        }
+  public:
+    StackTrace();
+    StackTrace(ThreadContext *tc, StaticInstPtr inst);
+    ~StackTrace();
 
-        bool valid() const { return tc != NULL; }
-        bool trace(ThreadContext *tc, StaticInstPtr inst);
+    void
+    clear()
+    {
+        tc = 0;
+        stack.clear();
+    }
 
-      public:
-        const std::vector<Addr> &getstack() const { return stack; }
+    bool valid() const { return tc != NULL; }
+    bool trace(ThreadContext *tc, StaticInstPtr inst);
 
-        static const int user = 1;
-        static const int console = 2;
-        static const int unknown = 3;
+  public:
+    const std::vector<Addr> &getstack() const { return stack; }
+
+    enum {
+        user = 1,
+        console = 2,
+        unknown = 3
+    };
 
 #if TRACING_ON
-      private:
-        void dump();
+  private:
+    void dump();
 
-      public:
-        void dprintf() { if (DTRACE(Stack)) dump(); }
+  public:
+    void dprintf() { if (DTRACE(Stack)) dump(); }
 #else
-      public:
-        void dprintf() {}
+  public:
+    void dprintf() {}
 #endif
-    };
+};
 
-    inline bool
-    StackTrace::trace(ThreadContext *tc, StaticInstPtr inst)
-    {
-        if (!inst->isCall() && !inst->isReturn())
-            return false;
+inline bool
+StackTrace::trace(ThreadContext *tc, StaticInstPtr inst)
+{
+    if (!inst->isCall() && !inst->isReturn())
+        return false;
 
-        if (valid())
-            clear();
+    if (valid())
+        clear();
 
-        trace(tc, !inst->isReturn());
-        return true;
-    }
+    trace(tc, !inst->isReturn());
+    return true;
 }
 
+} // namespace AlphaISA
+
 #endif // __ARCH_ALPHA_STACKTRACE_HH__