Skip to content

Commit

Permalink
[GR-53747] Enable debug mode for native-image and native-image-config…
Browse files Browse the repository at this point in the history
…ure.

PullRequest: graal/17638
  • Loading branch information
fniephaus committed May 2, 2024
2 parents d3d36e1 + 1cc9f38 commit 0c7497f
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 0c7497f

Please sign in to comment.