This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Remote Debugger


>>>>> "deepak" == deepak shekhar <dipaktc@rediffmail.com> writes:
deepak> I am porting GDB for an hypothetical processor.  It is a
deepak> remote debugger that is., the processor is connected to the
deepak> host machine via serial port.  As a part of it i am writing
deepak> the following files remote-hypo.c and hypo-tdep.c &tm-hypo.h.

Unless there is some specific requirement that you have not stated,
there is no need to have a target specific mechanism for gdb/target
communications (ie. remote-hypo.c).  The target independent generic
remote serial protocol should be sufficient.

deepak> Can somebody explain me how actually the GDB executes the
deepak> program on the target processor??

Many people use GDB to download the program to the target.  For many
targets GDB uses a special download mechanism (streaming s-records,
using a bulk transfer protocol like xmodem or tftp, etc.), but most
simply do multiple writes.  The targets I'm responsble for load the
image via tftp or off flash, so GDB is not involved in downloading.

Once the program has been downloaded, GDB sets the program counter to
the first instruction, and when instructed sends a continue or step
command.  That's it.  The program is running.  GDB then waits for
notification that the program has stopped.

deepak> Which  available port is a good example to follow??

My advice is to go with a target that is most like your hypo cpu.  But
take advantage of all the other targets as examples.  Also be sure to
read the GDB internals manual.

        --jtc

-- 
J.T. Conklin
RedBack Networks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]