> Since posting from opensolaris.org seems to get rejected, I'm trying > this again... > > > I'm currently finishing off some loose ends before (hopefully) > integrating a non-encumbered libdisasm.so for sparc. During this, > I've run into a minor issue with the kmdb build. I'd like to get some > guidance on an approach. > > Basically, in my code, I utilize a 'bprintf' function for outputting > text. It simplifies the code and keeps all the bits for tracking the > length of the buffer in one place (instead of spread all over the > place). However it utilizes vsnprintf to do this. This is where the > issue comes in > > mdb_modapi only exposes mdb_snprintf, so this is an issue with the kmdb build. > > I can think of three different options: > - I can rewrite the code to only utilize snprintf, though it would > clutter the code a bit > - I can make it reference mdb_iob_vsnprintf > - Or, I can add mdb_vsnprintf to mdb_modapi and use the same technique > currently used for snprintf > > Any thoughts, suggestions would be helpful.
The easiest way to do this is to provide a small set of stubs with the kmdb build. For example, if you standardize your code around bprintf or whatever, then in the kmdb build, provide a small wrapper file that declares bprintf as a small C function that calls mdb_iob_vsnprintf inside of it. -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/