Skip to content
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-53747] Enable debug mode for native-image and native-image-configure. #8861

Merged
merged 2 commits into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2023,20 +2023,24 @@ def native_image_on_jvm(args, **kwargs):
for key, value in javaProperties.items():
args.append("-D" + key + "=" + value)

arg = [executable]
jacoco_args = mx_gate.get_jacoco_agent_args(agent_option_prefix='-J')
if jacoco_args is not None:
arg += jacoco_args
arg += args
mx.run(arg, **kwargs)
mx.run([executable] + _debug_args() + args, **kwargs)

@mx.command(suite.name, 'native-image-configure')
def native_image_configure_on_jvm(args, **kwargs):
executable = vm_executable_path('native-image-configure')
if not exists(executable):
mx.abort("Can not find " + executable + "\nDid you forget to build? Try `mx build`")
mx.run([executable] + args, **kwargs)
mx.run([executable] + _debug_args() + args, **kwargs)

def _debug_args():
debug_args = get_jdk().debug_args
if debug_args and not mx.is_debug_disabled():
# prefix debug args with `--vm.` for bash launchers
return [f'--vm.{arg[1:]}' for arg in debug_args]
return []

@mx.command(suite.name, 'native-unittest')
def native_unittest(args):
Expand Down