commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
For automated unit tests I wanted my program to run normally, but if it crashed, to add a stack trace to the output log. I came up with this command so I wouldn't have to mess around with core files.
The one downside is that it does smoosh your program's stderr and stdout together.
This does almost the same thing as the original, but it runs the full backtrace for _all_ the threads, which is pretty important when reporting a crash for a multithreaded software, since more often than not, the signal handler is executed in a different thread than the crash happened.
Most of you are probably familiar with the "apropos" command for searching man pages. However, did you know there's a similar command inside of gdb? If, for example, you wanted to know all gdb commands that related to threads, you could type "apropos thread". Type "help some_command" to receive more information about a command. Type "help" by itself to see a list of help topics.