Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 How it works  





2 Alternatives  





3 See also  





4 Notes  





5 References  





6 External links  














gdbserver






Français

Српски / srpski
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


gdbserver is a computer program that makes it possible to remotely debug other programs.[1] Running on the same system as the program to be debugged, it allows the GNU Debugger to connect from another system; that is, only the executable to be debugged needs to be resident on the target system ("target"), while the source code and a copy of the binary file to be debugged reside on the developer's local computer ("host"). The connection can be either TCP or a serial line.

How it works

[edit]
  1. gdbserver 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.
  2. gdb 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 called hello_world on a remote target using TCP ("2159" is the registered TCP port number for remote GDB):

remote@~$ gdbserver :2159 hello_world
Process hello_world created; pid = 2509
Listening on port 2159
local@~$ gdb -q hello_world
Reading symbols from /home/user/hello_world...done.
(gdb) target remote 192.168.0.11:2159
Remote debugging using 192.168.0.11:2159
0x002f3850 in ?? () from /lib/ld-linux.so.2
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x08048414 in main () at hello_world.c:10
10         printf("x[%d] = %g\n", i, x[i]);
(gdb)

Alternatives

[edit]

Another technique for debugging programs remotely is to use a remote stub.[2][clarification needed] In this case, the program to be debugged is linked with a few special-purpose subroutines that implement the GDB remote serial protocol. The file containing these subroutines is called a "debugging stub".

See also

[edit]

Notes

[edit]

References

[edit]
[edit]


  • t
  • e

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Gdbserver&oldid=1062647957"

    Categories: 
    Debuggers
    Debugging
    GNU Project software
    Unix programming tools
    Computer programming stubs
    Hidden categories: 
    Wikipedia articles needing clarification from February 2010
    All stub articles
     



    This page was last edited on 29 December 2021, at 18:27 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki