Title: Theory / Unimportant / CS / Development / Debugger / GDB
Tags: hasNotNewEffectReturnsMeaning computer_to_instruction fromCommandLine récupéré seen_description FromInstruction FromVariables some_instruction
On every note of this deck, unless a note says otherwise:
Chapter: 2

Instruction: run
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: start running, until end of program or breakpoint or error
Context: gdb
Chapter: 1

Instruction: next
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: advance execution to the next line of the current function
Context: gdb
Chapter: 1
Abbreviation: n

Instruction: step
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: goes to the next line to be executed in any subroutine
Context: gdb
Chapter: 1
Abbreviation: s

Name: A stack frame display
Definition: The display that shows the subroutine where the program is now suspended (and its arguments)
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Chapter: 1
Context: gdb

Instruction: backtrace
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: displays a stack frame for each active subroutine.
Context: gdb
Chapter: 1
Abbreviation: bt

Instruction: print foo
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: print the value of foo
Context: gdb
Chapter: 1
Variables: foo an expression valid in the current stack frame
Abbreviation: p foo

Instruction: list
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: Display ten lines of source surrounding the current line
Context: gdb
Chapter: 1
Abbreviation: l

Instruction: gdb foo bar
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Invoking-GDB.html#Invoking-GDB
Effect: Start the debugger with program foo and the core bar
Chapter: 2
Section: 1
Assuming: bar is a file

Instruction: gdb foo bar
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Invoking-GDB.html#Invoking-GDB
Effect: Start the debugger with program foo and the process bar
Chapter: 2
Section: 1
Assuming: bar is a number which is not a file name

Instruction: gdb --args foo bar
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Invoking-GDB.html#Invoking-GDB
Effect: Start the debugger with program foo, the arguments of this program are bar
Chapter: 2
Section: 1

Fla: --silent
Effect: Run gdb without printing the front material
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Invoking-GDB.html#Invoking-GDB
Prefix: gdb
Flag abbreviation: -q
Section: 1

Fla: -help
Effect: show the command line options
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Invoking-GDB.html#Invoking-GDB
Prefix: gdb
Flag abbreviation: -h
Section: 1

Instruction: gdb foo
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: Starts the debugger process on foo
Chapter: 1
Assuming: foo is c or c++ compiled code. Potentieially some other language with some restriction

Instruction: set width n
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: The output is at most n character long
Context: gdb
Chapter: 1

Instruction: break foo
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Sample-Session.html#Sample-Session
Effect: Add a break at the start of foo
Context: gdb
Chapter: 1
Variables: foo a subroutine

Fla: -symbols file
Effect: Read symbol table from file file.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -s file
Section: 1.1

Fla: -exec file
Effect: Use file file as the executable file to execute when appropriate, and for examining pure data in conjunction with a core dump.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -e file
Section: 1.1

Fla: -se file
Effect: Read symbol table from file file and use it as the executable file.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Section: 1.1

Fla: -core file
Effect: Use file file as a core dump to examine.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -c file
Section: 1.1

Fla: -pid number
Effect: Connect to process ID number, as with the attach command.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -p number
Section: 1.1

Fla: -command foo
Effect: Execute commands from file foo The contents of this file is evaluated exactly as the source command would. See Command files.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Prefix: gdb
Flag abbreviation: -x foo
Section: 1.1

Fla: -eval-command command
Effect: Execute a single GDB command. This option may be used multiple times to call multiple commands. It may also be interleaved with ‘-command’ as required.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -ex command
Section: 1.1
Example: gdb -ex 'target sim' -ex 'load' -x setbreakpoints -ex 'run' a.out

Fla: -init-command file
Effect: Execute commands from file file before loading the inferior (but after loading gdbinit files). See Startup.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -ix file
Section: 1.1

Fla: -init-eval-command command
Effect: Execute a single GDB command before loading the inferior (but after loading gdbinit files). See Startup.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -iex command
Section: 1.1

Fla: -directory foo
Effect: Add directory to the path to search for source and script files.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -d foo
Section: 1.1

Fla: -readnow
Effect: Read each symbol file’s entire symbol table immediately, rather than the default, which is to read it incrementally as it is needed. This makes startup slower, but makes future operations faster.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Flag abbreviation: -r
Section: 1.1

Fla: --readnever
Effect: Do not read each symbol file’s symbolic debug information. This makes startup faster but at the expense of not being able to perform symbolic debugging. DWARF unwind information is also not read, meaning backtraces may become incomplete or inaccurate. One use of this is when a user simply wants to do the following sequence: attach, dump core, detach. Loading the debugging information in this case is an unnecessary cause of delay.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options
Section: 1.1

Variable: system.gdbinit
Meaning: This is the system-wide init file. Its location is specified with the --with-system-gdbinit configure option (see System-wide configuration). It is loaded first when GDB starts, before command line options have been processed.
Page: https://i3wm.org/docs/userguide.html
Section: 1.3
Chapter: 2
Typ: file

Variable: ~/.gdbinit
Meaning: loaded next, after system.gdbinit, and before command options have been processed.
Page: https://i3wm.org/docs/userguide.html
Section: 1.3
Chapter: 2
Typ: file

Variable: ./.gdbinit
Meaning: It is loaded last, after command line options other than -x and -ex have been processed.
Page: https://i3wm.org/docs/userguide.html
Section: 1.3
Chapter: 2
Typ: file

Fla: -nx
Effect: Do not execute commands found in any initialization file.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -n
Section: 1.2

Fla: -nh
Effect: Do not execute commands found in ~/.gdbinit, the init file in your home directory. See Startup.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Prefix: gdb
Section: 1.2

Fla: -batch-silent
Effect: Run in batch mode exactly like ‘-batch’, but totally silently. All GDB output to stdout is prevented (stderr is unaffected). This is much quieter than ‘-silent’ and would be useless for an interactive session. This is particularly useful when using targets that give ‘Loading section’ messages, for example. Note that targets that give their output via GDB, as opposed to writing directly to stdout, will also be made silent.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -return-child-result
Effect: The return code from GDB will be the return code from the child process (the process being debugged), with the following exceptions: GDB exits abnormally. E.g., due to an incorrect argument or an internal error. In this case the exit code is the same as it would have been without ‘-return-child-result’. The user quits with an explicit value. E.g., ‘quit 1’. The child process never runs, or is not allowed to terminate, in which case the exit code will be -1. This option is useful in conjunction with ‘-batch’ or ‘-batch-silent’, when GDB is being used as a remote program loader or simulator interface.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -nowindows
Effect: GDB to only use the command-line interface.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -nw
Section: 1.2
Extra: GDB comes with a graphical user interface (GUI) built in

Fla: -windows
Effect: If GDB includes a GUI, then this option requires it to be used if possible.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -w
Section: 1.2

Fla: -cd directory
Effect: Run GDB using directory as its working directory, instead of the current directory.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2
Context: Gdb

Fla: -data-directory directory
Effect: Run GDB using directory as its data directory. The data directory is where GDB searches for its auxiliary files. See Data Files.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -D directory
Section: 1.2

Fla: -fullname
Effect: Tells GDB to output the full file name and line number in a standard, recognisable fashion each time a stack frame is displayed (which includes each time your program stops). This recognisable format looks like two ‘\032’ characters, followed by the file name, line number and character position separated by colons, and a newline. The Emacs-to-GDB interface program uses the two ‘\032’ characters as a signal to display the source code for the frame.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -f
Section: 1.2
Extra: GNU Emacs sets this option when it runs GDB as a subprocess

Fla: -annotate level
Effect: This option sets the annotation level inside GDB. Its effect is identical to using ‘set annotate level’ (see Annotations). The annotation level controls how much information GDB prints together with its prompt, values of expressions, source lines, and other types of output. Level 0 is the normal, level 1 is for use when GDB is run as a subprocess of GNU Emacs, level 3 is the maximum annotation suitable for programs that control GDB, and level 2 has been deprecated. The annotation mechanism has largely been superseded by GDB/MI (see GDB/MI).
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: --args
Effect: Change interpretation of command line so that arguments following the executable file are passed as command line arguments to the inferior. This option stops option processing.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Prefix: gdb
Section: 1.2

Fla: -baud bps
Effect: Set the line speed (baud rate or bits per second) of any serial interface used by GDB for remote debugging.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -b bps
Section: 1.2

Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Effect: Set the timeout (in seconds) of any communication used by GDB for remote debugging.
Chapter: 2
Section: 1.2
Abbreviation: -l timeout

Fla: -tty device
Effect: Run using device for your program’s standard input and output.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -t device
Section: 1.2

Fla: -tui
Effect: Activate the Text User Interface when starting.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Prefix: gdb
Section: 1.2
Extra: Do not use this option if you run GDB from Emacs (see Using GDB under GNU Emacs).

Fla: -interpreter interp
Effect: Use the interpreter interp for interface with the controlling program or device. This option is meant to be set by programs which communicate with GDB using it as a back end. See Command Interpreters. ‘--interpreter=mi’ (or ‘--interpreter=mi2’) causes GDB to use the GDB/MI interface (see The GDB/MI Interface) included since GDB version 6.0. The previous GDB/MI interface, included in GDB version 5.3 and selected with ‘--interpreter=mi1’, is deprecated. Earlier GDB/MI interfaces are no longer supported.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -write
Effect: Open the executable and core files for both reading and writing. This is equivalent to the ‘set write on’ command inside GDB (see Patching).
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -statistics
Effect: This option causes GDB to print statistics about time and memory usage after it completes each command and returns to the prompt.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -version
Effect: This option causes GDB to print its version number and no-warranty blurb, and exit.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -configuration
Effect: This option causes GDB to print details about its build-time configuration parameters, and then exit. These details can be important when reporting GDB bugs (see GDB Bugs).
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2

Fla: -quiet,-silent
Effect: Do not print the introductory and copyright messages. These messages are also suppressed in batch mode.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Flag abbreviation: -q
Section: 1.2

Fla: -batch
Effect: Run in batch mode.
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Section: 1.2
Extra: Exit with status 0 after processing all the command files specified with ‘-x’ (and all commands from initialization files, if not inhibited with ‘-n’). Exit with nonzero status if an error occurs in executing the GDB commands in the command files. Batch mode also disables pagination, sets unlimited terminal width and height see Screen Size, and acts as if set confirm off were in effect (see Messages/Warnings). Batch mode may be useful for running GDB as a filter, for example to download and run a program on another computer; in order to make this more useful, the message «Program exited normally.» (which is ordinarily issued whenever a program running under GDB control terminates) is not issued when running in batch mode.

Instruction: quit foo
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Quitting-GDB.html#Quitting-GDB
Effect: quit GDB, using foo as error code
Chapter: 2
Abbreviation: q C-d

Instruction: shell foo
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Shell-Commands.html#Shell-Commands
Effect: Invoke a standard shell to execute foo.
Context: GBD running
Chapter: 2
Section: 3
Abbreviation: !foo

Instruction: make foo
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Shell-Commands.html#Shell-Commands
Effect: Execute the make program with the specified arguments.
Context: GBD running
Chapter: 2
Section: 3

Instruction: set logging on
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Logging-Output.html#Logging-Output
Effect: Enable logging.
Chapter: 2
Section: 4

Instruction: set logging off
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Logging-Output.html#Logging-Output
Effect: Disable logging.
Chapter: 2
Section: 4

Instruction: set logging file file
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Logging-Output.html#Logging-Output
Effect: Change the name of the current logfile. The default logfile is gdb.txt.
Chapter: 2
Section: 4

Instruction: set logging overwrite [on|off]
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Logging-Output.html#Logging-Output
Effect: By default, GDB will append to the logfile. Set overwrite if you want set logging on to overwrite the logfile instead.
Chapter: 2
Section: 4

Instruction: set logging redirect [on|off]
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Logging-Output.html#Logging-Output
Effect: By default, GDB output will go to both the terminal and the logfile. Set redirect if you want output to go only to the log file.
Chapter: 2
Section: 4

Instruction: show logging
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Logging-Output.html#Logging-Output
Effect: Show the current values of the logging settings.
Chapter: 2
Section: 4

Question: the protocal git can use
Answer: Local
Page: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
Chapter: 4
Section: 1
Answer2: SSH
Answer3: git
Answer4: HTTP

Name: Smart HTTP
Definition: Runs over HTTP, uses its authentification mecanism if required
Page: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
Chapter: 4
Section: 1

Name: Text User Interface
Definition: Interface to manage several text windows on the terminal, showing source, assembly, registers and GDB command outputs
Page: https://sourceware.org/gdb/current/onlinedocs/gdb/Mode-Options.html#Mode-Options
Chapter: 2
Section: 1.2
Abbreviation: TUI
Extra: see GDB Text User Interface