qemu/accel/tcg/debuginfo.h
Markus Armbruster 68ba85cecc coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h
qemu/coroutine.h and qemu/lockable.h include each other.

They need each other only in macro expansions, so we could simply drop
both inclusions to break the loop, and add suitable includes to files
that expand the macros.

Instead, move a part of qemu/coroutine.h to new qemu/coroutine-core.h
so that qemu/coroutine-core.h doesn't need qemu/lockable.h, and
qemu/lockable.h only needs qemu/coroutine-core.h.  Result:
qemu/coroutine.h includes qemu/lockable.h includes
qemu/coroutine-core.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221221131435.3851212-5-armbru@redhat.com>
[Semantic rebase conflict with 7c10cb38cc "accel/tcg: Add debuginfo
support" resolved]
2023-01-20 07:21:46 +01:00

80 lines
1.9 KiB
C

/*
* Debug information support.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef ACCEL_TCG_DEBUGINFO_H
#define ACCEL_TCG_DEBUGINFO_H
#include "qemu/bitops.h"
/*
* Debuginfo describing a certain address.
*/
struct debuginfo_query {
uint64_t address; /* Input: address. */
int flags; /* Input: debuginfo subset. */
const char *symbol; /* Symbol that the address is part of. */
uint64_t offset; /* Offset from the symbol. */
const char *file; /* Source file associated with the address. */
int line; /* Line number in the source file. */
};
/*
* Debuginfo subsets.
*/
#define DEBUGINFO_SYMBOL BIT(1)
#define DEBUGINFO_LINE BIT(2)
#if defined(CONFIG_TCG) && defined(CONFIG_LIBDW)
/*
* Load debuginfo for the specified guest ELF image.
* Return true on success, false on failure.
*/
void debuginfo_report_elf(const char *name, int fd, uint64_t bias);
/*
* Take the debuginfo lock.
*/
void debuginfo_lock(void);
/*
* Fill each on N Qs with the debuginfo about Q->ADDRESS as specified by
* Q->FLAGS:
*
* - DEBUGINFO_SYMBOL: update Q->SYMBOL and Q->OFFSET. If symbol debuginfo is
* missing, then leave them as is.
* - DEBUINFO_LINE: update Q->FILE and Q->LINE. If line debuginfo is missing,
* then leave them as is.
*
* This function must be called under the debuginfo lock. The results can be
* accessed only until the debuginfo lock is released.
*/
void debuginfo_query(struct debuginfo_query *q, size_t n);
/*
* Release the debuginfo lock.
*/
void debuginfo_unlock(void);
#else
static inline void debuginfo_report_elf(const char *image_name, int image_fd,
uint64_t load_bias)
{
}
static inline void debuginfo_lock(void)
{
}
static inline void debuginfo_query(struct debuginfo_query *q, size_t n)
{
}
static inline void debuginfo_unlock(void)
{
}
#endif
#endif