From a19d8047bc4547819cc68af2e8e55db8c5f8e583 Mon Sep 17 00:00:00 2001 From: clc5q <clc5q@git.zephyr-software.com> Date: Tue, 19 May 2015 16:23:32 +0000 Subject: [PATCH] Fix hex constant output on SPARK translation. Former-commit-id: 88746c24a79d19213db7da705076a54cb3edb20d --- include/base/SMPInstr.h | 1 - src/base/SMPInstr.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/base/SMPInstr.h b/include/base/SMPInstr.h index 9b72fc8a..39189f3e 100644 --- a/include/base/SMPInstr.h +++ b/include/base/SMPInstr.h @@ -43,7 +43,6 @@ #include "base/SMPDataFlowAnalysis.h" #include "interfaces/abstract/STARSInstruction.h" -//#include "interfaces/idapro/STARSInstruction.h" class SMPProgram; diff --git a/src/base/SMPInstr.cpp b/src/base/SMPInstr.cpp index ca812f63..85da0945 100644 --- a/src/base/SMPInstr.cpp +++ b/src/base/SMPInstr.cpp @@ -342,10 +342,10 @@ void SMPInstr::PrintSPARKAdaOperand(const STARSOpndTypePtr &Opnd, FILE *OutFile, if (Opnd->HasSIBByte()) { SMP_fprintf(OutFile, " %s ", MemWriteString); SPARKAnnotPrintSIB(Opnd, true, OutFile, Opnd->GetSegReg(), UseFP); - SMP_fprintf(OutFile, " + %llx )", (unsigned long long) Opnd->GetAddr()); + SMP_fprintf(OutFile, " + 16\#%llx\# )", (unsigned long long) Opnd->GetAddr()); } else { - SMP_fprintf(OutFile, " %s %llx ", MemWriteString, (unsigned long long) Opnd->GetAddr()); + SMP_fprintf(OutFile, " %s 16\#%llx\# ", MemWriteString, (unsigned long long) Opnd->GetAddr()); } if (SubwordWidth) { ++SubwordMemCount; @@ -429,7 +429,7 @@ void SMPInstr::PrintSPARKAdaOperand(const STARSOpndTypePtr &Opnd, FILE *OutFile, SMP_fprintf(OutFile, " %ld ", (long) Opnd->GetImmedValue()); } else if (Opnd->IsFarPointer() || Opnd->IsNearPointer()) { - SMP_fprintf(OutFile, " %lx ", (unsigned long) Opnd->GetAddr()); + SMP_fprintf(OutFile, " 16\#%llx\# ", (unsigned long long) Opnd->GetAddr()); } else { SMP_fprintf(OutFile, " ERROROP"); -- GitLab