Search code examples
androiddebugginggdbandroid-soong

Create unstripped executable for android with .bp


I want to build aosp native test and debug it on emulator. Is it possible to build executable with debugging symbols? I have tried to add -g and -ggdb to Android .bp:

    cflags: [
        "-Werror",
        "-Wall",
        "-g",
    ],

but it didn't help, I still getting stripped executable.


Solution

  • In the module declaration, add:

                strip: {
                    keep_symbols: true,
                },
    

    Reference: link.