google / prefab

Prefab is a tool for generating build system integrations for prebuilt C/C++ libraries.
https://google.github.io/prefab/
Apache License 2.0
210 stars 32 forks source link

[FR] Bundle sources with prefab archive #182

Closed madebr closed 6 months ago

madebr commented 6 months ago

Is your feature request related to a problem? Please describe.

When debugging prebuilt (OSS) libraries in a prefab archive, disassembled code is shown instead of the source code. It would be useful to bundle the sources somehow such that you don't have to select the file on your disk for each source file.

Describe the solution you'd like

  1. define a path + scheme inside aar archives in which we can put source code
  2. prefab's gradle/ndk-build bindings should make these paths available to Android Studio/gdb such that developers don't need to manually select a local source file anymore

Describe alternatives you've considered

(none)

Additional context

In short, we want to avoid messages like these: image

This is useful for users of the open source SDL library, such that they can easily debug their app and answer our questions about SDL's internals when something goes wrong.

DanAlbert commented 6 months ago

Duplicate of https://github.com/google/prefab/issues/65. Unfortunately useless without support from the Android Studio side, and that's apparently not feasible (see the linked bug attached to the dup).

madebr commented 6 months ago

That's sad. For it to work, we would just need to execute one command in the debugger:

settings set target.source-map /path/to/SDL/on/build/machine /path/to/extracted/SDL/by/prefab
DanAlbert commented 6 months ago

It's an area I know nothing about, so you'd have to talk to the Studio folks if you think "infeasible" is not true.