Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-22026-2376550
neuq-rCore-3166
Commits
cd55ddb3
Commit
cd55ddb3
authored
1 year ago
by
Caiyi H.
Browse files
Options
Download
Patches
Plain Diff
chore: Fix stack trace
parent
0c604267
vf2
add-dummy-test
chapter-3
docs
impl-allocation
impl-brk
impl-filesystem
load-from-sdcard
local-dependencies
main
make-clean
merge-after-submit
path-processing
process
prompt-generator
refact-mm
submit
submit-qemu
submit-vf2
sync-curr
vf2-ci
qemu-v0.2
qemu-v0.1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
os/src/entry.asm
+2
-0
os/src/entry.asm
os/src/stack_trace.rs
+7
-5
os/src/stack_trace.rs
with
9 additions
and
5 deletions
+9
-5
os/src/entry.asm
+
2
−
0
View file @
cd55ddb3
...
...
@@ -3,6 +3,8 @@
.global
_start
_start:
la
sp
,
boot_stack_top
#
Make
fp
0
so
that
stack
trace
knows
where
to
stop
xor
fp
,
fp
,
fp
j
__kernel_start_main
.section
.bss.stack
...
...
This diff is collapsed.
Click to expand it.
os/src/stack_trace.rs
+
7
−
5
View file @
cd55ddb3
...
...
@@ -4,15 +4,17 @@ pub unsafe fn print_stack_trace() {
let
mut
fp
:
*
const
usize
;
asm!
(
"mv {}, fp"
,
out
(
reg
)
fp
);
let
mut
saved_ra
=
*
fp
.sub
(
1
);
let
mut
saved_fp
=
*
fp
.sub
(
2
);
println!
(
"== Begin stack trace =="
);
while
!
fp
.is_null
()
{
let
saved_ra
=
*
fp
.sub
(
1
);
let
saved_fp
=
*
fp
.sub
(
2
);
while
!
fp
.is_null
()
&&
saved_fp
!=
0
{
saved_ra
=
*
fp
.sub
(
1
);
saved_fp
=
*
fp
.sub
(
2
);
println!
(
"0x{:016x}, fp = 0x{:016x}"
,
saved_ra
,
saved_fp
);
fp
=
saved_fp
as
*
const
usize
;
println!
(
"== End stack trace =="
);
}
println!
(
"== End stack trace =="
);
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets