#include "mlir/Debug/DebuggerExecutionContextHook.h"
#include "mlir/Debug/BreakpointManagers/FileLineColLocBreakpointManager.h"
#include "mlir/Debug/BreakpointManagers/TagBreakpointManager.h"
usingnamespacemlir;
usingnamespacemlir::tracing;
namespace {
struct DebuggerState { … };
}
static DebuggerState &getGlobalDebuggerState() { … }
extern "C" {
void mlirDebuggerSetControl(int controlOption) { … }
void mlirDebuggerPrintContext() { … }
void mlirDebuggerPrintActionBacktrace(bool withContext) { … }
void mlirDebuggerCursorPrint(bool withRegion) { … }
void mlirDebuggerCursorSelectIRUnitFromContext(int index) { … }
void mlirDebuggerCursorSelectParentIRUnit() { … }
void mlirDebuggerCursorSelectChildIRUnit(int index) { … }
void mlirDebuggerCursorSelectPreviousIRUnit() { … }
void mlirDebuggerCursorSelectNextIRUnit() { … }
void mlirDebuggerEnableBreakpoint(BreakpointHandle breakpoint) { … }
void mlirDebuggerDisableBreakpoint(BreakpointHandle breakpoint) { … }
BreakpointHandle mlirDebuggerAddTagBreakpoint(const char *tag) { … }
void mlirDebuggerAddRewritePatternBreakpoint(const char *patternNameInfo) { … }
void mlirDebuggerAddFileLineColLocBreakpoint(const char *file, int line,
int col) { … }
}
LLVM_ATTRIBUTE_NOINLINE void mlirDebuggerBreakpointHook() { … }
static void preventLinkerDeadCodeElim() { … }
static tracing::ExecutionContext::Control
debuggerCallBackFunction(const tracing::ActionActiveStack *actionStack) { … }
namespace {
class DebuggerObserver : public ExecutionContext::Observer { … };
}
void mlir::setupDebuggerExecutionContextHook(
tracing::ExecutionContext &executionContext) { … }