# IDL and System Routines Post-IDL 8.0

An IDL system routine is an IDL procedure or function that is written in a compiled language with an IDL specific interface and linked into IDL, instead of being written in the IDL language itself. The best way to create an IDL system routine is to compile and link the routine into a sharable library and then to add the routine to IDL at runtime using either the LINKIMAGE procedure or by making your routines part of a Dynamically Loadable Module (DLM).

Note: We recommend the use of Dynamically Loadable Modules rather than LINKIMAGE whenever possible.

## Debugging System Routines

To debug system routines and DLMs, you must attach your debugger to the IDL process that is running your library code. In IDL 8.0 and later, the process to which you should attach the debugger varies depending on your platform and your version of IDL.

When IDL is running via Command-Line:

Command Line
Windows | Unix
--- | ---
idl_opserver.exe | idl

To debug your shared library code when IDL is running in command-line mode, attach your debugger (gdb, Visual Studio, etc.) to one of the following:

- On Windows, using Visual Studio, you can select Attach to Process and choose the `idl_opserver.exe` process.
- On Unix-based systems, using gdb or dbx, you can use the `ps` command to retrieve the ID of the `idl` process, and then attach your debugger to that process ID.

When IDL is running via Workbench:

Workbench
Windows | Unix
--- | ---
32-bit | 64-bit | 64-bit
idl_engine.exe | idlde.exe | idlde

To debug your shared library code when the IDL Workbench is running, attach your debugger (gdb, Visual Studio, etc.) to one of the following:

- On Windows, using Visual Studio, you can select Attach to Process and choose the `idl_engine.exe` or `idlde.exe` process.
- On Unix-based systems, using gdb or dbx, you can use the `ps` command to retrieve the ID of the `idlde` process, and then attach your debugger to that process ID.