### Question:
GnuDemangler implements Demangler { @Override @Deprecated(since = "9.2", forRemoval = true) public DemangledObject demangle(String mangled, boolean demangleOnlyKnownPatterns) throws DemangledException { GnuDemanglerOptions options = new GnuDemanglerOptions(); options.setDemangleOnlyKnownPatterns(demangleOnlyKnownPatterns); return demangle(mangled, options); } GnuDemangler(); @Override DemanglerOptions createDefaultOptions(); @Override boolean canDemangle(Program program); @Override @Deprecated(since = "9.2", forRemoval = true) DemangledObject demangle(String mangled, boolean demangleOnlyKnownPatterns); @Override DemangledObject demangle(String mangled, DemanglerOptions demanglerOtions);  }### Answer:
@Test public void testDemangleTypeInfo() throws Exception { String mangled = "_ZTIN6AP_HAL3HAL9CallbacksE"; program.startTransaction("markup..."); program.getMemory().setInt(addr("01001000"), 0x1001010); SymbolTable symbolTable = program.getSymbolTable(); symbolTable.createLabel(addr("01001000"), mangled, SourceType.IMPORTED); GnuDemangler demangler = new GnuDemangler(); DemangledObject obj = demangler.demangle(mangled); assertNotNull(obj); assertTrue( obj.applyTo(program, addr("01001000"), new GnuDemanglerOptions(), TaskMonitor.DUMMY)); Symbol s = symbolTable.getPrimarySymbol(addr("01001000")); assertNotNull(s); assertEquals("typeinfo", s.getName()); assertEquals("AP_HAL::HAL::Callbacks", s.getParentNamespace().getName(true)); assertEquals("typeinfo for AP_HAL::HAL::Callbacks", program.getListing().getComment(CodeUnit.PLATE_COMMENT, addr("01001000"))); Data d = program.getListing().getDefinedDataAt(addr("01001000")); assertNotNull(d); assertTrue(d.isPointer()); }
@Test public void testDemangleTypeInfoName() throws Exception { String mangled = "_ZTSN6AP_HAL3HAL9CallbacksE"; program.startTransaction("markup..."); program.getMemory().setBytes(addr("01001000"), "ABC\0".getBytes()); SymbolTable symbolTable = program.getSymbolTable(); symbolTable.createLabel(addr("01001000"), mangled, SourceType.IMPORTED); GnuDemangler demangler = new GnuDemangler(); DemangledObject obj = demangler.demangle(mangled); assertNotNull(obj); assertEquals("typeinfo name for AP_HAL::HAL::Callbacks", obj.getSignature(false)); assertTrue( obj.applyTo(program, addr("01001000"), new GnuDemanglerOptions(), TaskMonitor.DUMMY)); Symbol s = symbolTable.getPrimarySymbol(addr("01001000")); assertNotNull(s); assertEquals("typeinfo-name", s.getName()); assertEquals("AP_HAL::HAL::Callbacks", s.getParentNamespace().getName(true)); assertEquals("typeinfo name for AP_HAL::HAL::Callbacks", program.getListing().getComment(CodeUnit.PLATE_COMMENT, addr("01001000"))); Data d = program.getListing().getDefinedDataAt(addr("01001000")); assertNotNull(d); assertTrue(d.getDataType() instanceof TerminatedStringDataType); assertEquals("ABC", d.getValue()); }