Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

gdbMann_Communication Chain

Unknown edited this page Jul 1, 2020 · 1 revision

Communication Chain

Goal

The communication Chain (comChain) intends to enable the use of different encoders or communication paths by building an linked list of communication possibility’s.

Each Chain element adds additional functionality or improve them.

E.g. an base chain could be an gdb-decoder which is able to flash, insert breakpoints, read memory, ….. It is possible to do the entire test execution just by using the gdb. But the test execution might by faster if some communication gets bypassed by e.g. a serial interface. Idea

The base element (gdb) implements the entire required functionality. If some functionality could be implemented more faster by an serial interface this gets done by an own chain element. Each functionality overrides the comChain’s basis functions. Each other method call gets redirected to the next chain element (done by the abstract base class).

To build the an specific chain each chain element receives an pointer to the next upper (and slower) chain element. The chain end is determined by an null pointer.

Example

GDB Chain

GDB_Chain : implements chomChain
Implements all Methods

ARM GDB Chain

arm_none_eabi_gdb_chain: implements gdb_chain
Overrides initSystem and continueAfterMessage

The arm gdb needs to change the gdbChain’s functionality cause the debugger has a bit different behaviour (like flash the target or software breakpoints). Serial Chain

Serial_Chain: implements chomChain

Implements: getResultData, getExecutionStopFrame, executionHasStopped, … Better Serial Chain

better_serial_chain: implements comChain
Implements getResultData

Test Execution

To use this chais each chain gets by construction the next chain element:

      gdb = gdbDebugger();
      serial = serial_chain(gdb);
      betterSerial = better_serial_cahin(serial);

The chain would be:

betterSerial --> serial  --> gdb

Advantage

By using an chain element for each communication interface it is possible to switch underlaying elements e.g. for further decoders. Example

If it is necessary to use another debugger than the gdb is just necessary to implement the corresponding decoder an keep all other chain elements.

      gdb = gdbDebugger();
      newDebugger = newDebugger();
      serial = serial_chain(newDebugger);
      betterSerial = better_serial_cahin(serial);

The chain would be:

betterSerial --> serial  --> newDebugger