V8 MDL - How the Debugger Finds Source Code


How the Debugger Finds Source Code

When the MDL debugger displays source code, it reads the code from the source code file. It looks for the source code file in the following places, in order:

 

  1. When looking for the source file, the debugger first uses the name exactly as it is specified in the compile command or makefile.
  2. Next it looks for it in the current directory and in the directories specified by MS_DBGSOURCE.
  3. Finally, it looks in the directory specified that contains the .ma application file.

 

Therefore, when make files specify the full directory path, MS_DBGSOURCE is not needed. A typical setting for MS_DBGSOURCE is the following:

 

MS_DBGSOURCE = %MS%\mdl\examples\myapp\;%MS%\mdl\examples\basic\

 

Preparing an Application for Use With the Debugger

 

To prepare an application for debugging, you must compile and link it with the -g modifier. When the -g modifier is specified to the compiler, the compiler dumps all debugging information to the object file. If the -g modifier is not specified, the compiler dumps only the function names to the debugger portion of the object file.

 

When the -g modifier is specified to the linker, the linker copies all available debugging information to the application file. If the -g modifier is not specified, the linker copies only the function names and source filenames to the application's debugging information.

 

When using bmake to build an application, the -g modifier can be issued to both the compiler and linker by defining the macro MDLDEBUG on the command line. For example, to compile and link the MDL example myapp for debugging, type:

 

BMAKE +dMDLDEBUG MYAPP