compile-time-init-build icon indicating copy to clipboard operation
compile-time-init-build copied to clipboard

✨ Add high-level debug capabilities

Open lukevalenty opened this issue 1 year ago • 0 comments
trafficstars

There is a desire for high-level debug features in embedded systems beyond the logging provided by cib. These debug features are focused on application logic and not low-level C++ or machine code debug.

Command handler with command declaration API

Declare commands:

  • name
  • summary
  • arguments
    • name
    • summary
    • type
    • default
  • response
    • type
constexpr auto my_cmd =
    dbg::command(
        "my_cmd"_sc,
        "Example for how to define a simple command."_sc,
        dbg::args(
            dbg::arg("arg1"_sc, "Just an optional arg."_sc, int, 0)
        ),
        void,
        [](auto args){
            auto arg1 = args.get("arg1"_f);
        }
    );

Built in commands for message handlers

  1. Spoof message. Automatically generate commands to spoof all the message types that message handlers have callbacks for.

Utilities for declaring and decoding high-level state information

namespace dbg {
    template<typename T, typename... Policies>
    struct state;
}

dbg::state<int, 
    dbg::name<"my_named_var"_sc>
> my_named_var{};

dbg::state<int, 
    dbg::name<"my_traced_var"_sc>,
    dbg::trace_changes
> my_traced_var{};

Python module for interacting with live target or snapshot with nice user interface

Extract command declarations and provide both an API and interactive UI to send and receive commands from a live target.

Interfaces:

  • Command interface
  • Memory interface
  • Trace/log interface

Python module will need support for how to represent the values of types with an extensible interface for adding more:

  1. Integral
  2. Enums
  3. stdx::bitset (including representation of set of enums)
  4. std::array
  5. stdx::intrusive_list
  6. msg::message
  7. Generic struct (recursively decode members)

lukevalenty avatar May 02 '24 15:05 lukevalenty