(note, programContext) -> new MyNote(....)
+ * specialized note.
* @return new Note instance, or null if not present or error reading
*/
protected static * When bootstrapping golang binaries, the following steps are used: *
- * To use the full might and majesty of StructureMapping(tm), a ProgramContext must be created. It + * To use the full might and majesty of StructureMapping(tm), a DataTypeMapper must be created. It * must be able to {@link #addArchiveSearchCategoryPath(CategoryPath...) find} * ({@link #addProgramSearchCategoryPath(CategoryPath...) more find}) the Ghidra structure data * types being used, and it must {@link #registerStructure(Class) know} about all classes that are * going to participate during deserialization and markup. *
- * Structure mapped classes can receive a reference to the specific ProgramContext type that - * created them by declaring a {@code ProgramContext} field, and tagging it with + * Structure mapped classes can receive a reference to the specific DataTypeMapper type that + * created them by declaring a {@code DataTypeMapper} field, and tagging it with * the @{@link ContextField} annotation: * *
- * class MyProgramContext extends ProgramContext {
- * public MyProgramContext() {
+ * class MyDataTypeMapper extends DataTypeMapper {
+ * public MyDataTypeMapper() {
* ...
* registerStructure(MyDataType.class);
* }
@@ -61,7 +61,7 @@ import ghidra.util.task.TaskMonitor;
* class MyDataType {
*
* @ContextField
- * private MyProgramContext myProgramContext;
+ * private MyDataTypeMapper myDataTypeMapper;
*
* @ContextField
* private StructureContext<MyDataType> context;
@@ -70,13 +70,13 @@ import ghidra.util.task.TaskMonitor;
* private long someField;
*
* void bar() {
- * context.getProgramContext().getProgram(); // can only access methods defined on base ProgramContext type
- * myProgramContext.foo(); // same context as previous line, but typed correctly
+ * context.getDataTypeMapper().getProgram(); // can only access methods defined on base DataTypeMapper type
+ * myDataTypeMapper.foo(); // same context as previous line, but typed correctly
* ...
*
*
*/
-public class ProgramContext implements AutoCloseable {
+public class DataTypeMapper implements AutoCloseable {
protected Program program;
protected DataTypeManager programDTM;
protected DataTypeManager archiveDTM;
@@ -92,7 +92,7 @@ public class ProgramContext implements AutoCloseable {
* @param archiveGDT
* @throws IOException
*/
- protected ProgramContext(Program program, ResourceFile archiveGDT) throws IOException {
+ protected DataTypeMapper(Program program, ResourceFile archiveGDT) throws IOException {
this.program = program;
this.programDTM = program.getDataTypeManager();
this.archiveDTM = archiveGDT != null
@@ -126,12 +126,12 @@ public class ProgramContext implements AutoCloseable {
return DataConverter.getInstance(program.getMemory().isBigEndian());
}
- public ProgramContext addProgramSearchCategoryPath(CategoryPath... paths) {
+ public DataTypeMapper addProgramSearchCategoryPath(CategoryPath... paths) {
programSearchCPs.addAll(Arrays.asList(paths));
return this;
}
- public ProgramContext addArchiveSearchCategoryPath(CategoryPath... paths) {
+ public DataTypeMapper addArchiveSearchCategoryPath(CategoryPath... paths) {
archiveSearchCPs.addAll(Arrays.asList(paths));
return this;
}
@@ -401,6 +401,6 @@ public class ProgramContext implements AutoCloseable {
@Override
public String toString() {
- return "ProgramContext { program: %s}".formatted(program.getName());
+ return "DataTypeMapper { program: %s}".formatted(program.getName());
}
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldContext.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldContext.java
index 5cf6bb4c29..9520cbf5d4 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldContext.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldContext.java
@@ -38,8 +38,8 @@ public record FieldContext- * The tagged class must be {@link ProgramContext#registerStructure(Class) registered} with + * The tagged class must be {@link DataTypeMapper#registerStructure(Class) registered} with * the program context to enable the suite of structure mapped classes to work together when * applied to a Ghidra binary. *
@@ -44,8 +44,8 @@ import java.lang.annotation.*; * variable length fields found in the structure. *
* Structure mapped classes must have a {@link StructureContext} member variable that is tagged
- * with the {@link ContextField} annotation, and probably should have a {@link ProgramContext}
- * member variable (that corresponds to a more specific type of ProgramContext) that is also
+ * with the {@link ContextField} annotation, and probably should have a {@link DataTypeMapper}
+ * member variable (that corresponds to a more specific type of DataTypeMapper) that is also
* tagged with the ContextField annotation.
*
*/
@@ -54,11 +54,11 @@ import java.lang.annotation.*;
public @interface StructureMapping {
/**
* Specifies the name of a Ghidra structure that the tagged class represents. For fixed
- * length structures, the {@link ProgramContext} will search for this Ghidra data type
+ * length structures, the {@link DataTypeMapper} will search for this Ghidra data type
* in it's configured
- * {@link ProgramContext#addArchiveSearchCategoryPath(ghidra.program.model.data.CategoryPath...) archive}
+ * {@link DataTypeMapper#addArchiveSearchCategoryPath(ghidra.program.model.data.CategoryPath...) archive}
* and
- * {@link ProgramContext#addProgramSearchCategoryPath(ghidra.program.model.data.CategoryPath...) program}
+ * {@link DataTypeMapper#addProgramSearchCategoryPath(ghidra.program.model.data.CategoryPath...) program}
* search paths.
*
* @return
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/StructureMappingInfo.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/StructureMappingInfo.java
index af65f1918d..1ec7e8a72f 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/StructureMappingInfo.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/StructureMappingInfo.java
@@ -86,7 +86,7 @@ public class StructureMappingInfo