diff --git a/README.md b/README.md index fe77f14..6ebe9f6 100644 --- a/README.md +++ b/README.md @@ -1843,6 +1843,9 @@ sudo gdb -p # Pass arguments to inferior gdb --args +# Start GDB with editor set +EDITOR=/usr/bin/nano gdb + # Start GDB without any program or process gdb # Then, load a program or attach to a running process manually: @@ -2059,6 +2062,7 @@ list -qualified list : # To show a line in a file list : + # To show current source location (gdb) list . # To show lines after current source location @@ -2069,15 +2073,30 @@ list : (gdb) list , # To show more surrounding lines (gdb) list -20,+50 + # To reset source location (gdb) frame ``` to show source locations. ```bash +list -source -line 0 +(gdb) forward-search +# or search +(gdb) reverse-search + +(gdb) edit +(gdb) edit + +# To show file name in vim +:echo expand('%:p') +``` +to search or edit a source location. + +```bash +print print whatis -print ``` to print an expression or a variable value or type.