- Change to the project
directory:
$ cd <plnx-proj-root>
- Add the following lines in <plnx-proj-root>/project-spec/meta-user/conf/user-rootfsconfig:
CONFIG_myapp-dev CONFIG_myapp-dbg
- Add the following lines in
<plnx-proj-root>/project-spec/meta-user/recipe-apps/myapp/myapp.bb.
DEBUG_FLAGS = "-g3 -O0" # Specifies to build packages with debugging information DEBUG_BUILD = "1" # Do not remove debug symbols INHIBIT_PACKAGE_STRIP = "1" # OPTIONAL: Do not split debug symbols in a separate file INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
- Run
petalinux-config -c rootfs
on the command console:$ petalinux-config -c rootfs
- Scroll down the user packages Configuration menu to Debugging:
Filesystem Packages ---> PetaLinux Package Groups ---> apps ---> user packages ---> PetaLinux RootFS Settings --->
- Select user
packages.
[X] myapp-dbg [ ] myapp-dev
- Select myapp-dbg. Exit the myapp sub-menu.
- Exit the user packages sub-menu, and select .
- Select gdb, and ensure
that the GDB server is enabled:
[ ] gdb [ ] gdb-dev [X] gdbserver [ ] gdb-dbg
- Exit the menu and select <Yes> to save the configuration.
- Select .
- Deselect tcf-agent as it uses the same 1534 port. Exit the menu and save the configuration.
- Rebuild the target system image. Add the following line in
<plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf.
RM_WORK_EXCLUDE += "myapp"
For more information, see Build System Image.