rakudo-debugger icon indicating copy to clipboard operation
rakudo-debugger copied to clipboard

Exception Thrown: Died when debugging scripts

Open ryn1x opened this issue 6 years ago • 0 comments

Issue

perl6-debug-m commonly shows a "Exception Thrown: Died" when debugging scripts that have no errors when running outside the debugger.

So far I have noticed this happening in two scenarios:

  • When a script has a MAIN() sub
  • When a script calls Native subs

It is also of note that the message happens in threes with Native subs.

Scenario 1:

Perl6 script:

#!/usr/bin/env perl6
use v6.c;

sub hi( $name ) {say "Hi, $name"}

sub MAIN() {
    hi 'Camelia';
}

Debugger output:

$ perl6-debug-m debugger.p6
>>> LOADING debugger.p6
+ Exception Thrown
| Died
+ debugger.p6 (4 - 8)
| sub hi( $name ) {say "Hi, $name"}
| 
| sub MAIN() {
|     hi 'Camelia';
| }
> 
+ debugger.p6 (5 - 9)
| 
| sub MAIN() {
|     hi 'Camelia';
| }
| 
> 
+ debugger.p6 (2 - 6)
| use v6.c;
| 
| sub hi( $name ) {say "Hi, $name"}
| 
| sub MAIN() {
> 
Hi, Camelia

Scenario 2

C source:

#include <stdio.h>

void hello() {
   printf("Hello from C!\n");
}

Perl6 script:

#!/usr/bin/env perl6
use v6.c;
use NativeCall;

sub hello() is native('hello') { * }

sub MAIN() {
    hello;
}

Debugger output:

$ perl6-debug-m debugger_native.p6
>>> LOADING debugger_native.p6
>>> LOADING EVAL_1
+ EVAL_1 (1 - 1)
| CompUnit::DependencySpecification.new(short-name => "NativeCall::Types", s...
> 
>>> LOADING EVAL_2
+ EVAL_2 (1 - 1)
| CompUnit::DependencySpecification.new(short-name => "NativeCall::Types", s...
> 
>>> LOADING EVAL_3
+ EVAL_3 (1 - 1)
| CompUnit::DependencySpecification.new(short-name => "NativeCall::Compiler:...
> 
>>> LOADING EVAL_4
+ EVAL_4 (1 - 1)
| CompUnit::DependencySpecification.new(short-name => "NativeCall::Compiler:...
> 
+ Exception Thrown
| Died
+ debugger_native.p6 (5 - 9)
| sub hello() is native('hello') { * }
| 
| sub MAIN() {
|     hello;
| }
> 
+ debugger_native.p6 (6 - 10)
| 
| sub MAIN() {
|     hello;
| }
| 
> 
+ Exception Thrown
| Died
+ debugger_native.p6 (6 - 10)
| 
| sub MAIN() {
|     hello;
| }
| 
> 
+ Exception Thrown
| Died
+ debugger_native.p6 (6 - 10)
| 
| sub MAIN() {
|     hello;
| }
| 
> 
+ Exception Thrown
| Died
+ debugger_native.p6 (6 - 10)
| 
| sub MAIN() {
|     hello;
| }
| 
> 
Hello from C!

Environment

  • Operating system: openSUSE Tumbleweed
  • Compiler version (perl6 -v): This is Rakudo version 2018.12 built on MoarVM version 2018.12 implementing Perl 6.d.

ryn1x avatar Dec 24 '18 01:12 ryn1x