@Test public void testAddLabelAtFunction() throws Exception { Function function = getTestFunction(); int transactionID = notepad.startTransaction("test"); try { function.setName("joe", SourceType.ANALYSIS); } finally { notepad.endTransaction(transactionID, true); } AddLabelCmd cmd = new AddLabelCmd(addr(0x0), "fred", SourceType.USER_DEFINED); execute(cmd); Symbol symbol = getUniqueSymbol(notepad, "fred", null); assertNotNull(symbol); assertEquals(SymbolType.CODE, symbol.getSymbolType()); SetLabelPrimaryCmd c = new SetLabelPrimaryCmd(symbol.getAddress(), "fred", symbol.getParentNamespace()); execute(c); symbol = getUniqueSymbol(notepad, "fred", null); assertEquals(SymbolType.FUNCTION, symbol.getSymbolType()); assertTrue(symbol.isPrimary()); assertEquals(SourceType.USER_DEFINED, symbol.getSource()); function = notepad.getFunctionManager().getFunctionAt(addr(0x0)); assertEquals("fred", function.getName()); Symbol other = getUniqueSymbol(notepad, "joe", null); assertNotNull(other); assertEquals(SourceType.ANALYSIS, other.getSource()); }
@Override public String getName() { return "Add Label"; }
AddLabelCmd implements Command { @Override public String getName() { return "Add Label"; } }
AddLabelCmd implements Command { @Override public String getName() { return "Add Label"; } AddLabelCmd(Address addr, String name, Namespace namespace, SourceType source);  AddLabelCmd(Address addr, String name, boolean useLocalNamespace, SourceType source);  AddLabelCmd(Address addr, String name, SourceType source); }
AddLabelCmd implements Command { @Override public String getName() { return "Add Label"; } AddLabelCmd(Address addr, String name, Namespace namespace, SourceType source);  AddLabelCmd(Address addr, String name, boolean useLocalNamespace, SourceType source);  AddLabelCmd(Address addr, String name, SourceType source); @Override boolean applyTo(DomainObject obj); @Override String getStatusMsg(); @Override String getName(); String getLabelName(); Address getLabelAddr(); void setLabelAddr(Address addr); void setLabelName(String name); void setNamespace(Namespace namespace); Symbol getSymbol(); }
AddLabelCmd implements Command { @Override public String getName() { return "Add Label"; } AddLabelCmd(Address addr, String name, Namespace namespace, SourceType source);  AddLabelCmd(Address addr, String name, boolean useLocalNamespace, SourceType source);  AddLabelCmd(Address addr, String name, SourceType source); @Override boolean applyTo(DomainObject obj); @Override String getStatusMsg(); @Override String getName(); String getLabelName(); Address getLabelAddr(); void setLabelAddr(Address addr); void setLabelName(String name); void setNamespace(Namespace namespace); Symbol getSymbol();  }