How does z/OS Debugger locate the C/C++ .mdbg file?

For the following conditions, z/OS® Debugger can obtain debug information and source from a module map (.mdbg) file:
  • You do one of the following tasks:
    • You or your site specifies YES for the EQAOPTS MDBG command and, for environments that support environment variables, you do not set the environment variable EQA_USE_MDBG to NO.
    • You or your site specifies or defaults to NO for the EQAOPTS MDBG command but, for environments that support environment variables, you override that option by setting the environment variable EQA_USE_MDBG to YES.
  • You compile your programs with z/OS XL C/C++, Version 1.10 or later
You use the dbgld command with the -c option or the CDADBGLD utility with the CAPSRC option to save (capture) the source files, as well as all the .dbg files, belonging to the programs that make up a single load module or DLL into one module map file (.mdbg file). Create an .mdbg file with captured source for any load module or DLL that you want to debug because the .mdbg file makes it easier for you to debug the load module or DLL. For example, if your load module is consists of 10 programs and you do not create a module map file, you would need to keep track of 10 .dbg files and 10 source files. If you create a module map file for that load module, you would need to keep track of just one .mdbg file.
z/OS Debugger might read the .mdbg file more than once, but it always reads this file from the same data set. After z/OS Debugger locates this file and validates its contents with the load module being debugged, you cannot redirect z/OS Debugger to search a different file. z/OS Debugger searches for the .mdbg file based on the input from the following commands, user exit, or environment variable, in the following order:
  1. The EQAUEDAT user exit, specifying function code 37.
  2. If you do not write the EQAUEDAT user exit or the user exit cannot find the file, the default data set name, which is userid.mdbg(load_module_or_DLL_name), or, in UNIX System Services, ./load_module_or_DLL_name.mdbg.
If z/OS Debugger cannot find the .mdbg file, then it searches for the .mdbg file based on the input from the following commands, DD statement, or environment variable, in the following order:
  1. The SET MDBG command
  2. The SET DEFAULT MDBG command
  3. The EQAMDBG DD statement.
  4. The EQA_MDBG_PATH environment variable.

To learn more about the DEBUG compiler option, the dbgld command, and the CDADBGLD utility, see z/OS XL C/C++ User's Guide.