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]
Other format: [Raw text]

Re: GDB --> Parallel Port --> Target??


Andrew Batchelor <A.C.Batchelor-99@student.lboro.ac.uk> writes:
> Can I check the flow of things?
> 
> 1) Create new serial_ops structure pointing to initialise functions,
> etc.
> 2) Then call this serial_add_interface to register the new structure.
> 
> 3) Add a new case to serial_open in serial.c for argument parsing to
> 'target remote'.

Yep, that's right.

> I may need to do some protocol conversion from the Remote Serial
> Protocol to something else.

What kind of agent do you have running on the system being debugged
that will be speaking the protocol with GDB?

GDB's protocol looks really hairy, but there are actually only five or
six operations you must implement --- the rest are optional.  Those
are:

- read registers
- write registers
- read memory
- write memory
- continue, and tell me why you stopped
- single-step (if GDB doesn't do software single-stepping for your
  architecture, but I'm not completely clear on this)

You can add more and get better behavior, more features, etc.  But the
above are all you need for almost everything --- breakpoints,
backtraces, expression evaluation, and so on.

It's been implemented many times over, and some implementations are
quite small and simple.  See the files called *-stub.c in the GDB
source tree.  Some of them are out-of-date, and none of them are
really tested or supported, but they'll give you the right idea.


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