没有合适的资源?快使用搜索试试~ 我知道了~
首页DS-5_Workshop DS-5工程建立
资源详情
资源评论
资源推荐
DS-5 Workshop: Linux Kernel and Application Debug, Trace and
Profile on Snowball
Copyright 2010-2013 ARM Ltd. All rights reserved.
This workshop demonstrates the features of the DS-5 Debugger by debugging and tracing U-Boot, the Linux
kernel and a game called Gnometris that is an ARM Linux application running on the target. It also
demonstrates the ARM Streamline profiler using an application called Xaos. It will introduce the views of
DS-5 Debugger and ARM Streamline and demonstrate their features. Some of the features are used in
explicit instructions that you are expected to follow and are marked with this symbol . Other features are
only mentioned and are not critical to the flow of the workshop. You don't have to use them, but you are
generally encouraged to try them out anyway.
We will use a Snowball board as the target, but DS-5 can also be used with any ARM Linux target that has
networking or the Real Time System Models that come with DS-5. The Gnometris and Xaos applications
that we will be using are supplied as examples with DS-5.
(version 31 January 2013; v5.13 d1622; HW; HWCortex-A9; DSTREAM; DSTREAMLinaro; DSTREAMSnowball; Snowball)
page 1 of 99
Contents
DS-5 Workshop: Linux Kernel and Application Debug, Trace and Profile on Snowball ................................................... 1
Preparation ..................................................................................................................................................................................... 2
Host Setup ................................................................................................................................................................................. 2
Target Setup .............................................................................................................................................................................. 2
Starting Eclipse .......................................................................................................................................................................... 2
Installing a DS-5 License ........................................................................................................................................................... 2
Bare-metal Debug and Trace (U-Boot) ........................................................................................................................................... 4
Setting up your own target: Download, build and setup U-Boot ................................................................................................. 4
Connect the hardware................................................................................................................................................................ 4
Debugging U-Boot on the target ................................................................................................................................................ 5
Quick tour of the debugger ...................................................................................................................................................... 10
Trace view ............................................................................................................................................................................... 12
Registers view ......................................................................................................................................................................... 15
Watchpoints ............................................................................................................................................................................. 15
Functions view ......................................................................................................................................................................... 16
Kernel and module debug ............................................................................................................................................................. 20
Setting up your own target: Download the Linux kernel symbols and sources ........................................................................ 20
Debugging the kernel before the MMU is on ............................................................................................................................ 20
Debugging the kernel initialisation after the MMU is on ........................................................................................................... 22
Peripheral Registers ................................................................................................................................................................ 28
Application debug ......................................................................................................................................................................... 33
Starting the X server on the Host ............................................................................................................................................. 33
Importing Gnometris ................................................................................................................................................................ 34
Connecting to the Target ......................................................................................................................................................... 34
Debugging Gnometris on the Target ........................................................................................................................................ 36
Detailed Debugging ................................................................................................................................................................. 40
Functions view ......................................................................................................................................................................... 40
Breakpoints .............................................................................................................................................................................. 41
Source and Disassembly views ............................................................................................................................................... 43
Variables view .......................................................................................................................................................................... 44
Stepping ................................................................................................................................................................................... 48
Registers view ......................................................................................................................................................................... 49
Debug Control view ................................................................................................................................................................. 50
Call Stack ................................................................................................................................................................................. 50
Play the game .......................................................................................................................................................................... 51
Gaming the game .................................................................................................................................................................... 52
Expressions view ..................................................................................................................................................................... 52
Expression Inspector view ....................................................................................................................................................... 53
Memory view ............................................................................................................................................................................ 53
Commands and History views ................................................................................................................................................. 56
Scripts view .............................................................................................................................................................................. 57
Breakpoint scripts .................................................................................................................................................................... 57
Show off your skills .................................................................................................................................................................. 58
Advanced Breakpoints ............................................................................................................................................................. 58
More features in Source and Disassembly views .................................................................................................................... 58
Shared Libraries and Modules view ......................................................................................................................................... 60
Change of topic ............................................................................................................................................................................ 61
ARM Streamline Workshop using Xaos on Snowball ..................................................................................................... 62
Introduction to ARM Streamline .................................................................................................................................................... 63
Preparation ................................................................................................................................................................................... 63
Host Setup ............................................................................................................................................................................... 63
Target Setup ............................................................................................................................................................................ 63
Starting Eclipse ........................................................................................................................................................................ 63
Installing a DS-5 License ......................................................................................................................................................... 63
Importing Xaos ......................................................................................................................................................................... 64
Install Xaos to the target .......................................................................................................................................................... 64
Set the Capture Options .......................................................................................................................................................... 66
Configure Counters .................................................................................................................................................................. 67
Capture some profile data ............................................................................................................................................................ 68
Examine the Report ...................................................................................................................................................................... 70
Timeline view – a first look at the Streamline report ................................................................................................................ 70
Configuring Charts ................................................................................................................................................................... 73
Power analysis ......................................................................................................................................................................... 74
Call Paths view ........................................................................................................................................................................ 75
Functions view ......................................................................................................................................................................... 77
Code view ................................................................................................................................................................................ 77
Call Graph view ....................................................................................................................................................................... 78
Stack view ................................................................................................................................................................................ 79
Log view and Annotations ........................................................................................................................................................ 80
page 2 of 99
Advanced Streamline.................................................................................................................................................................... 80
Reanalyze Streamline data ...................................................................................................................................................... 80
Import Captures ....................................................................................................................................................................... 82
Troubleshooting Streamline .......................................................................................................................................................... 83
Back to Debugging ....................................................................................................................................................................... 84
Debugging an application that is already running .................................................................................................................... 84
Advanced Debug Configurations ............................................................................................................................................. 85
Debugging Threads (“extra credit”) .......................................................................................................................................... 85
Debugging on the RTSM .............................................................................................................................................................. 86
Other DS-5 features you didn't see ............................................................................................................................................... 86
Finished! ....................................................................................................................................................................................... 86
Appendix A: Setup ........................................................................................................................................................................ 87
Host Setup ............................................................................................................................................................................... 87
Importing projects .................................................................................................................................................................... 87
Importing distribution................................................................................................................................................................ 87
Importing Gnometris ................................................................................................................................................................ 88
Changing Gnometris ................................................................................................................................................................ 89
Importing Xaos ......................................................................................................................................................................... 90
Creating a Target Connection .................................................................................................................................................. 90
Appendix B: Snowball ................................................................................................................................................................... 92
Board details and connections ................................................................................................................................................. 92
Write a target image to a microSD card ................................................................................................................................... 92
Serial setup .............................................................................................................................................................................. 92
Flash an eMMC image to the board ......................................................................................................................................... 94
Linaro Linux target setup ......................................................................................................................................................... 94
U-Boot download and debug setup .......................................................................................................................................... 95
Linux kernel download and debug setup.................................................................................................................................. 95
Kernel module debug (modex) build and setup ....................................................................................................................... 97
Setting a static IP address ....................................................................................................................................................... 98
ARM Energy Probe setup ........................................................................................................................................................ 99
Preparation
If the host and target have already been setup for you, you can skip down to Starting Eclipse below.
Otherwise you’ll need to start by installing some software.
Host Setup
DS-5 can be used on Windows and Linux hosts. If your host has not already been setup for you then you
will need to follow the instructions in the appendix on page 87
Target Setup
For the workshop you’ll be supplied with a Snowball board that already has U-Boot, a Linux kernel and root
filesystem on it. If you want to setup your own target please see Appendix B: Snowball: Linaro Linux target
setup page 94.Serial setup
Starting Eclipse
Start > All Programs > ARM DS-5 > Eclipse for DS-5 and choose a location for the workspace
where Eclipse projects will be stored. The default workspace location is fine.
If this is the first time you've started DS-5 you will see the "Welcome to ARM DS-5" home page;
click Go to the workbench. You can get the Welcome page back if you want it later by choosing Help
> Welcome.
Installing a DS-5 License
In order to use DS-5 for this workshop you will need to have a license for DS-5 Basic Edition, either a full
or evaluation license. (A license for Professional Edition will also work.) If the workshop has been setup
for you then you will already have a license. If you don’t have a license a dialog will open with an
explanation and a button to Open License Manager.... You can get an evaluation or full license by opening
the license manager using Help > ARM License Manager..., clicking the Obtain License... button and
following the instructions. You will need to be connected to the internet. When you receive the license file,
you need to add it by using the Add License... button.
page 3 of 99
Eclipse views (a brief digression)
The Eclipse window is divided into a number of rectangular panes. Each pane contains one or more views.
Each view has a tab at the top with the view’s name. For example, in the screenshot on the cover, Debug
Control, Project Explorer and Remote Systems are three views in the same pane. Views of source files
are named after their files, for example main.cpp.
You can easily rearrange panes and views. Dragging the dividing lines between panes changes their size.
Clicking on a view’s tab brings it to the front. You can drag a view’s tab to move the view to another pane
or to split a pane vertically or horizontally. You can even drag a view out of the Eclipse window entirely to
create a new window. Double-clicking on the tabs of a pane will expand the pane to fill the window
(maximize). Double-clicking it again will restore it down.
You can close a view by clicking the close button in its tab. If a view you want is not open, you can open it
by using the Window > Show view > menu.
A particular grouping of views is called a perspective. For example, there is a DS-5 Debug perspective that
we will be using, but there is also a C/C++ perspective and others. Eclipse provides ways to switch quickly
between perspectives and to create your own custom perspectives from a group of views.
Some of the DS-5 views such as Variables, Expressions, Registers, Functions and Modules have
columns. You can change the width of the columns by dragging the dividing lines in the column headers
right or left. You can change which columns are displayed by right-clicking on the column headers and
choosing from the context menu. In Functions and Modules you can sort by any of the columns by clicking
on the column heading. If you shift-click a different columns you can set further minor sort keys which
shows as the sort arrow and two or more dots.
There are more things you can do, such as minimizing panes and setting views to be pop-up “Fast Views”,
but that’s probably enough to get you started.
Getting help (more digression)
You can press the F1 key (or Shift+F1 on Linux) at any time to get help about the current view. You can
use Help > Help Contents > ARM DS-5 Documentation to view the documentation. You can access
cheat sheets for various tasks using Help > Cheat Sheets > ARM …, for example importing the example
projects. (But we won't be following those cheat sheets here.)
剩余100页未读,继续阅读
cp1300
- 粉丝: 1070
- 资源: 62
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0