1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (C) 2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//! SIMICS exception handling APIs.
//!
//! These should typically not be used directly, most SIMICS api functions provided by
//! this crate use the `#[simics_exception]` attribute to automatically convert thrown
//! exceptions into a [`Result`]. This allows more idiomatic error handling
//! via `Result`s.
use crate;
use CStr;
/// Alias for `sim_exception`
pub type SimException = sim_exception;
/// Returns the error message associated with the most recently raised frontend
/// exception, even if that exception has been cleared.
///
/// The returned string is only valid until the next use of the Simics API in the same
/// thread.
///
/// # Context
///
/// Cell Context
/// Clears the currently pending frontend exception and returns the value of it.
///
/// # Return Value
///
/// Returns the exception that was pending before the call, or SimExc_No_Exception.
///
/// # Context
///
/// Cell Context
/// This function returns the exception type of the current pending exception, or
/// SimExc_No_Exception if none available.
///
/// # Return Value
///
/// The pending exception. This value is [`SimException::SimExc_No_Exception`] if there was
/// none.
///
/// # Context
///
/// Cell Context