Add a GDB/LLDB interface for interactive debugging of MLIR Actions
authorMehdi Amini <joker.eph@gmail.com>
Wed, 15 Feb 2023 23:56:08 +0000 (15:56 -0800)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 24 Apr 2023 21:34:15 +0000 (14:34 -0700)
commit1020150e7a6f6d6f833c232125c5ab817c03c76b
tree7e74387e13d346152dcfcf3577f241726f187b32
parent1869a9c225c7ed411a15592d21b277716b65a374
Add a GDB/LLDB interface for interactive debugging of MLIR Actions

This includes a small runtime acting as callback for the ExecutionEngine
and a C API that makes it possible to control from the debugger.

A python script for LLDB is included that hook a new `mlir` subcommand
and allows to set breakpoints and inspect the current action, the context
and the stack.

Differential Revision: https://reviews.llvm.org/D144817
mlir/include/mlir/Debug/DebuggerExecutionContextHook.h [new file with mode: 0644]
mlir/include/mlir/Debug/ExecutionContext.h
mlir/include/mlir/IR/OperationSupport.h
mlir/include/mlir/Rewrite/PatternApplicator.h
mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
mlir/lib/Debug/CMakeLists.txt
mlir/lib/Debug/DebuggerExecutionContextHook.cpp [new file with mode: 0644]
mlir/lib/Debug/ExecutionContext.cpp
mlir/lib/IR/AsmPrinter.cpp
mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
mlir/utils/lldb-scripts/action_debugging.py [new file with mode: 0644]