This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [SH] regs command
On Wed, 16 May 2012, Maciej W. Rozycki wrote:
> > > This means you registered "regs" before the thing it aliases was
> > > registered. This can happen because _initialize_xxx order is not
> > > defined.
> > >
> > > There's no easy fix :(. You could move "regs" initialization to a
> > > better spot but then it will be visible in all builds of gdb, not just
> > > those with this target compiled in.
> >
> > It seems better in that case to just go with what Thomas had initially,
> > maybe just adding a comment why we don't use an alias? It's only for
> > a few weeks...
>
> I think a fix is actually very easy. All that has to be done is to tweak
> the init.c scriptery such that *_tdep initialisers are run last. And
> actually I think it is worth the while regardless of this particular issue
> as this way all the target-dependent bits can rely on generic stuff to
> have been initialised.
>
> Of course tweaking the scriptery can be horribly boring, but there you
> go. I'll see if I can give it a shot -- unless anyone beats me to it.
So here it is, this change moves *_tdep initialisers to the end while
otherwise keeping the order the same (IOW within the two groups the order
remains the same as before). I've checked it against autoconf's tool
portability list and also verified it with Solaris sed to make sure
there are no surprises.
Thomas, can you give it a shot and see if this fixes your alias issue?
I'll add some commentary if this works for you and gets a go-ahead.
2012-05-17 Maciej W. Rozycki <macro@codesourcery.com>
gdb/
* Makefile.in (init.c): Reorder *_tdep initialisers to the end.
Maciej
gdb-init-tdep.diff
Index: gdb-fsf-trunk-quilt/gdb/Makefile.in
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/Makefile.in 2012-05-17 01:08:19.000000000 +0100
+++ gdb-fsf-trunk-quilt/gdb/Makefile.in 2012-05-17 01:43:27.325562969 +0100
@@ -1121,6 +1121,12 @@ init.c: $(INIT_FILES)
while read f; do \
sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 2>/dev/null; \
done | \
+ sed -n \
+ -e '/_tdep$$/H' \
+ -e '//!p' \
+ -e '$$x' \
+ -e '$$s/\n//' \
+ -e '$$p' | \
while read f; do \
case " $$fs " in \
*" $$f "* ) ;; \