VxWorks反汇编操作方法说明 |
您所在的位置:网站首页 › vX模块如何嵌入 › VxWorks反汇编操作方法说明 |
VxWorks反汇编操作方法说明
反汇编作用:一句话,找bug。 步骤: 1.打开VxWorks Development Shell 2.找到WindRiver Workbench安装目录下的反编译可执行文件objdumppentium.exe,我的是在C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin下,在Shell里执行该exe,设置参数(表示反编译所有),填写镜像路径,并将反汇编输出的文件保存到txt中。(我这儿在桌面放了一个名为vx的文件夹,镜像和目标txt均放于此。) 执行语句如下: C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin>objdumppentium.exe -D C:\Users\Administrator\Desktop\vx\vxWorks >C:\Users\Administrator\Desktop\vx\vxWorks.txt或者可以一步步来,先打开C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin,(我的workbench安装在C盘根目录下),按Tab键找到objdumppentium.exe执行,再按出来的提示输入参数和待反汇编的镜像,执行过程如下: 文字版粘贴如下: C:\WindRiver>cd C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin>objdumppentium.exe Usage: objdumppentium.exe Display information from object . At least one of the following switches must be given: -a, --archive-headers Display archive header information -f, --file-headers Display the contents of the overall file header -p, --private-headers Display object format specific file header contents -h, --[section-]headers Display the contents of the section headers -x, --all-headers Display the contents of all headers -d, --disassemble Display assembler contents of executable sections -D, --disassemble-all Display assembler contents of all sections -S, --source Intermix source code with disassembly -s, --full-contents Display the full contents of all sections requested -g, --debugging Display debug information in object file -e, --debugging-tags Display debug information using ctags style -G, --stabs Display (in raw form) any STABS info in the file -W, --dwarf Display DWARF info in the file -t, --syms Display the contents of the symbol table(s) -T, --dynamic-syms Display the contents of the dynamic symbol table -r, --reloc Display the relocation entries in the file -R, --dynamic-reloc Display the dynamic relocation entries in the file @ Read options from -v, --version Display this program's version number -i, --info List object formats and architectures supported -H, --help Display this information C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin>objdumppentium.exe -D C:\Users\Administrator\Desktop\vx\vxWorks >C:\Users\Administrator\Desktop\vx\vxWorks.txt C:\WindRiver\gnu\4.1.2-vxworks-6.8\x86-win32\bin>这样反汇编的内容就被保存到VxWorks.txt里了。 再根据程序出错时报的page fault中的Program Counter即可找出对应的出错汇编语句。 例如 Page Fault Page Dir Base : 0x01a91000 Esp0 0x0366978c : 0x00000216, 0x0366991c, 0x0366984c, 0x00000003 Esp0 0x0366979c : 0x0034f7a8, 0x0625ab11, 0x00000064, 0x00000004 Program Counter : 0x003452d8 Code Selector : 0x00000008 Eflags Register : 0x00010202 Error Code : 0x00000002 Page Fault Addr : 0x00000064 Task: 0x1b08010 "tShellRem56985404"根据Program Counter : 0x003452d8能够找到出错语句的所在的函数或大致行数,再利用简单的汇编语句知识即可对应到源码上去。当然Page Fault中的Task也可以为你指明发生错误的任务,这样都有利于缩小排查范围。 想要对VxWorks反汇编有更多了解,详见Wind River官方手册《The gnu Binary Utilities》。手册在安装路径下,路径粘贴如下:"$installDir(请自行更改安装路径,如C:\WindRiver)\docs\extensions\eclipse\plugins\com.windriver.ide.doc.wr_gnu_compiler\wr_gnu_compiler_binary_utilities_4.1.2 > The gnu Binary Utilities" |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |