【问题标题】:How to save IAR IDE disassembly window contents to a file?如何将 IAR IDE 反汇编窗口内容保存到文件中?
【发布时间】:2013-11-03 18:09:31
【问题描述】:

使用 IAR IDE 从 C 源构建 ARM 可执行文件,我可以在相关窗口中看到反汇编,包括标签、地址、操作码和指令。

我正在尝试将一系列地址的内容转储到文本文件中,但找不到这样做的方法。窗口文本不可选择,因此我无法使用复制/粘贴。没有关联的菜单可以启用此功能。

作为替代方案,我可以生成列表和汇编文件,但这些似乎仅限于我的代码,并且不包含我感兴趣的 CRT 代码或任何 ROM 部分。

有什么方法可以转储选定的地址范围?

【问题讨论】:

    标签: c embedded disassembly iar


    【解决方案1】:

    您想使用位于 arm/bin 下 Workbench 目录中的ielfdumparm。这是该工具的帮助。

    Usage:          IElfDump input_file [output_file]
    
    Available command line options:
    --all           Dump all sections
    --code          Dump only code sections
    --no_header     Do not produce a list header
    --no_rel_sections
                    Do not output associated .rel sections
    --no_strtab     Do not include strtab sections
    --output file
    -o file         Name of text file to create
    --raw           Use raw text format
    --section #|name[,...]
    -s #|name[,...] Dump only section(s) with given numbers/names
    --source        Include source in disassembled code in executables
    --use_full_std_template_names
                    Don't use short names for standard C++ templates
    -a              All sections, except strtab sections
    -f file         Read command line options from file
    

    要获得与调试视图类似的输出,我建议 --code 避免转储您的数据空间,并建议 --source 将您的原始 C 嵌入到程序集中。

    您可以指定部分,但您似乎无法指定地址范围。您可以将它与其他一些 ELF 工具配对以仅提取特定地址范围,然后在其上运行此工具。或者,这会按地址顺序转储,因此您可以转储整个 ELF 文件,然后在事后查看您想要的地址范围。

    【讨论】:

    • 我安装的版本确实允许指定地址范围:--range A-B Disassemble only addresses in the specified range (from A to B).
    • 你介意我问什么版本吗?我的版本落后了,但听起来可能会有一些不错的改进。
    • IAR ELF Dumper V6.60.1.5097 for ARM
    【解决方案2】:

    我使用 Snagit 来捕获不可选择的文本。 Snagit 是一个屏幕快照工具(非常好的一个)。除了制作经典的屏幕截图外,它还支持捕获文本并将其保存为 ASCII 文本。它还可以自动滚动窗口以捕获长文本。

    也许值得一试。提供 30 天试用版。

    【讨论】:

    • 很好,但是当代码跨越超过 1 个窗口长度时(通常情况下),这会变得非常乏味。另外,它不是免费工具 ;-)
    • +1,因为它确实为问题提供了一些有限的解决方案。
    猜你喜欢
    • 2012-10-20
    • 2011-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-06
    相关资源
    最近更新 更多