sdk-ng icon indicating copy to clipboard operation
sdk-ng copied to clipboard

Provide debugging information for toolchain-bundled libraries

Open stephanosio opened this issue 1 year ago • 1 comments

Zephyr SDK bundles various libraries as part of the toolchains included in it:

  • libgcc
  • newlib
  • newlib-nano
  • picolibc (to be included; PR #287)
  • libstdc++

The Zephyr SDK build process currently strips out all the debug information for the above libraries in order to reduce the toolchain size, effectively making it impossible to debug the internals of these libraries.

Note that it is often necessary to debug the internals of the C and C++ standard libraries to fully understand the complex issues involving the functions from these libraries, and that is especially true for the Zephyr RTOS for which almost all of its users are writing very low-level code.

To fix this problem, consider providing the debug symbols for these libraries in one or more of the following ways:

  1. a separate tarball containing the debug symbols (still requires users to manually obtain the source code)
  2. debuginfod server (simply setting DEBUGINFOD_URLS environment variable to point to the Zephyr debuginfod server should be enough to allow the debug symbols and source code access)

stephanosio avatar Aug 20 '22 09:08 stephanosio

Wouldn't it be better to include debug symbols (and, heck, why not library source too?) with the libraries and instead split the SDK into architecture-specific bundles? The all-in-one SDK seems like a convenience for Zephyr testing, but isn't really useful for developing Zephyr-based applications.

keith-packard avatar Aug 20 '22 20:08 keith-packard