aboutsummaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-07-07 15:00:30 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-07-21 21:57:08 +0100
commitf7306dac19c502232f766c3881313857915f330d (patch)
treebbad3df7c454ff4eecb1064dfdb00d8e7fb3a778 /readline
parent05c309a8aeb8060fdcb9a05bbcdca2f5f1be61d7 (diff)
downloadfsf-binutils-gdb-f7306dac19c502232f766c3881313857915f330d.zip
fsf-binutils-gdb-f7306dac19c502232f766c3881313857915f330d.tar.gz
fsf-binutils-gdb-f7306dac19c502232f766c3881313857915f330d.tar.bz2
gdb/python: Reuse gdb.RegisterDescriptor objects where possible
Instead of having the gdb.RegisterDescriptorIterator creating new gdb.RegisterDescriptor objects for each regnum, instead cache gdb.RegisterDescriptor objects on the gdbarch object and reuse these. This means that for every gdbarch/regnum pair there is a single unique gdb.RegisterDescriptor, this feels like a neater implementation than the existing one. It is possible for a user to see (in Python code) that the descriptors are now identical, but as the descriptors are read-only this should make no real difference. There should be no other user visible changes. gdb/ChangeLog: * python/py-registers.c (gdbpy_register_object_data): New static global. (gdbpy_register_object_data_init): New function. (gdbpy_new_register_descriptor): Renamed to... (gdbpy_get_register_descriptor): ...this, and update to reuse existing register descriptors where possible. (gdbpy_register_descriptor_iter_next): Update. (gdbpy_initialize_registers): Register new gdbarch data. gdb/testsuite/ChangeLog: * gdb.python/py-arch-reg-names.exp: Additional tests.
Diffstat (limited to 'readline')
0 files changed, 0 insertions, 0 deletions