# 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!
