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:
>
> > Should ``default_memory_insert_breakpoint'' be made the default so that
> > other targets continue to work?
> > I may have missed it?
>
> I think you missed it. (But I'm new to the gdbarch stuff, so perhaps
> I forgot to do something.)
>
> For the targets which don't use gdbarch, the defines for
> MEMORY_INSERT_BREAKPOINT and MEMORY_REMOVE_BREAKPOINT in mem-break.c
> should take care of setting up the defaults. (I tested it on Linux.)
>
> For the targets which do use gdbarch, you'll notice that I put
> default_memory_{insert,remove}_breakpoint in the seventh field in the
> newly added lines to gdbarch.sh. This causes the appropriate values
> to be placed in the initialization of default_gdbarch.
>
> 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.
Andrew