docs/lldbinit.md
Usage of Chromium's lldbinit.py is recommended when
debugging with lldb. This is necessary for source-level debugging when
strip_absolute_paths_from_debug_symbols is enabled [this is the default].
If you have not installed LLDB yet, run sudo apt-get install lldb to get it.
To use, add the following to your ~/.lldbinit:
# So that lldbinit.py takes precedence.
script sys.path[:0] = ['/<your-path>/chromium/src/tools/lldb']
script import lldbinit
Replace <your-path> above with the absolute path containing your Chromium
repo.
Make sure the build configuration includes is_debug=true; this will set
symbol_level=2 by default, which is required to view the content of
frame-level local variables.
For visualizer support for common pointer, string, and vector types in Chromium, add the following:
script import chromium_visualizers
~/.lldbinit file; don't forget
to put the correct absolute path to Chromium source in there.lldb out/Default/chrome (or
out/Debug/chrome)
lldb out/Default/Chromium.app/Contents/MacOS/Chromium--no-sandbox flag:
out/Default/chrome --no-sandboxout/Default/Chromium.app/Contents/MacOS/Chromium --no-sandboxprocess launch -- --no-sandbox, you will attach to the main browser
process and will not be able to debug tab processes.process attach -p PID. PID is the process ID of the process you
want to debug.
Process PID stopped and some stack traces.attach failed: Operation not permitted, it is probably due to
ptrace Protection.
You can disable this feature using
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope.breakpoint set -f inspector_overlay_agent.cc -l 627.cont to continue the execution of the process.help to learn more about different lldb commands.