diff options
author | Tom Tromey <tromey@redhat.com> | 2013-12-03 10:21:20 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-03-03 12:47:25 -0700 |
commit | 5d9cf8a4d31f8c793ad7ba47fe79dac11894052c (patch) | |
tree | 187d4c14b2b1e0210be4822c68815aa7efbb8267 /gdb/elfread.c | |
parent | 729662a5221eaee2b3cd71d79afb3f612c4df904 (diff) | |
download | gdb-5d9cf8a4d31f8c793ad7ba47fe79dac11894052c.zip gdb-5d9cf8a4d31f8c793ad7ba47fe79dac11894052c.tar.gz gdb-5d9cf8a4d31f8c793ad7ba47fe79dac11894052c.tar.bz2 |
move probes to be per-bfd
This patch moves the probe data from the objfile to the per-BFD
object. This lets the probes be shared between different inferiors
(and different objfiles when dlmopen is in use, should gdb ever handle
that).
2014-03-03 Tom Tromey <tromey@redhat.com>
* elfread.c (probe_key): Change to bfd_data.
(elf_get_probes, probe_key_free, _initialize_elfread): Probes are
now per-BFD, not per-objfile.
* stap-probe.c (stap_probe_destroy): Update comment.
(handle_stap_probe): Allocate on the per-BFD obstack.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 79936d0..085ff47 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -63,9 +63,9 @@ struct elfinfo asection *mdebugsect; /* Section pointer for .mdebug section */ }; -/* Per-objfile data for probe info. */ +/* Per-BFD data for probe info. */ -static const struct objfile_data *probe_key = NULL; +static const struct bfd_data *probe_key = NULL; static void free_elfinfo (void *); @@ -1496,12 +1496,12 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst) static VEC (probe_p) * elf_get_probes (struct objfile *objfile) { - VEC (probe_p) *probes_per_objfile; + VEC (probe_p) *probes_per_bfd; /* Have we parsed this objfile's probes already? */ - probes_per_objfile = objfile_data (objfile, probe_key); + probes_per_bfd = bfd_data (objfile->obfd, probe_key); - if (!probes_per_objfile) + if (!probes_per_bfd) { int ix; const struct probe_ops *probe_ops; @@ -1510,25 +1510,25 @@ elf_get_probes (struct objfile *objfile) objfile. */ for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, probe_ops); ix++) - probe_ops->get_probes (&probes_per_objfile, objfile); + probe_ops->get_probes (&probes_per_bfd, objfile); - if (probes_per_objfile == NULL) + if (probes_per_bfd == NULL) { - VEC_reserve (probe_p, probes_per_objfile, 1); - gdb_assert (probes_per_objfile != NULL); + VEC_reserve (probe_p, probes_per_bfd, 1); + gdb_assert (probes_per_bfd != NULL); } - set_objfile_data (objfile, probe_key, probes_per_objfile); + set_bfd_data (objfile->obfd, probe_key, probes_per_bfd); } - return probes_per_objfile; + return probes_per_bfd; } /* Helper function used to free the space allocated for storing SystemTap probe information. */ static void -probe_key_free (struct objfile *objfile, void *d) +probe_key_free (bfd *abfd, void *d) { int ix; VEC (probe_p) *probes = d; @@ -1614,7 +1614,7 @@ static const struct gnu_ifunc_fns elf_gnu_ifunc_fns = void _initialize_elfread (void) { - probe_key = register_objfile_data_with_cleanup (NULL, probe_key_free); + probe_key = register_bfd_data_with_cleanup (NULL, probe_key_free); add_symtab_fns (bfd_target_elf_flavour, &elf_sym_fns); elf_objfile_gnu_ifunc_cache_data = register_objfile_data (); |