mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-26 22:21:52 +00:00
GP-0: Fixing typo in getLeastSignificatBitInBaseRegister() method
(Closes #4255)
This commit is contained in:
parent
377c7cb3d4
commit
9ea0c38993
@ -642,7 +642,7 @@ public class SleighDebugLogger {
|
||||
String partialMatch = childMatchValue.hasValue() ? "" : "*";
|
||||
String matchStr = match.equals(actual) ? " Match"
|
||||
: (" Failed (=0x" + Long.toHexString(actual.longValue()) + ")");
|
||||
int msb = baseRegSize - reg.getLeastSignificatBitInBaseRegister() - 1;
|
||||
int msb = baseRegSize - reg.getLeastSignificantBitInBaseRegister() - 1;
|
||||
int lsb = msb - reg.getBitLength() + 1;
|
||||
append(partialMatch + reg.getName() + "(" + lsb + "," + msb + ") == 0x" +
|
||||
Long.toHexString(match.longValue()) + matchStr);
|
||||
@ -685,7 +685,7 @@ public class SleighDebugLogger {
|
||||
RegisterValue childActualValue = actualValue.getRegisterValue(reg);
|
||||
if (childActualValue.hasAnyValue()) {
|
||||
BigInteger actual = childActualValue.getUnsignedValueIgnoreMask();
|
||||
int msb = baseRegSize - reg.getLeastSignificatBitInBaseRegister() - 1;
|
||||
int msb = baseRegSize - reg.getLeastSignificantBitInBaseRegister() - 1;
|
||||
int lsb = msb - reg.getBitLength() + 1;
|
||||
append("Set " + reg.getName() + "(" + lsb + "," + msb + ") = 0x" +
|
||||
Long.toHexString(actual.longValue()) + "\n");
|
||||
@ -737,7 +737,7 @@ public class SleighDebugLogger {
|
||||
RegisterValue childActualValue = actualValue.getRegisterValue(reg);
|
||||
if (childActualValue.hasAnyValue()) {
|
||||
BigInteger actual = childActualValue.getUnsignedValueIgnoreMask();
|
||||
int msb = baseRegSize - reg.getLeastSignificatBitInBaseRegister() - 1;
|
||||
int msb = baseRegSize - reg.getLeastSignificantBitInBaseRegister() - 1;
|
||||
int lsb = msb - reg.getBitLength() + 1;
|
||||
|
||||
append(msg + reg.getName() + "(" + lsb + "," + msb + ") = 0x" +
|
||||
|
@ -83,7 +83,7 @@ public interface ProcessorContextView {
|
||||
RegisterValue childValue = value.getRegisterValue(reg);
|
||||
if (childValue.hasAnyValue()) {
|
||||
BigInteger v = childValue.getUnsignedValueIgnoreMask();
|
||||
int msb = baseRegSize - reg.getLeastSignificatBitInBaseRegister() - 1;
|
||||
int msb = baseRegSize - reg.getLeastSignificantBitInBaseRegister() - 1;
|
||||
int lsb = msb - reg.getBitLength() + 1;
|
||||
if (buf.length() != 0) {
|
||||
buf.append("\n");
|
||||
|
@ -366,7 +366,7 @@ public class Register implements java.io.Serializable, Comparable<Register> {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getLeastSignificatBitInBaseRegister() {
|
||||
public int getLeastSignificantBitInBaseRegister() {
|
||||
return leastSigBitInBaseRegister;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class RegisterValue {
|
||||
*/
|
||||
public RegisterValue(Register register) {
|
||||
this.register = register;
|
||||
startBit = (register.getLeastSignificatBitInBaseRegister());
|
||||
startBit = (register.getLeastSignificantBitInBaseRegister());
|
||||
endBit = startBit + register.getBitLength() - 1;
|
||||
byte[] mask = register.getBaseMask();
|
||||
bytes = new byte[mask.length * 2];
|
||||
@ -62,7 +62,7 @@ public class RegisterValue {
|
||||
public RegisterValue(Register register, BigInteger value) {
|
||||
this.register = register;
|
||||
byte[] mask = register.getBaseMask();
|
||||
startBit = register.getLeastSignificatBitInBaseRegister();
|
||||
startBit = register.getLeastSignificantBitInBaseRegister();
|
||||
endBit = startBit + register.getBitLength() - 1;
|
||||
value = value.shiftLeft(startBit);
|
||||
byte[] valueBytes = value.toByteArray();
|
||||
@ -118,7 +118,7 @@ public class RegisterValue {
|
||||
this.register = register;
|
||||
this.bytes = adjustBytes(register.getBaseRegister(), bytes);
|
||||
applyRegisterMask(register.getBaseMask());
|
||||
startBit = register.getLeastSignificatBitInBaseRegister();
|
||||
startBit = register.getLeastSignificantBitInBaseRegister();
|
||||
endBit = startBit + register.getBitLength() - 1;
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ public class InstructionUtils {
|
||||
if (childActualValue.hasAnyValue()) {
|
||||
int pad = paddedLen - reg.getName().length();
|
||||
BigInteger actual = childActualValue.getUnsignedValueIgnoreMask();
|
||||
int msb = baseRegSize - reg.getLeastSignificatBitInBaseRegister() - 1;
|
||||
int msb = baseRegSize - reg.getLeastSignificantBitInBaseRegister() - 1;
|
||||
int lsb = msb - reg.getBitLength() + 1;
|
||||
if (buf.length() != 0) {
|
||||
buf.append("\n");
|
||||
|
@ -333,8 +333,8 @@ public abstract class LanguageTranslatorAdapter implements LanguageTranslator {
|
||||
}
|
||||
|
||||
protected boolean isSameRegisterConstruction(Register oldReg, Register newReg) {
|
||||
if (oldReg.getLeastSignificatBitInBaseRegister() != newReg
|
||||
.getLeastSignificatBitInBaseRegister() ||
|
||||
if (oldReg.getLeastSignificantBitInBaseRegister() != newReg
|
||||
.getLeastSignificantBitInBaseRegister() ||
|
||||
oldReg.getBitLength() != newReg.getBitLength()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ public class OldLanguageFactory {
|
||||
Element fieldElement = new Element("field");
|
||||
fieldElement.setAttribute("name", bitReg.getName());
|
||||
int fieldBitLength = bitReg.getBitLength();
|
||||
int lsb = bitReg.getLeastSignificatBitInBaseRegister();
|
||||
int lsb = bitReg.getLeastSignificantBitInBaseRegister();
|
||||
int msb = lsb + fieldBitLength - 1;
|
||||
|
||||
// Transpose bit numbering to agree with Sleigh context bit numbering
|
||||
|
Loading…
Reference in New Issue
Block a user