Tuesday, June 03, 2008

General Purpose Debugger for Core File Analysis

One of my co-workers had an early morning interview for a Principal Systems Administration position. Per the job description, he thought the position dealt mostly with Windows-based systems and a little UNIX. But after chatting with him post-interview, it was apparent that it was the latter. He seemed a bit shell-shocked. Why? He said the much younger interviewer had a plethora of detailed questions related to UNIX commands. I don't think he prepared as well for the UNIX side as he did for the Windows side. Unfortunately, he was only given a couple days to prepare.

Here is one of several commands he kept asking me about.

What UNIX command do you use when you want to perform analysis on a core file?

Here are a couple examples of the general purpose debugger, adb.

# adb /apps/myapps/bin/myexecutable /apps/myapps/bin/core
# adb -k vmunix.n vmcore.n

Core files generate a lot of lines and you might be able to extract some of text-based lines with the strings commands.
# strings core | grep -i pattern

Search for other debuggers and then consult the man pages
# catman -w (if you don't have a windex)
# man -k debugger

By the way, Sun has a script, iscda.sh, to read core files via SunSolve.
# $HOME/iscda.sh vmunix.n vmcore.n

No comments: