# Bochs IDB operation mode

The IDB operation mode, as its name implies, takes the current database as the input and runs it under the Bochs debugger. This mode can be used to debug any x86 32 or 64-bit code. Please note that the code executes with privilege ring 3.

The following parameters can be specified in the IDB operation mode:

```
  - Entry address: the address where the execution starts.
    This parameter can be specified in three ways (listed in order of
    precedence):
      - by renaming the desired location as "ENTRY" (global name)
      - by selecting an address range with the mouse or keyboard.
        The selection start address is used as the entry point
      - by positioning the cursor at a given position and running the
        debugger

  - Exit address (optional): the address where the execution ends.
    This parameter can be specified in two ways:
      - by renaming the desired location as "EXIT" (global name). Please note that
        the emulation will stop at the item following the exit label.
      - by selecting an address range with the mouse or keyboard
        The selection end address is used as the exit point
    If the exit address is not specified, the execution will continue until
    an exception occurs. However, if the exit address is reached, the debugger
    will ask the user if emulation should be continued or not.

  - Startup stack size: number of KBs to allocate for the stack segment.
    The stack segment is automatically created and named as "STACK".
```

It may also prove useful to enable the "Debugger Setup/Suspend on debugging start" so that IDA automatically suspends the process before executing the first instruction.

While debugging, exceptions may occur and are caught by IDA. Please note that these exceptions are raw machine exceptions. For example, instead of an access violation exception, a page fault exception is generated.

See also:

* [Bochs debugger](https://docs.hex-rays.com/8.5/user-guide/debugger/remote-debugging/bochs-debugger)
* [Bochs plugin operation mode FAQ](https://docs.hex-rays.com/8.5/user-guide/debugger/remote-debugging/bochs-debugger/bochs-debugger-faq)


---

# 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/bochs-debugger/bochs-idb-operation-mode.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.
