view test/callback_suite/README.txt @ 533:71c884e610f0

- integration of patches from Raphael Luba, Thekla, Inc.: * integration of aggregate-by-value (struct, union) support patch for x64 (win and sysv) * windows/x64 asm additions to specify how stack unwinds (help for debuggers, exception handling, etc.) * see Changelog for details - new calling convention modes for thiscalls (platform agnostic, was specific before) * new signature character for platform agnostic thiscalls ('*' / DC_SIGCHAR_CC_THISCALL) - dcCallF(), dcVCallF(), dcArgF() and dcVArgF(): * added support for aggregates-by-value (wasn't part of patch) * change that those functions don't implicitly call dcReset() anymore, which was unflexible (breaking change) - added macros to feature test implementation for aggregate-by-value and syscall support - changed libdyncall_s.lib and libdyncallback_s.lib order in callback test makefiles, as some toolchains are picky about order - doc: * man page updates to describe aggregate interface * manual overview changes to highlight platforms with aggregate-by-value support - test/plain: replaced tests w/ old/stale sctruct interface with new aggregate one
author Tassilo Philipp
date Thu, 21 Apr 2022 13:35:47 +0200
parents 95f6f43178ed
children
line wrap: on
line source

Callback Test Suite
-------------------


CONFIGURE SUITE

  needs lua: edit config.lua and run "make config".


DESCRIPTION

Generates a set of callback invokers in C using lua as a preprocessor.

The invokers pass random arguments to the callback to test, from a set of
reference values which are argument type- and position-specific.


The Callback Invocation Body

Example:
The body for a signature of type  "dpdf)p" at case id 19 is:

void f19(void* addr) 
{ 
  V_p[4] = ((p(*)(d,p,d,f))addr)(K_d[0],K_p[1],K_d[2],K_f[3]);
}                          ^^^^- dyncallback object
             ^^^^^^^^^^^^^- signature
     ^- return type                ^- args from reference values (to be retrieved in handler)


The K_? values are the reference values, which are supposed to be copied to
V_?, and are compared for identity after invocation. The arguments are copied
to V_? in the callback handler, called through "addr".

The reference values stored in K_? are generated once, randomly, at startup.


Specific calling conventions:

Specify 'api' and 'ccprefix' accordingly to generate callbacks for a
specific/custom calling convention:

"__stdcall"  "_s"
"__fastcall" "_f" for gcc compiler
             "_F" for microsoft compiler

See the dyncall documentation for other/more calling convention prefixes.