Skip to content

Instantly share code, notes, and snippets.

@Skarsnik
Created November 28, 2021 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Skarsnik/611d0211fb95b94604a6277c430da149 to your computer and use it in GitHub Desktop.
Save Skarsnik/611d0211fb95b94604a6277c430da149 to your computer and use it in GitHub Desktop.
resolvetype();
sub fix-struct-name { # CASTXML does not give a name to struct defined like typedef struct {} name
# Also does not give nice name to anonymous struct in union
say "fix stuff";
for %structs.keys -> $id {
next if %structs{$id} !~~ Struct; # Line 398
say %structs{$id};
if %structs{$id}.name eq $PLACEHOLDER {
# Merging typedef struct {}
for @typedefs -> $td {
if $td.ref-id eq $id {
say "merging struct ", $id , " with typedef ", $td.id;
%structs{$id}.name = $td.name;
%structs{$id}.id = $td.id;
%types{$id}.id = $td.id;
%types{$id}.name = $td.name;
%types{$td.id} = %types{$id};
%types{$id}:delete;
%structs{$td.id} = %structs{$id};
%structs{$id}:delete;
@typedefs.splice(@typedefs.first($td, :k), 1);
last;
}
}
}
}
(gdb) bt
#0 0x00007fffff12c896 in MVM_str_hash_key_is_valid (key=0x7ffffe8850d0, tc=0x8006110) at src/6model/reprs/MVMNull.h:11
#1 MVM_str_hash_fetch (want=0x7ffffe8850d0, hashtable=0x7ffffe710350, tc=0x8006110)
at src/core/str_hash_table_funcs.h:369
#2 MVMHash_at_key (tc=0x8006110, st=0x806e1a8, root=<optimized out>, data=0x7ffffe710350, key_obj=0x7ffffe8850d0,
result=0x84080b0, kind=8) at src/6model/reprs/MVMHash.c:98
#3 0x00007ffffd1301b7 in ?? ()
#4 0x0000000000000008 in ?? ()
#5 0x769c85a241999b00 in ?? ()
#6 0x0000000000000010 in ?? ()
#7 0x0000000000000048 in ?? ()
#8 0x00007ffffe6e2be8 in ?? ()
#9 0x000000000b71b8b8 in ?? ()
#10 0x0000000000000000 in ?? ()
(gdb) MVM_dump_backtrace(tc)
Undefined command: "MVM_dump_backtrace". Try "help".
(gdb) call MVM_dump_backtrace(tc)
at SETTING::src/core.c/Hash.pm6:35 (/home/skarsnik/raku/share/perl6/runtime/CORE.c.setting.moarvm:AT-KEY)
from SETTING::src/core.c/hash_slice.pm6:7 (/home/skarsnik/raku/share/perl6/runtime/CORE.c.setting.moarvm:postcircumfix:<{ }>)
from bin/gptrixie:398 (<ephemeral file>:)
from bin/gptrixie:397 (<ephemeral file>:fix-struct-name)
from bin/gptrixie:441 (<ephemeral file>:do-magic)
from bin/gptrixie:79 (<ephemeral file>:MAIN)
from SETTING::src/core.c/Main.pm6:380 (/home/skarsnik/raku/share/perl6/runtime/CORE.c.setting.moarvm:)
from SETTING::src/core.c/Main.pm6:376 (/home/skarsnik/raku/share/perl6/runtime/CORE.c.setting.moarvm:)
from SETTING::src/core.c/Main.pm6:375 (/home/skarsnik/raku/share/perl6/runtime/CORE.c.setting.moarvm:RUN-MAIN)
from bin/gptrixie:196 (<ephemeral file>:<unit>)
from bin/gptrixie:1 (<ephemeral file>:<unit-outer>)
from gen/moar/stage2/NQPHLL.nqp:1943 (/home/skarsnik/raku/share/nqp/lib/NQPHLL.moarvm:eval)
from gen/moar/stage2/NQPHLL.nqp:2148 (/home/skarsnik/raku/share/nqp/lib/NQPHLL.moarvm:evalfiles)
from gen/moar/stage2/NQPHLL.nqp:2078 (/home/skarsnik/raku/share/nqp/lib/NQPHLL.moarvm:command_eval)
from gen/moar/Compiler.nqp:111 (/home/skarsnik/raku/share/perl6/lib/Perl6/Compiler.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:2033 (/home/skarsnik/raku/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/rakudo.nqp:127 (/home/skarsnik/raku/share/perl6/runtime/perl6.moarvm:MAIN)
from gen/moar/rakudo.nqp:1 (/home/skarsnik/raku/share/perl6/runtime/perl6.moarvm:<mainline>)
from <unknown>:1 (/home/skarsnik/raku/share/perl6/runtime/perl6.moarvm:<main>)
from <unknown>:1 (/home/skarsnik/raku/share/perl6/runtime/perl6.moarvm:<entry>)
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment