From 29b7bc8ce430f3e1015b254cfc6faebdc2d44d87 Mon Sep 17 00:00:00 2001 From: quak Date: Wed, 4 Feb 2026 15:54:31 +0100 Subject: [PATCH] (gdb) added section on `list` --- gdb.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gdb.md b/gdb.md index 9a7c813..f0f5644 100644 --- a/gdb.md +++ b/gdb.md @@ -48,7 +48,7 @@ window. One can choose various layouts with the following command: -``` +```gdb # choose layout, enable views layout # default layout options: @@ -61,7 +61,7 @@ layout 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 [ ] tui new-layout {[-horizontal] [ ]} ``` + + +### 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 : + +# list knows symbol names +list +list main # this will show the main function + +# show current execution point +list . +```