File indexing completed on 2025-05-11 08:24:32
0001 #include "dl-load.h" /* make the symbol a C linkage */
0002
0003 #include <stdexcept>
0004
0005 #include <rtems/test-printer.h>
0006
0007 #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
0008
0009 void exception_dl(bool throw_runtime)
0010 {
0011 printf("exception_dl: begin\n");
0012 try
0013 {
0014 printf("exception_dl: throwing...\n");
0015 if (throw_runtime)
0016 throw std::runtime_error("throw std::runtime_error object");
0017 else
0018 throw dl_test_throw_me("throw dl_test_throw_me object");
0019 }
0020 catch (dl_test_throw_me const& e)
0021 {
0022 printf("%s: caught: %s\n", __func__, e.what());
0023 }
0024 catch (std::exception const& e)
0025 {
0026 printf("%s: caught: %s\n", __func__, e.what());
0027 }
0028 catch (...)
0029 {
0030 printf("%s: caught: unknown\n", __func__);
0031 }
0032 printf("exception_dl: end\n");
0033 }