2 messages in org.opensolaris.mdb-discuss[mdb-discuss] Fwd: building kmdb + li...
FromSent OnAttachments
Jason KingAug 31, 2007 7:59 pm.diff
Michael ShapiroSep 3, 2007 9:44 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[mdb-discuss] Fwd: building kmdb + libdisasmActions...
From:Michael Shapiro (mw@zion.eng.sun.com)
Date:Sep 3, 2007 9:44:38 am
List:org.opensolaris.mdb-discuss

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