#include <algorithm>
#include <climits>
-#include <xbt/ex.hpp>
#include "s4u-peer.hpp"
#include "s4u-tracker.hpp"
#include "simgrid/s4u.hpp"
#include <string>
#include <xbt/RngStream.h>
-#include <xbt/ex.hpp>
#include <xbt/str.h>
#define MAX_SIMULATION_TIME 1000
#include "simgrid/plugins/energy.h"
#include <simgrid/s4u.hpp>
-#include <xbt/ex.hpp>
-#include <xbt/log.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_energyptask, "Messages specific for this s4u example");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/s4u.hpp"
-#include "xbt/ex.hpp"
#include "xbt/str.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
#include "simgrid/s4u.hpp"
#include "simgrid/simdag.h"
-#include "xbt/ex.h"
-#include "xbt/log.h"
+
#include <cmath>
#include <set>
-#include <xbt/ex.hpp>
XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test, "Logging specific to this SimDag example");
*/
#include <exception>
+#include <simgrid/exception.hpp>
+#include <stdexcept>
+#include <xbt/exception.hpp>
+
+#include <xbt/ex.h>
namespace simgrid {
};
/** Exception raised when something got canceled before completion */
-class cancel_error : public simgrid::exception {
+class canceled_error : public simgrid::exception {
};
} // namespace simgrid
+/** A legacy exception
+ *
+ * It is defined by a category and a value within that category (as well as
+ * an optional error message).
+ *
+ * This used to be a structure for C exceptions but it has been retrofitted
+ * as a C++ exception and some of its data has been moved in the
+ * @ref WithContextException base class. We should deprecate it and replace it
+ * with either C++ different exceptions or `std::system_error` which already
+ * provides this (category + error code) logic.
+ *
+ * @ingroup XBT_ex_c
+ */
+class XBT_PUBLIC xbt_ex : public simgrid::exception, public simgrid::xbt::WithContextException {
+public:
+ xbt_ex() : simgrid::exception() {}
+
+ /**
+ *
+ * @param throwpoint Throw point (use XBT_THROW_POINT)
+ * @param message Exception message
+ */
+ xbt_ex(simgrid::xbt::ThrowPoint throwpoint, const char* message)
+ : simgrid::exception(message), simgrid::xbt::WithContextException(throwpoint, simgrid::xbt::backtrace())
+ {
+ }
+
+ ~xbt_ex(); // DO NOT define it here -- see ex.cpp for a rationale
+
+ /** Category (what went wrong) */
+ xbt_errcat_t category = unknown_error;
+
+ /** Why did it went wrong */
+ int value = 0;
+};
+
#endif
#include <simgrid/s4u/NetZone.hpp>
#include <simgrid/s4u/Storage.hpp>
+#include <simgrid/exception.hpp>
+
#endif /* SIMGRID_S4U_S4U_H */
+++ /dev/null
-/* Copyright (c) 2005-2018. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_XBT_EX_HPP
-#define SIMGRID_XBT_EX_HPP
-
-#include <simgrid/exception.hpp>
-#include <stdexcept>
-#include <xbt/exception.hpp>
-
-#include <xbt/ex.h>
-
-/** A legacy exception
- *
- * It is defined by a category and a value within that category (as well as
- * an optional error message).
- *
- * This used to be a structure for C exceptions but it has been retrofitted
- * as a C++ exception and some of its data has been moved in the
- * @ref WithContextException base class. We should deprecate it and replace it
- * with either C++ different exceptions or `std::system_error` which already
- * provides this (category + error code) logic.
- *
- * @ingroup XBT_ex_c
- */
-class XBT_PUBLIC xbt_ex : public simgrid::exception, public simgrid::xbt::WithContextException {
-public:
- xbt_ex() : simgrid::exception() {}
-
- /**
- *
- * @param throwpoint Throw point (use XBT_THROW_POINT)
- * @param message Exception message
- */
- xbt_ex(simgrid::xbt::ThrowPoint throwpoint, const char* message)
- : simgrid::exception(message), simgrid::xbt::WithContextException(throwpoint, simgrid::xbt::backtrace())
- {}
-
- ~xbt_ex(); // DO NOT define it here -- see ex.cpp for a rationale
-
- /** Category (what went wrong) */
- xbt_errcat_t category = unknown_error;
-
- /** Why did it went wrong */
- int value = 0;
-
-};
-
-#endif
#include "JavaContext.hpp"
#include "jxbt_utilities.hpp"
+#include "simgrid/exception.hpp"
#include "src/simix/smx_private.hpp"
-#include "xbt/ex.hpp"
#include <functional>
#include <utility>
#include "JavaContext.hpp"
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
/* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
#ifndef JNIEXPORT
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "jmsg_process.h"
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "jmsg.hpp"
#include "jmsg_synchro.h"
#include "jmsg_vm.h"
#include "jmsg_host.h"
#include "jxbt_utilities.hpp"
+#include "simgrid/exception.hpp"
#include "simgrid/plugins/live_migration.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "xbt/ex.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/activity/ConditionVariableImpl.hpp"
+#include "simgrid/exception.hpp"
#include "src/kernel/activity/MutexImpl.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
#include "src/simix/smx_synchro_private.hpp"
-#include "xbt/ex.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ConditionVariable, simix_synchro, "Condition variables");
#include "src/kernel/activity/SleepImpl.hpp"
#include "src/kernel/context/Context.hpp"
+#include "simgrid/exception.hpp"
#include "src/simix/ActorImpl.hpp"
#include "src/simix/popping_private.hpp"
#include "src/simix/smx_private.hpp"
#include "src/surf/surf_interface.hpp"
-#include "xbt/ex.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "simgrid/s4u/Mailbox.hpp"
#include "src/instr/instr_private.hpp"
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "xbt/ex.hpp"
-
#include "msg_private.hpp"
+#include "simgrid/exception.hpp"
#include "src/simix/smx_private.hpp"
#include "src/simix/smx_synchro_private.hpp"
#include "xbt/synchro.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/plugins/vm/VmLiveMigration.hpp"
+#include "simgrid/exception.hpp"
#include "src/instr/instr_private.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/plugins/vm/VmHostExt.hpp"
-#include "xbt/ex.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(vm_live_migration, "S4U virtual machines live migration");
#include <exception>
#include <mutex>
-#include <xbt/ex.hpp>
+#include <xbt/exception.hpp>
#include <xbt/log.hpp>
#include "simgrid/barrier.h"
#include <exception>
#include <mutex>
-#include <xbt/ex.hpp>
+#include <xbt/exception.hpp>
#include <xbt/log.hpp>
#include "simgrid/s4u/ConditionVariable.hpp"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "mc/mc.h"
+#include "simgrid/exception.hpp"
#include "smx_private.hpp"
#include "src/kernel/activity/CommImpl.hpp"
#include "src/kernel/activity/ExecImpl.hpp"
#include "src/simix/smx_synchro_private.hpp"
#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_interface.hpp"
-#include "xbt/ex.hpp"
#ifdef HAVE_SMPI
#include "src/smpi/include/private.hpp"
#include "smx_private.hpp"
#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
#include <simgrid/engine.h>
-#include <xbt/ex.hpp>
+#include <simgrid/exception.hpp>
#include <string>
#include <vector>
#include "xbt/xbt_os_time.h"
#include <simgrid/engine.h>
-#include <xbt/ex.hpp>
+#include <simgrid/exception.hpp>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "mc/mc.h"
+#include "simgrid/exception.hpp"
#include "smx_private.hpp"
#include "src/kernel/activity/CommImpl.hpp"
#include "src/kernel/activity/ExecImpl.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/simix/smx_host_private.hpp"
-#include "xbt/ex.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "mc/mc.h"
+#include "simgrid/exception.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Io.hpp"
-#include "xbt/ex.hpp"
#include "smx_private.hpp"
#include "src/kernel/activity/IoImpl.hpp"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "mc/mc.h"
+#include "simgrid/exception.hpp"
#include "src/kernel/activity/MailboxImpl.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/simix/smx_private.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-#include "xbt/ex.hpp"
#include <boost/circular_buffer.hpp>
#include <boost/range/algorithm.hpp>
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "smpi_info.hpp"
-#include "xbt/ex.hpp"
+#include "simgrid/exception.hpp"
#include "xbt/sysdep.h"
namespace simgrid{
#include "mc/mc.h"
#include "private.hpp"
+#include "simgrid/exception.hpp"
#include "simgrid/s4u/Exec.hpp"
#include "smpi_comm.hpp"
#include "smpi_datatype.hpp"
#include "src/simix/ActorImpl.hpp"
#include "src/smpi/include/smpi_actor.hpp"
#include "xbt/config.hpp"
-#include <xbt/ex.hpp>
#include <algorithm>
#include <typeinfo>
#include <vector>
+#include "simgrid/exception.hpp"
#include "simgrid/sg_config.hpp"
#include "xbt/dynar.h"
#include "xbt/log.h"
#include "xbt/sysdep.h"
#include <xbt/config.h>
#include <xbt/config.hpp>
-#include <xbt/ex.hpp>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
#include <string>
+#include "simgrid/exception.hpp"
#include "xbt.h"
#include "xbt/ex.h"
-#include <xbt/ex.hpp>
#include <xbt/config.hpp>
#include <string>
#include <vector>
+#include "simgrid/exception.hpp"
#include <xbt/cunit.h>
-#include <xbt/ex.hpp>
#include <xbt/string.hpp>
/* output stream to use everywhere */
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/dict.h"
+#include "dict_private.h"
+#include "simgrid/exception.hpp"
+#include "src/xbt_modinter.h"
#include "xbt/ex.h"
-#include <xbt/ex.hpp>
#include "xbt/log.h"
#include "xbt/mallocator.h"
-#include "src/xbt_modinter.h"
#include "xbt/str.h"
-#include "dict_private.h"
#include <cstdio>
#include <cstring>
}
#ifdef SIMGRID_TEST
+#include "simgrid/exception.hpp"
#include "src/internal_config.h"
#include "xbt.h"
#include "xbt/ex.h"
#include <ctime>
-#include <xbt/ex.hpp>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "xbt/dynar.h"
+#include "simgrid/exception.hpp"
+#include "xbt/ex.h"
+#include "xbt/log.h"
#include "xbt/misc.h"
#include "xbt/sysdep.h"
-#include "xbt/log.h"
-#include "xbt/ex.h"
-#include <xbt/ex.hpp>
-#include "xbt/dynar.h"
#include <sys/types.h>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn, xbt, "Dynamic arrays");
+++ /dev/null
-/* ex - Exception Handling */
-
-/* Copyright (c) 2005-2018. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <cstdio>
-#include <cstdlib>
-
-#include <xbt/backtrace.hpp>
-#include "src/internal_config.h" /* execinfo when available */
-#include "xbt/ex.h"
-#include <xbt/ex.hpp>
-#include "xbt/log.h"
-#include "xbt/log.hpp"
-#include "xbt/backtrace.h"
-#include "xbt/backtrace.hpp"
-#include "src/xbt_modinter.h" /* backtrace initialization headers */
-
-#include "simgrid/sg_config.hpp" /* Configuration mechanism of SimGrid */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ex, xbt, "Exception mechanism");
-
-// DO NOT define ~xbt_ex() in ex.hpp.
-// Defining it here ensures that xbt_ex is defined only in libsimgrid, but not in libsimgrid-java.
-// Doing otherwise naturally breaks things (at least on freebsd with clang).
-
-xbt_ex::~xbt_ex() = default;
-
-void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func)
-{
- xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func), message);
- xbt_free(message);
- e.category = errcat;
- e.value = value;
- throw e;
-}
-
-/** @brief shows an exception content and the associated stack if available */
-void xbt_ex_display(xbt_ex_t * e)
-{
- simgrid::xbt::log_exception(xbt_log_priority_critical, "UNCAUGHT EXCEPTION", *e);
-}
-
-/** @brief returns a short name for the given exception category */
-const char *xbt_ex_catname(xbt_errcat_t cat)
-{
- switch (cat) {
- case unknown_error:
- return "unknown error";
- case arg_error:
- return "invalid argument";
- case bound_error:
- return "out of bounds";
- case mismatch_error:
- return "mismatch";
- case not_found_error:
- return "not found";
- case system_error:
- return "system error";
- case network_error:
- return "network error";
- case timeout_error:
- return "timeout";
- case cancel_error:
- return "action canceled";
- case thread_error:
- return "thread error";
- case host_error:
- return "host failed";
- case tracing_error:
- return "tracing error";
- case io_error:
- return "io error";
- case vm_error:
- return "vm error";
- default:
- return "INVALID ERROR";
- }
- return "INVALID ERROR";
-}
#include <memory>
#include <mutex>
+#include "simgrid/exception.hpp"
#include <xbt/backtrace.hpp>
#include <xbt/config.hpp>
-#include <xbt/ex.hpp>
-#include <xbt/exception.hpp>
#include <xbt/log.h>
#include <xbt/log.hpp>
XBT_LOG_EXTERNAL_CATEGORY(xbt);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_exception, xbt, "Exceptions");
+// DO NOT define ~xbt_ex() in exception.hpp.
+// Defining it here ensures that xbt_ex is defined only in libsimgrid, but not in libsimgrid-java.
+// Doing otherwise naturally breaks things (at least on freebsd with clang).
+
+xbt_ex::~xbt_ex() = default;
+
+void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func)
+{
+ xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func), message);
+ xbt_free(message);
+ e.category = errcat;
+ e.value = value;
+ throw e;
+}
+
+/** @brief shows an exception content and the associated stack if available */
+void xbt_ex_display(xbt_ex_t* e)
+{
+ simgrid::xbt::log_exception(xbt_log_priority_critical, "UNCAUGHT EXCEPTION", *e);
+}
+
+/** @brief returns a short name for the given exception category */
+const char* xbt_ex_catname(xbt_errcat_t cat)
+{
+ switch (cat) {
+ case unknown_error:
+ return "unknown error";
+ case arg_error:
+ return "invalid argument";
+ case bound_error:
+ return "out of bounds";
+ case mismatch_error:
+ return "mismatch";
+ case not_found_error:
+ return "not found";
+ case system_error:
+ return "system error";
+ case network_error:
+ return "network error";
+ case timeout_error:
+ return "timeout";
+ case cancel_error:
+ return "action canceled";
+ case thread_error:
+ return "thread error";
+ case host_error:
+ return "host failed";
+ case tracing_error:
+ return "tracing error";
+ case io_error:
+ return "io error";
+ case vm_error:
+ return "vm error";
+ default:
+ return "INVALID ERROR";
+ }
+ return "INVALID ERROR";
+}
+
namespace simgrid {
namespace xbt {
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/exception.hpp"
#include "simgrid/simix.h" /* used implementation */
#include "src/kernel/activity/ConditionVariableImpl.hpp"
-#include "xbt/ex.hpp"
#include "xbt/synchro.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt, "Synchronization mechanism");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "xbt/ex.hpp"
+#include "simgrid/exception.hpp"
#include "xbt/log.h"
#include "xbt/replay.hpp"
-/* xbt_str.cpp - various helping functions to deal with strings */
+/* xbt_str.cpp - various helping functions to deal with strings */
-/* Copyright (c) 2007-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "xbt/misc.h"
+#include "xbt/str.h" /* headers of these functions */
#include "xbt/sysdep.h"
-#include "xbt/str.h" /* headers of these functions */
/** @brief Splits a string into a dynar of strings
*
}
#ifdef SIMGRID_TEST
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "xbt/str.h"
XBT_TEST_SUITE("xbt_str", "String Handling");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/exception.hpp"
#include "simgrid/msg.h"
-#include <xbt/ex.hpp>
#include <stdio.h> /* sscanf */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "simgrid/msg.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <xbt/ex.hpp>
+#include "simgrid/exception.hpp"
#include "simgrid/msg.h"
-#include <stdio.h> /* snprintf */
-
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
static std::vector<msg_task_t> tasks = std::vector<msg_task_t>();
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/s4u.hpp"
-#include <xbt/ex.hpp>
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/s4u.hpp"
-#include <xbt/ex.hpp>
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
-/* Copyright (c) 2012-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <sys/stat.h>
#include <unistd.h>
-#include <xbt/ex.hpp>
+#include <simgrid/exception.hpp>
XBT_LOG_NEW_DEFAULT_CATEGORY(test,"this test");
src/xbt/dict_cursor.c
src/xbt/dict_elm.c
src/xbt/dynar.cpp
- src/xbt/ex.cpp
src/xbt/exception.cpp
src/xbt/graph.c
src/xbt/log.c
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/ex.h
- include/xbt/ex.hpp
include/xbt/exception.hpp
include/xbt/Extendable.hpp
include/xbt/file.hpp