microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Static Public Member Functions | Static Public Attributes | List of all members
microfmt::gdb::packet_recognizer Class Reference

Zero-allocation packet payload recognizer. More...

#include <gdb_packet_recognizer.hpp>

Classes

struct  dispatch_entry
 
struct  packet_entry
 

Static Public Member Functions

static constexpr packet_type recognize (string_view payload) noexcept
 Identifies the high-level packet_type from a raw GDB packet payload.
 

Static Public Attributes

static constexpr size_t k_count_multichar
 
static constexpr auto k_multi_char_table
 
static constexpr auto k_first_byte_table
 

Detailed Description

Zero-allocation packet payload recognizer.

Member Function Documentation

◆ recognize()

static constexpr packet_type microfmt::gdb::packet_recognizer::recognize ( string_view  payload)
inlinestaticconstexprnoexcept

Identifies the high-level packet_type from a raw GDB packet payload.

Parameters
payloadUnescaped packet payload string (without '$' and '#XX').
Returns
Resolved packet_type, or unknown if unrecognized.

Member Data Documentation

◆ k_count_multichar

constexpr size_t microfmt::gdb::packet_recognizer::k_count_multichar
staticconstexpr
Initial value:
= []() -> size_t {
size_t count = 0;
#define __INSPECTOR_GDB_PACKET_TYPE_X(name, str)
return count;
}()

◆ k_first_byte_table

constexpr auto microfmt::gdb::packet_recognizer::k_first_byte_table
staticconstexpr
Initial value:
= []() {
reloco::array<packet_type, 128> table{};
for (size_t i = 0; i < 128; ++i) {
table[i] = packet_type::unknown;
}
#define __INSPECTOR_GDB_PACKET_TYPE_X(name, str)
return table;
}()

◆ k_multi_char_table

constexpr auto microfmt::gdb::packet_recognizer::k_multi_char_table
staticconstexpr
Initial value:
= []() {
reloco::array<packet_entry, k_count_multichar> sub{};
size_t idx = 0;
#define __INSPECTOR_GDB_PACKET_TYPE_X(name, str)
return sub;
}()

The documentation for this class was generated from the following file: