Gdbserver

gdbserver је програм који омогућује даљинско отклањање грешака у другим програмима. Покреће се на истом систему као и програм који се испитује, што омогућава повезивање ГНУ дибагера из другог система; то јест, само извршна датотека програма који се испитује мора да буде присутна на циљном систему, док се изворни код и копија бинарне датотеке датог програма налазе на локалном рачунару програмера. Веза може бити серијска или путем TCP протокола.

Начин рада

Позив gdbserver-а из командне линије Позив gdb-а из командне линије

gdbserver се покреће на циљном систему, са аргументима:

  • или именом уређаја (који користити серијски везу), или TCP протоколом са адресом сервера (host) и бројем порта (port), и
  • путањом и именом извршне датотеке која се тестира
gdbserver затим пасивно чека да gdb успостави комуникацију са њим.

gdb се покреће на систему клијента, са аргументима:

  • путањом и именом извршне датотеке (и свих изворних датотека) на клијентском систему, и
  • име уређаја (за серијску везу) или IP адреса и број порта потребан за повезивање на циљном систему.
remote$ gdbserver :2345 hello_world
Process hello_world created; pid = 2509
Listening on port 2345
local$ gdb -q hello_world
Reading symbols from /home/user/hello_world...done.
(gdb) target remote 192.168.0.11:2345
Remote debugging using 192.168.0.11:2345
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)

Види још

Спољашње везе

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.