Skip to content

Commit

Permalink
Also support --no-relocatable in perl6-debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatZim committed Mar 20, 2019
1 parent 090f1c9 commit 4a7c487
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/perl6-debug.nqp
Expand Up @@ -445,6 +445,17 @@ class Perl6::Debugger is Perl6::Compiler {
} }


sub MAIN(*@ARGS) { sub MAIN(*@ARGS) {
# XXX Parrot compat hack.
if nqp::islist(@ARGS[0]) {
@ARGS := @ARGS[0];
}

# Initialize dynops.
nqp::p6init();

# Create and configure compiler object.
my $comp := Perl6::Debugger.new();

# Determine Perl6 and NQP dirs. # Determine Perl6 and NQP dirs.
my $sep := nqp::backendconfig()<osname> eq 'MSWin32' ?? '\\' !! '/'; my $sep := nqp::backendconfig()<osname> eq 'MSWin32' ?? '\\' !! '/';
#?if jvm #?if jvm
Expand All @@ -454,27 +465,23 @@ sub MAIN(*@ARGS) {
#?if !jvm #?if !jvm
my $exec-dir := nqp::substr(nqp::execname(), 0, nqp::rindex(nqp::execname(), $sep)); my $exec-dir := nqp::substr(nqp::execname(), 0, nqp::rindex(nqp::execname(), $sep));
#?endif #?endif
my $perl6-home := nqp::getenvhash()<PERL6_HOME> // $exec-dir ~ '/../share/perl6'; my $perl6-home := $comp.config<static_perl6_home>
if (nqp::substr($perl6-home, nqp::chars($perl6-home) - 1) eq $sep) { // nqp::getenvhash()<PERL6_HOME>
// $exec-dir ~ '/../share/perl6';
if nqp::substr($perl6-home, nqp::chars($perl6-home) - 1) eq $sep {
$perl6-home := nqp::substr($perl6-home, 0, nqp::chars($perl6-home) - 1); $perl6-home := nqp::substr($perl6-home, 0, nqp::chars($perl6-home) - 1);
} }
my $nqp-home := nqp::getenvhash()<NQP_HOME> // $exec-dir ~ '/../share/nqp';
if (nqp::substr($nqp-home, nqp::chars($nqp-home) - 1) eq $sep) { my $nqp-home := $comp.config<static_nqp_home>
// nqp::getenvhash()<NQP_HOME>
// $exec-dir ~ '/../share/nqp';
if nqp::substr($nqp-home, nqp::chars($nqp-home) - 1) eq $sep {
$nqp-home := nqp::substr($nqp-home, 0, nqp::chars($nqp-home) - 1); $nqp-home := nqp::substr($nqp-home, 0, nqp::chars($nqp-home) - 1);
} }

nqp::bindhllsym('perl6', '$PERL6_HOME', $perl6-home); nqp::bindhllsym('perl6', '$PERL6_HOME', $perl6-home);
nqp::bindhllsym('perl6', '$NQP_HOME', $nqp-home); nqp::bindhllsym('perl6', '$NQP_HOME', $nqp-home);


# XXX Parrot compat hack.
if nqp::islist(@ARGS[0]) {
@ARGS := @ARGS[0];
}

# Initialize dynops.
nqp::p6init();

# Create and configure compiler object.
my $comp := Perl6::Debugger.new();
$comp.language('perl6'); $comp.language('perl6');
$comp.parsegrammar(Perl6::HookGrammar); $comp.parsegrammar(Perl6::HookGrammar);
$comp.parseactions(Perl6::HookActions); $comp.parseactions(Perl6::HookActions);
Expand Down

0 comments on commit 4a7c487

Please sign in to comment.