arch-arm: disassemble member variable not used by TarmacParser

We move it to the child class which is what the TarmacTracer
actually uses.

Change-Id: Ia30892723d2e1f7306dae87c6c9c1d69d00ad73d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Giacomo Travaglini
2023-09-22 12:48:14 +01:00
parent 237bbf0e42
commit 81b6e296dd
4 changed files with 10 additions and 8 deletions

View File

@@ -68,7 +68,6 @@ TarmacBaseRecord::InstEntry::InstEntry(
: taken(predicate) ,
addr(pc.instAddr()) ,
opcode(staticInst->getEMI() & 0xffffffff),
disassemble(staticInst->disassemble(addr)),
isetstate(pcToISetState(pc)),
mode(MODE_USER)
{
@@ -76,11 +75,6 @@ TarmacBaseRecord::InstEntry::InstEntry(
// Operating mode gained by reading the architectural register (CPSR)
const CPSR cpsr = thread->readMiscRegNoEffect(MISCREG_CPSR);
mode = (OperatingMode) (uint8_t)cpsr.mode;
// In Tarmac, instruction names are printed in capital
// letters.
std::for_each(disassemble.begin(), disassemble.end(),
[](char& c) { c = toupper(c); });
}
TarmacBaseRecord::RegEntry::RegEntry(const PCStateBase &pc)

View File

@@ -93,7 +93,6 @@ class TarmacBaseRecord : public InstRecord
bool taken;
Addr addr;
ArmISA::MachInst opcode;
std::string disassemble;
ISetState isetstate;
ArmISA::OperatingMode mode;
};

View File

@@ -123,7 +123,8 @@ TarmacTracerRecord::TarmacTracerRecord(Tick _when, ThreadContext *_thread,
TarmacTracerRecord::TraceInstEntry::TraceInstEntry(
const TarmacContext& tarmCtx,
bool predicate)
: InstEntry(tarmCtx.thread, *tarmCtx.pc, tarmCtx.staticInst, predicate)
: InstEntry(tarmCtx.thread, *tarmCtx.pc, tarmCtx.staticInst, predicate),
disassemble(tarmCtx.staticInst->disassemble(addr))
{
secureMode = isSecure(tarmCtx.thread);
@@ -140,6 +141,11 @@ TarmacTracerRecord::TraceInstEntry::TraceInstEntry(
// for 16bit (Thumb) instruction.
opcode = arm_inst->encoding();
// In Tarmac, instruction names are printed in capital
// letters.
std::for_each(disassemble.begin(), disassemble.end(),
[](char& c) { c = toupper(c); });
// Update the instruction count: number of executed
// instructions.
instCount++;

View File

@@ -115,6 +115,9 @@ class TarmacTracerRecord : public TarmacBaseRecord
* 32 otherwise (ARM and BigThumb)
*/
uint8_t instSize;
/** Instruction disassembly */
std::string disassemble;
};
/** Register Entry */