To debug the libraries that are built by the build tool you will have to make a few changes to the build configuration. For libraries built outside the build environment you will have to do some extra work.
The Yocto Project builds debug variants of binary packages and puts them into
build/tmp/deploy/<package manager>/<target architecture>. Here is an example of the debug package, for the C library in this case:
You can add these debug packages selectively to your target image by adding
<package name-dbg> to your target recipe. For
glibc, the package is named
glibc-dbg. Alternatively, you can simply tell the Yocto Project to install all debug packages ...