Debugging by Thinking: A Multidisciplinary Approach (HP Technologies)

9.9 Generate memory dump

9.9.1 Basic tactic

Generate a memory map when the application is compiled and a memory dump when it completes execution.

9.9.2 Purpose

Determine the state of all program variables.

9.9.3 Questions answered

9.9.4 Potential problems

9.9.5 Refined tactics

  1. Run the binary dump values through a program that has access to all the header files and dumps values in their natural container size and format.

  2. Run the binary dump through a tool that extracts only certain ranges of addresses.

9.9.6 Related tactics

Regardless of the platform, these logs can be used to identify the source of a problem in a postmortem fashion. You must run a tool, either the normal interactive debugger or a special tool (the Dr. Watson program), which will generate the following information for you:

On some systems, you may have to start a monitoring program, or change the properties of the executable to have these log files generated for you.

9.9.7 Choosing tactics

Use basic or refined tactics when dealing with a program that must reside in memory for long periods of time. Two types of programs that have this characteristic are operating system kernels and database managers.

Use related tactic 2 when you don’t have access to the system on which the failure occurred and the user is unable to provide enough useful information on how the program failed for you to diagnose the problem. Instruct the user to do what is necessary to cause a log file to be generated and send the log file to you.

Категории