Skip to content

Chapter 09 "Type safe manipulation" is out of date #109

Description

@lbellomo

I have some troubles running 09-registers/type-safe-manipulation and I notice that the middle part is outdated:

  • the example use cargo run but this don't start gdb. This should be cargo embed.
  • also run the cargo with no argument, targeting the src/main.rs. This should be the example/type-safe.rs
  • and it looks like the gdb section switched chapters but didn't refresh, because it shows src/07-registers/src/main.rs multiple times (should be 09, and the example/type-safe.rs).
  • finally I see something different at the start of gdb and not sure if I miss some breakpoints or is something else:

I run:

# on "src/09-registers"
cargo embed --example type-safe

# on another terminal:
gdb-multiarch ../../../target/thumbv7em-none-eabihf/debug/examples/type-safe
(gdb) target remote :1337
(gdb) set mem inaccessible-by-default off
(gdb) break type-safe.rs:12
Breakpoint 1 at 0x166: type-safe.rs:12. (2 locations)
(gdb) continue
Continuing.

Breakpoint 1.1, type_safe::__cortex_m_rt_main () at mdbook/src/09-registers/examples/type-safe.rs:12
12          p0.out.modify(|_, w| w.pin21().set_bit());
(gdb) print *p0
# the big output go here

From the example I don't have this part and i don't know what trigger the sigint or the breakpoint:

[...]
Program received signal SIGINT, Interrupt.
cortex_m_rt::DefaultPreInit () at src/lib.rs:1058
1058	pub unsafe extern "C" fn DefaultPreInit() {}
(gdb) continue
Continuing.

Breakpoint 1, registers::__cortex_m_rt_main_trampoline () at src/07-registers/src/main.rs:7
7	#[entry]
(gdb) continue
Continuing.

Program received signal SIGINT, Interrupt.
registers::__cortex_m_rt_main () at src/07-registers/src/main.rs:8
8	fn main() -> ! {
(gdb) continue
Continuing.
[...]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions