用反汇编代码匹配源 [英] 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
- 调用堆栈,崩溃时的注册表信息,单一信息
- 实际负载模块
- 匹配源代码
通常,基于偏移量并通过 objdump
生成反汇编,我计算失败指令(机器代码/汇编代码).
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?
我尝试使用 gcc -S
选项使用程序集源,但是无法有效地映射源.我通常找不到逻辑方法来映射具有源崩溃崩溃的程序集输出.
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.
请提出建议的方法.
推荐答案
创建启用了调试信息的零售代码,然后在发货前将其剥离,但请自己保存.然后,您可以使用副本来分析核心转储.
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.
这篇关于用反汇编代码匹配源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!