Lazily allocate 'struct regsets_info'::disabled_regsets.
authorPedro Alves <palves@redhat.com>
Tue, 11 Jun 2013 18:05:57 +0000 (18:05 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 11 Jun 2013 18:05:57 +0000 (18:05 +0000)
commit030031eed5425623865069a6083de8210c3769df
tree50240ae320eca7a767bc40d27886206bc8d68a59
parent5da6eb0a109d09cf64a82417e92bdf2f80bbda0e
Lazily allocate 'struct regsets_info'::disabled_regsets.

There's no need for every arch to pre-allocate disabled_regsets.
Chances are the array won't be used.

(I have a hunch that with some more work we could dispense with
initialize_regsets_info.)

Tested on x86_64 Fedora 17 w/ -lmcheck.

gdb/gdbserver/
2013-06-11  Pedro Alves  <palves@redhat.com>

* linux-low.c (regset_disabled, disable_regset): New functions.
(regsets_fetch_inferior_registers)
(regsets_store_inferior_registers): Use them.
(initialize_regsets_info); Don't allocate the disabled_regsets
array here.
* linux-low.h (struct regsets_info) <disabled_regsets>: Extend
comment.
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-low.h