没有合适的资源?快使用搜索试试~ 我知道了~
首页how to porting gdb(如何移植GDB)
how to porting gdb(如何移植GDB)
![](https://csdnimg.cn/release/wenkucmsfe/public/img/star.98a08eaa.png)
比较详细介绍gdb移植过程的文档,其中以openrisc 1000为例,对移植过程进行了描述。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/2744612/bg2.jpg)
ii Copyright © 2008 Embecosm Limited
Legal Notice
This work is licensed under the Creative Commons Attribution 2.0 UK: England & Wales
License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/uk/
or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California,
94105, USA.
This license means you are free:
• to copy, distribute, display, and perform the work
• to make derivative works
under the following conditions:
• Attribution. You must give the original author, Jeremy Bennett of Embecosm
(www.embecosm.com), credit;
• For any reuse or distribution, you must make clear to others the license terms of this
work;
• Any of these conditions can be waived if you get permission from the copyright holder,
Embecosm; and
• Nothing in this license impairs or restricts the author's moral rights.
The software for GNU Debugger, including the code to support the OpenRISC1000 written by
Embecosm and used in this document is licensed under the GNU General Public License (GNU
General Public License). For detailed licensing information see the files COPYING, COPYING3,
COPYING.LIB and COPYING3.LIB in the source code.
Embecosm is the business name of Embecosm Limited, a private limited company registered
in England and Wales. Registration number 6577021.
![](https://csdnimg.cn/release/download_crawler_static/2744612/bg3.jpg)
iii Copyright © 2008 Embecosm Limited
Table of Contents
1. Introduction ................................................................................................................ 1
1.1. Rationale .......................................................................................................... 1
1.2. Target Audience ................................................................................................ 1
1.3. Further Sources of Information ......................................................................... 1
1.3.1. Written Documentation .......................................................................... 1
1.3.2. Other Information Channels ................................................................... 2
1.4. About Embecosm .............................................................................................. 2
2. Overview of GDB Internals .......................................................................................... 3
2.1. GDB Nomenclature ........................................................................................... 3
2.2. Main Functional Areas and Data Structures ..................................................... 3
2.2.1. Binary File Description (BFD) ................................................................. 3
2.2.2. Architecture Description ......................................................................... 4
2.2.3. Target Operations ................................................................................... 5
2.2.4. Adding Commands to GDB .................................................................... 5
2.3. GDB Architecture Specification ......................................................................... 5
2.3.1. Looking up an Existing Architecture ....................................................... 6
2.3.2. Creating a New Architecture ................................................................... 7
2.3.3. Specifying the Hardware Data Representation ......................................... 8
2.3.4. Specifying the Hardware Architecture and ABI ........................................ 8
2.3.5. Specifying the Register Architecture ........................................................ 9
2.3.6. Specifying Frame Handling ................................................................... 11
2.4. Target Operations ........................................................................................... 17
2.4.1. Target Strata ........................................................................................ 17
2.4.2. Specifying a New Target ....................................................................... 17
2.4.3. structtarget_ops Functions and Variables Providing Information ........... 18
2.4.4. structtarget_ops Functions Controlling the Target Connection .............. 19
2.4.5. structtarget_ops Functions to Access Memory and Registers ................. 19
2.4.6. structtarget_ops Functions to Handle Breakpoints and Watchpoints ..... 19
2.4.7. structtarget_ops Functions to Control Execution .................................. 20
2.5. Adding Commands to GDB ............................................................................. 20
2.6. Simulators ...................................................................................................... 21
2.7. Remote Serial Protocol (RSP) ........................................................................... 22
2.7.1. RSP Client Implementation ................................................................... 22
2.7.2. RSP Server Implementation .................................................................. 22
2.8. GDB File Organization .................................................................................... 22
2.9. Testing GDB ................................................................................................... 23
2.10. Documentation ............................................................................................. 23
2.11. Example Procedure Flows in GDB ................................................................. 23
2.11.1. Initial Start Up ................................................................................... 24
2.11.2. The GDB target Command ................................................................. 24
2.11.3. The GDB load Command .................................................................... 25
2.11.4. The GDB break Command .................................................................. 25
2.11.5. The GDB run Command ..................................................................... 26
2.11.6. The GDB backtrace Command ............................................................ 28
2.11.7. The GDB continue Command after a Breakpoint ................................. 29
2.12. Summary: Steps to Port a New Architecture to GDB ...................................... 30
3. The OpenRISC1000 Architecture .............................................................................. 31
3.1. The OpenRISC1000 JTAG Interface ................................................................ 32
3.2. The OpenRISC1000 Remote JTAG Protocol .................................................... 33
3.3. Application Binary Interface (ABI) ................................................................... 34
3.4. Or1ksim: the OpenRISC1000 Architectural Simulator .................................... 35
![](https://csdnimg.cn/release/download_crawler_static/2744612/bg4.jpg)
iv Copyright © 2008 Embecosm Limited
4. Porting the OpenRISC1000 Architecture ................................................................... 36
4.1. BFD Specification ........................................................................................... 36
4.2. OpenRISC1000 Architecture Specification ...................................................... 36
4.2.1. Creating structgdbarch ........................................................................ 37
4.2.2. OpenRISC1000 Hardware Data Representation .................................... 37
4.2.3. Information Functions for the OpenRISC1000 Architecture .................. 38
4.2.4. OpenRISC1000 Register Architecture ................................................... 39
4.2.5. OpenRISC1000 Frame Handling .......................................................... 40
4.3. OpenRISC1000 JTAG Remote Target Specification ......................................... 46
4.3.1. Creating structtarget_ops for OpenRISC1000 ...................................... 47
4.3.2. OpenRISC1000 Target Functions and Variables Providing Information
......................................................................................................................... 47
4.3.3. OpenRISC1000 Target Functions Controlling the Connection ............... 48
4.3.4. OpenRISC1000 Target Functions to Access Memory and Registers ........ 49
4.3.5. OpenRISC1000 Target Functions to Handle Breakpoints and Watch-
points ............................................................................................................. 50
4.3.6. OpenRISC1000 Target Functions to Control Execution ......................... 51
4.3.7. OpenRISC1000 Target Functions to Execute Commands ...................... 53
4.3.8. The Low Level JTAG Interface ............................................................... 53
4.4. The OpenRISC1000 Disassembler .................................................................. 54
4.5. OpenRISC1000 Specific Commands for GDB .................................................. 54
4.5.1. The info spr Command ......................................................................... 55
4.5.2. The spr Command ................................................................................ 55
5. Summary .................................................................................................................. 56
Glossary ....................................................................................................................... 57
References .................................................................................................................... 59
Index .............................................................................................................................. 60
![](https://csdnimg.cn/release/download_crawler_static/2744612/bg5.jpg)
v Copyright © 2008 Embecosm Limited
List of Figures
2.1. An example stack frame ......................................................................................... 12
2.2. Sequence diagram for GDB start up ....................................................................... 24
2.3. High level sequence diagram for the GDB target command ..................................... 24
2.4. handle_inferior_event sequence diagram in response to the GDB target command
........................................................................................................................................ 25
2.5. Sequence diagram for the GDB load command ....................................................... 25
2.6. Sequence diagram for the GDB break command ..................................................... 26
2.7. High level sequence diagram for the GDB run command ......................................... 26
2.8. Sequence diagram for the GDB wait_for_inferior function as used by the run com-
mand ............................................................................................................................. 27
2.9. Sequence diagram for the GDB normal_stop function as used by the run command
........................................................................................................................................ 27
2.10. High level sequence diagram for the GDB backtrace command .............................. 28
2.11. Sequence diagram for the GDB print_frame function used by the backtrace com-
mand ............................................................................................................................. 28
2.12. High level sequence diagram for the GDB continue command after a breakpoint
........................................................................................................................................ 29
2.13. Sequence diagram for the GDB handle_inferior_event function after single step-
ping an instruction for the continue command .............................................................. 30
3.1. The OpenRISC1000 Remote JTAG Protocol data structures .................................... 34
4.1. The OpenRISC1000 stack frame at the end of the prologue .................................... 41
剩余73页未读,继续阅读
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/80518d03157d46a5b0321784bfcf19be_kkong522.jpg!1)
kkong522
- 粉丝: 2
- 资源: 4
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- VMP技术解析:Handle块优化与壳模板初始化
- C++ Primer 第四版更新:现代编程风格与标准库
- 计算机系统基础实验:缓冲区溢出攻击(Lab3)
- 中国结算网上业务平台:证券登记操作详解与常见问题
- FPGA驱动的五子棋博弈系统:加速与创新娱乐体验
- 多旋翼飞行器定点位置控制器设计实验
- 基于流量预测与潮汐效应的动态载频优化策略
- SQL练习:查询分析与高级操作
- 海底数据中心散热优化:从MATLAB到动态模拟
- 移动应用作业:MyDiaryBook - Google Material Design 日记APP
- Linux提权技术详解:从内核漏洞到Sudo配置错误
- 93分钟快速入门 LaTeX:从入门到实践
- 5G测试新挑战与罗德与施瓦茨解决方案
- EAS系统性能优化与故障诊断指南
- Java并发编程:JUC核心概念解析与应用
- 数据结构实验报告:基于不同存储结构的线性表和树实现
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)