mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
fixing memBlock problem after join
This commit is contained in:
parent
0aa413c956
commit
8bc95794e6
2 changed files with 10 additions and 1 deletions
|
@ -72,6 +72,7 @@ public class MemoryBlockDB implements MemoryBlock {
|
|||
}
|
||||
length = lRecord.getLongValue(MemoryMapDBAdapter.LENGTH_COL);
|
||||
lastSubBlock = null;
|
||||
Collections.sort(list);
|
||||
subBlocks = list;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import ghidra.program.model.mem.*;
|
|||
* Interface for the various types of memory block sections. They are used by a {@link MemoryBlockDB}
|
||||
* to do the actual storing and fetching of the bytes that make up a MemoryBlock
|
||||
*/
|
||||
abstract class SubMemoryBlock {
|
||||
abstract class SubMemoryBlock implements Comparable<SubMemoryBlock> {
|
||||
|
||||
protected final MemoryMapDBAdapter adapter;
|
||||
protected final Record record;
|
||||
|
@ -249,4 +249,12 @@ abstract class SubMemoryBlock {
|
|||
protected abstract ByteSourceRangeList getByteSourceRangeList(MemoryBlock block, Address start,
|
||||
long memBlockOffset, long size);
|
||||
|
||||
@Override
|
||||
public int compareTo(SubMemoryBlock o) {
|
||||
long result = getStartingOffset() - o.getStartingOffset();
|
||||
if (result == 0) {
|
||||
return 0;
|
||||
}
|
||||
return result > 0 ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue