meta: add debugging library
the debug library can be used by both server (the kernel) and client (the debugger) applications. the library implements the protocol that is used for communication between the kernel and debugger, as well as handling for any requests supported by the protocol.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include <magenta/debug/packet.h>
|
||||
#include <magenta/debug/util.h>
|
||||
|
||||
void mxdbg_packet_init(
|
||||
struct mxdbg_packet *packet,
|
||||
size_t size,
|
||||
enum mxdbg_packet_type type,
|
||||
enum mxdbg_packet_flags flags)
|
||||
{
|
||||
memset(packet, 0x0, sizeof *packet);
|
||||
packet->pkt_magic = MXDBG_PACKET_MAGIC;
|
||||
packet->pkt_length = size;
|
||||
packet->pkt_type = type;
|
||||
packet->pkt_flags = flags;
|
||||
}
|
||||
|
||||
bool mxdbg_packet_validate(const struct mxdbg_packet *packet)
|
||||
{
|
||||
return packet->pkt_magic == MXDBG_PACKET_MAGIC;
|
||||
}
|
||||
Reference in New Issue
Block a user