CygMon RedBoot ROM Monitors
8.2.3 GDB Stub
At the core of the two ROM monitors is the GDB stub. The GDB stub is a piece of software that provides the low-level interaction with the HAL, as well as the GDB protocol communication layer. The low-level HAL interaction includes hooking into the serial port for communication with the GDB host and installing trap handlers for breakpoint support. The GDB stub can also be built into a simple GDB stub ROM application that resides in the target hardware’s ROM and provides the ability to load and debug applications. This applica- tion can be used in lieu of a ROM monitor. The GDB stub code is contained in the file generic-stub.c with support routines in the file hal_stub.c. These files are located under the common HAL subdirectory. For addi- tional information on the GDB communication protocol, see the online documentation at: http:sources.redhat.comgdbonlinedocsgdb_toc.html GDB stub software can be included in any eCos image to provide GDB debugging func- tionality. Both CygMon and RedBoot include GDB stubs. The stub code can then be invoked by the GDB host or by the application itself by calling the breakpoint routine. There are config- uration options that control whether GDB stub code is included. These options are located under the common HAL configuration component Source-Level Debugging Support. The configura- tion options for including GDB stubs in eCos images are detailed in Item List 8.1. Item List 8.1 GDB Stubs Configuration Options Option Name Include GDB Stubs in HAL CDL Name CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS Description Causes the GDB stub code to be included in the image, enabling GDB communication and debug support. The default for this option is disabled. Option Name Include GDB External Break Support For Stubs CDL Name CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT Description Enables the GDB stub to include a serial port interrupt handler to listening for GDB break packets. This option allows a target to be stopped asynchronously using the GDB host. Option Name Include GDB External Break Support When No Stubs CDL Name CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT Description Allows a GDB host to stop a target asynchronously by listening for GDB break packets in a serial port interrupt handler. This option is used when GDB stubs are not present. Option Name Include GDB Multi-Threading Debug Support CDL Name CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT Description Enables additional HAL code to support multithreaded debugging of an application. This option is enabled by default. Let’s look at the two configuration options available that enable the building of a GDB stub ROM image. This image can then be programmed into a target hardware platform for File Systems 155 communication with a GDB host. The configuration options for building a GDB stub image are under the Global Build Options component. The stubs package template controls the GDB stubs options. The first option is Build GDB Stub ROM Image CYGBLD_BUILD_GDB_STUBS, whichParts
» Prentice.Hall – Embedded.Software.Development.with.eCos
» Where It All Started—Cygnus Solutions
» The eCos Configuration Method
» eCos Core Components The Origins of eCos
» Processor and Evaluation Platform Support
» eCos Support The Origins of eCos
» Component Framework eCos Terminology
» Component Repository eCos Terminology
» Configuration Options eCos Terminology
» Components and Packages Targets
» Summary Prentice.Hall – Embedded.Software.Development.with.eCos
» The Example HAL Function Call Trace
» Next, the Example HAL Function Call Trace
» Finally, the platform reset routine uses the architecture macros defined in
» HAL Macro Definitions Overview
» Common Configuration Components HAL Configuration
» Architecture-Specific Configuration Components HAL Configuration
» HAL and Kernel Exception Handling
» Application Exception Handling Exceptions
» Interrupt and Scheduler Synchronization
» Interrupt Service Routine Management
» Interrupt State Management Interrupt Control
» Interrupt Controller Management Interrupt Control
» Summary Summary Prentice.Hall – Embedded.Software.Development.with.eCos
» Virtual Vector Configuration Virtual Vectors
» Communication Channels Virtual Vector Table Initialization
» Kernel Directory Structure The Kernel
» Multilevel Queue Scheduler The Scheduler
» Bitmap Scheduler Priority Levels
» Scheduler Configuration The Scheduler
» Thread Stacks and Stack Sizes
» Condition Variables Synchronization Mechanisms
» Message Boxes Synchronization Mechanisms
» Counters Counters, Clocks, Alarms, and Timers
» Clocks Alarms Counters, Clocks, Alarms, and Timers
» Timers Counters, Clocks, Alarms, and Timers
» Asserts and Tracing Prentice.Hall – Embedded.Software.Development.with.eCos
» IO Sub-System IO Control System
» Device Drivers IO Control System
» ROM File System File Systems
» RAM File System File Systems
» USB Support Prentice.Hall – Embedded.Software.Development.with.eCos
» OpenBSD FreeBSD Networking Support
» Networking Threads Networking Support
» Networking Configuration Networking Support
» Networking Tests Networking Support
» DNS Support Networking Support
» SNMP Support Prentice.Hall – Embedded.Software.Development.with.eCos
» The GoAhead Embedded WebServer
» Symmetric Multi-Processing Support Prentice.Hall – Embedded.Software.Development.with.eCos
» Additional Features Prentice.Hall – Embedded.Software.Development.with.eCos
» Overview Prentice.Hall – Embedded.Software.Development.with.eCos
» RedBoot Directory Structure Prentice.Hall – Embedded.Software.Development.with.eCos
» RedBoot Configuration Installation and Configuration
» Boot Scripting RedBoot Commands
» Cygwin Tools Directory Structure
» Installing the Platform-Specific Cross-Development Tools
» Installing WinCVS Accessing the Online eCos Source Code Repository
» Setting WinCVS Preferences Accessing the Online eCos Source Code Repository
» WinCVS Update Commands Accessing the Online eCos Source Code Repository
» Package Directory Structure Packages
» CDL Script Files The Component Definition Language Overview
» Saving Configurations Screen Layout
» Importing and Exporting Configurations
» Configuration Window Screen Layout
» Conflicts Window Screen Layout
» Properties Window Screen Layout
» Short Description Window Screen Layout
» Memory Layout Window Screen Layout
» Memory Layout Manipulation Screen Layout
» eCos Repository Database The Configuration Tool
» Graphical Representation of CDL Script Files
» Conflicts and Resolutions Using Templates
» The Package Administration Tool
» The Command-Line Configuration Tool
» Source-Navigator Additional Open-Source Tools
» Splint Additional Open-Source Tools
» A Closer Look The eCos Build Process
» Development Hardware Setup Examples Overview
» Building the Application Application
» Loading the Application Application
» Using the GDB Command-Line Interface
» The eCos Tests Prentice.Hall – Embedded.Software.Development.with.eCos
» Simulators Prentice.Hall – Embedded.Software.Development.with.eCos
» Overview of Porting Prentice.Hall – Embedded.Software.Development.with.eCos
Show more