Skip to content

Commit fc3154b

Browse files
committed
add debug exception for x86_64 and fix the break exception definition error in aarch64.
Signed-off-by: Godones <[email protected]>
1 parent cc00dd0 commit fc3154b

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/aarch64/uspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl ExceptionInfo {
150150
/// Returns a generalized kind of this exception.
151151
pub fn kind(&self) -> ExceptionKind {
152152
match self.esr.read_as_enum(ESR_EL1::EC) {
153-
Some(ESR_EL1::EC::Value::BreakpointLowerEL) => ExceptionKind::Breakpoint,
153+
Some(ESR_EL1::EC::Value::Brk64) => ExceptionKind::Breakpoint,
154154
Some(ESR_EL1::EC::Value::IllegalExecutionState) => ExceptionKind::IllegalInstruction,
155155
Some(ESR_EL1::EC::Value::PCAlignmentFault)
156156
| Some(ESR_EL1::EC::Value::SPAlignmentFault) => ExceptionKind::Misaligned,

src/uspace_common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ pub enum ReturnReason {
2121
/// A generalized kind for [`ExceptionInfo`].
2222
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2323
pub enum ExceptionKind {
24+
#[cfg(target_arch = "x86_64")]
25+
/// A debug exception.
26+
Debug,
2427
/// A breakpoint exception.
2528
Breakpoint,
2629
/// An illegal instruction exception.

src/x86_64/uspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ impl ExceptionInfo {
143143
/// Returns a generalized kind of this exception.
144144
pub fn kind(&self) -> ExceptionKind {
145145
match ExceptionVector::try_from(self.vector) {
146+
Ok(ExceptionVector::Debug) => ExceptionKind::Debug,
146147
Ok(ExceptionVector::Breakpoint) => ExceptionKind::Breakpoint,
147148
Ok(ExceptionVector::InvalidOpcode) => ExceptionKind::IllegalInstruction,
148149
_ => ExceptionKind::Other,

0 commit comments

Comments
 (0)