summaryrefslogtreecommitdiff
path: root/src/systemc/core/process_types.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-07 01:37:57 -0700
committerGabe Black <gabeblack@google.com>2018-10-09 21:39:36 +0000
commit3f3773757eb2cf5d62caf5e01adf8611c8684dde (patch)
treee6db18cba3949ee76802d10ffd6a64dcd8b4d276 /src/systemc/core/process_types.hh
parent51e3c33ed41da2204c952792993b408917c6e522 (diff)
downloadgem5-3f3773757eb2cf5d62caf5e01adf8611c8684dde.tar.xz
systemc: Fortify how exceptions are caught and passed around.
This change tightens up exception catching and makes gem5's systemc code react to exceptions more in line with the Accellera implementation. This prevents exceptions from being caught by the pybind11 integration which makes it very difficult to see where an exception came from, and makes the output differ by including a (mostly useless) backtrace. Change-Id: I7130d53a98fadd137073d1718f780f32f57c658c Reviewed-on: https://gem5-review.googlesource.com/c/12601 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/process_types.hh')
-rw-r--r--src/systemc/core/process_types.hh8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/systemc/core/process_types.hh b/src/systemc/core/process_types.hh
index 6f603e73f..748c24914 100644
--- a/src/systemc/core/process_types.hh
+++ b/src/systemc/core/process_types.hh
@@ -92,7 +92,13 @@ class Thread : public Process
main() override
{
thread->_needsStart = false;
- thread->run();
+ try {
+ thread->run();
+ } catch (...) {
+ thread->terminate();
+ scheduler.throwToScMain();
+ return;
+ }
thread->terminate();
scheduler.yield();
}