# [−] [src] Module cortex_m_semihosting::debug

Interacting with debugging agent

# Example

This example will show how to terminate the QEMU session. The program should be running under QEMU with semihosting enabled (use `-semihosting` flag).

Target program:

    #[macro_use]
    extern crate cortex_m_semihosting;
    use cortex_m_semihosting::debug::{self, EXIT_SUCCESS, EXIT_FAILURE};

    fn main() {
        if 2 == 2 {
            // report success
            debug::exit(EXIT_SUCCESS);
        } else {
            // report failure
            debug::exit(EXIT_FAILURE);
        }
    }

## Enums

Exception | This values are taken from section 5.5.2 of ADS Debug Target Guide (DUI0058).

## Constants

EXIT_FAILURE | Unsuccessful execution of a program.
EXIT_SUCCESS | Successful execution of a program.

## Functions

exit | Reports to the debugger that the execution has completed.
report_exception | Report an exception to the debugger directly.

## Type Definitions

ExitStatus | Status enum for `exit` syscall.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)