mojo debug
Launches the Mojo debugger using the command-line interface or an external editor.
Synopsis
mojo debug [debug-options]
Description
This command, which underneath uses the LLDB debugger, offers four basic debug session modes:
-
Build and debug a Mojo file.
mojo debug [options] <file.mojo> [runtime args]
Builds the Mojo file at the given path and launches it under the debugger. Options, which come before the Mojo file, can include any compilation options expected by the
mojo run
, as well as regular debuggingcommands. Runtime args, which come after the Mojo file, are passed directly to the debuggee upon launch. By default, this mode uses-O0
and--debug-level=full
as compilation options. -
Debug a precompiled program.
mojo debug [options] <program> [runtime args]
Launches the program at the given path in the debugger. Options, which come before the program path, cannot include compilation commands. Runtime args, which come after the program path, are passed directly to the debuggee upon launch.
-
Attach to a running process.
mojo debug [options] [--pid <pid> | --process-name <process-name>]
Attaches to the process specified by pid or name, which can be the full path of the process’ executable. Options other than the process identifier cannot include compil