feat: update to new backtrace lib (#1049)

* feat: update to new backtrace lib

* feat: enable unwind for riscv64

---------

Co-authored-by: longjin <longjin@DragonOS.org>
This commit is contained in:
linfeng
2024-11-19 21:55:22 +08:00
committed by GitHub
parent 2cac148dc1
commit 081428c0d8
11 changed files with 151 additions and 33 deletions

View File

@ -28,6 +28,7 @@ SECTIONS
. = ALIGN(4096);
text_start_pa = .;
__executable_start = .;
.text (text_start_pa): AT(text_start_pa - KERNEL_VMA)
{
_text = .;
@ -39,6 +40,7 @@ SECTIONS
*(.text.*)
_etext = .;
__etext = .;
}
. = ALIGN(32768);
data_start_pa = .;

View File

@ -0,0 +1,28 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"features": "+m,+a,+f,+d,+c",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "unwind",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}

View File

@ -36,7 +36,8 @@ pub(super) fn syscall_handler(syscall_num: usize, frame: &mut TrapFrame) -> () {
let args = [frame.a0, frame.a1, frame.a2, frame.a3, frame.a4, frame.a5];
syscall_return!(
Syscall::handle(syscall_num, &args, frame).unwrap_or_else(|e| e.to_posix_errno() as usize),
Syscall::catch_handle(syscall_num, &args, frame)
.unwrap_or_else(|e| e.to_posix_errno() as usize),
frame,
false
);

View File

@ -26,6 +26,7 @@ SECTIONS
. = ALIGN(32768);
. += KERNEL_VMA;
text_start_pa = .;
__executable_start = .;
.text (text_start_pa): AT(text_start_pa - KERNEL_VMA)
{
_text = .;
@ -37,6 +38,7 @@ SECTIONS
*(.text.*)
_etext = .;
__etext = .;
}
. = ALIGN(32768);
data_start_pa = .;

View File

@ -118,8 +118,8 @@ pub extern "sysv64" fn syscall_handler(frame: &mut TrapFrame) {
_ => {}
}
syscall_return!(
Syscall::handle(syscall_num, &args, frame).unwrap_or_else(|e| e.to_posix_errno() as usize)
as u64,
Syscall::catch_handle(syscall_num, &args, frame)
.unwrap_or_else(|e| e.to_posix_errno() as usize) as u64,
frame,
show
);

View File

@ -11,5 +11,5 @@
"executables": true,
"features": "-mmx,-sse,+soft-float",
"disable-redzone": true,
"panic-strategy": "abort"
"panic-strategy": "unwind"
}