diff --git a/runtime/vm/compiler/ffi/abi.cc b/runtime/vm/compiler/ffi/abi.cc index 01cf0ca835a..ec21818fc1e 100644 --- a/runtime/vm/compiler/ffi/abi.cc +++ b/runtime/vm/compiler/ffi/abi.cc @@ -92,19 +92,23 @@ static_assert(offsetof(AbiAlignmentUint64, i) == 8, #error Unknown arch #endif +#if defined(USING_SIMULATOR) +#define ABI_ENUM_VALUE3 kNone +const char* target_abi_name = "none"; +#else #define ABI_ENUM_VALUE1(os, arch) k##os##arch #define ABI_ENUM_VALUE2(os, arch) ABI_ENUM_VALUE1(os, arch) #define ABI_ENUM_VALUE3 ABI_ENUM_VALUE2(DART_TARGET_OS_NAME, TARGET_ARCH_NAME) +#define STRINGIFY2(s) STRINGIFY(s) +#define STRINGIFY(s) #s +const char* target_abi_name = + STRINGIFY2(DART_TARGET_OS_NAME_LC) "_" STRINGIFY2(TARGET_ARCH_NAME_LC); +#endif Abi TargetAbi() { return Abi::ABI_ENUM_VALUE3; } -#define STRINGIFY2(s) STRINGIFY(s) -#define STRINGIFY(s) #s - -const char* target_abi_name = - STRINGIFY2(DART_TARGET_OS_NAME_LC) "_" STRINGIFY2(TARGET_ARCH_NAME_LC); } // namespace ffi diff --git a/runtime/vm/compiler/ffi/abi.h b/runtime/vm/compiler/ffi/abi.h index b693ef85255..6684a747a9a 100644 --- a/runtime/vm/compiler/ffi/abi.h +++ b/runtime/vm/compiler/ffi/abi.h @@ -40,6 +40,8 @@ enum class Abi { kWindowsArm64, kWindowsIA32, kWindowsX64, + + kNone, // E.g., simulators. }; const int64_t num_abis = static_cast(Abi::kWindowsX64) + 1; diff --git a/runtime/vm/simulator_riscv.cc b/runtime/vm/simulator_riscv.cc index 937c314875d..f457041949d 100644 --- a/runtime/vm/simulator_riscv.cc +++ b/runtime/vm/simulator_riscv.cc @@ -1601,9 +1601,10 @@ void Simulator::InterpretECALL(Instr instr) { // Fake instruction generated by Assembler::SimulatorPrintObject. if (true || IsTracingExecution()) { uintx_t raw = get_xreg(instr.rs1()); - Object& obj = Object::Handle(static_cast(raw)); - THR_Print("%" Px ": %s = %s\n", pc_, cpu_reg_names[instr.rs1()], - obj.ToCString()); + Object& obj = + Object::Handle(static_cast(static_cast(raw))); + THR_Print("%" Px ": %s = %s\n", static_cast(pc_), + cpu_reg_names[instr.rs1()], obj.ToCString()); FLAG_trace_sim_after = 1; } pc_ += instr.length();