# OS_IsRunOnDebugger

## Syntax

  `#include <nitro/os.h>`
  `BOOL OS_IsRunOnEmulator( void );`

## Arguments

None.

## Return Values

If the program is running on IS-NITRO-DEBUGGER or IS-TWL-DEBUGGER, returns `TRUE`. Otherwise, returns `FALSE`.

## Description

Checks whether the program is running on either IS-NITRO-DEBUGGER or IS-TWL-DEBUGGER.

Because this is a debugging function, it always returns `FALSE` in the FINALROM version of the library.

###
Similar Functions

The `OS_IsRunOnEmulator` function is also used for finding out the operating environment. It can find out whether the application is running on the Ensata NITRO Software Emulator.

###
Actual Values Due to the Environment or Build

The table below shows the differences in the values returned by the `OS_IsRunOnDebugger` and `OS_IsRunOnEmulator` functions due to the operating environment.

For NITRO Mode
Operating Environment | Build | Value of `OS_IsRunOnDebugger` | `Value of `OS_IsRunOnEmulator``
--- | --- | --- | ---
NTR system | DEBUG RELEASE FINALROM | FALSE | FALSE
Actual TWL unit | DEBUG RELEASE FINALROM | FALSE | FALSE
IS-NITRO-DEBUGGER (debugger software even if not connected) | DEBUG RELEASE | TRUE | FALSE
FINALROM | FALSE | FALSE
ENSATA EMULATOR | DEBUG RELEASE | FALSE | TRUE
FINALROM | FALSE | FALSE
IS-TWL-DEBUGGER (For general-purpose development: ARM9) | DEBUG RELEASE | TRUE | FALSE
FINALROM | FALSE | FALSE
IS-TWL-DEBUGGER (For component development: ARM9 + ARM7) | DEBUG RELEASE | TRUE | FALSE
FINALROM | FALSE | FALSE
IS-TWL-DEBUGGER (For general-purpose development: ARM9) Debugger software When not connected | DEBUG RELEASE | `FALSE` | `FALSE`
FINALROM | `FALSE` | `FALSE`
IS-TWL-DEBUGGER (For component development: ARM9 + ARM7) Debugger software When not connected | DEBUG RELEASE | `FALSE` | `FALSE`
FINALROM | `FALSE` | `FALSE`
For TWL Mode
Operating Environment | Build | Value of the `OS_IsRunOnDebugger` function | Value of `OS_IsRunOnEmulator`
Actual TWL unit | DEBUG RELEASE FINALROM | FALSE | FALSE
IS-TWL-DEBUGGER (For general-purpose development: ARM9) | DEBUG RELEASE | TRUE | FALSE
FINALROM | FALSE | FALSE
IS-TWL-DEBUGGER (For component development: ARM9 + ARM7) | DEBUG RELEASE | TRUE | FALSE
FINALROM | FALSE | FALSE
IS-TWL-DEBUGGER (For general-purpose development: ARM9) Debugger software When not connected | DEBUG RELEASE | `FALSE` | `FALSE`
FINALROM | `FALSE` | `FALSE`
IS-TWL-DEBUGGER (For component development: ARM9 + ARM7) Debugger software When not connected | DEBUG RELEASE | `FALSE` | `FALSE`
FINALROM | `FALSE` | `FALSE`

## Internal Operation

Makes a decision based on the logical sum of the the return value of the `OS_GetConsoleType` function and the `OS_CONSOLE_ISDEBUGGER` and `OS_CONSOLE_TWLDEBUGGER` bits.

## See Also

`OS_IsRunOnEmulator`
`OS_GetConsoleType`

## Revision History

2009/10/30 Added information about operations when a debugger is not connected.
2008/04/15 Table added.
2007/11/05 Initial version.

CONFIDENTIAL