diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2012-04-27 20:47:57 +0000 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2012-04-27 20:47:57 +0000 |
commit | 55aa24fb2eb147288fec359a99e960f7136336e8 (patch) | |
tree | d9650d8e5cd7bdbe4f19fb124a2190c8d321db63 /gdb/gdbarch.c | |
parent | 2755f698e14dabda211bc592a414ee21e0421a2d (diff) | |
download | gdb-55aa24fb2eb147288fec359a99e960f7136336e8.zip gdb-55aa24fb2eb147288fec359a99e960f7136336e8.tar.gz gdb-55aa24fb2eb147288fec359a99e960f7136336e8.tar.bz2 |
2012-04-27 Sergio Durigan Junior <sergiodj@redhat.com>
Tom Tromey <tromey@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (SFILES): Add `probe' and `stap-probe'.
(COMMON_OBS): Likewise.
(HFILES_NO_SRCDIR): Add `probe'.
* NEWS: Mention support for static and SystemTap probes.
* amd64-tdep.c (amd64_init_abi): Initializing proper fields used by
SystemTap probes' arguments parser.
* arm-linux-tdep.c: Including headers needed to perform the parsing
of SystemTap probes' arguments.
(arm_stap_is_single_operand): New function.
(arm_stap_parse_special_token): Likewise.
(arm_linux_init_abi): Initializing proper fields used by SystemTap
probes' arguments parser.
* ax-gdb.c (require_rvalue): Removing static declaration.
(gen_expr): Likewise.
* ax-gdb.h (gen_expr): Declaring function.
(require_rvalue): Likewise.
* breakpoint.c: Include `gdb_regex.h' and `probe.h'.
(bkpt_probe_breakpoint_ops): New variable.
(momentary_breakpoint_from_master): Set the `probe' value.
(add_location_to_breakpoint): Likewise.
(break_command_1): Using proper breakpoint_ops according to the
argument passed by the user in the command line.
(bkpt_probe_insert_location): New function.
(bkpt_probe_remove_location): Likewise.
(bkpt_probe_create_sals_from_address): Likewise.
(bkpt_probe_decode_linespec): Likewise.
(tracepoint_probe_create_sals_from_address): Likewise.
(tracepoint_probe_decode_linespec): Likewise.
(tracepoint_probe_breakpoint_ops): New variable.
(trace_command): Using proper breakpoint_ops according to the
argument passed by the user in the command line.
(initialize_breakpoint_ops): Initializing breakpoint_ops for
static probes on breakpoints and tracepoints.
* breakpoint.h (struct bp_location) <probe>: New field.
* cli-utils.c (skip_spaces_const): New function.
(extract_arg): Likewise.
* cli-utils.h (skip_spaces_const): Likewise.
(extract_arg): Likewise.
* coffread.c (coff_sym_fns): Add `sym_probe_fns' value.
* configure.ac: Append `stap-probe.o' to be generated when ELF
support is present.
* configure: Regenerate.
* dbxread.c (aout_sym_fns): Add `sym_probe_fns' value.
* elfread.c: Include `probe.h' and `arch-utils.h'.
(probe_key): New variable.
(elf_get_probes): New function.
(elf_get_probe_argument_count): Likewise.
(elf_evaluate_probe_argument): Likewise.
(elf_compile_to_ax): Likewise.
(elf_symfile_relocate_probe): Likewise.
(stap_probe_key_free): Likewise.
(elf_probe_fns): New variable.
(elf_sym_fns): Add `sym_probe_fns' value.
(elf_sym_fns_lazy_psyms): Likewise.
(elf_sym_fns_gdb_index): Likewise.
(_initialize_elfread): Initialize objfile cache for static
probes.
* gdb_vecs.h (struct probe): New forward declaration.
(probe_p): New VEC declaration.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh (stap_integer_prefix): New variable.
(stap_integer_suffix): Likewise.
(stap_register_prefix): Likewise.
(stap_register_suffix): Likewise.
(stap_register_indirection_prefix): Likewise.
(stap_register_indirection_suffix): Likewise.
(stap_gdb_register_prefix): Likewise.
(stap_gdb_register_suffix): Likewise.
(stap_is_single_operand): New function.
(stap_parse_special_token): Likewise.
(struct stap_parse_info): Forward declaration.
* i386-tdep.c: Including headers needed to perform the parsing
of SystemTap probes' arguments.
(i386_stap_is_single_operand): New function.
(i386_stap_parse_special_token): Likewise.
(i386_elf_init_abi): Initializing proper fields used by SystemTap
probes' arguments parser.
* i386-tdep.h (i386_stap_is_single_operand): New function.
(i386_stap_parse_special_token): Likewise.
* machoread.c (macho_sym_fns): Add `sym_probe_fns' value.
* mipsread.c (ecoff_sym_fns): Likewise.
* objfiles.c (objfile_relocate1): Support relocation for static
probes.
* parse.c (prefixify_expression): Remove static declaration.
(initialize_expout): Likewise.
(reallocate_expout): Likewise.
* parser-defs.h (initialize_expout): Declare function.
(reallocate_expout): Likewise.
(prefixify_expression): Likewise.
* ppc-linux-tdep.c: Including headers needed to perform the parsing
of SystemTap probes' arguments.
(ppc_stap_is_single_operand): New function.
(ppc_stap_parse_special_token): Likewise.
(ppc_linux_init_abi): Initializing proper fields used by SystemTap
probes' arguments parser.
* probe.c: New file, for generic statically defined probe support.
* probe.h: Likewise.
* s390-tdep.c: Including headers needed to perform the parsing of
SystemTap probes' arguments.
(s390_stap_is_single_operand): New function.
(s390_gdbarch_init): Initializing proper fields used by SystemTap
probes' arguments parser.
* somread.c (som_sym_fns): Add `sym_probe_fns' value.
* stap-probe.c: New file, for SystemTap probe support.
* stap-probe.h: Likewise.
* symfile.h: Include `gdb_vecs.h'.
(struct sym_probe_fns): New struct.
(struct sym_fns) <sym_probe_fns>: New field.
* symtab.c (init_sal): Initialize `probe' field.
* symtab.h (struct probe): Forward declaration.
(struct symtab_and_line) <probe>: New field.
* tracepoint.c (start_tracing): Adjust semaphore on breakpoints
locations.
(stop_tracing): Likewise.
* xcoffread.c (xcoff_sym_fns): Add `sym_probe_fns' value.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 250 |
1 files changed, 250 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index c079932..056dd5a 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -265,6 +265,16 @@ struct gdbarch gdbarch_get_siginfo_type_ftype *get_siginfo_type; gdbarch_record_special_symbol_ftype *record_special_symbol; gdbarch_get_syscall_number_ftype *get_syscall_number; + const char * stap_integer_prefix; + const char * stap_integer_suffix; + const char * stap_register_prefix; + const char * stap_register_suffix; + const char * stap_register_indirection_prefix; + const char * stap_register_indirection_suffix; + const char * stap_gdb_register_prefix; + const char * stap_gdb_register_suffix; + gdbarch_stap_is_single_operand_ftype *stap_is_single_operand; + gdbarch_stap_parse_special_token_ftype *stap_parse_special_token; int has_global_solist; int has_global_breakpoints; gdbarch_has_shared_address_space_ftype *has_shared_address_space; @@ -423,6 +433,16 @@ struct gdbarch startup_gdbarch = 0, /* get_siginfo_type */ 0, /* record_special_symbol */ 0, /* get_syscall_number */ + 0, /* stap_integer_prefix */ + 0, /* stap_integer_suffix */ + 0, /* stap_register_prefix */ + 0, /* stap_register_suffix */ + 0, /* stap_register_indirection_prefix */ + 0, /* stap_register_indirection_suffix */ + 0, /* stap_gdb_register_prefix */ + 0, /* stap_gdb_register_suffix */ + 0, /* stap_is_single_operand */ + 0, /* stap_parse_special_token */ 0, /* has_global_solist */ 0, /* has_global_breakpoints */ default_has_shared_address_space, /* has_shared_address_space */ @@ -715,6 +735,16 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of get_siginfo_type, has predicate. */ /* Skip verify of record_special_symbol, has predicate. */ /* Skip verify of get_syscall_number, has predicate. */ + /* Skip verify of stap_integer_prefix, invalid_p == 0 */ + /* Skip verify of stap_integer_suffix, invalid_p == 0 */ + /* Skip verify of stap_register_prefix, invalid_p == 0 */ + /* Skip verify of stap_register_suffix, invalid_p == 0 */ + /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */ + /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */ + /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */ + /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */ + /* Skip verify of stap_is_single_operand, has predicate. */ + /* Skip verify of stap_parse_special_token, has predicate. */ /* Skip verify of has_global_solist, invalid_p == 0 */ /* Skip verify of has_global_breakpoints, invalid_p == 0 */ /* Skip verify of has_shared_address_space, invalid_p == 0 */ @@ -1267,6 +1297,42 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: stabs_argument_has_addr = <%s>\n", host_address_to_string (gdbarch->stabs_argument_has_addr)); fprintf_unfiltered (file, + "gdbarch_dump: stap_gdb_register_prefix = %s\n", + gdbarch->stap_gdb_register_prefix); + fprintf_unfiltered (file, + "gdbarch_dump: stap_gdb_register_suffix = %s\n", + gdbarch->stap_gdb_register_suffix); + fprintf_unfiltered (file, + "gdbarch_dump: stap_integer_prefix = %s\n", + gdbarch->stap_integer_prefix); + fprintf_unfiltered (file, + "gdbarch_dump: stap_integer_suffix = %s\n", + gdbarch->stap_integer_suffix); + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n", + gdbarch_stap_is_single_operand_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: stap_is_single_operand = <%s>\n", + host_address_to_string (gdbarch->stap_is_single_operand)); + fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n", + gdbarch_stap_parse_special_token_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: stap_parse_special_token = <%s>\n", + host_address_to_string (gdbarch->stap_parse_special_token)); + fprintf_unfiltered (file, + "gdbarch_dump: stap_register_indirection_prefix = %s\n", + gdbarch->stap_register_indirection_prefix); + fprintf_unfiltered (file, + "gdbarch_dump: stap_register_indirection_suffix = %s\n", + gdbarch->stap_register_indirection_suffix); + fprintf_unfiltered (file, + "gdbarch_dump: stap_register_prefix = %s\n", + gdbarch->stap_register_prefix); + fprintf_unfiltered (file, + "gdbarch_dump: stap_register_suffix = %s\n", + gdbarch->stap_register_suffix); + fprintf_unfiltered (file, "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n", gdbarch_static_transform_name_p (gdbarch)); fprintf_unfiltered (file, @@ -3834,6 +3900,190 @@ set_gdbarch_get_syscall_number (struct gdbarch *gdbarch, gdbarch->get_syscall_number = get_syscall_number; } +const char * +gdbarch_stap_integer_prefix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_integer_prefix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_integer_prefix called\n"); + return gdbarch->stap_integer_prefix; +} + +void +set_gdbarch_stap_integer_prefix (struct gdbarch *gdbarch, + const char * stap_integer_prefix) +{ + gdbarch->stap_integer_prefix = stap_integer_prefix; +} + +const char * +gdbarch_stap_integer_suffix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_integer_suffix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_integer_suffix called\n"); + return gdbarch->stap_integer_suffix; +} + +void +set_gdbarch_stap_integer_suffix (struct gdbarch *gdbarch, + const char * stap_integer_suffix) +{ + gdbarch->stap_integer_suffix = stap_integer_suffix; +} + +const char * +gdbarch_stap_register_prefix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_register_prefix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_prefix called\n"); + return gdbarch->stap_register_prefix; +} + +void +set_gdbarch_stap_register_prefix (struct gdbarch *gdbarch, + const char * stap_register_prefix) +{ + gdbarch->stap_register_prefix = stap_register_prefix; +} + +const char * +gdbarch_stap_register_suffix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_register_suffix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_suffix called\n"); + return gdbarch->stap_register_suffix; +} + +void +set_gdbarch_stap_register_suffix (struct gdbarch *gdbarch, + const char * stap_register_suffix) +{ + gdbarch->stap_register_suffix = stap_register_suffix; +} + +const char * +gdbarch_stap_register_indirection_prefix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_register_indirection_prefix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_indirection_prefix called\n"); + return gdbarch->stap_register_indirection_prefix; +} + +void +set_gdbarch_stap_register_indirection_prefix (struct gdbarch *gdbarch, + const char * stap_register_indirection_prefix) +{ + gdbarch->stap_register_indirection_prefix = stap_register_indirection_prefix; +} + +const char * +gdbarch_stap_register_indirection_suffix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_register_indirection_suffix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_indirection_suffix called\n"); + return gdbarch->stap_register_indirection_suffix; +} + +void +set_gdbarch_stap_register_indirection_suffix (struct gdbarch *gdbarch, + const char * stap_register_indirection_suffix) +{ + gdbarch->stap_register_indirection_suffix = stap_register_indirection_suffix; +} + +const char * +gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_gdb_register_prefix called\n"); + return gdbarch->stap_gdb_register_prefix; +} + +void +set_gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch, + const char * stap_gdb_register_prefix) +{ + gdbarch->stap_gdb_register_prefix = stap_gdb_register_prefix; +} + +const char * +gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_gdb_register_suffix called\n"); + return gdbarch->stap_gdb_register_suffix; +} + +void +set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch, + const char * stap_gdb_register_suffix) +{ + gdbarch->stap_gdb_register_suffix = stap_gdb_register_suffix; +} + +int +gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->stap_is_single_operand != NULL; +} + +int +gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->stap_is_single_operand != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_is_single_operand called\n"); + return gdbarch->stap_is_single_operand (gdbarch, s); +} + +void +set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, + gdbarch_stap_is_single_operand_ftype stap_is_single_operand) +{ + gdbarch->stap_is_single_operand = stap_is_single_operand; +} + +int +gdbarch_stap_parse_special_token_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->stap_parse_special_token != NULL; +} + +int +gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, struct stap_parse_info *p) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->stap_parse_special_token != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_parse_special_token called\n"); + return gdbarch->stap_parse_special_token (gdbarch, p); +} + +void +set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, + gdbarch_stap_parse_special_token_ftype stap_parse_special_token) +{ + gdbarch->stap_parse_special_token = stap_parse_special_token; +} + int gdbarch_has_global_solist (struct gdbarch *gdbarch) { |