diff --git a/src/patches/HEAD/0001-Add-include-guards-to-decompiler-C-headers.patch b/src/patches/HEAD/0001-Add-include-guards-to-decompiler-C-headers.patch index d5c9e23..2cd1358 100644 --- a/src/patches/HEAD/0001-Add-include-guards-to-decompiler-C-headers.patch +++ b/src/patches/HEAD/0001-Add-include-guards-to-decompiler-C-headers.patch @@ -1,7 +1,7 @@ -From a43241edd759d507287ebd37f4a69ae3d6ef4a2f Mon Sep 17 00:00:00 2001 +From 0ca6d7c5c7f927a37482962df4399031581cf8af Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 28 Jul 2022 09:20:03 -0400 -Subject: [PATCH 1/4] Add include guards to decompiler C++ headers +Subject: [PATCH 1/7] Add include guards to decompiler C++ headers --- Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh | 5 +++++ @@ -92,7 +92,7 @@ index 2245840a0..490abf901 100644 +#endif diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh -index e7ab19185..8fd9ba2fd 100644 +index 91e12244b..2b18e10fc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh @@ -16,6 +16,9 @@ @@ -105,7 +105,7 @@ index e7ab19185..8fd9ba2fd 100644 #include "sleighbase.hh" #include "pcodecompile.hh" #include "filemanage.hh" -@@ -446,3 +449,5 @@ class SleighCompile : public SleighBase { +@@ -450,3 +453,5 @@ class SleighCompile : public SleighBase { extern SleighCompile *slgh; ///< A global reference to the SLEIGH compiler accessible to the parse functions extern int yydebug; ///< Debug state for the SLEIGH parse functions @@ -133,5 +133,5 @@ index d395fb8a3..6371148b0 100644 + +#endif -- -2.39.0 +2.40.0 diff --git a/src/patches/HEAD/0002-Fix-UBSAN-errors-in-decompiler.patch b/src/patches/HEAD/0002-Fix-UBSAN-errors-in-decompiler.patch index 6af845e..dc3680e 100644 --- a/src/patches/HEAD/0002-Fix-UBSAN-errors-in-decompiler.patch +++ b/src/patches/HEAD/0002-Fix-UBSAN-errors-in-decompiler.patch @@ -1,7 +1,7 @@ -From 0f35ed587ed7eabed6e87be0a09c9f2fddefdd7e Mon Sep 17 00:00:00 2001 +From 1f00ab9f7c53b6611fc1cf16455bb6069c0c0b69 Mon Sep 17 00:00:00 2001 From: Alex Cameron Date: Mon, 7 Feb 2022 02:02:03 +1100 -Subject: [PATCH 2/4] Fix UBSAN errors in decompiler +Subject: [PATCH 2/7] Fix UBSAN errors in decompiler --- .../Decompiler/src/decompile/cpp/address.cc | 4 ++-- @@ -20,7 +20,7 @@ Subject: [PATCH 2/4] Fix UBSAN errors in decompiler 13 files changed, 59 insertions(+), 23 deletions(-) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -index b3758ddd1..0b3bf04c8 100644 +index 26694b558..395fee432 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc @@ -685,7 +685,7 @@ uintb sign_extend(uintb in,int4 sizein,int4 sizeout) @@ -42,10 +42,10 @@ index b3758ddd1..0b3bf04c8 100644 mask <<= 1; val &= (~mask); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -index 19ed41c63..d1bd842d8 100644 +index 0f8c95d60..95ab4b0ee 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -@@ -2656,8 +2656,12 @@ void ProtoModelMerged::decode(Decoder &decoder) +@@ -2659,8 +2659,12 @@ void ProtoModelMerged::decode(Decoder &decoder) modellist.push_back(mymodel); } decoder.closeElement(elemId); @@ -80,10 +80,10 @@ index 0a641091b..70acfad8f 100644 uint4 vnFlags = vn->getFlags() & (Varnode::directwrite|Varnode::addrforce); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -index 697e42372..6267ed750 100644 +index 4c0749590..24551ed11 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -@@ -667,7 +667,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const +@@ -666,7 +666,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const break; case CPUI_PIECE: resmask = getIn(0)->getNZMask(); @@ -159,7 +159,7 @@ index 49128f7e6..133da8178 100644 return res; } diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -index 652eefbe5..c84df0848 100644 +index 9068f2a81..216f2f45f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc @@ -974,7 +974,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data) @@ -188,7 +188,7 @@ index 652eefbe5..c84df0848 100644 Varnode *vn1 = op->getIn(1); if (!vn1->isConstant()) return 0; Varnode *outvn = op->getOut(); -@@ -8467,7 +8473,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data) +@@ -8469,7 +8475,11 @@ int4 RuleSubvarSubpiece::applyOp(PcodeOp *op,Funcdata &data) Varnode *outvn = op->getOut(); int4 flowsize = outvn->getSize(); uintb mask = calc_mask( flowsize ); @@ -235,7 +235,7 @@ index 3b836244c..1fbd169c9 100644 type=op2.type; value=op2.value; value_real=op2.value_real; select=op2.select; } ConstTpl(const_type tp,uintb val); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -index fb9e94d34..7d09dd209 100644 +index b92a3de3b..ac9a70c93 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc @@ -2157,8 +2157,8 @@ string SleighCompile::checkSymbols(SymbolScope *scope) @@ -249,10 +249,10 @@ index fb9e94d34..7d09dd209 100644 msg << " Label <" << sym->getName() << "> was placed but not used" << endl; else if (!sym->isPlaced()) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -index dbb8f9e51..85bd54261 100644 +index 8516dbf10..352a0ae99 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -@@ -2565,7 +2565,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans) +@@ -2566,7 +2566,7 @@ void ContextOp::restoreXml(const Element *el,SleighBase *trans) const List &list(el->getChildren()); List::const_iterator iter; iter = list.begin(); @@ -262,7 +262,7 @@ index dbb8f9e51..85bd54261 100644 } diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -index 844bb2776..1296b82dd 100644 +index 9fc48aa7d..8b75afb6d 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc @@ -3233,8 +3233,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub) @@ -276,10 +276,10 @@ index 844bb2776..1296b82dd 100644 ++iter; if (ptr->submeta == sub) { diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -index ab99382a3..67d92c573 100644 +index f88b4d000..3b16ed13c 100644 --- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc +++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -@@ -338,7 +338,7 @@ TEST(float_opTrunc_to_int) { +@@ -343,7 +343,7 @@ TEST(float_opTrunc_to_int) { for(float f:float_test_values) { // avoid undefined behavior @@ -289,5 +289,5 @@ index ab99382a3..67d92c573 100644 uintb true_result = ((uintb)(int32_t)f) & 0xffffffff; uintb encoding = format.getEncoding(f); -- -2.39.0 +2.40.0 diff --git a/src/patches/HEAD/0003-Use-stroull-instead-of-stroul-to-parse-address-offse.patch b/src/patches/HEAD/0003-Use-stroull-instead-of-stroul-to-parse-address-offse.patch index 7547be1..0c6b74a 100644 --- a/src/patches/HEAD/0003-Use-stroull-instead-of-stroul-to-parse-address-offse.patch +++ b/src/patches/HEAD/0003-Use-stroull-instead-of-stroul-to-parse-address-offse.patch @@ -1,7 +1,7 @@ -From a208e9b0de5aba873248ceb583db842978868bd4 Mon Sep 17 00:00:00 2001 +From ad4a5782300ff499c1633da6923669545b78a2cc Mon Sep 17 00:00:00 2001 From: Alex Cameron Date: Wed, 3 Aug 2022 20:01:18 +1000 -Subject: [PATCH 3/4] Use `stroull` instead of `stroul` to parse address +Subject: [PATCH 3/7] Use `stroull` instead of `stroul` to parse address offsets --- @@ -9,7 +9,7 @@ Subject: [PATCH 3/4] Use `stroull` instead of `stroul` to parse address 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -index 40a3e3bfe..ff6f282ca 100644 +index b511f8919..4ae8f18a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc @@ -16,6 +16,8 @@ @@ -21,7 +21,7 @@ index 40a3e3bfe..ff6f282ca 100644 AttributeId ATTRIB_BASE = AttributeId("base",89); AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90); AttributeId ATTRIB_DELAY = AttributeId("delay", 91); -@@ -268,7 +270,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const +@@ -288,7 +290,10 @@ uintb AddrSpace::read(const string &s,int4 &size) const } } catch(LowlevelError &err) { // Name doesn't exist @@ -34,5 +34,5 @@ index 40a3e3bfe..ff6f282ca 100644 enddata = (const char *) tmpdata; if (enddata - s.c_str() == s.size()) { // If no size or offset override -- -2.39.0 +2.40.0 diff --git a/src/patches/HEAD/0004-1-4-decompiler-Add-using-namespace-std-to-all-.cc-fi.patch b/src/patches/HEAD/0004-1-4-decompiler-Add-using-namespace-std-to-all-.cc-fi.patch new file mode 100644 index 0000000..a3b082a --- /dev/null +++ b/src/patches/HEAD/0004-1-4-decompiler-Add-using-namespace-std-to-all-.cc-fi.patch @@ -0,0 +1,1673 @@ +From e805ecdc9520ee818a193c70838c72cb822fb0e0 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Wed, 2 Nov 2022 19:41:19 -0400 +Subject: [PATCH 4/7] (1/4) decompiler: Add 'using namespace std' to all '.cc' + files + +This commit will not compile. + +It is less controversial (but still not ideal) to add 'using namespace' +to C++ source files because they are isolated and will not affect any +other code than what's in the source file. Eventually, it would be best +to refactor to either use a using-declaration statement or to attach +'std::' to all the symbols. Clangd refactors exist to do this (but they +don't work on header files). + +I modified the *.y and *.l files, but I did not regenerate because it +would cause more diffs than necessary, but if you did regenerate, it +would generate the intended modifications made to the generated files. +--- + Ghidra/Features/Decompiler/src/decompile/cpp/action.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/address.cc | 2 ++ + .../Decompiler/src/decompile/cpp/architecture.cc | 3 ++- + .../Features/Decompiler/src/decompile/cpp/bfd_arch.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/block.cc | 2 ++ + .../Decompiler/src/decompile/cpp/blockaction.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/callgraph.cc | 2 ++ + .../Decompiler/src/decompile/cpp/capability.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/codedata.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/comment.cc | 2 ++ + .../Decompiler/src/decompile/cpp/comment_ghidra.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/condexe.cc | 2 ++ + .../Decompiler/src/decompile/cpp/consolemain.cc | 6 ++---- + .../Features/Decompiler/src/decompile/cpp/context.cc | 2 ++ + .../Decompiler/src/decompile/cpp/coreaction.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc | 2 ++ + .../Decompiler/src/decompile/cpp/cpool_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/database.cc | 2 ++ + .../Decompiler/src/decompile/cpp/database_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/double.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/dynamic.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/emulate.cc | 2 ++ + .../Decompiler/src/decompile/cpp/emulateutil.cc | 2 ++ + .../Decompiler/src/decompile/cpp/filemanage.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/float.cc | 10 ++-------- + Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/funcdata.cc | 2 ++ + .../Decompiler/src/decompile/cpp/funcdata_block.cc | 2 ++ + .../Decompiler/src/decompile/cpp/funcdata_op.cc | 2 ++ + .../Decompiler/src/decompile/cpp/funcdata_varnode.cc | 2 ++ + .../Decompiler/src/decompile/cpp/ghidra_arch.cc | 2 ++ + .../Decompiler/src/decompile/cpp/ghidra_context.cc | 2 ++ + .../Decompiler/src/decompile/cpp/ghidra_process.cc | 2 ++ + .../Decompiler/src/decompile/cpp/ghidra_translate.cc | 2 ++ + .../Decompiler/src/decompile/cpp/globalcontext.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/grammar.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/heritage.cc | 2 ++ + .../Decompiler/src/decompile/cpp/ifacedecomp.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/ifaceterm.cc | 2 ++ + .../Decompiler/src/decompile/cpp/inject_ghidra.cc | 2 ++ + .../Decompiler/src/decompile/cpp/inject_sleigh.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/interface.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/jumptable.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/libdecomp.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/loadimage.cc | 2 ++ + .../Decompiler/src/decompile/cpp/loadimage_bfd.cc | 2 ++ + .../Decompiler/src/decompile/cpp/loadimage_ghidra.cc | 2 ++ + .../Decompiler/src/decompile/cpp/loadimage_xml.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/marshal.cc | 1 + + .../Features/Decompiler/src/decompile/cpp/memstate.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/op.cc | 2 ++ + .../Decompiler/src/decompile/cpp/opbehavior.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/opcodes.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/options.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/override.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/paramid.cc | 2 ++ + .../Decompiler/src/decompile/cpp/pcodecompile.cc | 2 ++ + .../Decompiler/src/decompile/cpp/pcodeinject.cc | 2 ++ + .../Decompiler/src/decompile/cpp/pcodeparse.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/pcodeparse.y | 2 ++ + .../Features/Decompiler/src/decompile/cpp/pcoderaw.cc | 2 ++ + .../Decompiler/src/decompile/cpp/prefersplit.cc | 2 ++ + .../Decompiler/src/decompile/cpp/prettyprint.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/printjava.cc | 2 ++ + .../Decompiler/src/decompile/cpp/printlanguage.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/rangeutil.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/raw_arch.cc | 2 ++ + .../Decompiler/src/decompile/cpp/ruleaction.cc | 2 ++ + .../Decompiler/src/decompile/cpp/rulecompile.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/ruleparse.y | 2 ++ + .../Features/Decompiler/src/decompile/cpp/semantics.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc | 2 ++ + .../Decompiler/src/decompile/cpp/sleigh_arch.cc | 2 ++ + .../Decompiler/src/decompile/cpp/sleighbase.cc | 2 ++ + .../Decompiler/src/decompile/cpp/sleighexample.cc | 2 ++ + .../Decompiler/src/decompile/cpp/slgh_compile.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/slghparse.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/slghparse.y | 2 ++ + .../Decompiler/src/decompile/cpp/slghpatexpress.cc | 2 ++ + .../Decompiler/src/decompile/cpp/slghpattern.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/slghscan.cc | 3 +++ + .../Features/Decompiler/src/decompile/cpp/slghscan.l | 3 +++ + .../Decompiler/src/decompile/cpp/slghsymbol.cc | 3 ++- + Ghidra/Features/Decompiler/src/decompile/cpp/space.cc | 2 ++ + .../Decompiler/src/decompile/cpp/string_ghidra.cc | 2 ++ + .../Decompiler/src/decompile/cpp/stringmanage.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/subflow.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/test.cc | 2 ++ + .../Decompiler/src/decompile/cpp/testfunction.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/transform.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/translate.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/type.cc | 2 ++ + .../Decompiler/src/decompile/cpp/typegrp_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc | 2 ++ + .../Decompiler/src/decompile/cpp/unionresolve.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/variable.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/varnode.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/xml.y | 2 ++ + .../Features/Decompiler/src/decompile/cpp/xml_arch.cc | 2 ++ + .../src/decompile/unittests/testcirclerange.cc | 2 ++ + .../Decompiler/src/decompile/unittests/testfloatemu.cc | 8 ++------ + .../src/decompile/unittests/testfuncproto.cc | 2 ++ + .../Decompiler/src/decompile/unittests/testmarshal.cc | 2 ++ + .../Decompiler/src/decompile/unittests/testtypes.cc | 2 ++ + 116 files changed, 233 insertions(+), 20 deletions(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc +index 7b1b2062a..76fc27d72 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc +@@ -18,6 +18,8 @@ + + #include "coreaction.hh" + ++using namespace std; ++ + /// Specify the name, group, and properties of the Action + /// \param f is the collection of property flags + /// \param nm is the Action name +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc +index 395fee432..2fa5c7724 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc +@@ -16,6 +16,8 @@ + #include "address.hh" + #include "translate.hh" + ++using namespace std; ++ + AttributeId ATTRIB_FIRST = AttributeId("first",27); + AttributeId ATTRIB_LAST = AttributeId("last",28); + AttributeId ATTRIB_UNIQ = AttributeId("uniq",29); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc +index fdd607cc2..ea28bda29 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc +@@ -22,9 +22,10 @@ + #endif + #ifdef CPUI_STATISTICS + #include +-using std::sqrt; + #endif + ++using namespace std; ++ + vector ArchitectureCapability::thelist; + + const uint4 ArchitectureCapability::majorversion = 5; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc +index b9a495500..a37960f9e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc +@@ -16,6 +16,8 @@ + */ + #include "bfd_arch.hh" + ++using namespace std; ++ + // Constructing this object registers capability + BfdArchitectureCapability BfdArchitectureCapability::bfdArchitectureCapability; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc +index eef4a58b9..038df3db2 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc +@@ -17,6 +17,8 @@ + #include "block.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_ALTINDEX = AttributeId("altindex",75); + AttributeId ATTRIB_DEPTH = AttributeId("depth",76); + AttributeId ATTRIB_END = AttributeId("end",77); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc +index 80265a458..9c9906f8f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc +@@ -16,6 +16,8 @@ + #include "blockaction.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// Retrieve the current edge (as a \e top FlowBlock and the index of the outgoing edge). + /// If the end-points have been collapsed together, this returns NULL. + /// The top and bottom nodes of the edge are updated to FlowBlocks in the current collapsed graph. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc +index 26406c288..6b6a8d34b 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc +@@ -16,6 +16,8 @@ + #include "callgraph.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_CALLGRAPH = ElementId("callgraph",226); + ElementId ELEM_NODE = ElementId("node",227); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc +index 87e40dbbf..481cf3378 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc +@@ -15,6 +15,8 @@ + */ + #include "capability.hh" + ++using namespace std; ++ + /// Access static vector of CapabilityPoint objects that are registered during static initialization + /// The list itself is created once on the first call to this method + /// \e after all the static initializers have run +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc +index dc8baa764..0899dc5de 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc +@@ -16,6 +16,8 @@ + #include "cast.hh" + #include "op.hh" + ++using namespace std; ++ + /// Sets the TypeFactory used to produce data-types for the arithmeticOutputStandard() method + /// \param t is the TypeFactory + void CastStrategy::setTypeFactory(TypeFactory *t) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc +index 92690f422..1ba834bd6 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc +@@ -17,6 +17,8 @@ + #include "codedata.hh" + #include "loadimage_bfd.hh" + ++using namespace std; ++ + // Constructing this registers the capability + IfaceCodeDataCapability IfaceCodeDataCapability::ifaceCodeDataCapability; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc +index b5bc0a16d..e495b734e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc +@@ -16,6 +16,8 @@ + #include "comment.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_COMMENT = ElementId("comment",86); + ElementId ELEM_COMMENTDB = ElementId("commentdb",87); + ElementId ELEM_TEXT = ElementId("text",88); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc +index 04a4c2cf0..2ba980fc0 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "comment_ghidra.hh" + ++using namespace std; ++ + CommentDatabaseGhidra::CommentDatabaseGhidra(ArchitectureGhidra *g) + : CommentDatabase() + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc +index 962f35d5d..0c41bb363 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc +@@ -15,6 +15,8 @@ + */ + #include "condexe.hh" + ++using namespace std; ++ + ConditionMarker::ConditionMarker(void) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc +index 29d2bd63b..c4a628228 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc +@@ -16,12 +16,10 @@ + #include + #include + +-using std::cin; +-using std::cout; +-using std::cerr; +- + #include "libdecomp.hh" + ++using namespace std; ++ + class IfcLoadFile : public IfaceDecompCommand { + public: + virtual void execute(istream &s); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc +index 51157f3a7..19ab8ddfa 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc +@@ -17,6 +17,8 @@ + #include "slghsymbol.hh" + #include "translate.hh" + ++using namespace std; ++ + ParserContext::ParserContext(ContextCache *ccache,Translate *trans) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc +index 1cbb3c039..0fba98fb3 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc +@@ -18,6 +18,8 @@ + #include "double.hh" + #include "subflow.hh" + ++using namespace std; ++ + /// \brief A stack equation + struct StackEqn { + int4 var1; ///< Variable with 1 coefficient +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc +index 6e2b88a06..f41a8f745 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc +@@ -16,6 +16,8 @@ + #include "cover.hh" + #include "block.hh" + ++using namespace std; ++ + const CoverBlock Cover::emptyBlock; + + /// PcodeOp objects and a CoverBlock start/stop boundaries have +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc +index 42b1531ad..8e1fd1150 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc +@@ -15,6 +15,8 @@ + */ + #include "cpool.hh" + ++using namespace std; ++ + AttributeId ATTRIB_A = AttributeId("a",80); + AttributeId ATTRIB_B = AttributeId("b",81); + AttributeId ATTRIB_LENGTH = AttributeId("length",82); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc +index e8dee8256..1da445915 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "cpool_ghidra.hh" + ++using namespace std; ++ + ConstantPoolGhidra::ConstantPoolGhidra(ArchitectureGhidra *g) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc +index 2881ab711..3c68cb3ba 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc +@@ -16,6 +16,8 @@ + */ + #include "crc32.hh" + ++using namespace std; ++ + // Table for bytewise calculation of a 32-bit Cyclic Redundancy Check + uint4 crc32tab[] = { + 0x0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f, +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc +index eaf2c498d..d3f5805ee 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc +@@ -18,6 +18,8 @@ + #include "crc32.hh" + #include + ++using namespace std; ++ + AttributeId ATTRIB_CAT = AttributeId("cat",61); + AttributeId ATTRIB_FIELD = AttributeId("field",62); + AttributeId ATTRIB_MERGE = AttributeId("merge",63); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc +index 35030ffe0..93d390f97 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc +@@ -16,6 +16,8 @@ + #include "database_ghidra.hh" + #include "funcdata.hh" + ++using namespace std; ++ + Scope *ScopeGhidra::buildSubScope(uint8 id,const string &nm) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc +index ce5706bcd..14ad6929e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc +@@ -15,6 +15,8 @@ + */ + #include "double.hh" + ++using namespace std; ++ + /// Internally, the \b lo and \b hi Varnodes are set to null, and the \b val field + /// holds the constant value. + /// \param sz is the size in bytes of the constant +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc +index 3656c0df5..16dfa25ca 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc +@@ -17,6 +17,8 @@ + #include "funcdata.hh" + #include "crc32.hh" + ++using namespace std; ++ + // Table for how to hash opcodes, lumps certain operators (i.e. ADD SUB PTRADD PTRSUB) into one hash + // zero indicates the operator should be skipped + const uint4 DynamicHash::transtable[] = { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc +index 88936cedd..5025d952d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc +@@ -15,6 +15,8 @@ + */ + #include "emulate.hh" + ++using namespace std; ++ + /// Any time the emulator is about to execute a user-defined pcode op with the given name, + /// the indicated breakpoint is invoked first. The break table does \e not assume responsibility + /// for freeing the breakpoint object. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc +index fe37a7be2..8e022e3a3 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc +@@ -16,6 +16,8 @@ + #include "architecture.hh" + #include "emulateutil.hh" + ++using namespace std; ++ + /// \param g is the Architecture providing the LoadImage + EmulatePcodeOp::EmulatePcodeOp(Architecture *g) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc +index 9ab665cd3..56cd2620f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc +@@ -29,6 +29,8 @@ extern "C" { + } + #endif + ++using namespace std; ++ + // Path name separator + #ifdef _WINDOWS + char FileManage::separator = '\\'; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc +index 115d69749..36bf119e5 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc +@@ -19,14 +19,8 @@ + + #include + #include +-using std::ldexp; +-using std::frexp; +-using std::signbit; +-using std::sqrt; +-using std::floor; +-using std::ceil; +-using std::round; +-using std::fabs; ++ ++using namespace std; + + /// Set format for a given encoding size according to IEEE 754 standards + /// \param sz is the size of the encoding in bytes +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc +index 9235d71c7..7180167a9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc +@@ -15,6 +15,8 @@ + */ + #include "flow.hh" + ++using namespace std; ++ + /// Prepare for tracing flow for a new function. + /// The Funcdata object and references to its internal containers must be explicitly given. + /// \param d is the new function to trace +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc +index 95ab4b0ee..47b3c4564 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc +@@ -16,6 +16,8 @@ + #include "fspec.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_CUSTOM = AttributeId("custom",114); + AttributeId ATTRIB_DOTDOTDOT = AttributeId("dotdotdot",115); + AttributeId ATTRIB_EXTENSION = AttributeId("extension",116); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc +index 24756f0b7..5dd98c243 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc +@@ -15,6 +15,8 @@ + */ + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_NOCODE = AttributeId("nocode",84); + + ElementId ELEM_AST = ElementId("ast",115); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc +index d67f5252c..70e9db13a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc +@@ -16,6 +16,8 @@ + #include "funcdata.hh" + #include "flow.hh" + ++using namespace std; ++ + // Funcdata members pertaining directly to blocks + + /// A description of each block in the current structure hierarchy is +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc +index d546e58b6..6a4d8be41 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc +@@ -16,6 +16,8 @@ + #include "funcdata.hh" + #include "flow.hh" + ++using namespace std; ++ + // Funcdata members pertaining directly to ops + + /// \param op is the given PcodeOp +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc +index 70acfad8f..d68294476 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc +@@ -15,6 +15,8 @@ + */ + #include "funcdata.hh" + ++using namespace std; ++ + // Funcdata members pertaining directly to varnodes + + /// Properties of a given storage location are gathered from symbol information and +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc +index b5dd6c469..68e33edff 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc +@@ -23,6 +23,8 @@ + #include "cpool_ghidra.hh" + #include "inject_ghidra.hh" + ++using namespace std; ++ + //AttributeId ATTRIB_BADDATA = AttributeId("baddata",145); + + ElementId ELEM_COMMAND_ISNAMEUSED = ElementId("command_isnameused",239); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc +index 226c3249c..80106670a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc +@@ -15,6 +15,8 @@ + */ + #include "ghidra_context.hh" + ++using namespace std; ++ + const TrackedSet &ContextGhidra::getTrackedSet(const Address &addr) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc +index a2cc2299b..e1a7f57cd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc +@@ -22,6 +22,8 @@ + #include + #endif + ++using namespace std; ++ + #ifdef __REMOTE_SOCKET__ + + #include "ifacedecomp.hh" +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc +index dd2c0274a..bb5211a8f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc +@@ -16,6 +16,8 @@ + #include "ghidra_translate.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// \brief Associate a Varnode with a register name + /// + /// \param nm is the register name +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc +index 15badbad3..a70ec2686 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc +@@ -15,6 +15,8 @@ + */ + #include "globalcontext.hh" + ++using namespace std; ++ + ElementId ELEM_CONTEXT_DATA = ElementId("context_data",120); + ElementId ELEM_CONTEXT_POINTS = ElementId("context_points",121); + ElementId ELEM_CONTEXT_POINTSET = ElementId("context_pointset",122); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc +index aab637f39..a87932dc8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc +@@ -89,6 +89,8 @@ + + #include "grammar.hh" + ++using namespace std; ++ + extern int yylex(void); + extern int yyerror(const char *str); + static CParse *parse; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y +index f210843fd..f9b3cca31 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y +@@ -16,6 +16,8 @@ + %{ + #include "grammar.hh" + ++using namespace std; ++ + extern int yylex(void); + extern int yyerror(const char *str); + static CParse *parse; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc +index 20d7cd196..31b69addd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc +@@ -16,6 +16,8 @@ + */ + #include "graph.hh" + ++using namespace std; ++ + static void print_varnode_vertex(Varnode *vn,ostream &s) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc +index 0630e8bba..4ebf76dee 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc +@@ -17,6 +17,8 @@ + #include "funcdata.hh" + #include "prefersplit.hh" + ++using namespace std; ++ + /// Update disjoint cover making sure (addr,size) is contained in a single element and return + /// an iterator to this element. The element's \b pass number is set to be the smallest value + /// of any previous intersecting element. Additionally an \b intersect code is passed back: +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc +index fd0087cb6..a77e075f8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc +@@ -20,6 +20,8 @@ extern "C" { + #include "pcodeparse.hh" + #include "blockaction.hh" + ++using namespace std; ++ + // Constructing this registers the capability + IfaceDecompCapability IfaceDecompCapability::ifaceDecompCapability; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc +index 44a584305..ebcf1fcfd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc +@@ -15,6 +15,8 @@ + */ + #include "ifaceterm.hh" + ++using namespace std; ++ + IfaceTerm::IfaceTerm(const string &prmpt,istream &is,ostream &os) + : IfaceStatus(prmpt,os) + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc +index 1f14d2a55..02df9e9ad 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "inject_ghidra.hh" + ++using namespace std; ++ + void InjectContextGhidra::encode(Encoder &encoder) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc +index e37e3f469..137d0402c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc +@@ -17,6 +17,8 @@ + #include "pcodeparse.hh" + #include "architecture.hh" + ++using namespace std; ++ + InjectContextSleigh::~InjectContextSleigh(void) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc +index 8ac61f889..977703bbd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc +@@ -21,6 +21,8 @@ + #include "ext/stdio_filebuf.h" + #endif + ++using namespace std; ++ + vector IfaceCapability::thelist; + + void IfaceCapability::initialize(void) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc +index 47d220df0..732f4bca9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc +@@ -17,6 +17,8 @@ + #include "emulate.hh" + #include "flow.hh" + ++using namespace std; ++ + AttributeId ATTRIB_LABEL = AttributeId("label",131); + AttributeId ATTRIB_NUM = AttributeId("num",132); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc +index b60a349fe..81ab37960 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc +@@ -15,6 +15,8 @@ + */ + #include "libdecomp.hh" + ++using namespace std; ++ + void startDecompilerLibrary(const char *sleighhome) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc +index e14109b32..bba3e9674 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc +@@ -15,6 +15,8 @@ + */ + #include "loadimage.hh" + ++using namespace std; ++ + /// This is a convenience method wrapped around the core + /// loadFill() routine. It automatically allocates an array + /// of the desired size, and then fills it with load image data. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc +index 7e9f1ad8a..6009dde95 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc +@@ -16,6 +16,8 @@ + */ + #include "loadimage_bfd.hh" + ++using namespace std; ++ + int4 LoadImageBfd::bfdinit = 0; // Global initialization variable + + LoadImageBfd::LoadImageBfd(const string &f,const string &t) : LoadImage(f) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc +index 069a1f956..2ede5182b 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "loadimage_ghidra.hh" + ++using namespace std; ++ + LoadImageGhidra::LoadImageGhidra(ArchitectureGhidra *g) + : LoadImage("ghidra_progam") + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc +index b7a9a30c4..0de974108 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc +@@ -16,6 +16,8 @@ + #include "loadimage_xml.hh" + #include "translate.hh" + ++using namespace std; ++ + AttributeId ATTRIB_ARCH = AttributeId("arch",135); + + ElementId ELEM_BINARYIMAGE = ElementId("binaryimage",230); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc +index 9be7a178f..15ba002ab 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc +@@ -17,6 +17,7 @@ + #include "translate.hh" + + using namespace PackedFormat; ++using namespace std; + + unordered_map AttributeId::lookupAttributeId; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc +index be9a570a0..621e2dda9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc +@@ -16,6 +16,8 @@ + #include "memstate.hh" + #include "translate.hh" + ++using namespace std; ++ + /// This is a static convenience routine for decoding a value from a sequence of bytes depending + /// on the desired endianness + /// \param ptr is the pointer to the bytes to decode +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc +index 096fbbf53..4bdaa5a22 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc +@@ -16,6 +16,8 @@ + #include "merge.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// This instance assumes the identity of the given Varnode and the defining index is + /// cached to facilitate quick sorting. + /// \param v is the given Varnode +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc +index 24551ed11..36ed97bc6 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc +@@ -16,6 +16,8 @@ + #include "op.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_IOP = ElementId("iop",113); + ElementId ELEM_UNIMPL = ElementId("unimpl",114); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc +index 3e0c39904..f3dcaed3c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc +@@ -16,6 +16,8 @@ + #include "opbehavior.hh" + #include "translate.hh" + ++using namespace std; ++ + /// This routine generates a vector of OpBehavior objects indexed by opcode + /// \param inst is the vector of behaviors to be filled + /// \param trans is the translator object needed by the floating point behaviors +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc +index d116fe62d..100236b1e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc +@@ -16,6 +16,8 @@ + #include "opcodes.hh" + #include "types.h" + ++using namespace std; ++ + /// \brief Names of operations associated with their opcode number + /// + /// Some of the names have been replaced with special placeholder +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc +index 0ee439e44..ab042112c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc +@@ -18,6 +18,8 @@ + #include "flow.hh" + #include "printc.hh" + ++using namespace std; ++ + ElementId ELEM_ALIASBLOCK = ElementId("aliasblock",174); + ElementId ELEM_ALLOWCONTEXTSET = ElementId("allowcontextset",175); + ElementId ELEM_ANALYZEFORLOOPS = ElementId("analyzeforloops",176); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc +index f64cb03ca..ca5d726c9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc +@@ -16,6 +16,8 @@ + #include "override.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_DEADCODEDELAY = ElementId("deadcodedelay",218); + ElementId ELEM_FLOW = ElementId("flow",219); + ElementId ELEM_FORCEGOTO = ElementId("forcegoto",220); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc +index 093a8b232..4ba724490 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc +@@ -15,6 +15,8 @@ + */ + #include "paramid.hh" + ++using namespace std; ++ + ElementId ELEM_PARAMMEASURES = ElementId("parammeasures",106); + ElementId ELEM_PROTO = ElementId("proto",107); + ElementId ELEM_RANK = ElementId("rank",108); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc +index 133da8178..ce8a0f834 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc +@@ -15,6 +15,8 @@ + */ + #include "pcodecompile.hh" + ++using namespace std; ++ + string Location::format(void) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc +index 7a317f47f..d6678a5ca 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc +@@ -16,6 +16,8 @@ + #include "pcodeinject.hh" + #include "architecture.hh" + ++using namespace std; ++ + AttributeId ATTRIB_DYNAMIC = AttributeId("dynamic",70); + AttributeId ATTRIB_INCIDENTALCOPY = AttributeId("incidentalcopy",71); + AttributeId ATTRIB_INJECT = AttributeId("inject",72); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc +index c562c0f83..4d67e8a6e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc +@@ -89,6 +89,8 @@ + + #include "pcodeparse.hh" + ++using namespace std; ++ + //#define YYERROR_VERBOSE + extern int yylex(void); + static PcodeSnippet *pcode; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y +index c858fa148..46480a5ad 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y +@@ -16,6 +16,8 @@ + %{ + #include "pcodeparse.hh" + ++using namespace std; ++ + //#define YYERROR_VERBOSE + extern int yylex(void); + static PcodeSnippet *pcode; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc +index 317d4dbf1..5221185f8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc +@@ -16,6 +16,8 @@ + #include "pcoderaw.hh" + #include "translate.hh" + ++using namespace std; ++ + /// Build this VarnodeData from an \, \, or \ element. + /// \param decoder is the stream decoder + void VarnodeData::decode(Decoder &decoder) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc +index 635941885..e1267e610 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc +@@ -16,6 +16,8 @@ + #include "prefersplit.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_PREFERSPLIT = ElementId("prefersplit",225); + + bool PreferSplitRecord::operator<(const PreferSplitRecord &op2) const +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc +index 388708030..fa631ccf1 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc +@@ -16,6 +16,8 @@ + #include "prettyprint.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_BLOCKREF = AttributeId("blockref",35); + AttributeId ATTRIB_CLOSE = AttributeId("close",36); + AttributeId ATTRIB_COLOR = AttributeId("color",37); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc +index d93f044fb..d85e51e8b 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc +@@ -16,6 +16,8 @@ + #include "printc.hh" + #include "funcdata.hh" + ++using namespace std; ++ + // Operator tokens for expressions + // token #in prec assoc optype space bump + OpToken PrintC::hidden = { "", "", 1, 70, false, OpToken::hiddenfunction, 0, 0, (OpToken *)0 }; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc +index 473bab08a..a193e8688 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc +@@ -16,6 +16,8 @@ + #include "printjava.hh" + #include "funcdata.hh" + ++using namespace std; ++ + OpToken PrintJava::instanceof = { "instanceof", "", 2, 60, true, OpToken::binary, 1, 0, (OpToken *)0 }; + + // Constructing this registers the capability +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc +index aad62c9f4..f48592204 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc +@@ -17,6 +17,8 @@ + #include "printlanguage.hh" + #include "funcdata.hh" + ++using namespace std; ++ + const string PrintLanguage::OPEN_PAREN = "("; + const string PrintLanguage::CLOSE_PAREN = ")"; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc +index d98998426..3d17317f8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc +@@ -16,6 +16,8 @@ + #include "rangeutil.hh" + #include "block.hh" + ++using namespace std; ++ + const char CircleRange::arrange[] = "gcgbegdagggggggeggggcgbggggggggcdfgggggggegdggggbgggfggggcgbegda"; + + /// All the instantiations where left == right represent the same set. We +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc +index 3b83cf3ce..aab606e5d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc +@@ -15,6 +15,8 @@ + */ + #include "raw_arch.hh" + ++using namespace std; ++ + ElementId ELEM_RAW_SAVEFILE = ElementId("raw_savefile",237); + + // Constructing this object registers the capability +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc +index 216f2f45f..2f26d8fd2 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc +@@ -18,6 +18,8 @@ + #include "subflow.hh" + #include "rangeutil.hh" + ++using namespace std; ++ + /// \class RuleEarlyRemoval + /// \brief Get rid of unused PcodeOp objects where we can guarantee the output is unused + int4 RuleEarlyRemoval::applyOp(PcodeOp *op,Funcdata &data) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc +index af4e191c7..eeb7cc1f7 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc +@@ -17,6 +17,8 @@ + #include "rulecompile.hh" + #include "ruleparse.hh" + ++using namespace std; ++ + RuleCompile *rulecompile; + extern int4 ruleparsedebug; + extern int4 ruleparseparse(void); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y +index 3d3ced687..aceb52b9a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y +@@ -17,6 +17,8 @@ + #ifdef CPUI_RULECOMPILE + #include "rulecompile.hh" + ++using namespace std; ++ + #define YYERROR_VERBOSE + + extern RuleCompile *rulecompile; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc +index 1c9ab7560..a791a3348 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc +@@ -16,6 +16,8 @@ + #include "semantics.hh" + #include "translate.hh" + ++using namespace std; ++ + ConstTpl::ConstTpl(const_type tp) + + { // Constructor for relative jump constants and uniques +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc +index 0fd86e645..b33cf85d2 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc +@@ -16,6 +16,8 @@ + #include "sleigh.hh" + #include "loadimage.hh" + ++using namespace std; ++ + PcodeCacher::PcodeCacher(void) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc +index aebec0e4c..4ff7b336d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc +@@ -16,6 +16,8 @@ + #include "sleigh_arch.hh" + #include "inject_sleigh.hh" + ++using namespace std; ++ + AttributeId ATTRIB_DEPRECATED = AttributeId("deprecated",136); + AttributeId ATTRIB_ENDIAN = AttributeId("endian",137); + AttributeId ATTRIB_PROCESSOR = AttributeId("processor",138); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc +index 6b170df8e..4511dbb65 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc +@@ -15,6 +15,8 @@ + */ + #include "sleighbase.hh" + ++using namespace std; ++ + const int4 SleighBase::SLA_FORMAT_VERSION = 3; + + const uint4 SleighBase::MAX_UNIQUE_SIZE = 128; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc +index 87a4d7980..3ed0c3390 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc +@@ -22,6 +22,8 @@ + #include "emulate.hh" + #include + ++using namespace std; ++ + // These are the bytes for an example x86 binary + // These bytes are loaded at address 0x80483b4 + static uint1 myprog[] = { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc +index ac9a70c93..b64b3dc11 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc +@@ -17,6 +17,8 @@ + #include "filemanage.hh" + #include + ++using namespace std; ++ + SleighCompile *slgh; // Global pointer to sleigh object for use with parser + #ifdef YYDEBUG + extern int yydebug; // Global debugging state for parser +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc +index 746d70a81..bd4aa1b77 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc +@@ -81,6 +81,8 @@ + + #include "slgh_compile.hh" + ++using namespace std; ++ + #define YYERROR_VERBOSE + + extern SleighCompile *slgh; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +index b3fedb7b6..0e2172f79 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +@@ -16,6 +16,8 @@ + %{ + #include "slgh_compile.hh" + ++using namespace std; ++ + #define YYERROR_VERBOSE + + extern SleighCompile *slgh; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc +index 3b7534f09..f6f4f029d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc +@@ -16,6 +16,8 @@ + #include "slghpatexpress.hh" + #include "sleighbase.hh" + ++using namespace std; ++ + int4 TokenPattern::resolveTokens(const TokenPattern &tok1,const TokenPattern &tok2) + + { // Use the token lists to decide how the two patterns +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc +index 4ebeaa000..9cb0803eb 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc +@@ -15,6 +15,8 @@ + */ + #include "slghpattern.hh" + ++using namespace std; ++ + uintm DisjointPattern::getMask(int4 startbit,int4 size,bool context) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc +index 1ac87e2cd..20cbf21e4 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc +@@ -888,6 +888,9 @@ char *yytext; + #line 18 "slghscan.l" + #include "slgh_compile.hh" + #include "slghparse.hh" ++ ++using namespace std; ++ + #define yywrap() 1 + #define YY_SKIP_YYWRAP + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l +index 2df137019..f2341ef09 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l +@@ -17,6 +17,9 @@ + %{ + #include "slgh_compile.hh" + #include "slghparse.hh" ++ ++using namespace std; ++ + #define yywrap() 1 + #define YY_SKIP_YYWRAP + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc +index 352a0ae99..22dc50d0d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc +@@ -16,7 +16,8 @@ + #include "slghsymbol.hh" + #include "sleighbase.hh" + #include +-using std::log; ++ ++using namespace std; + + SleighSymbol *SymbolScope::addSymbol(SleighSymbol *a) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc +index 4ae8f18a6..169437ca6 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc +@@ -18,6 +18,8 @@ + + #include + ++using namespace std; ++ + AttributeId ATTRIB_BASE = AttributeId("base",89); + AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90); + AttributeId ATTRIB_DELAY = AttributeId("delay", 91); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc +index 080f543ce..eb10514d1 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "string_ghidra.hh" + ++using namespace std; ++ + GhidraStringManager::GhidraStringManager(ArchitectureGhidra *g,int4 max) + : StringManager(max) + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc +index 220210a1c..a1324ca46 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc +@@ -16,6 +16,8 @@ + #include "stringmanage.hh" + #include "architecture.hh" + ++using namespace std; ++ + AttributeId ATTRIB_TRUNC = AttributeId("trunc",69); + + ElementId ELEM_BYTES = ElementId("bytes",83); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc +index 8f6835b3f..2a79f2942 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc +@@ -15,6 +15,8 @@ + */ + #include "subflow.hh" + ++using namespace std; ++ + /// \brief Return \e slot of constant if INT_OR op sets all bits in mask, otherwise -1 + /// + /// \param orop is the given CPUI_INT_OR op +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc +index e1b6a04c7..bf890ae5f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc +@@ -16,6 +16,8 @@ + #include "test.hh" + #include "libdecomp.hh" + ++using namespace std; ++ + vector UnitTest::tests; + + /// Run all the tests unless a non-empty set of names is passed in. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc +index 38137ffd4..a39680854 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc +@@ -15,6 +15,8 @@ + */ + #include "ifacedecomp.hh" + ++using namespace std; ++ + void FunctionTestProperty::startTest(void) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc +index 3c594169d..2e42baac0 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc +@@ -16,6 +16,8 @@ + #include "transform.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_VECTOR_LANE_SIZES = AttributeId("vector_lane_sizes",130); + + /// \param op2 is the lane description to copy from +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc +index 61b8cc108..0eecb6cbc 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc +@@ -15,6 +15,8 @@ + */ + #include "translate.hh" + ++using namespace std; ++ + AttributeId ATTRIB_CODE = AttributeId("code",43); + AttributeId ATTRIB_CONTAIN = AttributeId("contain",44); + AttributeId ATTRIB_DEFAULTSPACE = AttributeId("defaultspace",45); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +index 8b75afb6d..18df2c557 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +@@ -16,6 +16,8 @@ + #include "type.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// The base propagation ordering associated with each meta-type. + /// The array elements correspond to the ordering of #type_metatype. + sub_metatype Datatype::base2sub[15] = { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc +index 351e3df1a..dcc279aaf 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "typegrp_ghidra.hh" + ++using namespace std; ++ + Datatype *TypeFactoryGhidra::findById(const string &n,uint8 id,int4 sz) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc +index 93970319f..2d19545f3 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc +@@ -16,6 +16,8 @@ + #include "typeop.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// \param inst will hold the array of TypeOp objects, indexed on op-code + /// \param tlst is the corresponding TypeFactory for the Architecture + /// \param trans is the Translate object for floating-point formats +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc +index d848cfc7d..4caefde8d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc +@@ -16,6 +16,8 @@ + #ifdef CPUI_RULECOMPILE + #include "unify.hh" + ++using namespace std; ++ + UnifyDatatype::UnifyDatatype(uint4 tp) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc +index 940d33322..055662fb9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc +@@ -16,6 +16,8 @@ + #include "unionresolve.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// The original parent must either be a union, a pointer to a union, or a partial union. + /// The object is set up initially to resolve to the parent. + /// \param parent is the original parent data-type +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc +index e60353941..d32919020 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc +@@ -16,6 +16,8 @@ + #include "userop.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_FARPOINTER = AttributeId("farpointer",85); + AttributeId ATTRIB_INPUTOP = AttributeId("inputop",86); + AttributeId ATTRIB_OUTPUTOP = AttributeId("outputop",87); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc +index c3b89df4c..156f1824e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc +@@ -17,6 +17,8 @@ + #include "op.hh" + #include "database.hh" + ++using namespace std; ++ + AttributeId ATTRIB_CLASS = AttributeId("class",66); + AttributeId ATTRIB_REPREF = AttributeId("repref",67); + AttributeId ATTRIB_SYMREF = AttributeId("symref",68); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc +index 76f4ed86f..9674c5dfe 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc +@@ -16,6 +16,8 @@ + #include "varmap.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_LOCK = AttributeId("lock",133); + AttributeId ATTRIB_MAIN = AttributeId("main",134); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc +index 713fe9851..967d8b6fe 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc +@@ -16,6 +16,8 @@ + #include "varnode.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_ADDRTIED = AttributeId("addrtied",30); + AttributeId ATTRIB_GRP = AttributeId("grp",31); + AttributeId ATTRIB_INPUT = AttributeId("input",32); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc +index fc4d1bf61..68778c5ca 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc +@@ -98,6 +98,8 @@ + #include + #include + ++using namespace std; ++ + string Attributes::bogus_uri("http://unused.uri"); + + /// \brief The XML character scanner +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y +index 8f5386237..5d5f702cc 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y +@@ -25,6 +25,8 @@ + #include + #include + ++using namespace std; ++ + string Attributes::bogus_uri("http://unused.uri"); + + /// \brief The XML character scanner +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc +index c5c533ba9..21e6e390a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc +@@ -15,6 +15,8 @@ + */ + #include "xml_arch.hh" + ++using namespace std; ++ + ElementId ELEM_XML_SAVEFILE = ElementId("xml_savefile",236); + + // Constructing the singleton registers the capability +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc +index a8bf58ec5..6dcfc7930 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc +@@ -16,6 +16,8 @@ + #include "architecture.hh" + #include "test.hh" + ++using namespace std; ++ + class CircleRangeTestEnvironment { + Architecture *g; + public: +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc +index 3b16ed13c..3583ca69d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc +@@ -25,12 +25,8 @@ + #include + + #include +-using std::isnan; +-using std::sqrt; +-using std::floor; +-using std::ceil; +-using std::round; +-using std::abs; ++ ++using namespace std; + + // utility functions + float floatFromRawBits(uintb e) { +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc +index 417f53e7b..879f0e7e7 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfuncproto.cc +@@ -18,6 +18,8 @@ + #include "test.hh" + #include + ++using namespace std; ++ + class FuncProtoTestEnvironment { + Architecture *g; + ProtoModel *mod1; +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc +index 26c7d62d7..f409f4cb9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc +@@ -16,6 +16,8 @@ + #include "translate.hh" + #include "test.hh" + ++using namespace std; ++ + class TestAddrSpaceManager : public AddrSpaceManager { + public: + TestAddrSpaceManager(Translate *t); +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc +index 4ce7cdde6..1ac3c3d5f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc +@@ -18,6 +18,8 @@ + #include "test.hh" + #include + ++using namespace std; ++ + static Architecture *glb; + static TypeFactory *types; + static CastStrategy *strategy; +-- +2.40.0 + diff --git a/src/patches/HEAD/0004-Remove-using-namespace-std-from-headers.patch b/src/patches/HEAD/0005-2-4-decompiler-Automated-std-namespace-fix-with-remu.patch similarity index 91% rename from src/patches/HEAD/0004-Remove-using-namespace-std-from-headers.patch rename to src/patches/HEAD/0005-2-4-decompiler-Automated-std-namespace-fix-with-remu.patch index 90bc480..5a443f9 100644 --- a/src/patches/HEAD/0004-Remove-using-namespace-std-from-headers.patch +++ b/src/patches/HEAD/0005-2-4-decompiler-Automated-std-namespace-fix-with-remu.patch @@ -1,240 +1,113 @@ -From b19e8d846cb65f476d1accb4f33943d0cc2c79bf Mon Sep 17 00:00:00 2001 +From 4fa958b887c0f77ae9d87ffce5b1e54eff70b05f Mon Sep 17 00:00:00 2001 From: Eric Kilmer -Date: Wed, 2 Nov 2022 19:41:19 -0400 -Subject: [PATCH 4/4] Remove 'using namespace std' from headers +Date: Wed, 15 Mar 2023 23:09:42 -0400 +Subject: [PATCH 5/7] (2/4) decompiler: Automated std namespace fix with + remusing tool -Still uses it in source files to reduce diff and ease transition. - -I did not regenerate the files because it would cause more diffs than -necessary. +The remusing tool uses a heuristic to search for and add a prefix to +unqualified symbols that came from the C++ standard library. --- - .../Decompiler/src/decompile/cpp/action.cc | 2 + .../Decompiler/src/decompile/cpp/action.hh | 122 ++-- - .../Decompiler/src/decompile/cpp/address.cc | 2 + .../Decompiler/src/decompile/cpp/address.hh | 24 +- - .../src/decompile/cpp/architecture.cc | 2 + .../src/decompile/cpp/architecture.hh | 62 +- - .../Decompiler/src/decompile/cpp/bfd_arch.cc | 2 + .../Decompiler/src/decompile/cpp/bfd_arch.hh | 6 +- - .../Decompiler/src/decompile/cpp/block.cc | 2 + .../Decompiler/src/decompile/cpp/block.hh | 120 ++-- - .../src/decompile/cpp/blockaction.cc | 2 + .../src/decompile/cpp/blockaction.hh | 78 +-- - .../Decompiler/src/decompile/cpp/callgraph.cc | 2 + .../Decompiler/src/decompile/cpp/callgraph.hh | 20 +- - .../src/decompile/cpp/capability.cc | 2 + - .../src/decompile/cpp/capability.hh | 4 +- - .../Decompiler/src/decompile/cpp/cast.cc | 2 + - .../Decompiler/src/decompile/cpp/codedata.cc | 2 + + .../src/decompile/cpp/capability.hh | 5 +- .../Decompiler/src/decompile/cpp/codedata.hh | 56 +- - .../Decompiler/src/decompile/cpp/comment.cc | 2 + .../Decompiler/src/decompile/cpp/comment.hh | 28 +- - .../src/decompile/cpp/comment_ghidra.cc | 2 + .../src/decompile/cpp/comment_ghidra.hh | 4 +- - .../Decompiler/src/decompile/cpp/condexe.cc | 2 + .../Decompiler/src/decompile/cpp/condexe.hh | 12 +- - .../src/decompile/cpp/consolemain.cc | 2 + - .../Decompiler/src/decompile/cpp/context.cc | 2 + .../Decompiler/src/decompile/cpp/context.hh | 14 +- - .../src/decompile/cpp/coreaction.cc | 2 + - .../src/decompile/cpp/coreaction.hh | 162 ++--- - .../Decompiler/src/decompile/cpp/cover.cc | 2 + + .../src/decompile/cpp/coreaction.hh | 166 +++--- .../Decompiler/src/decompile/cpp/cover.hh | 12 +- - .../Decompiler/src/decompile/cpp/cpool.cc | 2 + .../Decompiler/src/decompile/cpp/cpool.hh | 22 +- - .../src/decompile/cpp/cpool_ghidra.cc | 2 + .../src/decompile/cpp/cpool_ghidra.hh | 4 +- - .../Decompiler/src/decompile/cpp/crc32.cc | 2 + - .../Decompiler/src/decompile/cpp/database.cc | 2 + .../Decompiler/src/decompile/cpp/database.hh | 152 ++--- - .../src/decompile/cpp/database_ghidra.cc | 2 + .../src/decompile/cpp/database_ghidra.hh | 32 +- - .../Decompiler/src/decompile/cpp/double.cc | 2 + .../Decompiler/src/decompile/cpp/double.hh | 26 +- - .../Decompiler/src/decompile/cpp/dynamic.cc | 2 + .../Decompiler/src/decompile/cpp/dynamic.hh | 14 +- - .../Decompiler/src/decompile/cpp/emulate.cc | 2 + .../Decompiler/src/decompile/cpp/emulate.hh | 22 +- - .../src/decompile/cpp/emulateutil.cc | 2 + .../src/decompile/cpp/emulateutil.hh | 8 +- - .../Decompiler/src/decompile/cpp/error.hh | 10 +- - .../src/decompile/cpp/filemanage.cc | 2 + - .../src/decompile/cpp/filemanage.hh | 30 +- - .../Decompiler/src/decompile/cpp/float.cc | 2 + + .../Decompiler/src/decompile/cpp/error.hh | 38 +- + .../src/decompile/cpp/filemanage.hh | 33 +- .../Decompiler/src/decompile/cpp/float.hh | 2 +- - .../Decompiler/src/decompile/cpp/flow.cc | 2 + .../Decompiler/src/decompile/cpp/flow.hh | 32 +- - .../Decompiler/src/decompile/cpp/fspec.cc | 2 + - .../Decompiler/src/decompile/cpp/fspec.hh | 154 ++--- - .../Decompiler/src/decompile/cpp/funcdata.cc | 2 + + .../Decompiler/src/decompile/cpp/fspec.hh | 162 +++--- .../Decompiler/src/decompile/cpp/funcdata.hh | 86 +-- - .../src/decompile/cpp/funcdata_block.cc | 2 + - .../src/decompile/cpp/funcdata_op.cc | 2 + - .../src/decompile/cpp/funcdata_varnode.cc | 2 + - .../src/decompile/cpp/ghidra_arch.cc | 2 + - .../src/decompile/cpp/ghidra_arch.hh | 64 +- - .../src/decompile/cpp/ghidra_context.cc | 2 + + .../src/decompile/cpp/ghidra_arch.hh | 64 +-- .../src/decompile/cpp/ghidra_context.hh | 10 +- - .../src/decompile/cpp/ghidra_process.cc | 2 + - .../src/decompile/cpp/ghidra_process.hh | 26 +- - .../src/decompile/cpp/ghidra_translate.cc | 2 + + .../src/decompile/cpp/ghidra_process.hh | 27 +- .../src/decompile/cpp/ghidra_translate.hh | 14 +- - .../src/decompile/cpp/globalcontext.cc | 2 + .../src/decompile/cpp/globalcontext.hh | 34 +- - .../Decompiler/src/decompile/cpp/grammar.cc | 2 + .../Decompiler/src/decompile/cpp/grammar.hh | 140 ++--- - .../Decompiler/src/decompile/cpp/graph.cc | 2 + .../Decompiler/src/decompile/cpp/graph.hh | 6 +- - .../Decompiler/src/decompile/cpp/heritage.cc | 2 + .../Decompiler/src/decompile/cpp/heritage.hh | 80 +-- - .../src/decompile/cpp/ifacedecomp.cc | 2 + - .../src/decompile/cpp/ifacedecomp.hh | 238 ++++---- - .../Decompiler/src/decompile/cpp/ifaceterm.cc | 2 + + .../src/decompile/cpp/ifacedecomp.hh | 240 ++++---- .../Decompiler/src/decompile/cpp/ifaceterm.hh | 12 +- - .../src/decompile/cpp/inject_ghidra.cc | 2 + .../src/decompile/cpp/inject_ghidra.hh | 28 +- - .../src/decompile/cpp/inject_sleigh.cc | 2 + .../src/decompile/cpp/inject_sleigh.hh | 50 +- - .../Decompiler/src/decompile/cpp/interface.cc | 2 + - .../Decompiler/src/decompile/cpp/interface.hh | 104 ++-- - .../Decompiler/src/decompile/cpp/jumptable.cc | 2 + + .../Decompiler/src/decompile/cpp/interface.hh | 108 ++-- .../Decompiler/src/decompile/cpp/jumptable.hh | 76 +-- - .../Decompiler/src/decompile/cpp/libdecomp.cc | 2 + .../Decompiler/src/decompile/cpp/libdecomp.hh | 4 +- - .../Decompiler/src/decompile/cpp/loadimage.cc | 2 + .../Decompiler/src/decompile/cpp/loadimage.hh | 22 +- - .../src/decompile/cpp/loadimage_bfd.cc | 2 + .../src/decompile/cpp/loadimage_bfd.hh | 12 +- - .../src/decompile/cpp/loadimage_ghidra.cc | 2 + .../src/decompile/cpp/loadimage_ghidra.hh | 2 +- - .../src/decompile/cpp/loadimage_xml.cc | 2 + .../src/decompile/cpp/loadimage_xml.hh | 14 +- - .../Decompiler/src/decompile/cpp/marshal.cc | 1 + - .../Decompiler/src/decompile/cpp/marshal.hh | 78 ++- - .../Decompiler/src/decompile/cpp/memstate.cc | 2 + + .../Decompiler/src/decompile/cpp/marshal.hh | 97 ++-- .../Decompiler/src/decompile/cpp/memstate.hh | 12 +- - .../Decompiler/src/decompile/cpp/merge.cc | 2 + .../Decompiler/src/decompile/cpp/merge.hh | 32 +- - .../Decompiler/src/decompile/cpp/op.cc | 2 + .../Decompiler/src/decompile/cpp/op.hh | 58 +- - .../src/decompile/cpp/opbehavior.cc | 2 + .../src/decompile/cpp/opbehavior.hh | 4 +- - .../Decompiler/src/decompile/cpp/opcodes.cc | 2 + .../Decompiler/src/decompile/cpp/opcodes.hh | 4 +- - .../Decompiler/src/decompile/cpp/options.cc | 2 + .../Decompiler/src/decompile/cpp/options.hh | 82 +-- - .../Decompiler/src/decompile/cpp/override.cc | 2 + .../Decompiler/src/decompile/cpp/override.hh | 22 +- - .../Decompiler/src/decompile/cpp/paramid.cc | 2 + .../Decompiler/src/decompile/cpp/paramid.hh | 10 +- - .../Decompiler/src/decompile/cpp/partmap.hh | 11 +- - .../src/decompile/cpp/pcodecompile.cc | 2 + + .../Decompiler/src/decompile/cpp/partmap.hh | 12 +- .../src/decompile/cpp/pcodecompile.hh | 50 +- - .../src/decompile/cpp/pcodeinject.cc | 2 + .../src/decompile/cpp/pcodeinject.hh | 84 +-- - .../src/decompile/cpp/pcodeparse.cc | 2 + .../src/decompile/cpp/pcodeparse.hh | 24 +- - .../Decompiler/src/decompile/cpp/pcodeparse.y | 2 + - .../Decompiler/src/decompile/cpp/pcoderaw.cc | 2 + .../Decompiler/src/decompile/cpp/pcoderaw.hh | 2 +- - .../src/decompile/cpp/prefersplit.cc | 2 + .../src/decompile/cpp/prefersplit.hh | 8 +- - .../src/decompile/cpp/prettyprint.cc | 2 + .../src/decompile/cpp/prettyprint.hh | 144 ++--- - .../Decompiler/src/decompile/cpp/printc.cc | 2 + .../Decompiler/src/decompile/cpp/printc.hh | 72 +-- - .../Decompiler/src/decompile/cpp/printjava.cc | 2 + .../Decompiler/src/decompile/cpp/printjava.hh | 4 +- - .../src/decompile/cpp/printlanguage.cc | 2 + - .../src/decompile/cpp/printlanguage.hh | 66 +- - .../Decompiler/src/decompile/cpp/rangeutil.cc | 2 + + .../src/decompile/cpp/printlanguage.hh | 66 +-- .../Decompiler/src/decompile/cpp/rangeutil.hh | 38 +- - .../Decompiler/src/decompile/cpp/raw_arch.cc | 2 + .../Decompiler/src/decompile/cpp/raw_arch.hh | 6 +- - .../src/decompile/cpp/ruleaction.cc | 2 + - .../src/decompile/cpp/ruleaction.hh | 566 +++++++++--------- - .../src/decompile/cpp/rulecompile.cc | 2 + + .../src/decompile/cpp/ruleaction.hh | 542 +++++++++--------- .../src/decompile/cpp/rulecompile.hh | 44 +- - .../Decompiler/src/decompile/cpp/ruleparse.y | 2 + - .../Decompiler/src/decompile/cpp/semantics.cc | 2 + .../Decompiler/src/decompile/cpp/semantics.hh | 42 +- - .../Decompiler/src/decompile/cpp/sleigh.cc | 2 + - .../Decompiler/src/decompile/cpp/sleigh.hh | 22 +- - .../src/decompile/cpp/sleigh_arch.cc | 2 + + .../Decompiler/src/decompile/cpp/sleigh.hh | 10 +- .../src/decompile/cpp/sleigh_arch.hh | 82 +-- - .../src/decompile/cpp/sleighbase.cc | 2 + .../src/decompile/cpp/sleighbase.hh | 32 +- - .../src/decompile/cpp/sleighexample.cc | 2 + - .../src/decompile/cpp/slgh_compile.cc | 2 + - .../src/decompile/cpp/slgh_compile.hh | 144 ++--- - .../Decompiler/src/decompile/cpp/slghparse.cc | 2 + + .../src/decompile/cpp/slgh_compile.hh | 148 +++-- .../Decompiler/src/decompile/cpp/slghparse.hh | 14 +- - .../Decompiler/src/decompile/cpp/slghparse.y | 2 + - .../src/decompile/cpp/slghpatexpress.cc | 2 + .../src/decompile/cpp/slghpatexpress.hh | 158 ++--- - .../src/decompile/cpp/slghpattern.cc | 2 + .../src/decompile/cpp/slghpattern.hh | 22 +- - .../Decompiler/src/decompile/cpp/slghscan.cc | 3 + - .../Decompiler/src/decompile/cpp/slghscan.l | 3 + - .../src/decompile/cpp/slghsymbol.cc | 2 + .../src/decompile/cpp/slghsymbol.hh | 236 ++++---- - .../Decompiler/src/decompile/cpp/space.cc | 2 + .../Decompiler/src/decompile/cpp/space.hh | 44 +- - .../src/decompile/cpp/string_ghidra.cc | 2 + .../src/decompile/cpp/string_ghidra.hh | 2 +- - .../src/decompile/cpp/stringmanage.cc | 2 + .../src/decompile/cpp/stringmanage.hh | 12 +- - .../Decompiler/src/decompile/cpp/subflow.cc | 2 + .../Decompiler/src/decompile/cpp/subflow.hh | 18 +- - .../Decompiler/src/decompile/cpp/test.cc | 2 + - .../src/decompile/cpp/testfunction.cc | 2 + - .../src/decompile/cpp/testfunction.hh | 34 +- - .../Decompiler/src/decompile/cpp/transform.cc | 2 + + .../Decompiler/src/decompile/cpp/test.hh | 16 +- + .../src/decompile/cpp/testfunction.hh | 32 +- .../Decompiler/src/decompile/cpp/transform.hh | 16 +- - .../Decompiler/src/decompile/cpp/translate.cc | 2 + .../Decompiler/src/decompile/cpp/translate.hh | 48 +- - .../Decompiler/src/decompile/cpp/type.cc | 2 + .../Decompiler/src/decompile/cpp/type.hh | 126 ++-- - .../src/decompile/cpp/typegrp_ghidra.cc | 2 + .../src/decompile/cpp/typegrp_ghidra.hh | 2 +- - .../Decompiler/src/decompile/cpp/typeop.cc | 2 + .../Decompiler/src/decompile/cpp/typeop.hh | 82 +-- - .../Decompiler/src/decompile/cpp/unify.cc | 2 + .../Decompiler/src/decompile/cpp/unify.hh | 188 +++--- - .../src/decompile/cpp/unionresolve.cc | 2 + .../src/decompile/cpp/unionresolve.hh | 10 +- - .../Decompiler/src/decompile/cpp/userop.cc | 2 + .../Decompiler/src/decompile/cpp/userop.hh | 48 +- - .../Decompiler/src/decompile/cpp/variable.cc | 2 + .../Decompiler/src/decompile/cpp/variable.hh | 14 +- - .../Decompiler/src/decompile/cpp/varmap.cc | 2 + .../Decompiler/src/decompile/cpp/varmap.hh | 38 +- - .../Decompiler/src/decompile/cpp/varnode.cc | 2 + .../Decompiler/src/decompile/cpp/varnode.hh | 24 +- - .../Decompiler/src/decompile/cpp/xml.cc | 2 + - .../Decompiler/src/decompile/cpp/xml.hh | 148 +++-- - .../Decompiler/src/decompile/cpp/xml.y | 2 + - .../Decompiler/src/decompile/cpp/xml_arch.cc | 2 + + .../Decompiler/src/decompile/cpp/xml.hh | 141 +++-- .../Decompiler/src/decompile/cpp/xml_arch.hh | 6 +- - .../decompile/unittests/testcirclerange.cc | 2 + - .../src/decompile/unittests/testfloatemu.cc | 2 + - .../src/decompile/unittests/testmarshal.cc | 2 + - .../src/decompile/unittests/testtypes.cc | 2 + - 212 files changed, 2865 insertions(+), 2651 deletions(-) + 99 files changed, 2627 insertions(+), 2706 deletions(-) -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc -index 7b1b2062a..76fc27d72 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc -@@ -18,6 +18,8 @@ - - #include "coreaction.hh" - -+using namespace std; -+ - /// Specify the name, group, and properties of the Action - /// \param f is the collection of property flags - /// \param nm is the Action name diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/action.hh index 645c81119..c9369c025 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.hh @@ -484,21 +357,8 @@ index 645c81119..c9369c025 100644 void universalAction(Architecture *glb); ///< Build the universal action }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -index 0b3bf04c8..9a58ea4ef 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -@@ -16,6 +16,8 @@ - #include "address.hh" - #include "translate.hh" - -+using namespace std; -+ - AttributeId ATTRIB_FIRST = AttributeId("first",27); - AttributeId ATTRIB_LAST = AttributeId("last",28); - AttributeId ATTRIB_UNIQ = AttributeId("uniq",29); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh -index 46f73910b..4f843998b 100644 +index 8ca8477d5..c0c78645d 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh @@ -72,8 +72,8 @@ class Address { @@ -520,8 +380,8 @@ index 46f73910b..4f843998b 100644 + friend std::ostream &operator<<(std::ostream &s,const Address &addr); ///< Write out an address to stream bool containedBy(int4 sz,const Address &op2,int4 sz2) const; ///< Determine if \e op2 range contains \b this range int4 justifiedContain(int4 sz,const Address &op2,int4 sz2,bool forceleft) const; ///< Determine if \e op2 is the least significant part of \e this. - int4 overlap(int4 skip,const Address &op,int4 size) const; ///< Determine how two address ranges overlap -@@ -161,7 +161,7 @@ class SeqNum { + int4 overlap(int4 skip,const Address &op,int4 size) const; ///< Determine how \b this address falls in a given address range +@@ -162,7 +162,7 @@ class SeqNum { static SeqNum decode(Decoder &decoder); /// Write out a SeqNum in human readable form to a stream @@ -530,7 +390,7 @@ index 46f73910b..4f843998b 100644 }; class RangeProperties; -@@ -200,7 +200,7 @@ class Range { +@@ -201,7 +201,7 @@ class Range { if (spc->getIndex() != op2.spc->getIndex()) return (spc->getIndex() < op2.spc->getIndex()); return (first < op2.first); } @@ -539,7 +399,7 @@ index 46f73910b..4f843998b 100644 void encode(Encoder &encoder) const; ///< Encode \b this Range to a stream void decode(Decoder &decoder); ///< Restore \b this from a stream void decodeFromAttributes(Decoder &decoder); ///< Read \b from attributes on another tag -@@ -211,7 +211,7 @@ class Range { +@@ -212,7 +212,7 @@ class Range { /// Class that allows \ tags to be parsed, when the address space doesn't yet exist class RangeProperties { friend class Range; @@ -548,7 +408,7 @@ index 46f73910b..4f843998b 100644 uintb first; ///< Offset of first byte in the Range uintb last; ///< Offset of last byte in the Range bool isRegister; ///< Range is specified a register name -@@ -227,14 +227,14 @@ class RangeProperties { +@@ -228,14 +228,14 @@ class RangeProperties { /// that cover all the addresses in the container. Ranges can be inserted /// and removed, but overlapping/adjacent ranges will get merged. class RangeList { @@ -566,7 +426,7 @@ index 46f73910b..4f843998b 100644 int4 numRanges(void) const { return tree.size(); } ///< Return the number of Range objects in container const Range *getFirstRange(void) const; ///< Get the first Range const Range *getLastRange(void) const; ///< Get the last Range -@@ -245,7 +245,7 @@ class RangeList { +@@ -246,7 +246,7 @@ class RangeList { void merge(const RangeList &op2); ///< Merge another RangeList into \b this bool inRange(const Address &addr,int4 size) const; ///< Check containment an address range uintb longestFit(const Address &addr,uintb maxsize) const; ///< Find size of biggest Range containing given address @@ -575,7 +435,7 @@ index 46f73910b..4f843998b 100644 void encode(Encoder &encoder) const; ///< Encode \b this RangeList to a stream void decode(Decoder &decoder); ///< Decode \b this RangeList from a \ element }; -@@ -299,7 +299,7 @@ inline bool Address::isBigEndian(void) const { +@@ -300,7 +300,7 @@ inline bool Address::isBigEndian(void) const { /// Write a short-hand or debug version of this address to a /// stream. /// \param s is the stream being written @@ -584,7 +444,7 @@ index 46f73910b..4f843998b 100644 if (base == (AddrSpace *)0) { s << "invalid_addr"; return; -@@ -311,7 +311,7 @@ inline void Address::printRaw(ostream &s) const { +@@ -312,7 +312,7 @@ inline void Address::printRaw(ostream &s) const { /// tailored for the particular address space. /// \param s is the string to parse /// \return any size associated with the parsed string @@ -593,19 +453,6 @@ index 46f73910b..4f843998b 100644 int4 sz; offset=base->read(s,sz); return sz; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc -index 2bd660889..ea28bda29 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc -@@ -24,6 +24,8 @@ - #include - #endif - -+using namespace std; -+ - vector ArchitectureCapability::thelist; - - const uint4 ArchitectureCapability::majorversion = 5; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh index 20cb06f0d..1da109f31 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh @@ -785,19 +632,6 @@ index 20cb06f0d..1da109f31 100644 void addToGlobalScope(const RangeProperties &props); ///< Add a memory range to the set of addresses considered \e global void addOtherSpace(void); ///< Add OTHER space and all of its overlays to the symboltab void decodeReadOnly(Decoder &decoder); ///< Apply read-only region configuration -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc -index b9a495500..a37960f9e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc -@@ -16,6 +16,8 @@ - */ - #include "bfd_arch.hh" - -+using namespace std; -+ - // Constructing this object registers capability - BfdArchitectureCapability BfdArchitectureCapability::bfdArchitectureCapability; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh index 6ade01ecc..ed206737b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh @@ -822,19 +656,6 @@ index 6ade01ecc..ed206737b 100644 virtual ~BfdArchitecture(void) {} }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc -index a79e17ded..76523a58a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc -@@ -17,6 +17,8 @@ - #include "block.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_ALTINDEX = AttributeId("altindex",75); - AttributeId ATTRIB_DEPTH = AttributeId("depth",76); - AttributeId ATTRIB_END = AttributeId("end",77); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/block.hh index 1844f8a71..08194d967 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.hh @@ -1185,19 +1006,6 @@ index 1844f8a71..08194d967 100644 { return 2; // By default a block will not normalize -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc -index 80265a458..9c9906f8f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc -@@ -16,6 +16,8 @@ - #include "blockaction.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// Retrieve the current edge (as a \e top FlowBlock and the index of the outgoing edge). - /// If the end-points have been collapsed together, this returns NULL. - /// The top and bottom nodes of the edge are updated to FlowBlocks in the current collapsed graph. diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh index 09b1779dc..0ae2b6234 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh @@ -1404,19 +1212,6 @@ index 09b1779dc..0ae2b6234 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionNodeJoin(getGroup()); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc -index 26406c288..6b6a8d34b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc -@@ -16,6 +16,8 @@ - #include "callgraph.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_CALLGRAPH = ElementId("callgraph",226); - ElementId ELEM_NODE = ElementId("node",227); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.hh index f8419f15a..5ad32b66f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.hh @@ -1475,33 +1270,21 @@ index f8419f15a..5ad32b66f 100644 void buildAllNodes(void); void buildEdges(Funcdata *fd); void encode(Encoder &encoder) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc -index 87e40dbbf..481cf3378 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc -@@ -15,6 +15,8 @@ - */ - #include "capability.hh" - -+using namespace std; -+ - /// Access static vector of CapabilityPoint objects that are registered during static initialization - /// The list itself is created once on the first call to this method - /// \e after all the static initializers have run diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh -index 9ed07195d..4cbbf6aec 100644 +index a4d58691d..4cbbf6aec 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh -@@ -22,8 +22,6 @@ +@@ -22,9 +22,6 @@ #include #include --using namespace std; +-using std::vector; +-using std::string; - /// \brief Class for automatically registering extension points to the decompiler /// /// This uses the C++ static initializer feature to automatically \e discover -@@ -34,7 +32,7 @@ using namespace std; +@@ -35,7 +32,7 @@ using std::string; /// will ensure that the initialize() method is called on each extension, allowing it /// to complete its integration. class CapabilityPoint { @@ -1510,32 +1293,6 @@ index 9ed07195d..4cbbf6aec 100644 protected: CapabilityPoint(void); ///< Construct extension capability exactly once public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc -index dc8baa764..0899dc5de 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc -@@ -16,6 +16,8 @@ - #include "cast.hh" - #include "op.hh" - -+using namespace std; -+ - /// Sets the TypeFactory used to produce data-types for the arithmeticOutputStandard() method - /// \param t is the TypeFactory - void CastStrategy::setTypeFactory(TypeFactory *t) -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc -index 92690f422..1ba834bd6 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc -@@ -17,6 +17,8 @@ - #include "codedata.hh" - #include "loadimage_bfd.hh" - -+using namespace std; -+ - // Constructing this registers the capability - IfaceCodeDataCapability IfaceCodeDataCapability::ifaceCodeDataCapability; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.hh index 3b5a4b031..87db1807b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.hh @@ -1674,19 +1431,6 @@ index 3b5a4b031..87db1807b 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc -index b5bc0a16d..e495b734e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc -@@ -16,6 +16,8 @@ - #include "comment.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_COMMENT = ElementId("comment",86); - ElementId ELEM_COMMENTDB = ElementId("commentdb",87); - ElementId ELEM_TEXT = ElementId("text",88); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh index b2be60f0f..49d4e1950 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh @@ -1777,19 +1521,6 @@ index b2be60f0f..49d4e1950 100644 bool displayUnplacedComments; ///< True if unplaced comments should be displayed (in the header) bool findPosition(Subsort &subsort,Comment *comm,const Funcdata *fd); ///< Establish sorting key for a Comment public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc -index 04a4c2cf0..2ba980fc0 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "comment_ghidra.hh" - -+using namespace std; -+ - CommentDatabaseGhidra::CommentDatabaseGhidra(ArchitectureGhidra *g) - : CommentDatabase() - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.hh index c0dc59c89..0ed0def99 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.hh @@ -1805,19 +1536,6 @@ index c0dc59c89..0ed0def99 100644 virtual void deleteComment(Comment *com) { throw LowlevelError("deleteComment unimplemented"); } virtual CommentSet::const_iterator beginComment(const Address &fad) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc -index 962f35d5d..0c41bb363 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc -@@ -15,6 +15,8 @@ - */ - #include "condexe.hh" - -+using namespace std; -+ - ConditionMarker::ConditionMarker(void) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh index bf2e54615..8d479c3ed 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh @@ -1859,32 +1577,6 @@ index bf2e54615..8d479c3ed 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc -index f40f3dd66..c4a628228 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc -@@ -18,6 +18,8 @@ - - #include "libdecomp.hh" - -+using namespace std; -+ - class IfcLoadFile : public IfaceDecompCommand { - public: - virtual void execute(istream &s); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc -index 51157f3a7..19ab8ddfa 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc -@@ -17,6 +17,8 @@ - #include "slghsymbol.hh" - #include "translate.hh" - -+using namespace std; -+ - ParserContext::ParserContext(ContextCache *ccache,Translate *trans) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh index 8ae7012a6..5f00991fc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh @@ -1942,21 +1634,8 @@ index 8ae7012a6..5f00991fc 100644 }; inline void ParserContext::deallocateState(ParserWalkerChange &walker) { -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc -index 17d3e4b55..19807a55e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc -@@ -18,6 +18,8 @@ - #include "double.hh" - #include "subflow.hh" - -+using namespace std; -+ - /// \brief A stack equation - struct StackEqn { - int4 var1; ///< Variable with 1 coefficient diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh -index 2b187e734..d5bc73848 100644 +index d33fa3302..8a9bcef9d 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh @@ -31,7 +31,7 @@ @@ -2031,15 +1710,6 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionForceGoto(getGroup()); -@@ -149,7 +149,7 @@ class ActionForceGoto : public Action { - // \brief Perform common subexpression elimination - // class ActionCse : public Action { - // public: --// ActionCse(const string &g) : Action(0,"cse",g) {} ///< Constructor -+// ActionCse(const std::string &g) : Action(0,"cse",g) {} ///< Constructor - // virtual Action *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Action *)0; - // return new ActionCse(getGroup()); @@ -163,7 +163,7 @@ class ActionMultiCse : public Action { static PcodeOp *findMatch(BlockBasic *bl,PcodeOp *target,Varnode *in); ///< Find match to CPUI_MULTIEQUAL bool processBlock(Funcdata &data,BlockBasic *bl); ///< Search a block for equivalent CPUI_MULTIEQUAL @@ -2318,16 +1988,30 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionDeadCode(getGroup()); -@@ -566,7 +566,7 @@ class ActionDeadCode : public Action { +@@ -565,16 +565,16 @@ class ActionDeadCode : public Action { + /// \brief Propagate conditional constants class ActionConditionalConst : public Action { +- static void clearMarks(const vector &opList); +- static void collectReachable(Varnode *vn,vector &phiNodeEdges,vector &reachable); ++ static void clearMarks(const std::vector &opList); ++ static void collectReachable(Varnode *vn,std::vector &phiNodeEdges,std::vector &reachable); + static bool flowToAlternatePath(PcodeOp *op); +- static bool flowTogether(const vector &edges,int4 i,vector &result); ++ static bool flowTogether(const std::vector &edges,int4 i,std::vector &result); + static Varnode *placeCopy(PcodeOp *op,BlockBasic *bl,Varnode *constVn,Funcdata &data); +- static void placeMultipleConstants(vector &phiNodeEdges,vector &marks,Varnode *constVn,Funcdata &data); +- void handlePhiNodes(Varnode *varVn,Varnode *constVn,vector &phiNodeEdges,Funcdata &data); ++ static void placeMultipleConstants(std::vector &phiNodeEdges,std::vector &marks,Varnode *constVn,Funcdata &data); ++ void handlePhiNodes(Varnode *varVn,Varnode *constVn,std::vector &phiNodeEdges,Funcdata &data); + void propagateConstant(Varnode *varVn,Varnode *constVn,FlowBlock *constBlock,bool useMultiequal,Funcdata &data); public: - ActionConditionalConst(const string &g) : Action(0,"condconst",g) {} ///< Constructor + ActionConditionalConst(const std::string &g) : Action(0,"condconst",g) {} ///< Constructor virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionConditionalConst(getGroup()); -@@ -581,7 +581,7 @@ class ActionConditionalConst : public Action { +@@ -588,7 +588,7 @@ class ActionConditionalConst : public Action { /// the \b switch action. The case labels are also calculated based on the normalization. class ActionSwitchNorm : public Action { public: @@ -2336,7 +2020,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionSwitchNorm(getGroup()); -@@ -602,7 +602,7 @@ class ActionSwitchNorm : public Action { +@@ -609,7 +609,7 @@ class ActionSwitchNorm : public Action { /// Similarly there should be no lock on the output and no lock on the prototype model class ActionNormalizeSetup : public Action { public: @@ -2345,7 +2029,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionNormalizeSetup(getGroup()); -@@ -618,7 +618,7 @@ class ActionNormalizeSetup : public Action { +@@ -625,7 +625,7 @@ class ActionNormalizeSetup : public Action { class ActionPrototypeTypes: public Action { public: void extendInput(Funcdata &data,Varnode *invn,ProtoParameter *param,BlockBasic *topbl); @@ -2354,7 +2038,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionPrototypeTypes(getGroup()); -@@ -633,7 +633,7 @@ class ActionPrototypeTypes: public Action { +@@ -640,7 +640,7 @@ class ActionPrototypeTypes: public Action { /// \e uponreturn injection, the p-code is injected at this time. class ActionDefaultParams : public Action { public: @@ -2363,7 +2047,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionDefaultParams(getGroup()); -@@ -651,7 +651,7 @@ class ActionDefaultParams : public Action { +@@ -658,7 +658,7 @@ class ActionDefaultParams : public Action { class ActionExtraPopSetup : public Action { AddrSpace *stackspace; ///< The stack space to analyze public: @@ -2372,7 +2056,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionExtraPopSetup(getGroup(),stackspace); -@@ -669,7 +669,7 @@ class ActionFuncLink : public Action { +@@ -676,7 +676,7 @@ class ActionFuncLink : public Action { static void funcLinkInput(FuncCallSpecs *fc,Funcdata &data); static void funcLinkOutput(FuncCallSpecs *fc,Funcdata &data); public: @@ -2381,7 +2065,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionFuncLink(getGroup()); -@@ -687,7 +687,7 @@ class ActionFuncLink : public Action { +@@ -694,7 +694,7 @@ class ActionFuncLink : public Action { /// don't care about the function inputs. class ActionFuncLinkOutOnly : public Action { public: @@ -2390,7 +2074,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionFuncLinkOutOnly(getGroup()); -@@ -704,7 +704,7 @@ class ActionFuncLinkOutOnly : public Action { +@@ -711,7 +711,7 @@ class ActionFuncLinkOutOnly : public Action { /// sure the pieces are properly labeled. class ActionParamDouble : public Action { public: @@ -2399,7 +2083,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionParamDouble(getGroup()); -@@ -722,7 +722,7 @@ class ActionParamDouble : public Action { +@@ -729,7 +729,7 @@ class ActionParamDouble : public Action { /// but \b before any simplification or copy propagation has been performed. class ActionActiveParam : public Action { public: @@ -2408,7 +2092,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionActiveParam(getGroup()); -@@ -735,7 +735,7 @@ class ActionActiveParam : public Action { +@@ -742,7 +742,7 @@ class ActionActiveParam : public Action { /// This is analogous to ActionActiveParam but for sub-function return values. class ActionActiveReturn : public Action { public: @@ -2417,25 +2101,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionActiveReturn(getGroup()); -@@ -746,7 +746,7 @@ class ActionActiveReturn : public Action { - // \brief If there are any sub-function calls with \e paramshifts, add the shifted parameters. - // class ActionParamShiftStart : public Action { - // public: --// ActionParamShiftStart(const string &g) : Action( rule_onceperfunc, "paramshiftstart",g) {} ///< Constructor -+// ActionParamShiftStart(const std::string &g) : Action( rule_onceperfunc, "paramshiftstart",g) {} ///< Constructor - // virtual Action *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Action *)0; - // return new ActionParamShiftStart(getGroup()); -@@ -758,7 +758,7 @@ class ActionActiveReturn : public Action { - // class ActionParamShiftStop : public Action { - // bool paramshiftsleft; - // public: --// ActionParamShiftStop(const string &g) : Action( 0, "paramshiftstop",g) {} ///< Constructor -+// ActionParamShiftStop(const std::string &g) : Action( 0, "paramshiftstop",g) {} ///< Constructor - // virtual void reset(Funcdata &data) { paramshiftsleft = true; } - // virtual Action *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Action *)0; -@@ -771,7 +771,7 @@ class ActionActiveReturn : public Action { +@@ -778,7 +778,7 @@ class ActionActiveReturn : public Action { class ActionReturnRecovery : public Action { static void buildReturnOutput(ParamActive *active,PcodeOp *retop,Funcdata &data); public: @@ -2444,7 +2110,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionReturnRecovery(getGroup()); -@@ -785,7 +785,7 @@ class ActionReturnRecovery : public Action { +@@ -792,7 +792,7 @@ class ActionReturnRecovery : public Action { /// so that they cannot be treated as local variables. class ActionRestrictLocal : public Action { public: @@ -2453,7 +2119,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionRestrictLocal(getGroup()); -@@ -807,9 +807,9 @@ class ActionRestrictLocal : public Action { +@@ -814,9 +814,9 @@ class ActionRestrictLocal : public Action { /// allows the spurious references to the register to be removed. class ActionLikelyTrash : public Action { static uint4 countMarks(PcodeOp *op); @@ -2465,7 +2131,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionLikelyTrash(getGroup()); -@@ -823,7 +823,7 @@ class ActionLikelyTrash : public Action { +@@ -830,7 +830,7 @@ class ActionLikelyTrash : public Action { class ActionRestructureVarnode : public Action { int4 numpass; ///< Number of passes performed for this function public: @@ -2474,7 +2140,7 @@ index 2b187e734..d5bc73848 100644 virtual void reset(Funcdata &data) { numpass = 0; } virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; -@@ -837,7 +837,7 @@ class ActionRestructureVarnode : public Action { +@@ -844,7 +844,7 @@ class ActionRestructureVarnode : public Action { /// This produces the final set of symbols on the stack. class ActionRestructureHigh : public Action { public: @@ -2483,7 +2149,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionRestructureHigh(getGroup()); -@@ -848,7 +848,7 @@ class ActionRestructureHigh : public Action { +@@ -855,7 +855,7 @@ class ActionRestructureHigh : public Action { /// \brief Create symbols for any discovered global variables in the function. class ActionMapGlobals : public Action { public: @@ -2492,7 +2158,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionMapGlobals(getGroup()); -@@ -862,7 +862,7 @@ class ActionMapGlobals : public Action { +@@ -869,7 +869,7 @@ class ActionMapGlobals : public Action { /// to determine a prototype based on the prototype model. class ActionInputPrototype : public Action { public: @@ -2501,7 +2167,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionInputPrototype(getGroup()); -@@ -873,7 +873,7 @@ class ActionInputPrototype : public Action { +@@ -880,7 +880,7 @@ class ActionInputPrototype : public Action { /// \brief Set the (already) recovered output data-type as a formal part of the prototype class ActionOutputPrototype : public Action { public: @@ -2510,7 +2176,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionOutputPrototype(getGroup()); -@@ -888,7 +888,7 @@ class ActionOutputPrototype : public Action { +@@ -895,7 +895,7 @@ class ActionOutputPrototype : public Action { /// full input class ActionUnjustifiedParams : public Action { public: @@ -2519,7 +2185,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionUnjustifiedParams(getGroup()); -@@ -942,7 +942,7 @@ class ActionInferTypes : public Action { +@@ -949,7 +949,7 @@ class ActionInferTypes : public Action { static PcodeOp *canonicalReturnOp(Funcdata &data); static void propagateAcrossReturns(Funcdata &data); public: @@ -2528,7 +2194,7 @@ index 2b187e734..d5bc73848 100644 virtual void reset(Funcdata &data) { localcount = 0; } virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; -@@ -960,7 +960,7 @@ class ActionInferTypes : public Action { +@@ -967,7 +967,7 @@ class ActionInferTypes : public Action { /// alters the defining op of the shadow so that the duplicate statement doesn't print. class ActionHideShadow : public Action { public: @@ -2537,7 +2203,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionHideShadow(getGroup()); -@@ -971,7 +971,7 @@ class ActionHideShadow : public Action { +@@ -978,7 +978,7 @@ class ActionHideShadow : public Action { /// \brief Replace COPYs from the same source with a single dominant COPY class ActionDominantCopy : public Action { public: @@ -2546,7 +2212,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionDominantCopy(getGroup()); -@@ -982,7 +982,7 @@ class ActionDominantCopy : public Action { +@@ -989,7 +989,7 @@ class ActionDominantCopy : public Action { /// \brief Mark COPY operations between Varnodes representing the object as \e non-printing class ActionCopyMarker : public Action { public: @@ -2555,7 +2221,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionCopyMarker(getGroup()); -@@ -993,7 +993,7 @@ class ActionCopyMarker : public Action { +@@ -1000,7 +1000,7 @@ class ActionCopyMarker : public Action { /// \brief Attach \e dynamically mapped symbols to Varnodes in time for data-type propagation class ActionDynamicMapping : public Action { public: @@ -2564,7 +2230,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionDynamicMapping(getGroup()); -@@ -1004,7 +1004,7 @@ class ActionDynamicMapping : public Action { +@@ -1011,7 +1011,7 @@ class ActionDynamicMapping : public Action { /// \brief Make final attachments of \e dynamically mapped symbols to Varnodes class ActionDynamicSymbols : public Action { public: @@ -2573,7 +2239,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionDynamicSymbols(getGroup()); -@@ -1015,7 +1015,7 @@ class ActionDynamicSymbols : public Action { +@@ -1022,7 +1022,7 @@ class ActionDynamicSymbols : public Action { /// \brief Add warnings for prototypes that aren't modeled properly class ActionPrototypeWarnings : public Action { public: @@ -2582,7 +2248,7 @@ index 2b187e734..d5bc73848 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionPrototypeWarnings(getGroup()); -@@ -1030,7 +1030,7 @@ class ActionPrototypeWarnings : public Action { +@@ -1037,7 +1037,7 @@ class ActionPrototypeWarnings : public Action { class PropagationState { public: Varnode *vn; ///< The root Varnode @@ -2591,7 +2257,7 @@ index 2b187e734..d5bc73848 100644 PcodeOp *op; ///< The current descendant or the defining PcodeOp int4 inslot; ///< Slot holding Varnode for descendant PcodeOp int4 slot; ///< Current edge relative to current PcodeOp -@@ -1060,15 +1060,15 @@ class AdditiveEdge { +@@ -1067,15 +1067,15 @@ class AdditiveEdge { /// sorting of the terms to facilitate constant collapse and factoring simplifications. class TermOrder { PcodeOp *root; ///< The final PcodeOp in the expression @@ -2610,19 +2276,6 @@ index 2b187e734..d5bc73848 100644 }; /// \brief A comparison operator for ordering terms in a sum -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc -index 6e2b88a06..f41a8f745 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc -@@ -16,6 +16,8 @@ - #include "cover.hh" - #include "block.hh" - -+using namespace std; -+ - const CoverBlock Cover::emptyBlock; - - /// PcodeOp objects and a CoverBlock start/stop boundaries have diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh index 4d874ff9f..4cc0bdaaa 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh @@ -2667,19 +2320,6 @@ index 4d874ff9f..4cc0bdaaa 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc -index 42b1531ad..8e1fd1150 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc -@@ -15,6 +15,8 @@ - */ - #include "cpool.hh" - -+using namespace std; -+ - AttributeId ATTRIB_A = AttributeId("a",80); - AttributeId ATTRIB_B = AttributeId("b",81); - AttributeId ATTRIB_LENGTH = AttributeId("length",82); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh index ce9b9809a..76a83fd9b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh @@ -2767,19 +2407,6 @@ index ce9b9809a..76a83fd9b 100644 virtual bool empty(void) const { return cpoolMap.empty(); } virtual void clear(void) { cpoolMap.clear(); } virtual void encode(Encoder &encoder) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc -index e8dee8256..1da445915 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "cpool_ghidra.hh" - -+using namespace std; -+ - ConstantPoolGhidra::ConstantPoolGhidra(ArchitectureGhidra *g) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.hh index af65a8d2b..5efe96766 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.hh @@ -2797,32 +2424,6 @@ index af65a8d2b..5efe96766 100644 virtual bool empty(void) const { return false; } virtual void clear(void) { cache.clear(); } virtual void encode(Encoder &encoder) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc -index 2881ab711..3c68cb3ba 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc -@@ -16,6 +16,8 @@ - */ - #include "crc32.hh" - -+using namespace std; -+ - // Table for bytewise calculation of a 32-bit Cyclic Redundancy Check - uint4 crc32tab[] = { - 0x0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f, -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc -index eaf2c498d..d3f5805ee 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc -@@ -18,6 +18,8 @@ - #include "crc32.hh" - #include - -+using namespace std; -+ - AttributeId ATTRIB_CAT = AttributeId("cat",61); - AttributeId ATTRIB_FIELD = AttributeId("field",62); - AttributeId ATTRIB_MERGE = AttributeId("merge",63); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh index 10eaee7ab..1a2a2709c 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh @@ -3236,19 +2837,6 @@ index 10eaee7ab..1a2a2709c 100644 { scope=sc; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc -index 35030ffe0..93d390f97 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc -@@ -16,6 +16,8 @@ - #include "database_ghidra.hh" - #include "funcdata.hh" - -+using namespace std; -+ - Scope *ScopeGhidra::buildSubScope(uint8 id,const string &nm) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.hh index 304bd2914..09a6b6af3 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.hh @@ -3338,19 +2926,6 @@ index 304bd2914..09a6b6af3 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc -index ce5706bcd..14ad6929e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc -@@ -15,6 +15,8 @@ - */ - #include "double.hh" - -+using namespace std; -+ - /// Internally, the \b lo and \b hi Varnodes are set to null, and the \b val field - /// holds the constant value. - /// \param sz is the size in bytes of the constant diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/double.hh index 418d1f85e..09640b9d5 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.hh @@ -3425,19 +3000,6 @@ index 418d1f85e..09640b9d5 100644 + static void reassignIndirects(Funcdata &data,PcodeOp *newStore,const std::vector &indirects); }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc -index 3656c0df5..16dfa25ca 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc -@@ -17,6 +17,8 @@ - #include "funcdata.hh" - #include "crc32.hh" - -+using namespace std; -+ - // Table for how to hash opcodes, lumps certain operators (i.e. ADD SUB PTRADD PTRSUB) into one hash - // zero indicates the operator should be skipped - const uint4 DynamicHash::transtable[] = { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh index 1355f9fe1..6fd8f9fec 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh @@ -3477,19 +3039,6 @@ index 1355f9fe1..6fd8f9fec 100644 static int4 getSlotFromHash(uint8 h); ///< Retrieve the encoded slot from a hash static uint4 getMethodFromHash(uint8 h); ///< Retrieve the encoded method from a hash static uint4 getOpCodeFromHash(uint8 h); ///< Retrieve the encoded op-code from a hash -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc -index 88936cedd..5025d952d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc -@@ -15,6 +15,8 @@ - */ - #include "emulate.hh" - -+using namespace std; -+ - /// Any time the emulator is about to execute a user-defined pcode op with the given name, - /// the indicated breakpoint is invoked first. The break table does \e not assume responsibility - /// for freeing the breakpoint object. diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.hh index bfe874751..d7d33a980 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.hh @@ -3542,19 +3091,6 @@ index bfe874751..d7d33a980 100644 BreakTable *breaktable; ///< The table of breakpoints Address current_address; ///< Address of current instruction being executed bool instruction_start; ///< \b true if next pcode op is start of instruction -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc -index fe37a7be2..8e022e3a3 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc -@@ -16,6 +16,8 @@ - #include "architecture.hh" - #include "emulateutil.hh" - -+using namespace std; -+ - /// \param g is the Architecture providing the LoadImage - EmulatePcodeOp::EmulatePcodeOp(Architecture *g) - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh index a06b49ce3..92f76bd75 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh @@ -3582,19 +3118,47 @@ index a06b49ce3..92f76bd75 100644 /// \brief Set the current executing p-code op by index diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/error.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/error.hh -index 788b2421d..d2b35046e 100644 +index 6cb1c1156..d2b35046e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/error.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/error.hh -@@ -33,8 +33,6 @@ +@@ -33,36 +33,6 @@ #include #include --using namespace std; +-using std::string; +-using std::map; +-using std::set; +-using std::list; +-using std::vector; +-using std::pair; +-using std::make_pair; +-using std::ostream; +-using std::istream; +-using std::ifstream; +-using std::ofstream; +-using std::istringstream; +-using std::ostringstream; +-using std::ios; +-using std::dec; +-using std::hex; +-using std::oct; +-using std::setfill; +-using std::fixed; +-using std::setprecision; +-using std::setw; +-using std::endl; +-using std::ws; +-using std::min; +-using std::max; +-using std::to_string; +-using std::piecewise_construct; +-using std::forward_as_tuple; +- - /// \brief The lowest level error generated by the decompiler /// /// This is the base error for all exceptions thrown by the -@@ -42,9 +40,9 @@ using namespace std; +@@ -70,9 +40,9 @@ using std::forward_as_tuple; /// level errors that immediately abort decompilation (usually /// for just a single function). struct LowlevelError { @@ -3606,7 +3170,7 @@ index 788b2421d..d2b35046e 100644 }; /// \brief A generic recoverable error -@@ -54,7 +52,7 @@ struct LowlevelError { +@@ -82,7 +52,7 @@ struct LowlevelError { /// into account. struct RecovError : public LowlevelError { /// Initialize the error with an explanatory string @@ -3615,7 +3179,7 @@ index 788b2421d..d2b35046e 100644 }; /// \brief An error generated while parsing a command or language -@@ -64,7 +62,7 @@ struct RecovError : public LowlevelError { +@@ -92,7 +62,7 @@ struct RecovError : public LowlevelError { /// C syntax. struct ParseError : public LowlevelError { // Parsing error /// Initialize the error with an explanatory string @@ -3624,28 +3188,18 @@ index 788b2421d..d2b35046e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc -index 9ab665cd3..56cd2620f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc -@@ -29,6 +29,8 @@ extern "C" { - } - #endif - -+using namespace std; -+ - // Path name separator - #ifdef _WINDOWS - char FileManage::separator = '\\'; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh -index 9cd6f4e8f..f0c7423a0 100644 +index 9393802a4..f0c7423a0 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh -@@ -24,26 +24,24 @@ +@@ -24,29 +24,24 @@ #include #include --using namespace std; +-using std::vector; +-using std::string; +-using std::ifstream; +-using std::ostringstream; - class FileManage { - vector pathlist; // List of paths to search for files @@ -3682,19 +3236,6 @@ index 9cd6f4e8f..f0c7423a0 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc -index 068c7e991..8f843d1da 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc -@@ -19,6 +19,8 @@ - #include - #include "address.hh" - -+using namespace std; -+ - /// Set format for a given encoding size according to IEEE 754 standards - /// \param sz is the size of the encoding in bytes - FloatFormat::FloatFormat(int4 sz) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/float.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/float.hh index fff9075f1..f9c11b67b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/float.hh @@ -3708,19 +3249,6 @@ index fff9075f1..f9c11b67b 100644 void restoreXml(const Element *el); ///< Restore the format from XML }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc -index ff775928f..3833b6423 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc -@@ -15,6 +15,8 @@ - */ - #include "flow.hh" - -+using namespace std; -+ - /// Prepare for tracing flow for a new function. - /// The Funcdata object and references to its internal containers must be explicitly given. - /// \param d is the new function to trace diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh index 19d3b47bf..4adac3ba2 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh @@ -3789,21 +3317,8 @@ index 19d3b47bf..4adac3ba2 100644 void setRange(const Address &b,const Address &e) { baddr = b; eaddr = e; } ///< Establish the flow bounds void setMaximumInstructions(uint4 max) { insn_max = max; } ///< Set the maximum number of instructions void setFlags(uint4 val) { flags |= val; } ///< Enable a specific option -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -index d1bd842d8..064b98a34 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -@@ -16,6 +16,8 @@ - #include "fspec.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_CUSTOM = AttributeId("custom",114); - AttributeId ATTRIB_DOTDOTDOT = AttributeId("dotdotdot",115); - AttributeId ATTRIB_EXTENSION = AttributeId("extension",116); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh -index 88eb871cd..164fadd3b 100644 +index 64ec45e2c..b8e820229 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh @@ -58,7 +58,7 @@ extern ElementId ELEM_UNAFFECTED; ///< Marshaling element \ @@ -3815,7 +3330,16 @@ index 88eb871cd..164fadd3b 100644 }; /// \brief A contiguous range of memory that can be used to pass parameters -@@ -110,9 +110,9 @@ class ParamEntry { +@@ -101,7 +101,7 @@ class ParamEntry { + private: + uint4 flags; ///< Boolean properties of the parameter + type_metatype type; ///< Data-type class that this entry must match +- vector groupSet; ///< Group(s) \b this entry belongs to ++ std::vector groupSet; ///< Group(s) \b this entry belongs to + AddrSpace *spaceid; ///< Address space containing the range + uintb addressbase; ///< Starting offset of the range + int4 size; ///< Size of the range in bytes +@@ -109,16 +109,16 @@ class ParamEntry { int4 alignment; ///< How much alignment (0 means only 1 logical value is allowed) int4 numslots; ///< (Maximum) number of slots that can store separate parameters JoinRecord *joinrec; ///< Non-null if this is logical variable from joined pieces @@ -3828,6 +3352,14 @@ index 88eb871cd..164fadd3b 100644 /// \brief Is the logical value left-justified within its container bool isLeftJustified(void) const { return (((flags&force_left_justify)!=0)||(!spaceid->isBigEndian())); } + public: + ParamEntry(int4 grp) { groupSet.push_back(grp); } ///< Constructor for use with decode + int4 getGroup(void) const { return groupSet[0]; } ///< Get the group id \b this belongs to +- const vector &getAllGroups(void) const { return groupSet; } ///< Get all group numbers \b this overlaps ++ const std::vector &getAllGroups(void) const { return groupSet; } ///< Get all group numbers \b this overlaps + bool groupOverlap(const ParamEntry &op2) const; ///< Check if \b this and op2 occupy any of the same groups + int4 getSize(void) const { return size; } ///< Get the size of the memory range in bytes. + int4 getMinSize(void) const { return minsize; } ///< Get the minimum size of a logical value contained in \b this @@ -140,7 +140,7 @@ class ParamEntry { AddrSpace *getSpace(void) const { return spaceid; } ///< Get the address space containing \b this entry uintb getBase(void) const { return addressbase; } ///< Get the starting offset of \b this entry @@ -3878,12 +3410,14 @@ index 88eb871cd..164fadd3b 100644 virtual ParamList *clone(void) const=0; ///< Clone this parameter list model }; -@@ -559,11 +559,11 @@ class ParamListStandard : public ParamList { +@@ -558,15 +558,15 @@ class ParamListStandard : public ParamList { + int4 maxdelay; ///< Maximum heritage delay across all parameters int4 pointermax; ///< If non-zero, maximum size of a data-type before converting to a pointer bool thisbeforeret; ///< Does a \b this parameter come before a hidden return parameter - int4 resourceTwoStart; ///< If there are two resource sections, the group of the first entry in the second section +- vector resourceStart; ///< The starting group for each resource section - list entry; ///< The ordered list of parameter entries - vector resolverMap; ///< Map from space id to resolver ++ std::vector resourceStart; ///< The starting group for each resource section + std::list entry; ///< The ordered list of parameter entries + std::vector resolverMap; ///< Map from space id to resolver AddrSpace *spacebase; ///< Address space containing relative offset parameters @@ -3892,7 +3426,11 @@ index 88eb871cd..164fadd3b 100644 + Address assignAddress(const Datatype *tp,std::vector &status) const; ///< Assign storage for given parameter data-type const ParamEntry *selectUnreferenceEntry(int4 grp,type_metatype prefType) const; ///< Select entry to fill an unreferenced param void buildTrialMap(ParamActive *active) const; ///< Build map from parameter trials to model ParamEntrys - void separateSections(ParamActive *active,int4 &oneStart,int4 &oneStop,int4 &twoStart,int4 &twoStop) const; +- void separateSections(ParamActive *active,vector &trialStart) const; ++ void separateSections(ParamActive *active,std::vector &trialStart) const; + static void markGroupNoUse(ParamActive *active,int4 activeTrial,int4 trialStart); + static void markBestInactive(ParamActive *active,int4 group,int4 groupStart,type_metatype prefType); + static void forceExclusionGroup(ParamActive *active); @@ -575,17 +575,17 @@ class ParamListStandard : public ParamList { void calcDelay(void); ///< Calculate the maximum heritage delay for any potential parameter in this list void addResolverRange(AddrSpace *spc,uintb first,uintb last,ParamEntry *paramEntry,int4 position); @@ -4280,19 +3818,6 @@ index 88eb871cd..164fadd3b 100644 }; /// Return the trial associated with the input Varnode to the associated p-code CALL or CALLIND. -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc -index 24756f0b7..5dd98c243 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc -@@ -15,6 +15,8 @@ - */ - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_NOCODE = AttributeId("nocode",84); - - ElementId ELEM_AST = ElementId("ast",115); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh index 3397f986a..894d8a200 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh @@ -4525,58 +4050,6 @@ index 3397f986a..894d8a200 100644 + std::vector &outlist); #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc -index 85874d97a..94d903ced 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc -@@ -16,6 +16,8 @@ - #include "funcdata.hh" - #include "flow.hh" - -+using namespace std; -+ - // Funcdata members pertaining directly to blocks - - /// A description of each block in the current structure hierarchy is -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc -index d546e58b6..6a4d8be41 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc -@@ -16,6 +16,8 @@ - #include "funcdata.hh" - #include "flow.hh" - -+using namespace std; -+ - // Funcdata members pertaining directly to ops - - /// \param op is the given PcodeOp -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -index 70acfad8f..d68294476 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -@@ -15,6 +15,8 @@ - */ - #include "funcdata.hh" - -+using namespace std; -+ - // Funcdata members pertaining directly to varnodes - - /// Properties of a given storage location are gathered from symbol information and -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc -index b5dd6c469..68e33edff 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc -@@ -23,6 +23,8 @@ - #include "cpool_ghidra.hh" - #include "inject_ghidra.hh" - -+using namespace std; -+ - //AttributeId ATTRIB_BADDATA = AttributeId("baddata",145); - - ElementId ELEM_COMMAND_ISNAMEUSED = ElementId("command_isnameused",239); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh index 20dabcb6c..e2056337e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh @@ -4684,19 +4157,6 @@ index 20dabcb6c..e2056337e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc -index 226c3249c..80106670a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc -@@ -15,6 +15,8 @@ - */ - #include "ghidra_context.hh" - -+using namespace std; -+ - const TrackedSet &ContextGhidra::getTrackedSet(const Address &addr) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.hh index 68c201a33..bd41a9042 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.hh @@ -4728,24 +4188,21 @@ index 68c201a33..bd41a9042 100644 throw LowlevelError("registerVariable should not be called for GHIDRA"); } virtual void encode(Encoder &encoder) const { throw LowlevelError("context::encode should not be called for GHIDRA"); } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc -index a2cc2299b..e1a7f57cd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc -@@ -22,6 +22,8 @@ - #include - #endif - -+using namespace std; -+ - #ifdef __REMOTE_SOCKET__ - - #include "ifacedecomp.hh" diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh -index 8c682d80d..428319a65 100644 +index 6ee255caa..64fd45e35 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh -@@ -39,11 +39,11 @@ extern ElementId ELEM_DOC; ///< Marshaling element \ +@@ -27,9 +27,6 @@ + #include + #include + +-using std::cin; +-using std::cout; +- + class GhidraCommand; + + extern ElementId ELEM_DOC; ///< Marshaling element \ +@@ -42,11 +39,11 @@ extern ElementId ELEM_DOC; ///< Marshaling element \ /// a command from the stream and dispatching to the correct GhidraCommand object. class GhidraCapability : public CapabilityPoint { protected: @@ -4761,7 +4218,7 @@ index 8c682d80d..428319a65 100644 static void shutDown(void); ///< Release all GhidraCommand resources }; -@@ -72,14 +72,14 @@ class GhidraDecompCapability : public GhidraCapability { +@@ -75,8 +72,8 @@ class GhidraDecompCapability : public GhidraCapability { /// and sendResult() will send back any accumulated warning/error messages. class GhidraCommand { protected: @@ -4772,14 +4229,7 @@ index 8c682d80d..428319a65 100644 ArchitectureGhidra *ghidra; ///< The Architecture on which to perform the command int4 status; ///< Meta-command to system (0=wait for next command, 1=terminate process) virtual void loadParameters(void); ///< Read parameters directing command execution - virtual void sendResult(void); ///< Send results of the command (if any) back to the Ghidra client - public: -- GhidraCommand(void) : sin(cin),sout(cout) { -+ GhidraCommand(void) : sin(std::cin),sout(std::cout) { - ghidra = (ArchitectureGhidra *)0; - } ///< Construct given i/o streams - virtual ~GhidraCommand(void) {} ///< Destructor -@@ -102,10 +102,10 @@ class GhidraCommand { +@@ -105,10 +102,10 @@ class GhidraCommand { /// - The stripped down \ tag describing address spaces for the program /// - The \ tag describing the built-in datatypes for the program class RegisterProgram : public GhidraCommand { @@ -4794,7 +4244,7 @@ index 8c682d80d..428319a65 100644 virtual void loadParameters(void); virtual void sendResult(void); public: -@@ -203,8 +203,8 @@ class StructureGraph : public GhidraCommand { +@@ -206,8 +203,8 @@ class StructureGraph : public GhidraCommand { /// The command returns a single character message, 't' or 'f', indicating whether the /// action succeeded. class SetAction : public GhidraCommand { @@ -4805,19 +4255,6 @@ index 8c682d80d..428319a65 100644 virtual void loadParameters(void); virtual void sendResult(void); public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc -index dd2c0274a..bb5211a8f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc -@@ -16,6 +16,8 @@ - #include "ghidra_translate.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// \brief Associate a Varnode with a register name - /// - /// \param nm is the register name diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh index 207f2f375..c41fc12d9 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh @@ -4849,19 +4286,6 @@ index 207f2f375..c41fc12d9 100644 virtual int4 oneInstruction(PcodeEmit &emit,const Address &baseaddr) const; virtual int4 instructionLength(const Address &baseaddr) const { throw LowlevelError("Cannot currently get instruction length through this interface"); } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc -index 15badbad3..a70ec2686 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc -@@ -15,6 +15,8 @@ - */ - #include "globalcontext.hh" - -+using namespace std; -+ - ElementId ELEM_CONTEXT_DATA = ElementId("context_data",120); - ElementId ELEM_CONTEXT_POINTS = ElementId("context_points",121); - ElementId ELEM_CONTEXT_POINTSET = ElementId("context_pointset",122); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.hh index 6bf5ae0fe..6e76a125a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.hh @@ -4968,19 +4392,6 @@ index 6bf5ae0fe..6e76a125a 100644 virtual const uintm *getContext(const Address &addr) const { return database.getValue(addr).array; } virtual const uintm *getContext(const Address &addr,uintb &first,uintb &last) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc -index aab637f39..a87932dc8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc -@@ -89,6 +89,8 @@ - - #include "grammar.hh" - -+using namespace std; -+ - extern int yylex(void); - extern int yyerror(const char *str); - static CParse *parse; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh index 3f9115e72..2caa79ce4 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh @@ -5233,19 +4644,6 @@ index 3f9115e72..2caa79ce4 100644 +extern Address parse_op(std::istream &s,uintm &uq,const TypeFactory &typegrp); #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc -index 20d7cd196..31b69addd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc -@@ -16,6 +16,8 @@ - */ - #include "graph.hh" - -+using namespace std; -+ - static void print_varnode_vertex(Varnode *vn,ostream &s) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh index edd6ce865..09467394f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh @@ -5262,19 +4660,6 @@ index edd6ce865..09467394f 100644 +extern void dump_dom_graph(const std::string &name,const BlockGraph &graph,std::ostream &s); #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc -index e8af0c939..8ce556c80 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc -@@ -17,6 +17,8 @@ - #include "funcdata.hh" - #include "prefersplit.hh" - -+using namespace std; -+ - /// Update disjoint cover making sure (addr,size) is contained in a single element and return - /// an iterator to this element. The element's \b pass number is set to be the smallest value - /// of any previous intersecting element. Additionally an \b intersect code is passed back: diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh index 76f731a58..4f5fed417 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh @@ -5431,21 +4816,8 @@ index 76f731a58..4f5fed417 100644 const LoadGuard *getStoreGuard(PcodeOp *op) const; ///< Get LoadGuard record associated with given PcodeOp }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc -index 5e035d4a2..f4a1acfee 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc -@@ -20,6 +20,8 @@ extern "C" { - #include "pcodeparse.hh" - #include "blockaction.hh" - -+using namespace std; -+ - // Constructing this registers the capability - IfaceDecompCapability IfaceDecompCapability::ifaceDecompCapability; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh -index 73f476e20..fb9777427 100644 +index 41bb99425..208d4e6b9 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh @@ -47,7 +47,7 @@ class IfaceDecompData : public IfaceData { @@ -5501,7 +4873,7 @@ index 73f476e20..fb9777427 100644 virtual IfaceData *createData(void) { return new IfaceDecompData(); } /// \brief Perform the per-function aspect of \b this command. -@@ -108,545 +108,545 @@ class IfaceDecompCommand : public IfaceCommand { +@@ -108,550 +108,550 @@ class IfaceDecompCommand : public IfaceCommand { class IfcSource : public IfaceDecompCommand { public: @@ -5763,6 +5135,12 @@ index 73f476e20..fb9777427 100644 + virtual void execute(std::istream &s); }; + class IfcIsolate : public IfaceDecompCommand { + public: +- virtual void execute(istream &s); ++ virtual void execute(std::istream &s); + }; + class IfcPrintVarnode : public IfaceDecompCommand { public: - virtual void execute(istream &s); @@ -6156,19 +5534,6 @@ index 73f476e20..fb9777427 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc -index 44a584305..ebcf1fcfd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc -@@ -15,6 +15,8 @@ - */ - #include "ifaceterm.hh" - -+using namespace std; -+ - IfaceTerm::IfaceTerm(const string &prmpt,istream &is,ostream &os) - : IfaceStatus(prmpt,os) - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh index 0b70d8b22..43817d845 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh @@ -6194,19 +5559,6 @@ index 0b70d8b22..43817d845 100644 virtual void popScript(void); virtual bool isStreamFinished(void) const; }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc -index 6ecde748c..5845276ce 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "inject_ghidra.hh" - -+using namespace std; -+ - void InjectContextGhidra::encode(Encoder &encoder) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.hh index c0678039c..18844d334 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.hh @@ -6280,19 +5632,6 @@ index c0678039c..18844d334 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc -index e37e3f469..137d0402c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc -@@ -17,6 +17,8 @@ - #include "pcodeparse.hh" - #include "architecture.hh" - -+using namespace std; -+ - InjectContextSleigh::~InjectContextSleigh(void) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh index be86fbcf6..4fa80954f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh @@ -6405,42 +5744,33 @@ index be86fbcf6..4fa80954f 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc -index 8ac61f889..977703bbd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc -@@ -21,6 +21,8 @@ - #include "ext/stdio_filebuf.h" - #endif - -+using namespace std; -+ - vector IfaceCapability::thelist; - - void IfaceCapability::initialize(void) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh -index 0771e7428..1a467abda 100644 +index 03755410b..0c15b4ce9 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh -@@ -27,8 +27,6 @@ +@@ -26,16 +26,6 @@ #include #include --using namespace std; +-using std::map; +-using std::istream; +-using std::ostream; +-using std::ifstream; +-using std::ofstream; +-using std::istringstream; +-using std::endl; +-using std::ws; +-using std::ios_base; - #ifdef __REMOTE_SOCKET__ /// \brief A wrapper around a UNIX domain socket -@@ -38,18 +36,18 @@ using namespace std; - /// The socket is bound to a C++ istream and ostream. - class RemoteSocket { +@@ -47,16 +37,16 @@ class RemoteSocket { int fileDescriptor; ///< Descriptor for the socket -- basic_filebuf *inbuf; ///< Input buffer associated with the socket -- basic_filebuf *outbuf; ///< Output buffer for the socket + basic_filebuf *inbuf; ///< Input buffer associated with the socket + basic_filebuf *outbuf; ///< Output buffer for the socket - istream *inStream; ///< The C++ input stream - ostream *outStream; ///< The C++ output stream -+ std::basic_filebuf *inbuf; ///< Input buffer associated with the socket -+ std::basic_filebuf *outbuf; ///< Output buffer for the socket + std::istream *inStream; ///< The C++ input stream + std::ostream *outStream; ///< The C++ output stream bool isOpen; ///< Has the socket been opened @@ -6457,7 +5787,7 @@ index 0771e7428..1a467abda 100644 void close(void); ///< Close the streams and socket }; -@@ -57,8 +55,8 @@ class RemoteSocket { +@@ -64,8 +54,8 @@ class RemoteSocket { /// \brief An exception specific to the command line interface struct IfaceError { @@ -6468,7 +5798,7 @@ index 0771e7428..1a467abda 100644 }; /// \brief An exception describing a parsing error in a command line -@@ -66,14 +64,14 @@ struct IfaceError { +@@ -73,14 +63,14 @@ struct IfaceError { /// Thrown when attempting to parse a command line. Options are missing or are in /// the wrong form etc. struct IfaceParseError : public IfaceError { @@ -6485,7 +5815,7 @@ index 0771e7428..1a467abda 100644 }; class IfaceStatus; // Forward declaration -@@ -95,7 +93,7 @@ class IfaceData { +@@ -102,7 +92,7 @@ class IfaceData { /// The command is associated with a specific sequence of words (tokens) /// that should appear at the start of the command line. class IfaceCommand { @@ -6494,7 +5824,7 @@ index 0771e7428..1a467abda 100644 public: virtual ~IfaceCommand(void) {} ///< Destructor -@@ -108,13 +106,13 @@ class IfaceCommand { +@@ -115,13 +105,13 @@ class IfaceCommand { /// Execute this command. Additional state can be read from the given command line stream. /// Otherwise, the command gets its data from its registered IfaceData object /// \param s is the input stream from the command line @@ -6510,7 +5840,7 @@ index 0771e7428..1a467abda 100644 /// \brief Create a specialized data object for \b this command (and its module) /// -@@ -125,13 +123,13 @@ class IfaceCommand { +@@ -132,13 +122,13 @@ class IfaceCommand { /// \brief Add a token to the command line string associated with this command /// /// \param temp is the new token to add @@ -6528,7 +5858,7 @@ index 0771e7428..1a467abda 100644 int4 compare(const IfaceCommand &op2) const; ///< Order two commands by their command line strings }; -@@ -139,8 +137,8 @@ class IfaceCommand { +@@ -146,8 +136,8 @@ class IfaceCommand { class IfaceCommandDummy : public IfaceCommand { public: virtual void setData(IfaceStatus *root,IfaceData *data) {} @@ -6539,7 +5869,7 @@ index 0771e7428..1a467abda 100644 virtual IfaceData *createData(void) { return (IfaceData *)0; } }; -@@ -159,11 +157,11 @@ inline bool compare_ifacecommand(const IfaceCommand *a,const IfaceCommand *b) { +@@ -166,11 +156,11 @@ inline bool compare_ifacecommand(const IfaceCommand *a,const IfaceCommand *b) { /// is automatically made available to any IfaceStatus object just by calling /// the static registerAllCommands() class IfaceCapability : public CapabilityPoint { @@ -6554,7 +5884,7 @@ index 0771e7428..1a467abda 100644 virtual void initialize(void); virtual void registerCommands(IfaceStatus *status)=0; ///< Register commands for \b this grouping -@@ -193,39 +191,39 @@ class IfaceCapability : public CapabilityPoint { +@@ -200,39 +190,39 @@ class IfaceCapability : public CapabilityPoint { /// - Override pushScript() and popScript() to allow command scripts /// - Get custom data into IfaceCommand callbacks class IfaceStatus { @@ -6612,7 +5942,7 @@ index 0771e7428..1a467abda 100644 virtual void popScript(void); virtual void reset(void); ///< Pop any existing script streams and return to processing from the base stream int4 getNumInputStreamSize(void) const { return promptstack.size(); } ///< Get depth of script nesting -@@ -235,14 +233,14 @@ class IfaceStatus { +@@ -242,14 +232,14 @@ class IfaceStatus { const char *nm3 = (const char *)0, const char *nm4 = (const char *)0, const char *nm5 = (const char *)0); @@ -6630,7 +5960,7 @@ index 0771e7428..1a467abda 100644 }; /// \brief A root class for a basic set of commands -@@ -254,38 +252,38 @@ class IfaceBaseCommand : public IfaceCommand { +@@ -261,38 +251,38 @@ class IfaceBaseCommand : public IfaceCommand { IfaceStatus *status; ///< The interface owning this command instance public: virtual void setData(IfaceStatus *root,IfaceData *data) { status = root; } @@ -6676,19 +6006,6 @@ index 0771e7428..1a467abda 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc -index 1c032adad..e2c9c370b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc -@@ -17,6 +17,8 @@ - #include "emulate.hh" - #include "flow.hh" - -+using namespace std; -+ - AttributeId ATTRIB_LABEL = AttributeId("label",131); - AttributeId ATTRIB_NUM = AttributeId("num",132); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh index 4c9b6d552..a89b1ddc3 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh @@ -6916,19 +6233,6 @@ index 4c9b6d552..a89b1ddc3 100644 int4 numIndicesByBlock(const FlowBlock *bl) const; int4 getIndexByBlock(const FlowBlock *bl,int4 i) const; Address getAddressByIndex(int4 i) const { return addresstable[i]; } ///< Get the i-th address table entry -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc -index b60a349fe..81ab37960 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc -@@ -15,6 +15,8 @@ - */ - #include "libdecomp.hh" - -+using namespace std; -+ - void startDecompilerLibrary(const char *sleighhome) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.hh index e7f5ae179..1578984a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.hh @@ -6944,19 +6248,6 @@ index e7f5ae179..1578984a6 100644 extern void shutdownDecompilerLibrary(void); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc -index e14109b32..bba3e9674 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc -@@ -15,6 +15,8 @@ - */ - #include "loadimage.hh" - -+using namespace std; -+ - /// This is a convenience method wrapped around the core - /// loadFill() routine. It automatically allocates an array - /// of the desired size, and then fills it with load image data. diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.hh index 59d4c9a5d..0cfd48715 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.hh @@ -7040,19 +6331,6 @@ index 59d4c9a5d..0cfd48715 100644 return filename; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc -index 7e9f1ad8a..6009dde95 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc -@@ -16,6 +16,8 @@ - */ - #include "loadimage_bfd.hh" - -+using namespace std; -+ - int4 LoadImageBfd::bfdinit = 0; // Global initialization variable - - LoadImageBfd::LoadImageBfd(const string &f,const string &t) : LoadImage(f) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh index 9d69fcca5..9905ce825 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh @@ -7100,19 +6378,6 @@ index 9d69fcca5..9905ce825 100644 virtual void adjustVma(long adjust); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc -index 069a1f956..2ede5182b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "loadimage_ghidra.hh" - -+using namespace std; -+ - LoadImageGhidra::LoadImageGhidra(ArchitectureGhidra *g) - : LoadImage("ghidra_progam") - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.hh index 95c56dcdf..82700069a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.hh @@ -7126,19 +6391,6 @@ index 95c56dcdf..82700069a 100644 virtual void adjustVma(long adjust); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc -index b7a9a30c4..0de974108 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc -@@ -16,6 +16,8 @@ - #include "loadimage_xml.hh" - #include "translate.hh" - -+using namespace std; -+ - AttributeId ATTRIB_ARCH = AttributeId("arch",135); - - ElementId ELEM_BINARYIMAGE = ElementId("binaryimage",230); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.hh index 018cc06bb..5f0707e5b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.hh @@ -7174,32 +6426,21 @@ index 018cc06bb..5f0707e5b 100644 virtual void adjustVma(long adjust); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc -index cd1e7acde..49b57b6a3 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc -@@ -17,6 +17,7 @@ - #include "translate.hh" - - using namespace PackedFormat; -+using namespace std; - - unordered_map AttributeId::lookupAttributeId; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh -index a6cf0fb26..5f97090a8 100644 +index 46478206d..f108a3068 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh -@@ -20,8 +20,6 @@ +@@ -20,9 +20,6 @@ #include #include --using namespace std; +-using std::list; +-using std::unordered_map; - /// \brief An annotation for a data element to being transferred to/from a stream /// /// This class parallels the XML concept of an \b attribute on an element. An AttributeId describes -@@ -35,16 +33,16 @@ using namespace std; +@@ -36,16 +33,16 @@ using std::unordered_map; /// /// The same AttributeId can be used to label a different type of data when associated with a different ElementId. class AttributeId { @@ -7222,7 +6463,7 @@ index a6cf0fb26..5f97090a8 100644 static void initialize(void); ///< Populate a hashtable with all AttributeId objects friend bool operator==(uint4 id,const AttributeId &op2) { return (id == op2.id); } ///< Test equality of a raw integer id with an AttributeId friend bool operator==(const AttributeId &op1,uint4 id) { return (op1.id == id); } ///< Test equality of an AttributeId with a raw integer id -@@ -59,16 +57,16 @@ class AttributeId { +@@ -60,16 +57,16 @@ class AttributeId { /// AttributeId ATTRIB_CONTENT is used to label the XML element's text content, which is traditionally not labeled /// as an attribute. class ElementId { @@ -7245,7 +6486,7 @@ index a6cf0fb26..5f97090a8 100644 static void initialize(void); ///< Populate a hashtable with all ElementId objects friend bool operator==(uint4 id,const ElementId &op2) { return (id == op2.id); } ///< Test equality of a raw integer id with an ElementId friend bool operator==(const ElementId &op1,uint4 id) { return (op1.id == id); } ///< Test equality of an ElementId with a raw integer id -@@ -107,7 +105,7 @@ class Decoder { +@@ -108,7 +105,7 @@ class Decoder { /// i.e. the input stream is cleared before any decoding takes place. /// \param s is the given input stream to be decode /// \return \b true if the stream was fully ingested @@ -7254,7 +6495,25 @@ index a6cf0fb26..5f97090a8 100644 /// \brief Peek at the next child element of the current parent, without traversing in (opening) it. /// -@@ -208,7 +206,7 @@ class Decoder { +@@ -206,7 +203,7 @@ class Decoder { + /// \param expect is the string value to expect if the attribute is encoded as a string + /// \param expectval is the integer value to return if the attribute matches the expected string + /// \return the encoded integer or the integer value associated with the expected string +- virtual intb readSignedIntegerExpectString(const string &expect,intb expectval)=0; ++ virtual intb readSignedIntegerExpectString(const std::string &expect,intb expectval)=0; + + /// \brief Find and parse a specific attribute in the current element as either a signed integer or a string. + /// +@@ -219,7 +216,7 @@ class Decoder { + /// \param expect is the string to expect, if the attribute is not encoded as an integer + /// \param expectval is the integer value to return if the attribute matches the expected string + /// \return the encoded integer or the integer value associated with the expected string +- virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const string &expect,intb expectval)=0; ++ virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const std::string &expect,intb expectval)=0; + + /// \brief Parse the current attribute as an unsigned integer value + /// +@@ -241,7 +238,7 @@ class Decoder { /// /// The last attribute, as returned by getNextAttributeId, is returned as a string. /// \return the string associated with the current attribute. @@ -7263,7 +6522,7 @@ index a6cf0fb26..5f97090a8 100644 /// \brief Find the specific attribute in the current element and return it as a string /// -@@ -217,7 +215,7 @@ class Decoder { +@@ -250,7 +247,7 @@ class Decoder { /// Parse via getNextAttributeId is reset. /// \param attribId is the specific attribute id to match /// \return the string associated with the attribute @@ -7272,16 +6531,25 @@ index a6cf0fb26..5f97090a8 100644 /// \brief Parse the current attribute as an address space /// -@@ -296,7 +294,7 @@ class Encoder { +@@ -329,7 +326,7 @@ class Encoder { /// The string is associated with the given AttributeId annotation and the current open element. /// \param attribId is the given AttributeId annotation /// \param val is the string to encode - virtual void writeString(const AttributeId &attribId,const string &val)=0; + virtual void writeString(const AttributeId &attribId,const std::string &val)=0; + /// \brief Write an annotated string, using an indexed attribute, into the encoding + /// +@@ -340,7 +337,7 @@ class Encoder { + /// \param attribId is the shared AttributeId + /// \param index is the unique index to associated with the string + /// \param val is the string to encode +- virtual void writeStringIndexed(const AttributeId &attribId,uint4 index,const string &val)=0; ++ virtual void writeStringIndexed(const AttributeId &attribId,uint4 index,const std::string &val)=0; + /// \brief Write an address space reference into the encoding /// -@@ -314,10 +312,10 @@ class Encoder { +@@ -358,10 +355,10 @@ class Encoder { class XmlDecode : public Decoder { Document *document; ///< An ingested XML document, owned by \b this decoder const Element *rootElement; ///< The root XML element to be decoded @@ -7295,7 +6563,7 @@ index a6cf0fb26..5f97090a8 100644 public: XmlDecode(const AddrSpaceManager *spc,const Element *root) : Decoder(spc) { document = (Document *)0; rootElement = root; attributeIndex = -1; } ///< Constructor with preparsed root -@@ -325,7 +323,7 @@ class XmlDecode : public Decoder { +@@ -369,7 +366,7 @@ class XmlDecode : public Decoder { document = (Document *)0; rootElement = (const Element *)0; attributeIndex = -1; } ///< Constructor for use with ingestStream const Element *getCurrentXmlElement(void) const { return elStack.back(); } ///< Get pointer to underlying XML element object virtual ~XmlDecode(void); @@ -7304,8 +6572,14 @@ index a6cf0fb26..5f97090a8 100644 virtual uint4 peekElement(void); virtual uint4 openElement(void); virtual uint4 openElement(const ElementId &elemId); -@@ -339,8 +337,8 @@ class XmlDecode : public Decoder { +@@ -382,12 +379,12 @@ class XmlDecode : public Decoder { + virtual bool readBool(const AttributeId &attribId); + virtual intb readSignedInteger(void); virtual intb readSignedInteger(const AttributeId &attribId); +- virtual intb readSignedIntegerExpectString(const string &expect,intb expectval); +- virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const std::string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const std::string &expect,intb expectval); virtual uintb readUnsignedInteger(void); virtual uintb readUnsignedInteger(const AttributeId &attribId); - virtual string readString(void); @@ -7315,7 +6589,7 @@ index a6cf0fb26..5f97090a8 100644 virtual AddrSpace *readSpace(void); virtual AddrSpace *readSpace(const AttributeId &attribId); }; -@@ -351,16 +349,16 @@ class XmlDecode : public Decoder { +@@ -398,17 +395,17 @@ class XmlDecode : public Decoder { /// receive the XML document as calls are made on the encoder. class XmlEncode : public Encoder { friend class XmlDecode; @@ -7331,11 +6605,13 @@ index a6cf0fb26..5f97090a8 100644 virtual void writeSignedInteger(const AttributeId &attribId,intb val); virtual void writeUnsignedInteger(const AttributeId &attribId,uintb val); - virtual void writeString(const AttributeId &attribId,const string &val); +- virtual void writeStringIndexed(const AttributeId &attribId,uint4 index,const string &val); + virtual void writeString(const AttributeId &attribId,const std::string &val); ++ virtual void writeStringIndexed(const AttributeId &attribId,uint4 index,const std::string &val); virtual void writeSpace(const AttributeId &attribId,const AddrSpace *spc); }; -@@ -437,11 +435,11 @@ class PackedDecode : public Decoder { +@@ -485,11 +482,11 @@ class PackedDecode : public Decoder { /// \brief An iterator into input stream class Position { friend class PackedDecode; @@ -7349,7 +6625,7 @@ index a6cf0fb26..5f97090a8 100644 Position startPos; ///< Position at the start of the current open element Position curPos; ///< Position of the next attribute as returned by getNextAttributeId Position endPos; ///< Ending position after all attributes in current open element -@@ -458,7 +456,7 @@ class PackedDecode : public Decoder { +@@ -506,7 +503,7 @@ class PackedDecode : public Decoder { public: PackedDecode(const AddrSpaceManager *spcManager) : Decoder(spcManager) {} ///< Constructor virtual ~PackedDecode(void); @@ -7358,8 +6634,14 @@ index a6cf0fb26..5f97090a8 100644 virtual uint4 peekElement(void); virtual uint4 openElement(void); virtual uint4 openElement(const ElementId &elemId); -@@ -472,8 +470,8 @@ class PackedDecode : public Decoder { +@@ -519,12 +516,12 @@ class PackedDecode : public Decoder { + virtual bool readBool(const AttributeId &attribId); + virtual intb readSignedInteger(void); virtual intb readSignedInteger(const AttributeId &attribId); +- virtual intb readSignedIntegerExpectString(const string &expect,intb expectval); +- virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const std::string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const std::string &expect,intb expectval); virtual uintb readUnsignedInteger(void); virtual uintb readUnsignedInteger(const AttributeId &attribId); - virtual string readString(void); @@ -7369,7 +6651,7 @@ index a6cf0fb26..5f97090a8 100644 virtual AddrSpace *readSpace(void); virtual AddrSpace *readSpace(const AttributeId &attribId); }; -@@ -482,17 +480,17 @@ class PackedDecode : public Decoder { +@@ -533,18 +530,18 @@ class PackedDecode : public Decoder { /// /// See PackedDecode for details of the encoding format. class PackedEncode : public Encoder { @@ -7386,11 +6668,13 @@ index a6cf0fb26..5f97090a8 100644 virtual void writeSignedInteger(const AttributeId &attribId,intb val); virtual void writeUnsignedInteger(const AttributeId &attribId,uintb val); - virtual void writeString(const AttributeId &attribId,const string &val); +- virtual void writeStringIndexed(const AttributeId &attribId,uint4 index,const string &val); + virtual void writeString(const AttributeId &attribId,const std::string &val); ++ virtual void writeStringIndexed(const AttributeId &attribId,uint4 index,const std::string &val); virtual void writeSpace(const AttributeId &attribId,const AddrSpace *spc); }; -@@ -504,7 +502,7 @@ inline uint1 PackedDecode::getBytePlus1(Position &pos) +@@ -556,7 +553,7 @@ inline uint1 PackedDecode::getBytePlus1(Position &pos) { uint1 *ptr = pos.current + 1; if (ptr == pos.end) { @@ -7399,7 +6683,7 @@ index a6cf0fb26..5f97090a8 100644 ++iter; if (iter == inStream.end()) throw DecoderError("Unexpected end of stream"); -@@ -574,10 +572,10 @@ extern AttributeId ATTRIB_CONTENT; ///< Special attribute for XML text content o +@@ -626,10 +623,10 @@ extern AttributeId ATTRIB_CONTENT; ///< Special attribute for XML text content o /// placeholder attribute, ATTRIB_UNKNOWN, is returned as a placeholder for attributes with unrecognized names. /// \param nm is the name of the attribute /// \return the associated id @@ -7412,7 +6696,7 @@ index a6cf0fb26..5f97090a8 100644 if (iter != lookupAttributeId.end()) return (*iter).second; return ATTRIB_UNKNOWN.id; -@@ -587,10 +585,10 @@ inline uint4 AttributeId::find(const string &nm) +@@ -639,10 +636,10 @@ inline uint4 AttributeId::find(const string &nm) /// placeholder element, ELEM_UNKNOWN, is returned as a placeholder for elements with unrecognized names. /// \param nm is the name of the element /// \return the associated id @@ -7425,19 +6709,6 @@ index a6cf0fb26..5f97090a8 100644 if (iter != lookupElementId.end()) return (*iter).second; return ELEM_UNKNOWN.id; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc -index be9a570a0..621e2dda9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc -@@ -16,6 +16,8 @@ - #include "memstate.hh" - #include "translate.hh" - -+using namespace std; -+ - /// This is a static convenience routine for decoding a value from a sequence of bytes depending - /// on the desired endianness - /// \param ptr is the pointer to the bytes to decode diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.hh index 6a260c466..273d66cab 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.hh @@ -7482,19 +6753,6 @@ index 6a260c466..273d66cab 100644 void setValue(const VarnodeData *vn,uintb cval); ///< Set value on a given \b varnode uintb getValue(const VarnodeData *vn) const; ///< Get a value from a \b varnode void getChunk(uint1 *res,AddrSpace *spc,uintb off,int4 size) const; ///< Get a chunk of data from memory state -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc -index 2ada56f0e..4f94002e8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc -@@ -16,6 +16,8 @@ - #include "merge.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// This instance assumes the identity of the given Varnode and the defining index is - /// cached to facilitate quick sorting. - /// \param v is the given Varnode diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh index b3919111c..b024d2986 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh @@ -7575,21 +6833,8 @@ index b3919111c..b024d2986 100644 void mergeOpcode(OpCode opc); void mergeByDatatype(VarnodeLocSet::const_iterator startiter,VarnodeLocSet::const_iterator enditer); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -index 6267ed750..c8d31849f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -@@ -16,6 +16,8 @@ - #include "op.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_IOP = ElementId("iop",113); - ElementId ELEM_UNIMPL = ElementId("unimpl",114); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh -index da10d3380..1fa441f5a 100644 +index 7e9ca0098..0736ac7a3 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh @@ -37,10 +37,10 @@ class IopSpace : public AddrSpace { @@ -7659,7 +6904,7 @@ index da10d3380..1fa441f5a 100644 void encode(Encoder &encoder) const; ///< Encode a description of \b this op to stream /// \brief Retrieve the PcodeOp encoded as the address \e addr -@@ -275,11 +275,11 @@ class PieceNode { +@@ -276,11 +276,11 @@ class PieceNode { Varnode *getVarnode(void) const { return pieceOp->getIn(slot); } ///< Get the Varnode representing \b this piece static bool isLeaf(Varnode *rootVn,Varnode *vn,int4 typeOffset); static Varnode *findRoot(Varnode *vn); @@ -7673,7 +6918,7 @@ index da10d3380..1fa441f5a 100644 /// \brief Container class for PcodeOps associated with a single function /// -@@ -290,13 +290,13 @@ typedef map PcodeOpTree; +@@ -291,13 +291,13 @@ typedef map PcodeOpTree; /// Several lists group PcodeOps with important op-codes (like STORE and RETURN). class PcodeOpBank { PcodeOpTree optree; ///< The main sequence number sort @@ -7694,7 +6939,7 @@ index da10d3380..1fa441f5a 100644 uintm uniqid; ///< Counter for producing unique id's for each op void addToCodeList(PcodeOp *op); ///< Add given PcodeOp to specific op-code list void removeFromCodeList(PcodeOp *op); ///< Remove given PcodeOp from specific op-code list -@@ -335,22 +335,22 @@ class PcodeOpBank { +@@ -336,22 +336,22 @@ class PcodeOpBank { PcodeOpTree::const_iterator end(const Address &addr) const; /// \brief Start of all PcodeOps marked as \e alive @@ -7723,19 +6968,6 @@ index da10d3380..1fa441f5a 100644 }; extern int4 functionalEqualityLevel(Varnode *vn1,Varnode *vn2,Varnode **res1,Varnode **res2); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc -index 3e0c39904..f3dcaed3c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc -@@ -16,6 +16,8 @@ - #include "opbehavior.hh" - #include "translate.hh" - -+using namespace std; -+ - /// This routine generates a vector of OpBehavior objects indexed by opcode - /// \param inst is the vector of behaviors to be filled - /// \param trans is the translator object needed by the floating point behaviors diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh index 5061cb65f..ffec2e4ef 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh @@ -7758,28 +6990,15 @@ index 5061cb65f..ffec2e4ef 100644 }; /// This kind of OpBehavior is associated with a particular opcode and is either unary or binary -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc -index d116fe62d..100236b1e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc -@@ -16,6 +16,8 @@ - #include "opcodes.hh" - #include "types.h" - -+using namespace std; -+ - /// \brief Names of operations associated with their opcode number - /// - /// Some of the names have been replaced with special placeholder diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh -index 14ec99772..45e98662e 100644 +index 7c5cc64c5..1d9d612b3 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh @@ -21,8 +21,6 @@ #include --using namespace std; +-using std::string; - /// \brief The op-code defining a specific p-code operation (PcodeOp) /// @@ -7789,23 +7008,10 @@ index 14ec99772..45e98662e 100644 extern const char *get_opname(OpCode opc); ///< Convert an OpCode to the name as a string -extern OpCode get_opcode(const string &nm); ///< Convert a name string to the matching OpCode -+extern OpCode get_opcode(const std::string &nm); ///< Convert a name string to the matching OpCode ++extern OpCode get_opcode(const std::string &nm); ///< Convert a name string to the matching OpCode extern OpCode get_booleanflip(OpCode opc,bool &reorder); ///< Get the complementary OpCode -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc -index 0ee439e44..ab042112c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc -@@ -18,6 +18,8 @@ - #include "flow.hh" - #include "printc.hh" - -+using namespace std; -+ - ElementId ELEM_ALIASBLOCK = ElementId("aliasblock",174); - ElementId ELEM_ALLOWCONTEXTSET = ElementId("allowcontextset",175); - ElementId ELEM_ANALYZEFORLOOPS = ElementId("analyzeforloops",176); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/options.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/options.hh index 474ee7071..a36f35d7e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/options.hh @@ -8096,19 +7302,6 @@ index 474ee7071..a36f35d7e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc -index f64cb03ca..ca5d726c9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc -@@ -16,6 +16,8 @@ - #include "override.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_DEADCODEDELAY = ElementId("deadcodedelay",218); - ElementId ELEM_FLOW = ElementId("flow",219); - ElementId ELEM_FORCEGOTO = ElementId("forcegoto",220); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/override.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/override.hh index 1a76e46e1..c4d780feb 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/override.hh @@ -8152,19 +7345,6 @@ index 1a76e46e1..c4d780feb 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc -index 093a8b232..4ba724490 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc -@@ -15,6 +15,8 @@ - */ - #include "paramid.hh" - -+using namespace std; -+ - ElementId ELEM_PARAMMEASURES = ElementId("parammeasures",106); - ElementId ELEM_PROTO = ElementId("proto",107); - ElementId ELEM_RANK = ElementId("rank",108); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.hh index 7eb7d78c9..91aa7dfed 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.hh @@ -8201,18 +7381,19 @@ index 7eb7d78c9..91aa7dfed 100644 #endif //ifndef __CPUI_PARAMID__ diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh -index 41abc55a0..91851a005 100644 +index 4573f4960..e41558cdb 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh -@@ -199,7 +199,6 @@ template +@@ -199,8 +199,6 @@ template #if 0 #include --using namespace std; - +-using std::cout; +- int main(int argc,char **argv) -@@ -212,16 +211,16 @@ int main(int argc,char **argv) + { +@@ -212,16 +210,16 @@ int main(int argc,char **argv) data.split(3) = 4; data.split(3) = 3; @@ -8234,19 +7415,6 @@ index 41abc55a0..91851a005 100644 ++iter; } } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc -index 133da8178..ce8a0f834 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc -@@ -15,6 +15,8 @@ - */ - #include "pcodecompile.hh" - -+using namespace std; -+ - string Location::format(void) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.hh index 3c7f2b26f..6b44c2af2 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.hh @@ -8352,21 +7520,8 @@ index 3c7f2b26f..6b44c2af2 100644 static bool propagateSize(ConstructTpl *ct); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc -index 7a317f47f..d6678a5ca 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc -@@ -16,6 +16,8 @@ - #include "pcodeinject.hh" - #include "architecture.hh" - -+using namespace std; -+ - AttributeId ATTRIB_DYNAMIC = AttributeId("dynamic",70); - AttributeId ATTRIB_INCIDENTALCOPY = AttributeId("incidentalcopy",71); - AttributeId ATTRIB_INJECT = AttributeId("inject",72); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh -index d57215bc7..fac6c3f7d 100644 +index d57215bc7..2d558ac55 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh @@ -52,12 +52,12 @@ extern ElementId ELEM_SIZE_PCODE; ///< Marshaling element \ @@ -8486,7 +7641,7 @@ index d57215bc7..fac6c3f7d 100644 + std::vector callOtherTarget; ///< Map from injectid to callother-fixup target-op name + std::vector callMechTarget; ///< Map from injectid to call-mech name + std::vector scriptNames; ///< Map from injectid to script name -+ void registerCallFixup(const std::string &fixupName,int4 injectid/* , std::vector targets */); ++ void registerCallFixup(const std::string &fixupName,int4 injectid/* , vector targets */); + void registerCallOtherFixup(const std::string &fixupName,int4 injectid); + void registerCallMechanism(const std::string &fixupName,int4 injectid); + void registerExeScript(const std::string &scriptName,int4 injectid); @@ -8549,19 +7704,6 @@ index d57215bc7..fac6c3f7d 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc -index c562c0f83..4d67e8a6e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc -@@ -89,6 +89,8 @@ - - #include "pcodeparse.hh" - -+using namespace std; -+ - //#define YYERROR_VERBOSE - extern int yylex(void); - static PcodeSnippet *pcode; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.hh index 587604237..cca442307 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.hh @@ -8625,32 +7767,6 @@ index 587604237..cca442307 100644 }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y -index c858fa148..46480a5ad 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y -@@ -16,6 +16,8 @@ - %{ - #include "pcodeparse.hh" - -+using namespace std; -+ - //#define YYERROR_VERBOSE - extern int yylex(void); - static PcodeSnippet *pcode; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc -index 317d4dbf1..5221185f8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc -@@ -16,6 +16,8 @@ - #include "pcoderaw.hh" - #include "translate.hh" - -+using namespace std; -+ - /// Build this VarnodeData from an \, \, or \ element. - /// \param decoder is the stream decoder - void VarnodeData::decode(Decoder &decoder) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh index fd70a956e..bab636fcc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh @@ -8664,19 +7780,6 @@ index fd70a956e..bab636fcc 100644 public: void setBehavior(OpBehavior *be); ///< Set the opcode for this op OpBehavior *getBehavior(void) const; ///< Retrieve the behavior for this op -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc -index 635941885..e1267e610 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc -@@ -16,6 +16,8 @@ - #include "prefersplit.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_PREFERSPLIT = ElementId("prefersplit",225); - - bool PreferSplitRecord::operator<(const PreferSplitRecord &op2) const diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.hh index 9654ceedd..7e517620c 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.hh @@ -8704,19 +7807,6 @@ index 9654ceedd..7e517620c 100644 void split(void); void splitAdditional(void); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc -index 388708030..fa631ccf1 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc -@@ -16,6 +16,8 @@ - #include "prettyprint.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_BLOCKREF = AttributeId("blockref",35); - AttributeId ATTRIB_CLOSE = AttributeId("close",36); - AttributeId ATTRIB_COLOR = AttributeId("color",37); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh index cc81dad23..046ac8b40 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh @@ -9121,19 +8211,6 @@ index cc81dad23..046ac8b40 100644 virtual bool emitsMarkup(void) const { return lowlevel->emitsMarkup(); } virtual void resetDefaults(void); void setMarkup(bool val); ///< Toggle whether the low-level emitter emits markup or not -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc -index d93f044fb..d85e51e8b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc -@@ -16,6 +16,8 @@ - #include "printc.hh" - #include "funcdata.hh" - -+using namespace std; -+ - // Operator tokens for expressions - // token #in prec assoc optype space bump - OpToken PrintC::hidden = { "", "", 1, 70, false, OpToken::hiddenfunction, 0, 0, (OpToken *)0 }; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh index 6c7d79988..186c79f86 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh @@ -9263,19 +8340,6 @@ index 6c7d79988..186c79f86 100644 virtual void docTypeDefinitions(const TypeFactory *typegrp); virtual void docAllGlobals(void); virtual void docSingleGlobal(const Symbol *sym); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc -index 473bab08a..a193e8688 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc -@@ -16,6 +16,8 @@ - #include "printjava.hh" - #include "funcdata.hh" - -+using namespace std; -+ - OpToken PrintJava::instanceof = { "instanceof", "", 2, 60, true, OpToken::binary, 1, 0, (OpToken *)0 }; - - // Constructing this registers the capability diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.hh index f3f200d11..d95adf12a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.hh @@ -9292,19 +8356,6 @@ index f3f200d11..d95adf12a 100644 virtual void resetDefaults(void); virtual void docFunction(const Funcdata *fd); virtual void pushTypeStart(const Datatype *ct,bool noident); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc -index a693042de..6e0e08b70 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc -@@ -17,6 +17,8 @@ - #include "printlanguage.hh" - #include "funcdata.hh" - -+using namespace std; -+ - const string PrintLanguage::OPEN_PAREN = "("; - const string PrintLanguage::CLOSE_PAREN = ")"; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh index 497e968c7..a5e4db314 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh @@ -9488,19 +8539,6 @@ index 497e968c7..a5e4db314 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc -index d98998426..3d17317f8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc -@@ -16,6 +16,8 @@ - #include "rangeutil.hh" - #include "block.hh" - -+using namespace std; -+ - const char CircleRange::arrange[] = "gcgbegdagggggggeggggcgbggggggggcdfgggggggegdggggbgggfggggcgbegda"; - - /// All the instantiations where left == right represent the same set. We diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.hh index e4f37b063..f046fba21 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.hh @@ -9599,19 +8637,6 @@ index e4f37b063..f046fba21 100644 #endif }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc -index 3b83cf3ce..aab606e5d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc -@@ -15,6 +15,8 @@ - */ - #include "raw_arch.hh" - -+using namespace std; -+ - ElementId ELEM_RAW_SAVEFILE = ElementId("raw_savefile",237); - - // Constructing this object registers the capability diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh index 490abf901..23580df2f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh @@ -9636,21 +8661,8 @@ index 490abf901..23580df2f 100644 virtual ~RawBinaryArchitecture(void) {} }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -index c84df0848..0834161dc 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -@@ -18,6 +18,8 @@ - #include "subflow.hh" - #include "rangeutil.hh" - -+using namespace std; -+ - /// \class RuleEarlyRemoval - /// \brief Get rid of unused PcodeOp objects where we can guarantee the output is unused - int4 RuleEarlyRemoval::applyOp(PcodeOp *op,Funcdata &data) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh -index 325c62987..b7324cea9 100644 +index 325c62987..02e38ca80 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh @@ -52,9 +52,9 @@ class AddTreeState { @@ -9675,16 +8687,7 @@ index 325c62987..b7324cea9 100644 virtual Rule *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Rule *)0; return new RuleEarlyRemoval(getGroup()); -@@ -92,180 +92,180 @@ class RuleEarlyRemoval : public Rule { - }; - // class RuleAddrForceRelease : public Rule { - // public: --// RuleAddrForceRelease(const string &g) : Rule(g, 0, "addrforcerelease") {} ///< Constructor --// virtual void getOpList(vector &oplist) const; -+// RuleAddrForceRelease(const std::string &g) : Rule(g, 0, "addrforcerelease") {} ///< Constructor -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); - // }; +@@ -99,173 +99,173 @@ class RuleEarlyRemoval : public Rule { class RuleCollectTerms : public Rule { static Varnode *getMultCoeff(Varnode *vn,uintb &coef); ///< Get the multiplicative coefficient public: @@ -9892,7 +8895,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); static void minMaxUse(Varnode *vn,int4 &maxByte,int4 &minByte); static void replaceDescendants(Varnode *origVn,Varnode *newVn,int4 maxByte,int4 minByte,Funcdata &data); -@@ -275,389 +275,389 @@ class RulePullsubMulti : public Rule { +@@ -275,173 +275,173 @@ class RulePullsubMulti : public Rule { }; class RulePullsubIndirect : public Rule { public: @@ -10100,16 +9103,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleShiftLess : public Rule { - // public: --// RuleShiftLess(const string &g) : Rule(g, 0, "shiftless") {} ///< Constructor -+// RuleShiftLess(const std::string &g) : Rule(g, 0, "shiftless") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleShiftLess(getGroup()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); +@@ -456,208 +456,208 @@ class RuleShiftCompare : public Rule { // }; class RuleLessEqual : public Rule { public: @@ -10381,7 +9375,7 @@ index 325c62987..b7324cea9 100644 virtual Rule *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Rule *)0; return new RulePropagateCopy(getGroup()); -@@ -687,62 +687,62 @@ class RulePropagateCopy : public Rule { +@@ -687,52 +687,52 @@ class RulePropagateCopy : public Rule { }; class Rule2Comp2Mult : public Rule { public: @@ -10444,19 +9438,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleUndistribute : public Rule { - // public: --// RuleUndistribute(const string &g) : Rule(g, 0, "undistribute") {} ///< Constructor -+// RuleUndistribute(const std::string &g) : Rule(g, 0, "undistribute") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleUndistribute(Group()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); - // }; - class RuleLoadVarnode : public Rule { -@@ -751,397 +751,397 @@ class RuleLoadVarnode : public Rule { +@@ -751,22 +751,22 @@ class RuleLoadVarnode : public Rule { static AddrSpace *vnSpacebase(Architecture *glb,Varnode *vn,uintb &val,AddrSpace *spc); static AddrSpace *checkSpacebase(Architecture *glb,PcodeOp *op,uintb &offoff); public: @@ -10483,16 +9465,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleShadowVar : public Rule { - // public: --// RuleShadowVar(const string &g) : Rule(g, 0, "shadowvar") {} ///< Constructor -+// RuleShadowVar(const std::string &g) : Rule(g, 0, "shadowvar") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleShadowVar(getGroup()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); +@@ -781,33 +781,33 @@ class RuleStoreVarnode : public Rule { // }; class RuleSubExtComm : public Rule { public: @@ -10532,16 +9505,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleIndirectConcat : public Rule { - // public: --// RuleIndirectConcat(const string &g) : Rule(g, 0, "indirectconcat") {} ///< Constructor -+// RuleIndirectConcat(const std::string &g) : Rule(g, 0, "indirectconcat") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleIndirectConcat(getGroup()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); +@@ -822,326 +822,326 @@ class RuleConcatCommute : public Rule { // }; class RuleConcatZext : public Rule { public: @@ -10931,7 +9895,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; -@@ -1150,71 +1150,71 @@ class RulePieceStructure : public Rule { +@@ -1150,26 +1150,26 @@ class RulePieceStructure : public Rule { static Datatype *determineDatatype(Varnode *vn,int4 &baseOffset); static bool spanningRange(Datatype *ct,int4 off,int4 size); static bool convertZextToPiece(PcodeOp *zext,Datatype *structuredType,int4 offset,Funcdata &data); @@ -10963,18 +9927,7 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; - // class RuleRightShiftSub : public Rule { - // public: --// RuleRightShiftSub(const string &g) : Rule( g, 0, "rightshiftsub") {} ///< Constructor -+// RuleRightShiftSub(const std::string &g) : Rule( g, 0, "rightshiftsub") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleRightShiftSub(Group()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); - // }; +@@ -1186,35 +1186,35 @@ class RuleSubNormal : public Rule { class RulePositiveDiv : public Rule { public: @@ -11423,19 +10376,6 @@ index 325c62987..b7324cea9 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc -index af4e191c7..eeb7cc1f7 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc -@@ -17,6 +17,8 @@ - #include "rulecompile.hh" - #include "ruleparse.hh" - -+using namespace std; -+ - RuleCompile *rulecompile; - extern int4 ruleparsedebug; - extern int4 ruleparseparse(void); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh index 8cce8fc2f..23c656384 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh @@ -11551,32 +10491,6 @@ index 8cce8fc2f..23c656384 100644 }; /* -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y -index 3d3ced687..aceb52b9a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y -@@ -17,6 +17,8 @@ - #ifdef CPUI_RULECOMPILE - #include "rulecompile.hh" - -+using namespace std; -+ - #define YYERROR_VERBOSE - - extern RuleCompile *rulecompile; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc -index 1c9ab7560..a791a3348 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc -@@ -16,6 +16,8 @@ - #include "semantics.hh" - #include "translate.hh" - -+using namespace std; -+ - ConstTpl::ConstTpl(const_type tp) - - { // Constructor for relative jump constants and uniques diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh index 1fbd169c9..de1f10961 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh @@ -11695,21 +10609,8 @@ index 1fbd169c9..de1f10961 100644 int4 restoreXml(const Element *el,const AddrSpaceManager *manage); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc -index 0fd86e645..b33cf85d2 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc -@@ -16,6 +16,8 @@ - #include "sleigh.hh" - #include "loadimage.hh" - -+using namespace std; -+ - PcodeCacher::PcodeCacher(void) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh -index 74fc5cbf8..c003c55f4 100644 +index 74fc5cbf8..ab07b2e7b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh @@ -57,9 +57,9 @@ class PcodeCacher { @@ -11736,60 +10637,6 @@ index 74fc5cbf8..c003c55f4 100644 virtual void allowContextSet(bool val) const; virtual int4 instructionLength(const Address &baseaddr) const; virtual int4 oneInstruction(PcodeEmit &emit,const Address &baseaddr) const; -@@ -327,8 +327,8 @@ class Sleigh : public SleighBase { - - // Set up the loadimage - // Providing an executable name and architecture -- string loadimagename = "x86testcode"; -- string bfdtarget= "default"; -+ std::string loadimagename = "x86testcode"; -+ std::string bfdtarget= "default"; - - loader = new LoadImageBfd(loadimagename,bfdtarget); - loader->open(); // Load the executable from file -@@ -345,7 +345,7 @@ class Sleigh : public SleighBase { - this. - - \code -- string sleighfilename = "specfiles/x86.sla"; -+ std::string sleighfilename = "specfiles/x86.sla"; - DocumentStorage docstorage; - Element *sleighroot = docstorage.openDocument(sleighfilename)->getRoot(); - docstorage.registerTag(sleighroot); -@@ -365,7 +365,7 @@ class Sleigh : public SleighBase { - \code - class AssemblyRaw : public AssemblyEmit { - public: -- virtual void dump(const Address &addr,const string &mnem,const string &body) { -+ virtual void dump(const Address &addr,const std::string &mnem,const std::string &body) { - addr.printRaw(cout); - cout << ": " << mnem << ' ' << body << endl; - } -@@ -484,9 +484,9 @@ class Sleigh : public SleighBase { - \code - class MyLoadImage : public LoadImage { - public: -- MyLoadImage(const string &nm) : Loadimage(nm) {} -+ MyLoadImage(const std::string &nm) : Loadimage(nm) {} - virtual void loadFill(uint1 *ptr,int4 size,const Address &addr); -- virtual string getArchType(void) const { return "mytype"; } -+ virtual std::string getArchType(void) const { return "mytype"; } - virtual void adjustVma(long adjust) {} - }; - \endcode -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc -index aebec0e4c..4ff7b336d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc -@@ -16,6 +16,8 @@ - #include "sleigh_arch.hh" - #include "inject_sleigh.hh" - -+using namespace std; -+ - AttributeId ATTRIB_DEPRECATED = AttributeId("deprecated",136); - AttributeId ATTRIB_ENDIAN = AttributeId("endian",137); - AttributeId ATTRIB_PROCESSOR = AttributeId("processor",138); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh index 203a33ee6..467675555 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh @@ -11924,19 +10771,6 @@ index 203a33ee6..467675555 100644 static void shutdown(void); ///< Shutdown all Translate objects and free global resources. static FileManage specpaths; ///< Known directories that contain .ldefs files. }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc -index 6b170df8e..4511dbb65 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc -@@ -15,6 +15,8 @@ - */ - #include "sleighbase.hh" - -+using namespace std; -+ - const int4 SleighBase::SLA_FORMAT_VERSION = 3; - - const uint4 SleighBase::MAX_UNIQUE_SIZE = 128; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.hh index 560c5a203..0f96de8c6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.hh @@ -12007,37 +10841,22 @@ index 560c5a203..0f96de8c6 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc -index 87a4d7980..3ed0c3390 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc -@@ -22,6 +22,8 @@ - #include "emulate.hh" - #include - -+using namespace std; -+ - // These are the bytes for an example x86 binary - // These bytes are loaded at address 0x80483b4 - static uint1 myprog[] = { -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -index 7d09dd209..d8e1041ae 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -@@ -17,6 +17,8 @@ - #include "filemanage.hh" - #include - -+using namespace std; -+ - SleighCompile *slgh; // Global pointer to sleigh object for use with parser - #ifdef YYDEBUG - extern int yydebug; // Global debugging state for parser diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh -index 8fd9ba2fd..c4971d04e 100644 +index 2b18e10fc..c4971d04e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh -@@ -51,7 +51,7 @@ struct RtlPair { +@@ -25,10 +25,6 @@ + #include + #include + +-using std::cout; +-using std::cerr; +-using std::out_of_range; +- + /// \brief A helper class to associate a \e named Constructor section with its symbol scope + /// + /// A Constructor can contain multiple named sections of p-code. There is a \e main +@@ -55,7 +51,7 @@ struct RtlPair { class SectionVector { int4 nextindex; ///< Index of the section currently being parsed. RtlPair main; ///< The main section @@ -12046,7 +10865,7 @@ index 8fd9ba2fd..c4971d04e 100644 public: SectionVector(ConstructTpl *rtl,SymbolScope *scope); ///< Constructor ConstructTpl *getMainSection(void) const { return main.section; } ///< Get the \e main section -@@ -73,12 +73,12 @@ struct SpaceQuality { +@@ -77,12 +73,12 @@ struct SpaceQuality { ramtype, ///< An address space representing normal, indexed, memory registertype ///< An address space containing registers }; @@ -12061,7 +10880,7 @@ index 8fd9ba2fd..c4971d04e 100644 }; /// \brief Qualities associated (via parsing) with a token or context \b field -@@ -87,13 +87,13 @@ struct SpaceQuality { +@@ -91,13 +87,13 @@ struct SpaceQuality { /// are parsed in of a \b define \b token block prior to formally allocating the /// TokenField or FieldContext object. struct FieldQuality { @@ -12077,7 +10896,7 @@ index 8fd9ba2fd..c4971d04e 100644 }; /// \brief Subtable, pattern, and context information applied across a \b with block -@@ -104,14 +104,14 @@ struct FieldQuality { +@@ -108,14 +104,14 @@ struct FieldQuality { class WithBlock { SubtableSymbol *ss; ///< Subtable containing each Constructor (or null for root table) PatternEquation *pateq; ///< Pattern to prepend to each Constructor (or null) @@ -12097,7 +10916,7 @@ index 8fd9ba2fd..c4971d04e 100644 }; class SleighCompile; -@@ -161,11 +161,11 @@ class ConsistencyChecker { +@@ -165,11 +161,11 @@ class ConsistencyChecker { bool printdeadwarning; ///< Set to \b true if warning emitted for each written but not read temporary bool printlargetempwarning; ///< Set to \b true if warning emitted for each too large temporary SubtableSymbol *root_symbol; ///< The root symbol table for the parsed SLEIGH file @@ -12113,7 +10932,7 @@ index 8fd9ba2fd..c4971d04e 100644 int4 recoverSize(const ConstTpl &sizeconst,Constructor *ct); bool checkOpMisuse(OpTpl *op,Constructor *ct); bool sizeRestriction(OpTpl *op,Constructor *ct); -@@ -180,14 +180,14 @@ class ConsistencyChecker { +@@ -184,14 +180,14 @@ class ConsistencyChecker { void setPostOrder(SubtableSymbol *root); // Optimization routines @@ -12133,7 +10952,7 @@ index 8fd9ba2fd..c4971d04e 100644 void checkLargeTemporaries(Constructor *ct,ConstructTpl *ctpl); void optimize(Constructor *ct); public: -@@ -224,14 +224,14 @@ struct FieldContext { +@@ -228,14 +224,14 @@ struct FieldContext { class MacroBuilder : public PcodeBuilder { SleighCompile *slgh; ///< The SLEIGH parsing object bool haserror; ///< Set to \b true by the build() method if there was an error @@ -12153,7 +10972,7 @@ index 8fd9ba2fd..c4971d04e 100644 slgh = sl; haserror = false; } ///< Constructor void setMacroOp(OpTpl *macroop); ///< Establish the MACRO directive to expand bool hasError(void) const { return haserror; } ///< Return \b true if there were errors during expansion -@@ -251,8 +251,8 @@ class SleighPcode : public PcodeCompile { +@@ -255,8 +251,8 @@ class SleighPcode : public PcodeCompile { SleighCompile *compiler; ///< The main SLEIGH parser virtual uint4 allocateTemp(void); virtual const Location *getLocation(SleighSymbol *sym) const; @@ -12164,7 +10983,7 @@ index 8fd9ba2fd..c4971d04e 100644 virtual void addSymbol(SleighSymbol *sym); public: SleighPcode(void) : PcodeCompile() { compiler = (SleighCompile *)0; } ///< Constructor -@@ -272,21 +272,21 @@ class SleighCompile : public SleighBase { +@@ -276,21 +272,21 @@ class SleighCompile : public SleighBase { public: SleighPcode pcode; ///< The p-code parsing (sub)engine private: @@ -12198,7 +11017,7 @@ index 8fd9ba2fd..c4971d04e 100644 int4 userop_count; ///< Number of userops defined bool warnunnecessarypcode; ///< \b true if we warn of unnecessary ZEXT or SEXT bool warndeadtemps; ///< \b true if we warn of temporaries that are written but not read -@@ -295,7 +295,7 @@ class SleighCompile : public SleighBase { +@@ -299,7 +295,7 @@ class SleighCompile : public SleighBase { bool warnalllocalcollisions; ///< \b true if local export collisions generate individual warnings bool warnallnops; ///< \b true if pcode NOPs generate individual warnings bool failinsensitivedups; ///< \b true if case insensitive register duplicates cause error @@ -12207,7 +11026,7 @@ index 8fd9ba2fd..c4971d04e 100644 mutable Location currentLocCache; ///< Location for (last) request of current location int4 errors; ///< Number of fatal errors encountered -@@ -305,14 +305,14 @@ class SleighCompile : public SleighBase { +@@ -309,14 +305,14 @@ class SleighCompile : public SleighBase { void buildDecisionTrees(void); ///< Build decision trees for all subtables void buildPatterns(void); ///< Generate final match patterns based on parse constraint equations void checkConsistency(void); ///< Perform final consistency checks on the SLEIGH definitions @@ -12225,7 +11044,7 @@ index 8fd9ba2fd..c4971d04e 100644 bool expandMacros(ConstructTpl *ctpl); ///< Expand any formal SLEIGH macros in the given section of p-code bool finalizeSections(Constructor *big,SectionVector *vec); ///< Do final checks, expansions, and linking for p-code sections -@@ -322,17 +322,17 @@ class SleighCompile : public SleighBase { +@@ -326,17 +322,17 @@ class SleighCompile : public SleighBase { static void shiftUniqueOp(OpTpl *op,int4 sa); static void shiftUniqueHandle(HandleTpl *hand,int4 sa); static void shiftUniqueConstruct(ConstructTpl *tpl,int4 sa); @@ -12248,7 +11067,7 @@ index 8fd9ba2fd..c4971d04e 100644 int4 numErrors(void) const { return errors; } ///< Return the current number of fatal errors uint4 getUniqueAddr(void); ///< Get the next available temporary register offset -@@ -379,21 +379,21 @@ class SleighCompile : public SleighBase { +@@ -383,21 +379,21 @@ class SleighCompile : public SleighBase { // Lexer functions void calcContextLayout(void); ///< Calculate the internal context field layout @@ -12277,7 +11096,7 @@ index 8fd9ba2fd..c4971d04e 100644 void setEndian(int4 end); /// \brief Set instruction alignment for the SLEIGH specification -@@ -401,36 +401,36 @@ class SleighCompile : public SleighBase { +@@ -405,36 +401,36 @@ class SleighCompile : public SleighBase { /// \param val is the alignment value in bytes. 1 is the default indicating no alignment void setAlignment(int4 val) { alignment = val; } @@ -12330,7 +11149,7 @@ index 8fd9ba2fd..c4971d04e 100644 void buildMacro(MacroSymbol *sym,ConstructTpl *rtl); void recordNop(void); -@@ -440,11 +440,11 @@ class SleighCompile : public SleighBase { +@@ -444,11 +440,11 @@ class SleighCompile : public SleighBase { virtual int4 oneInstruction(PcodeEmit &emit,const Address &baseaddr) const { return 0; } virtual int4 printAssembly(AssemblyEmit &emit,const Address &baseaddr) const { return 0; } @@ -12344,19 +11163,6 @@ index 8fd9ba2fd..c4971d04e 100644 }; extern SleighCompile *slgh; ///< A global reference to the SLEIGH compiler accessible to the parse functions -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc -index 746d70a81..bd4aa1b77 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc -@@ -81,6 +81,8 @@ - - #include "slgh_compile.hh" - -+using namespace std; -+ - #define YYERROR_VERBOSE - - extern SleighCompile *slgh; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh index f52fe7abb..4bc7f292d 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh @@ -12393,34 +11199,8 @@ index f52fe7abb..4bc7f292d 100644 SleighSymbol *anysym; SpaceSymbol *spacesym; SectionSymbol *sectionsym; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y -index b3fedb7b6..0e2172f79 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y -@@ -16,6 +16,8 @@ - %{ - #include "slgh_compile.hh" - -+using namespace std; -+ - #define YYERROR_VERBOSE - - extern SleighCompile *slgh; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc -index 3b7534f09..f6f4f029d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc -@@ -16,6 +16,8 @@ - #include "slghpatexpress.hh" - #include "sleighbase.hh" - -+using namespace std; -+ - int4 TokenPattern::resolveTokens(const TokenPattern &tok1,const TokenPattern &tok2) - - { // Use the token lists to decide how the two patterns diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh -index 8c748c2ce..7aa030a45 100644 +index 8c748c2ce..69e7e170b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh @@ -20,7 +20,7 @@ @@ -12459,7 +11239,7 @@ index 8c748c2ce..7aa030a45 100644 - virtual void listValues(vector &list) const { list.push_back(this); } - virtual void getMinMax(vector &minlist,vector &maxlist) const { + virtual void listValues(std::vector &list) const { list.push_back(this); } -+ virtual void getMinMax(std::vector &minlist,std::vector &maxlist) const { ++ virtual void getMinMax(std::vector &minlist,std::vector &maxlist) const { minlist.push_back(minValue()); maxlist.push_back(maxValue()); } - virtual intb getSubValue(const vector &replace,int4 &listpos) const { return replace[listpos++]; } + virtual intb getSubValue(const std::vector &replace,int4 &listpos) const { return replace[listpos++]; } @@ -12869,19 +11649,6 @@ index 8c748c2ce..7aa030a45 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc -index 4ebeaa000..9cb0803eb 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc -@@ -15,6 +15,8 @@ - */ - #include "slghpattern.hh" - -+using namespace std; -+ - uintm DisjointPattern::getMask(int4 startbit,int4 size,bool context) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh index 05b98e00a..153164e9a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh @@ -12969,49 +11736,8 @@ index 05b98e00a..153164e9a 100644 virtual void restoreXml(const Element *el); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc -index 1ac87e2cd..20cbf21e4 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc -@@ -888,6 +888,9 @@ char *yytext; - #line 18 "slghscan.l" - #include "slgh_compile.hh" - #include "slghparse.hh" -+ -+using namespace std; -+ - #define yywrap() 1 - #define YY_SKIP_YYWRAP - -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l -index 2df137019..f2341ef09 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l -@@ -17,6 +17,9 @@ - %{ - #include "slgh_compile.hh" - #include "slghparse.hh" -+ -+using namespace std; -+ - #define yywrap() 1 - #define YY_SKIP_YYWRAP - -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -index 85bd54261..22dc50d0d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -@@ -17,6 +17,8 @@ - #include "sleighbase.hh" - #include - -+using namespace std; -+ - SleighSymbol *SymbolScope::addSymbol(SleighSymbol *a) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh -index 82d95ffef..e07f85e2b 100644 +index 82d95ffef..2327854a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh @@ -29,19 +29,19 @@ class SleighSymbol { @@ -13297,7 +12023,7 @@ index 82d95ffef..e07f85e2b 100644 public: VarnodeListSymbol(void) {} // For use with restoreXml - VarnodeListSymbol(const string &nm,PatternValue *pv,const vector &vt); -+ VarnodeListSymbol(const std::string &nm,PatternValue *pv,const std::vector &vt); ++ VarnodeListSymbol(const std::string &nm,PatternValue *pv,const std::vector &vt); virtual Constructor *resolve(ParserWalker &walker); virtual void getFixedHandle(FixedHandle &hand,ParserWalker &walker) const; virtual int4 getSize(void) const; @@ -13627,24 +12353,11 @@ index 82d95ffef..e07f85e2b 100644 uint4 getIndex(void) const { return index; } void incrementRefCount(void) { refcount += 1; } uint4 getRefCount(void) const { return refcount; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -index ff6f282ca..b8ac04e72 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -@@ -18,6 +18,8 @@ - - #include - -+using namespace std; -+ - AttributeId ATTRIB_BASE = AttributeId("base",89); - AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90); - AttributeId ATTRIB_DELAY = AttributeId("delay", 91); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh -index 92209bd30..e25e3f79e 100644 +index bf4913d41..8afa862b9 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh -@@ -113,7 +113,7 @@ class AddrSpace { +@@ -105,7 +105,7 @@ class AddrSpace { uintb pointerUpperBound; ///< Offset above which we don't search for pointers char shortcut; ///< Shortcut character for printing protected: @@ -13653,7 +12366,7 @@ index 92209bd30..e25e3f79e 100644 uint4 addressSize; ///< Size of an address into this space in bytes uint4 wordsize; ///< Size of unit being addressed (1=byte) int4 minimumPointerSize; ///< Smallest size of a pointer into \b this space (in bytes) -@@ -123,14 +123,14 @@ class AddrSpace { +@@ -115,14 +115,14 @@ class AddrSpace { void calcScaleMask(void); ///< Calculate scale and mask void setFlags(uint4 fl); ///< Set a cached attribute void clearFlags(uint4 fl); ///< Clear a cached attribute @@ -13671,7 +12384,7 @@ index 92209bd30..e25e3f79e 100644 AddrSpaceManager *getManager(void) const; ///< Get the space manager const Translate *getTrans(void) const; ///< Get the processor translator spacetype getType(void) const; ///< Get the type of space -@@ -156,7 +156,7 @@ class AddrSpace { +@@ -148,7 +148,7 @@ class AddrSpace { bool isOtherSpace(void) const; ///< Return \b true if \b this is the \e other address space bool isTruncated(void) const; ///< Return \b true if this space is truncated from its original size bool hasNearPointers(void) const; ///< Return \b true if \e near (truncated) pointers into \b this space are possible @@ -13680,7 +12393,7 @@ index 92209bd30..e25e3f79e 100644 virtual int4 numSpacebase(void) const; ///< Number of base registers associated with this space virtual const VarnodeData &getSpacebase(int4 i) const; ///< Get a base register that creates this virtual space -@@ -166,9 +166,9 @@ class AddrSpace { +@@ -159,9 +159,9 @@ class AddrSpace { virtual void encodeAttributes(Encoder &encoder,uintb offset) const; ///< Encode address attributes to a stream virtual void encodeAttributes(Encoder &encoder,uintb offset,int4 size) const; ///< Encode an address and size attributes to a stream virtual uintb decodeAttributes(Decoder &decoder,uint4 &size) const; ///< Recover an offset and size @@ -13693,10 +12406,10 @@ index 92209bd30..e25e3f79e 100644 virtual void decode(Decoder &decoder); ///< Recover the details of this space from XML static uintb addressToByte(uintb val,uint4 ws); ///< Scale from addressable units to byte units -@@ -193,10 +193,10 @@ class AddrSpace { - class ConstantSpace : public AddrSpace { +@@ -187,10 +187,10 @@ class ConstantSpace : public AddrSpace { public: ConstantSpace(AddrSpaceManager *m,const Translate *t); ///< Only constructor + virtual int4 overlapJoin(uintb offset,int4 size,AddrSpace *pointSpace,uintb pointOff,int4 pointSkip) const; - virtual void printRaw(ostream &s,uintb offset) const; - virtual void saveXml(ostream &s) const; + virtual void printRaw(std::ostream &s,uintb offset) const; @@ -13707,7 +12420,7 @@ index 92209bd30..e25e3f79e 100644 static const int4 INDEX; ///< Reserved index for constant space }; -@@ -205,9 +205,9 @@ class OtherSpace : public AddrSpace { +@@ -199,9 +199,9 @@ class OtherSpace : public AddrSpace { public: OtherSpace(AddrSpaceManager *m, const Translate *t, int4 ind); ///< Constructor OtherSpace(AddrSpaceManager *m, const Translate *t); ///< For use with decode @@ -13720,7 +12433,7 @@ index 92209bd30..e25e3f79e 100644 static const int4 INDEX; ///< Reserved index for the other space }; -@@ -224,8 +224,8 @@ class UniqueSpace : public AddrSpace { +@@ -218,8 +218,8 @@ class UniqueSpace : public AddrSpace { public: UniqueSpace(AddrSpaceManager *m,const Translate *t,int4 ind,uint4 fl); ///< Constructor UniqueSpace(AddrSpaceManager *m,const Translate *t); ///< For use with decode @@ -13731,7 +12444,7 @@ index 92209bd30..e25e3f79e 100644 static const uint4 SIZE; ///< Fixed size (in bytes) for unique space offsets }; -@@ -243,11 +243,11 @@ class JoinSpace : public AddrSpace { +@@ -239,11 +239,11 @@ class JoinSpace : public AddrSpace { virtual void encodeAttributes(Encoder &encoder,uintb offset) const; virtual void encodeAttributes(Encoder &encoder,uintb offset,int4 size) const; virtual uintb decodeAttributes(Decoder &decoder,uint4 &size) const; @@ -13747,7 +12460,7 @@ index 92209bd30..e25e3f79e 100644 }; /// \brief An overlay space. -@@ -263,7 +263,7 @@ class OverlaySpace : public AddrSpace { +@@ -259,7 +259,7 @@ class OverlaySpace : public AddrSpace { public: OverlaySpace(AddrSpaceManager *m,const Translate *t); ///< Constructor virtual AddrSpace *getContain(void) const { return baseSpace; } @@ -13756,7 +12469,7 @@ index 92209bd30..e25e3f79e 100644 virtual void decode(Decoder &decoder); }; -@@ -282,7 +282,7 @@ inline void AddrSpace::clearFlags(uint4 fl) { +@@ -278,7 +278,7 @@ inline void AddrSpace::clearFlags(uint4 fl) { /// Every address space has a (unique) name, which is referred /// to especially in configuration files via XML. /// \return the name of this space @@ -13765,19 +12478,6 @@ index 92209bd30..e25e3f79e 100644 return name; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc -index 080f543ce..eb10514d1 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "string_ghidra.hh" - -+using namespace std; -+ - GhidraStringManager::GhidraStringManager(ArchitectureGhidra *g,int4 max) - : StringManager(max) - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.hh index 884e7e671..af81276ed 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.hh @@ -13791,19 +12491,6 @@ index 884e7e671..af81276ed 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc -index 220210a1c..a1324ca46 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc -@@ -16,6 +16,8 @@ - #include "stringmanage.hh" - #include "architecture.hh" - -+using namespace std; -+ - AttributeId ATTRIB_TRUNC = AttributeId("trunc",69); - - ElementId ELEM_BYTES = ElementId("bytes",83); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh index 8a227c69e..f6f5bcb4e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh @@ -13848,19 +12535,6 @@ index 8a227c69e..f6f5bcb4e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc -index 8f6835b3f..2a79f2942 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc -@@ -15,6 +15,8 @@ - */ - #include "subflow.hh" - -+using namespace std; -+ - /// \brief Return \e slot of constant if INT_OR op sets all bits in mask, otherwise -1 - /// - /// \param orop is the given CPUI_INT_OR op diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh index d3c5983b8..741af41d2 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh @@ -13918,34 +12592,53 @@ index d3c5983b8..741af41d2 100644 bool allowSubpieceTerminator; ///< \b true if we allow lanes to be cast (via SUBPIECE) to a smaller integer size TransformVar *setReplacement(Varnode *vn,int4 numLanes,int4 skipLanes); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc -index 4d9b612d0..f5cd4030c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc -@@ -16,6 +16,8 @@ - #include "test.hh" - #include "libdecomp.hh" +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh +index b593db91f..a0b4326be 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.hh +@@ -33,14 +33,6 @@ + #include + #include -+using namespace std; -+ - vector UnitTest::tests; +-using std::vector; +-using std::set; +-using std::string; +-using std::ostringstream; +-using std::cout; +-using std::cerr; +-using std::endl; +- + typedef void (*testfunc_t)(); ///< A unit-test function - /// Run all the tests unless a non-empty set of names is passed in. -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc -index 4f7110bb4..a23cad3df 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc -@@ -15,6 +15,8 @@ - */ - #include "ifacedecomp.hh" + /// \brief Simple unit test class +@@ -49,21 +41,21 @@ typedef void (*testfunc_t)(); ///< A unit-test function + /// The static run() method calls all the function pointers of all instantiated + /// objects. + struct UnitTest { +- static vector tests; ///< The collection of test objects +- string name; ///< Name of the test ++ static std::vector tests; ///< The collection of test objects ++ std::string name; ///< Name of the test + testfunc_t func; ///< Call-back function executing the test + + /// \brief Constructor + /// + /// \param name is the identifier for the test + /// \param func is a call-back function that executes the test +- UnitTest(const string &name,testfunc_t func) : ++ UnitTest(const std::string &name,testfunc_t func) : + name(name), func(func) + { + tests.push_back(this); + } + +- static int run(set &testNames); ///< Run all the instantiated tests ++ static int run(std::set &testNames); ///< Run all the instantiated tests + }; -+using namespace std; -+ - void FunctionTestProperty::startTest(void) const - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh -index 46abd6bce..daf9779b7 100644 +index 43801047a..daf9779b7 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh @@ -33,24 +33,24 @@ class IfaceDecompData; @@ -13953,9 +12646,8 @@ index 46abd6bce..daf9779b7 100644 int4 minimumMatch; ///< Minimum number of times property is expected to match int4 maximumMatch; ///< Maximum number of times property is expected to match - string name; ///< Name of the test, to be printed in test summaries -- regex pattern; ///< Regular expression to match against a line of output + std::string name; ///< Name of the test, to be printed in test summaries -+ std::regex pattern; ///< Regular expression to match against a line of output + std::regex pattern; ///< Regular expression to match against a line of output mutable uint4 count; ///< Number of times regular expression has been seen public: - string getName(void) const { return name; } ///< Get the name of the property @@ -14022,19 +12714,6 @@ index 46abd6bce..daf9779b7 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc -index 3c594169d..2e42baac0 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc -@@ -16,6 +16,8 @@ - #include "transform.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_VECTOR_LANE_SIZES = AttributeId("vector_lane_sizes",130); - - /// \param op2 is the lane description to copy from diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh index fa26f0bd1..107e701fc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh @@ -14080,19 +12759,6 @@ index fa26f0bd1..107e701fc 100644 void placeInputs(void); ///< Set input Varnodes for all new ops public: TransformManager(Funcdata *f) { fd = f; } ///< Constructor -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc -index 6e379031a..689583858 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc -@@ -15,6 +15,8 @@ - */ - #include "translate.hh" - -+using namespace std; -+ - AttributeId ATTRIB_CODE = AttributeId("code",43); - AttributeId ATTRIB_CONTAIN = AttributeId("contain",44); - AttributeId ATTRIB_DEFAULTSPACE = AttributeId("defaultspace",45); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh index 34a4709a8..3d9476b87 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh @@ -14280,19 +12946,6 @@ index 34a4709a8..3d9476b87 100644 /// \brief Get the length of a machine instruction /// -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -index 1296b82dd..0eff1ae2b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -@@ -16,6 +16,8 @@ - #include "type.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// The base propagation ordering associated with each meta-type. - /// The array elements correspond to the ordering of #type_metatype. - sub_metatype Datatype::base2sub[15] = { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh index 6703c74b2..393b90692 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh @@ -14653,19 +13306,6 @@ index 6703c74b2..393b90692 100644 void cacheCoreTypes(void); ///< Cache common types }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc -index 351e3df1a..dcc279aaf 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "typegrp_ghidra.hh" - -+using namespace std; -+ - Datatype *TypeFactoryGhidra::findById(const string &n,uint8 id,int4 sz) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.hh index 847dec7da..91de00eea 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.hh @@ -14679,19 +13319,6 @@ index 847dec7da..91de00eea 100644 public: TypeFactoryGhidra(ArchitectureGhidra *g) : TypeFactory(g) {} ///< Constructor virtual ~TypeFactoryGhidra(void) {} -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc -index 0a00521f7..304a39b14 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc -@@ -17,6 +17,8 @@ - #include "funcdata.hh" - #include - -+using namespace std; -+ - /// \param inst will hold the array of TypeOp objects, indexed on op-code - /// \param tlst is the corresponding TypeFactory for the Architecture - /// \param trans is the Translate object for floating-point formats diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh index 7c9532cdc..27db0b7e4 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh @@ -15020,19 +13647,6 @@ index 7c9532cdc..27db0b7e4 100644 }; /// \brief Information about the INSERT op-code -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc -index d848cfc7d..4caefde8d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc -@@ -16,6 +16,8 @@ - #ifdef CPUI_RULECOMPILE - #include "unify.hh" - -+using namespace std; -+ - UnifyDatatype::UnifyDatatype(uint4 tp) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.hh index 995f96b44..2522ad5ae 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.hh @@ -15576,19 +14190,6 @@ index 995f96b44..2522ad5ae 100644 }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc -index 940d33322..055662fb9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc -@@ -16,6 +16,8 @@ - #include "unionresolve.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// The original parent must either be a union, a pointer to a union, or a partial union. - /// The object is set up initially to resolve to the parent. - /// \param parent is the original parent data-type diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh index c60c70601..77e85c1a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh @@ -15610,19 +14211,6 @@ index c60c70601..77e85c1a6 100644 ResolvedUnion result; ///< The best result int4 trialCount; ///< Number of trials evaluated so far static const int4 maxPasses; ///< Maximum number of levels to score through -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc -index e60353941..d32919020 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc -@@ -16,6 +16,8 @@ - #include "userop.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_FARPOINTER = AttributeId("farpointer",85); - AttributeId ATTRIB_INPUTOP = AttributeId("inputop",86); - AttributeId ATTRIB_OUTPUTOP = AttributeId("outputop",87); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh index 747a22d0f..f11afd4fa 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh @@ -15785,21 +14373,8 @@ index 747a22d0f..f11afd4fa 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc -index 72bb50eb9..9d426786c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc -@@ -17,6 +17,8 @@ - #include "op.hh" - #include "database.hh" - -+using namespace std; -+ - AttributeId ATTRIB_CLASS = AttributeId("class",66); - AttributeId ATTRIB_REPREF = AttributeId("repref",67); - AttributeId ATTRIB_SYMREF = AttributeId("symref",68); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh -index 6e8e4caa5..00d950749 100644 +index 409d54799..0ec81de5e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh @@ -47,7 +47,7 @@ class VariableGroup { @@ -15850,7 +14425,7 @@ index 6e8e4caa5..00d950749 100644 bool hasName(void) const; ///< Check if \b this HighVariable can be named Varnode *getTiedVarnode(void) const; ///< Find the first address tied member Varnode Varnode *getInputVarnode(void) const; ///< Find (the) input member Varnode -@@ -215,7 +215,7 @@ class HighVariable { +@@ -216,7 +216,7 @@ class HighVariable { // Varnode *findGlobalRep(void) const; static bool compareName(Varnode *vn1,Varnode *vn2); ///< Determine which given Varnode is most nameable static bool compareJustLoc(const Varnode *a,const Varnode *b); ///< Compare based on storage location @@ -15859,19 +14434,6 @@ index 6e8e4caa5..00d950749 100644 }; /// The internal cover is marked as dirty. If \b this is a piece of a VariableGroup, it and all the other -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc -index 76f4ed86f..9674c5dfe 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc -@@ -16,6 +16,8 @@ - #include "varmap.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_LOCK = AttributeId("lock",133); - AttributeId ATTRIB_MAIN = AttributeId("main",134); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh index 5267b0a3a..dba5351fa 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh @@ -15988,21 +14550,8 @@ index 5267b0a3a..dba5351fa 100644 const Address &pc, Datatype *ct, int4 &index,uint4 flags) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc -index b5581a7aa..0eea14ba9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc -@@ -16,6 +16,8 @@ - #include "varnode.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_ADDRTIED = AttributeId("addrtied",30); - AttributeId ATTRIB_GRP = AttributeId("grp",31); - AttributeId ATTRIB_INPUT = AttributeId("input",32); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh -index 64fc38bbd..0fc9a476d 100644 +index a76c21d42..25d19e890 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh @@ -47,10 +47,10 @@ struct VarnodeCompareDefLoc { @@ -16053,7 +14602,7 @@ index 64fc38bbd..0fc9a476d 100644 Varnode(int4 s,const Address &m,Datatype *dt); ///< Construct a \e free Varnode bool operator<(const Varnode &op2) const; ///< Comparison operator on Varnode bool operator==(const Varnode &op2) const; ///< Equality operator -@@ -226,7 +226,7 @@ class Varnode { +@@ -227,7 +227,7 @@ class Varnode { int4 overlap(const Address &op2loc,int4 op2size) const; ///< Return relative point of overlap with Address range uintb getNZMask(void) const { return nzm; } ///< Get the mask of bits within \b this that are known to be zero int4 termOrder(const Varnode *op) const; ///< Compare two Varnodes based on their term order @@ -16062,7 +14611,7 @@ index 64fc38bbd..0fc9a476d 100644 bool isAnnotation(void) const { return ((flags&Varnode::annotation)!=0); } ///< Is \b this an annotation? bool isImplied(void) const { return ((flags&Varnode::implied)!=0); } ///< Is \b this an implied variable? bool isExplicit(void) const { return ((flags&Varnode::explict)!=0); } ///< Is \b this an explicitly printed variable? -@@ -341,7 +341,7 @@ class Varnode { +@@ -342,7 +342,7 @@ class Varnode { Datatype *getStructuredType(void) const; ///< Get structure/array/union that \b this is a piece of void encode(Encoder &encoder) const; ///< Encode a description of \b this to a stream static bool comparePointers(const Varnode *a,const Varnode *b) { return (*a < *b); } ///< Compare Varnodes as pointers @@ -16071,7 +14620,7 @@ index 64fc38bbd..0fc9a476d 100644 }; /// \brief A container for Varnode objects from a specific function -@@ -395,7 +395,7 @@ class VarnodeBank { +@@ -396,7 +396,7 @@ class VarnodeBank { VarnodeLocSet::const_iterator endLoc(int4 s,const Address &addr,uint4 fl) const; VarnodeLocSet::const_iterator beginLoc(int4 s,const Address &addr,const Address &pc,uintm uniq) const; VarnodeLocSet::const_iterator endLoc(int4 s,const Address &addr,const Address &pc,uintm uniq) const; @@ -16080,43 +14629,36 @@ index 64fc38bbd..0fc9a476d 100644 VarnodeDefSet::const_iterator beginDef(void) const { return def_tree.begin(); } ///< Beginning of Varnodes sorted by definition VarnodeDefSet::const_iterator endDef(void) const { return def_tree.end(); } ///< End of Varnodes sorted by definition VarnodeDefSet::const_iterator beginDef(uint4 fl) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc -index fc4d1bf61..68778c5ca 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc -@@ -98,6 +98,8 @@ - #include - #include - -+using namespace std; -+ - string Attributes::bogus_uri("http://unused.uri"); - - /// \brief The XML character scanner diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh -index a1c763a3e..802f57988 100644 +index 21884553c..95255b533 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh -@@ -25,8 +25,6 @@ +@@ -25,15 +25,6 @@ #include #include --using namespace std; +-using std::string; +-using std::vector; +-using std::map; +-using std::istream; +-using std::ostream; +-using std::ifstream; +-using std::dec; +-using std::hex; - /// \brief The \e attributes for a single XML element /// /// A container for name/value pairs (of strings) for the formal attributes, as collected during parsing. -@@ -34,34 +32,34 @@ using namespace std; +@@ -41,34 +32,34 @@ using std::hex; /// This also holds other properties of the element that are unused in this implementation, /// including the \e namespace URI. class Attributes { - static string bogus_uri; ///< A placeholder for the namespace URI that should be attached to the element --// static string prefix; ++ static std::string bogus_uri; ///< A placeholder for the namespace URI that should be attached to the element + // static string prefix; - string *elementname; ///< The name of the XML element - vector name; ///< List of names for each formal XML attribute - vector value; ///< List of values for each formal XML attribute -+ static std::string bogus_uri; ///< A placeholder for the namespace URI that should be attached to the element -+// static std::string prefix; + std::string *elementname; ///< The name of the XML element + std::vector name; ///< List of names for each formal XML attribute + std::vector value; ///< List of values for each formal XML attribute @@ -16138,30 +14680,24 @@ index a1c763a3e..802f57988 100644 - const string &getURI(int4 i) const { return bogus_uri; } ///< Get the namespace URI associated with the i-th attribute - const string &getLocalName(int4 i) const { return *name[i]; } ///< Get the local name of the i-th attribute - const string &getQName(int4 i) const { return *name[i]; } ///< Get the qualified name of the i-th attribute -- // int4 getIndex(const string &uri,const string &localName) const; -- // int4 getIndex(const string &qualifiedName) const; -- // const string &getType(int4 index) const; -- // const string &getType(const string &uri,const string &localName) const; -- // const string &getType(const string &qualifiedName) const; -- const string &getValue(int4 i) const { return *value[i]; } ///< Get the value of the i-th attribute -- //const string &getValue(const string &uri,const string &localName) const; + const std::string &getURI(int4 i) const { return bogus_uri; } ///< Get the namespace URI associated with the i-th attribute + const std::string &getLocalName(int4 i) const { return *name[i]; } ///< Get the local name of the i-th attribute + const std::string &getQName(int4 i) const { return *name[i]; } ///< Get the qualified name of the i-th attribute -+ // int4 getIndex(const std::string &uri,const std::string &localName) const; -+ // int4 getIndex(const std::string &qualifiedName) const; -+ // const std::string &getType(int4 index) const; -+ // const std::string &getType(const std::string &uri,const std::string &localName) const; -+ // const std::string &getType(const std::string &qualifiedName) const; + // int4 getIndex(const string &uri,const string &localName) const; + // int4 getIndex(const string &qualifiedName) const; + // const string &getType(int4 index) const; + // const string &getType(const string &uri,const string &localName) const; + // const string &getType(const string &qualifiedName) const; +- const string &getValue(int4 i) const { return *value[i]; } ///< Get the value of the i-th attribute + const std::string &getValue(int4 i) const { return *value[i]; } ///< Get the value of the i-th attribute -+ //const std::string &getValue(const std::string &uri,const std::string &localName) const; + //const string &getValue(const string &uri,const string &localName) const; /// \brief Get the value of the attribute with the given qualified name - const string &getValue(const string &qualifiedName) const { + const std::string &getValue(const std::string &qualifiedName) const { for(uint4 i=0;i - #include - -+using namespace std; -+ - string Attributes::bogus_uri("http://unused.uri"); - - /// \brief The XML character scanner -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc -index c5c533ba9..21e6e390a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc -@@ -15,6 +15,8 @@ - */ - #include "xml_arch.hh" - -+using namespace std; -+ - ElementId ELEM_XML_SAVEFILE = ElementId("xml_savefile",236); - - // Constructing the singleton registers the capability diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh index 6371148b0..e9598b9d5 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh @@ -16505,58 +15015,6 @@ index 6371148b0..e9598b9d5 100644 virtual ~XmlArchitecture(void) {} }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc -index a8bf58ec5..6dcfc7930 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc -@@ -16,6 +16,8 @@ - #include "architecture.hh" - #include "test.hh" - -+using namespace std; -+ - class CircleRangeTestEnvironment { - Architecture *g; - public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -index 67d92c573..9cb08b3d1 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -@@ -27,6 +27,8 @@ - #include - #include - -+using namespace std; -+ - // utility functions - float floatFromRawBits(uintb e) { - float f; -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc -index b941fede3..a09332af8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc -@@ -16,6 +16,8 @@ - #include "translate.hh" - #include "test.hh" - -+using namespace std; -+ - class TestAddrSpaceManager : public AddrSpaceManager { - public: - TestAddrSpaceManager(Translate *t); -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc -index 4ce7cdde6..1ac3c3d5f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc -@@ -18,6 +18,8 @@ - #include "test.hh" - #include - -+using namespace std; -+ - static Architecture *glb; - static TypeFactory *types; - static CastStrategy *strategy; -- -2.39.0 +2.40.0 diff --git a/src/patches/HEAD/0006-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch b/src/patches/HEAD/0006-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch new file mode 100644 index 0000000..67c1ca4 --- /dev/null +++ b/src/patches/HEAD/0006-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch @@ -0,0 +1,51 @@ +From 24a158c4514567a0cc253f0c0a4b7a9f5df7384d Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Wed, 15 Mar 2023 23:04:28 -0400 +Subject: [PATCH 6/7] (3/4) decompiler: Manually fix std namespace in generated + file + +We must manually fix the symbols from std namespace because the +automated tool does not know how to parse yacc/bison files. +--- + .../Decompiler/src/decompile/cpp/slghparse.y | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +index 0e2172f79..039963cd5 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +@@ -32,24 +32,24 @@ using namespace std; + char ch; + uintb *i; + intb *big; +- string *str; +- vector *strlist; +- vector *biglist; +- vector *param; ++ std::string *str; ++ std::vector *strlist; ++ std::vector *biglist; ++ std::vector *param; + SpaceQuality *spacequal; + FieldQuality *fieldqual; + StarQuality *starqual; + VarnodeTpl *varnode; + ExprTree *tree; +- vector *stmt; ++ std::vector *stmt; + ConstructTpl *sem; + SectionVector *sectionstart; + Constructor *construct; + PatternEquation *pateq; + PatternExpression *patexp; + +- vector *symlist; +- vector *contop; ++ std::vector *symlist; ++ std::vector *contop; + SleighSymbol *anysym; + SpaceSymbol *spacesym; + SectionSymbol *sectionsym; +-- +2.40.0 + diff --git a/src/patches/HEAD/0007-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch b/src/patches/HEAD/0007-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch new file mode 100644 index 0000000..f795018 --- /dev/null +++ b/src/patches/HEAD/0007-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch @@ -0,0 +1,29 @@ +From ed427a72a0d2f70565752902f274a748835afa1a Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Wed, 15 Mar 2023 23:10:22 -0400 +Subject: [PATCH 7/7] (4/4) decompiler: Manually fix missed std variable usage + +Unfortunately, the heuristics in remusing are unable to automatically +fix this case of variables from the C++ standard library. + +This was fixed by resolving the error(s) produced by the compiler. +--- + Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh +index 64fd45e35..428319a65 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh +@@ -79,7 +79,7 @@ class GhidraCommand { + virtual void loadParameters(void); ///< Read parameters directing command execution + virtual void sendResult(void); ///< Send results of the command (if any) back to the Ghidra client + public: +- GhidraCommand(void) : sin(cin),sout(cout) { ++ GhidraCommand(void) : sin(std::cin),sout(std::cout) { + ghidra = (ArchitectureGhidra *)0; + } ///< Construct given i/o streams + virtual ~GhidraCommand(void) {} ///< Destructor +-- +2.40.0 + diff --git a/src/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch b/src/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch index 7515551..d237d64 100644 --- a/src/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch +++ b/src/patches/stable/0001-Small-improvements-to-C-decompiler-testing-from-CLI.patch @@ -1,7 +1,7 @@ -From 1f0f87b4f14bbe60250ca1c7a23300fc5e1766f0 Mon Sep 17 00:00:00 2001 +From 2ade75baba3f2945d5b53e5c1eedb53ebe10f61b Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 13 Feb 2022 12:59:42 -0500 -Subject: [PATCH 1/5] Small improvements to C++ decompiler testing from CLI +Subject: [PATCH 1/8] Small improvements to C++ decompiler testing from CLI * Fixes argument parsing to accept more than one option for specifying paths. @@ -161,5 +161,5 @@ index 52125b401..46abd6bce 100644 #endif -- -2.39.0 +2.40.0 diff --git a/src/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch b/src/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch index b493446..c8444e9 100644 --- a/src/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch +++ b/src/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch @@ -1,7 +1,7 @@ -From b3aaad14dea43fd05d1049c7b7ba7ba723e7b2f8 Mon Sep 17 00:00:00 2001 +From 9f82d92228afeaac6e8482a1e842fea9d195e750 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 28 Jul 2022 09:20:03 -0400 -Subject: [PATCH 2/5] Add include guards to decompiler C++ headers +Subject: [PATCH 2/8] Add include guards to decompiler C++ headers --- Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh | 5 +++++ @@ -133,5 +133,5 @@ index d395fb8a3..6371148b0 100644 + +#endif -- -2.39.0 +2.40.0 diff --git a/src/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch b/src/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch index f0534a1..a4ea872 100644 --- a/src/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch +++ b/src/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch @@ -1,7 +1,7 @@ -From e2eb3c6789bb5e84720174f9c3652165174c5c3a Mon Sep 17 00:00:00 2001 +From 4fa4b34e64c277f699a0c4d9cda1a2de739b9130 Mon Sep 17 00:00:00 2001 From: Alex Cameron Date: Mon, 7 Feb 2022 02:02:03 +1100 -Subject: [PATCH 3/5] Fix UBSAN errors in decompiler +Subject: [PATCH 3/8] Fix UBSAN errors in decompiler --- .../Decompiler/src/decompile/cpp/address.cc | 4 ++-- @@ -42,10 +42,10 @@ index b3758ddd1..0b3bf04c8 100644 mask <<= 1; val &= (~mask); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -index 19ed41c63..d1bd842d8 100644 +index c52d92c80..937b57157 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -@@ -2656,8 +2656,12 @@ void ProtoModelMerged::decode(Decoder &decoder) +@@ -2649,8 +2649,12 @@ void ProtoModelMerged::decode(Decoder &decoder) modellist.push_back(mymodel); } decoder.closeElement(elemId); @@ -61,7 +61,7 @@ index 19ed41c63..d1bd842d8 100644 void ParameterBasic::setTypeLock(bool val) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -index 0c4275f15..bdbda0ae6 100644 +index 63784131d..ff8bb6a23 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc @@ -501,7 +501,13 @@ void Funcdata::setHighLevel(void) @@ -262,7 +262,7 @@ index dbb8f9e51..85bd54261 100644 } diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -index 316074389..91bf4bc77 100644 +index 8d5dc17ed..f50e07f84 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc @@ -3233,8 +3233,8 @@ void TypeFactory::recalcPointerSubmeta(Datatype *base,sub_metatype sub) @@ -289,5 +289,5 @@ index ab99382a3..67d92c573 100644 uintb true_result = ((uintb)(int32_t)f) & 0xffffffff; uintb encoding = format.getEncoding(f); -- -2.39.0 +2.40.0 diff --git a/src/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch b/src/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch index 315938a..e6d9bf7 100644 --- a/src/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch +++ b/src/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch @@ -1,7 +1,7 @@ -From e4f947f20ef0d35e8f5e85da5f2ef97d1bf8df3b Mon Sep 17 00:00:00 2001 +From a5f1be9df17f10db97dbd12243b001591d8b64d9 Mon Sep 17 00:00:00 2001 From: Alex Cameron Date: Wed, 3 Aug 2022 20:01:18 +1000 -Subject: [PATCH 4/5] Use `stroull` instead of `stroul` to parse address +Subject: [PATCH 4/8] Use `stroull` instead of `stroul` to parse address offsets --- @@ -34,5 +34,5 @@ index 40a3e3bfe..ff6f282ca 100644 enddata = (const char *) tmpdata; if (enddata - s.c_str() == s.size()) { // If no size or offset override -- -2.39.0 +2.40.0 diff --git a/src/patches/stable/0005-1-4-decompiler-Add-using-namespace-std-to-all-.cc.patch b/src/patches/stable/0005-1-4-decompiler-Add-using-namespace-std-to-all-.cc.patch new file mode 100644 index 0000000..0dc7d58 --- /dev/null +++ b/src/patches/stable/0005-1-4-decompiler-Add-using-namespace-std-to-all-.cc.patch @@ -0,0 +1,1640 @@ +From 5a016a2b679fb58b5896049cecc5e3be9a6c66fb Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Sun, 19 Mar 2023 15:37:26 -0400 +Subject: [PATCH 5/8] (1/4) decompiler: Add 'using namespace std' to all '.cc' + +This commit _should_ compile with all Ghidra code. + +It is less controversial (but still not ideal) to add 'using namespace' +to C++ source files. Source files are isolated and will not affect any +code other than what's in the source file. Eventually, it would be best +to refactor to either use a using-declaration statement or to attach +'std::' to all the symbols. Clangd refactors exist to do this (but they +don't work on header files). + +I modified the *.y and *.l files, but I did not regenerate because it +would cause more diffs than necessary, but if you did regenerate, it +would generate the intended modifications made to the generated files. +--- + Ghidra/Features/Decompiler/src/decompile/cpp/action.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/address.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/block.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/comment_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/context.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/database.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/database_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/double.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/float.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/funcdata_block.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc | 2 ++ + .../Decompiler/src/decompile/cpp/funcdata_varnode.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/ghidra_context.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/ghidra_process.cc | 5 ++++- + .../Decompiler/src/decompile/cpp/ghidra_translate.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/globalcontext.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/inject_ghidra.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/inject_sleigh.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc | 2 ++ + .../Decompiler/src/decompile/cpp/loadimage_ghidra.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/loadimage_xml.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/op.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/options.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/override.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/printlanguage.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/sleighexample.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y | 2 ++ + .../Features/Decompiler/src/decompile/cpp/slghpatexpress.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc | 3 +++ + Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l | 3 +++ + Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/space.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/string_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/test.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/type.cc | 2 ++ + .../Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/xml.y | 2 ++ + Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc | 2 ++ + .../Decompiler/src/decompile/unittests/testcirclerange.cc | 2 ++ + .../Decompiler/src/decompile/unittests/testfloatemu.cc | 2 ++ + .../Decompiler/src/decompile/unittests/testmarshal.cc | 2 ++ + .../Features/Decompiler/src/decompile/unittests/testtypes.cc | 2 ++ + 115 files changed, 234 insertions(+), 1 deletion(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc +index 7b1b2062a..76fc27d72 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc +@@ -18,6 +18,8 @@ + + #include "coreaction.hh" + ++using namespace std; ++ + /// Specify the name, group, and properties of the Action + /// \param f is the collection of property flags + /// \param nm is the Action name +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc +index 0b3bf04c8..9a58ea4ef 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc +@@ -16,6 +16,8 @@ + #include "address.hh" + #include "translate.hh" + ++using namespace std; ++ + AttributeId ATTRIB_FIRST = AttributeId("first",27); + AttributeId ATTRIB_LAST = AttributeId("last",28); + AttributeId ATTRIB_UNIQ = AttributeId("uniq",29); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc +index 14c4c337c..a43cf5387 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc +@@ -24,6 +24,8 @@ + #include + #endif + ++using namespace std; ++ + vector ArchitectureCapability::thelist; + + const uint4 ArchitectureCapability::majorversion = 5; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc +index b9a495500..a37960f9e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc +@@ -16,6 +16,8 @@ + */ + #include "bfd_arch.hh" + ++using namespace std; ++ + // Constructing this object registers capability + BfdArchitectureCapability BfdArchitectureCapability::bfdArchitectureCapability; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc +index 611009333..fff1a5cfe 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc +@@ -17,6 +17,8 @@ + #include "block.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_ALTINDEX = AttributeId("altindex",75); + AttributeId ATTRIB_DEPTH = AttributeId("depth",76); + AttributeId ATTRIB_END = AttributeId("end",77); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc +index 80265a458..9c9906f8f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc +@@ -16,6 +16,8 @@ + #include "blockaction.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// Retrieve the current edge (as a \e top FlowBlock and the index of the outgoing edge). + /// If the end-points have been collapsed together, this returns NULL. + /// The top and bottom nodes of the edge are updated to FlowBlocks in the current collapsed graph. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc +index 26406c288..6b6a8d34b 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc +@@ -16,6 +16,8 @@ + #include "callgraph.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_CALLGRAPH = ElementId("callgraph",226); + ElementId ELEM_NODE = ElementId("node",227); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc +index 87e40dbbf..481cf3378 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc +@@ -15,6 +15,8 @@ + */ + #include "capability.hh" + ++using namespace std; ++ + /// Access static vector of CapabilityPoint objects that are registered during static initialization + /// The list itself is created once on the first call to this method + /// \e after all the static initializers have run +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc +index dc8baa764..0899dc5de 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc +@@ -16,6 +16,8 @@ + #include "cast.hh" + #include "op.hh" + ++using namespace std; ++ + /// Sets the TypeFactory used to produce data-types for the arithmeticOutputStandard() method + /// \param t is the TypeFactory + void CastStrategy::setTypeFactory(TypeFactory *t) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc +index 92690f422..1ba834bd6 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc +@@ -17,6 +17,8 @@ + #include "codedata.hh" + #include "loadimage_bfd.hh" + ++using namespace std; ++ + // Constructing this registers the capability + IfaceCodeDataCapability IfaceCodeDataCapability::ifaceCodeDataCapability; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc +index b5bc0a16d..e495b734e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc +@@ -16,6 +16,8 @@ + #include "comment.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_COMMENT = ElementId("comment",86); + ElementId ELEM_COMMENTDB = ElementId("commentdb",87); + ElementId ELEM_TEXT = ElementId("text",88); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc +index 04a4c2cf0..2ba980fc0 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "comment_ghidra.hh" + ++using namespace std; ++ + CommentDatabaseGhidra::CommentDatabaseGhidra(ArchitectureGhidra *g) + : CommentDatabase() + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc +index 962f35d5d..0c41bb363 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc +@@ -15,6 +15,8 @@ + */ + #include "condexe.hh" + ++using namespace std; ++ + ConditionMarker::ConditionMarker(void) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc +index f40f3dd66..c4a628228 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc +@@ -18,6 +18,8 @@ + + #include "libdecomp.hh" + ++using namespace std; ++ + class IfcLoadFile : public IfaceDecompCommand { + public: + virtual void execute(istream &s); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc +index 51157f3a7..19ab8ddfa 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc +@@ -17,6 +17,8 @@ + #include "slghsymbol.hh" + #include "translate.hh" + ++using namespace std; ++ + ParserContext::ParserContext(ContextCache *ccache,Translate *trans) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc +index a4c6b71fc..dfe23cf03 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc +@@ -18,6 +18,8 @@ + #include "double.hh" + #include "subflow.hh" + ++using namespace std; ++ + /// \brief A stack equation + struct StackEqn { + int4 var1; ///< Variable with 1 coefficient +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc +index 6e2b88a06..f41a8f745 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc +@@ -16,6 +16,8 @@ + #include "cover.hh" + #include "block.hh" + ++using namespace std; ++ + const CoverBlock Cover::emptyBlock; + + /// PcodeOp objects and a CoverBlock start/stop boundaries have +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc +index 42b1531ad..8e1fd1150 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc +@@ -15,6 +15,8 @@ + */ + #include "cpool.hh" + ++using namespace std; ++ + AttributeId ATTRIB_A = AttributeId("a",80); + AttributeId ATTRIB_B = AttributeId("b",81); + AttributeId ATTRIB_LENGTH = AttributeId("length",82); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc +index e8dee8256..1da445915 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "cpool_ghidra.hh" + ++using namespace std; ++ + ConstantPoolGhidra::ConstantPoolGhidra(ArchitectureGhidra *g) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc +index 2881ab711..3c68cb3ba 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc +@@ -16,6 +16,8 @@ + */ + #include "crc32.hh" + ++using namespace std; ++ + // Table for bytewise calculation of a 32-bit Cyclic Redundancy Check + uint4 crc32tab[] = { + 0x0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f, +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc +index 17127fe23..75d54f3bd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc +@@ -18,6 +18,8 @@ + #include "crc32.hh" + #include + ++using namespace std; ++ + AttributeId ATTRIB_CAT = AttributeId("cat",61); + AttributeId ATTRIB_FIELD = AttributeId("field",62); + AttributeId ATTRIB_MERGE = AttributeId("merge",63); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc +index 35030ffe0..93d390f97 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc +@@ -16,6 +16,8 @@ + #include "database_ghidra.hh" + #include "funcdata.hh" + ++using namespace std; ++ + Scope *ScopeGhidra::buildSubScope(uint8 id,const string &nm) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc +index ce5706bcd..14ad6929e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc +@@ -15,6 +15,8 @@ + */ + #include "double.hh" + ++using namespace std; ++ + /// Internally, the \b lo and \b hi Varnodes are set to null, and the \b val field + /// holds the constant value. + /// \param sz is the size in bytes of the constant +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc +index 3656c0df5..16dfa25ca 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc +@@ -17,6 +17,8 @@ + #include "funcdata.hh" + #include "crc32.hh" + ++using namespace std; ++ + // Table for how to hash opcodes, lumps certain operators (i.e. ADD SUB PTRADD PTRSUB) into one hash + // zero indicates the operator should be skipped + const uint4 DynamicHash::transtable[] = { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc +index 88936cedd..5025d952d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc +@@ -15,6 +15,8 @@ + */ + #include "emulate.hh" + ++using namespace std; ++ + /// Any time the emulator is about to execute a user-defined pcode op with the given name, + /// the indicated breakpoint is invoked first. The break table does \e not assume responsibility + /// for freeing the breakpoint object. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc +index fe37a7be2..8e022e3a3 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc +@@ -16,6 +16,8 @@ + #include "architecture.hh" + #include "emulateutil.hh" + ++using namespace std; ++ + /// \param g is the Architecture providing the LoadImage + EmulatePcodeOp::EmulatePcodeOp(Architecture *g) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc +index 9ab665cd3..56cd2620f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc +@@ -29,6 +29,8 @@ extern "C" { + } + #endif + ++using namespace std; ++ + // Path name separator + #ifdef _WINDOWS + char FileManage::separator = '\\'; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc +index 068c7e991..8f843d1da 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc +@@ -19,6 +19,8 @@ + #include + #include "address.hh" + ++using namespace std; ++ + /// Set format for a given encoding size according to IEEE 754 standards + /// \param sz is the size of the encoding in bytes + FloatFormat::FloatFormat(int4 sz) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc +index c59ebdf61..c7c37dc6c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc +@@ -15,6 +15,8 @@ + */ + #include "flow.hh" + ++using namespace std; ++ + /// Prepare for tracing flow for a new function. + /// The Funcdata object and references to its internal containers must be explicitly given. + /// \param d is the new function to trace +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc +index 937b57157..22960f3bf 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc +@@ -16,6 +16,8 @@ + #include "fspec.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_CUSTOM = AttributeId("custom",114); + AttributeId ATTRIB_DOTDOTDOT = AttributeId("dotdotdot",115); + AttributeId ATTRIB_EXTENSION = AttributeId("extension",116); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc +index 2412d35bb..602910d36 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc +@@ -15,6 +15,8 @@ + */ + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_NOCODE = AttributeId("nocode",84); + + ElementId ELEM_AST = ElementId("ast",115); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc +index 83fafbc0a..70c7a09f5 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc +@@ -16,6 +16,8 @@ + #include "funcdata.hh" + #include "flow.hh" + ++using namespace std; ++ + // Funcdata members pertaining directly to blocks + + /// A description of each block in the current structure hierarchy is +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc +index d546e58b6..6a4d8be41 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc +@@ -16,6 +16,8 @@ + #include "funcdata.hh" + #include "flow.hh" + ++using namespace std; ++ + // Funcdata members pertaining directly to ops + + /// \param op is the given PcodeOp +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc +index ff8bb6a23..4a19d6809 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc +@@ -15,6 +15,8 @@ + */ + #include "funcdata.hh" + ++using namespace std; ++ + // Funcdata members pertaining directly to varnodes + + /// Properties of a given storage location are gathered from symbol information and +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc +index b5dd6c469..68e33edff 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc +@@ -23,6 +23,8 @@ + #include "cpool_ghidra.hh" + #include "inject_ghidra.hh" + ++using namespace std; ++ + //AttributeId ATTRIB_BADDATA = AttributeId("baddata",145); + + ElementId ELEM_COMMAND_ISNAMEUSED = ElementId("command_isnameused",239); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc +index 226c3249c..80106670a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_context.cc +@@ -15,6 +15,8 @@ + */ + #include "ghidra_context.hh" + ++using namespace std; ++ + const TrackedSet &ContextGhidra::getTrackedSet(const Address &addr) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc +index a2cc2299b..1d73ebbb2 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.cc +@@ -23,9 +23,12 @@ + #endif + + #ifdef __REMOTE_SOCKET__ +- + #include "ifacedecomp.hh" ++#endif + ++using namespace std; ++ ++#ifdef __REMOTE_SOCKET__ + + static IfaceStatus *ghidra_dcp = (IfaceStatus *)0; + static RemoteSocket *remote = (RemoteSocket *)0; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc +index dd2c0274a..bb5211a8f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc +@@ -16,6 +16,8 @@ + #include "ghidra_translate.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// \brief Associate a Varnode with a register name + /// + /// \param nm is the register name +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc +index 15badbad3..a70ec2686 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc +@@ -15,6 +15,8 @@ + */ + #include "globalcontext.hh" + ++using namespace std; ++ + ElementId ELEM_CONTEXT_DATA = ElementId("context_data",120); + ElementId ELEM_CONTEXT_POINTS = ElementId("context_points",121); + ElementId ELEM_CONTEXT_POINTSET = ElementId("context_pointset",122); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc +index aab637f39..a87932dc8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc +@@ -89,6 +89,8 @@ + + #include "grammar.hh" + ++using namespace std; ++ + extern int yylex(void); + extern int yyerror(const char *str); + static CParse *parse; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y +index f210843fd..f9b3cca31 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.y +@@ -16,6 +16,8 @@ + %{ + #include "grammar.hh" + ++using namespace std; ++ + extern int yylex(void); + extern int yyerror(const char *str); + static CParse *parse; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc +index 20d7cd196..31b69addd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc +@@ -16,6 +16,8 @@ + */ + #include "graph.hh" + ++using namespace std; ++ + static void print_varnode_vertex(Varnode *vn,ostream &s) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc +index e8af0c939..8ce556c80 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc +@@ -17,6 +17,8 @@ + #include "funcdata.hh" + #include "prefersplit.hh" + ++using namespace std; ++ + /// Update disjoint cover making sure (addr,size) is contained in a single element and return + /// an iterator to this element. The element's \b pass number is set to be the smallest value + /// of any previous intersecting element. Additionally an \b intersect code is passed back: +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc +index 5e035d4a2..f4a1acfee 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc +@@ -20,6 +20,8 @@ extern "C" { + #include "pcodeparse.hh" + #include "blockaction.hh" + ++using namespace std; ++ + // Constructing this registers the capability + IfaceDecompCapability IfaceDecompCapability::ifaceDecompCapability; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc +index 44a584305..ebcf1fcfd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc +@@ -15,6 +15,8 @@ + */ + #include "ifaceterm.hh" + ++using namespace std; ++ + IfaceTerm::IfaceTerm(const string &prmpt,istream &is,ostream &os) + : IfaceStatus(prmpt,os) + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc +index 6ecde748c..5845276ce 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "inject_ghidra.hh" + ++using namespace std; ++ + void InjectContextGhidra::encode(Encoder &encoder) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc +index e37e3f469..137d0402c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc +@@ -17,6 +17,8 @@ + #include "pcodeparse.hh" + #include "architecture.hh" + ++using namespace std; ++ + InjectContextSleigh::~InjectContextSleigh(void) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc +index 8ac61f889..977703bbd 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc +@@ -21,6 +21,8 @@ + #include "ext/stdio_filebuf.h" + #endif + ++using namespace std; ++ + vector IfaceCapability::thelist; + + void IfaceCapability::initialize(void) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc +index 63126e06e..86146b913 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc +@@ -17,6 +17,8 @@ + #include "emulate.hh" + #include "flow.hh" + ++using namespace std; ++ + AttributeId ATTRIB_LABEL = AttributeId("label",131); + AttributeId ATTRIB_NUM = AttributeId("num",132); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc +index b60a349fe..81ab37960 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc +@@ -15,6 +15,8 @@ + */ + #include "libdecomp.hh" + ++using namespace std; ++ + void startDecompilerLibrary(const char *sleighhome) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc +index e14109b32..bba3e9674 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc +@@ -15,6 +15,8 @@ + */ + #include "loadimage.hh" + ++using namespace std; ++ + /// This is a convenience method wrapped around the core + /// loadFill() routine. It automatically allocates an array + /// of the desired size, and then fills it with load image data. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc +index 7e9f1ad8a..6009dde95 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc +@@ -16,6 +16,8 @@ + */ + #include "loadimage_bfd.hh" + ++using namespace std; ++ + int4 LoadImageBfd::bfdinit = 0; // Global initialization variable + + LoadImageBfd::LoadImageBfd(const string &f,const string &t) : LoadImage(f) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc +index 069a1f956..2ede5182b 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "loadimage_ghidra.hh" + ++using namespace std; ++ + LoadImageGhidra::LoadImageGhidra(ArchitectureGhidra *g) + : LoadImage("ghidra_progam") + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc +index b7a9a30c4..0de974108 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc +@@ -16,6 +16,8 @@ + #include "loadimage_xml.hh" + #include "translate.hh" + ++using namespace std; ++ + AttributeId ATTRIB_ARCH = AttributeId("arch",135); + + ElementId ELEM_BINARYIMAGE = ElementId("binaryimage",230); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc +index d9a63a047..c6225ea73 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc +@@ -16,6 +16,8 @@ + #include "marshal.hh" + #include "translate.hh" + ++using namespace std; ++ + using namespace PackedFormat; + + unordered_map AttributeId::lookupAttributeId; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc +index be9a570a0..621e2dda9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc +@@ -16,6 +16,8 @@ + #include "memstate.hh" + #include "translate.hh" + ++using namespace std; ++ + /// This is a static convenience routine for decoding a value from a sequence of bytes depending + /// on the desired endianness + /// \param ptr is the pointer to the bytes to decode +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc +index cb41351e2..3a856760e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc +@@ -16,6 +16,8 @@ + #include "merge.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// This instance assumes the identity of the given Varnode and the defining index is + /// cached to facilitate quick sorting. + /// \param v is the given Varnode +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc +index 068393416..980300b23 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc +@@ -16,6 +16,8 @@ + #include "op.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_IOP = ElementId("iop",113); + ElementId ELEM_UNIMPL = ElementId("unimpl",114); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc +index 3e0c39904..f3dcaed3c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc +@@ -16,6 +16,8 @@ + #include "opbehavior.hh" + #include "translate.hh" + ++using namespace std; ++ + /// This routine generates a vector of OpBehavior objects indexed by opcode + /// \param inst is the vector of behaviors to be filled + /// \param trans is the translator object needed by the floating point behaviors +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc +index d116fe62d..100236b1e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc +@@ -16,6 +16,8 @@ + #include "opcodes.hh" + #include "types.h" + ++using namespace std; ++ + /// \brief Names of operations associated with their opcode number + /// + /// Some of the names have been replaced with special placeholder +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc +index 0ee439e44..ab042112c 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc +@@ -18,6 +18,8 @@ + #include "flow.hh" + #include "printc.hh" + ++using namespace std; ++ + ElementId ELEM_ALIASBLOCK = ElementId("aliasblock",174); + ElementId ELEM_ALLOWCONTEXTSET = ElementId("allowcontextset",175); + ElementId ELEM_ANALYZEFORLOOPS = ElementId("analyzeforloops",176); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc +index f64cb03ca..ca5d726c9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc +@@ -16,6 +16,8 @@ + #include "override.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_DEADCODEDELAY = ElementId("deadcodedelay",218); + ElementId ELEM_FLOW = ElementId("flow",219); + ElementId ELEM_FORCEGOTO = ElementId("forcegoto",220); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc +index 093a8b232..4ba724490 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc +@@ -15,6 +15,8 @@ + */ + #include "paramid.hh" + ++using namespace std; ++ + ElementId ELEM_PARAMMEASURES = ElementId("parammeasures",106); + ElementId ELEM_PROTO = ElementId("proto",107); + ElementId ELEM_RANK = ElementId("rank",108); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc +index 133da8178..ce8a0f834 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc +@@ -15,6 +15,8 @@ + */ + #include "pcodecompile.hh" + ++using namespace std; ++ + string Location::format(void) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc +index 7a317f47f..d6678a5ca 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc +@@ -16,6 +16,8 @@ + #include "pcodeinject.hh" + #include "architecture.hh" + ++using namespace std; ++ + AttributeId ATTRIB_DYNAMIC = AttributeId("dynamic",70); + AttributeId ATTRIB_INCIDENTALCOPY = AttributeId("incidentalcopy",71); + AttributeId ATTRIB_INJECT = AttributeId("inject",72); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc +index c562c0f83..4d67e8a6e 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc +@@ -89,6 +89,8 @@ + + #include "pcodeparse.hh" + ++using namespace std; ++ + //#define YYERROR_VERBOSE + extern int yylex(void); + static PcodeSnippet *pcode; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y +index c858fa148..46480a5ad 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y +@@ -16,6 +16,8 @@ + %{ + #include "pcodeparse.hh" + ++using namespace std; ++ + //#define YYERROR_VERBOSE + extern int yylex(void); + static PcodeSnippet *pcode; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc +index 317d4dbf1..5221185f8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc +@@ -16,6 +16,8 @@ + #include "pcoderaw.hh" + #include "translate.hh" + ++using namespace std; ++ + /// Build this VarnodeData from an \, \, or \ element. + /// \param decoder is the stream decoder + void VarnodeData::decode(Decoder &decoder) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc +index 635941885..e1267e610 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc +@@ -16,6 +16,8 @@ + #include "prefersplit.hh" + #include "funcdata.hh" + ++using namespace std; ++ + ElementId ELEM_PREFERSPLIT = ElementId("prefersplit",225); + + bool PreferSplitRecord::operator<(const PreferSplitRecord &op2) const +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc +index 388708030..fa631ccf1 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc +@@ -16,6 +16,8 @@ + #include "prettyprint.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_BLOCKREF = AttributeId("blockref",35); + AttributeId ATTRIB_CLOSE = AttributeId("close",36); + AttributeId ATTRIB_COLOR = AttributeId("color",37); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc +index 5c90024a2..bd433b898 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc +@@ -16,6 +16,8 @@ + #include "printc.hh" + #include "funcdata.hh" + ++using namespace std; ++ + // Operator tokens for expressions + // token #in prec assoc optype space bump + OpToken PrintC::hidden = { "", "", 1, 70, false, OpToken::hiddenfunction, 0, 0, (OpToken *)0 }; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc +index 473bab08a..a193e8688 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc +@@ -16,6 +16,8 @@ + #include "printjava.hh" + #include "funcdata.hh" + ++using namespace std; ++ + OpToken PrintJava::instanceof = { "instanceof", "", 2, 60, true, OpToken::binary, 1, 0, (OpToken *)0 }; + + // Constructing this registers the capability +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc +index f43d3e6f3..8f7a3c03b 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc +@@ -17,6 +17,8 @@ + #include "printlanguage.hh" + #include "funcdata.hh" + ++using namespace std; ++ + const string PrintLanguage::OPEN_PAREN = "("; + const string PrintLanguage::CLOSE_PAREN = ")"; + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc +index d98998426..3d17317f8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc +@@ -16,6 +16,8 @@ + #include "rangeutil.hh" + #include "block.hh" + ++using namespace std; ++ + const char CircleRange::arrange[] = "gcgbegdagggggggeggggcgbggggggggcdfgggggggegdggggbgggfggggcgbegda"; + + /// All the instantiations where left == right represent the same set. We +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc +index 3b83cf3ce..aab606e5d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc +@@ -15,6 +15,8 @@ + */ + #include "raw_arch.hh" + ++using namespace std; ++ + ElementId ELEM_RAW_SAVEFILE = ElementId("raw_savefile",237); + + // Constructing this object registers the capability +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc +index 3955b836b..81d62ac2a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc +@@ -18,6 +18,8 @@ + #include "subflow.hh" + #include "rangeutil.hh" + ++using namespace std; ++ + /// \class RuleEarlyRemoval + /// \brief Get rid of unused PcodeOp objects where we can guarantee the output is unused + int4 RuleEarlyRemoval::applyOp(PcodeOp *op,Funcdata &data) +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc +index af4e191c7..6af627ef8 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc +@@ -892,6 +892,8 @@ Here is the original flex parser + %{ + #include "rulecompile.hh" + #include "ruleparse.hh" ++ ++using namespace std; + #define ruleparsewrap() 1 + #define YY_SKIP_YYWRAP + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y +index 3d3ced687..aceb52b9a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y +@@ -17,6 +17,8 @@ + #ifdef CPUI_RULECOMPILE + #include "rulecompile.hh" + ++using namespace std; ++ + #define YYERROR_VERBOSE + + extern RuleCompile *rulecompile; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc +index 1c9ab7560..a791a3348 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc +@@ -16,6 +16,8 @@ + #include "semantics.hh" + #include "translate.hh" + ++using namespace std; ++ + ConstTpl::ConstTpl(const_type tp) + + { // Constructor for relative jump constants and uniques +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc +index 0fd86e645..b33cf85d2 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc +@@ -16,6 +16,8 @@ + #include "sleigh.hh" + #include "loadimage.hh" + ++using namespace std; ++ + PcodeCacher::PcodeCacher(void) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc +index aebec0e4c..4ff7b336d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc +@@ -16,6 +16,8 @@ + #include "sleigh_arch.hh" + #include "inject_sleigh.hh" + ++using namespace std; ++ + AttributeId ATTRIB_DEPRECATED = AttributeId("deprecated",136); + AttributeId ATTRIB_ENDIAN = AttributeId("endian",137); + AttributeId ATTRIB_PROCESSOR = AttributeId("processor",138); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc +index 6b170df8e..4511dbb65 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighbase.cc +@@ -15,6 +15,8 @@ + */ + #include "sleighbase.hh" + ++using namespace std; ++ + const int4 SleighBase::SLA_FORMAT_VERSION = 3; + + const uint4 SleighBase::MAX_UNIQUE_SIZE = 128; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc +index 87a4d7980..3ed0c3390 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleighexample.cc +@@ -22,6 +22,8 @@ + #include "emulate.hh" + #include + ++using namespace std; ++ + // These are the bytes for an example x86 binary + // These bytes are loaded at address 0x80483b4 + static uint1 myprog[] = { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc +index 40d731480..2c8eefab7 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc +@@ -17,6 +17,8 @@ + #include "filemanage.hh" + #include + ++using namespace std; ++ + SleighCompile *slgh; // Global pointer to sleigh object for use with parser + #ifdef YYDEBUG + extern int yydebug; // Global debugging state for parser +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc +index 746d70a81..e2ac5dd79 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc +@@ -110,6 +110,8 @@ + + /* In a future release of Bison, this section will be replaced + by #include "slghparse.hh". */ ++ ++using namespace std; + #ifndef YY_YY_SLGHPARSE_HH_INCLUDED + # define YY_YY_SLGHPARSE_HH_INCLUDED + /* Debug traces. */ +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +index b3fedb7b6..0e2172f79 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +@@ -16,6 +16,8 @@ + %{ + #include "slgh_compile.hh" + ++using namespace std; ++ + #define YYERROR_VERBOSE + + extern SleighCompile *slgh; +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc +index 3b7534f09..f6f4f029d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc +@@ -16,6 +16,8 @@ + #include "slghpatexpress.hh" + #include "sleighbase.hh" + ++using namespace std; ++ + int4 TokenPattern::resolveTokens(const TokenPattern &tok1,const TokenPattern &tok2) + + { // Use the token lists to decide how the two patterns +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc +index 4ebeaa000..9cb0803eb 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc +@@ -15,6 +15,8 @@ + */ + #include "slghpattern.hh" + ++using namespace std; ++ + uintm DisjointPattern::getMask(int4 startbit,int4 size,bool context) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc +index 1ac87e2cd..20cbf21e4 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc +@@ -888,6 +888,9 @@ char *yytext; + #line 18 "slghscan.l" + #include "slgh_compile.hh" + #include "slghparse.hh" ++ ++using namespace std; ++ + #define yywrap() 1 + #define YY_SKIP_YYWRAP + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l +index 2df137019..f2341ef09 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l +@@ -17,6 +17,9 @@ + %{ + #include "slgh_compile.hh" + #include "slghparse.hh" ++ ++using namespace std; ++ + #define yywrap() 1 + #define YY_SKIP_YYWRAP + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc +index 85bd54261..22dc50d0d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc +@@ -17,6 +17,8 @@ + #include "sleighbase.hh" + #include + ++using namespace std; ++ + SleighSymbol *SymbolScope::addSymbol(SleighSymbol *a) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc +index ff6f282ca..b8ac04e72 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc +@@ -18,6 +18,8 @@ + + #include + ++using namespace std; ++ + AttributeId ATTRIB_BASE = AttributeId("base",89); + AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90); + AttributeId ATTRIB_DELAY = AttributeId("delay", 91); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc +index 080f543ce..eb10514d1 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "string_ghidra.hh" + ++using namespace std; ++ + GhidraStringManager::GhidraStringManager(ArchitectureGhidra *g,int4 max) + : StringManager(max) + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc +index 220210a1c..a1324ca46 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc +@@ -16,6 +16,8 @@ + #include "stringmanage.hh" + #include "architecture.hh" + ++using namespace std; ++ + AttributeId ATTRIB_TRUNC = AttributeId("trunc",69); + + ElementId ELEM_BYTES = ElementId("bytes",83); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc +index 8f6835b3f..2a79f2942 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc +@@ -15,6 +15,8 @@ + */ + #include "subflow.hh" + ++using namespace std; ++ + /// \brief Return \e slot of constant if INT_OR op sets all bits in mask, otherwise -1 + /// + /// \param orop is the given CPUI_INT_OR op +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc +index ebc049c29..cfac8815a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc +@@ -19,6 +19,8 @@ + + #include "libdecomp.hh" + ++using namespace std; ++ + vector UnitTest::tests; + + /// Run all the tests unless a non-empty set of names is passed in. +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc +index 4f7110bb4..a23cad3df 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc +@@ -15,6 +15,8 @@ + */ + #include "ifacedecomp.hh" + ++using namespace std; ++ + void FunctionTestProperty::startTest(void) const + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc +index 3c594169d..2e42baac0 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc +@@ -16,6 +16,8 @@ + #include "transform.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_VECTOR_LANE_SIZES = AttributeId("vector_lane_sizes",130); + + /// \param op2 is the lane description to copy from +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc +index 6e379031a..689583858 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc +@@ -15,6 +15,8 @@ + */ + #include "translate.hh" + ++using namespace std; ++ + AttributeId ATTRIB_CODE = AttributeId("code",43); + AttributeId ATTRIB_CONTAIN = AttributeId("contain",44); + AttributeId ATTRIB_DEFAULTSPACE = AttributeId("defaultspace",45); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +index f50e07f84..b1c8124d9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc +@@ -16,6 +16,8 @@ + #include "type.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// The base propagation ordering associated with each meta-type. + /// The array elements correspond to the ordering of #type_metatype. + sub_metatype Datatype::base2sub[15] = { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc +index 351e3df1a..dcc279aaf 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc +@@ -15,6 +15,8 @@ + */ + #include "typegrp_ghidra.hh" + ++using namespace std; ++ + Datatype *TypeFactoryGhidra::findById(const string &n,uint8 id,int4 sz) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc +index 11000806f..210d7ae99 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc +@@ -17,6 +17,8 @@ + #include "funcdata.hh" + #include + ++using namespace std; ++ + /// \param inst will hold the array of TypeOp objects, indexed on op-code + /// \param tlst is the corresponding TypeFactory for the Architecture + /// \param trans is the Translate object for floating-point formats +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc +index d848cfc7d..4caefde8d 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc +@@ -16,6 +16,8 @@ + #ifdef CPUI_RULECOMPILE + #include "unify.hh" + ++using namespace std; ++ + UnifyDatatype::UnifyDatatype(uint4 tp) + + { +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc +index 940d33322..055662fb9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc +@@ -16,6 +16,8 @@ + #include "unionresolve.hh" + #include "funcdata.hh" + ++using namespace std; ++ + /// The original parent must either be a union, a pointer to a union, or a partial union. + /// The object is set up initially to resolve to the parent. + /// \param parent is the original parent data-type +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc +index e60353941..d32919020 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc +@@ -16,6 +16,8 @@ + #include "userop.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_FARPOINTER = AttributeId("farpointer",85); + AttributeId ATTRIB_INPUTOP = AttributeId("inputop",86); + AttributeId ATTRIB_OUTPUTOP = AttributeId("outputop",87); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc +index b8fdd62c9..8574d7212 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc +@@ -17,6 +17,8 @@ + #include "op.hh" + #include "database.hh" + ++using namespace std; ++ + AttributeId ATTRIB_CLASS = AttributeId("class",66); + AttributeId ATTRIB_REPREF = AttributeId("repref",67); + AttributeId ATTRIB_SYMREF = AttributeId("symref",68); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc +index 76f4ed86f..9674c5dfe 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc +@@ -16,6 +16,8 @@ + #include "varmap.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_LOCK = AttributeId("lock",133); + AttributeId ATTRIB_MAIN = AttributeId("main",134); + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc +index 36203c8d6..65451d0a5 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc +@@ -16,6 +16,8 @@ + #include "varnode.hh" + #include "funcdata.hh" + ++using namespace std; ++ + AttributeId ATTRIB_ADDRTIED = AttributeId("addrtied",30); + AttributeId ATTRIB_GRP = AttributeId("grp",31); + AttributeId ATTRIB_INPUT = AttributeId("input",32); +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc +index fc4d1bf61..68778c5ca 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc +@@ -98,6 +98,8 @@ + #include + #include + ++using namespace std; ++ + string Attributes::bogus_uri("http://unused.uri"); + + /// \brief The XML character scanner +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y +index 8f5386237..5d5f702cc 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y +@@ -25,6 +25,8 @@ + #include + #include + ++using namespace std; ++ + string Attributes::bogus_uri("http://unused.uri"); + + /// \brief The XML character scanner +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc +index c5c533ba9..21e6e390a 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc +@@ -15,6 +15,8 @@ + */ + #include "xml_arch.hh" + ++using namespace std; ++ + ElementId ELEM_XML_SAVEFILE = ElementId("xml_savefile",236); + + // Constructing the singleton registers the capability +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc +index a8bf58ec5..6dcfc7930 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc +@@ -16,6 +16,8 @@ + #include "architecture.hh" + #include "test.hh" + ++using namespace std; ++ + class CircleRangeTestEnvironment { + Architecture *g; + public: +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc +index 67d92c573..9cb08b3d1 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc +@@ -27,6 +27,8 @@ + #include + #include + ++using namespace std; ++ + // utility functions + float floatFromRawBits(uintb e) { + float f; +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc +index 26c7d62d7..f409f4cb9 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc +@@ -16,6 +16,8 @@ + #include "translate.hh" + #include "test.hh" + ++using namespace std; ++ + class TestAddrSpaceManager : public AddrSpaceManager { + public: + TestAddrSpaceManager(Translate *t); +diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc +index 4ce7cdde6..1ac3c3d5f 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc ++++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc +@@ -18,6 +18,8 @@ + #include "test.hh" + #include + ++using namespace std; ++ + static Architecture *glb; + static TypeFactory *types; + static CastStrategy *strategy; +-- +2.40.0 + diff --git a/src/patches/stable/0005-Remove-using-namespace-std-from-headers.patch b/src/patches/stable/0006-2-4-decompiler-Remusing-automated-std-namespace-fix.patch similarity index 91% rename from src/patches/stable/0005-Remove-using-namespace-std-from-headers.patch rename to src/patches/stable/0006-2-4-decompiler-Remusing-automated-std-namespace-fix.patch index 2f0a1da..b4353a7 100644 --- a/src/patches/stable/0005-Remove-using-namespace-std-from-headers.patch +++ b/src/patches/stable/0006-2-4-decompiler-Remusing-automated-std-namespace-fix.patch @@ -1,240 +1,111 @@ -From 9b8d25a25cfc2f47853f844282e89a786b4df65f Mon Sep 17 00:00:00 2001 +From 9e624c292572ff219dc5c17071fd84435127e4b2 Mon Sep 17 00:00:00 2001 From: Eric Kilmer -Date: Wed, 2 Nov 2022 19:41:19 -0400 -Subject: [PATCH 5/5] Remove 'using namespace std' from headers +Date: Sun, 19 Mar 2023 15:44:23 -0400 +Subject: [PATCH 6/8] (2/4) decompiler: Remusing automated std namespace fix -Still uses it in source files to reduce diff and ease transition. - -I did not regenerate the files because it would cause more diffs than -necessary. +The remusing tool uses a heuristic to search for and add a prefix to +unqualified symbols that came from the C++ standard library. --- - .../Decompiler/src/decompile/cpp/action.cc | 2 + .../Decompiler/src/decompile/cpp/action.hh | 122 ++-- - .../Decompiler/src/decompile/cpp/address.cc | 2 + .../Decompiler/src/decompile/cpp/address.hh | 24 +- - .../src/decompile/cpp/architecture.cc | 2 + .../src/decompile/cpp/architecture.hh | 62 +- - .../Decompiler/src/decompile/cpp/bfd_arch.cc | 2 + .../Decompiler/src/decompile/cpp/bfd_arch.hh | 6 +- - .../Decompiler/src/decompile/cpp/block.cc | 2 + .../Decompiler/src/decompile/cpp/block.hh | 116 ++-- - .../src/decompile/cpp/blockaction.cc | 2 + .../src/decompile/cpp/blockaction.hh | 78 +-- - .../Decompiler/src/decompile/cpp/callgraph.cc | 2 + .../Decompiler/src/decompile/cpp/callgraph.hh | 20 +- - .../src/decompile/cpp/capability.cc | 2 + .../src/decompile/cpp/capability.hh | 4 +- - .../Decompiler/src/decompile/cpp/cast.cc | 2 + - .../Decompiler/src/decompile/cpp/codedata.cc | 2 + .../Decompiler/src/decompile/cpp/codedata.hh | 56 +- - .../Decompiler/src/decompile/cpp/comment.cc | 2 + .../Decompiler/src/decompile/cpp/comment.hh | 28 +- - .../src/decompile/cpp/comment_ghidra.cc | 2 + .../src/decompile/cpp/comment_ghidra.hh | 4 +- - .../Decompiler/src/decompile/cpp/condexe.cc | 2 + .../Decompiler/src/decompile/cpp/condexe.hh | 12 +- - .../src/decompile/cpp/consolemain.cc | 2 + - .../Decompiler/src/decompile/cpp/context.cc | 2 + .../Decompiler/src/decompile/cpp/context.hh | 14 +- - .../src/decompile/cpp/coreaction.cc | 2 + - .../src/decompile/cpp/coreaction.hh | 162 ++--- - .../Decompiler/src/decompile/cpp/cover.cc | 2 + + .../src/decompile/cpp/coreaction.hh | 156 ++--- .../Decompiler/src/decompile/cpp/cover.hh | 12 +- - .../Decompiler/src/decompile/cpp/cpool.cc | 2 + .../Decompiler/src/decompile/cpp/cpool.hh | 22 +- - .../src/decompile/cpp/cpool_ghidra.cc | 2 + .../src/decompile/cpp/cpool_ghidra.hh | 4 +- - .../Decompiler/src/decompile/cpp/crc32.cc | 2 + - .../Decompiler/src/decompile/cpp/database.cc | 2 + .../Decompiler/src/decompile/cpp/database.hh | 152 ++--- - .../src/decompile/cpp/database_ghidra.cc | 2 + .../src/decompile/cpp/database_ghidra.hh | 32 +- - .../Decompiler/src/decompile/cpp/double.cc | 2 + .../Decompiler/src/decompile/cpp/double.hh | 26 +- - .../Decompiler/src/decompile/cpp/dynamic.cc | 2 + - .../Decompiler/src/decompile/cpp/dynamic.hh | 12 +- - .../Decompiler/src/decompile/cpp/emulate.cc | 2 + + .../Decompiler/src/decompile/cpp/dynamic.hh | 14 +- .../Decompiler/src/decompile/cpp/emulate.hh | 22 +- - .../src/decompile/cpp/emulateutil.cc | 2 + .../src/decompile/cpp/emulateutil.hh | 8 +- .../Decompiler/src/decompile/cpp/error.hh | 10 +- - .../src/decompile/cpp/filemanage.cc | 2 + .../src/decompile/cpp/filemanage.hh | 30 +- - .../Decompiler/src/decompile/cpp/float.cc | 2 + .../Decompiler/src/decompile/cpp/float.hh | 2 +- - .../Decompiler/src/decompile/cpp/flow.cc | 2 + .../Decompiler/src/decompile/cpp/flow.hh | 30 +- - .../Decompiler/src/decompile/cpp/fspec.cc | 2 + .../Decompiler/src/decompile/cpp/fspec.hh | 154 ++--- - .../Decompiler/src/decompile/cpp/funcdata.cc | 2 + .../Decompiler/src/decompile/cpp/funcdata.hh | 84 +-- - .../src/decompile/cpp/funcdata_block.cc | 2 + - .../src/decompile/cpp/funcdata_op.cc | 2 + - .../src/decompile/cpp/funcdata_varnode.cc | 2 + - .../src/decompile/cpp/ghidra_arch.cc | 2 + - .../src/decompile/cpp/ghidra_arch.hh | 64 +- - .../src/decompile/cpp/ghidra_context.cc | 2 + + .../src/decompile/cpp/ghidra_arch.hh | 64 +-- .../src/decompile/cpp/ghidra_context.hh | 10 +- - .../src/decompile/cpp/ghidra_process.cc | 2 + - .../src/decompile/cpp/ghidra_process.hh | 26 +- - .../src/decompile/cpp/ghidra_translate.cc | 2 + + .../src/decompile/cpp/ghidra_process.hh | 24 +- .../src/decompile/cpp/ghidra_translate.hh | 14 +- - .../src/decompile/cpp/globalcontext.cc | 2 + .../src/decompile/cpp/globalcontext.hh | 34 +- - .../Decompiler/src/decompile/cpp/grammar.cc | 2 + .../Decompiler/src/decompile/cpp/grammar.hh | 140 ++--- - .../Decompiler/src/decompile/cpp/graph.cc | 2 + .../Decompiler/src/decompile/cpp/graph.hh | 6 +- - .../Decompiler/src/decompile/cpp/heritage.cc | 2 + .../Decompiler/src/decompile/cpp/heritage.hh | 80 +-- - .../src/decompile/cpp/ifacedecomp.cc | 2 + .../src/decompile/cpp/ifacedecomp.hh | 238 ++++---- - .../Decompiler/src/decompile/cpp/ifaceterm.cc | 2 + .../Decompiler/src/decompile/cpp/ifaceterm.hh | 12 +- - .../src/decompile/cpp/inject_ghidra.cc | 2 + .../src/decompile/cpp/inject_ghidra.hh | 28 +- - .../src/decompile/cpp/inject_sleigh.cc | 2 + .../src/decompile/cpp/inject_sleigh.hh | 50 +- - .../Decompiler/src/decompile/cpp/interface.cc | 2 + - .../Decompiler/src/decompile/cpp/interface.hh | 104 ++-- - .../Decompiler/src/decompile/cpp/jumptable.cc | 2 + + .../Decompiler/src/decompile/cpp/interface.hh | 100 ++-- .../Decompiler/src/decompile/cpp/jumptable.hh | 74 +-- - .../Decompiler/src/decompile/cpp/libdecomp.cc | 2 + .../Decompiler/src/decompile/cpp/libdecomp.hh | 4 +- - .../Decompiler/src/decompile/cpp/loadimage.cc | 2 + .../Decompiler/src/decompile/cpp/loadimage.hh | 22 +- - .../src/decompile/cpp/loadimage_bfd.cc | 2 + .../src/decompile/cpp/loadimage_bfd.hh | 12 +- - .../src/decompile/cpp/loadimage_ghidra.cc | 2 + .../src/decompile/cpp/loadimage_ghidra.hh | 2 +- - .../src/decompile/cpp/loadimage_xml.cc | 2 + .../src/decompile/cpp/loadimage_xml.hh | 14 +- - .../Decompiler/src/decompile/cpp/marshal.cc | 1 + - .../Decompiler/src/decompile/cpp/marshal.hh | 78 ++- - .../Decompiler/src/decompile/cpp/memstate.cc | 2 + + .../Decompiler/src/decompile/cpp/marshal.hh | 90 ++- .../Decompiler/src/decompile/cpp/memstate.hh | 12 +- - .../Decompiler/src/decompile/cpp/merge.cc | 2 + .../Decompiler/src/decompile/cpp/merge.hh | 26 +- - .../Decompiler/src/decompile/cpp/op.cc | 2 + .../Decompiler/src/decompile/cpp/op.hh | 56 +- - .../src/decompile/cpp/opbehavior.cc | 2 + .../src/decompile/cpp/opbehavior.hh | 4 +- - .../Decompiler/src/decompile/cpp/opcodes.cc | 2 + .../Decompiler/src/decompile/cpp/opcodes.hh | 4 +- - .../Decompiler/src/decompile/cpp/options.cc | 2 + .../Decompiler/src/decompile/cpp/options.hh | 82 +-- - .../Decompiler/src/decompile/cpp/override.cc | 2 + .../Decompiler/src/decompile/cpp/override.hh | 22 +- - .../Decompiler/src/decompile/cpp/paramid.cc | 2 + .../Decompiler/src/decompile/cpp/paramid.hh | 10 +- - .../Decompiler/src/decompile/cpp/partmap.hh | 11 +- - .../src/decompile/cpp/pcodecompile.cc | 2 + + .../Decompiler/src/decompile/cpp/partmap.hh | 12 +- .../src/decompile/cpp/pcodecompile.hh | 50 +- - .../src/decompile/cpp/pcodeinject.cc | 2 + .../src/decompile/cpp/pcodeinject.hh | 84 +-- - .../src/decompile/cpp/pcodeparse.cc | 2 + .../src/decompile/cpp/pcodeparse.hh | 24 +- - .../Decompiler/src/decompile/cpp/pcodeparse.y | 2 + - .../Decompiler/src/decompile/cpp/pcoderaw.cc | 2 + .../Decompiler/src/decompile/cpp/pcoderaw.hh | 2 +- - .../src/decompile/cpp/prefersplit.cc | 2 + .../src/decompile/cpp/prefersplit.hh | 8 +- - .../src/decompile/cpp/prettyprint.cc | 2 + .../src/decompile/cpp/prettyprint.hh | 144 ++--- - .../Decompiler/src/decompile/cpp/printc.cc | 2 + .../Decompiler/src/decompile/cpp/printc.hh | 72 +-- - .../Decompiler/src/decompile/cpp/printjava.cc | 2 + .../Decompiler/src/decompile/cpp/printjava.hh | 4 +- - .../src/decompile/cpp/printlanguage.cc | 2 + - .../src/decompile/cpp/printlanguage.hh | 64 +- - .../Decompiler/src/decompile/cpp/rangeutil.cc | 2 + + .../src/decompile/cpp/printlanguage.hh | 64 +-- .../Decompiler/src/decompile/cpp/rangeutil.hh | 38 +- - .../Decompiler/src/decompile/cpp/raw_arch.cc | 2 + .../Decompiler/src/decompile/cpp/raw_arch.hh | 6 +- - .../src/decompile/cpp/ruleaction.cc | 2 + - .../src/decompile/cpp/ruleaction.hh | 564 +++++++++--------- - .../src/decompile/cpp/rulecompile.cc | 2 + + .../src/decompile/cpp/ruleaction.hh | 540 +++++++++--------- .../src/decompile/cpp/rulecompile.hh | 44 +- - .../Decompiler/src/decompile/cpp/ruleparse.y | 2 + - .../Decompiler/src/decompile/cpp/semantics.cc | 2 + .../Decompiler/src/decompile/cpp/semantics.hh | 42 +- - .../Decompiler/src/decompile/cpp/sleigh.cc | 2 + - .../Decompiler/src/decompile/cpp/sleigh.hh | 22 +- - .../src/decompile/cpp/sleigh_arch.cc | 2 + + .../Decompiler/src/decompile/cpp/sleigh.hh | 10 +- .../src/decompile/cpp/sleigh_arch.hh | 82 +-- - .../src/decompile/cpp/sleighbase.cc | 2 + .../src/decompile/cpp/sleighbase.hh | 32 +- - .../src/decompile/cpp/sleighexample.cc | 2 + - .../src/decompile/cpp/slgh_compile.cc | 2 + .../src/decompile/cpp/slgh_compile.hh | 144 ++--- - .../Decompiler/src/decompile/cpp/slghparse.cc | 2 + .../Decompiler/src/decompile/cpp/slghparse.hh | 14 +- - .../Decompiler/src/decompile/cpp/slghparse.y | 2 + - .../src/decompile/cpp/slghpatexpress.cc | 2 + .../src/decompile/cpp/slghpatexpress.hh | 158 ++--- - .../src/decompile/cpp/slghpattern.cc | 2 + .../src/decompile/cpp/slghpattern.hh | 22 +- - .../Decompiler/src/decompile/cpp/slghscan.cc | 3 + - .../Decompiler/src/decompile/cpp/slghscan.l | 3 + - .../src/decompile/cpp/slghsymbol.cc | 2 + .../src/decompile/cpp/slghsymbol.hh | 236 ++++---- - .../Decompiler/src/decompile/cpp/space.cc | 2 + .../Decompiler/src/decompile/cpp/space.hh | 44 +- - .../src/decompile/cpp/string_ghidra.cc | 2 + .../src/decompile/cpp/string_ghidra.hh | 2 +- - .../src/decompile/cpp/stringmanage.cc | 2 + .../src/decompile/cpp/stringmanage.hh | 12 +- - .../Decompiler/src/decompile/cpp/subflow.cc | 2 + .../Decompiler/src/decompile/cpp/subflow.hh | 18 +- - .../Decompiler/src/decompile/cpp/test.cc | 2 + - .../src/decompile/cpp/testfunction.cc | 2 + .../src/decompile/cpp/testfunction.hh | 34 +- - .../Decompiler/src/decompile/cpp/transform.cc | 2 + .../Decompiler/src/decompile/cpp/transform.hh | 16 +- - .../Decompiler/src/decompile/cpp/translate.cc | 2 + - .../Decompiler/src/decompile/cpp/translate.hh | 46 +- - .../Decompiler/src/decompile/cpp/type.cc | 2 + + .../Decompiler/src/decompile/cpp/translate.hh | 48 +- .../Decompiler/src/decompile/cpp/type.hh | 126 ++-- - .../src/decompile/cpp/typegrp_ghidra.cc | 2 + .../src/decompile/cpp/typegrp_ghidra.hh | 2 +- - .../Decompiler/src/decompile/cpp/typeop.cc | 2 + .../Decompiler/src/decompile/cpp/typeop.hh | 82 +-- - .../Decompiler/src/decompile/cpp/unify.cc | 2 + .../Decompiler/src/decompile/cpp/unify.hh | 188 +++--- - .../src/decompile/cpp/unionresolve.cc | 2 + .../src/decompile/cpp/unionresolve.hh | 10 +- - .../Decompiler/src/decompile/cpp/userop.cc | 2 + .../Decompiler/src/decompile/cpp/userop.hh | 48 +- - .../Decompiler/src/decompile/cpp/variable.cc | 2 + .../Decompiler/src/decompile/cpp/variable.hh | 8 +- - .../Decompiler/src/decompile/cpp/varmap.cc | 2 + .../Decompiler/src/decompile/cpp/varmap.hh | 38 +- - .../Decompiler/src/decompile/cpp/varnode.cc | 2 + .../Decompiler/src/decompile/cpp/varnode.hh | 22 +- - .../Decompiler/src/decompile/cpp/xml.cc | 2 + - .../Decompiler/src/decompile/cpp/xml.hh | 148 +++-- - .../Decompiler/src/decompile/cpp/xml.y | 2 + - .../Decompiler/src/decompile/cpp/xml_arch.cc | 2 + + .../Decompiler/src/decompile/cpp/xml.hh | 134 +++-- .../Decompiler/src/decompile/cpp/xml_arch.hh | 6 +- - .../decompile/unittests/testcirclerange.cc | 2 + - .../src/decompile/unittests/testfloatemu.cc | 2 + - .../src/decompile/unittests/testmarshal.cc | 2 + - .../src/decompile/unittests/testtypes.cc | 2 + - 212 files changed, 2848 insertions(+), 2634 deletions(-) + 98 files changed, 2596 insertions(+), 2612 deletions(-) -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc -index 7b1b2062a..76fc27d72 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc -@@ -18,6 +18,8 @@ - - #include "coreaction.hh" - -+using namespace std; -+ - /// Specify the name, group, and properties of the Action - /// \param f is the collection of property flags - /// \param nm is the Action name diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/action.hh index 645c81119..c9369c025 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.hh @@ -484,19 +355,6 @@ index 645c81119..c9369c025 100644 void universalAction(Architecture *glb); ///< Build the universal action }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -index 0b3bf04c8..9a58ea4ef 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc -@@ -16,6 +16,8 @@ - #include "address.hh" - #include "translate.hh" - -+using namespace std; -+ - AttributeId ATTRIB_FIRST = AttributeId("first",27); - AttributeId ATTRIB_LAST = AttributeId("last",28); - AttributeId ATTRIB_UNIQ = AttributeId("uniq",29); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh index ace26f175..084a78b1b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.hh @@ -593,21 +451,8 @@ index ace26f175..084a78b1b 100644 int4 sz; offset=base->read(s,sz); return sz; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc -index cb96bbbbc..18b379314 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.cc -@@ -24,6 +24,8 @@ - #include - #endif - -+using namespace std; -+ - vector ArchitectureCapability::thelist; - - const uint4 ArchitectureCapability::majorversion = 5; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh -index 300721274..638445c03 100644 +index 20cb06f0d..1da109f31 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/architecture.hh @@ -54,7 +54,7 @@ class Statistics { @@ -619,7 +464,7 @@ index 300721274..638445c03 100644 }; #endif -@@ -114,11 +114,11 @@ extern ElementId ELEM_VOLATILE; ///< Marshaling element \ +@@ -115,11 +115,11 @@ extern ElementId ELEM_VOLATILE; ///< Marshaling element \ class ArchitectureCapability : public CapabilityPoint { static const uint4 majorversion; ///< Current major version of decompiler static const uint4 minorversion; ///< Current minor version of decompiler @@ -634,7 +479,7 @@ index 300721274..638445c03 100644 virtual void initialize(void); ///< Do specialized initialization /// \brief Build an Architecture given a raw file or data -@@ -129,13 +129,13 @@ class ArchitectureCapability : public CapabilityPoint { +@@ -130,13 +130,13 @@ class ArchitectureCapability : public CapabilityPoint { /// \param filename is the path to the executable file to examine /// \param target if non-empty is a language id string /// \param estream is an output stream for error messages @@ -650,7 +495,7 @@ index 300721274..638445c03 100644 /// \brief Determine is this extension can handle this XML document /// -@@ -145,9 +145,9 @@ class ArchitectureCapability : public CapabilityPoint { +@@ -146,9 +146,9 @@ class ArchitectureCapability : public CapabilityPoint { /// \return \b true if \b this extension understands the XML virtual bool isXmlMatch(Document *doc) const=0; @@ -662,7 +507,7 @@ index 300721274..638445c03 100644 static void sortCapabilities(void); ///< Sort extensions static uint4 getMajorVersion(void) { return majorversion; } ///< Get \e major decompiler version static uint4 getMinorVersion(void) { return minorversion; } ///< Get \e minor decompiler version -@@ -161,7 +161,7 @@ class ArchitectureCapability : public CapabilityPoint { +@@ -162,7 +162,7 @@ class ArchitectureCapability : public CapabilityPoint { /// This class also holds numerous configuration parameters for the analysis process class Architecture : public AddrSpaceManager { public: @@ -671,7 +516,7 @@ index 300721274..638445c03 100644 // Configuration data int4 trim_recurse_max; ///< How many levels to let parameter trims recurse -@@ -173,16 +173,16 @@ class Architecture : public AddrSpaceManager { +@@ -174,16 +174,16 @@ class Architecture : public AddrSpaceManager { bool readonlypropagate; ///< true if readonly values should be treated as constants bool infer_pointers; ///< True if we should infer pointers from constants that are likely addresses bool analyze_for_loops; ///< True if we should attempt conversion of \e whiledo loops to \e for loops @@ -691,7 +536,7 @@ index 300721274..638445c03 100644 ProtoModel *defaultfp; ///< Parsed form of default prototype VarnodeData defaultReturnAddr; ///< Default storage location of return address (for current function) ProtoModel *evalfp_current; ///< Function proto to use when evaluating current function -@@ -196,58 +196,58 @@ class Architecture : public AddrSpaceManager { +@@ -197,58 +197,58 @@ class Architecture : public AddrSpaceManager { StringManager *stringManager; ///< Manager of decoded strings ConstantPool *cpool; ///< Deferred constant values PrintLanguage *print; ///< Current high-level language printer @@ -767,7 +612,7 @@ index 300721274..638445c03 100644 int4 truncSize,bool isreversejustified,bool stackGrowth,bool isFormal); void addNoHighPtr(const Range &rng); ///< Add a new region where pointers do not exist -@@ -302,7 +302,7 @@ class Architecture : public AddrSpaceManager { +@@ -338,7 +338,7 @@ class Architecture : public AddrSpaceManager { void fillinReadOnlyFromLoader(void); ///< Load info about read-only sections void initializeSegments(); ///< Set up segment resolvers void cacheAddrSpaceProperties(void); ///< Calculate some frequently used space properties and cache them @@ -776,7 +621,7 @@ index 300721274..638445c03 100644 void parseProcessorConfig(DocumentStorage &store); ///< Apply processor specific configuration void parseCompilerConfig(DocumentStorage &store); ///< Apply compiler specific configuration -@@ -312,7 +312,7 @@ class Architecture : public AddrSpaceManager { +@@ -348,7 +348,7 @@ class Architecture : public AddrSpaceManager { ProtoModel *decodeProto(Decoder &decoder); ///< Parse a proto-type model from a stream void decodeProtoEval(Decoder &decoder); ///< Apply prototype evaluation configuration void decodeDefaultProto(Decoder &decoder); ///< Apply default prototype model configuration @@ -785,19 +630,6 @@ index 300721274..638445c03 100644 void addToGlobalScope(const RangeProperties &props); ///< Add a memory range to the set of addresses considered \e global void addOtherSpace(void); ///< Add OTHER space and all of its overlays to the symboltab void decodeReadOnly(Decoder &decoder); ///< Apply read-only region configuration -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc -index b9a495500..a37960f9e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.cc -@@ -16,6 +16,8 @@ - */ - #include "bfd_arch.hh" - -+using namespace std; -+ - // Constructing this object registers capability - BfdArchitectureCapability BfdArchitectureCapability::bfdArchitectureCapability; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh index 6ade01ecc..ed206737b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/bfd_arch.hh @@ -822,19 +654,6 @@ index 6ade01ecc..ed206737b 100644 virtual ~BfdArchitecture(void) {} }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc -index 611009333..fff1a5cfe 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc -@@ -17,6 +17,8 @@ - #include "block.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_ALTINDEX = AttributeId("altindex",75); - AttributeId ATTRIB_DEPTH = AttributeId("depth",76); - AttributeId ATTRIB_END = AttributeId("end",77); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/block.hh index 556789694..9c49e4c51 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.hh @@ -1179,19 +998,6 @@ index 556789694..9c49e4c51 100644 { return 2; // By default a block will not normalize -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc -index 80265a458..9c9906f8f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.cc -@@ -16,6 +16,8 @@ - #include "blockaction.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// Retrieve the current edge (as a \e top FlowBlock and the index of the outgoing edge). - /// If the end-points have been collapsed together, this returns NULL. - /// The top and bottom nodes of the edge are updated to FlowBlocks in the current collapsed graph. diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh index 09b1779dc..0ae2b6234 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/blockaction.hh @@ -1398,19 +1204,6 @@ index 09b1779dc..0ae2b6234 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionNodeJoin(getGroup()); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc -index 26406c288..6b6a8d34b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.cc -@@ -16,6 +16,8 @@ - #include "callgraph.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_CALLGRAPH = ElementId("callgraph",226); - ElementId ELEM_NODE = ElementId("node",227); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.hh index f8419f15a..5ad32b66f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/callgraph.hh @@ -1469,19 +1262,6 @@ index f8419f15a..5ad32b66f 100644 void buildAllNodes(void); void buildEdges(Funcdata *fd); void encode(Encoder &encoder) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc -index 87e40dbbf..481cf3378 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.cc -@@ -15,6 +15,8 @@ - */ - #include "capability.hh" - -+using namespace std; -+ - /// Access static vector of CapabilityPoint objects that are registered during static initialization - /// The list itself is created once on the first call to this method - /// \e after all the static initializers have run diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh index 9ed07195d..4cbbf6aec 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/capability.hh @@ -1504,32 +1284,6 @@ index 9ed07195d..4cbbf6aec 100644 protected: CapabilityPoint(void); ///< Construct extension capability exactly once public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc -index dc8baa764..0899dc5de 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cast.cc -@@ -16,6 +16,8 @@ - #include "cast.hh" - #include "op.hh" - -+using namespace std; -+ - /// Sets the TypeFactory used to produce data-types for the arithmeticOutputStandard() method - /// \param t is the TypeFactory - void CastStrategy::setTypeFactory(TypeFactory *t) -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc -index 92690f422..1ba834bd6 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.cc -@@ -17,6 +17,8 @@ - #include "codedata.hh" - #include "loadimage_bfd.hh" - -+using namespace std; -+ - // Constructing this registers the capability - IfaceCodeDataCapability IfaceCodeDataCapability::ifaceCodeDataCapability; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.hh index 3b5a4b031..87db1807b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/codedata.hh @@ -1668,19 +1422,6 @@ index 3b5a4b031..87db1807b 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc -index b5bc0a16d..e495b734e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.cc -@@ -16,6 +16,8 @@ - #include "comment.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_COMMENT = ElementId("comment",86); - ElementId ELEM_COMMENTDB = ElementId("commentdb",87); - ElementId ELEM_TEXT = ElementId("text",88); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh index b2be60f0f..49d4e1950 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment.hh @@ -1771,19 +1512,6 @@ index b2be60f0f..49d4e1950 100644 bool displayUnplacedComments; ///< True if unplaced comments should be displayed (in the header) bool findPosition(Subsort &subsort,Comment *comm,const Funcdata *fd); ///< Establish sorting key for a Comment public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc -index 04a4c2cf0..2ba980fc0 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "comment_ghidra.hh" - -+using namespace std; -+ - CommentDatabaseGhidra::CommentDatabaseGhidra(ArchitectureGhidra *g) - : CommentDatabase() - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.hh index c0dc59c89..0ed0def99 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/comment_ghidra.hh @@ -1799,19 +1527,6 @@ index c0dc59c89..0ed0def99 100644 virtual void deleteComment(Comment *com) { throw LowlevelError("deleteComment unimplemented"); } virtual CommentSet::const_iterator beginComment(const Address &fad) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc -index 962f35d5d..0c41bb363 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.cc -@@ -15,6 +15,8 @@ - */ - #include "condexe.hh" - -+using namespace std; -+ - ConditionMarker::ConditionMarker(void) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh index bf2e54615..8d479c3ed 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/condexe.hh @@ -1853,32 +1568,6 @@ index bf2e54615..8d479c3ed 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc -index f40f3dd66..c4a628228 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/consolemain.cc -@@ -18,6 +18,8 @@ - - #include "libdecomp.hh" - -+using namespace std; -+ - class IfcLoadFile : public IfaceDecompCommand { - public: - virtual void execute(istream &s); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc -index 51157f3a7..19ab8ddfa 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/context.cc -@@ -17,6 +17,8 @@ - #include "slghsymbol.hh" - #include "translate.hh" - -+using namespace std; -+ - ParserContext::ParserContext(ContextCache *ccache,Translate *trans) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh index 8ae7012a6..5f00991fc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh @@ -1936,21 +1625,8 @@ index 8ae7012a6..5f00991fc 100644 }; inline void ParserContext::deallocateState(ParserWalkerChange &walker) { -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc -index a4c6b71fc..dfe23cf03 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.cc -@@ -18,6 +18,8 @@ - #include "double.hh" - #include "subflow.hh" - -+using namespace std; -+ - /// \brief A stack equation - struct StackEqn { - int4 var1; ///< Variable with 1 coefficient diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh -index 2f4c94921..7ef1e69ff 100644 +index 2f4c94921..fcb5c7582 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/coreaction.hh @@ -31,7 +31,7 @@ @@ -2025,15 +1701,6 @@ index 2f4c94921..7ef1e69ff 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionForceGoto(getGroup()); -@@ -149,7 +149,7 @@ class ActionForceGoto : public Action { - // \brief Perform common subexpression elimination - // class ActionCse : public Action { - // public: --// ActionCse(const string &g) : Action(0,"cse",g) {} ///< Constructor -+// ActionCse(const std::string &g) : Action(0,"cse",g) {} ///< Constructor - // virtual Action *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Action *)0; - // return new ActionCse(getGroup()); @@ -163,7 +163,7 @@ class ActionMultiCse : public Action { static PcodeOp *findMatch(BlockBasic *bl,PcodeOp *target,Varnode *in); ///< Find match to CPUI_MULTIEQUAL bool processBlock(Funcdata &data,BlockBasic *bl); ///< Search a block for equivalent CPUI_MULTIEQUAL @@ -2411,24 +2078,6 @@ index 2f4c94921..7ef1e69ff 100644 virtual Action *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Action *)0; return new ActionActiveReturn(getGroup()); -@@ -746,7 +746,7 @@ class ActionActiveReturn : public Action { - // \brief If there are any sub-function calls with \e paramshifts, add the shifted parameters. - // class ActionParamShiftStart : public Action { - // public: --// ActionParamShiftStart(const string &g) : Action( rule_onceperfunc, "paramshiftstart",g) {} ///< Constructor -+// ActionParamShiftStart(const std::string &g) : Action( rule_onceperfunc, "paramshiftstart",g) {} ///< Constructor - // virtual Action *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Action *)0; - // return new ActionParamShiftStart(getGroup()); -@@ -758,7 +758,7 @@ class ActionActiveReturn : public Action { - // class ActionParamShiftStop : public Action { - // bool paramshiftsleft; - // public: --// ActionParamShiftStop(const string &g) : Action( 0, "paramshiftstop",g) {} ///< Constructor -+// ActionParamShiftStop(const std::string &g) : Action( 0, "paramshiftstop",g) {} ///< Constructor - // virtual void reset(Funcdata &data) { paramshiftsleft = true; } - // virtual Action *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Action *)0; @@ -771,7 +771,7 @@ class ActionActiveReturn : public Action { class ActionReturnRecovery : public Action { static void buildReturnOutput(ParamActive *active,PcodeOp *retop,Funcdata &data); @@ -2604,19 +2253,6 @@ index 2f4c94921..7ef1e69ff 100644 }; /// \brief A comparison operator for ordering terms in a sum -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc -index 6e2b88a06..f41a8f745 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.cc -@@ -16,6 +16,8 @@ - #include "cover.hh" - #include "block.hh" - -+using namespace std; -+ - const CoverBlock Cover::emptyBlock; - - /// PcodeOp objects and a CoverBlock start/stop boundaries have diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh index 4d874ff9f..4cc0bdaaa 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/cover.hh @@ -2661,19 +2297,6 @@ index 4d874ff9f..4cc0bdaaa 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc -index 42b1531ad..8e1fd1150 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.cc -@@ -15,6 +15,8 @@ - */ - #include "cpool.hh" - -+using namespace std; -+ - AttributeId ATTRIB_A = AttributeId("a",80); - AttributeId ATTRIB_B = AttributeId("b",81); - AttributeId ATTRIB_LENGTH = AttributeId("length",82); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh index ce9b9809a..76a83fd9b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool.hh @@ -2761,19 +2384,6 @@ index ce9b9809a..76a83fd9b 100644 virtual bool empty(void) const { return cpoolMap.empty(); } virtual void clear(void) { cpoolMap.clear(); } virtual void encode(Encoder &encoder) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc -index e8dee8256..1da445915 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "cpool_ghidra.hh" - -+using namespace std; -+ - ConstantPoolGhidra::ConstantPoolGhidra(ArchitectureGhidra *g) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.hh index af65a8d2b..5efe96766 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/cpool_ghidra.hh @@ -2791,34 +2401,8 @@ index af65a8d2b..5efe96766 100644 virtual bool empty(void) const { return false; } virtual void clear(void) { cache.clear(); } virtual void encode(Encoder &encoder) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc -index 2881ab711..3c68cb3ba 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/crc32.cc -@@ -16,6 +16,8 @@ - */ - #include "crc32.hh" - -+using namespace std; -+ - // Table for bytewise calculation of a 32-bit Cyclic Redundancy Check - uint4 crc32tab[] = { - 0x0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f, -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc -index 4704eb1d3..2e0b74fb0 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database.cc -@@ -18,6 +18,8 @@ - #include "crc32.hh" - #include - -+using namespace std; -+ - AttributeId ATTRIB_CAT = AttributeId("cat",61); - AttributeId ATTRIB_FIELD = AttributeId("field",62); - AttributeId ATTRIB_MERGE = AttributeId("merge",63); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh -index 8da3a41fa..787b1ca8b 100644 +index 67f42a265..d8e4b8e7a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database.hh @@ -155,7 +155,7 @@ class SymbolEntry { @@ -3221,7 +2805,7 @@ index 8da3a41fa..787b1ca8b 100644 const Scope *mapScope(const Scope *qpoint,const Address &addr,const Address &usepoint) const; Scope *mapScope(Scope *qpoint,const Address &addr,const Address &usepoint); uint4 getProperty(const Address &addr) const { return flagbase.getValue(addr); } ///< Get boolean properties at the given address -@@ -935,7 +935,7 @@ class Database { +@@ -936,7 +936,7 @@ class Database { /// \param sc is the scope containing the new symbol /// \param nm is the local name of the symbol /// \param ct is the data-type of the symbol @@ -3230,19 +2814,6 @@ index 8da3a41fa..787b1ca8b 100644 { scope=sc; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc -index 35030ffe0..93d390f97 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.cc -@@ -16,6 +16,8 @@ - #include "database_ghidra.hh" - #include "funcdata.hh" - -+using namespace std; -+ - Scope *ScopeGhidra::buildSubScope(uint8 id,const string &nm) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.hh index 304bd2914..09a6b6af3 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/database_ghidra.hh @@ -3332,19 +2903,6 @@ index 304bd2914..09a6b6af3 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc -index ce5706bcd..14ad6929e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc -@@ -15,6 +15,8 @@ - */ - #include "double.hh" - -+using namespace std; -+ - /// Internally, the \b lo and \b hi Varnodes are set to null, and the \b val field - /// holds the constant value. - /// \param sz is the size in bytes of the constant diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/double.hh index 418d1f85e..09640b9d5 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.hh @@ -3419,21 +2977,8 @@ index 418d1f85e..09640b9d5 100644 + static void reassignIndirects(Funcdata &data,PcodeOp *newStore,const std::vector &indirects); }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc -index 9d8b08053..6c5fb790d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.cc -@@ -17,6 +17,8 @@ - #include "funcdata.hh" - #include "crc32.hh" - -+using namespace std; -+ - // Table for how to hash opcodes, lumps certain operators (i.e. ADD SUB PTRADD PTRSUB) into one hash - // zero indicates the operator should be skipped - const uint4 DynamicHash::transtable[] = { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh -index 2a500d56b..0973a626f 100644 +index 1355f9fe1..6fd8f9fec 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/dynamic.hh @@ -62,10 +62,10 @@ class DynamicHash { @@ -3451,7 +2996,16 @@ index 2a500d56b..0973a626f 100644 Address addrresult; ///< Address most closely associated with variable uint8 hash; ///< The calculated hash value -@@ -88,8 +88,8 @@ class DynamicHash { +@@ -77,7 +77,7 @@ class DynamicHash { + void gatherUnmarkedOp(void); ///< Mark any new PcodeOps in the sub-graph + void pieceTogetherHash(const Varnode *root,uint4 method); ///< Clean-up and piece together formal hash value + static void moveOffSkip(const PcodeOp *&op,int4 &slot); ///< Convert given PcodeOp to a non-skip op by following data-flow +- static void dedupVarnodes(vector &varlist); ///< Remove any duplicate Varnodes in given list ++ static void dedupVarnodes(std::vector &varlist); ///< Remove any duplicate Varnodes in given list + public: + void clear(void); ///< Called for each additional hash (after the first) + void calcHash(const Varnode *root,uint4 method); ///< Calculate the hash for given Varnode and method +@@ -89,8 +89,8 @@ class DynamicHash { uint8 getHash(void) const { return hash; } ///< Get the (current) hash const Address &getAddress(void) const { return addrresult; } ///< Get the (current) address @@ -3461,20 +3015,7 @@ index 2a500d56b..0973a626f 100644 + static void gatherOpsAtAddress(std::vector &opList,const Funcdata *fd,const Address &addr); static int4 getSlotFromHash(uint8 h); ///< Retrieve the encoded slot from a hash static uint4 getMethodFromHash(uint8 h); ///< Retrieve the encoded method from a hash - static OpCode getOpCodeFromHash(uint8 h); ///< Retrieve the encoded op-code from a hash -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc -index 88936cedd..5025d952d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.cc -@@ -15,6 +15,8 @@ - */ - #include "emulate.hh" - -+using namespace std; -+ - /// Any time the emulator is about to execute a user-defined pcode op with the given name, - /// the indicated breakpoint is invoked first. The break table does \e not assume responsibility - /// for freeing the breakpoint object. + static uint4 getOpCodeFromHash(uint8 h); ///< Retrieve the encoded op-code from a hash diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.hh index bfe874751..d7d33a980 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulate.hh @@ -3527,19 +3068,6 @@ index bfe874751..d7d33a980 100644 BreakTable *breaktable; ///< The table of breakpoints Address current_address; ///< Address of current instruction being executed bool instruction_start; ///< \b true if next pcode op is start of instruction -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc -index fe37a7be2..8e022e3a3 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.cc -@@ -16,6 +16,8 @@ - #include "architecture.hh" - #include "emulateutil.hh" - -+using namespace std; -+ - /// \param g is the Architecture providing the LoadImage - EmulatePcodeOp::EmulatePcodeOp(Architecture *g) - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh index a06b49ce3..92f76bd75 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/emulateutil.hh @@ -3609,19 +3137,6 @@ index 788b2421d..d2b35046e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc -index 9ab665cd3..56cd2620f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.cc -@@ -29,6 +29,8 @@ extern "C" { - } - #endif - -+using namespace std; -+ - // Path name separator - #ifdef _WINDOWS - char FileManage::separator = '\\'; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh index 9cd6f4e8f..f0c7423a0 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/filemanage.hh @@ -3667,19 +3182,6 @@ index 9cd6f4e8f..f0c7423a0 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc -index 068c7e991..8f843d1da 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/float.cc -@@ -19,6 +19,8 @@ - #include - #include "address.hh" - -+using namespace std; -+ - /// Set format for a given encoding size according to IEEE 754 standards - /// \param sz is the size of the encoding in bytes - FloatFormat::FloatFormat(int4 sz) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/float.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/float.hh index fff9075f1..f9c11b67b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/float.hh @@ -3693,19 +3195,6 @@ index fff9075f1..f9c11b67b 100644 void restoreXml(const Element *el); ///< Restore the format from XML }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc -index c59ebdf61..c7c37dc6c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.cc -@@ -15,6 +15,8 @@ - */ - #include "flow.hh" - -+using namespace std; -+ - /// Prepare for tracing flow for a new function. - /// The Funcdata object and references to its internal containers must be explicitly given. - /// \param d is the new function to trace diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh index 7362e4b18..c2c11d0dd 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/flow.hh @@ -3770,19 +3259,6 @@ index 7362e4b18..c2c11d0dd 100644 void setRange(const Address &b,const Address &e) { baddr = b; eaddr = e; } ///< Establish the flow bounds void setMaximumInstructions(uint4 max) { insn_max = max; } ///< Set the maximum number of instructions void setFlags(uint4 val) { flags |= val; } ///< Enable a specific option -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -index d1bd842d8..064b98a34 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc -@@ -16,6 +16,8 @@ - #include "fspec.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_CUSTOM = AttributeId("custom",114); - AttributeId ATTRIB_DOTDOTDOT = AttributeId("dotdotdot",115); - AttributeId ATTRIB_EXTENSION = AttributeId("extension",116); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh index 08487fa4e..e086556b0 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.hh @@ -4261,21 +3737,8 @@ index 08487fa4e..e086556b0 100644 }; /// Return the trial associated with the input Varnode to the associated p-code CALL or CALLIND. -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc -index 2412d35bb..602910d36 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.cc -@@ -15,6 +15,8 @@ - */ - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_NOCODE = AttributeId("nocode",84); - - ElementId ELEM_AST = ElementId("ast",115); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh -index 892883c0d..90c98d096 100644 +index af8e2bac3..702b7d877 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata.hh @@ -76,13 +76,13 @@ class Funcdata { @@ -4382,7 +3845,7 @@ index 892883c0d..90c98d096 100644 void mapGlobals(void); ///< Make sure there is a Symbol entry for all global Varnodes void prepareThisPointer(void); ///< Prepare for recovery of the "this" pointer bool checkCallDoubleUse(const PcodeOp *opmatch,const PcodeOp *op,const Varnode *vn,uint4 fl,const ParamTrial &trial) const; -@@ -414,7 +414,7 @@ class Funcdata { +@@ -413,7 +413,7 @@ class Funcdata { Symbol *linkSymbol(Varnode *vn); ///< Find or create Symbol associated with given Varnode Symbol *linkSymbolReference(Varnode *vn); ///< Discover and attach Symbol to a constant reference Varnode *findLinkedVarnode(SymbolEntry *entry) const; ///< Find a Varnode matching the given Symbol mapping @@ -4391,7 +3854,7 @@ index 892883c0d..90c98d096 100644 void buildDynamicSymbol(Varnode *vn); ///< Build a \e dynamic Symbol associated with the given Varnode bool attemptDynamicMapping(SymbolEntry *entry,DynamicHash &dhash); bool attemptDynamicMappingLate(SymbolEntry *entry,DynamicHash &dhash); -@@ -446,13 +446,13 @@ class Funcdata { +@@ -445,13 +445,13 @@ class Funcdata { void opSetInput(PcodeOp *op,Varnode *vn,int4 slot); ///< Set a specific input operand for the given PcodeOp void opSwapInput(PcodeOp *op,int4 slot1,int4 slot2); ///< Swap two input operands in the given PcodeOp void opUnsetInput(PcodeOp *op,int4 slot); ///< Clear an input operand slot for the given PcodeOp @@ -4407,7 +3870,7 @@ index 892883c0d..90c98d096 100644 void opRemoveInput(PcodeOp *op,int4 slot); ///< Remove a specific input slot for the given PcodeOp void opInsertInput(PcodeOp *op,Varnode *vn,int4 slot); ///< Insert a new Varnode into the operand list for the given PcodeOp void opMarkStartBasic(PcodeOp *op) { op->setFlag(PcodeOp::startbasic); } ///< Mark PcodeOp as starting a basic block -@@ -472,22 +472,22 @@ class Funcdata { +@@ -471,22 +471,22 @@ class Funcdata { void opUndoPtradd(PcodeOp *op,bool finalize); ///< Convert a CPUI_PTRADD back into a CPUI_INT_ADD /// \brief Start of PcodeOp objects with the given op-code @@ -4497,60 +3960,8 @@ index 892883c0d..90c98d096 100644 + std::vector &outlist); #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc -index a7a2756e2..126ffe727 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_block.cc -@@ -16,6 +16,8 @@ - #include "funcdata.hh" - #include "flow.hh" - -+using namespace std; -+ - // Funcdata members pertaining directly to blocks - - /// A description of each block in the current structure hierarchy is -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc -index d546e58b6..6a4d8be41 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_op.cc -@@ -16,6 +16,8 @@ - #include "funcdata.hh" - #include "flow.hh" - -+using namespace std; -+ - // Funcdata members pertaining directly to ops - - /// \param op is the given PcodeOp -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -index bdbda0ae6..0c6bf2214 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc -@@ -15,6 +15,8 @@ - */ - #include "funcdata.hh" - -+using namespace std; -+ - // Funcdata members pertaining directly to varnodes - - /// Properties of a given storage location are gathered from symbol information and -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc -index ce67e2cc8..4e7cc5318 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.cc -@@ -23,6 +23,8 @@ - #include "cpool_ghidra.hh" - #include "inject_ghidra.hh" - -+using namespace std; -+ - //AttributeId ATTRIB_BADDATA = AttributeId("baddata",145); - - ElementId ELEM_COMMAND_ISNAMEUSED = ElementId("command_isnameused",239); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh -index bd0fc3afe..261bebe05 100644 +index 20dabcb6c..e2056337e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_arch.hh @@ -51,8 +51,8 @@ extern ElementId ELEM_COMMAND_GETUSEROPNAME; ///< Marshaling element \ - #endif - -+using namespace std; -+ - #ifdef __REMOTE_SOCKET__ - - #include "ifacedecomp.hh" diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh -index 8c682d80d..428319a65 100644 +index 8c682d80d..64fd45e35 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh @@ -39,11 +39,11 @@ extern ElementId ELEM_DOC; ///< Marshaling element \ @@ -4733,7 +4118,7 @@ index 8c682d80d..428319a65 100644 static void shutDown(void); ///< Release all GhidraCommand resources }; -@@ -72,14 +72,14 @@ class GhidraDecompCapability : public GhidraCapability { +@@ -72,8 +72,8 @@ class GhidraDecompCapability : public GhidraCapability { /// and sendResult() will send back any accumulated warning/error messages. class GhidraCommand { protected: @@ -4744,13 +4129,6 @@ index 8c682d80d..428319a65 100644 ArchitectureGhidra *ghidra; ///< The Architecture on which to perform the command int4 status; ///< Meta-command to system (0=wait for next command, 1=terminate process) virtual void loadParameters(void); ///< Read parameters directing command execution - virtual void sendResult(void); ///< Send results of the command (if any) back to the Ghidra client - public: -- GhidraCommand(void) : sin(cin),sout(cout) { -+ GhidraCommand(void) : sin(std::cin),sout(std::cout) { - ghidra = (ArchitectureGhidra *)0; - } ///< Construct given i/o streams - virtual ~GhidraCommand(void) {} ///< Destructor @@ -102,10 +102,10 @@ class GhidraCommand { /// - The stripped down \ tag describing address spaces for the program /// - The \ tag describing the built-in datatypes for the program @@ -4777,19 +4155,6 @@ index 8c682d80d..428319a65 100644 virtual void loadParameters(void); virtual void sendResult(void); public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc -index dd2c0274a..bb5211a8f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.cc -@@ -16,6 +16,8 @@ - #include "ghidra_translate.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// \brief Associate a Varnode with a register name - /// - /// \param nm is the register name diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh index 207f2f375..c41fc12d9 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_translate.hh @@ -4821,19 +4186,6 @@ index 207f2f375..c41fc12d9 100644 virtual int4 oneInstruction(PcodeEmit &emit,const Address &baseaddr) const; virtual int4 instructionLength(const Address &baseaddr) const { throw LowlevelError("Cannot currently get instruction length through this interface"); } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc -index 15badbad3..a70ec2686 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.cc -@@ -15,6 +15,8 @@ - */ - #include "globalcontext.hh" - -+using namespace std; -+ - ElementId ELEM_CONTEXT_DATA = ElementId("context_data",120); - ElementId ELEM_CONTEXT_POINTS = ElementId("context_points",121); - ElementId ELEM_CONTEXT_POINTSET = ElementId("context_pointset",122); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.hh index 6bf5ae0fe..6e76a125a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/globalcontext.hh @@ -4940,19 +4292,6 @@ index 6bf5ae0fe..6e76a125a 100644 virtual const uintm *getContext(const Address &addr) const { return database.getValue(addr).array; } virtual const uintm *getContext(const Address &addr,uintb &first,uintb &last) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc -index aab637f39..a87932dc8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.cc -@@ -89,6 +89,8 @@ - - #include "grammar.hh" - -+using namespace std; -+ - extern int yylex(void); - extern int yyerror(const char *str); - static CParse *parse; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh index 3f9115e72..2caa79ce4 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/grammar.hh @@ -5205,19 +4544,6 @@ index 3f9115e72..2caa79ce4 100644 +extern Address parse_op(std::istream &s,uintm &uq,const TypeFactory &typegrp); #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc -index 20d7cd196..31b69addd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.cc -@@ -16,6 +16,8 @@ - */ - #include "graph.hh" - -+using namespace std; -+ - static void print_varnode_vertex(Varnode *vn,ostream &s) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh index edd6ce865..09467394f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/graph.hh @@ -5234,19 +4560,6 @@ index edd6ce865..09467394f 100644 +extern void dump_dom_graph(const std::string &name,const BlockGraph &graph,std::ostream &s); #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc -index e8af0c939..8ce556c80 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.cc -@@ -17,6 +17,8 @@ - #include "funcdata.hh" - #include "prefersplit.hh" - -+using namespace std; -+ - /// Update disjoint cover making sure (addr,size) is contained in a single element and return - /// an iterator to this element. The element's \b pass number is set to be the smallest value - /// of any previous intersecting element. Additionally an \b intersect code is passed back: diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh index 76f731a58..4f5fed417 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/heritage.hh @@ -5403,19 +4716,6 @@ index 76f731a58..4f5fed417 100644 const LoadGuard *getStoreGuard(PcodeOp *op) const; ///< Get LoadGuard record associated with given PcodeOp }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc -index 5e035d4a2..f4a1acfee 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.cc -@@ -20,6 +20,8 @@ extern "C" { - #include "pcodeparse.hh" - #include "blockaction.hh" - -+using namespace std; -+ - // Constructing this registers the capability - IfaceDecompCapability IfaceDecompCapability::ifaceDecompCapability; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh index 73f476e20..fb9777427 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifacedecomp.hh @@ -6128,19 +5428,6 @@ index 73f476e20..fb9777427 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc -index 44a584305..ebcf1fcfd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.cc -@@ -15,6 +15,8 @@ - */ - #include "ifaceterm.hh" - -+using namespace std; -+ - IfaceTerm::IfaceTerm(const string &prmpt,istream &is,ostream &os) - : IfaceStatus(prmpt,os) - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh index 0b70d8b22..43817d845 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ifaceterm.hh @@ -6166,19 +5453,6 @@ index 0b70d8b22..43817d845 100644 virtual void popScript(void); virtual bool isStreamFinished(void) const; }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc -index 6ecde748c..5845276ce 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "inject_ghidra.hh" - -+using namespace std; -+ - void InjectContextGhidra::encode(Encoder &encoder) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.hh index c0678039c..18844d334 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_ghidra.hh @@ -6252,19 +5526,6 @@ index c0678039c..18844d334 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc -index e37e3f469..137d0402c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.cc -@@ -17,6 +17,8 @@ - #include "pcodeparse.hh" - #include "architecture.hh" - -+using namespace std; -+ - InjectContextSleigh::~InjectContextSleigh(void) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh index be86fbcf6..4fa80954f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/inject_sleigh.hh @@ -6377,21 +5638,8 @@ index be86fbcf6..4fa80954f 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc -index 8ac61f889..977703bbd 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.cc -@@ -21,6 +21,8 @@ - #include "ext/stdio_filebuf.h" - #endif - -+using namespace std; -+ - vector IfaceCapability::thelist; - - void IfaceCapability::initialize(void) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh -index 0771e7428..1a467abda 100644 +index 0771e7428..88c637333 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/interface.hh @@ -27,8 +27,6 @@ @@ -6403,16 +5651,12 @@ index 0771e7428..1a467abda 100644 #ifdef __REMOTE_SOCKET__ /// \brief A wrapper around a UNIX domain socket -@@ -38,18 +36,18 @@ using namespace std; - /// The socket is bound to a C++ istream and ostream. - class RemoteSocket { +@@ -40,16 +38,16 @@ class RemoteSocket { int fileDescriptor; ///< Descriptor for the socket -- basic_filebuf *inbuf; ///< Input buffer associated with the socket -- basic_filebuf *outbuf; ///< Output buffer for the socket + basic_filebuf *inbuf; ///< Input buffer associated with the socket + basic_filebuf *outbuf; ///< Output buffer for the socket - istream *inStream; ///< The C++ input stream - ostream *outStream; ///< The C++ output stream -+ std::basic_filebuf *inbuf; ///< Input buffer associated with the socket -+ std::basic_filebuf *outbuf; ///< Output buffer for the socket + std::istream *inStream; ///< The C++ input stream + std::ostream *outStream; ///< The C++ output stream bool isOpen; ///< Has the socket been opened @@ -6648,19 +5892,6 @@ index 0771e7428..1a467abda 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc -index 63126e06e..86146b913 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc -@@ -17,6 +17,8 @@ - #include "emulate.hh" - #include "flow.hh" - -+using namespace std; -+ - AttributeId ATTRIB_LABEL = AttributeId("label",131); - AttributeId ATTRIB_NUM = AttributeId("num",132); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh index eafb09897..1e0282f41 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.hh @@ -6879,19 +6110,6 @@ index eafb09897..1e0282f41 100644 int4 numIndicesByBlock(const FlowBlock *bl) const; int4 getIndexByBlock(const FlowBlock *bl,int4 i) const; Address getAddressByIndex(int4 i) const { return addresstable[i]; } ///< Get the i-th address table entry -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc -index b60a349fe..81ab37960 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.cc -@@ -15,6 +15,8 @@ - */ - #include "libdecomp.hh" - -+using namespace std; -+ - void startDecompilerLibrary(const char *sleighhome) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.hh index e7f5ae179..1578984a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/libdecomp.hh @@ -6907,19 +6125,6 @@ index e7f5ae179..1578984a6 100644 extern void shutdownDecompilerLibrary(void); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc -index e14109b32..bba3e9674 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.cc -@@ -15,6 +15,8 @@ - */ - #include "loadimage.hh" - -+using namespace std; -+ - /// This is a convenience method wrapped around the core - /// loadFill() routine. It automatically allocates an array - /// of the desired size, and then fills it with load image data. diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.hh index 59d4c9a5d..0cfd48715 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage.hh @@ -7003,19 +6208,6 @@ index 59d4c9a5d..0cfd48715 100644 return filename; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc -index 7e9f1ad8a..6009dde95 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.cc -@@ -16,6 +16,8 @@ - */ - #include "loadimage_bfd.hh" - -+using namespace std; -+ - int4 LoadImageBfd::bfdinit = 0; // Global initialization variable - - LoadImageBfd::LoadImageBfd(const string &f,const string &t) : LoadImage(f) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh index 9d69fcca5..9905ce825 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh @@ -7063,19 +6255,6 @@ index 9d69fcca5..9905ce825 100644 virtual void adjustVma(long adjust); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc -index 069a1f956..2ede5182b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "loadimage_ghidra.hh" - -+using namespace std; -+ - LoadImageGhidra::LoadImageGhidra(ArchitectureGhidra *g) - : LoadImage("ghidra_progam") - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.hh index 95c56dcdf..82700069a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_ghidra.hh @@ -7089,19 +6268,6 @@ index 95c56dcdf..82700069a 100644 virtual void adjustVma(long adjust); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc -index b7a9a30c4..0de974108 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.cc -@@ -16,6 +16,8 @@ - #include "loadimage_xml.hh" - #include "translate.hh" - -+using namespace std; -+ - AttributeId ATTRIB_ARCH = AttributeId("arch",135); - - ElementId ELEM_BINARYIMAGE = ElementId("binaryimage",230); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.hh index 018cc06bb..5f0707e5b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_xml.hh @@ -7137,20 +6303,8 @@ index 018cc06bb..5f0707e5b 100644 virtual void adjustVma(long adjust); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc -index 20e51c1a9..c8f2af0ec 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc -@@ -17,6 +17,7 @@ - #include "translate.hh" - - using namespace PackedFormat; -+using namespace std; - - unordered_map AttributeId::lookupAttributeId; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh -index c2eae63e0..7951c373c 100644 +index 98337529d..144dc58b6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.hh @@ -20,8 +20,6 @@ @@ -7217,7 +6371,25 @@ index c2eae63e0..7951c373c 100644 /// \brief Peek at the next child element of the current parent, without traversing in (opening) it. /// -@@ -208,7 +206,7 @@ class Decoder { +@@ -196,7 +194,7 @@ class Decoder { + /// \param expect is the string value to expect if the attribute is encoded as a string + /// \param expectval is the integer value to return if the attribute matches the expected string + /// \return the encoded integer or the integer value associated with the expected string +- virtual intb readSignedIntegerExpectString(const string &expect,intb expectval)=0; ++ virtual intb readSignedIntegerExpectString(const std::string &expect,intb expectval)=0; + + /// \brief Find and parse a specific attribute in the current element as either a signed integer or a string. + /// +@@ -209,7 +207,7 @@ class Decoder { + /// \param expect is the string to expect, if the attribute is not encoded as an integer + /// \param expectval is the integer value to return if the attribute matches the expected string + /// \return the encoded integer or the integer value associated with the expected string +- virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const string &expect,intb expectval)=0; ++ virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const std::string &expect,intb expectval)=0; + + /// \brief Parse the current attribute as an unsigned integer value + /// +@@ -231,7 +229,7 @@ class Decoder { /// /// The last attribute, as returned by getNextAttributeId, is returned as a string. /// \return the string associated with the current attribute. @@ -7226,7 +6398,7 @@ index c2eae63e0..7951c373c 100644 /// \brief Find the specific attribute in the current element and return it as a string /// -@@ -217,7 +215,7 @@ class Decoder { +@@ -240,7 +238,7 @@ class Decoder { /// Parse via getNextAttributeId is reset. /// \param attribId is the specific attribute id to match /// \return the string associated with the attribute @@ -7235,7 +6407,7 @@ index c2eae63e0..7951c373c 100644 /// \brief Parse the current attribute as an address space /// -@@ -296,7 +294,7 @@ class Encoder { +@@ -319,7 +317,7 @@ class Encoder { /// The string is associated with the given AttributeId annotation and the current open element. /// \param attribId is the given AttributeId annotation /// \param val is the string to encode @@ -7244,7 +6416,7 @@ index c2eae63e0..7951c373c 100644 /// \brief Write an address space reference into the encoding /// -@@ -314,17 +312,17 @@ class Encoder { +@@ -337,10 +335,10 @@ class Encoder { class XmlDecode : public Decoder { Document *document; ///< An ingested XML document, owned by \b this decoder const Element *rootElement; ///< The root XML element to be decoded @@ -7258,16 +6430,23 @@ index c2eae63e0..7951c373c 100644 public: XmlDecode(const AddrSpaceManager *spc,const Element *root) : Decoder(spc) { document = (Document *)0; rootElement = root; attributeIndex = -1; } ///< Constructor with preparsed root - XmlDecode(const AddrSpaceManager *spc) : Decoder(spc) { +@@ -348,7 +346,7 @@ class XmlDecode : public Decoder { document = (Document *)0; rootElement = (const Element *)0; attributeIndex = -1; } ///< Constructor for use with ingestStream + const Element *getCurrentXmlElement(void) const { return elStack.back(); } ///< Get pointer to underlying XML element object virtual ~XmlDecode(void); - virtual void ingestStream(istream &s); + virtual void ingestStream(std::istream &s); virtual uint4 peekElement(void); virtual uint4 openElement(void); virtual uint4 openElement(const ElementId &elemId); -@@ -338,8 +336,8 @@ class XmlDecode : public Decoder { +@@ -360,12 +358,12 @@ class XmlDecode : public Decoder { + virtual bool readBool(const AttributeId &attribId); + virtual intb readSignedInteger(void); virtual intb readSignedInteger(const AttributeId &attribId); +- virtual intb readSignedIntegerExpectString(const string &expect,intb expectval); +- virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const std::string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const std::string &expect,intb expectval); virtual uintb readUnsignedInteger(void); virtual uintb readUnsignedInteger(const AttributeId &attribId); - virtual string readString(void); @@ -7277,7 +6456,7 @@ index c2eae63e0..7951c373c 100644 virtual AddrSpace *readSpace(void); virtual AddrSpace *readSpace(const AttributeId &attribId); }; -@@ -350,16 +348,16 @@ class XmlDecode : public Decoder { +@@ -376,16 +374,16 @@ class XmlDecode : public Decoder { /// receive the XML document as calls are made on the encoder. class XmlEncode : public Encoder { friend class XmlDecode; @@ -7297,7 +6476,7 @@ index c2eae63e0..7951c373c 100644 virtual void writeSpace(const AttributeId &attribId,const AddrSpace *spc); }; -@@ -436,11 +434,11 @@ class PackedDecode : public Decoder { +@@ -462,11 +460,11 @@ class PackedDecode : public Decoder { /// \brief An iterator into input stream class Position { friend class PackedDecode; @@ -7311,7 +6490,7 @@ index c2eae63e0..7951c373c 100644 Position startPos; ///< Position at the start of the current open element Position curPos; ///< Position of the next attribute as returned by getNextAttributeId Position endPos; ///< Ending position after all attributes in current open element -@@ -457,7 +455,7 @@ class PackedDecode : public Decoder { +@@ -483,7 +481,7 @@ class PackedDecode : public Decoder { public: PackedDecode(const AddrSpaceManager *spcManager) : Decoder(spcManager) {} ///< Constructor virtual ~PackedDecode(void); @@ -7320,8 +6499,14 @@ index c2eae63e0..7951c373c 100644 virtual uint4 peekElement(void); virtual uint4 openElement(void); virtual uint4 openElement(const ElementId &elemId); -@@ -471,8 +469,8 @@ class PackedDecode : public Decoder { +@@ -495,12 +493,12 @@ class PackedDecode : public Decoder { + virtual bool readBool(const AttributeId &attribId); + virtual intb readSignedInteger(void); virtual intb readSignedInteger(const AttributeId &attribId); +- virtual intb readSignedIntegerExpectString(const string &expect,intb expectval); +- virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const std::string &expect,intb expectval); ++ virtual intb readSignedIntegerExpectString(const AttributeId &attribId,const std::string &expect,intb expectval); virtual uintb readUnsignedInteger(void); virtual uintb readUnsignedInteger(const AttributeId &attribId); - virtual string readString(void); @@ -7331,7 +6516,7 @@ index c2eae63e0..7951c373c 100644 virtual AddrSpace *readSpace(void); virtual AddrSpace *readSpace(const AttributeId &attribId); }; -@@ -481,17 +479,17 @@ class PackedDecode : public Decoder { +@@ -509,17 +507,17 @@ class PackedDecode : public Decoder { /// /// See PackedDecode for details of the encoding format. class PackedEncode : public Encoder { @@ -7352,7 +6537,7 @@ index c2eae63e0..7951c373c 100644 virtual void writeSpace(const AttributeId &attribId,const AddrSpace *spc); }; -@@ -503,7 +501,7 @@ inline uint1 PackedDecode::getBytePlus1(Position &pos) +@@ -531,7 +529,7 @@ inline uint1 PackedDecode::getBytePlus1(Position &pos) { uint1 *ptr = pos.current + 1; if (ptr == pos.end) { @@ -7361,7 +6546,7 @@ index c2eae63e0..7951c373c 100644 ++iter; if (iter == inStream.end()) throw DecoderError("Unexpected end of stream"); -@@ -573,10 +571,10 @@ extern AttributeId ATTRIB_CONTENT; ///< Special attribute for XML text content o +@@ -601,10 +599,10 @@ extern AttributeId ATTRIB_CONTENT; ///< Special attribute for XML text content o /// placeholder attribute, ATTRIB_UNKNOWN, is returned as a placeholder for attributes with unrecognized names. /// \param nm is the name of the attribute /// \return the associated id @@ -7374,7 +6559,7 @@ index c2eae63e0..7951c373c 100644 if (iter != lookupAttributeId.end()) return (*iter).second; return ATTRIB_UNKNOWN.id; -@@ -586,10 +584,10 @@ inline uint4 AttributeId::find(const string &nm) +@@ -614,10 +612,10 @@ inline uint4 AttributeId::find(const string &nm) /// placeholder element, ELEM_UNKNOWN, is returned as a placeholder for elements with unrecognized names. /// \param nm is the name of the element /// \return the associated id @@ -7387,19 +6572,6 @@ index c2eae63e0..7951c373c 100644 if (iter != lookupElementId.end()) return (*iter).second; return ELEM_UNKNOWN.id; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc -index be9a570a0..621e2dda9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.cc -@@ -16,6 +16,8 @@ - #include "memstate.hh" - #include "translate.hh" - -+using namespace std; -+ - /// This is a static convenience routine for decoding a value from a sequence of bytes depending - /// on the desired endianness - /// \param ptr is the pointer to the bytes to decode diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.hh index 6a260c466..273d66cab 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/memstate.hh @@ -7444,19 +6616,6 @@ index 6a260c466..273d66cab 100644 void setValue(const VarnodeData *vn,uintb cval); ///< Set value on a given \b varnode uintb getValue(const VarnodeData *vn) const; ///< Get a value from a \b varnode void getChunk(uint1 *res,AddrSpace *spc,uintb off,int4 size) const; ///< Get a chunk of data from memory state -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc -index cb41351e2..3a856760e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.cc -@@ -16,6 +16,8 @@ - #include "merge.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// This instance assumes the identity of the given Varnode and the defining index is - /// cached to facilitate quick sorting. - /// \param v is the given Varnode diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh index 18c9e0b15..df33d998f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/merge.hh @@ -7529,19 +6688,6 @@ index 18c9e0b15..df33d998f 100644 void mergeOpcode(OpCode opc); void mergeByDatatype(VarnodeLocSet::const_iterator startiter,VarnodeLocSet::const_iterator enditer); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -index 068393416..980300b23 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc -@@ -16,6 +16,8 @@ - #include "op.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_IOP = ElementId("iop",113); - ElementId ELEM_UNIMPL = ElementId("unimpl",114); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh index d93dcd3c1..2a1b32c8a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.hh @@ -7672,19 +6818,6 @@ index d93dcd3c1..2a1b32c8a 100644 }; extern int4 functionalEqualityLevel(Varnode *vn1,Varnode *vn2,Varnode **res1,Varnode **res2); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc -index 3e0c39904..f3dcaed3c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.cc -@@ -16,6 +16,8 @@ - #include "opbehavior.hh" - #include "translate.hh" - -+using namespace std; -+ - /// This routine generates a vector of OpBehavior objects indexed by opcode - /// \param inst is the vector of behaviors to be filled - /// \param trans is the translator object needed by the floating point behaviors diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh index 5061cb65f..ffec2e4ef 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/opbehavior.hh @@ -7707,21 +6840,8 @@ index 5061cb65f..ffec2e4ef 100644 }; /// This kind of OpBehavior is associated with a particular opcode and is either unary or binary -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc -index d116fe62d..100236b1e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.cc -@@ -16,6 +16,8 @@ - #include "opcodes.hh" - #include "types.h" - -+using namespace std; -+ - /// \brief Names of operations associated with their opcode number - /// - /// Some of the names have been replaced with special placeholder diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh -index 14ec99772..45e98662e 100644 +index 14ec99772..1d9d612b3 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh @@ -21,8 +21,6 @@ @@ -7738,23 +6858,10 @@ index 14ec99772..45e98662e 100644 extern const char *get_opname(OpCode opc); ///< Convert an OpCode to the name as a string -extern OpCode get_opcode(const string &nm); ///< Convert a name string to the matching OpCode -+extern OpCode get_opcode(const std::string &nm); ///< Convert a name string to the matching OpCode ++extern OpCode get_opcode(const std::string &nm); ///< Convert a name string to the matching OpCode extern OpCode get_booleanflip(OpCode opc,bool &reorder); ///< Get the complementary OpCode -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc -index 0ee439e44..ab042112c 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/options.cc -@@ -18,6 +18,8 @@ - #include "flow.hh" - #include "printc.hh" - -+using namespace std; -+ - ElementId ELEM_ALIASBLOCK = ElementId("aliasblock",174); - ElementId ELEM_ALLOWCONTEXTSET = ElementId("allowcontextset",175); - ElementId ELEM_ANALYZEFORLOOPS = ElementId("analyzeforloops",176); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/options.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/options.hh index 474ee7071..a36f35d7e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/options.hh @@ -8045,19 +7152,6 @@ index 474ee7071..a36f35d7e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc -index f64cb03ca..ca5d726c9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/override.cc -@@ -16,6 +16,8 @@ - #include "override.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_DEADCODEDELAY = ElementId("deadcodedelay",218); - ElementId ELEM_FLOW = ElementId("flow",219); - ElementId ELEM_FORCEGOTO = ElementId("forcegoto",220); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/override.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/override.hh index 1a76e46e1..c4d780feb 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/override.hh @@ -8101,19 +7195,6 @@ index 1a76e46e1..c4d780feb 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc -index 093a8b232..4ba724490 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.cc -@@ -15,6 +15,8 @@ - */ - #include "paramid.hh" - -+using namespace std; -+ - ElementId ELEM_PARAMMEASURES = ElementId("parammeasures",106); - ElementId ELEM_PROTO = ElementId("proto",107); - ElementId ELEM_RANK = ElementId("rank",108); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.hh index 7eb7d78c9..91aa7dfed 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/paramid.hh @@ -8150,18 +7231,19 @@ index 7eb7d78c9..91aa7dfed 100644 #endif //ifndef __CPUI_PARAMID__ diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh -index 41abc55a0..91851a005 100644 +index 41abc55a0..e41558cdb 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/partmap.hh -@@ -199,7 +199,6 @@ template +@@ -199,8 +199,6 @@ template #if 0 #include -using namespace std; - +- int main(int argc,char **argv) -@@ -212,16 +211,16 @@ int main(int argc,char **argv) + { +@@ -212,16 +210,16 @@ int main(int argc,char **argv) data.split(3) = 4; data.split(3) = 3; @@ -8183,19 +7265,6 @@ index 41abc55a0..91851a005 100644 ++iter; } } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc -index 133da8178..ce8a0f834 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.cc -@@ -15,6 +15,8 @@ - */ - #include "pcodecompile.hh" - -+using namespace std; -+ - string Location::format(void) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.hh index 3c7f2b26f..6b44c2af2 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodecompile.hh @@ -8301,21 +7370,8 @@ index 3c7f2b26f..6b44c2af2 100644 static bool propagateSize(ConstructTpl *ct); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc -index 7a317f47f..d6678a5ca 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.cc -@@ -16,6 +16,8 @@ - #include "pcodeinject.hh" - #include "architecture.hh" - -+using namespace std; -+ - AttributeId ATTRIB_DYNAMIC = AttributeId("dynamic",70); - AttributeId ATTRIB_INCIDENTALCOPY = AttributeId("incidentalcopy",71); - AttributeId ATTRIB_INJECT = AttributeId("inject",72); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh -index d57215bc7..fac6c3f7d 100644 +index d57215bc7..2d558ac55 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeinject.hh @@ -52,12 +52,12 @@ extern ElementId ELEM_SIZE_PCODE; ///< Marshaling element \ @@ -8435,7 +7491,7 @@ index d57215bc7..fac6c3f7d 100644 + std::vector callOtherTarget; ///< Map from injectid to callother-fixup target-op name + std::vector callMechTarget; ///< Map from injectid to call-mech name + std::vector scriptNames; ///< Map from injectid to script name -+ void registerCallFixup(const std::string &fixupName,int4 injectid/* , std::vector targets */); ++ void registerCallFixup(const std::string &fixupName,int4 injectid/* , vector targets */); + void registerCallOtherFixup(const std::string &fixupName,int4 injectid); + void registerCallMechanism(const std::string &fixupName,int4 injectid); + void registerExeScript(const std::string &scriptName,int4 injectid); @@ -8498,19 +7554,6 @@ index d57215bc7..fac6c3f7d 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc -index c562c0f83..4d67e8a6e 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.cc -@@ -89,6 +89,8 @@ - - #include "pcodeparse.hh" - -+using namespace std; -+ - //#define YYERROR_VERBOSE - extern int yylex(void); - static PcodeSnippet *pcode; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.hh index 587604237..cca442307 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.hh @@ -8574,32 +7617,6 @@ index 587604237..cca442307 100644 }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y -index c858fa148..46480a5ad 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcodeparse.y -@@ -16,6 +16,8 @@ - %{ - #include "pcodeparse.hh" - -+using namespace std; -+ - //#define YYERROR_VERBOSE - extern int yylex(void); - static PcodeSnippet *pcode; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc -index 317d4dbf1..5221185f8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.cc -@@ -16,6 +16,8 @@ - #include "pcoderaw.hh" - #include "translate.hh" - -+using namespace std; -+ - /// Build this VarnodeData from an \, \, or \ element. - /// \param decoder is the stream decoder - void VarnodeData::decode(Decoder &decoder) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh index fd70a956e..bab636fcc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/pcoderaw.hh @@ -8613,19 +7630,6 @@ index fd70a956e..bab636fcc 100644 public: void setBehavior(OpBehavior *be); ///< Set the opcode for this op OpBehavior *getBehavior(void) const; ///< Retrieve the behavior for this op -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc -index 635941885..e1267e610 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.cc -@@ -16,6 +16,8 @@ - #include "prefersplit.hh" - #include "funcdata.hh" - -+using namespace std; -+ - ElementId ELEM_PREFERSPLIT = ElementId("prefersplit",225); - - bool PreferSplitRecord::operator<(const PreferSplitRecord &op2) const diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.hh index 9654ceedd..7e517620c 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/prefersplit.hh @@ -8653,19 +7657,6 @@ index 9654ceedd..7e517620c 100644 void split(void); void splitAdditional(void); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc -index 388708030..fa631ccf1 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.cc -@@ -16,6 +16,8 @@ - #include "prettyprint.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_BLOCKREF = AttributeId("blockref",35); - AttributeId ATTRIB_CLOSE = AttributeId("close",36); - AttributeId ATTRIB_COLOR = AttributeId("color",37); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh index cc81dad23..046ac8b40 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/prettyprint.hh @@ -9070,19 +8061,6 @@ index cc81dad23..046ac8b40 100644 virtual bool emitsMarkup(void) const { return lowlevel->emitsMarkup(); } virtual void resetDefaults(void); void setMarkup(bool val); ///< Toggle whether the low-level emitter emits markup or not -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc -index 5c90024a2..bd433b898 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.cc -@@ -16,6 +16,8 @@ - #include "printc.hh" - #include "funcdata.hh" - -+using namespace std; -+ - // Operator tokens for expressions - // token #in prec assoc optype space bump - OpToken PrintC::hidden = { "", "", 1, 70, false, OpToken::hiddenfunction, 0, 0, (OpToken *)0 }; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh index 6c7d79988..186c79f86 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/printc.hh @@ -9212,19 +8190,6 @@ index 6c7d79988..186c79f86 100644 virtual void docTypeDefinitions(const TypeFactory *typegrp); virtual void docAllGlobals(void); virtual void docSingleGlobal(const Symbol *sym); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc -index 473bab08a..a193e8688 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.cc -@@ -16,6 +16,8 @@ - #include "printjava.hh" - #include "funcdata.hh" - -+using namespace std; -+ - OpToken PrintJava::instanceof = { "instanceof", "", 2, 60, true, OpToken::binary, 1, 0, (OpToken *)0 }; - - // Constructing this registers the capability diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.hh index f3f200d11..d95adf12a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/printjava.hh @@ -9241,19 +8206,6 @@ index f3f200d11..d95adf12a 100644 virtual void resetDefaults(void); virtual void docFunction(const Funcdata *fd); virtual void pushTypeStart(const Datatype *ct,bool noident); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc -index f43d3e6f3..8f7a3c03b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc -@@ -17,6 +17,8 @@ - #include "printlanguage.hh" - #include "funcdata.hh" - -+using namespace std; -+ - const string PrintLanguage::OPEN_PAREN = "("; - const string PrintLanguage::CLOSE_PAREN = ")"; - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh index ea7a1efa5..71178da2d 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.hh @@ -9433,19 +8385,6 @@ index ea7a1efa5..71178da2d 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc -index d98998426..3d17317f8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.cc -@@ -16,6 +16,8 @@ - #include "rangeutil.hh" - #include "block.hh" - -+using namespace std; -+ - const char CircleRange::arrange[] = "gcgbegdagggggggeggggcgbggggggggcdfgggggggegdggggbgggfggggcgbegda"; - - /// All the instantiations where left == right represent the same set. We diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.hh index e4f37b063..f046fba21 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/rangeutil.hh @@ -9544,19 +8483,6 @@ index e4f37b063..f046fba21 100644 #endif }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc -index 3b83cf3ce..aab606e5d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.cc -@@ -15,6 +15,8 @@ - */ - #include "raw_arch.hh" - -+using namespace std; -+ - ElementId ELEM_RAW_SAVEFILE = ElementId("raw_savefile",237); - - // Constructing this object registers the capability diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh index 490abf901..23580df2f 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/raw_arch.hh @@ -9581,21 +8507,8 @@ index 490abf901..23580df2f 100644 virtual ~RawBinaryArchitecture(void) {} }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -index 3955b836b..81d62ac2a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc -@@ -18,6 +18,8 @@ - #include "subflow.hh" - #include "rangeutil.hh" - -+using namespace std; -+ - /// \class RuleEarlyRemoval - /// \brief Get rid of unused PcodeOp objects where we can guarantee the output is unused - int4 RuleEarlyRemoval::applyOp(PcodeOp *op,Funcdata &data) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh -index 0412b8b72..71b9b1d16 100644 +index 0412b8b72..e1bfe6e4b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.hh @@ -52,9 +52,9 @@ class AddTreeState { @@ -9620,16 +8533,7 @@ index 0412b8b72..71b9b1d16 100644 virtual Rule *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Rule *)0; return new RuleEarlyRemoval(getGroup()); -@@ -92,180 +92,180 @@ class RuleEarlyRemoval : public Rule { - }; - // class RuleAddrForceRelease : public Rule { - // public: --// RuleAddrForceRelease(const string &g) : Rule(g, 0, "addrforcerelease") {} ///< Constructor --// virtual void getOpList(vector &oplist) const; -+// RuleAddrForceRelease(const std::string &g) : Rule(g, 0, "addrforcerelease") {} ///< Constructor -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); - // }; +@@ -99,173 +99,173 @@ class RuleEarlyRemoval : public Rule { class RuleCollectTerms : public Rule { static Varnode *getMultCoeff(Varnode *vn,uintb &coef); ///< Get the multiplicative coefficient public: @@ -9837,7 +8741,7 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); static void minMaxUse(Varnode *vn,int4 &maxByte,int4 &minByte); static void replaceDescendants(Varnode *origVn,Varnode *newVn,int4 maxByte,int4 minByte,Funcdata &data); -@@ -275,389 +275,389 @@ class RulePullsubMulti : public Rule { +@@ -275,173 +275,173 @@ class RulePullsubMulti : public Rule { }; class RulePullsubIndirect : public Rule { public: @@ -10045,16 +8949,7 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleShiftLess : public Rule { - // public: --// RuleShiftLess(const string &g) : Rule(g, 0, "shiftless") {} ///< Constructor -+// RuleShiftLess(const std::string &g) : Rule(g, 0, "shiftless") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleShiftLess(getGroup()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); +@@ -456,208 +456,208 @@ class RuleShiftCompare : public Rule { // }; class RuleLessEqual : public Rule { public: @@ -10326,7 +9221,7 @@ index 0412b8b72..71b9b1d16 100644 virtual Rule *clone(const ActionGroupList &grouplist) const { if (!grouplist.contains(getGroup())) return (Rule *)0; return new RulePropagateCopy(getGroup()); -@@ -687,62 +687,62 @@ class RulePropagateCopy : public Rule { +@@ -687,52 +687,52 @@ class RulePropagateCopy : public Rule { }; class Rule2Comp2Mult : public Rule { public: @@ -10389,19 +9284,7 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleUndistribute : public Rule { - // public: --// RuleUndistribute(const string &g) : Rule(g, 0, "undistribute") {} ///< Constructor -+// RuleUndistribute(const std::string &g) : Rule(g, 0, "undistribute") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleUndistribute(Group()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); - // }; - class RuleLoadVarnode : public Rule { -@@ -751,463 +751,463 @@ class RuleLoadVarnode : public Rule { +@@ -751,22 +751,22 @@ class RuleLoadVarnode : public Rule { static AddrSpace *vnSpacebase(Architecture *glb,Varnode *vn,uintb &val,AddrSpace *spc); static AddrSpace *checkSpacebase(Architecture *glb,PcodeOp *op,uintb &offoff); public: @@ -10428,16 +9311,7 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleShadowVar : public Rule { - // public: --// RuleShadowVar(const string &g) : Rule(g, 0, "shadowvar") {} ///< Constructor -+// RuleShadowVar(const std::string &g) : Rule(g, 0, "shadowvar") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleShadowVar(getGroup()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); +@@ -781,33 +781,33 @@ class RuleStoreVarnode : public Rule { // }; class RuleSubExtComm : public Rule { public: @@ -10477,16 +9351,7 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; // class RuleIndirectConcat : public Rule { - // public: --// RuleIndirectConcat(const string &g) : Rule(g, 0, "indirectconcat") {} ///< Constructor -+// RuleIndirectConcat(const std::string &g) : Rule(g, 0, "indirectconcat") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleIndirectConcat(getGroup()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); +@@ -822,347 +822,347 @@ class RuleConcatCommute : public Rule { // }; class RuleConcatZext : public Rule { public: @@ -10901,18 +9766,7 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; - // class RuleRightShiftSub : public Rule { - // public: --// RuleRightShiftSub(const string &g) : Rule( g, 0, "rightshiftsub") {} ///< Constructor -+// RuleRightShiftSub(const std::string &g) : Rule( g, 0, "rightshiftsub") {} ///< Constructor - // virtual Rule *clone(const ActionGroupList &grouplist) const { - // if (!grouplist.contains(getGroup())) return (Rule *)0; - // return new RuleRightShiftSub(Group()); - // } --// virtual void getOpList(vector &oplist) const; -+// virtual void getOpList(std::vector &oplist) const; - // virtual int4 applyOp(PcodeOp *op,Funcdata &data); - // }; +@@ -1179,35 +1179,35 @@ class RuleSubNormal : public Rule { class RulePositiveDiv : public Rule { public: @@ -11361,19 +10215,6 @@ index 0412b8b72..71b9b1d16 100644 virtual int4 applyOp(PcodeOp *op,Funcdata &data); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc -index af4e191c7..eeb7cc1f7 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.cc -@@ -17,6 +17,8 @@ - #include "rulecompile.hh" - #include "ruleparse.hh" - -+using namespace std; -+ - RuleCompile *rulecompile; - extern int4 ruleparsedebug; - extern int4 ruleparseparse(void); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh index 8cce8fc2f..23c656384 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/rulecompile.hh @@ -11489,32 +10330,6 @@ index 8cce8fc2f..23c656384 100644 }; /* -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y -index 3d3ced687..aceb52b9a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleparse.y -@@ -17,6 +17,8 @@ - #ifdef CPUI_RULECOMPILE - #include "rulecompile.hh" - -+using namespace std; -+ - #define YYERROR_VERBOSE - - extern RuleCompile *rulecompile; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc -index 1c9ab7560..a791a3348 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.cc -@@ -16,6 +16,8 @@ - #include "semantics.hh" - #include "translate.hh" - -+using namespace std; -+ - ConstTpl::ConstTpl(const_type tp) - - { // Constructor for relative jump constants and uniques diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh index 1fbd169c9..de1f10961 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/semantics.hh @@ -11633,21 +10448,8 @@ index 1fbd169c9..de1f10961 100644 int4 restoreXml(const Element *el,const AddrSpaceManager *manage); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc -index 0fd86e645..b33cf85d2 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.cc -@@ -16,6 +16,8 @@ - #include "sleigh.hh" - #include "loadimage.hh" - -+using namespace std; -+ - PcodeCacher::PcodeCacher(void) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh -index 74fc5cbf8..c003c55f4 100644 +index 74fc5cbf8..ab07b2e7b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh.hh @@ -57,9 +57,9 @@ class PcodeCacher { @@ -11674,62 +10476,8 @@ index 74fc5cbf8..c003c55f4 100644 virtual void allowContextSet(bool val) const; virtual int4 instructionLength(const Address &baseaddr) const; virtual int4 oneInstruction(PcodeEmit &emit,const Address &baseaddr) const; -@@ -327,8 +327,8 @@ class Sleigh : public SleighBase { - - // Set up the loadimage - // Providing an executable name and architecture -- string loadimagename = "x86testcode"; -- string bfdtarget= "default"; -+ std::string loadimagename = "x86testcode"; -+ std::string bfdtarget= "default"; - - loader = new LoadImageBfd(loadimagename,bfdtarget); - loader->open(); // Load the executable from file -@@ -345,7 +345,7 @@ class Sleigh : public SleighBase { - this. - - \code -- string sleighfilename = "specfiles/x86.sla"; -+ std::string sleighfilename = "specfiles/x86.sla"; - DocumentStorage docstorage; - Element *sleighroot = docstorage.openDocument(sleighfilename)->getRoot(); - docstorage.registerTag(sleighroot); -@@ -365,7 +365,7 @@ class Sleigh : public SleighBase { - \code - class AssemblyRaw : public AssemblyEmit { - public: -- virtual void dump(const Address &addr,const string &mnem,const string &body) { -+ virtual void dump(const Address &addr,const std::string &mnem,const std::string &body) { - addr.printRaw(cout); - cout << ": " << mnem << ' ' << body << endl; - } -@@ -484,9 +484,9 @@ class Sleigh : public SleighBase { - \code - class MyLoadImage : public LoadImage { - public: -- MyLoadImage(const string &nm) : Loadimage(nm) {} -+ MyLoadImage(const std::string &nm) : Loadimage(nm) {} - virtual void loadFill(uint1 *ptr,int4 size,const Address &addr); -- virtual string getArchType(void) const { return "mytype"; } -+ virtual std::string getArchType(void) const { return "mytype"; } - virtual void adjustVma(long adjust) {} - }; - \endcode -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc -index c0518ec0e..5660525e2 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.cc -@@ -16,6 +16,8 @@ - #include "sleigh_arch.hh" - #include "inject_sleigh.hh" - -+using namespace std; -+ - AttributeId ATTRIB_DEPRECATED = AttributeId("deprecated",136); - AttributeId ATTRIB_ENDIAN = AttributeId("endian",137); - AttributeId ATTRIB_PROCESSOR = AttributeId("processor",138); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh -index 6bb57b81a..0f0535d22 100644 +index 203a33ee6..467675555 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/sleigh_arch.hh @@ -42,15 +42,15 @@ extern ElementId ELEM_LANGUAGE_DEFINITIONS; ///< Marshaling element \ - -+using namespace std; -+ - // These are the bytes for an example x86 binary - // These bytes are loaded at address 0x80483b4 - static uint1 myprog[] = { -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -index 40d731480..2c8eefab7 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.cc -@@ -17,6 +17,8 @@ - #include "filemanage.hh" - #include - -+using namespace std; -+ - SleighCompile *slgh; // Global pointer to sleigh object for use with parser - #ifdef YYDEBUG - extern int yydebug; // Global debugging state for parser diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh index 8fd9ba2fd..c4971d04e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slgh_compile.hh @@ -12281,19 +10991,6 @@ index 8fd9ba2fd..c4971d04e 100644 }; extern SleighCompile *slgh; ///< A global reference to the SLEIGH compiler accessible to the parse functions -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc -index 746d70a81..bd4aa1b77 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.cc -@@ -81,6 +81,8 @@ - - #include "slgh_compile.hh" - -+using namespace std; -+ - #define YYERROR_VERBOSE - - extern SleighCompile *slgh; diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh index f52fe7abb..4bc7f292d 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.hh @@ -12330,34 +11027,8 @@ index f52fe7abb..4bc7f292d 100644 SleighSymbol *anysym; SpaceSymbol *spacesym; SectionSymbol *sectionsym; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y -index b3fedb7b6..0e2172f79 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y -@@ -16,6 +16,8 @@ - %{ - #include "slgh_compile.hh" - -+using namespace std; -+ - #define YYERROR_VERBOSE - - extern SleighCompile *slgh; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc -index 3b7534f09..f6f4f029d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.cc -@@ -16,6 +16,8 @@ - #include "slghpatexpress.hh" - #include "sleighbase.hh" - -+using namespace std; -+ - int4 TokenPattern::resolveTokens(const TokenPattern &tok1,const TokenPattern &tok2) - - { // Use the token lists to decide how the two patterns diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh -index 8c748c2ce..7aa030a45 100644 +index 8c748c2ce..69e7e170b 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpatexpress.hh @@ -20,7 +20,7 @@ @@ -12396,7 +11067,7 @@ index 8c748c2ce..7aa030a45 100644 - virtual void listValues(vector &list) const { list.push_back(this); } - virtual void getMinMax(vector &minlist,vector &maxlist) const { + virtual void listValues(std::vector &list) const { list.push_back(this); } -+ virtual void getMinMax(std::vector &minlist,std::vector &maxlist) const { ++ virtual void getMinMax(std::vector &minlist,std::vector &maxlist) const { minlist.push_back(minValue()); maxlist.push_back(maxValue()); } - virtual intb getSubValue(const vector &replace,int4 &listpos) const { return replace[listpos++]; } + virtual intb getSubValue(const std::vector &replace,int4 &listpos) const { return replace[listpos++]; } @@ -12806,19 +11477,6 @@ index 8c748c2ce..7aa030a45 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc -index 4ebeaa000..9cb0803eb 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.cc -@@ -15,6 +15,8 @@ - */ - #include "slghpattern.hh" - -+using namespace std; -+ - uintm DisjointPattern::getMask(int4 startbit,int4 size,bool context) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh index 05b98e00a..153164e9a 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghpattern.hh @@ -12906,49 +11564,8 @@ index 05b98e00a..153164e9a 100644 virtual void restoreXml(const Element *el); }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc -index 1ac87e2cd..20cbf21e4 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.cc -@@ -888,6 +888,9 @@ char *yytext; - #line 18 "slghscan.l" - #include "slgh_compile.hh" - #include "slghparse.hh" -+ -+using namespace std; -+ - #define yywrap() 1 - #define YY_SKIP_YYWRAP - -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l -index 2df137019..f2341ef09 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghscan.l -@@ -17,6 +17,9 @@ - %{ - #include "slgh_compile.hh" - #include "slghparse.hh" -+ -+using namespace std; -+ - #define yywrap() 1 - #define YY_SKIP_YYWRAP - -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -index 85bd54261..22dc50d0d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.cc -@@ -17,6 +17,8 @@ - #include "sleighbase.hh" - #include - -+using namespace std; -+ - SleighSymbol *SymbolScope::addSymbol(SleighSymbol *a) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh -index 82d95ffef..e07f85e2b 100644 +index 82d95ffef..2327854a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghsymbol.hh @@ -29,19 +29,19 @@ class SleighSymbol { @@ -13234,7 +11851,7 @@ index 82d95ffef..e07f85e2b 100644 public: VarnodeListSymbol(void) {} // For use with restoreXml - VarnodeListSymbol(const string &nm,PatternValue *pv,const vector &vt); -+ VarnodeListSymbol(const std::string &nm,PatternValue *pv,const std::vector &vt); ++ VarnodeListSymbol(const std::string &nm,PatternValue *pv,const std::vector &vt); virtual Constructor *resolve(ParserWalker &walker); virtual void getFixedHandle(FixedHandle &hand,ParserWalker &walker) const; virtual int4 getSize(void) const; @@ -13564,19 +12181,6 @@ index 82d95ffef..e07f85e2b 100644 uint4 getIndex(void) const { return index; } void incrementRefCount(void) { refcount += 1; } uint4 getRefCount(void) const { return refcount; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -index ff6f282ca..b8ac04e72 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/space.cc -@@ -18,6 +18,8 @@ - - #include - -+using namespace std; -+ - AttributeId ATTRIB_BASE = AttributeId("base",89); - AttributeId ATTRIB_DEADCODEDELAY = AttributeId("deadcodedelay",90); - AttributeId ATTRIB_DELAY = AttributeId("delay", 91); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh index 92209bd30..e25e3f79e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/space.hh @@ -13702,19 +12306,6 @@ index 92209bd30..e25e3f79e 100644 return name; } -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc -index 080f543ce..eb10514d1 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "string_ghidra.hh" - -+using namespace std; -+ - GhidraStringManager::GhidraStringManager(ArchitectureGhidra *g,int4 max) - : StringManager(max) - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.hh index 884e7e671..af81276ed 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/string_ghidra.hh @@ -13728,19 +12319,6 @@ index 884e7e671..af81276ed 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc -index 220210a1c..a1324ca46 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc -@@ -16,6 +16,8 @@ - #include "stringmanage.hh" - #include "architecture.hh" - -+using namespace std; -+ - AttributeId ATTRIB_TRUNC = AttributeId("trunc",69); - - ElementId ELEM_BYTES = ElementId("bytes",83); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh index 8a227c69e..f6f5bcb4e 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.hh @@ -13785,19 +12363,6 @@ index 8a227c69e..f6f5bcb4e 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc -index 8f6835b3f..2a79f2942 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.cc -@@ -15,6 +15,8 @@ - */ - #include "subflow.hh" - -+using namespace std; -+ - /// \brief Return \e slot of constant if INT_OR op sets all bits in mask, otherwise -1 - /// - /// \param orop is the given CPUI_INT_OR op diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh index d3c5983b8..741af41d2 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/subflow.hh @@ -13855,32 +12420,6 @@ index d3c5983b8..741af41d2 100644 bool allowSubpieceTerminator; ///< \b true if we allow lanes to be cast (via SUBPIECE) to a smaller integer size TransformVar *setReplacement(Varnode *vn,int4 numLanes,int4 skipLanes); -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc -index ebc049c29..cfac8815a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/test.cc -@@ -19,6 +19,8 @@ - - #include "libdecomp.hh" - -+using namespace std; -+ - vector UnitTest::tests; - - /// Run all the tests unless a non-empty set of names is passed in. -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc -index 4f7110bb4..a23cad3df 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.cc -@@ -15,6 +15,8 @@ - */ - #include "ifacedecomp.hh" - -+using namespace std; -+ - void FunctionTestProperty::startTest(void) const - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh index 46abd6bce..daf9779b7 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/testfunction.hh @@ -13959,19 +12498,6 @@ index 46abd6bce..daf9779b7 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc -index 3c594169d..2e42baac0 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc -@@ -16,6 +16,8 @@ - #include "transform.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_VECTOR_LANE_SIZES = AttributeId("vector_lane_sizes",130); - - /// \param op2 is the lane description to copy from diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh index fa26f0bd1..107e701fc 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh @@ -14017,21 +12543,8 @@ index fa26f0bd1..107e701fc 100644 void placeInputs(void); ///< Set input Varnodes for all new ops public: TransformManager(Funcdata *f) { fd = f; } ///< Constructor -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc -index ec3ec9a01..1d1c89275 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.cc -@@ -15,6 +15,8 @@ - */ - #include "translate.hh" - -+using namespace std; -+ - AttributeId ATTRIB_CODE = AttributeId("code",43); - AttributeId ATTRIB_CONTAIN = AttributeId("contain",44); - AttributeId ATTRIB_DEFAULTSPACE = AttributeId("defaultspace",45); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh -index 4f296ee10..baec0079a 100644 +index 34a4709a8..3d9476b87 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/translate.hh @@ -54,7 +54,7 @@ struct UnimplError : public LowlevelError { @@ -14145,7 +12658,16 @@ index 4f296ee10..baec0079a 100644 JoinRecord *findJoin(uintb offset) const; ///< Find JoinRecord for \e offset in the join space void setDeadcodeDelay(AddrSpace *spc,int4 delaydelta); ///< Set the deadcodedelay for a specific space void truncateSpace(const TruncationTag &tag); ///< Mark a space as truncated from its original size -@@ -306,7 +306,7 @@ class Translate : public AddrSpaceManager { +@@ -280,7 +280,7 @@ class AddrSpaceManager { + void renormalizeJoinAddress(Address &addr,int4 size); + + /// \brief Parse a string with just an \e address \e space name and a hex offset +- Address parseAddressSimple(const string &val); ++ Address parseAddressSimple(const std::string &val); + }; + + /// \brief The interface to a translation engine for a processor. +@@ -309,7 +309,7 @@ class Translate : public AddrSpaceManager { uint4 unique_base; ///< Starting offset into unique space protected: int4 alignment; ///< Byte modulo on which instructions are aligned @@ -14154,7 +12676,7 @@ index 4f296ee10..baec0079a 100644 void setBigEndian(bool val); ///< Set general endianness to \b big if val is \b true void setUniqueBase(uint4 val); ///< Set the base offset for new temporary registers -@@ -336,7 +336,7 @@ class Translate : public AddrSpaceManager { +@@ -339,7 +339,7 @@ class Translate : public AddrSpaceManager { /// \param name is the name of the new context variable /// \param sbit is the first bit of the variable in the packed state /// \param ebit is the last bit of the variable in the packed state @@ -14163,7 +12685,7 @@ index 4f296ee10..baec0079a 100644 /// \brief Set the default value for a particular context variable /// -@@ -345,7 +345,7 @@ class Translate : public AddrSpaceManager { +@@ -348,7 +348,7 @@ class Translate : public AddrSpaceManager { /// for the variable. /// \param name is the name of the context variable /// \param val is the value to be considered default @@ -14172,7 +12694,7 @@ index 4f296ee10..baec0079a 100644 /// \brief Toggle whether disassembly is allowed to affect context /// -@@ -362,7 +362,7 @@ class Translate : public AddrSpaceManager { +@@ -365,7 +365,7 @@ class Translate : public AddrSpaceManager { /// Retrieve the location and size of a register given its name /// \param nm is the name of the register /// \return the VarnodeData for the register @@ -14181,7 +12703,7 @@ index 4f296ee10..baec0079a 100644 /// \brief Get the name of a register given its location /// -@@ -374,7 +374,7 @@ class Translate : public AddrSpaceManager { +@@ -377,7 +377,7 @@ class Translate : public AddrSpaceManager { /// \param off is the offset of the location /// \param size is the size of the location /// \return the name of the register, or an empty string @@ -14190,7 +12712,7 @@ index 4f296ee10..baec0079a 100644 /// \brief Get a list of all register names and the corresponding location /// -@@ -382,7 +382,7 @@ class Translate : public AddrSpaceManager { +@@ -385,7 +385,7 @@ class Translate : public AddrSpaceManager { /// that are specific to it. This function populates a map from the location information /// to the name, for every named location known by the translator /// \param reglist is the map which will be populated by the call @@ -14199,7 +12721,7 @@ index 4f296ee10..baec0079a 100644 /// \brief Get a list of all \e user-defined pcode ops /// -@@ -392,7 +392,7 @@ class Translate : public AddrSpaceManager { +@@ -395,7 +395,7 @@ class Translate : public AddrSpaceManager { /// and an index. This method returns a list of these ops /// in index order. /// \param res is the resulting vector of user op names @@ -14208,19 +12730,6 @@ index 4f296ee10..baec0079a 100644 /// \brief Get the length of a machine instruction /// -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -index 91bf4bc77..0f725c138 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc -@@ -16,6 +16,8 @@ - #include "type.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// The base propagation ordering associated with each meta-type. - /// The array elements correspond to the ordering of #type_metatype. - sub_metatype Datatype::base2sub[15] = { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh index 78b6fe4d2..64fa3f4d8 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh @@ -14580,19 +13089,6 @@ index 78b6fe4d2..64fa3f4d8 100644 void cacheCoreTypes(void); ///< Cache common types }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc -index 351e3df1a..dcc279aaf 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.cc -@@ -15,6 +15,8 @@ - */ - #include "typegrp_ghidra.hh" - -+using namespace std; -+ - Datatype *TypeFactoryGhidra::findById(const string &n,uint8 id,int4 sz) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.hh index 847dec7da..91de00eea 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/typegrp_ghidra.hh @@ -14606,19 +13102,6 @@ index 847dec7da..91de00eea 100644 public: TypeFactoryGhidra(ArchitectureGhidra *g) : TypeFactory(g) {} ///< Constructor virtual ~TypeFactoryGhidra(void) {} -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc -index 11000806f..210d7ae99 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc -@@ -17,6 +17,8 @@ - #include "funcdata.hh" - #include - -+using namespace std; -+ - /// \param inst will hold the array of TypeOp objects, indexed on op-code - /// \param tlst is the corresponding TypeFactory for the Architecture - /// \param trans is the Translate object for floating-point formats diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh index f8976eb5e..c90401b52 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.hh @@ -14947,19 +13430,6 @@ index f8976eb5e..c90401b52 100644 }; /// \brief Information about the INSERT op-code -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc -index d848cfc7d..4caefde8d 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.cc -@@ -16,6 +16,8 @@ - #ifdef CPUI_RULECOMPILE - #include "unify.hh" - -+using namespace std; -+ - UnifyDatatype::UnifyDatatype(uint4 tp) - - { diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/unify.hh index 995f96b44..2522ad5ae 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/unify.hh @@ -15503,19 +13973,6 @@ index 995f96b44..2522ad5ae 100644 }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc -index 940d33322..055662fb9 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.cc -@@ -16,6 +16,8 @@ - #include "unionresolve.hh" - #include "funcdata.hh" - -+using namespace std; -+ - /// The original parent must either be a union, a pointer to a union, or a partial union. - /// The object is set up initially to resolve to the parent. - /// \param parent is the original parent data-type diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh index c60c70601..77e85c1a6 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/unionresolve.hh @@ -15537,19 +13994,6 @@ index c60c70601..77e85c1a6 100644 ResolvedUnion result; ///< The best result int4 trialCount; ///< Number of trials evaluated so far static const int4 maxPasses; ///< Maximum number of levels to score through -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc -index e60353941..d32919020 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.cc -@@ -16,6 +16,8 @@ - #include "userop.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_FARPOINTER = AttributeId("farpointer",85); - AttributeId ATTRIB_INPUTOP = AttributeId("inputop",86); - AttributeId ATTRIB_OUTPUTOP = AttributeId("outputop",87); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh index a283255cb..d99f16029 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/userop.hh @@ -15712,21 +14156,8 @@ index a283255cb..d99f16029 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc -index ff5678c04..d8d010b27 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.cc -@@ -17,6 +17,8 @@ - #include "op.hh" - #include "database.hh" - -+using namespace std; -+ - AttributeId ATTRIB_CLASS = AttributeId("class",66); - AttributeId ATTRIB_REPREF = AttributeId("repref",67); - AttributeId ATTRIB_SYMREF = AttributeId("symref",68); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh -index 25f6f8361..f26e0c6b6 100644 +index 21e547919..31dce00be 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/variable.hh @@ -62,7 +62,7 @@ class HighVariable { @@ -15738,7 +14169,7 @@ index 25f6f8361..f26e0c6b6 100644 int4 numMergeClasses; ///< Number of different speculative merge classes in \b this mutable uint4 highflags; ///< Dirtiness flags mutable uint4 flags; ///< Boolean properties inherited from Varnode members -@@ -102,9 +102,9 @@ class HighVariable { +@@ -103,9 +103,9 @@ class HighVariable { /// \brief Print details of the cover for \b this (for debug purposes) /// /// \param s is the output stream @@ -15750,7 +14181,7 @@ index 25f6f8361..f26e0c6b6 100644 bool hasName(void) const; ///< Check if \b this HighVariable can be named Varnode *getTiedVarnode(void) const; ///< Find the first address tied member Varnode Varnode *getInputVarnode(void) const; ///< Find (the) input member Varnode -@@ -143,7 +143,7 @@ class HighVariable { +@@ -144,7 +144,7 @@ class HighVariable { // Varnode *findGlobalRep(void) const; static bool compareName(Varnode *vn1,Varnode *vn2); ///< Determine which given Varnode is most nameable static bool compareJustLoc(const Varnode *a,const Varnode *b); ///< Compare based on storage location @@ -15759,19 +14190,6 @@ index 25f6f8361..f26e0c6b6 100644 }; #endif -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc -index 76f4ed86f..9674c5dfe 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.cc -@@ -16,6 +16,8 @@ - #include "varmap.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_LOCK = AttributeId("lock",133); - AttributeId ATTRIB_MAIN = AttributeId("main",134); - diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh index 5267b0a3a..dba5351fa 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/varmap.hh @@ -15888,21 +14306,8 @@ index 5267b0a3a..dba5351fa 100644 const Address &pc, Datatype *ct, int4 &index,uint4 flags) const; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc -index 4675e9ee8..e7041884b 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.cc -@@ -16,6 +16,8 @@ - #include "varnode.hh" - #include "funcdata.hh" - -+using namespace std; -+ - AttributeId ATTRIB_ADDRTIED = AttributeId("addrtied",30); - AttributeId ATTRIB_GRP = AttributeId("grp",31); - AttributeId ATTRIB_INPUT = AttributeId("input",32); diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh -index c6f656478..d27b37f8c 100644 +index 30a49cb75..eadd293db 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/varnode.hh @@ -47,10 +47,10 @@ struct VarnodeCompareDefLoc { @@ -15927,7 +14332,7 @@ index c6f656478..d27b37f8c 100644 mutable Cover *cover; ///< Addresses covered by the def->use of this Varnode mutable union { Datatype *dataType; ///< Temporary data-type associated with \b this for use in type propagate algorithm -@@ -195,8 +195,8 @@ class Varnode { +@@ -196,8 +196,8 @@ class Varnode { ValueSet *getValueSet(void) const { return temp.valueSet; } ///< Get the temporary ValueSet record uint4 getCreateIndex(void) const { return create_index; } ///< Get the creation index Cover *getCover(void) const { updateCover(); return cover; } ///< Get Varnode coverage information @@ -15938,7 +14343,7 @@ index c6f656478..d27b37f8c 100644 uintb getConsume(void) const { return consumed; } ///< Get mask of consumed bits void setConsume(uintb val) { consumed = val; } ///< Set the mask of consumed bits (used by dead-code algorithm) bool isConsumeList(void) const { return ((addlflags&Varnode::lisconsume)!=0); } ///< Get marker used by dead-code algorithm -@@ -207,10 +207,10 @@ class Varnode { +@@ -208,10 +208,10 @@ class Varnode { void clearConsumeVacuous(void) { addlflags &= ~Varnode::vacconsume; } ///< Clear marker used by dead-code algorithm PcodeOp *loneDescend(void) const; ///< Return unique reading PcodeOp, or \b null if there are zero or more than 1 Address getUsePoint(const Funcdata &fd) const; ///< Get Address when this Varnode first comes into scope @@ -15953,7 +14358,7 @@ index c6f656478..d27b37f8c 100644 Varnode(int4 s,const Address &m,Datatype *dt); ///< Construct a \e free Varnode bool operator<(const Varnode &op2) const; ///< Comparison operator on Varnode bool operator==(const Varnode &op2) const; ///< Equality operator -@@ -224,7 +224,7 @@ class Varnode { +@@ -225,7 +225,7 @@ class Varnode { int4 overlap(const Address &op2loc,int4 op2size) const; ///< Return relative point of overlap with Address range uintb getNZMask(void) const { return nzm; } ///< Get the mask of bits within \b this that are known to be zero int4 termOrder(const Varnode *op) const; ///< Compare two Varnodes based on their term order @@ -15962,7 +14367,7 @@ index c6f656478..d27b37f8c 100644 bool isAnnotation(void) const { return ((flags&Varnode::annotation)!=0); } ///< Is \b this an annotation? bool isImplied(void) const { return ((flags&Varnode::implied)!=0); } ///< Is \b this an implied variable? bool isExplicit(void) const { return ((flags&Varnode::explict)!=0); } ///< Is \b this an explicitly printed variable? -@@ -332,7 +332,7 @@ class Varnode { +@@ -333,7 +333,7 @@ class Varnode { bool copyShadow(const Varnode *op2) const; ///< Are \b this and \b op2 copied from the same source? void encode(Encoder &encoder) const; ///< Encode a description of \b this to a stream static bool comparePointers(const Varnode *a,const Varnode *b) { return (*a < *b); } ///< Compare Varnodes as pointers @@ -15971,21 +14376,8 @@ index c6f656478..d27b37f8c 100644 }; /// \brief A container for Varnode objects from a specific function -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc -index fc4d1bf61..68778c5ca 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.cc -@@ -98,6 +98,8 @@ - #include - #include - -+using namespace std; -+ - string Attributes::bogus_uri("http://unused.uri"); - - /// \brief The XML character scanner diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh -index a1c763a3e..802f57988 100644 +index a1c763a3e..95255b533 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.hh @@ -25,8 +25,6 @@ @@ -16002,12 +14394,11 @@ index a1c763a3e..802f57988 100644 /// including the \e namespace URI. class Attributes { - static string bogus_uri; ///< A placeholder for the namespace URI that should be attached to the element --// static string prefix; ++ static std::string bogus_uri; ///< A placeholder for the namespace URI that should be attached to the element + // static string prefix; - string *elementname; ///< The name of the XML element - vector name; ///< List of names for each formal XML attribute - vector value; ///< List of values for each formal XML attribute -+ static std::string bogus_uri; ///< A placeholder for the namespace URI that should be attached to the element -+// static std::string prefix; + std::string *elementname; ///< The name of the XML element + std::vector name; ///< List of names for each formal XML attribute + std::vector value; ///< List of values for each formal XML attribute @@ -16029,23 +14420,17 @@ index a1c763a3e..802f57988 100644 - const string &getURI(int4 i) const { return bogus_uri; } ///< Get the namespace URI associated with the i-th attribute - const string &getLocalName(int4 i) const { return *name[i]; } ///< Get the local name of the i-th attribute - const string &getQName(int4 i) const { return *name[i]; } ///< Get the qualified name of the i-th attribute -- // int4 getIndex(const string &uri,const string &localName) const; -- // int4 getIndex(const string &qualifiedName) const; -- // const string &getType(int4 index) const; -- // const string &getType(const string &uri,const string &localName) const; -- // const string &getType(const string &qualifiedName) const; -- const string &getValue(int4 i) const { return *value[i]; } ///< Get the value of the i-th attribute -- //const string &getValue(const string &uri,const string &localName) const; + const std::string &getURI(int4 i) const { return bogus_uri; } ///< Get the namespace URI associated with the i-th attribute + const std::string &getLocalName(int4 i) const { return *name[i]; } ///< Get the local name of the i-th attribute + const std::string &getQName(int4 i) const { return *name[i]; } ///< Get the qualified name of the i-th attribute -+ // int4 getIndex(const std::string &uri,const std::string &localName) const; -+ // int4 getIndex(const std::string &qualifiedName) const; -+ // const std::string &getType(int4 index) const; -+ // const std::string &getType(const std::string &uri,const std::string &localName) const; -+ // const std::string &getType(const std::string &qualifiedName) const; + // int4 getIndex(const string &uri,const string &localName) const; + // int4 getIndex(const string &qualifiedName) const; + // const string &getType(int4 index) const; + // const string &getType(const string &uri,const string &localName) const; + // const string &getType(const string &qualifiedName) const; +- const string &getValue(int4 i) const { return *value[i]; } ///< Get the value of the i-th attribute + const std::string &getValue(int4 i) const { return *value[i]; } ///< Get the value of the i-th attribute -+ //const std::string &getValue(const std::string &uri,const std::string &localName) const; + //const string &getValue(const string &uri,const string &localName) const; /// \brief Get the value of the attribute with the given qualified name - const string &getValue(const string &qualifiedName) const { + const std::string &getValue(const std::string &qualifiedName) const { @@ -16346,32 +14731,6 @@ index a1c763a3e..802f57988 100644 { if (attr.size()==0) return false; -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y -index 8f5386237..5d5f702cc 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml.y -@@ -25,6 +25,8 @@ - #include - #include - -+using namespace std; -+ - string Attributes::bogus_uri("http://unused.uri"); - - /// \brief The XML character scanner -diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc -index c5c533ba9..21e6e390a 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.cc -@@ -15,6 +15,8 @@ - */ - #include "xml_arch.hh" - -+using namespace std; -+ - ElementId ELEM_XML_SAVEFILE = ElementId("xml_savefile",236); - - // Constructing the singleton registers the capability diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh index 6371148b0..e9598b9d5 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/xml_arch.hh @@ -16396,58 +14755,6 @@ index 6371148b0..e9598b9d5 100644 virtual ~XmlArchitecture(void) {} }; -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc -index a8bf58ec5..6dcfc7930 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testcirclerange.cc -@@ -16,6 +16,8 @@ - #include "architecture.hh" - #include "test.hh" - -+using namespace std; -+ - class CircleRangeTestEnvironment { - Architecture *g; - public: -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -index 67d92c573..9cb08b3d1 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testfloatemu.cc -@@ -27,6 +27,8 @@ - #include - #include - -+using namespace std; -+ - // utility functions - float floatFromRawBits(uintb e) { - float f; -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc -index b941fede3..a09332af8 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testmarshal.cc -@@ -16,6 +16,8 @@ - #include "translate.hh" - #include "test.hh" - -+using namespace std; -+ - class TestAddrSpaceManager : public AddrSpaceManager { - public: - TestAddrSpaceManager(Translate *t); -diff --git a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc -index 4ce7cdde6..1ac3c3d5f 100644 ---- a/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc -+++ b/Ghidra/Features/Decompiler/src/decompile/unittests/testtypes.cc -@@ -18,6 +18,8 @@ - #include "test.hh" - #include - -+using namespace std; -+ - static Architecture *glb; - static TypeFactory *types; - static CastStrategy *strategy; -- -2.39.0 +2.40.0 diff --git a/src/patches/stable/0007-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch b/src/patches/stable/0007-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch new file mode 100644 index 0000000..06c0976 --- /dev/null +++ b/src/patches/stable/0007-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch @@ -0,0 +1,51 @@ +From 893e32017fb08c773bfedafe790667db3a39cf62 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Sun, 19 Mar 2023 15:46:26 -0400 +Subject: [PATCH 7/8] (3/4) decompiler: Manually fix std namespace in generated + file + +We must manually fix the symbols from std namespace because the +automated tool does not know how to parse yacc/bison files. +--- + .../Decompiler/src/decompile/cpp/slghparse.y | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +index 0e2172f79..039963cd5 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/slghparse.y +@@ -32,24 +32,24 @@ using namespace std; + char ch; + uintb *i; + intb *big; +- string *str; +- vector *strlist; +- vector *biglist; +- vector *param; ++ std::string *str; ++ std::vector *strlist; ++ std::vector *biglist; ++ std::vector *param; + SpaceQuality *spacequal; + FieldQuality *fieldqual; + StarQuality *starqual; + VarnodeTpl *varnode; + ExprTree *tree; +- vector *stmt; ++ std::vector *stmt; + ConstructTpl *sem; + SectionVector *sectionstart; + Constructor *construct; + PatternEquation *pateq; + PatternExpression *patexp; + +- vector *symlist; +- vector *contop; ++ std::vector *symlist; ++ std::vector *contop; + SleighSymbol *anysym; + SpaceSymbol *spacesym; + SectionSymbol *sectionsym; +-- +2.40.0 + diff --git a/src/patches/stable/0008-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch b/src/patches/stable/0008-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch new file mode 100644 index 0000000..373bf45 --- /dev/null +++ b/src/patches/stable/0008-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch @@ -0,0 +1,29 @@ +From 92dd6f2579323dba0b5438c245f342507d27ec01 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Sun, 19 Mar 2023 15:47:28 -0400 +Subject: [PATCH 8/8] (4/4) decompiler: Manually fix missed std variable usage + +Unfortunately, the heuristics in remusing are unable to automatically +fix this case of variables from the C++ standard library. + +This was fixed by resolving the error(s) produced by the compiler. +--- + Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh +index 64fd45e35..428319a65 100644 +--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh ++++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ghidra_process.hh +@@ -79,7 +79,7 @@ class GhidraCommand { + virtual void loadParameters(void); ///< Read parameters directing command execution + virtual void sendResult(void); ///< Send results of the command (if any) back to the Ghidra client + public: +- GhidraCommand(void) : sin(cin),sout(cout) { ++ GhidraCommand(void) : sin(std::cin),sout(std::cout) { + ghidra = (ArchitectureGhidra *)0; + } ///< Construct given i/o streams + virtual ~GhidraCommand(void) {} ///< Destructor +-- +2.40.0 + diff --git a/src/setup-ghidra-source.cmake b/src/setup-ghidra-source.cmake index 19c1ea6..317789f 100644 --- a/src/setup-ghidra-source.cmake +++ b/src/setup-ghidra-source.cmake @@ -22,7 +22,7 @@ set_property(CACHE sleigh_RELEASE_TYPE PROPERTY STRINGS "stable" "HEAD") find_package(Git REQUIRED) # Ghidra pinned stable version commit -set(ghidra_version "10.2.2") +set(ghidra_version "10.2.3") set(ghidra_git_tag "Ghidra_${ghidra_version}_build") set(ghidra_shallow TRUE) @@ -42,7 +42,10 @@ set(ghidra_patches "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0002-Add-include-guards-to-decompiler-C-headers.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0003-Fix-UBSAN-errors-in-decompiler.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0004-Use-stroull-instead-of-stroul-to-parse-address-offse.patch" - "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-Remove-using-namespace-std-from-headers.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0005-1-4-decompiler-Add-using-namespace-std-to-all-.cc.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0006-2-4-decompiler-Remusing-automated-std-namespace-fix.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0007-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/stable/0008-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch" ) # Ghidra pinned commits used for pinning last known working HEAD commit @@ -51,7 +54,7 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD") # TODO: CMake only likes numeric characters in the version string.... set(ghidra_head_version "10.3") set(ghidra_version "${ghidra_head_version}") - set(ghidra_head_git_tag "d55b7e9aa9e667359b097b6f07a077942cd259e8") + set(ghidra_head_git_tag "a6be09898f46e4c6bd2c48c3df7b89a1737e9af3") set(ghidra_git_tag "${ghidra_head_git_tag}") set(ghidra_shallow FALSE) set(ghidra_patches @@ -61,7 +64,10 @@ if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD") "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0001-Add-include-guards-to-decompiler-C-headers.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0002-Fix-UBSAN-errors-in-decompiler.patch" "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0003-Use-stroull-instead-of-stroul-to-parse-address-offse.patch" - "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0004-Remove-using-namespace-std-from-headers.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0004-1-4-decompiler-Add-using-namespace-std-to-all-.cc-fi.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0005-2-4-decompiler-Automated-std-namespace-fix-with-remu.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0006-3-4-decompiler-Manually-fix-std-namespace-in-generat.patch" + "${CMAKE_CURRENT_LIST_DIR}/patches/HEAD/0007-4-4-decompiler-Manually-fix-missed-std-variable-usag.patch" ) string(SUBSTRING "${ghidra_git_tag}" 0 7 ghidra_short_commit) else() diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 1043af3..67d1d9f 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -59,6 +59,8 @@ target_include_directories(sleigh_support SYSTEM PUBLIC "$" + # For libconfig.h + "$" ) if(NOT CMAKE_SKIP_INSTALL_RULES) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a6b6081..8b43a09 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,10 +24,11 @@ add_executable(sleigh_ghidra_test "${library_root}/../unittests/testmarshal.cc" ) -#if(sleigh_RELEASE_IS_HEAD) -# target_sources(sleigh_ghidra_test PRIVATE -# ) -#endif() +if(sleigh_RELEASE_IS_HEAD) + target_sources(sleigh_ghidra_test PRIVATE + "${library_root}/../unittests/testfuncproto.cc" + ) +endif() target_compile_features(sleigh_ghidra_test PRIVATE cxx_std_11) target_include_directories(sleigh_ghidra_test PRIVATE "${library_root}")