view release on metacpan or search on metacpan
or, as part of a `Struct[ ... ]`.
## `DumpHex( ... )`
```
DumpHex( $ptr, $length );
```
Dumps `$length` bytes of raw data from a given point in memory.
This is a debugging function that probably shouldn't find its way into your
code and might not be public in the future.
# Types
Raku offers a set of native types with a fixed, and known, representation in
memory but this is Perl so we need to do the work ourselves with a pseudo-type
system. Affix supports the fundamental types (void, int, etc.), aggregates
(struct, array, union), and .
## Fundamental Types with Native Representation
dyncall/ChangeLog view on Meta::CPAN
o aggregate-by-value (struct, union) support for x64 (win and sysv; thanks Raphael Luba!)
o new aggregate description interface DCaggr replacing stale DCstruct (latter had shortcomings, was
mostly unused as it lacked stable implementations, didn't handle unions, ...)
o new calling convention modes for thiscalls (platform agnostic DC_CALL_C_DEFAULT_THIS, as well as
DC_CALL_C_X64_{WIN64,SYSV}_THIS (needed to handle C++ ABI rules for returning aggregates by value)
o new signature character for platform agnostic thiscalls ('*' / DC_SIGCHAR_CC_THISCALL)
o dcCallF(), dcVCallF(), dcArgF() and dcVArgF() don't implicitly call dcReset()
anymore, which was unflexible (breaking change)
o added macros to feature test implementation for aggregate-by-value and syscall support
o windows/x64/masm directives added to specify how stack unwinds (help for
debuggers, exception handling, etc.; thanks Raphael Luba!)
o fixed detection of native thiscall callconv for builds not using MSVC but using (or adhering to)
the MSVC runtime (e.g. ReactOS' MinGW based RosBE)
o BSD syscall segfault fix
dyncallback:
o new, portable aggregate-by-value callback argument interface
o aggregate-by-value (struct, union) support for x64 (win and sysv; thanks Raphael Luba!)
o x64/windows masm directives for frame unwinding information (as dbg help; thanks Raphael Luba!)
o sparc64 callback crash fix
dynload:
o build fix for ReactOS with RosBE/cmake/mingw-make environment
dyncall/buildsys/mk/pcc.mk view on Meta::CPAN
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
#//////////////////////////////////////////////////////////////////////////////
#@@@ add stuff for crosscompiling here.
CC = pcc
LD = pcc
#@@@.if $(BUILD_CONFIG) == "debug"
#@@@ add -g option or similar
#@@@.endif
CPPFLAGS = -D__Plan9__ -D__${objtype}__
CFLAGS = -D__Plan9__ -D__${objtype}__ -I$TOP/dyncall -I$TOP/dyncallback -c
#CXXFLAGS = $CXXFLAGS -D__Plan9__
#ASFLAGS = -D__Plan9__
# @@@ used to convert GAS sources
# /^$/d # Remove empty lines.
# /^#.*/d # Remove comments.
dyncall/buildsys/nmake/tool_msvc.nmake view on Meta::CPAN
AR =lib
!IF "$(BUILD_ARCH)" == "x64"
AS =ml64
!ELSE IF "$(BUILD_ARCH)" == "x86"
AS =ml
!ENDIF
LD =link
ASFLAGS = /c /nologo
!IF "$(BUILD_CONFIG)" == "debug"
CFLAGS = /EHsc /GR- /GS- /Od /c /nologo /I$(TOP)\dyncall /I$(TOP)\dyncallback /DEBUG /Z7
LDFLAGS = /NOLOGO /DEBUG
ARFLAGS = /NOLOGO /DEBUG
!ELSE
CFLAGS = /EHsc /GR- /GS- /Ox /c /nologo /I$(TOP)\dyncall /I$(TOP)\dyncallback
LDFLAGS = /OPT:REF /OPT:ICF /NOLOGO
ARFLAGS = /NOLOGO
!ENDIF
CXXFLAGS = $(CFLAGS)
dyncall/configure view on Meta::CPAN
;;
PSP)
SDKROOT="`psp-config --pspsdk-path`"
printf "CC=psp-gcc\n" >>$C
printf "CXX=psp-gcc\n">>$C # don't use psp-g++, buggy
printf "AR=psp-ar\n" >>$C
printf "CFLAGS=-I${SDKROOT}/include/\n" >>$C
printf "CXXFLAGS=-I${SDKROOT}/include/\n" >>$C
# Pulling in dyncall libs below is a hack, for some reason psp-ld is super-picky about order.
# Use your C lib of choice, from the PSPSDK, or...
#printf "LDLIBS=-L${SDKROOT}/lib/ -L${SRCTOP}/dyncall -L${SRCTOP}/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lpsplibc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputili...
# ... newlib.
printf "LDLIBS=-L${SDKROOT}/lib/ -L${SRCTOP}/dyncall -L${SRCTOP}/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputilit...
;;
?)
cat $0 | awk '/^esac$/{b=0}/^ [A-Za-z0-9|]+\)/{if(b==1) print substr($1,1,length($1)-1)}BEGIN{b=0}/^case.*TARGET.*uname.*in$/{b=1}' | tr '|' '\n'
exit 0
;;
esac
# removed, b/c platform support not consistent and ELF flags checked often not having any result
#
dyncall/doc/manual/manual_devel.tex view on Meta::CPAN
that API (e.g. calling convention mode switches, aggregates, ...) but is not extensive.
\item [malloc\_wx]
Tests \emph{writable and executable memory allocation} used by the
\product{dyncallback} C API.
\item [thunk]
Tests only the \emph{callback} thunks for the \product{dyncallback} C API.
\item [callback\_plain]
Simple callback function test (useful for easy debugging of new ports).
\item [callback\_suite]
Mass test suite for callback function testing. Uses random function argument
number and type.
A Lua script the tests up to a given number of calls and type combinations.
\item [resolv\_self]
Test for dynload library to resolve symbols from application image itself.
\end{description}
dyncall/dyncall/dyncall_call_mips_n32.S view on Meta::CPAN
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
.section .mdebug.abiN32
.previous
.abicalls
.text
.align 2
.globl dcCall_mips_n32
.ent dcCall_mips_n32
dcCall_mips_n32:
/* Stack-frame prolog */
dyncall/dyncall/dyncall_call_mips_n64.S view on Meta::CPAN
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
.section .mdebug.abi64
.previous
.abicalls
.text
.align 2
.globl dcCall_mips_n64
.ent dcCall_mips_n64
dcCall_mips_n64:
/* Stack-frame prolog */
dyncall/dyncall/dyncall_call_mips_o32.S view on Meta::CPAN
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $4 target function */
/* $5 register data */
/* $6 stack size (guaranteed to be >= 16b and multiple of 8b) */
/* $7 stack data */
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl dcCall_mips_o32
.ent dcCall_mips_o32
.type dcCall_mips_o32, @function
dcCall_mips_o32:
.frame $fp,40,$31 /* vars=8, regs=2/0, args=16, gp=8 */
.mask 0xc0000000,-4
dyncall/dyncallback/dyncall_callback_mips_n32.S view on Meta::CPAN
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
.section .mdebug.abiN32
.previous
.abicalls
.text
.align 2
.globl dcCallbackThunkEntry
.ent dcCallbackThunkEntry
dcCallbackThunkEntry:
.end dcCallbackThunkEntry
dyncall/dyncallback/dyncall_callback_mips_n64.S view on Meta::CPAN
#if defined(DC__ABI_HARDFLOAT)
SP_SP = 160
#else
SP_SP = 96
#endif
SP_LR = SP_SP-8
SP_RVAL = SP_SP-16
SP_ARG_SP = SP_SP-24
SP_ARG_RC = SP_SP-32
.section .mdebug.abi64
.previous
.abicalls
.text
.align 2
.globl dcCallbackThunkEntry
.ent dcCallbackThunkEntry
dcCallbackThunkEntry:
.set noreorder
/* Prolog. */
dyncall/dyncallback/dyncall_callback_mips_o32.S view on Meta::CPAN
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* input:
$t4 -> thunk
$t4+20 -> cb handler
$t4+24 -> userdata
*/
.section .mdebug.abi32
.previous
.abicalls
.text
.align 2
.globl dcCallbackThunkEntry
.ent dcCallbackThunkEntry
.type dcCallbackThunkEntry, @function
/* Called by thunk - thunk stores pointer to DCCallback in $12 ($t4), and */
/* pointer to called function in $25 ($t9, required for PIC) */
dyncall/dynload/dynload_syms_mach-o.c view on Meta::CPAN
if(!pSyms)
return NULL;
nl = pSyms->pSymbolTable + index;
t = nl->n_type & N_TYPE;
/* Return name by lookup through it's address. This guarantees to be consistent with dlsym and dladdr */
/* calls as used in dlFindAddress and dlSymsNameFromValue - the "#if 0"-ed code below returns the */
/* name directly, but assumes wrongly that everything is prefixed with an underscore on Darwin. */
/* only handle symbols that are in a section and aren't symbolic debug entries */
if((t == N_SECT) && (nl->n_type & N_STAB) == 0)
return dlSymsNameFromValue(pSyms, (void*)(nl->n_value + pSyms->symOffset));
return NULL; /* @@@ handle N_INDR, etc.? */
#if 0
/* Mach-O manual: Symbols with an index into the string table of zero */
/* (n_un.n_strx == 0) are defined to have a null ("") name. */
if(nl->n_un.n_strx == 0)
return NULL; /*@@@ have return pointer to some static "" string? */
dyncall/test/common/platformInit.h view on Meta::CPAN
#define PLATFORMINIT_H
#include "../../dyncall/dyncall_macros.h"
#if defined(DC__OS_NDS)
# include <nds.h>
# include <stdio.h>
#elif defined(DC__OS_PSP)
# include <pspkernel.h>
# include <pspdebug.h>
# include <pspdisplay.h>
# include <stdio.h>
# define printf pspDebugScreenPrintf
/* All other platforms, usually just pulling in standard headers and empty init function. */
#else
# if defined(__cplusplus)
# if defined(__SUNPRO_CC) || defined(__ANDROID__) /* needed by SunPro .. otherwise printf not included */
# include <stdio.h>
# else
# include <cstdio>
lib/Affix.pm view on Meta::CPAN
The source pointer would have normally been obtained from a call to a native
subroutine that returned a pointer, a lvalue pointer to a native subroutine,
or, as part of a C<Struct[ ... ]>.
=head2 C<DumpHex( ... )>
DumpHex( $ptr, $length );
Dumps C<$length> bytes of raw data from a given point in memory.
This is a debugging function that probably shouldn't find its way into your
code and might not be public in the future.
=head1 Types
Raku offers a set of native types with a fixed, and known, representation in
memory but this is Perl so we need to do the work ourselves with a pseudo-type
system. Affix supports the fundamental types (void, int, etc.), aggregates
(struct, array, union), and .
=head2 Fundamental Types with Native Representation