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].
To install, run
sudo apt-get install lldb.
To use, add the following to your
# So that lldbinit.py takes precedence. script sys.path[:0] = ['/<your-path>/chromium/src/tools/lldb'] script import lldbinit
Make sure the build configurations include
is_debug=true, this will set
symbol_level=2 by default, which is required if need to view the content of frame-level local variables.
~/.lldbinitfile, don't forget to put the correct path to Chromium source in there.
process 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 tab (process) you want to debug.
Process PID stoppedand 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.
contto continue the execution of the process.
helpto learn more about different lldb commands.