`HardFault` trampoline makes it difficult for `probe-rs` debugger to unwind past the exception handler.
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust
- 领域
- embedded-iot
调研方向
从 cortex-m-rt/src/lib.rs 中 446-469 行附近的 HardFault trampoline 开始,然后追踪现有的 #[exception(trampoline = false)] 处理。比较生成的 exception-entry 行为,并确定默认行为如何在不破坏现有 handler 的情况下保留 probe-rs 的栈展开能力。完成的标准是默认行为支持展开,同时保留文档中说明的兼容性。
由索引模型根据 Issue 内容生成。
描述
The HardFault trampoline overwrites the EXC_RETURN magic values when it writes to the lr register.
Currently, the probe-rs debugger relies on those magic values during stack unwinding, to identify exception handlers, and unwind the stack that caused the exception. For instance, it used to be possible to get a stack like this:
__cortex_m_rt_HardFault (/Users/jn/dev/debug/probe-rs-debugger-test/src/thumbv7em-none-eabihf/nRF52833_xxAA.rs:43)
"HardFault handler. Cause: Escalated BusFault (Precise data access error) at location: 0x3ffffffc." (Unknown Source:0)
div_half_u128 (/rustc/0ecbd0605770f45c9151715e66ba2b3cae367fcb/library/core/src/ptr/mod.rs:1636)
__cortex_m_rt_SysTick (/Users/jn/dev/debug/probe-rs-debugger-test/src/thumbv7em-none-eabihf/nRF52833_xxAA.rs:32)
__cortex_m_rt_SysTick_trampoline (/Users/jn/dev/debug/probe-rs-debugger-test/src/thumbv7em-none-eabihf/nRF52833_xxAA.rs:17)
"Systick handler." (Unknown Source:0)
__delay #[inline] (/Users/jn/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cortex-m-0.7.7/asm/inline.rs:62)
delay (/Users/jn/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cortex-m-0.7.7/src/asm.rs:29)
__cortex_m_rt_main (/Users/jn/dev/debug/probe-rs-debugger-test/src/thumbv7em-none-eabihf/nRF52833_xxAA.rs:85)
__cortex_m_rt_main (/Users/jn/dev/debug/probe-rs-debugger-test/src/thumbv7em-none-eabihf/nRF52833_xxAA.rs:62)
With the trampoline, the debugger has no way of knowing that it is an exception handler that needs register substitutions before the calling frames can be identified, and it stops unwinding at the first frame.
I've notice in the unreleased code, that users can bypass the trampoline, with#[exception(trampoline = false)], and this restores the previous behaviour of the stack unwind.
Unfortunately, this means that the users have to modify their code before they can use the debugger in these situations.
Is there any way we can make the default to be trampoline = false?
- 主要语言
- Rust
- 星标
- 1k
- 派生
- 201
- 平均合并
- 5 小时 8 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-embedded/cortex-m 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
rust-embedded/cortex-m#702 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
rust-embedded/cortex-m#651 · 5 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
rust-embedded/cortex-m#637 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
rust-embedded/cortex-m#511 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
rust-embedded/cortex-m#700 · 1 条评论 ·
查看 rust-embedded/cortex-m 的全部 Issue
相似的 Issue
-
area/backends bug session-analysis
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 1 天内回复
-
docs good first issue
难度 2/5 1-3 小时 新手友好度 75/100
-
crash
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
aaif-goose/goose#13125 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复