Differences
This shows you the differences between two versions of the page.
Next revision
|
Previous revision
|
software:gdb [2008/11/18 14:42] cyril created |
software:gdb [2013/09/19 16:40] (current) |
* **# ''gdb <prog-file> <core-file>''** : inspect the core dump | * **# ''gdb <prog-file> <core-file>''** : inspect the core dump |
* **# ''gdb <prog-file> <pid>''** : attach to the running process | * **# ''gdb <prog-file> <pid>''** : attach to the running process |
| * **# ''gdb --pid=<pid> --batch -ex gcore''** : dump the core of an alive process |
==== Running ==== | ==== Running ==== |
* **''run <prog-args...>''** (short "r") : start the program | * **''run <prog-args...>''** (short "r") : start the program |
* **''backtrace''** (short "bt") : show the stack | * **''backtrace''** (short "bt") : show the stack |
* **''frame <frame-number>''** (short "f") : move to the stack drame number | * **''frame <frame-number>''** (short "f") : move to the stack drame number |
* **''list [source-file]:<line|function>''** (short "l") : show source code | * **''list''**, **''list -''**, **''list [source-file]:<line|function>''** (short "l") : show source code |
| |
==== Threads ==== | ==== Threads ==== |
* **''x <addr>''** : print the content of memory, can format with /<format> too | * **''x <addr>''** : print the content of memory, can format with /<format> too |
* **''set variable <var-name> = <value>''** : change variable value | * **''set variable <var-name> = <value>''** : change variable value |
| * **''set $variable = <exp>''** : create an external variable |
| |
==== Automation ==== | ==== Automation ==== |
| |
* **''source <file-name>''** : load a set of commands from a file | * **''source <file-name>''** : load a set of commands from a file |
* You can define macros in ~/.gdbinit | * You can define macros in ~/.gdbinit, eg to automatically set some breakpoints. |
| |