mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-25 13:42:06 +00:00
review fixes
This commit is contained in:
parent
57e2171dd4
commit
265e010273
@ -99,17 +99,14 @@ public class MemoryBlockSourceInfo {
|
||||
|
||||
/**
|
||||
* Returns the offset into the {@link FileBytes} object for the given address or
|
||||
* -1 if this SourceInfo does not have an associated {@link FileBytes} or the address doesn't
|
||||
* belong to this SourceInfo.
|
||||
* -1 if this MemoryBlockSourceInfo does not have an associated {@link FileBytes} or the address doesn't
|
||||
* belong to this MemoryBlockSourceInfo.
|
||||
*
|
||||
* @param address the address for which to get an offset into the {@link FileBytes} object.
|
||||
* @return the offset into the {@link FileBytes} object for the given address.
|
||||
*/
|
||||
public long getFileBytesOffset(Address address) {
|
||||
if (!contains(address)) {
|
||||
return -1;
|
||||
}
|
||||
if (subBlock instanceof FileBytesSubMemoryBlock) {
|
||||
if (subBlock instanceof FileBytesSubMemoryBlock && contains(address)) {
|
||||
long blockOffset = address.subtract(getMinAddress());
|
||||
long subBlockOffset = blockOffset - subBlock.startingOffset;
|
||||
return ((FileBytesSubMemoryBlock) subBlock).getFileBytesOffset() + subBlockOffset;
|
||||
|
@ -752,8 +752,9 @@ public interface Memory extends AddressSetView {
|
||||
|
||||
/**
|
||||
* Returns information ({@link AddressSourceInfo}) about the byte source at the given address.
|
||||
* @param address the address to query.
|
||||
* @return information ({@link AddressSourceInfo}) about the byte source at the given address.
|
||||
* @param address the address to query. Returns null if the address is not in memory.
|
||||
* @return information ({@link AddressSourceInfo}) about the byte source at the given address or
|
||||
* null if the address is not in memory.
|
||||
*/
|
||||
public AddressSourceInfo getAddressSourceInfo(Address address);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user