Skip to content

Commit 80cf0ed

Browse files
qinsoonwks
andauthored
Add a section about debugging tips in user guide (#987)
Co-authored-by: Kunshan Wang <wks1986@gmail.com>
1 parent 23ff088 commit 80cf0ed

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

docs/userguide/src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
- [How to Undertake a Port](portingguide/howto/prefix.md)
3232
- [NoGC](portingguide/howto/nogc.md)
3333
- [Next Steps](portingguide/howto/next_steps.md)
34+
- [Debugging Tips](portingguide/debugging/prefix.md)
35+
- [Enabling Debug Assertions](portingguide/debugging/assertions.md)
3436
- [Performance Tuning](portingguide/perf_tuning/prefix.md)
3537
- [Link Time Optimization](portingguide/perf_tuning/lto.md)
3638
- [Optimizing Allocation](portingguide/perf_tuning/alloc.md)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Enabling debug assertions
2+
3+
MMTk is implemented with an extensive amount of assertions to ensure the correctness.
4+
We strongly recommend using a debug build of MMTk that includes all the debugging assertions
5+
when one is developing on a MMTk binding. The assertions are normal Rust `debug_assert!`,
6+
and they can be turned on in a release build with Rust flags (https://doc.rust-lang.org/cargo/reference/profiles.html#debug-assertions).
7+
8+
## Extreme debugging assertions
9+
10+
In addition to the normal debugging assertions, MMTk also has a set of
11+
optional runtime checks that can be turned on by enabling the feature `extreme_assertions`.
12+
These usually include checks that are too expensive (even in a debug build) that we do not
13+
want to enable by default.
14+
15+
You should make sure your MMTk binding can pass all the assertions (including `extreme_assertions`).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Debugging Tips
2+
3+
In this section, we discuss debugging tips that will be useful to debug MMTk
4+
in a binding implementation. We will focus on discussing strategies and tools
5+
in the specific context of debugging MMTk.
6+
7+
We aim to enhance the debugging capabilities for MMTk. However, as of October 2023, our debugging
8+
tools remain limited. We welcome your feedback and suggestions. If there's a specific debugging tool
9+
you'd like to see or have recommendations, please reach out to us on [Zulip](https://mmtk.zulipchat.com/)
10+
or submit your thoughts via [issues](https://github.com/mmtk/mmtk-core/issues).

0 commit comments

Comments
 (0)