Comments (7)
@japaric Thanks for the support on this issue! We were having this problem at the Boston Embedded Systems Meetup's Bring and Blink and some people were very impressed with your responsiveness and helpfulness in resolving this issue. Thank you for this book and all of the work you have done! It is awesome
from discovery.
Sounds like the linker is dropping the main symbol at link time. Could you check with objdump
?
# is `<main>` there?
$ arm-none-eabi-objdump -Cd target/thumbv7m-none-eabihf/debug/led-roulette | less
It's a bug with some gcc versions. It has been reported before (#34). You have to install / use a different GCC version. #34 mentions an alternative GCC repo at the end of its description.
from discovery.
The <main>
is not there!
I tried the mentioned px4
brew tap in #34, its gdb crashes immediately.
The only way to get the gdb 7.12's support for rust on OS X seems to be using the linker from 5_4-2016q3
(ARM's official gcc) and then downloading/using gdb from 6-2017-q1-update
from discovery.
I'm having the same issue. How is the initialization done? It reaches pg::init, but this doesn't call the main function. The stack backtrace at pg::init also does not show anything beyond this and $sp seems to be at the start of the stack. How is main supposed to get called?
EDIT: Well it seems that this issue is pretty common here. I'll have a look at the possible solutions,
from discovery.
After first following these instructions, the px4/px4
tap fixed this issue for me
$ brew info px4/px4/gcc-arm-none-eabi
px4/px4/gcc-arm-none-eabi: stable 20160928
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
/usr/local/Cellar/gcc-arm-none-eabi/20160928 (5,502 files, 447.2MB) *
Built from source on 2017-04-03 at 19:42:16
From: https://github.com/px4/homebrew-px4/blob/master/gcc-arm-none-eabi.rb
from discovery.
Turns out newer versions of gcc were dropping the entry point _reset
, which is marked as so in the linker script. I have modified the linker script to force the linker to keep the symbol around and released a new version of the f3 crate (v0.3.1) with the fix.
Tentatively closing as fixed but let me know if you run into any other linker error.
from discovery.
Hi, this came up again for me. I'm using GCC 5.4 on Debian 9.5. The main
symbol is present but GDB can't find it for some reason. I was able to set a breakpoint by line number.
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:5.4.1+svn241155-1) 5.4.1 20160919
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ arm-none-eabi-objdump -Cd target/thumbv7em-none-eabihf/debug/led-roulette | rg main
08000188 <led_roulette::main>:
8000192: e7ff b.n 8000194 <led_roulette::main+0xc>
8000194: e7fe b.n 8000194 <led_roulette::main+0xc>
08000196 <main>:
8000444: f7ff fea7 bl 8000196 <main>
$ arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/led-roulette
GNU gdb (7.12-6+9+b2) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/thumbv7em-none-eabihf/debug/led-roulette...done.
(gdb) target remote :3333
Remote debugging using :3333
Reset () at /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.5.3/src/lib.rs:491
491 let pre_init: unsafe extern "C" fn() = __pre_init;
(gdb) load
Loading section .vector_table, size 0x188 lma 0x8000000
Loading section .text, size 0x3f0 lma 0x8000188
Loading section .rodata, size 0x12c lma 0x8000580
Start address 0x80003e4, load size 1700
Transfer rate: 708 bytes/sec, 566 bytes/write.
(gdb) break led_roulette::main
Function "led_roulette::main" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) break main.rs:11
Breakpoint 1 at 0x800018c: file src/05-led-roulette/src/main.rs, line 11.
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Breakpoint 1, led_roulette::main::h1bb7a04b9156fd55 () at src/05-led-roulette/src/main.rs:13
13 let x = 42;
(gdb)
from discovery.
Related Issues (20)
- error: linking with `rust-lld` failed: exit code: 0xc0000374
- Why can't I use gdb even though I set up the environment according to the build manual? Please help me. HOT 1
- Unit testing? HOT 1
- 5.3 'Debug It' gdb could not load XML target description HOT 1
- problem at 05-led-roulette, gdb debugging on windows10, incompatible version? HOT 1
- OpenOCD configuration for F3Discovery changed in v0.12
- Simple Chinese Tranlation HOT 4
- hidapi error: Failed to open a device with path '/dev/hidraw4': Permission denied HOT 1
- 3,4 Can't Verify Install - Failed Attaching To Target
- Additional content - snake game HOT 1
- [Chapter 5.3] compiled code seems to be optimized HOT 1
- error: Package `led-roulette v0.2.0 does not have the feature `v2` HOT 3
- Failed to parse inteface number in hardware IDs. HOT 2
- Definition of `meta` key not clear in Minicom
- [Chapter 5.3] Continue hangs, stuck at "0x00000000 in __vector_table ()"
- Extract STM32 discovery book to separate repo and archive HOT 1
- Extract and archive support for microbit:v1 HOT 2
- Micro:bit V2 Project Template
- Typo HOT 2
- probe-rs-tools installation fails HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discovery.