From 7849991ccefe012792f1fc8cfc56f36772db32c6 Mon Sep 17 00:00:00 2001
From: FXTi <zjxiang1998@gmail.com>
Date: Wed, 26 Aug 2020 15:10:30 +0800
Subject: [PATCH 16/23] Export two private field to SLEIGH plugin. (#4)

---
 Ghidra/Features/Decompiler/src/decompile/cpp/context.hh | 2 ++
 Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh  | 1 +
 2 files changed, 3 insertions(+)

diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh
index 3372e5ac5..5920bceb4 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh
@@ -89,6 +89,8 @@ private:
   ConstructState *base_state;
   int4 alloc;			// Number of ConstructState's allocated
   int4 delayslot;		// delayslot depth
+protected:
+  ConstructState *getBaseState(void) { return base_state; }
 public:
   ParserContext(ContextCache *ccache);
   ~ParserContext(void) { if (context != (uintm *)0) delete [] context; }
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh
index 1a758a488..1e96c2c30 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh
@@ -166,6 +166,7 @@ protected:
   ParserContext *obtainContext(const Address &addr,int4 state) const;
   void resolve(ParserContext &pos) const;	///< Generate a parse tree suitable for disassembly
   void resolveHandles(ParserContext &pos) const;	///< Prepare the parse tree for p-code generation
+  ContextCache *getContextCache(void) { return cache; }
 public:
   Sleigh(LoadImage *ld,ContextDatabase *c_db);		///< Constructor
   virtual ~Sleigh(void);				///< Destructor
-- 
2.24.3 (Apple Git-128)

