- Go to the
meta-qcom-distro/recipes-products/packagegroupsdirectory and open thepackagegroup-qcom-utilities.bbfile. - Modify the
packagegroup-qcom-utilities.bbfile to addgdbin the package list. Skip this step if the package name is already present in the package list. - Ensure that the build incorporates the debug symbols.
OrIf the debug symbols aren’t enabled, compile all required executables or shared libraries with the
-gcompiler flag. To push debug symbols to the device, see Configure debug symbols. - Recompile and flash the build on the device.
- To debug using GDB, run the following command on the device:
Sample output:
GDB commands
The following table lists the commonly used GDB commands. Table: Common GDB commands| Command | Description |
|---|---|
(gdb) bt | Provides a backtrace of the current thread |
(gdb) info threads | Lists the IDs of currently known threads |
(gdb) thread 2 | Switches to thread 2 |
(gdb) where | Shows the current line number and the function in which you are currently executing |
(gdb) thread apply all bt full | Provides a backtrace of all threads |
(gdb) info sharedlibrary | Lists the names of shared libraries used |
(gdb) info reg | Lists the CPU registers |

