This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: GDB and Dragonball EZ.
- To: davidwilliams at ozemail dot com dot au
- Subject: Re: GDB and Dragonball EZ.
- From: Stan Shebs <shebs at cygnus dot com>
- Date: Mon, 22 Nov 1999 13:59:43 -0800
- CC: gdb at sourceware dot cygnus dot com
From: David Williams <davidwilliams@ozemail.com.au>
Date: Mon, 22 Nov 1999 22:30:45 +1100
I need some help to get started in modifying the appropriate parts of GDB
so that I can remotely debug my system.
I am using the Motorola MC68EZ328 (Dragonball EZ). It has a hardware
breakpoint capability built in (not BDM as Dragonball is a 68000 core not
CPU32). The hardware breakpoint capability would seem to be peculiar to
this processor so I believe I will have to modify some parts(drivers etc)
of GDB to use it. The processors breakpoint facility allows you to define a
single address (and mask for ranges) to set a break-point on for either
instruction or data accesses - read or write. This is great as can then set
break-points in code without having to have code in RAM! A small problem is
it only allows one hardware breakpoint to be set at a time.
Interesting! There is some hardware breakpoint support in GDB
already, though it's mostly used for native systems. Look for the
macro TARGET_HAS_HARDWARE_WATCHPOINTS to find some relevant sources.
Another "small" problem is that I don't have a spare RS-232 port to
communicate to GDB with. I have only one on my system. I have two options,
as I see it. Firstly I could share the serial port between GDB and my
application. One problem with this approach is will make debugging the IrDA
part of my application more difficult. Secondly I could try and implement a
software UART using the handshaking lines. Currently I think this second
option may be better as long as a simple half duplex software UART can be
implemented and provide adequate communications.
The second option sounds harder to me, but mostly because it sounds like
some ugly driver hacking. The latest GDB sources include a mechanism
to allow an application and GDB to share a single line when using the
remote protocol. Look for the function minitelnet() in remote.c.
Anyway what I would like to know is which parts of GDB to look at and what
existing drivers/stubs etc I should use as templates for modification? Are
DLDT drivers appropriate? Is GDB stub ("remote target") appropriate?
I would say so. An example m68k stub is in gdb/m68k-stub.c. It's not
the prettiest code in the world, but note that there's not even a GPL
on it; the expectation is that you take and modify for your own purposes.
Please point me in the right direction I am currently lost in a sea of
documentation and source code with no maps!
Note: I am currenty using ECGS 1.1.2 and have downloaded GDB 4.18
distribution.
GDB has evolved quite a bit since 4.18, and includes hardware
breakpoint ("Z packet") and the minitelnet features that you probably
want to use. You can get a copy of the latest sources from
sourceware.cygnus.com/gdb. Also check out the user's manuals and the
internals manuals (in gdb/doc), we've been adding to them recently.
Stan