mirror of
https://github.com/clearlinux/graphene.git
synced 2026-08-20 12:45:57 +00:00
5ef9bdc861
- Use the same mechanism (debug_map) in Pal/Linux and Pal/Linux-SGX. Previously, Pal/Linux emulated the _r_debug structure, normally maintained by ld.so, but that cannot be done in SGX outer PAL, because it's loaded by ld.so already. - Maintain the debug maps outside of SGX enclave. This allows initializing them before enclave start, and potentially makes them easier to use. - Initialize PAL debug map before enclave start. Previously, this was done from inside the enclave, so you couldn't set a breakpoint too early (e.g. in pal_linux_main). - Store only load address, without list of sections. This is to avoid parsing the list of sections just to report them to the debugger. Unfortunately, the GDB version that we support still needs these sections, but we can retrieve them in GDB plugin. - Move Python GDB code related to debug maps to a common file.
21 lines
553 B
C
21 lines
553 B
C
/* SPDX-License-Identifier: LGPL-3.0-or-later */
|
|
/* Copyright (C) 2014 Stony Brook University */
|
|
|
|
/*
|
|
* This file contains definitions of APIs used for debug purposes.
|
|
*/
|
|
|
|
#ifndef PAL_DEBUG_H
|
|
#define PAL_DEBUG_H
|
|
|
|
#include "pal.h"
|
|
|
|
int pal_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
|
|
int pal_fdprintf(int fd, const char* fmt, ...) __attribute__((format(printf, 2, 3)));
|
|
void warn(const char* format, ...);
|
|
|
|
void DkDebugMapAdd(PAL_STR uri, PAL_PTR start_addr);
|
|
void DkDebugMapRemove(PAL_PTR start_addr);
|
|
|
|
#endif /* PAL_DEBUG_H */
|