Boost.Build comes with a debugger for Jamfiles. To run the debugger, start Boost.Build with b2 -dconsole.
$ b2 -dconsole (b2db) break gcc.init Breakpoint 1 set at gcc.init (b2db) run Starting program: /usr/bin/b2 Breakpoint 1, gcc.init ( ) at /usr/share/boost-build/tools/gcc.jam:74 74 local tool-command = ; (b2db) quit
run command is used to start a new
subprocess for debugging. The arguments to
passed on the command line. If a child process is already running,
it will be terminated before the new child is launched.
When the program is paused
continue will resume execution.
step command will advance the program by a single
statement, stopping on entry to another function or return
from the current function.
next is like
except that it skips over function calls.
until the current function returns.
kill command terminates the current child
Breakpoints are set using the
The location of the breakpoint can be specified as either
the name of a function (including the module name) or
or a file name and line number of the form
When a breakpoint is created it is given a unique id which is
used to identify it for other commands.
(b2db) break Jamfile:10 Breakpoint 1 set at Jamfile:10 (b2db) break msvc.init Breakpoint 2 set at msvc.init
A breakpoint can be temporarily disabled using the
command. While a breakpoint is disabled, the child will not
stop when it is hit. A disabled breakpoint can be activated
(b2db) disable 1 (b2db) enable 1
Breakpoints can be removed permanently with
clear. The difference between them is that
delete takes the breakpoint id while
clear takes the location of the breakpoint as
originally specified to break.
(b2db) clear Jamfile:10 Deleted breakpoint 1 (b2db) delete 2
backtrace command will print a summary of
every frame on the stack.
(b2db) print [ modules.peek : ARGV ] /usr/bin/b2 toolset=msvc install (b2db) print $(__file__) Jamfile.jam