>>>>> "c" == chromatic  <[EMAIL PROTECTED]> writes:

  c> I ran this program in lieu of the debugger:

i recall an old trick i learned to get offsets into structs which would
be easier to read than hex addresses:

  c> int main ()
  c> {
  c>     SDL_KeyboardEvent kbevent;
  c>     printf( "0x%08X event\n", &kbevent );
  c>     printf( "0x%08X event.type\n", &kbevent.type );

<untested>

        printf( "%d event.type\n", (char *)&kbevent.type ) - (char *)&kbevent ;

it can be made into a macro IIRC for ease of use.

that could be done with a perl script for any structure and it could
generate an offset map for the given environment. that map could be used
by parrot to access members in a portable way.

so the script would parse a structure, generate a set of those prints
(with the right format output) and compile it with the same tools as
parrot. run that little c program and save the output in a file. parrot
reads that file and uses it as a name to offset map for that structure.

want me to hack up this little script and c generation stuff? the hard
part is parsing the struct so i would have to assume some simple format
and not full c for the moment. the only thing needed by the parser is
all the member names.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to