Editing Source Code

In DDD itself, you cannot change the source file currently displayed. Instead, DDD allows you to invoke a text editor. To invoke a text editor for the current source file, select the Edit button or Source => Edit Source.

By default, DDD tries a number of common editors. You can customize DDD to use your favorite editor; See Customizing Editing, for details.

After the editor has exited, the source code shown is automatically updated.

If you have DDD and an editor running in parallel, you can also update the source code manually via Source => Reload Source. This reloads the source code shown from the source file. Since DDD automatically reloads the source code if the debugged program has been recompiled, this should seldom be necessary.

  • Customizing Editing:
  • In-Place Editing:

Node:Customizing Editing, Next:In-Place Editing, Up:Editing Source Code

Customizing Editing

You can customize the editor to be used via Edit => Preferences => Helpers => Edit Sources. This is tied to the following resource:

editCommand(class EditCommand) Resource

| A command string to invoke an editor on the specific file. @LINE@ is replaced by the current line number, @FILE@ by the file name. The default is to invoke $XEDITOR first, then $EDITOR, then vi:

          Ddd*editCommand: \
          ${XEDITOR-false} +@LINE@ @FILE@ || \
          xterm -e ${EDITOR-vi} +@LINE@ @FILE@
          

| | --- |

This ~/.ddd/init setting invokes an editing session for an XEmacs editor running gnuserv:

     Ddd*editCommand: gnuclient +@LINE@ @FILE@
     

This ~/.ddd/init setting invokes an editing session for an Emacs editor running emacsserver:

     Ddd*editCommand: emacsclient +@LINE@ @FILE@
     

Node:In-Place Editing, Previous:Customizing Editing, Up:Editing Source Code

In-Place Editing

This resource is experimental:

sourceEditing(class SourceEditing) Resource
If this is on, the displayed source code becomes editable. This is an experimental feature; Default is off.

Node:Recompiling, Next:Patching, Previous:Editing Source Code, Up:Changing the Program

results matching ""

    No results matching ""