[oss-devel] A useful debugging source

Yair K. cesium2 at gmail.com
Tue Jan 22 04:52:17 EET 2008


Hi,

  The attached source, when compiled to a library and LD_PRELOADed,  will 
write which ioctls an app sends to OSS's "/dev/dsp" to stderr. It's useful 
for debugging, especially when an application isn't open source. However, 
it's hackish and may only work only on Linux. To build and run:

 1) cc -fPIC -shared -Wl,-soname,libwrap_ioctl.so.1 -I/usr/lib/oss/include
    -I/usr/include -o libwrap_ioctl.so.1.0 -ldl ioctlw.c
 2) LD_PRELOAD=libwrap_ioctl.so.1.0 (app).

[1] With thanks to 
http://scaryreasoner.wordpress.com/2007/11/17/using-ld_preload-libraries-and-glibc-backtrace-function-for-debugging/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ioctlw.c.gz
Type: application/x-gzip
Size: 1575 bytes
Desc: not available
Url : http://mailman.opensound.com/pipermail/oss-devel/attachments/20080122/4d9d33ee/attachment.bin 


More information about the oss-devel mailing list