-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer quarkus property to enable debug symbols #9792
Comments
@emmanuelbernard sure assign it to me, but there's some obstacles to resolve before then. I started playing with debug symbols and Quarkus a few days back, which led me to finding #9750. Once that was fixed I tried to debug it with gdb 7.6, but gdb threw a segmentation fault. I tried with latest gdb 9.2 and at least that loaded the image with symbols, but I've not tried to step through the code yet to see if I can move between lines/code...etc. Assuming that works fine, the tricky thing is access to sources. Some source zip files seem to be missing which @adinn spotted oracle/graal#2551. In my local testing I was just linking to locally built src zip files. Once all of that is figure out we can wrap it up with the addition of the property. Finally, @n1hility has requested for symbols to be kept in a separate file. That's not the case at the moment; symbols are kept in the same file as the binary. I'm checking to see how much would would that involve, how we're tracking that...etc. |
OK, considering we would really like to get this one in 1.6, I propose we can add the high level Quarkus property to wire things all the way down. Whether GraalVM feature has bugs (or Quarkus has bugs) and whether we can move the symbols to a separate file, we should do as follow up tasks. |
Ah, yes, I will send the email right away. |
I created the wiki page the other day but forgot to send the email: https://github.com/quarkusio/quarkus/wiki/Release-Planning |
Done. |
@emmanuelbernard Assigned this to me, I've started work on it. |
@emmanuelbernard I've been chatting to @jerboaa and I'm thinking that |
@emmanuelbernard Might be better if we discuss it in quarkus-dev google group? |
Started a discussion on quarkus-dev about the configuration to expose. I will work with @jerboaa to see where we end up splitting symbols. |
yes I think the enum is fine. I had the same thoughts when talking with Andrew during Insights. |
What would be the values though? |
Also we need to make room for the ability to generate "more" debug symbols. Is this external file supposed to be configurable in name and location? Proposition 1: not configurable or with sensible default file name value
Proposition 2: must define a file name anyways
|
I think 1 has my preference as sensible external file name might make a lot of sense. |
I would go with |
Regarding
I would go with with |
@emmanuelbernard I'd like to avoid adding too many config values for this. OK for making the suffix configurable (defaulting to |
@emmanuelbernard I opened a quarkus-dev discussion, but anyway... I agree with @rsvoboda, something that has enable in it seems like it should be true|false. Also, note that I'd just for an enum (that allows us to introduce new options in the future, including different levels). Then, about the debug symbols external file, I'd just leave that out for now. If there's an option to set the path of the native binary, then one could modify that and get the symbols location modified along (so that it sits next to it). |
debug-symbols is a weird implementation detail for me. should it not just to include debug info or not ? i.e. |
for me what would make sense is that the debug file location default to .symbols and then have a have it default on and then you just need to do If you want to tweak settings do
|
All, further discussions in https://groups.google.com/forum/#!topic/quarkus-dev/VOSQ6zhy_vI |
* Added new debug symbol enable option, to avoid breaking existing usage. * Used objcopy to split debug symbols from binary.
* Added new debug symbol enable option, to avoid breaking existing usage. * Used objcopy to split debug symbols from binary.
…o#9792 * To avoid side-effects when building debug symbol source cache.
* Added new debug symbol enable option, to avoid breaking existing usage. * Used objcopy to split debug symbols from binary.
…9792 * Also, check src/main/java exists before adding it to the source search path.
* Add third party source jars support. * Third party jars not downloaded by default, so it requires user to call `mvn dependencies:sources` or equivalent. * If source jars are found, they're put next to the jars in the lib directory. * After generating native executable, the source jars are removed. * Application sources are added individually using -H:DebugInfoSourceSearchPath option. They're only added if the directory exists. * Debug symbols flag switched from -H:GenerateDebugInfo=1 to `-g`. * Sources cache has been moved to target/sources-cache using the -H:DebugInfoSourceCacheRoot option. This makes sources cache more closely available. gdb should discover these automatically, but it does not seem to work, so better use `set directories` pointing to them. * These changes only work on Mandrel or GraalVM 20.2, so reworked the whole GraalVM version and distribution resolution logic to make this easier to handle. * Previous ad-hoc GraalVM version resolution has been been replaced by a regex solution. * Added unit tests to verify that GraalVM versions and distributions are resolved correctly with a diverse set of `native-image --version` outputs.
* Add third party source jars support. * Third party jars not downloaded by default, so it requires user to call `mvn dependencies:sources` or equivalent. * If source jars are found, they're put next to the jars in the lib directory. * After generating native executable, the source jars are removed. * Application sources are added individually using -H:DebugInfoSourceSearchPath option. They're only added if the directory exists. * Debug symbols flag switched from -H:GenerateDebugInfo=1 to `-g`. * Sources cache has been moved to target/sources-cache using the -H:DebugInfoSourceCacheRoot option. This makes sources cache more closely available. gdb should discover these automatically, but it does not seem to work, so better use `set directories` pointing to them. * These changes only work on Mandrel or GraalVM 20.2, so reworked the whole GraalVM version and distribution resolution logic to make this easier to handle. * Previous ad-hoc GraalVM version resolution has been been replaced by a regex solution. * Added unit tests to verify that GraalVM versions and distributions are resolved correctly with a diverse set of `native-image --version` outputs.
* Add third party source jars support. * Third party jars not downloaded by default, so it requires user to call `mvn dependencies:sources` or equivalent. * If source jars are found, they're put next to the jars in the lib directory. * After generating native executable, the source jars are removed. * Application sources are added individually using -H:DebugInfoSourceSearchPath option. They're only added if the directory exists. * Debug symbols flag switched from -H:GenerateDebugInfo=1 to `-g`. * Sources cache has been moved to target/sources-cache using the -H:DebugInfoSourceCacheRoot option. This makes sources cache more closely available. gdb should discover these automatically, but it does not seem to work, so better use `set directories` pointing to them. * These changes only work on Mandrel or GraalVM 20.2, so reworked the whole GraalVM version and distribution resolution logic to make this easier to handle. * Previous ad-hoc GraalVM version resolution has been been replaced by a regex solution. * Added unit tests to verify that GraalVM versions and distributions are resolved correctly with a diverse set of `native-image --version` outputs.
* Add third party source jars support. * Third party jars not downloaded by default, so it requires user to call `mvn dependencies:sources` or equivalent. * If source jars are found, they're put next to the jars in the lib directory. * After generating native executable, the source jars are removed. * Application sources are added individually using -H:DebugInfoSourceSearchPath option. They're only added if the directory exists. * Debug symbols flag switched from -H:GenerateDebugInfo=1 to `-g`. * Sources cache has been moved to target/sources-cache using the -H:DebugInfoSourceCacheRoot option. This makes sources cache more closely available. gdb should discover these automatically, but it does not seem to work, so better use `set directories` pointing to them. * These changes only work on Mandrel or GraalVM 20.2, so reworked the whole GraalVM version and distribution resolution logic to make this easier to handle. * Previous ad-hoc GraalVM version resolution has been been replaced by a regex solution. * Added unit tests to verify that GraalVM versions and distributions are resolved correctly with a diverse set of `native-image --version` outputs.
* Add third party source jars support. * Third party jars not downloaded by default, so it requires user to call `mvn dependencies:sources` or equivalent. * If source jars are found, they're put next to the jars in the lib directory. * After generating native executable, the source jars are removed. * Application sources are added individually using -H:DebugInfoSourceSearchPath option. They're only added if the directory exists. * Debug symbols flag switched from -H:GenerateDebugInfo=1 to `-g`. * Sources cache has been moved to target/sources-cache using the -H:DebugInfoSourceCacheRoot option. This makes sources cache more closely available. gdb should discover these automatically, but it does not seem to work, so better use `set directories` pointing to them. * These changes only work on Mandrel or GraalVM 20.2, so reworked the whole GraalVM version and distribution resolution logic to make this easier to handle. * Previous ad-hoc GraalVM version resolution has been been replaced by a regex solution. * Added unit tests to verify that GraalVM versions and distributions are resolved correctly with a diverse set of `native-image --version` outputs.
Now that GraalVM has debug symbols, have a Quarkus property
e.g.
quarkus.native.debug-symbols
so it generates the image with debug symbols.
Useful in conjunction with profiles
The text was updated successfully, but these errors were encountered: