From b1bca74174eaadedf8392d4724d0b0563c5a3c15 Mon Sep 17 00:00:00 2001 From: ghizard <50744617+ghizard@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:37:54 -0400 Subject: [PATCH] GP-3644_MDMang_rref_cleanup --- .../src/main/java/mdemangler/MDMangGhidra.java | 4 ++-- .../mdemangler/datatype/MDDataTypeParser.java | 2 +- .../mdemangler/datatype/modifier/MDCVMod.java | 16 ++++++++-------- ...efType.java => MDDataRightReferenceType.java} | 6 +++--- .../datatype/modifier/MDModifiedTypeParser.java | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) rename Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/{MDDataRefRefType.java => MDDataRightReferenceType.java} (90%) diff --git a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangGhidra.java b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangGhidra.java index 784c6d0e89..431178bdc2 100644 --- a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangGhidra.java +++ b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangGhidra.java @@ -452,7 +452,7 @@ public class MDMangGhidra extends MDMang { } private DemangledFunctionReference processDemangledFunctionReference(MDModifierType refType) { - if (!((refType instanceof MDReferenceType) || (refType instanceof MDDataRefRefType))) { + if (!((refType instanceof MDReferenceType) || (refType instanceof MDDataRightReferenceType))) { return null; // Not planning on anything else yet. } DemangledFunctionReference functionReference = @@ -702,7 +702,7 @@ public class MDMangGhidra extends MDMang { } return resultDataType; } - else if (modifierType instanceof MDDataRefRefType) { + else if (modifierType instanceof MDDataRightReferenceType) { if ((modifierType.getReferencedType() instanceof MDFunctionType)) { resultDataType.setName(getDataTypeName(datatype)); // TODO---------what are we returning... need to work on called routine. diff --git a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/MDDataTypeParser.java b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/MDDataTypeParser.java index 4ea1de6313..66cb0a1109 100644 --- a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/MDDataTypeParser.java +++ b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/MDDataTypeParser.java @@ -138,7 +138,7 @@ public class MDDataTypeParser { break; case 'Q': case 'R': - MDDataRefRefType drrt = new MDDataRefRefType(dmang); + MDDataRightReferenceType drrt = new MDDataRightReferenceType(dmang); dt = drrt; if (isHighest && (code == 'R')) { drrt.clearConst(); diff --git a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDCVMod.java b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDCVMod.java index 4b26c07ab2..705363074f 100644 --- a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDCVMod.java +++ b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDCVMod.java @@ -38,10 +38,10 @@ public class MDCVMod extends MDParsableItem { // with // // old code private static final String POINTER = "*"; - private static final String REFERENCE = "&"; + private static final String AMPERSAND = "&"; private static final String CARROT = "^"; private static final String PERCENT = "%"; - private static final String REFREF = "&&"; + private static final String DOUBLE_AMPERSAND = "&&"; private final static String PTR64 = " __ptr64"; private static final String UNALIGNED = "__unaligned "; @@ -132,7 +132,7 @@ public class MDCVMod extends MDParsableItem { plain, pointer, reference, - refref, + rightreference, carrot, // TODO: eliminate with old code percent, // TODO: eliminate with old code functionpointer, // TODO: eliminate with old code @@ -156,8 +156,8 @@ public class MDCVMod extends MDParsableItem { modType = CvModifierType.reference; } - public void setRefRefTemplateParameter() { - modType = CvModifierType.refref; + public void setRightReferenceTemplateParameter() { + modType = CvModifierType.rightreference; } // public void setCarrotType() { @@ -828,10 +828,10 @@ public class MDCVMod extends MDParsableItem { annotation = PERCENT; } else { - annotation = REFERENCE; + annotation = AMPERSAND; } break; - case refref: + case rightreference: if (isCLIProperty()) { // highest precedence, even if isGC is set. annotation = PERCENT; } @@ -839,7 +839,7 @@ public class MDCVMod extends MDParsableItem { annotation = PERCENT; } else { - annotation = REFREF; + annotation = DOUBLE_AMPERSAND; } break; case array: diff --git a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDDataRefRefType.java b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDDataRightReferenceType.java similarity index 90% rename from Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDDataRefRefType.java rename to Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDDataRightReferenceType.java index 55e2cf56c1..0bde39e1d6 100644 --- a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDDataRefRefType.java +++ b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDDataRightReferenceType.java @@ -28,15 +28,15 @@ import mdemangler.MDMang; // properties // TODO: Seems very closely related to a "reference" type, so might find a way to merge // reference types together. -public class MDDataRefRefType extends MDModifierType { +public class MDDataRightReferenceType extends MDModifierType { - public MDDataRefRefType(MDMang dmang) { + public MDDataRightReferenceType(MDMang dmang) { super(dmang, 3); } @Override protected void parseInternal() throws MDException { - cvMod.setRefRefTemplateParameter(); + cvMod.setRightReferenceTemplateParameter(); super.parseInternal(); } } diff --git a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDModifiedTypeParser.java b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDModifiedTypeParser.java index 55381dbaed..c7cd2fea61 100644 --- a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDModifiedTypeParser.java +++ b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/datatype/modifier/MDModifiedTypeParser.java @@ -127,7 +127,7 @@ public class MDModifiedTypeParser { plain, pointer, reference, - refref, + rightreference, carrot, // TODO: eliminate with old code percent, // TODO: eliminate with old code functionpointer, // TODO: eliminate with old code @@ -150,8 +150,8 @@ public class MDModifiedTypeParser { modType = CvModifierType.reference; } - public void setRefRefTemplateParameter() { - modType = CvModifierType.refref; + public void setRightReferenceParameter() { + modType = CvModifierType.rightreference; } // public void setCarrotType() {