systemc: Improve handling of empty process handles.

Most had checks, but didn't print any message. throw_it needed a check
as well.

Change-Id: I916c837112f9b27852583f01b3e16a6f53d5e7ca
Reviewed-on: https://gem5-review.googlesource.com/c/12440
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2018-08-28 23:14:40 -07:00
parent cfe48360f9
commit b6ad37a88e
3 changed files with 58 additions and 18 deletions

View File

@@ -33,7 +33,8 @@
#include <exception>
#include <vector>
#include "systemc/ext/core/sc_object.hh"
#include "../utils/sc_report_handler.hh"
#include "sc_object.hh"
namespace sc_gem5
{
@@ -212,6 +213,11 @@ class sc_process_handle
sc_descendent_inclusion_info include_descendants=
SC_NO_DESCENDANTS)
{
if (!_gem5_process) {
SC_REPORT_WARNING("(W570) attempt to use an empty "
"process handle ignored", "throw_it()");
return;
}
::sc_gem5::ExceptionWrapper<T> exc(user_defined_exception);
::sc_gem5::throw_it_wrapper(_gem5_process, exc,
include_descendants == SC_INCLUDE_DESCENDANTS);

View File

@@ -33,7 +33,7 @@
#include <exception>
#include <string>
#include "systemc/ext/core/sc_time.hh"
#include "../core/sc_time.hh"
namespace sc_core
{