Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages | Examples

ac_gdb.cpp File Reference

#include "ac_gdb.H"

Include dependency graph for ac_gdb.cpp:

Include dependency graph

Go to the source code of this file.


Detailed Description

GDB Support for ArchC simulators.

This file implements AC_GDB methods to support GDB communication protocol (see info gdb / "Remote Protocol"). The current implementation supports the following gdb commands:

 .----------------.---------------------------------------.-----------------.
 | Command        | Function Description                  | Return value    |
 }----------------+---------------------------------------+-----------------{
 | g              | Return the value of the CPU registers | hex data or ENN |
 | G              | Set the value of the CPU registers    | OK or ENN       |
 |                |                                       |                 |
 | mAA..AA,LLLL   | Read LLLL bytes at address AA..AA     | hex data or ENN |
 | MAA..AA,LLLL:  | Write LLLL bytes at address AA.AA     | OK or ENN       |
 |                |                                       |                 |
 | c              | Resume at current address             | SNN (signal NN) |
 | cAA..AA        | Continue at address AA..AA            | SNN             |
 |                |                                       |                 |
 | s              | Step one instruction                  | SNN             |
 | sAA..AA        | Step one instruction from AA..AA      | SNN             |
 |                |                                       |                 |
 | k              | kill                                  |                 |
 |                |                                       |                 |
 | ZT,AA..AA,LLLL | Insert breakpoint or watchpoint       | OK, ENN or ''   |
 | zT,AA..AA,LLLL | Remove breakpoint or watchpoint       | OK, ENN or ''   |
 |                |                                       |                 |
 | ?              | What was the last sigval ?            | SNN             |
 |                |                                       |                 |
 | 0x03           | Control-C                             |                 |
 `----------------'---------------------------------------'-----------------'
 

All commands and responses are sent with a packet which includes a checksum. A packet consists of

                 $<packet info>#<checksum>.
 

where packet info = characters representing the command or response checksum = two hex digits computed as modulo 256 sum of packet info

When a packet is received, it is first acknowledged with either '+' or '-' '+' indicates a successful transfer. '-' indicates a failed transfer.

This file is to be processor agnostic! Every code that depends on processor specific features must be handled in AC_GDB_Interface.

Note:
When modifing this file respect:

This code contains code from others, see the helper functions below for origin references and copyright notices. Those code lines come from Linux kernel and are under GNU-GPL.

Todo:
Right now, just memory breakpoints are supported, the other (hardware, write, read and access) are not implemented. They are marked as:
 // FIXME --- not yet supported 
If you want to improve GDB support, try to implement these.

LICENSE: GNU GPL --- General Public License, version 2.0 or greater. See archc/COPYING for more information.

Author:
Daniel Cabrini Hauagge <ra008388@ic.unicamp.br>

Gustavo Sverzut Barbieri <ra008849@ic.unicamp.br>

Joao Victor Andrade Neves <ra008951@ic.unicamp.br>

Rafael Dantas de Castro <ra009663@ic.unicamp.br>

NOTICE: Contains extracts from Linux Kernel code. See below.

Definition in file ac_gdb.cpp.


Generated on Thu Jun 24 08:30:06 2004 for ArchC by doxygen 1.3.4