/* * Copyright (c) 2023, Jesús Lapastora * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace JIT::GDB { void register_into_gdb(ReadonlyBytes data); void unregister_from_gdb(ReadonlyBytes data); // Build a GDB compatible image to register with the GDB JIT Interface. // Returns Optional since the platform may not be supported. // The `code` must be the region of memory that will be executed, since the // image will hold direct references to addresses within the code. This way GDB // will be able to identify the code region and insert breakpoints into it. // Both `file_symbol_name` and `code_symbol_name` will end up in the symbol // table of the image. They represent a file name for the image and a name for // the region of code that is being executed. Optional> build_gdb_image(ReadonlyBytes code, StringView file_symbol_name, StringView code_symbol_name); }