This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: RFA: new gdbarch methods for inserting/removing breakpoints
Kevin Buettner wrote:
>
> On Oct 14, 9:47am, Andrew Cagney wrote:
>
> > > Is there something else I needed to do?
> >
> > Ah, yes. That handles the non multi-arch case. A multi-arch target
> > (eg d10v) would likely dump core. The ``init'' field in that script
> > should do it.
> >
> > default_arch is there simply to stop GDB crashing during
> > initialization. Some code unfortunatly assumes that an architecture has
> > already been selected by the time _initialize has been called (see
> > gdbtypes.c). It is never used as a real architecture.
>
> I see. Without closely reading the code I was assuming that
> default_arch was memcpy'd over to the newly allocated structure
> created in gdbarch_alloc().
>
> I've appended my revised patches below. All that's really changed from
> the first patches I sent are that I changed the following on the
> two lines that I added to gdbarch.sh
>
> a) changed the ``default'' field to be 0
> b) put default_memory_{insert,remove}_breakpoint in the ``init'' field
> c) added a 0 ``init_p'' field
Ok. Check it in.
>
> I then reran gdbarch.sh to generate a new gdbarch.c. (gdbarch.h didn't
> change at all.)
>
> BTW, the whole process of adding new arch methods turned out being a
> lot less painful than I expected. Nice job on the gdbarch.sh
> facility.
Er, thanks!
enjoy,
Andrew