mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch
'origin/GP-3260_ghidra1_ElfMipsRelocs--SQUASHED' (Closes #5160) Conflicts: Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/extension/datatype/finder/DecompilerReference.java
This commit is contained in:
commit
d0e28a7036
12 changed files with 271 additions and 245 deletions
|
@ -18,6 +18,7 @@ package ghidra.program.database.references;
|
|||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.model.symbol.*;
|
||||
import ghidra.util.NumericUtilities;
|
||||
|
||||
class OffsetReferenceDB extends MemReferenceDB implements OffsetReference {
|
||||
|
||||
|
@ -58,7 +59,8 @@ class OffsetReferenceDB extends MemReferenceDB implements OffsetReference {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " Offset: 0x" + Long.toHexString(offsetOrShift);
|
||||
String offsetStr = NumericUtilities.toSignedHexString(offsetOrShift);
|
||||
return super.toString() + " Offset: " + offsetStr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -114,7 +114,12 @@ public class ComponentOffsetSettingsDefinition
|
|||
public String getAttributeSpecification(Settings settings) {
|
||||
if (hasValue(settings)) {
|
||||
long offset = getValue(settings);
|
||||
return "offset(0x" + Long.toHexString(offset) + ")";
|
||||
String sign = "";
|
||||
if (offset < 0) {
|
||||
offset = -offset;
|
||||
sign = "-";
|
||||
}
|
||||
return "offset(" + sign + "0x" + Long.toHexString(offset) + ")";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -184,6 +184,16 @@ public class Relocation {
|
|||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of original instruction bytes affected by applied relocation.
|
||||
*
|
||||
* @return number of original instruction bytes affected by relocation if it was successfully applied
|
||||
* (i.e., {@link Status#APPLIED}, {@link Status#APPLIED_OTHER}), otherwise null may be returned.
|
||||
*/
|
||||
public int getLength() {
|
||||
return bytes != null ? bytes.length : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the symbol being relocated or <code>null</code> if there is no symbol name.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue