reggroups: Convert reggroups from post_init to pre_init
authorStafford Horne <shorne@gmail.com>
Wed, 27 Dec 2017 14:36:30 +0000 (23:36 +0900)
committerStafford Horne <shorne@gmail.com>
Wed, 27 Dec 2017 14:36:30 +0000 (23:36 +0900)
commitc1166ca9f3543b28e8b0057ecaf2cd3251cd51c5
tree4ed6dd6aefe88c058eb57ad3d006b649a747b1e1
parentb67d92b06e6155a392a0c2d413f87d050880dbf4
reggroups: Convert reggroups from post_init to pre_init

Currently the reggroups gdbarch_data cannot be manipulated until after
the gdbarch is completely initialized.  This is usually done when the
object init depends on architecture specific fields.  In the case of
reggroups it only depends on the obstack being available.

Coverting this to pre_init allows using reggroups during gdbarch
initialization.  This is needed to allow registering arbitrary reggroups
during gdbarch initializations.

gdb/ChangeLog:

yyyy-mm-dd  Stafford Horne  <shorne@gmail.com>

* reggroups.c (reggroups_init): Change to depend only on
obstack rather than gdbarch.
(reggroup_add): Remove logic for forcing premature init.
(_initialize_reggroup): Set `reggroups_data` with
gdbarch_data_register_pre_init() rather than
gdbarch_data_register_post_init().
gdb/ChangeLog
gdb/reggroups.c