trace32使用手册
- 格式:pdf
- 大小:1.26 MB
- 文档页数:36


MANUAL Release 09.2023Integration for X-Tools and X32Integration for X-Tools and X32 | 2©1989-2023 Lauterbach Integration for X-Tools and X32TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents ...................................................................................................................... 3rd-Party Tool Integrations .......................................................................................................... Integration for X-Tools and X32 ................................................................................................1 Overview ..................................................................................................................................3 Brief Overview of Documents for New Users .......................................................................3 Operation Theory ....................................................................................................................4 Installation ...............................................................................................................................4 Startup Sequence ....................................................................................................................5 Menu Commands ....................................................................................................................6 Set BreakpointSet breakpoint on current line6 Delete BreakpointDelete breakpoint on current line6 List of all BreakpointsLists the breakpoints6 GoContinue application6 BreakStop application6 Go until CursorContinue application until this line7 Step OverStep over function call7 Step IntoStep into function call7 Watch VariableAdd variable to watch window7 Working with the X-TOOLS extensions .................................................................................8 Known Problems .....................................................................................................................9Integration for X-Tools and X32 | 3©1989-2023 Lauterbach Integration for X-Tools and X32Version 10-Oct-2023OverviewThis interface integrates the X-TOOLS / X32 tool series (blue river software GmbH) and TRACE32. Current supported versions are:X-TOOLS Version 4.03X32 Version 2.0Hosts: Windows95, Windows NTIn the further description, both X-TOOLS Classic and X32 are referred to as X-TOOLS.Brief Overview of Documents for New UsersArchitecture-independent information:•“Training Basic Debugging” (training_debugger.pdf): Get familiar with the basic features of a TRACE32 debugger.•“T32Start” (app_t32start.pdf): T32Start assists you in starting TRACE32 PowerView instances for different configurations of the debugger. T32Start is only available for Windows.•“General Commands” (general_ref_.pdf): Alphabetic list of debug commands.Architecture-specific information:•“Processor Architecture Manuals”: These manuals describe commands that are specific for the processor architecture supported by your debug cable. To access the manual for your processor architecture, proceed as follows:-Choose Help menu > Processor Architecture Manual.•“OS Awareness Manuals” (rtos_.pdf): TRACE32 PowerView can be extended for operating system-aware debugging. The appropriate OS Awareness manual informs you how to enable the OS-aware debugging. Integration for X-Tools and X32 | 4©1989-2023 Lauterbach Operation TheoryX-TOOLS provides an additional menu, which allows to control TRACE32 main features via X-TOOLS. To access these menu items, you have to install an helper application ("WxT32.exe") that manages the communication between X-TOOLS and TRACE32. X-TOOLS passes all requests via DDE messages to the helper application. This application converts the requests and sends them to the TRACE32 display driver via sockets (important: WINSOCK has to be installed!). The display driver transports the requests to the TRACE32. The answer goes exactly the same way backwards.X-TOOLS --> WxT32 --> t32 --> TRACE32InstallationFollow these steps to install the X-TOOLS extension for TRACE32:1.Copy the file "~~/demo/env/xtools/wxt32.exe" to your X-TOOLS directory.2.Edit your "config.t32" file: Add between two empty lines the following statements, if not already there: No "PORT=" line should follow. The port defaults to 20000, and this is the only one currently usable.3.Start X-TOOLS, select menu Extras->Tools…Press the “Add” button and choose “WxT32.exe”.Press “OK”.4.If you like, you can add the startup call for your TRACE32 debugger to the “Tools” menu.NOTE:This integration uses internally the TRACE32 Remote API.The Remote API has restrictions if TRACE32 runs in demo mode. Please see there for further details.RCL=NETASSISTPACKLEN=1024Integration for X-Tools and X32 | 5©1989-2023 Lauterbach Startup SequenceFor the first try on the X-TOOLS integration, follow the steps below. If you once got experienced, you can customize your own startup sequence, e.g. starting the WxT32 only, when it is needed.1.Switch on power on TRACE32 and your target.2.Start the TRACE32 debugger.3.Change the directory inside TRACE32 to your application.4.Setup TRACE32 and load your application.5.Start X-TOOLS. If you followed the installation steps above, the “Tools” menu should contain an item called “WxT32”.6.Start WxT32 by choosing this menu item. WxT32 will automatically establish a DDE connection to X-TOOLS and connect to the TRACE32 debugger. X-TOOLS then loads the current source file and places the cursor to the line that represents the current program counter address.7.After the application came up, try "Step", “Go” etc.
如何用trace32调试native和kernel异常
---------- for Android System Debug
众所周知gdb功能强大,但相对于gdb的指令式调试,trace32的图形界面要更方便易上手,而且不用查记那些繁复的指令,虽然效率上不及gdb,但对于新手而言,使用trace32要比gdb 快捷。下面就介绍如何使用trace32加载symbol文件。
1. 启动trace32
默认安装好trace32后,在开始菜单中选择 “Trace32 Simulator for ARM”,如图1
图1
2. 启动模拟器
在CPU菜单中选择 “System Settings…”,如图2,
图2 在弹出窗口中的CPU框选择对应的CPU,如图3,对于MT6589平台选择CortexA9MPCore,
图3
然后点击UP即可启动模拟器,右下角会显示 “system ready”,如图4。
图4
3. 加载symbol文件
加载的指令为 “data.load.elf /gnu /noclear /nocode”,
symbol 文件可以是boot、lk等的elf文件,kernel的vmlinux,native so的symbol库;
加载地址是可选项,可从PROCESS_MAP获取,也可从问题log获取。
加载完成后点击工具条上的蓝色感叹号就会显示出该symbol文件所对应的symbol,如图5,双击symbol符号可进入该symbol的具体内容。
图5
4. 设置资源路径
symbol文件加载完了,但对应的内容是十分难读的汇编语言,如图6,
图6
不过不用担心trace32支持symbol与code映射,可以将symbol与代码对应起来,在图6界面滑动鼠标滚轮,在命令框下方会提示该段symbol所对应的文件,如图7,
图7
将与symbol文件对应的同一版本的代码放到提示的路径下,在View菜单选择 “Symbols”
1 前言
Trace32 ICD ARM USB能实时DEBUG代码在手机中的运行情况,功能强
大,但需要连接TRACE32硬件才能工作。更重要的是,对于概率性死机的BUG,
用Trace32 ICD ARM USB应该是很难找到问题,因为你不能确定手机什么时候
crash。
其实TRACE32还有一个WIN32版本,用户只需要把手机crash时候的寄存
器信息dump出来,就能在WIN32下定位到死在代码的那一行,非常类似于EMP
平台的CHKARM工具。
这就是本文将要描述的Trace32 Simulator for ARM工具。
2 安装
WIN32版的TRACE32需要重新安装,安装文件和硬件版TRACE32是一样
的,只是安装时候的选项不同,而且WIN32版的需要安装在不同的目录下(比
如trace32-win32)。
z 运行安装文件\trace32\bin\setup\setup.exe。首先设置安装路径,注意不
要和硬件版TRACE32安装在同一个目录下,请新建一个文件夹(比如
trace32-win32)
z 选择【New Installation】,然后Next
z 选择【Simulator】,这个是WIN32版TRACE32的选项(硬件版TRACE32
是选择第2项,注意不要搞错了)
z 选择默认值,然后Next
z 选择【SIM ARM7 ARM9 ARM10 ARM11】,和硬件版TRACE32一样
z 安装中,安装完毕后就可以使用了。
3 使用
首先请确保你有保存当前手机软件的原始ARM文件。
手机死机时,按“#”键进入downloading模式。
z 运行【QPST】→【Memory Debug】,制指定数据线端口
z 点击【Get Regions】显示将要dump的信息
z 点击【SaveTo】保存dump数据
z 创建保存dump数据的文件夹,建议放到Arm/ms/dump目录下
使用 Trace32 对 FLASH 编程
随着软硬件复杂性的增加,在嵌入式系统开发中,调试器对项目的开发进度、质量起着越来
越重要的作用。在众多的调试器中,Lauterbach 公司的 Trace32 凭借其强大的功能,出色
的性能,成为目前嵌入式系统开发中,尤其是高端系统中普遍采用的调试工具。
Trace32 除了具有对代码设置断点、跟踪调试等常规的功能以外,还能够控制对目标系统的
FLASH 进行编程。本文首先对比了 Trace32 FLASH 编程的两种方式:"Emulator controlled
flash programming" 和 "Target controlled flash programming",指出"Target controlled flash
programming"方式的优点;然后介绍了与 FLASH 编程相关的 Trace32 脚本命令,以及
Trace32 脚本命令与 FLASH 编程软件之间的通信机制;最后,给出了 "Target controlled
flash programming" 方式的控制流程。
注:本文中使用的"编程"一词,除了具有对 FLASH 烧写的含义外,还包括擦除、校验等其
它对 FLASH 的操作。
一、FLASH 编程的两种方式
对目标系统中的 FLASH 有两种方式进行编程,分别是 "Emulator controlled flash
programming" 和 "Target controlled flash programming"。
在 "Emulator controlled flash programming" 方式下,所有对 FLASH 编程的操作都是由
Emulator 完成的,不使用目标系统的资源。Trace32 软件支持市面上几乎所有的 FLASH芯
片,只要在脚本命令 FLASH.Create 中指明目标 FLASH 的型号,地址范围以及总线的配