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