Skip to content

Instantly share code, notes, and snippets.

Created September 26, 2016 10:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/13aa8546fac1294601bbb54fa44f5fb6 to your computer and use it in GitHub Desktop.
$ jdb -attach 8000 -sourcepath src/vm/jvm/runtime/:nqp/src/vm/jvm/runtime/:src/:nqp/src/:.:nqp/
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
VM Started: > No frames on the current call stack
main[1] stop in org.perl6.nqp.runtime.NativeCallOps:61
Deferring breakpoint org.perl6.nqp.runtime.NativeCallOps:61.
It will be set after the class is loaded.
main[1] run
> Set deferred breakpoint org.perl6.nqp.runtime.NativeCallOps:61
Breakpoint hit: "thread=main", org.perl6.nqp.runtime.NativeCallOps.build(), line=61 bci=0
61 NativeCallBody call = getNativeCallBody(tc, target);
main[1] list
57 return 1L;
58 }
59
60 public static long build(SixModelObject target, String libname, String symbol, String convention, SixModelObject arguments, SixModelObject returns, ThreadContext tc) {
61 => NativeCallBody call = getNativeCallBody(tc, target);
62
63 try {
64 /* Load the library and locate the symbol. */
65 /* TODO: Error handling! */
66 NativeLibrary library = libname == null || libname.equals("")
main[1] locals
Method arguments:
target = instance of __P6opaque__77(id=4656)
libname = "/home/psch/rakudo/rakudo/lib19-function-pointers.so"
symbol = "ReturnFunctionPointer"
convention = ""
arguments = instance of org.perl6.nqp.sixmodel.reprs.VMArrayInstance(id=4660)
returns = instance of org.perl6.nqp.sixmodel.reprs.VMHashInstance(id=4661)
tc = instance of org.perl6.nqp.runtime.ThreadContext(id=4662)
Local variables:
# up to here is the original build() call, for the function that returns the func ptr
# the following i can only assume is the function that's in the pointer
main[1] cont
>
Breakpoint hit: "thread=main", org.perl6.nqp.runtime.NativeCallOps.build(), line=61 bci=0
61 NativeCallBody call = getNativeCallBody(tc, target);
main[1] list
57 return 1L;
58 }
59
60 public static long build(SixModelObject target, String libname, String symbol, String convention, SixModelObject arguments, SixModelObject returns, ThreadContext tc) {
61 => NativeCallBody call = getNativeCallBody(tc, target);
62
63 try {
64 /* Load the library and locate the symbol. */
65 /* TODO: Error handling! */
66 NativeLibrary library = libname == null || libname.equals("")
main[1] locals
Method arguments:
target = instance of __P6opaque__77(id=4724)
libname = "" # and these here
symbol = "" # look at least a little
convention = "" # concerning
arguments = instance of org.perl6.nqp.sixmodel.reprs.VMArrayInstance(id=4726)
returns = instance of org.perl6.nqp.sixmodel.reprs.VMHashInstance(id=4727)
tc = instance of org.perl6.nqp.runtime.ThreadContext(id=4662)
Local variables:
main[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment