# External programs and GDB Debugger

The "Run a program before debugging" option in [Remote GDB Debugger options](/8.5/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](/8.5/user-guide/user-interface/menu-bar/debugger/process-control/process-options.md) dialog %p: port number from the [Process options](/8.5/user-guide/user-interface/menu-bar/debugger/process-control/process-options.md) 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](/8.5/user-guide/debugger/remote-debugging/remote-gdb-debugger/debugging-code-snippets-with-qemu.md) using the QEMU emulator.

See also

* [Remote GDB Debugger options](/8.5/user-guide/debugger/remote-debugging/remote-gdb-debugger/remote-gdb-debugger-options.md)
* [Debugger submenu](/8.5/user-guide/user-interface/menu-bar/debugger.md).


---

# Agent Instructions: 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/8.5/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.
