Skip to content

[GR-41196] Provide .debug.* sections that contain build options and properties used in the build of an image #5010

@olpaw

Description

@olpaw

Feature request

During the 2022 GraalVM meetup JetBrains (@vvlevchenko & Yuriy Artamonov) asked for a way to figure out for an image with which flags it was built.

When we build with -g we can provide additional sections in the image that contain the following information:

  • .debug.svm.imagebuild.classpath and .debug.svm.imagebuild.modulepath
    Those two sections will contain the full classpath and modulepath that was passed to the builder when building the image
  • .debug.svm.imagebuild.arguments
    Contains all raw arguments that were passed to the builder when building the image
  • .debug.svm.imagebuild.java.properties
    Contains all system properties that were passed to the builder when building the image

Having all those extra section in the .debug.* section namespace makes sure that stripping the binary (with the standard strip tool from binutils) will remove them from the binary if needed.

This extra information in debug images will allow users (or the IDE) to know how an native image was built. This can be useful to determine if the image was built with -H:Optimize=1 so that an IDE knows that the debugging experience will be sub-optimal.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions