`HardFault` trampoline makes it difficult for `probe-rs` debugger to unwind past the exception handler.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- embedded-iot
Direzione di ricerca
Inizia in cortex-m-rt/src/lib.rs, al trampoline di HardFault intorno alle righe 446-469, quindi segui la gestione esistente di #[exception(trampoline = false)]. Confronta il comportamento generato all’ingresso in un’eccezione e determina come il comportamento predefinito potrebbe preservare lo stack unwinding di probe-rs senza compromettere gli handler esistenti. Il lavoro è completo quando il comportamento predefinito supporta l’unwinding mantenendo al contempo la compatibilità documentata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- Rust
- Stelle
- 1k
- Fork
- 201
- Merge medio
- 1g 4h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-embedded/cortex-m
-
Deprecation of `bare-metal`Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
rust-embedded/cortex-m#651 · 5 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
rust-embedded/cortex-m#637 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rust-embedded/cortex-m#511 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
rust-embedded/cortex-m#700 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-embedded/cortex-m#695 ·
Tutte le issue di rust-embedded/cortex-m
Issue simili
-
`mise doctor` Shows Not Installed Lazy Tools as ProblemsForse già presa @jdx l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
nn::linear: weight initialization depends on `bias` because the bias is created before the weightForse già presa @monfortema l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
LaurentMazare/tch-rs#1067 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
astral-sh/astral-codec#234 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100