On Sat, May 15, 2021 at 4:56 PM Samuel Thibault <[email protected]> wrote: > > * rpctrace has to learn to parse defs, instead of (or in addition to) msgids > > * GNU MIG needs to be taught to emit more info into msgids files > > Either of those. Probably the latter would be more interesting > long-term. We could introduce a new file format that encodes the RPCs > in a way that is easy to parse for programs, similary to what the msgid > files, does, but more powerful.
Well, it just so happens that I have some experience in extending MIG for precisely this purpose. Darwin uses untyped MIG, so we couldn't just make xtrace iterate over data items like rpctrace does. Instead I extended Darling MIG to generate a separate C source file, fooXtraceMig.c, in addition to fooUser.c and fooServer.c. The file consists of routines that can parse a message blob back into its arguments; this is then built into dynamic libraries that are installed into a special directory and dlopened by xtrace on startup. But I don't think we want to go all loadable dynamic libraries for rpctrace; typed MIG makes this much easier to do with just a declarative format. Sergey
