Merge remote-tracking branch 'origin/Ghidra_11.4'

This commit is contained in:
ghidra1 2025-06-06 18:50:01 -04:00
commit f981f43fad
183 changed files with 3088 additions and 3278 deletions

View file

@ -173,13 +173,8 @@ public class DiffApplyMergeTest extends DiffApplyTestAdapter {
setDiffSelection(as);
apply();
// Check the results. We should have both tags now in the target program
// (Program 1), so check the number of tags and make sure the names are
// correct.
Iterator<FunctionTag> iter = f1.getTags().iterator();
List<String> tagNames = new ArrayList<>();
while (iter.hasNext()) {
FunctionTag tag = iter.next();
for (FunctionTag tag : f1.getTags()) {
tagNames.add(tag.getName());
}
assertEquals(tagNames.size(), 2);

View file

@ -164,49 +164,49 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
builder.createExternalReference("0x01001034", "yourLib.dll", "GetStuff", "0x77f42caa", 0);
// comments
builder.createComment("1002040", "Plate in P1.", CodeUnit.PLATE_COMMENT);
builder.createComment("1002040", "Pre in P1.", CodeUnit.PRE_COMMENT);
builder.createComment("1002040", "EOL in P1.", CodeUnit.EOL_COMMENT);
builder.createComment("1002040", "Repeatable in P1.", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002040", "Post in P1.", CodeUnit.POST_COMMENT);
builder.createComment("1002040", "Plate in P1.", CommentType.PLATE);
builder.createComment("1002040", "Pre in P1.", CommentType.PRE);
builder.createComment("1002040", "EOL in P1.", CommentType.EOL);
builder.createComment("1002040", "Repeatable in P1.", CommentType.REPEATABLE);
builder.createComment("1002040", "Post in P1.", CommentType.POST);
builder.createComment("1002304", "EOL comment", CodeUnit.EOL_COMMENT);
builder.createComment("1002306", "\"Pre Comment\"", CodeUnit.PRE_COMMENT);
builder.createComment("100230b", "Plate Comment", CodeUnit.PRE_COMMENT);
builder.createComment("100230b", "Post Comment", CodeUnit.PRE_COMMENT);
builder.createComment("100230d", "simple comment", CodeUnit.PRE_COMMENT);
builder.createComment("100230d", "simple comment", CodeUnit.EOL_COMMENT);
builder.createComment("100230d", "simple comment", CodeUnit.POST_COMMENT);
builder.createComment("100230d", "simple comment", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("100230d", "simple comment", CodeUnit.PLATE_COMMENT);
builder.createComment("1002304", "EOL comment", CommentType.EOL);
builder.createComment("1002306", "\"Pre Comment\"", CommentType.PRE);
builder.createComment("100230b", "Plate Comment", CommentType.PRE);
builder.createComment("100230b", "Post Comment", CommentType.PRE);
builder.createComment("100230d", "simple comment", CommentType.PRE);
builder.createComment("100230d", "simple comment", CommentType.EOL);
builder.createComment("100230d", "simple comment", CommentType.POST);
builder.createComment("100230d", "simple comment", CommentType.REPEATABLE);
builder.createComment("100230d", "simple comment", CommentType.PLATE);
builder.createComment("1002312", "\"My comment that the other comment is in.\"",
CodeUnit.PRE_COMMENT);
CommentType.PRE);
builder.createComment("1002312", "My comment that the other comment is in.",
CodeUnit.EOL_COMMENT);
CommentType.EOL);
builder.createComment("1002312", "My comment that the other comment is in.",
CodeUnit.POST_COMMENT);
CommentType.POST);
builder.createComment("1002312", "My comment that the other comment is in.",
CodeUnit.PLATE_COMMENT);
CommentType.PLATE);
builder.createComment("1002336", "ONE: Repeatable comment.", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002336", "ONE: Repeatable comment.", CommentType.REPEATABLE);
builder.createComment("1002346", "Easy as pie.", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002346", "Easy as pie.", CommentType.REPEATABLE);
builder.createComment("1002350", "Once upon a", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002350", "Once upon a", CommentType.REPEATABLE);
builder.createComment("100238f", "EOL: Program1", CodeUnit.EOL_COMMENT);
builder.createComment("100238f", "EOL: Program1", CommentType.EOL);
builder.createComment("1002395", "Pre: Program1", CodeUnit.PRE_COMMENT);
builder.createComment("1002395", "Pre: Program1", CommentType.PRE);
// builder.createComment("100239d", "Plate: Program1", CodeUnit.PLATE_COMMENT);
builder.createComment("100239d", "Post: Program1", CodeUnit.POST_COMMENT);
// builder.createComment("100239d", "Plate: Program1", CommentType.PLATE);
builder.createComment("100239d", "Post: Program1", CommentType.POST);
builder.createComment("10030d2", "FUNCTION", CodeUnit.PLATE_COMMENT);
builder.createComment("10030d2", "FUNCTION", CommentType.PLATE);
builder.createComment("100355f", "This is a function.", CodeUnit.PLATE_COMMENT);
builder.createComment("100355f", "This is a function.", CommentType.PLATE);
builder.createComment("100415a", "This is my function", CodeUnit.PLATE_COMMENT);
builder.createComment("100415a", "This is my function", CommentType.PLATE);
// functions
DataType dt = new ByteDataType();
@ -333,54 +333,50 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
// comments
builder.createComment("100204c", "My multi-line plate\ncomment for program2.",
CodeUnit.PLATE_COMMENT);
CommentType.PLATE);
builder.createComment("100204c", "My multi-line pre\ncomment for program2.",
CodeUnit.PRE_COMMENT);
CommentType.PRE);
builder.createComment("100204c", "My multi-line EOL\ncomment for program2.",
CodeUnit.EOL_COMMENT);
CommentType.EOL);
builder.createComment("100204c", "My multi-line repeatable\ncomment for program2.",
CodeUnit.REPEATABLE_COMMENT);
CommentType.REPEATABLE);
builder.createComment("100204c", "My multi-line post\ncomment for program2.",
CodeUnit.POST_COMMENT);
CommentType.POST);
builder.createComment("100230d", "This is a simple comment for example.", CommentType.PRE);
builder.createComment("100230d", "This is a simple comment for example.", CommentType.EOL);
builder.createComment("100230d", "This is a simple comment for example.", CommentType.POST);
builder.createComment("100230d", "This is a simple comment for example.",
CodeUnit.PRE_COMMENT);
CommentType.REPEATABLE);
builder.createComment("100230d", "This is a simple comment for example.",
CodeUnit.EOL_COMMENT);
builder.createComment("100230d", "This is a simple comment for example.",
CodeUnit.POST_COMMENT);
builder.createComment("100230d", "This is a simple comment for example.",
CodeUnit.REPEATABLE_COMMENT);
builder.createComment("100230d", "This is a simple comment for example.",
CodeUnit.PLATE_COMMENT);
CommentType.PLATE);
builder.createComment("1002312", "My comment", CodeUnit.PRE_COMMENT);
builder.createComment("1002312", "My comment", CodeUnit.EOL_COMMENT);
builder.createComment("1002312", "My comment", CodeUnit.POST_COMMENT);
builder.createComment("1002312", "My comment", CodeUnit.PLATE_COMMENT);
builder.createComment("1002312", "My comment", CommentType.PRE);
builder.createComment("1002312", "My comment", CommentType.EOL);
builder.createComment("1002312", "My comment", CommentType.POST);
builder.createComment("1002312", "My comment", CommentType.PLATE);
builder.createComment("1002329", "Before the code unit", CodeUnit.PRE_COMMENT);
builder.createComment("1002329", "End of the line.", CodeUnit.EOL_COMMENT);
builder.createComment("1002329", "After the code unit", CodeUnit.POST_COMMENT);
builder.createComment("1002329", "PLATE", CodeUnit.PLATE_COMMENT);
builder.createComment("1002329", "Before the code unit", CommentType.PRE);
builder.createComment("1002329", "End of the line.", CommentType.EOL);
builder.createComment("1002329", "After the code unit", CommentType.POST);
builder.createComment("1002329", "PLATE", CommentType.PLATE);
builder.createComment("1002336", "TWO: Repeatable comment.", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002336", "TWO: Repeatable comment.", CommentType.REPEATABLE);
builder.createComment("1002346", "Easy", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002346", "Easy", CommentType.REPEATABLE);
builder.createComment("1002350", "Once upon a time...", CodeUnit.REPEATABLE_COMMENT);
builder.createComment("1002350", "Once upon a time...", CommentType.REPEATABLE);
builder.createComment("100238f", "EOL: Program2", CodeUnit.EOL_COMMENT);
builder.createComment("100238f", "EOL: Program2", CommentType.EOL);
builder.createComment("1002395", "Pre: Program2", CodeUnit.PRE_COMMENT);
builder.createComment("1002395", "Pre: Program2", CommentType.PRE);
// builder.createComment("100239d", "Plate: Program2", CodeUnit.PLATE_COMMENT);
builder.createComment("100239d", "Post: Program2", CodeUnit.POST_COMMENT);
// builder.createComment("100239d", "Plate: Program2", CommentType.PLATE);
builder.createComment("100239d", "Post: Program2", CommentType.POST);
builder.createComment("1002a91", "FUNCTION", CodeUnit.PLATE_COMMENT);
builder.createComment("1002a91", "FUNCTION", CommentType.PLATE);
builder.createComment("100415a", "This is my function for testing diff",
CodeUnit.PLATE_COMMENT);
builder.createComment("100415a", "This is my function for testing diff", CommentType.PLATE);
// functions
DataType dt = new ByteDataType();