IBM Z and LinuxONE - Languages - Group home

Speedy debugging on z/OS

  

z/OS 1.10 introduces the dbgld utility. It will significantly improve the startup time and performance of dbx. So how does it work, and how do I take advantage of it? Read on for more details.


When you specify -g option during C/C++ compilation, a debug sidefile (.dbg) is generated for each input source file. To debug an application, dbx would need to locate all of its debug sidefiles, and process debug information stored within them, this is a necessary but time consuming task. dbgld can perform this task before dbx is invoked. In addition, dbgld consolidates all the debug sidefiles into a single sidefile (.mdbg). You can now debug your module, by bringing along just a single .mdbg file.


Speedy debugging in 3 easy steps
  1. Compile and bind program with -g option:
  2. xlc -g hello1.c hello2.c hello3.c -o hello
  3. This will create an executable module hello and 3 debug sidefiles hello1.dbg hello2.dbg and hello3.dbg
  4. Invoke dbgld on the module:
  5. dbgld hello
  6. This will create the consolidated debug sidefile hello.mdbg
  7. Finally, debug hello with dbx:
  8. dbx hello
  9. dbx will automatically use hello.mdbg if it finds it in your current directory.


For more information about dbgld, please refer to dbgld — Create a module map for debugging in XL C/C++ User's Guide.