[GSoC weekly report#8]implement basic gdbserver

According to Youpi's adivice, I planing build gdbserver from scratch. As say, implement the basic gdbserver first, then add more feature one by one. But I also borrow code from the gdb part.

Reference for the implementation of the lynxOS port of gdbserver(because this port is much simpler than linux's), I have summarized the basic framework of how to implement a gdbserver.

1. Implement gnu_create_inferior(); which fork and exec the inferior and initialize the process list. The Hurd port of gdb have two specific core structures, such as structure inf which describe the state of the inferior and structure proc which describe the thread info of the inferior. And now I have put this two structures into gdbserver's process list and thread list reference by the pointer private_data and target_data respective.

2. Implement gnu_wait_1(). which does the actual work of set the wait_status. This is the most import function in gdbserver. Gdbserver only care of this three wait_kinds,TARGET_WAITKIND_EXITED,TARGET_WAITKIND_SIGNALED,TARGET_WAITKIND_STOPPED and should take care of the SIGNAL_TRAP when meet TARGET_WAITKING_STOPPED.

3. Implement the gnu_remuse() which recover  the inferior's execution.

Now I have meet a tiny problem, when I use gdb to attach gdbserver, it replied "Remote connection closed".  I will debug it and fix this. Before this weekend,  my gdbserver should work I think.

 

One thought on “[GSoC weekly report#8]implement basic gdbserver

  1. [16:12] < tschwinge> hacklu: The x86 GNU Hurd support will basically consist of three pieces -- exactly as with GDB's native x86 GNU Hurd port: x86 processor specific (the existing gdbserver/i386-low.c etc. -- shouldn't need any modifications (hopefully)), GNU Hurd specific (gdbserver/gnu-hurd-low.c (or similar)), and x86 GNU Hurd specific (gdbserver/gnu-hurd-x86-low.c (or similar)).

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>