Ghidra is a software reverse engineering (SRE) framework
Add testfunction to ghidra_dbg. Push and pops scripts properly.
caheckmandff7c83542ba
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/Makefile b/Ghidra/Features/Decompiler/src/decompile/cpp/Makefileindex b278371b67..5d6e5643ba 100644--- a/Ghidra/Features/Decompiler/src/decompile/cpp/Makefile+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/Makefile@@ -123,7 +123,7 @@ TEST_NAMES=$(CORE) $(DECCORE) $(SLEIGH) $(EXTRA) testTEST_DEBUG=-D__TERMINAL__GHIDRA_NAMES=$(CORE) $(DECCORE) $(GHIDRA)-GHIDRA_NAMES_DBG=$(GHIDRA_NAMES) callgraph ifacedecomp ifaceterm interface+GHIDRA_NAMES_DBG=$(GHIDRA_NAMES) callgraph ifacedecomp testfunction ifaceterm interfaceGHIDRA_DEBUG=-DCPUI_DEBUGGHIDRA_OPT=diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.ccindex 7cba748208..44a5843058 100644--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc@@ -51,6 +51,11 @@ IfaceTerm::IfaceTerm(const string &prmpt,istream &is,ostream &os)IfaceTerm::~IfaceTerm(void){+ while(!inputstack.empty()) {+ delete sptr;+ sptr = inputstack.back();+ inputstack.pop_back();+ }#ifdef __TERMINAL__if (is_terminal) {tcsetattr(ifd,TCSANOW,&itty); // Restore original terminal settingsdiff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.ccindex f0a98b6179..a95982ecb5 100644--- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc@@ -145,6 +145,7 @@ void IfaceStatus::pushScript(const string &filename,const string &newprompt)ifstream *s = new ifstream(filename.c_str());if (!*s)throw IfaceParseError("Unable to open script file");+ pushScript(s,newprompt);}/// \brief Provide a new input stream to execute, with an associated command prompt