Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
labs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emil Kitti
labs
Commits
e07aefa0
Commit
e07aefa0
authored
7 years ago
by
Emil Kitti
Browse files
Options
Downloads
Patches
Plain Diff
bare0_4
parent
fac2151c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/bare0.rs
+18
-3
18 additions, 3 deletions
examples/bare0.rs
with
18 additions
and
3 deletions
examples/bare0.rs
+
18
−
3
View file @
e07aefa0
...
@@ -25,7 +25,7 @@ fn main() {
...
@@ -25,7 +25,7 @@ fn main() {
unsafe
{
unsafe
{
X
=
X
.wrapping_add
(
1
);
X
=
X
.wrapping_add
(
1
);
Y
=
X
;
Y
=
X
;
assert!
(
x
==
X
&&
X
==
Y
);
assert!
(
x
==
X
&&
X
==
Y
+
1
);
}
}
}
}
}
}
...
@@ -63,7 +63,7 @@ fn main() {
...
@@ -63,7 +63,7 @@ fn main() {
// cortex_m_rt::default_handler (ef=0x20017e68) at /home/kitzin/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.3.12/src/lib.rs:454
// cortex_m_rt::default_handler (ef=0x20017e68) at /home/kitzin/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.3.12/src/lib.rs:454
// 454 asm::bkpt();
// 454 asm::bkpt();
//
//
//
An interrupt is triggered!
//
Overflow is detected and program !panics
//
//
// commit your answers (bare0_2)
// commit your answers (bare0_2)
//
//
...
@@ -100,7 +100,22 @@ fn main() {
...
@@ -100,7 +100,22 @@ fn main() {
// you have some fault in the program and go back to 3)
// you have some fault in the program and go back to 3)
//
//
// 4. change the asserion to assert!(x == X && X == Y + 1), what happens
// 4. change the asserion to assert!(x == X && X == Y + 1), what happens
// ** place your answer here **
//
// (gdb) next
// 28 assert!(x == X && X == Y + 1);
// (gdb) next
//
// Program received signal SIGTRAP, Trace/breakpoint trap.
// cortex_m_rt::default_handler (ef=0x20017e60) at /home/kitzin/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.3.12/src/lib.rs:454
// 454 asm::bkpt();
// (gdb) print bare0::X
// $72 = 0
// (gdb) print bare0::Y
// $73 = 0
//
//
// The assert condition (0 == 1) is false and it !panics
//
//
//
// commit your answers (bare0_4)
// commit your answers (bare0_4)
//
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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