mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-23 20:52:03 +00:00
Merge remote-tracking branch 'origin/GP-5014_ghizard_MDMang_add_tests_for_vxtable_parentage_coded_as_backref'
This commit is contained in:
commit
9d67b8c6ef
@ -4655,6 +4655,15 @@ public class MDMangBaseTest extends AbstractGenericTest {
|
||||
demangleAndTest();
|
||||
}
|
||||
|
||||
// Backref used in parentage
|
||||
@Test
|
||||
public void testUnderscore7f() throws Exception {
|
||||
mangled = "??_7a@b@@6B01@@";
|
||||
msTruth = "const b::a::`vftable'{for `b::a'}";
|
||||
mdTruth = msTruth;
|
||||
demangleAndTest();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSpecialNames_R() throws Exception {
|
||||
mangled = "??_R0X@8";
|
||||
|
@ -56,6 +56,28 @@ public class MDMangExtraTest extends AbstractGenericTest {
|
||||
assertEquals("k::j::i", qualifications.get(2).toString());
|
||||
}
|
||||
|
||||
// Backref used in parentage
|
||||
@Test
|
||||
public void testVxTableNestedQualificationWithBackref() throws Exception {
|
||||
String mangled = "??_7a@b@@6B01@@";
|
||||
String truth = "const b::a::`vftable'{for `b::a'}";
|
||||
|
||||
MDMangGhidra demangler = new MDMangGhidra();
|
||||
demangler.setMangledSymbol(mangled);
|
||||
demangler.setErrorOnRemainingChars(true);
|
||||
demangler.setDemangleOnlyKnownPatterns(true);
|
||||
MDParsableItem item = demangler.demangle();
|
||||
|
||||
String demangled = item.toString();
|
||||
assertEquals(truth, demangled);
|
||||
|
||||
MDObjectCPP cppItem = (MDObjectCPP) item;
|
||||
MDVxTable vxTable = (MDVxTable) cppItem.getTypeInfo();
|
||||
List<MDQualification> qualifications = vxTable.getNestedQualifications();
|
||||
assertEquals(1, qualifications.size());
|
||||
assertEquals("b::a", qualifications.get(0).toString());
|
||||
}
|
||||
|
||||
// Need to test the demangleType() method to make sure it does the retry with LLVM mode
|
||||
@Test
|
||||
public void testDemangleTypeWithRetry() throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user