Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Match source with disassembled code

As part of my JOB, often I have to analyse un-reproducible retail crashes with/ without a core dump. I am generally equipped with

  1. Call Stack, registry information at the time of crash, singal information
  2. Actual Load Modules
  3. Matching Source Code

Generally, based on the offset and generating the dis-assembly via objdump, I calculate the failing instruction (machine code/assembly code).

The next JOB is tedious. I try to map the failing instruction to the actual source location. This is time consuming and painful. Is there a painless, easy way to map the source code to the failing instruction?

I tried using the assembly source using the gcc -S option, but cannot effectively map the source. I generally cannot find a logical way to map the assembly output with the crashing offset with the source.

Please suggest the recommended approach.

like image 406
Abhijit Avatar asked Nov 26 '25 07:11

Abhijit


1 Answers

Create your retail code with debugging information enabled, then strip it before shipping but keep it for yourself. Then you can use your copy for analyzing core dumps.

like image 195
Jester Avatar answered Nov 28 '25 22:11

Jester