From 729662a5221eaee2b3cd71d79afb3f612c4df904 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 2 Dec 2013 13:58:59 -0700 Subject: change probes to be program-space-independent This changes the probes to be independent of the program space. After this, when a probe's address is needed, it is determined by applying offsets at the point of use. This introduces a bound_probe object, similar to bound minimal symbols. Objects of this type are used when it's necessary to pass a probe and its corresponding objfile. This removes the backlink from probe to objfile, which was primarily used to fetch the architecture to use. This adds a get_probe_address function which calls a probe method to compute the probe's relocated address. Similarly, it adds an objfile parameter to the semaphore methods so they can do the relocation properly as well. 2014-03-03 Tom Tromey * break-catch-throw.c (fetch_probe_arguments): Use bound probes. * breakpoint.c (create_longjmp_master_breakpoint): Use get_probe_address. (add_location_to_breakpoint, bkpt_probe_insert_location) (bkpt_probe_remove_location): Update. * breakpoint.h (struct bp_location) : Now a bound_probe. * elfread.c (elf_symfile_relocate_probe): Remove. (elf_probe_fns): Update. (insert_exception_resume_breakpoint): Change type of "probe" parameter to bound_probe. (check_exception_resume): Update. * objfiles.c (objfile_relocate1): Don't relocate probes. * probe.c (bound_probe_s): New typedef. (parse_probes): Use get_probe_address. Set sal's objfile. (find_probe_by_pc): Return a bound_probe. (collect_probes): Return a VEC(bound_probe_s). (compare_probes): Update. (gen_ui_out_table_header_info): Change type of "probes" parameter. Update. (info_probes_for_ops): Update. (get_probe_address): New function. (probe_safe_evaluate_at_pc): Update. * probe.h (struct probe_ops) : New field. : Add objfile parameter. (struct probe) : Remove field. : New field.
: Update comment. (struct bound_probe): New. (find_probe_by_pc): Return a bound_probe. (get_probe_address): Declare. * solib-svr4.c (struct probe_and_action)
: New field. (hash_probe_and_action, equal_probe_and_action): Update. (register_solib_event_probe): Add address parameter. (solib_event_probe_at): Update. (svr4_create_probe_breakpoints): Add objfile parameter. Use get_probe_address. * stap-probe.c (struct stap_probe) : Update comment. (stap_get_probe_address): New function. (stap_can_evaluate_probe_arguments, compute_probe_arg) (compile_probe_arg): Update. (stap_set_semaphore, stap_clear_semaphore): Compute semaphore's address. (handle_stap_probe): Don't relocate the probe. (stap_relocate): Remove. (stap_gen_info_probes_table_values): Update. (stap_probe_ops): Remove stap_relocate. * symfile-debug.c (debug_sym_relocate_probe): Remove. (debug_sym_probe_fns): Update. * symfile.h (struct sym_probe_fns) : Remove. * symtab.c (init_sal): Use memset. * symtab.h (struct symtab_and_line) : New field. * tracepoint.c (start_tracing, stop_tracing): Update. --- gdb/symfile-debug.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'gdb/symfile-debug.c') diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index e8491c8..170ba3a 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -391,28 +391,9 @@ debug_sym_get_probes (struct objfile *objfile) return retval; } -static void -debug_sym_relocate_probe (struct objfile *objfile, - const struct section_offsets *new_offsets, - const struct section_offsets *delta) -{ - const struct debug_sym_fns_data *debug_data = - objfile_data (objfile, symfile_debug_objfile_data_key); - - fprintf_filtered (gdb_stdlog, - "probes->sym_relocate_probe (%s, %s, %s)\n", - debug_objfile_name (objfile), - host_address_to_string (new_offsets), - host_address_to_string (delta)); - - debug_data->real_sf->sym_probe_fns->sym_relocate_probe - (objfile, new_offsets, delta); -} - static const struct sym_probe_fns debug_sym_probe_fns = { debug_sym_get_probes, - debug_sym_relocate_probe }; /* Debugging version of struct sym_fns. */ -- cgit v1.1