Content deleted Content added
m Date maintenance tags and general fixes: build 400: |
Sammi Brie (talk | contribs) Adding short description: "Remote debugging program" |
||
(37 intermediate revisions by 27 users not shown) | |||
Line 1:
{{Short description|Remote debugging program}}
{{lowercase|title=gdbserver}}
{{compu-prog-stub|date=February 2010}}▼
'''gdbserver''' is a computer program that
▲'''gdbserver''' is a computer program that allows to remotely [[Debugging|debug]] other programs<ref>[http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_130.html GDB Manual]</ref>. It runs in the system with the program to be debugged and allows the [[GNU Debugger]] to connect from a different system.
# <code>gdbserver</code> is launched on the target system, with the arguments:
#* Either a device name (to use a serial line) or a TCP hostname and port number, and
#* The path and filename of the executable to be debugged
#:It then waits passively for the host gdb to communicate with it.
# <code>gdb</code> is run on the host, with the arguments:
#* The path and filename of the executable (and any sources) on the host, and
#* A device name (for a serial line) or the IP address and port number needed for connection to the target system.
Example for debugging a program
<syntaxhighlight lang="console">
▲== How It Works ==
▲Example for debugging a program in a remote host called <code>hello_world</code> ("2345" is the TCP port number):
▲remote$ gdbserver :2345 hello_world
Process hello_world created; pid = 2509
Listening on port
</syntaxhighlight>
<syntaxhighlight lang="console">
local@~$ gdb -q hello_world
Reading symbols from /home/user/hello_world...done.
(gdb) target remote 192.168.0.11:
Remote debugging using 192.168.0.11:
0x002f3850 in ?? () from /lib/ld-linux.so.2
(gdb) continue
Line 30 ⟶ 32:
10 printf("x[%d] = %g\n", i, x[i]);
(gdb)
</syntaxhighlight>
== Alternatives ==
== See also ==
Line 42:
== Notes ==
{{
== References ==
* Andreas Zeller: <cite>Why Programs Fail: A Guide to Systematic Debugging</cite>, Morgan Kaufmann, 2005. {{ISBN
== External links ==
* [
* [http://davis.lbl.gov/Manuals/GDB/gdb_17.html Debugging with GDB]
{{GNU}}
[[Category:
[[Category:
[[Category:GNU Project software|Debugger]]
[[Category:Unix programming tools]]
|