mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GP-385: Prevent re-goto-PC on memory bytes change
This commit is contained in:
parent
592edd3843
commit
6bbacbc3f9
1 changed files with 15 additions and 0 deletions
|
@ -295,6 +295,8 @@ public class DebuggerListingProvider extends CodeViewerProvider {
|
|||
|
||||
protected final boolean isMainListing;
|
||||
|
||||
private long countAddressesInIndex;
|
||||
|
||||
public DebuggerListingProvider(DebuggerListingPlugin plugin, FormatManager formatManager,
|
||||
boolean isConnected) {
|
||||
super(plugin, formatManager, isConnected);
|
||||
|
@ -722,6 +724,19 @@ public class DebuggerListingProvider extends CodeViewerProvider {
|
|||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
super.stateChanged(e);
|
||||
/*
|
||||
* It seems this method gets called a bit spuriously. A change in bytes, which does not
|
||||
* imply a change in layout, will also land us here. Thus, we do some simple test here to
|
||||
* verify that the layout has actually changed. A good proxy is if the number of addresses
|
||||
* in the listing has changed. To detect that, we have to record what we've seen each
|
||||
* change.
|
||||
*/
|
||||
long newCountAddressesInIndex =
|
||||
getListingPanel().getAddressIndexMap().getIndexedAddressSet().getNumAddresses();
|
||||
if (this.countAddressesInIndex == newCountAddressesInIndex) {
|
||||
return;
|
||||
}
|
||||
this.countAddressesInIndex = newCountAddressesInIndex;
|
||||
ProgramLocation trackedLocation = trackingTrait.getTrackedLocation();
|
||||
if (trackedLocation != null && !isEffectivelyDifferent(getLocation(), trackedLocation)) {
|
||||
cbGoTo.invoke(() -> getListingPanel().goTo(trackedLocation, true));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue