Modifications to x86 __attribute__(__thiscall__) and __attribute__(cdecl) calling conventions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To whom it may concern,

In the interests of improving the type-safety of our future var_args
implementation in an OS project I have founded, we are possibly
interested in implementing some slight variations of the cdecl and
thiscall conventions for the x86 architecture (thiscall2 and cdecl2.)

Can anybody please help us locate where exactly in gcc-trunk's
sourcecode the implementations of these conventions would be
located?

Our modifications to thiscall and cdecl would include the following
(in a general sort of order)-
ÂÂ - PUSH the number of arguments used in a "..." before the list of
arguments begins
ÂÂ - PUSH the total size of the arguments used in a "..." call before
the list of arguments begins
ÂÂ - Before each argument, push an 8-bit 'arguments' flag denoting
whether or not the type being pushed is (or resolves to):
  0. is a signed type (1 if yes, 0 if no).
ÂÂ ÂÂ 1. is an integer
  2. is a  char
  3. is a  short
  4. is a  long
  5. is a  double
ÂÂ ÂÂ 6. is aÂÂ long-long
ÂÂ ÂÂ 7. is an complex/compound type (ie. struct, class, etc.)

This way, our standard libraries and debugging tools could (at-least
semi-)accurately deduce types and function call usage
patterns for var_args code being debugged on our OS.

Thanks in advance,
- Robert



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux