This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] Implement new features needed for handling SystemTap probes
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: sergiodj at redhat dot com
- Cc: gdb-patches at sourceware dot org, tromey at redhat dot com
- Date: Sat, 10 Mar 2012 17:55:40 +0100 (CET)
- Subject: Re: [PATCH 2/3] Implement new features needed for handling SystemTap probes
- References: <m3boo5cyd8.fsf@redhat.com> <m3pqclbjla.fsf@redhat.com>
> From: Sergio Durigan Junior <sergiodj@redhat.com>
> Date: Fri, 09 Mar 2012 17:33:21 -0300
>
> This is the second patch. It implements a bunch of new things needed to
> support SystemTap probes, for both arch-dependent and independent bits.
> There are new variables and methods for gdbarch, new files
> (stap-probe.[ch]), new methods for reading and handling SystemTap probes
> on elfread.c, adaptations on breakpoint.c to make the `break' command
> understand the `-p' and `-probe' arguments, and so on. It also includes
> documentation and testcases inclusions.
>
> Is this OK?
>
> gdb/ChangeLog
> 2012-09-03 Sergio Durigan Junior <sergiodj@redhat.com>
> Tom Tromey <tromey@redhat.com>
>
> * Makefile.in (SFILES): Add `stap-probe'.
> (COMMON_OBS): Likewise.
> (HFILES_NO_SRCDIR): Likewise.
> * NEWS: Mention support for SystemTap probes.
> * amd64-linux-tdep.c (amd64_linux_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 `stap-probe.h'.
> (bkpt_stap_probe_breakpoint_ops): New variable.
> (modify_semaphore): New function.
> (insert_bp_location): Call `modify_semaphore'.
> (remove_breakpoint_1): Likewise.
> (momentary_breakpoint_from_master): Use the `semaphore' value.
> (add_location_to_breakpoint): Likewise.
> (break_command_1): Using proper breakpoint_ops according to the
> argument passed by user in the command line.
> (bkpt_stap_probe_create_sals_from_address): New function.
> (bkpt_stap_probe_decode_linespec): Likewise.
> (initialize_breakpoint_ops): Initializing breakpoint_ops from
> SystemTap probes.
> * breakpoint.h (struct bp_location) <semaphore>: New field.
> (modify_semaphore): New function.
> * 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.
> * dbxread.c (aout_sym_fns): Likewise.
> * elfread.c: Include `stap-probe.h' and `arch-utils.h'.
> (stap_probe_key): New variable.
> (struct stap_probe_per_objfile): New struct.
> (handle_probe): New function.
> (STAP_BASE_SECTION_NAME): New define.
> (get_base_address_1): New function.
> (get_base_address): Likewise.
> (elf_get_probes): Likewise.
> (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 SystemTap
> probes.
> * 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-linux-tdep.c (i386_linux_init_abi): Initializing proper
> fields used by SystemTap probes' arguments parser.
> * 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-tdep.h (i386_stap_is_single_operand): Likewise.
> (i386_stap_parse_special_token): Likewise.
As far as I can tell SystemTap is Linux-specific. So I'd think its
support should go completely in Linux-specific -tdep.c files.