microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
gdb_packet_recognizer.hpp File Reference

Fast compile-time two-level lookup for GDB RSP packets. More...

#include "../microfmt.hpp"
#include "gdb_packet_types.hpp"
#include <cstddef>
#include <cstdint>
Include dependency graph for gdb_packet_recognizer.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  microfmt::gdb::packet_recognizer
 Zero-allocation packet payload recognizer. More...
 
struct  microfmt::gdb::packet_recognizer::packet_entry
 
struct  microfmt::gdb::packet_recognizer::dispatch_entry
 

Namespaces

namespace  microfmt
 
namespace  microfmt::gdb
 

Macros

#define __INSPECTOR_GDB_PACKET_TYPE_X(name, str)
 
#define __INSPECTOR_GDB_PACKET_TYPE_X(name, str)
 
#define __INSPECTOR_GDB_PACKET_TYPE_X(name, str)
 

Detailed Description

Fast compile-time two-level lookup for GDB RSP packets.

Macro Definition Documentation

◆ __INSPECTOR_GDB_PACKET_TYPE_X [1/3]

#define __INSPECTOR_GDB_PACKET_TYPE_X (   name,
  str 
)
Value:
if constexpr (sizeof(str) > 2) { \
++count; \
}

◆ __INSPECTOR_GDB_PACKET_TYPE_X [2/3]

#define __INSPECTOR_GDB_PACKET_TYPE_X (   name,
  str 
)
Value:
if constexpr (sizeof(str) > 2) { \
sub[idx++] = packet_entry{str, packet_type::name}; \
}

◆ __INSPECTOR_GDB_PACKET_TYPE_X [3/3]

#define __INSPECTOR_GDB_PACKET_TYPE_X (   name,
  str 
)
Value:
if constexpr (sizeof(str) > 2) { \
const unsigned char c = static_cast<unsigned char>((str)[0]); \
if (c < 128) { \
table[c] = packet_type::_multi_char_marker; \
} \
} else if constexpr (sizeof(str) == 2) { \
const unsigned char c = static_cast<unsigned char>((str)[0]); \
if (c < 128) { \
table[c] = packet_type::name; \
} \
}