# Debugging with OpenOCD

Make sure the following line is present in the .cfg file for your target:

```
 gdb_port 3333
```

Edit the port number if necessary. Specify that port in the process options and use the Debugger, Attach command.

Tips: Use the [GDB command line](/9.1/user-guide/user-interface/command-line.md) to send commands directly to OpenOCD interpreter.


---

# 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/9.1/user-guide/debugger/remote-debugging/remote-gdb-debugger/debugging-with-openocd.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.
