Services - tools - models - for embedded software development
Embecosm divider strip
  Next

Howto: GDB Remote Serial Protocol

Writing a RSP Server

Jeremy Bennett

Embecosm

Application Note 4. Issue 2

November 2008


Table of Contents

1. Introduction
1.1. Rationale
1.2. Target Audience
1.3. Further Sources of Information
1.3.1. Written Documentation
1.3.2. Other Information Channels
1.4. About Embecosm
2. Overview of the Remote Serial Protocol
2.1. Client-Server Relationship
2.2. Session Layer: The Serial Connection
2.3. Presentation Layer: Packet Transfer
2.3.1. Packet Acknowledgment
2.3.2. Interrupt
2.4. Application Layer: Remote Serial Protocol
2.5. Putting it All Together to Build a Server
2.5.1. Using gdbserver
2.5.2. Implementing Server Code on the Target
2.5.3. Implementing Server Code for Simulators
2.5.4. Implementing a Custom Server for JTAG
3. Mapping GDB Commands to RSP
3.1. Remote Debugging in GDB
3.1.1. Standard Remote Debugging
3.1.2. Extended Remote Debugging
3.1.3. Asynchronous Remote Debugging
3.2. GDB Standard Remote Command Dialogs
3.2.1. The target remote Command
3.2.2. The load Command
3.2.3. Examining Registers
3.2.4. Examining Memory
3.2.5. The stepi Command
3.2.6. The step Command
3.2.7. The cont Command
3.2.8. The break Command
3.2.9. The watch Command
3.2.10. The detach and disconnect Commands
3.3. GDB Extended Remote Command Dialogs
3.3.1. The target extended-remote Command
3.4. GDB Asynchronous Remote Command Dialogs
4. RSP Server Implementation Example
4.1. The OpenRISC 1000 Architectural Simulator, Or1ksim
4.1.1. The OpenRISC 1000 Architecture
4.1.2. The OpenRISC 1000 Debug Unit
4.1.3. The OpenRISC 1000 JTAG Interface
4.1.4. Application Binary Interface (ABI)
4.1.5. Or1ksim: the OpenRISC 1000 Architectural Simulator
4.2. OpenRISC 1000 GDB Architectural Specification
4.3. Overview of the RSP Server Implementation
4.3.1. External Code Interface
4.3.2. Global Data Structures
4.3.3. Top Level Behavior
4.4. The Serial Connection
4.4.1. Establishing the Server Listener Socket
4.4.2. Establishing the Client Connection
4.4.3. Communicating with the Client
4.5. The Packet Interface
4.5.1. Packet Representation
4.5.2. Getting Packets
4.5.3. Sending Packets
4.6. Convenience Functions
4.6.1. Convenience String Packet Output
4.6.2. Conversion Between Binary and Hexadecimal Characters
4.6.3. Conversion Between Binary and Hexadecimal Character Registers
4.6.4. Data "Unescaping"
4.6.5. Setting the Program Counter
4.7. High Level Protocol Implementation
4.7.1. Deprecated Packets
4.7.2. Unsupported Packets
4.7.3. Simple Packets
4.7.4. Reporting the Last Exception
4.7.5. Continuing
4.7.6. Reading and Writing All Registers
4.7.7. Reading and Writing Memory
4.7.8. Reading and Writing Individual Registers
4.7.9. Query Packets
4.7.10. Set Packets
4.7.11. Restart the Target
4.7.12. Stepping
4.7.13. v Packets
4.7.14. Binary Data Transfer
4.7.15. Matchpoint Handling
5. Summary
Glossary
References
Index
Embecosm divider strip