From 7e314624d7b7172cef27cabe6c754f0bea3dc45c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 12 Apr 2021 22:45:19 +0200 Subject: [PATCH] Print state_ in symbolic form. --- src/kernel/activity/ActivityImpl.cpp | 2 +- src/s4u/s4u_Exec.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kernel/activity/ActivityImpl.cpp b/src/kernel/activity/ActivityImpl.cpp index c6c864b6f7..3ce0954a7b 100644 --- a/src/kernel/activity/ActivityImpl.cpp +++ b/src/kernel/activity/ActivityImpl.cpp @@ -65,7 +65,7 @@ bool ActivityImpl::test() void ActivityImpl::wait_for(actor::ActorImpl* issuer, double timeout) { - XBT_DEBUG("Wait for execution of synchro %p, state %d", this, (int)state_); + XBT_DEBUG("Wait for execution of synchro %p, state %s", this, to_c_str(state_)); xbt_assert(std::isfinite(timeout), "timeout is not finite!"); /* Associate this simcall to the synchro */ diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 0fe8c0ae59..192b8d2a4d 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -183,7 +183,7 @@ unsigned int Exec::get_host_number() const ExecPtr Exec::set_host(Host* host) { xbt_assert(state_ == State::INITED || state_ == State::STARTING || state_ == State::STARTED, - "Cannot change the host of an exec once it's done (state: %d)", (int)state_); + "Cannot change the host of an exec once it's done (state: %s)", to_c_str(state_)); if (state_ == State::STARTED) boost::static_pointer_cast(pimpl_)->migrate(host); @@ -201,7 +201,7 @@ ExecPtr Exec::set_host(Host* host) ExecPtr Exec::set_hosts(const std::vector& hosts) { xbt_assert(state_ == State::INITED || state_ == State::STARTING, - "Cannot change the hosts of an exec once it's done (state: %d)", (int)state_); + "Cannot change the hosts of an exec once it's done (state: %s)", to_c_str(state_)); kernel::actor::simcall( [this, hosts] { boost::static_pointer_cast(pimpl_)->set_hosts(hosts); }); -- 2.20.1