> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/ida-9.2/user-guide/debugger/remote-debugging/remote-gdb-debugger/external-programs-and-gdb-debugger.md).

# External programs and GDB Debugger

The "Run a program before debugging" option in [Remote GDB Debugger options](/ida-9.2/user-guide/debugger/remote-debugging/remote-gdb-debugger/remote-gdb-debugger-options.md) allows to automatically run a program (such as a debugging server) when starting a debugging session. If you enable it, the following options become available:

Command line

```
        Command line of the program to run. The following special symbols can be used:
```

%i: input file name from the [Process options](/ida-9.2/user-guide/user-interface/menu-bar/common-actions-2.md#process-options) dialog %p: port number from the [Process options](/ida-9.2/user-guide/user-interface/menu-bar/common-actions-2.md#process-options) dialog %e: file name of a temporary ELF file created from the database contents Initial SP

```
        IDA will set the SP (or a similar register) after connecting to the server
```

Choose a configuration

```
        Load one of the pre-defined configurations (command line, memory map and SP value)
        described in the gdb_arch.cfg file.
```

Memory map

```
        Edit the memory map for the external server. It will be used during debugging.
```

One use of these options is to [debug small code snippets](/ida-9.2/user-guide/debugger/remote-debugging/remote-gdb-debugger/debugging-code-snippets-with-qemu.md) using the QEMU emulator.

See also

* [Remote GDB Debugger options](/ida-9.2/user-guide/debugger/remote-debugging/remote-gdb-debugger/remote-gdb-debugger-options.md)
* [Debugger submenu](/ida-9.2/user-guide/user-interface/menu-bar/common-actions-2.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/ida-9.2/user-guide/debugger/remote-debugging/remote-gdb-debugger/external-programs-and-gdb-debugger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
