mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-3260 Corrected MIPS relocation issues and a few related issues affecting listing markup
This commit is contained in:
parent
acb07dd535
commit
836604e09d
12 changed files with 266 additions and 235 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