Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU Debugger
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Internals === GDB uses a system call named [[ptrace]] (the name is an abbreviation of "process trace") to observe and control the execution of another process, and examine and change the process' memory and registers. {{aligned table|class=wikitable|cols=2|col1header=y|col1align=left|row1header=y | Common gdb commands | Corresponding ptrace calls | <syntaxhighlight lang="console" inline>(gdb) start</syntaxhighlight> | {{mono|PTRACE_TRACEME}} β makes parent a tracer (called by a tracee) | <syntaxhighlight lang="console" inline>(gdb) attach PID</syntaxhighlight> | {{mono|PTRACE_ATTACH}} β attach to a running process | <syntaxhighlight lang="console" inline>(gdb) stop</syntaxhighlight> | {{code|kill(child_pid, SIGSTOP)}} (or {{mono|PTRACE_INTERRUPT}}) | <syntaxhighlight lang="console" inline>(gdb) continue</syntaxhighlight> | {{mono|PTRACE_CONT}} | <syntaxhighlight lang="console" inline>(gdb) info registers</syntaxhighlight> | {{mono|PTRACE_GET(FP)REGS(ET)}} and {{mono|PTRACE_SET(FP)REGS(ET)}} | <syntaxhighlight lang="console" inline>(gdb) x</syntaxhighlight> | {{mono|PTRACE_PEEKTEXT}} and {{mono|PTRACE_POKETEXT}} }} A breakpoint is implemented by replacing an instruction at a given memory address with another special instruction. Executing breakpoint instruction causes SIGTRAP.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)