Debugging utility targeting UNIX-like systems with dynamic system linkers.
- C 59.7%
- Python 28.4%
- Just 7.7%
- Shell 4.2%
| scripts | move scripts | |
| .gitignore | reimplement mab as a c shared lib | |
| clang-format.conf | reflow comments | |
| Justfile | build with warns | |
| LICENSE | initial commit | |
| mab.c | fix warnings | |
| mab.h | fix warnings | |
| README.md | just install | |
mab
mab is a debugging utility that wraps a
binary executable and a library with some helper code, with the intent of
facilitating the visualization of data under the lldb debugger.
Compiling
Simply building the library can be done with:
just build
To install the library, one should run:
just install
Usage
mab is implemented as a shared library that you inject into a program using
the platform's dynamic linker. Usually, this is done by passing the path to the
shared library to an environment variable, consulted by the linker just before
running the target binary (e.g. LD_PRELOAD on GNU/Linux systems, and
DYLD_INSERT_LIBRARIES on macOs).
For instance, on macOs, one might run:
DYLD_INSERT_LIBRARIES=/path/to/libmab.dylib \
MAB_LIB_PATH=/path/to/lib_with_debug_code.dylib \
/Library/Developer/CommandLineTools/usr/bin/lldb -- \
/path/to/program/you/wish/to/debug [cmdline-args]
To generate a library to feed to $MAB_LIB_PATH, check out
mab-template-rust or
mab-template-c.
WTF is this name?
mab = macOs bugs