Code Monkey home page Code Monkey logo

astub's Introduction

Introduction

astub is a remote stub for GNU: The GNU Project Debugger, aimed for resource constrainted systems. It allows source-level debugging of software running on the target system, controlled by a host system running GDB.

For more information on GDB, remote stubs and the gdb Remote Serial Protocol, see Debugging with gdb: the gnu Source-Level Debugger.

Purpose

The purpose of preparing this software was to create a cross-development and debug environment for the Commodore Amiga A500 computer.

Target support

The following CPU architectures are currently supported:

  • Motorola 68000

The following computer platforms are currently supported:

  • Commodore Amiga A500. A1000, A600 and A2000 should also work but has not been tested.

Implementation

Portability and reusability is a design goal for astub. The implementation has been is split into the following parts:

  • target independent code
  • architecture specific code
  • platform specific code

Target independent code

The target independent code implements a selected subset of the gdb Remote Serial Protocol. This includes a packetization layer (pkt), a command interpretation layer (cmd) and support functions for working with data coded as hexadecimal strings (hex).

  • include/pkt.h, pkt.c
  • include/cmd.h, cmd.c
  • include/hex.h, hex.c
  • include/link.h (only the API, not the implementation)

Architecture specific code

Architecture specific code contains knowledge of the target CPU architecture and how to perform the architecture specific processing of gdb Remote Serial Protocol commands.

The architecture specific code shall make no assumptions on how the CPU is used and connected in the target system. Such information is provided by the platform specific code instead.

  • <architecture>/include/stub_arch.h

Platform specific code

Platform specific code is responsible for implementing initializations and operations required for astub to operate on the target system. Platform specific information includes for example:

  • Which interrupts are connected to which peripheral
  • Memory map
  • Memory access restrictions
  • Implementation of the link.h API

The platform specific code implements the communication channel (link) between the GDB host system and the target system. It is typically a UART driver.

Coding convention

The Linux kernel coding style is a good starting point.

For target independent code

  1. Use C90 for the target independent code. This implies that stdint.h can not be used. For gcc, try -ansi -Wall -Wextra -pedantic.
  2. Make no assumptions on how the C types are represented, except for what the C standard says.
  3. Compiler extensions, pragmas, inline assembly, etc. shall not be used.

The rationale for all the above is to have the target independent code compatible with a wide range of compilers for a wide range of exotic targets.

For architecture specific code

Only point 3. above applies.

For platform specific code

Only point 3. above applies.

License

This software is licensed under GPL v3.

astub's People

Contributors

endofexclusive avatar

Stargazers

Graham Bates avatar Radosław Kujawa avatar Stefan Reinauer avatar Andre Zeps avatar Marnix avatar Samuel Crow avatar Valentino Miazzo avatar

Watchers

Marco Rolappe avatar James Cloos avatar  avatar Andre Zeps avatar Stefan Reinauer avatar  avatar  avatar

Forkers

photondreams

astub's Issues

Please don't use a viral license

Hello, endofexclusive.
This project is really interesting.

Anyway, GPL v3 license is, IMO, a bit extreme for some code that must be linked statically to other.
It would the linked code GPL v3 too.

What about using BSD or MIT?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.