Hello everyone,
I am trying to debug an applicaiton via eclipse.
On the Virtual-Linux (Fedore) from your website I found the description "Eclipse_Application_development_eng.pdf". Sadly the steps described there are not working fully.
I still managed to compile a simple applicaiton. But when I want to debug the application I am having problems.
The reason why ot's not working is, that I don't have the GDB-Debugger anywhere on your provided fedora system.
In the documentation it says that:
"The GDB debugger is located in the buildroot directory …/output/host/usr/bin/arm-linux-gdb."
But the MX8MP only supports Yocot atm, so I have no buildroot directory and the yocto-directories don't provide the gdb-Debugger-files.
Where can I find the gdb-Debugger-files. I am using "fsimx8mp-Y2021.07.2".
PS:
fsimx8mp-Y2021.07.2 also doesn't provide a toolschain including the needed compiler (I took it from fsimx8mm-B2021.06), I hope that's okay.
debugging with eclipse
-
-
Hello,
Yocto builds its own toolchain, so we don't add our toolchain to the release.
You can build the Yocto toolchain for external usage by running
bitbake meta-toolchain
Then you will have to install the toolchain-sdk
./tmp/deploy/sdk/fus-imx-[...]-toolchain-5.4-zeus.sh
Unfortunately, only the default path at /opt is supported right now.
You should find the gdb at
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gdb
The path may differ a bit, depending on your Yocto configuration.
I hope this helps
Your F&S Support Team
-
Okay, i managed to build the toolchain like you suggested.
But I am not able to compile with the created toolchain.
I wrote a simple HelloWorld-Programm in test.c:#include <stdio.h>
int main(void) {
printf("Hello World!\n");
return 0;
}
I then opened a terminaml and sourced the scripted as you mentioned.Now no compiler generated by the toolchain is able to compile the programm successfully. There are allways some Paths missing.
Examples:CLANG-Compiler:
aarch64-poky-linux-clang -Wall -Wextra -Werror -o clangtest test.c
In file included from test.c:11:
/usr/include/stdio.h:27:10: fatal error: 'bits/libc-header-start.h' file not found
#include <bits/libc-header-start.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
GNU-Compiler:
aarch64-poky-linux-g++ -Wall test.c -o test
test.c:11:10: fatal error: stdio.h: No such file or directory
11 | #include <stdio.h>
| ^~~~~~~~~
compilation terminated.
GNU-Compiler with manually added Paths to headers:aarch64-poky-linux-g++ -Wall test.c -I/opt/fus-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux/usr/include -o test
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find Scrt1.o: No such file or directory
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find crti.o: No such file or directory
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find crtbeginS.o: No such file or directory
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lstdc++
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lm
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lgcc_s
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lgcc
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lc
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lgcc_s
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find -lgcc
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find crtendS.o: No such file or directory
/opt/fus-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/real-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
What am I dooing wrong here?
When I compile it with the native gcc-compiler it works just fine:gcc -Wall test.c -o test
-
Hello,
to use the Yocto toolchain, you fist have to setup the environment so the Toolchain knows where to look for the includes.
This can be done by executing the setup script, delivered with the meta-toolchain package like this.
source /opt/fus-imx-wayland/5.4-zeus/environment-setup-aarch64-poky-linux
Then you can compile your program in the same terminal running:
$CC -o test test.c
There is a special Yocto Plugin for Eclipse, which helps configuring the environment there.
The following link describes how to install and configure it
https://www.yoctoproject.org/d…t-manual.html#adt-eclipse
We will add this to out documentation.
Your F&S Support Team.
-
Hello,
the compilation with $CC -o test.c works, thanks for the info.
I will have a look into the provided link tomorrow.
Regards,
Marcel. -
Hello,
new version of document "Application Development with Eclipse" is available.
Your F&S Support Team.