-
Notifications
You must be signed in to change notification settings - Fork 1.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
[GR-41196] Provide .debug.* sections that contain build options and properties used in the build of an image. #5254
Conversation
This PR implements #5010 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine Paul and thanks for reorganizing the provider code so it is managed by the feature. Much neater.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM as well. Thanks @olpaw
var accessImpl = (FeatureImpl.BeforeImageWriteAccessImpl) access; | ||
var image = accessImpl.getImage(); | ||
var debugContext = new DebugContext.Builder(HostedOptionValues.singleton(), new GraalDebugHandlersFactory(GraalAccess.getOriginalSnippetReflection())).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the use of var
encouraged in the GraalVM code base?
If so, I will need to keep that in mind :)
(I am personally not a fan, but that's just my personal taste)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if it's easy from the context to guess what type the local is or the types are rather trivial, it's fine to use var
.
If the type is non-trivial and being explicit actually helps to understand the code better then not using var is recommended.
d155108
to
46a2e20
Compare
This PR will make native-image embed
.debug.svm.imagebuild.* sections
into an image when building with-g
. This can be used to find out what options and other settings were used to build that image.For example building
native-image -Dmy.system.property=123 HelloJava -O0 -g
results in an executablehellojava
where the following can be used: