From 0e74a041c0e7bdbc403b05967cdf57ecd23a8ecc Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 22 Jul 2020 15:56:07 +0200 Subject: gdb/jit: split jit_objfile_data in two The jit_objfile_data is currently used to hold information about both objfiles that are the result of JIT compilation (JITed) and objfiles that can produce JITed objfiles (JITers). I think that this double use of the type is confusing, and that things would be more obvious if we had one type for each role. This patch splits it into: - jited_objfile_data: for data about an objfile that is the result of a JIT compilation - jiter_objfile_data: for data about an objfile which produces JITed objfiles There are now two JIT-related fields in an objfile, one for each kind. With this change, the following invariants hold: - an objfile has a non-null `jiter_data` field iff it defines the required symbols of the JIT interface - an objfile has a non-null `jited_data` field iff it is the product of JIT compilation (has been produced by some JITer) gdb/ChangeLog: 2020-07-22 Simon Marchi * jit.h (struct jit_objfile_data): Split into... (struct jiter_objfile_data): ... this ... (struct jited_objfile_data): ... and this. * objfiles.h (struct objfile) : Remove. : New fields. * jit.c (jit_objfile_data::~jit_objfile_data): Rename to ... (jiter_objfile_data::~jiter_objfile_data): ... this. (get_jit_objfile_data): Rename to ... (get_jiter_objfile_data): ... this. (add_objfile_entry): Update. (jit_read_descriptor): Use get_jiter_objfile_data. (jit_find_objf_with_entry_addr): Use objfile's jited_data field. (jit_breakpoint_re_set_internal): Use get_jiter_objfile_data. (jit_inferior_exit_hook): Use objfile's jited_data field. --- gdb/objfiles.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gdb/objfiles.h') diff --git a/gdb/objfiles.h b/gdb/objfiles.h index b21b426..3fbc6da 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -699,8 +699,13 @@ public: allocated on the objfile's obstack. */ htab_up static_links; - /* JIT-related data for this objfile. */ - std::unique_ptr jit_data = nullptr; + /* JIT-related data for this objfile, if the objfile is a JITer; + that is, it produces JITed objfiles. */ + std::unique_ptr jiter_data = nullptr; + + /* JIT-related data for this objfile, if the objfile is JITed; + that is, it was produced by a JITer. */ + std::unique_ptr jited_data = nullptr; }; /* A deleter for objfile. */ -- cgit v1.1