jit: make gdb_object::symtabs an std::forward_list
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 16 Dec 2019 21:30:49 +0000 (16:30 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 16 Dec 2019 21:30:49 +0000 (16:30 -0500)
commit1b61f46da5e55bf2df243215f34ffbca4bcf6d9e
tree26ad937934477fd9ac2429546a1447f2f2509cac
parent89867184294da399078d77bae3cd4b27ce640f27
jit: make gdb_object::symtabs an std::forward_list

Replace the manual linked list with an std::forward_list, simplifying
the memory management.  This requires allocating gdb_object with new and
free'ing it with delete.

gdb/ChangeLog:

* jit.c: Include forward_list.
(struct gdb_symtab) <next>: Remove field.
(struct gdb_object) <symtabs>: Change type to
std::forward_list<gdb_symtab>.
(jit_object_open_impl): Allocate gdb_object with new.
(jit_symtab_open_impl): Adjust to std::forward_list.
(finalize_symtab): Don't delete symtab.
(jit_object_close_impl):  Adjust to std::forward_list.  Free
gdb_object with delete.
gdb/ChangeLog
gdb/jit.c