From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: relax restrictions on per-architecture data registration Date: Wed, 06 Jun 2001 09:35:00 -0000 Message-id: <3B1E5AAF.6070005@cygnus.com> References: <20010601233233.C19845E9CB@zwingli.cygnus.com> <3B1E1B37.10209@cygnus.com> X-SW-Source: 2001-06/msg00073.html > Okay. My first patch was exactly that, but then I felt like I was > assuming that all per-architecture data would be registered by the > time initialization was done, which wasn't a documented requirement in > gdbarch.h. So I made it more dynamic. Ah. My e-mail actually contained a white lie. At present it really does: o compile in a static dummy architecture and wire things to use that o call _initialize_*() o create the real architecture the first step, a hack, is to get around a chicken/egg problem with the current GDB code. gdbtypes.[hc] assumes that there is an architecture _before_ anything has been initialized (ulgh). As usual, the long term objective is to eliminate the hack :-) Tweeking the ``create the real architecture'' code to create the data vector in both the multi-arch and non-multi-arch cases will actually take this a step closer - chunks of GDB can be rewritten to just use the register_gdbarch_data() mechanism. I'll add a comment to top.c / gdbint.texinfo to explain this. Andrew