KMDF dbgext wdfkd.wdfspinlock , FORCEINLINE, and debug builds

Ok, so the tempation to quote the excelent “I need a hole in my head” blog
masthead is too great to avoid and I appologize in advance but gosh, I need
a hole in my head!

somebody call the compiler guys and let them know that __forceinline (or in
DDK land FORCEINLINE) really ought to do just that!

You know what the otherwise excelent wdfkd.wdfspinlock extension tells me is
the callers address in a debug build? (drum roll…)
!WdfSpinLockAcquire(). Geez, that is useful.

But seriously, does anyone have any suggestions on how to leverage this
capability when working with a debug build other than forcing /Ob1 for the
entire build or is that the only way? I would, of course, like to have my
cake and eat it too. I use FORCEINLINE functions all over the place and I
don’t want to unecessarilly expand them all (but that is where I am going
now until I find this spinlock issue).

TIA,
-dave

By design that FORCEINLINE evaluates to a real symbol on a chk build,
makes debugging easier, but as you point out, it has unintended
sideaffects. I don’t have a good solution on how to overcome this
feature on chk build and get the real caller’s address

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Friday, May 11, 2007 11:34 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF dbgext wdfkd.wdfspinlock , FORCEINLINE, and debug
builds

Ok, so the tempation to quote the excelent “I need a hole in my head”
blog masthead is too great to avoid and I appologize in advance but
gosh, I need a hole in my head!

somebody call the compiler guys and let them know that __forceinline (or
in DDK land FORCEINLINE) really ought to do just that!

You know what the otherwise excelent wdfkd.wdfspinlock extension tells
me is the callers address in a debug build? (drum roll…)
!WdfSpinLockAcquire(). Geez, that is useful.

But seriously, does anyone have any suggestions on how to leverage this
capability when working with a debug build other than forcing /Ob1 for
the entire build or is that the only way? I would, of course, like to
have my cake and eat it too. I use FORCEINLINE functions all over the
place and I don’t want to unecessarilly expand them all (but that is
where I am going now until I find this spinlock issue).

TIA,

-dave


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer