(gdb) added section on list

This commit is contained in:
quak
2026-02-04 15:54:31 +01:00
parent b9f0aa0886
commit 29b7bc8ce4

24
gdb.md
View File

@@ -48,7 +48,7 @@ window.
One can choose various layouts with the following command:
```
```gdb
# choose layout, enable views
layout <layout-name>
# default layout options:
@@ -61,7 +61,7 @@ layout <layout-name>
The `tui` command also allows to define custom layouts.
See the example below.
```
```gdb
# defines a layout with the name `test` and the view `regs`, `src` and `cmd`
tui new-layout test {-horizontal regs 1 src 2} 1 cmd 1
@@ -69,3 +69,23 @@ tui new-layout test {-horizontal regs 1 src 2} 1 cmd 1
tui new-layout <name> <view> <weight> [<view> <weight>]
tui new-layout <name> {[-horizontal] <view> <weight> [<view> <weight>]} <weight>
```
### source code view
The source code view - as the name suggests - displays source code.
By default the window displays the file containing the current instruction,
but one can choose a differnt file with the `list` command.
Below are several examples of how to use this command.
```gdb
# when specifying a file, a line number is required
list <file-name>:<line-number>
# list knows symbol names
list <symbol>
list main # this will show the main function
# show current execution point
list .
```