mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-21 13:32:44 +08:00
Merge remote-tracking branch 'origin/GP-5480_ghidra1_MergeExternalLocations'
This commit is contained in:
+11
-3
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -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 {
|
||||
|
||||
+6
-14
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
+6
-2
@@ -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();
|
||||
}
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user