[PVFS2-developers] redo sm -> c preprocessing
Bradley W. Settlemyer
bradles at parl.clemson.edu
Wed Mar 23 18:13:29 EST 2005
I had problems with the .sm -> .c stuff related to having compiled with
-O2 on, gcc and gdb could no longer figure out the mapping. Once I
turned off -O2 during compilation, I had no problem stepping thru
the .sm file rather than the .c. The generated .c already has a
directive telling it to look in the .sm for traces and gdb -- I seem to
recall ddd not being very intelligent about the issue, but I just added
source directories and it seemed to work fine after that.
Just my experience in early to mid february (and it was msgpair that was
giving me a headache as well).
Cheers,
Brad
On Wed, 2005-03-23 at 17:58 -0500, Pete Wyckoff wrote:
> I've been debugging stuff deep inside msgpairarray. It is implemented
> as one of these state machine files that is converted from .sm to .c
> before that is compiled for real.
>
> Gdb is driving me nuts. I spent some time trying to figure out how to
> convince it that it should look in the .sm file when showing me source
> lines, but I have failed.
>
> Instead, I want to redo the .sm -> .c process like the following.
> We get rid of .sm files, renaming them to .c in the real source. Then
> we change them to add good old CPP directives:
>
> #ifdef STATE_MACHINE_PASS
> %%
>
> nested machine pvfs2_msgpairarray_sm(
> init,
> post,
> post_retry,
> complete,
> completion_fn)
> {
> state init
> {
> run msgpairarray_init;
> default => post;
> }
> [..]
> }
>
> %%
> #else
> #include "msgpairarray.sm.c"
> #endif
>
> Then we have the state machine compiler read in the C file and spit
> out a new .sm.c file into the build directory that contains just its
> little rewrite of the state machine declaration into a bunch of C union
> definitions.
>
> I can leave in the %% separators to leave the if/else/endif a bit more
> flexible, or just teach the SM compiler to look for the new ifdefs and
> constrain the C code a bit to match its expectations.
>
> Any suggestions, complaints? I'm ready to do it.
>
> -- Pete
> _______________________________________________
> PVFS2-developers mailing list
> PVFS2-developers at beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
>
More information about the PVFS2-developers
mailing list