Next: , Previous: Attach Buffer, Up: Debugger

3.2.4 Synchronising Breakpoints

At any point in time the breakpoints in a particular buffer will be either “fresh” or “stale,” depending on whether the buffer has been modified. Breakpoints are fresh when, as far as Emacs knows, the buffer's source text (line numbers) correspond with the code in the Erlang node. After the buffer is modified, the breakpoints become stale, because edits may change line numbers so that the breakpoints in Emacs no longer correspond with the actual program. Stale breakpoints are made fresh by using the edb-synch-breakpoints (C-c C-d s) command to reassert that they are correct. This command is typically used after recompiling and reloading the module.

Fresh breakpoints are marked in red, stale breakpoints are marked in purple.

C-c C-d s
Synchronise breakpoints by discarding the ones in the Erlang node and then re-setting them from those in the Emacs buffer.

Care must be taken to only synchronise breakpoints when the Erlang node is actually running the same code that is in the Emacs buffer. Otherwise, the Erlang processes may break in unexpected places.

When reloading modules during debugging, it is preferable to use the erl-reload-module command (C-c C-d L, see Evaluation) than to call l(mymodule) directly in the Erlang shell. This is because the Distel command is specially coded to make sure reloading interpreted modules keeps them interpreted, but this doesn't appear to work correctly in the Erlang shell.