mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-5480 Corrected Merge tool rendering of external locations within
multi-listing.
This commit is contained in:
parent
7b9183b2db
commit
905b4d78bd
4 changed files with 26 additions and 22 deletions
|
@ -106,7 +106,6 @@ public class ProgramMultiUserMergeManager extends MergeManager {
|
|||
ListingMergeManager listingMergeManager =
|
||||
new ListingMergeManager(this, resultProgram, originalProgram, latestProgram, myProgram,
|
||||
(ProgramChangeSet) latestChangeSet, (ProgramChangeSet) myChangeSet);
|
||||
listingMergeManager.setShowListingPanel(showListingPanels);
|
||||
mergeResolvers[idx++] = listingMergeManager;
|
||||
|
||||
mergeResolvers[idx++] =
|
||||
|
@ -406,6 +405,15 @@ public class ProgramMultiUserMergeManager extends MergeManager {
|
|||
return isShowingListingMergePanel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the listing panels should be rendered.
|
||||
* NOTE: This is provided for testing performance reasons only.
|
||||
* @return true if listing panels should be rendered
|
||||
*/
|
||||
public boolean isShowListingPanel() {
|
||||
return showListingPanels;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MergeNavigatable implements Navigatable {
|
||||
|
|
|
@ -130,7 +130,6 @@ public class ListingMergeManager implements MergeResolver, ListingMergeConstants
|
|||
|
||||
private int totalConflictsInPhase; // Total number of conflicts for current phase of listing.
|
||||
private int conflictNum; // Current conflict number being resolved.
|
||||
private boolean showListingPanel = true;
|
||||
|
||||
/**
|
||||
* Manages listing changes and conflicts between the latest versioned
|
||||
|
@ -160,14 +159,6 @@ public class ListingMergeManager implements MergeResolver, ListingMergeConstants
|
|||
return functionTagMerger;
|
||||
}
|
||||
|
||||
/**
|
||||
* True signals to show the listing panel (default); false signals to show an empty listing (faster)
|
||||
* @param showListingPanel
|
||||
*/
|
||||
public void setShowListingPanel(boolean showListingPanel) {
|
||||
this.showListingPanel = showListingPanel;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see ghidra.app.merge.MergeResolver#apply()
|
||||
*/
|
||||
|
@ -512,7 +503,8 @@ public class ListingMergeManager implements MergeResolver, ListingMergeConstants
|
|||
* determine conflicts. The conflicts are handled later by calling manualMerge().
|
||||
*/
|
||||
private void initializeMergers() {
|
||||
externalFunctionMerger = new ExternalFunctionMerger(this, showListingPanel);
|
||||
externalFunctionMerger =
|
||||
new ExternalFunctionMerger(this, mergeManager.isShowListingPanel());
|
||||
cuMerge = new CodeUnitMerger(this);
|
||||
functionMerger = new FunctionMerger(this);
|
||||
symbolMerger = new SymbolMerger(this);
|
||||
|
@ -632,8 +624,8 @@ public class ListingMergeManager implements MergeResolver, ListingMergeConstants
|
|||
*/
|
||||
public AddressSet getMergedCodeUnits() {
|
||||
if (mergeManager != null) {
|
||||
return (AddressSet) mergeManager.getResolveInformation(
|
||||
MergeConstants.RESOLVED_CODE_UNITS);
|
||||
return (AddressSet) mergeManager
|
||||
.getResolveInformation(MergeConstants.RESOLVED_CODE_UNITS);
|
||||
}
|
||||
return new AddressSet();
|
||||
}
|
||||
|
|
|
@ -156,7 +156,6 @@ public class LabelFieldFactory extends FieldFactory {
|
|||
|
||||
// check to see if there is an offcut reference to this code unit
|
||||
// if there is, then create a "OFF" label
|
||||
//
|
||||
List<Address> offcuts = getOffcutReferenceAddress(cu);
|
||||
boolean hasOffcuts = offcuts.size() > 0;
|
||||
|
||||
|
@ -269,11 +268,16 @@ public class LabelFieldFactory extends FieldFactory {
|
|||
|
||||
private List<Address> getOffcutReferenceAddress(CodeUnit cu) {
|
||||
|
||||
Address startAddr = cu.getMinAddress();
|
||||
if (!startAddr.isMemoryAddress()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Program prog = cu.getProgram();
|
||||
if (cu.getLength() == 1) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Address nextAddr = cu.getMinAddress().next();
|
||||
Address nextAddr = startAddr.next();
|
||||
if (nextAddr == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ public class SimpleDiffUtility {
|
|||
else if (addr.isExternalAddress()) {
|
||||
Symbol s = program.getSymbolTable().getPrimarySymbol(addr);
|
||||
if (s != null && s.isExternal()) {
|
||||
s = getSymbol(s, otherProgram);
|
||||
s = getMatchingExternalSymbol(program, s, otherProgram, null);
|
||||
if (s != null) {
|
||||
return s.getAddress();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue