# GDB

### View breakpoints

```
# shorthand
i b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x00403710 <nv::Handler::cmdGet(nv::message const&)>
# long hand
info break
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x00403710 <nv::Handler::cmdGet(nv::message const&)>
```

### Remove breakpoint

```
# shorthand
d 1
gef➤  info break
No breakpoints or watchpoints.
# long hand
delete 1
```

### Set breakpoint on memory address

```
info functions
--snip--
0x00403710  nv::Handler::cmdGet(nv::message const&)
--snip--
break *0x00403710
Breakpoint 1 at 0x403710
```

### GDB Server

* setting up a gdb server can be very useful for embedded systems.
* it is nice to have plugins for gdb like GEF that you cannot bring with you on the embedded system. This is a good use case for gdb-server and then connecting with your gdb client which can have the plugins you want to assist VR
* start the server attaching to a process that is running

```
./gdbserver-7.12-mips-be 0.0.0.0:65000 --attach 204
Attached; pid = 204
Listening on port 65000
```

* connect with your client

<pre><code>gdb
target remote 192.168.15.7:65000
Remote debugging using 192.168.15.7:65000
<strong>--snip--
</strong>[*] Failed to find objfile or not a valid file format: [Errno 2] No such file or directory: '/proc/204/root/nova/bin/login'
Invalid hex digit 59
</code></pre>

* you can now run all your normal gdb commands!


---

# 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://book.ice-wzl.xyz/exploit-development/gdb.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.
