This is an old one, but a really Good One. Is a program doing something weird you don't understand? Don't feel like wading through megalines of source? Just want to know what it does when the rubber hits the road?
Well, nothing under Linux can do anything real unless it first tells the OS to do so. A userland program can whirr away, thinking, computing, cogitating as much as it likes... but to _do_ anything, or _get_ any information, at some point it _must_ ask the OS. Enter strace. You can strace any program, or strace a running program and it will log every system call, the parameters used and the result code. Grrreat general purpose problem solver! What config/license file did that thing really use? Ask strace. This program is stuck waiting for something to happen. What? Ask strace. Does this program dial home? And if so who? Ask strace. It's getting that wrong info from somewhere, if we knew we could fix it. Ask strace. I don't understand the initialization sequence, mmaps and what libraries are being used. Watch things in strace... Wow! Do you learn a lot. There is a matching one at the libc level called ltrace. Say "man strace" to know more. John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : [EMAIL PROTECTED] New Zealand
