/* * Copyright (c) 2021, Leon Albrecht * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #if defined(__cplusplus) && defined(__cpp_concepts) # include #else # include #endif #include #ifdef __cplusplus struct [[gnu::packed]] PtraceRegisters : public __mcontext { # if defined(__cplusplus) && defined(__cpp_concepts) FlatPtr ip() const { return rip; } void set_ip(FlatPtr ip) { rip = ip; } FlatPtr bp() const { return rbp; } void set_bp(FlatPtr bp) { rbp = bp; } # endif }; #else typedef struct __mcontext PthreadRegisters; #endif