Commit Graph

39 Commits

Author SHA1 Message Date
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
Tom Tromey 8e481c3ba8 C++-ify parse_format_string
This replaces parse_format_string with a class, removing some
constructors along the way.  While doing this, I found that one
argument to gen_printf is unused, so I removed it.

Also, I am not completely sure, but the use of `release' in
maint_agent_printf_command and parse_cmd_to_aexpr seems like it may
leak expressions.

Regression tested by the buildbot.

ChangeLog
2017-12-08  Tom Tromey  <tom@tromey.com>

	* printcmd.c (ui_printf): Update.  Use std::vector.
	* common/format.h (struct format_piece): Add constructor.
	<string>: Now const.
	(class format_pieces): New class.
	(parse_format_string, free_format_pieces)
	(free_format_pieces_cleanup): Remove.
	* common/format.c (format_pieces::format_pieces): Rename from
	parse_format_string.  Update.
	(free_format_pieces, free_format_pieces_cleanup): Remove.
	* breakpoint.c (parse_cmd_to_aexpr): Update.  Use std::vector.
	* ax-gdb.h (gen_printf): Remove argument.
	* ax-gdb.c (gen_printf): Remove "frags" argument.
	(maint_agent_printf_command): Update.  Use std::vector.

gdbserver/ChangeLog
2017-12-08  Tom Tromey  <tom@tromey.com>

	* ax.c (ax_printf): Update.
2017-12-08 10:23:43 -07:00
Yao Qi c0b8369c8a Include ax.h in ax-gdb.h
$ make check-headers CHECK_HEADERS="ax-gdb.h"
...

../../binutils-gdb/gdb/ax-gdb.h:104:8: error: 'agent_expr_up' does not name a type
 extern agent_expr_up gen_trace_for_expr (CORE_ADDR, struct expression *,
        ^

gdb:

2017-01-06  Yao Qi  <yao.qi@linaro.org>

	* ax-gdb.h: Include "ax.h"
2017-01-06 14:26:45 +00:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Pedro Alves 833177a4a5 'struct agent_expr *' -> unique_ptr<agent_expr>
This patch makes the gen_* functions return a unique_ptr instead of
raw pointer:

  typedef gdb::unique_ptr<agent_expr> agent_expr_up;

and then adjusts the codebase throughout to stop using
make_cleanup_free_agent_expr.

The cond_bytecode and cmd_bytecode fields of struct bp_location are
owning pointers, so they're changed to be unique_ptr's instead of raw
pointers.

gdb/ChangeLog:
2016-11-08  Pedro Alves  <palves@redhat.com>

	* ax-gdb.c (is_nontrivial_conversion): Use agent_expr_up.
	(gen_trace_for_var, gen_trace_for_expr, gen_eval_for_expr)
	(gen_trace_for_return_address, gen_printf): Use and return an
	agent_expr_up.  Don't use make_cleanup_free_agent_expr.
	(agent_eval_command_one, maint_agent_printf_command): Use
	agent_expr_up.  Don't use make_cleanup_free_agent_expr.
	* ax-gdb.h (gen_trace_for_expr, gen_trace_for_var)
	(gen_trace_for_return_address, gen_eval_for_expr, gen_printf): Use
	agent_expr_up.
	* ax-general.c (new_agent_expr): Rename to ...
	(agent_expr::agent_expr): ... this, and now a constructor.
	(free_agent_expr): Rename to ...
	(agent_expr::~agent_exp): ... this, and now a destructor.
	(do_free_agent_expr_cleanup, make_cleanup_free_agent_expr):
	Delete.
	* ax.h (struct agent_expr): Add ctor/dtor.
	(agent_expr_up): New typedef.
	(new_agent_expr, free_agent_expr, make_cleanup_free_agent_expr):
	Delete declarations.
	* breakpoint.c (parse_cond_to_aexpr): Use and return an
	agent_expr_up.  Don't use make_cleanup_free_agent_expr.
	(build_target_condition_list): Adjust to use agent_expr_up.
	(parse_cmd_to_aexpr): Use and return an agent_expr_up.  Don't use
	make_cleanup_free_agent_expr.
	(build_target_command_list): Adjust to use agent_expr_up.
	(force_breakpoint_reinsertion): Adjust to use agent_expr_up.
	(bp_location_dtor): Remove unnecessary free_agent_expr and xfree
	calls.
	* breakpoint.h (struct bp_target_info) <cond_bytecode,
	cmd_bytecode>: Now agent_expr_up's.
	* remote.c (remote_download_tracepoint): Adjust to use
	agent_expr_up and remove use of make_cleanup_free_agent_expr.
	* tracepoint.c (validate_actionline, collect_symbol): Adjust to
	use agent_expr_up and remove uses of make_cleanup_free_agent_expr.
	(collection_list::~collection_list): Call delete instead of
	free_agent_expr.
	(encode_actions_1): Adjust to use agent_expr_up and remove uses of
	make_cleanup_free_agent_expr.
	(add_aexpr): Change parameter type to agent_expr_up; Return a raw
	agent_expr pointer.
2016-11-08 15:26:47 +00:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Sergio Durigan Junior 74e5a34656 I found this issue when I was debugging something else on IA-64. Both
ax-gdb.h and parser-defs.h could be made more self-contained by forward
declaring types or including the necessary header files.  This commit does
this.

2013-06-26  Sergio Durigan Junior  <sergiodj@redhat.com>

	* ax-gdb.h (union exp_element): Forward declare.
	* parser-defs.h: Include expression.h.
2013-06-26 17:22:52 +00:00
Tom Tromey 92bc6a2064 * tracepoint.h (decode_agent_options): Add 'trace_string'
argument.
	* tracepoint.c (decode_agent_options): Add 'trace_string'
	argument.
	(validate_actionline): Update.
	(collect_symbol): Add 'trace_string' argument.
	(struct add_local_symbols_data) <trace_string>: New field.
	(do_collect_symbol): Update.
	(add_local_symbols): Add 'trace_string' argument.
	(encode_actions_1): Update.
	(trace_dump_actions): Update.
	* dwarf2loc.c (access_memory): Update.
	* ax.h (struct agent_expr) <tracing, trace_string>: New fields.
	* ax-general.c (new_agent_expr): Update.
	* ax-gdb.h (gen_trace_for_expr, gen_trace_for_var)
	(gen_trace_for_return_address): Add argument.
	(trace_kludge, trace_string_kludge): Remove.
	* ax-gdb.c (trace_kludge, trace_string_kludge): Remove.
	(gen_traced_pop, gen_fetch, gen_bitfield_ref, gen_expr): Update.
	(gen_trace_for_var): Add 'trace_string' argument.
	(gen_trace_for_expr, gen_trace_for_return_address): Likewise.
	(gen_printf, agent_eval_command_one): Update.
2013-03-21 16:09:27 +00:00
Keith Seitz 741d92cf39 * ax-gdb.c (gen_printf): Make FORMAT const.
* ax-gdb.h (gen_printf): Likewise.
	* ax-general.c (ax_string): Make STR const.
	* ax.h (ax_string): Likewise.
2013-03-07 00:48:25 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:33:28 +00:00
Stan Shebs d3ce09f5bf Add target-side support for dynamic printf.
* NEWS: Mention the additional style.
	* breakpoint.h (struct bp_target_info): New fields tcommands, persist.
	(struct bp_location): New field cmd_bytecode.
	* breakpoint.c: Include format.h.
	(disconnected_dprintf): New global.
	(parse_cmd_to_aexpr): New function.
	(build_target_command_list): New function.
	(insert_bp_location): Call it.
	(remove_breakpoints_pid): Skip dprintf breakpoints.
	(print_one_breakpoint_location): Ditto.
	(dprintf_style_agent): New global.
	(dprintf_style_enums): Add dprintf_style_agent.
	(update_dprintf_command_list): Add agent case.
	(agent_printf_command): New function.
	(_initialize_breakpoint): Add new commands.
	* common/ax.def (printf): New bytecode.
	* ax.h (ax_string): Declare.
	* ax-gdb.h (gen_printf): Declare.
	* ax-gdb.c: Include cli-utils.h, format.h.
	(gen_printf): New function.
	(maint_agent_print_command): New function.
	(_initialize_ax_gdb): Add maint agent-printf command.
	* ax-general.c (ax_string): New function.
	(ax_print): Add printf disassembly.
	* Makefile.in (SFILES): Add format.c
	(COMMON_OBS): Add format.o.
	* common/format.h: New file.
	* common/format.c: New file.
	* printcmd.c: Include format.h.
	(ui_printf): Call parse_format_string.
	* remote.c (remote_state): New field breakpoint_commands.
	(PACKET_BreakpointCommands): New enum.
	(remote_breakpoint_commands_feature): New function.
	(remote_protocol_features): Add new BreakpointCommands entry.
	(remote_can_run_breakpoint_commands): New function.
	(remote_add_target_side_commands): New function.
	(remote_insert_breakpoint): Call it.
	(remote_insert_hw_breakpoint): Ditto.
	(_initialize_remote): Add new packet configuration for
	target-side breakpoint commands.
	* target.h (struct target_ops): New field
	to_can_run_breakpoint_commands.
	(target_can_run_breakpoint_commands): New macro.
	* target.c (update_current_target): Handle
	to_can_run_breakpoint_commands.

	[gdbserver]
	* Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
	(ax.o): Add it to build rule.
	(ax-ipa.o): Ditto.
	(OBS): Add format.o.
	(IPA_OBS): Add format.o.
	* server.c (handle_query): Claim support for breakpoint commands.
	(process_point_options): Add command case.
	(process_serial_event): Leave running if there are printfs in
	effect.
	* mem-break.h (any_persistent_commands): Declare.
	(add_breakpoint_commands): Declare.
	(gdb_no_commands_at_breakpoint): Declare.
	(run_breakpoint_commands): Declare.
	* mem-break.c (struct point_command_list): New struct.
	(struct breakpoint): New field command_list.
	(any_persistent_commands): New function.
	(add_commands_to_breakpoint): New function.
	(add_breakpoint_commands): New function.
	(gdb_no_commands_at_breakpoint): New function.
	(run_breakpoint_commands): New function.
	* linux-low.c (linux_wait_1): Test for and run breakpoint commands
	locally.
	* ax.c: Include format.h.
	(ax_printf): New function.
	(gdb_eval_agent_expr): Add printf opcode.

	[doc]
	* gdb.texinfo (Dynamic Printf): Mention agent style and
	disconnected dprintf.
	(Maintenance Commands): Describe maint agent-printf.
	(General Query Packets): Mention BreakpointCommands feature.
	(Packets): Document commands extension to Z0 packet.
	* agentexpr.texi (Bytecode Descriptions): Document printf
	bytecode.

	[testsuite]
	* gdb.base/dprintf.exp: Add agent style tests.
2012-07-02 15:29:39 +00:00
Sergio Durigan Junior 55aa24fb2e 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.
2012-04-27 20:47:57 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Stan Shebs 3065dfb6b4 2011-11-02 Stan Shebs <stan@codesourcery.com>
String collection for tracepoints.
	* NEWS: Mention string collection.
	* common/ax.def (tracenz): New bytecode.
	* ax-gdb.h (trace_string_kludge): Declare.
	* ax-gdb.c: Include valprint.h and c-lang.h.
	(trace_string_kludge): New global.
	(gen_traced_pop): Add string case.
	(agent_command): Add string case.
	* tracepoint.h (decode_agent_options): Declare.
	* tracepoint.c: Include cli-utils.h.
	(decode_agent_options): New function.
	(validate_actionline): Call it.
	(encode_actions_1): Ditto.
	* target.h (struct target_ops): New method to_supports_string_tracing.
	(target_supports_string_tracing): New macro.
	* target.c (update_current_target): Add to_supports_string_tracing.
	* remote.c (struct remote_state): New field string_tracing.
	(remote_string_tracing_feature): New function.
	(remote_protocol_features): New feature tracenz.
	(remote_supports_string_tracing): New function.
	(init_remote_ops): Set to_supports_string_tracing.

	* tracepoint.c (agent_mem_read_string): New function.
	(eval_agent_expr): Call it for tracenz.
	* server.c (handle_query): Report support for tracenz.

	* gdb.texinfo (Tracepoint Action Lists): Document collect/s.
	(General Query Packets): Describe tracenz feature.
	* agentexpr.texi (Bytecode Descriptions): Describe tracenz.

	* gdb.trace/collection.c: Add code using strings.
	* gdb.trace/collection.exp: Add tests of string collection.
2011-11-02 23:44:21 +00:00
Stan Shebs 6710bf39b7 Add return address collection for tracepoints.
* tracepoint.c (encode_actions_1): Add case for $_ret.
	(validate_actionline): Check for $_ret.
	(trace_dump_actions): Ditto.
	* ax-gdb.h (gen_trace_for_return_address): Declare.
	* ax-gdb.c: Include arch-utils.h.
	(gen_trace_for_return_address): New function.
	(agent_command): Add return address special case.
	* amd64-tdep.c: Include ax.h and ax-gdb.h.
	(amd64_gen_return_address): New function.
	(amd64_init_abi): Call it.
	* i386-tdep.c: Include ax.h and ax-gdb.h.
	(i386_gen_return_address): New function.
	(i386_init_abi): Call it.
	* arch-utils.h (default_gen_return_address): Declare.
	* arch-utils.c (default_gen_return_address): New function.
	* gdbarch.sh (gen_return_address): New method.
	* gdbarch.h, gdbarch.c: Regenerate.

	* gdb.texinfo (Tracepoint Action Lists): Document $_ret.

	* gdb.trace/collection.exp: Test collection of $_ret.
2011-09-27 13:09:37 +00:00
Joel Brobecker a04b0428ab Revert the following change (not approved yet):
2011-02-21  Hui Zhu  <teawater@gmail.com>
	* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h.
	* ax-gdb.c (gen_printf_expr_callback): New function.
	* ax-gdb.h (gen_printf_expr_callback): Forward declare.
	* ax-general.c (ax_memcpy): New function.
	(ax_print): Handle "printf".
	(ax_reqs): Ditto.
	* ax.h (ax_memcpy): Forward declare.
	* common/ax.def (invalid2): Removed.
	(printf): New entry.
	* printcmd.c (printcmd.h): New include.
	(string_printf): New function.
	(ui_printf): Removed.
	(printf_command): Remove static.  Call string_printf.
	(eval_command): Call string_printf.
	* printcmd.h: New file.
	* tracepoint.c (validate_actionline,
	encode_actions_1): handle printf_command.
2011-02-24 07:39:48 +00:00
Hui Zhu d0e92d82d8 2011-02-21 Hui Zhu <teawater@gmail.com>
* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h.
	* ax-gdb.c (gen_printf_expr_callback): New function.
	* ax-gdb.h (gen_printf_expr_callback): Forward declare.
	* ax-general.c (ax_memcpy): New function.
	(ax_print): Handle "printf".
	(ax_reqs): Ditto.
	* ax.h (ax_memcpy): Forward declare.
	* common/ax.def (invalid2): Removed.
	(printf): New entry.
	* printcmd.c (printcmd.h): New include.
	(string_printf): New function.
	(ui_printf): Removed.
	(printf_command): Remove static.  Call string_printf.
	(eval_command): Call string_printf.
	* printcmd.h: New file.
	* tracepoint.c (validate_actionline,
	encode_actions_1): handle printf_command.
2011-02-21 08:38:14 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Michael Snyder 0e2de36609 2010-12-31 Michael Snyder <msnyder@vmware.com>
* annotate.c: Comment cleanup, shorten long lines.
	* arch-utils.c: Ditto.
	* arch-utils.h: Ditto.
	* auxv.c: Ditto.
	* auxv.h: Ditto.
	* ax-gdb.c: Ditto.
	* ax-gdb.h: Ditto.
	* ax-general.c: Ditto.
	* breakpoint.h: Ditto.
	* buildsym.h: Ditto.
2010-12-31 19:16:37 +00:00
Tom Tromey 3cf03773b7 * vec.h (VEC_cleanup): New macro.
(DEF_VEC_ALLOC_FUNC_I): Update.
	(DEF_VEC_ALLOC_FUNC_P): Likewise.
	(DEF_VEC_ALLOC_FUNC_O): Likewise.
	* dwarf2loc.c (struct axs_var_loc): Remove.
	(unimplemented): New function.
	(translate_register): Likewise.
	(access_memory): Likewise.
	(compile_dwarf_to_ax): Likewise.
	(dwarf2_tracepoint_var_loc): Remove.
	(dwarf2_tracepoint_var_access): Likewise.
	(dwarf2_tracepoint_var_ref): Likewise.
	(locexpr_tracepoint_var_ref): Use compile_dwarf_to_ax.
	(loclist_tracepoint_var_ref): Likewise.
	* dwarf2expr.h (dwarf_expr_require_composition): Declare.
	* dwarf2expr.c (dwarf_expr_require_composition): Rename from
	require_composition.  No longer static.
	(execute_stack_op): Update.
	* ax-gdb.h (trace_kludge): Declare.
2010-06-11 15:21:11 +00:00
Stan Shebs 400c6af037 2010-03-17 Stan Shebs <stan@codesourcery.com>
* ax-gdb.h (struct axs_value): New field optimized_out.
	(gen_trace_for_var): Add gdbarch argument.
	* ax-gdb.c (gen_trace_static_fields): New function.
	(gen_traced_pop): Call it, add gdbarch argument.
	(gen_trace_for_expr): Update call to it.
	(gen_trace_for_var): Ditto, and report optimized-out variables.
	(gen_struct_ref_recursive): Check for optimized-out value.
	(gen_struct_elt_for_reference): Ditto.
	(gen_static_field): Pass gdbarch instead of expression, assume
	optimization if field not found.
	(gen_var_ref): Set the optimized_out flag.
	(gen_expr): Error on optimized-out variable.
	* tracepoint.c (collect_symbol): Handle struct-valued vars as
	expressions, skip optimized-out variables with computed locations.
	* dwarf2loc.c (dwarf2_tracepoint_var_ref): Flag instead of
	erroring out if location expression missing.
	(loclist_tracepoint_var_ref): Don't error out here.
2010-03-17 22:04:43 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Stan Shebs 0936ad1d22 2009-12-23 Stan Shebs <stan@codesourcery.com>
* ax-gdb.h (gen_trace_for_var): Declare.
	* ax-gdb.c (gen_trace_for_var): New function.
	* dwarf2loc.c (dwarf_expr_frame_base_1): New function, split from...
	(dwarf_expr_frame_base): ...here.
	(dwarf2_tracepoint_var_ref): Add computed location case.
	* tracepoint.c (collect_symbol): Add scope arg and LOC_COMPUTED
	case.
	(add_local_symbols): Update call to collect_symbol.
	(encode_actions): Ditto.
2009-12-24 00:40:49 +00:00
Stan Shebs 782b2b0784 gdb/
Conditional tracepoints.
	* ax-gdb.h (gen_eval_for_expr): Declare.
	* ax-gdb.c (gen_expr): Generate bytecodes for BINOP_EQUAL
	and other comparisons.
	(gen_eval_for_expr): New function.
	(agent_eval_command): New maintenance command.
	(_initialize_ax_gdb): Define the command.
	* remote.c (struct remote_state): New field cond_tracepoints.
	(PACKET_ConditionalTracepoints): New packet config type.
	(remote_cond_tracepoint_feature): New function.
	(remote_protocol_features): Add ConditionalTracepoints.
	(remote_supports_cond_tracepoints): New function.
	(_initialize_remote): Add ConditionalTracepoints.
	* tracepoint.c (download_tracepoint): Add conditional.
	* NEWS: Mention conditional tracepoints.

	gdb/doc/
	* gdb.texinfo (Tracepoint Conditions): New section.
	(General Query Packets): Describe ConditionalTracepoints.
	(Tracepoint Packets): Describe condition field.
	(Maintenance Commands): Describe maint agent-eval.
	* agentexpr.texi (Using Agent Expressions): Mention eval usage.

	gdb/testsuite/
	* gdb.trace/tracecmd.exp: Add basic test of tracepoint conditions.
2009-07-14 21:40:34 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Jim Blandy bfe10c0fae * ax-gdb.h (expr_to_address_and_size): Delete declaration for
deleted function.
2007-10-27 01:31:46 +00:00
Jim Blandy 624d6fb77c * ax-gdb.c (expr_to_agent): Delete unused function.
(expr_to_address_and_size): Delete #if 0'd function.
* ax-gdb.h (expr_to_agent): Delete declaration.
2007-10-26 23:42:28 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Eli Zaretskii 197e01b6dc * breakpoint.c:
* arm-tdep.c:
	* ia64-tdep.c:
	* i386-tdep.c:
	* hpread.c:
	* hppa-tdep.c:
	* hppa-hpux-tdep.c:
	* gnu-nat.c:
	* gdbtypes.c:
	* gdbarch.h:
	* gdbarch.c:
	* eval.c:
	* dwarf2read.c:
	* dbxread.c:
	* copying:
	* symfile.c:
	* stabsread.c:
	* sh64-tdep.c:
	* sh-tdep.c:
	* s390-tdep.c:
	* rs6000-tdep.c:
	* remote.c:
	* remote-mips.c:
	* mips-tdep.c:
	* mdebugread.c:
	* linux-nat.c:
	* infrun.c:
	* xcoffread.c:
	* win32-nat.c:
	* valops.c:
	* utils.c:
	* tracepoint.c:
	* target.c:
	* symtab.c:
	* c-exp.y:
	* ada-valprint.c:
	* ada-typeprint.c:
	* ada-lex.l:
	* ada-lang.h:
	* ada-lang.c:
	* ada-exp.y:
	* alphafbsd-tdep.c:
	* alphabsd-tdep.h:
	* alphabsd-tdep.c:
	* alphabsd-nat.c:
	* alpha-tdep.h:
	* alpha-tdep.c:
	* alpha-osf1-tdep.c:
	* alpha-nat.c:
	* alpha-mdebug-tdep.c:
	* alpha-linux-tdep.c:
	* alpha-linux-nat.c:
	* aix-thread.c:
	* abug-rom.c:
	* arch-utils.c:
	* annotate.h:
	* annotate.c:
	* amd64obsd-tdep.c:
	* amd64obsd-nat.c:
	* amd64nbsd-tdep.c:
	* amd64nbsd-nat.c:
	* amd64fbsd-tdep.c:
	* amd64fbsd-nat.c:
	* amd64bsd-nat.c:
	* amd64-tdep.h:
	* amd64-tdep.c:
	* amd64-sol2-tdep.c:
	* amd64-nat.h:
	* amd64-nat.c:
	* amd64-linux-tdep.c:
	* amd64-linux-nat.c:
	* alphanbsd-tdep.c:
	* block.h:
	* block.c:
	* bfd-target.h:
	* bfd-target.c:
	* bcache.h:
	* bcache.c:
	* ax.h:
	* ax-general.c:
	* ax-gdb.h:
	* ax-gdb.c:
	* avr-tdep.c:
	* auxv.h:
	* auxv.c:
	* armnbsd-tdep.c:
	* armnbsd-nat.c:
	* arm-tdep.h:
	* arm-linux-nat.c:
	* arch-utils.h:
	* charset.c:
	* call-cmds.h:
	* c-valprint.c:
	* c-typeprint.c:
	* c-lang.h:
	* c-lang.c:
	* buildsym.h:
	* buildsym.c:
	* bsd-uthread.h:
	* bsd-uthread.c:
	* bsd-kvm.h:
	* bsd-kvm.c:
	* breakpoint.h:
	* core-regset.c:
	* core-aout.c:
	* completer.h:
	* completer.c:
	* complaints.h:
	* complaints.c:
	* command.h:
	* coffread.c:
	* coff-solib.h:
	* coff-solib.c:
	* coff-pe-read.h:
	* coff-pe-read.c:
	* cli-out.h:
	* cli-out.c:
	* charset.h:
	* dink32-rom.c:
	* dictionary.h:
	* dictionary.c:
	* demangle.c:
	* defs.h:
	* dcache.h:
	* dcache.c:
	* d10v-tdep.c:
	* cpu32bug-rom.c:
	* cp-valprint.c:
	* cp-support.h:
	* cp-support.c:
	* cp-namespace.c:
	* cp-abi.h:
	* cp-abi.c:
	* corelow.c:
	* corefile.c:
	* environ.c:
	* elfread.c:
	* dwarfread.c:
	* dwarf2loc.c:
	* dwarf2expr.h:
	* dwarf2expr.c:
	* dwarf2-frame.h:
	* dwarf2-frame.c:
	* dve3900-rom.c:
	* dummy-frame.h:
	* dummy-frame.c:
	* dsrec.c:
	* doublest.h:
	* doublest.c:
	* disasm.h:
	* disasm.c:
	* fork-child.c:
	* findvar.c:
	* fbsd-nat.h:
	* fbsd-nat.c:
	* f-valprint.c:
	* f-typeprint.c:
	* f-lang.h:
	* f-lang.c:
	* expression.h:
	* expprint.c:
	* exec.h:
	* exec.c:
	* exceptions.h:
	* exceptions.c:
	* event-top.h:
	* event-top.c:
	* event-loop.h:
	* event-loop.c:
	* gdb.c:
	* gdb-stabs.h:
	* gdb-events.h:
	* gdb-events.c:
	* gcore.c:
	* frv-tdep.h:
	* frv-tdep.c:
	* frv-linux-tdep.c:
	* frame.h:
	* frame.c:
	* frame-unwind.h:
	* frame-unwind.c:
	* frame-base.h:
	* frame-base.c:
	* gdb_vfork.h:
	* gdb_thread_db.h:
	* gdb_string.h:
	* gdb_stat.h:
	* gdb_regex.h:
	* gdb_ptrace.h:
	* gdb_proc_service.h:
	* gdb_obstack.h:
	* gdb_locale.h:
	* gdb_dirent.h:
	* gdb_curses.h:
	* gdb_assert.h:
	* gdbarch.sh:
	* gdb.h:
	* hpux-thread.c:
	* hppabsd-nat.c:
	* hppa-tdep.h:
	* hpacc-abi.c:
	* h8300-tdep.c:
	* gregset.h:
	* go32-nat.c:
	* gnu-v3-abi.c:
	* gnu-v2-abi.h:
	* gnu-v2-abi.c:
	* gnu-nat.h:
	* glibc-tdep.c:
	* gdbtypes.h:
	* gdbcore.h:
	* gdbcmd.h:
	* i386nbsd-tdep.c:
	* i386nbsd-nat.c:
	* i386gnu-tdep.c:
	* i386gnu-nat.c:
	* i386fbsd-tdep.c:
	* i386fbsd-nat.c:
	* i386bsd-tdep.c:
	* i386bsd-nat.h:
	* i386bsd-nat.c:
	* i386-tdep.h:
	* i386-sol2-nat.c:
	* i386-nto-tdep.c:
	* i386-nat.c:
	* i386-linux-tdep.h:
	* i386-linux-tdep.c:
	* i386-linux-nat.c:
	* i386-cygwin-tdep.c:
	* inf-ttrace.c:
	* inf-ptrace.h:
	* inf-ptrace.c:
	* inf-loop.h:
	* inf-loop.c:
	* inf-child.h:
	* inf-child.c:
	* ia64-tdep.h:
	* ia64-linux-nat.c:
	* i387-tdep.h:
	* i387-tdep.c:
	* i386v4-nat.c:
	* i386v-nat.c:
	* i386obsd-tdep.c:
	* i386obsd-nat.c:
	* kod.c:
	* jv-valprint.c:
	* jv-typeprint.c:
	* jv-lang.h:
	* jv-lang.c:
	* irix5-nat.c:
	* iq2000-tdep.c:
	* interps.h:
	* interps.c:
	* inftarg.c:
	* inflow.h:
	* inflow.c:
	* inferior.h:
	* infcmd.c:
	* infcall.h:
	* infcall.c:
	* inf-ttrace.h:
	* m32r-tdep.h:
	* m32r-tdep.c:
	* m32r-rom.c:
	* m32r-linux-tdep.c:
	* m32r-linux-nat.c:
	* m2-valprint.c:
	* m2-typeprint.c:
	* m2-lang.h:
	* m2-lang.c:
	* lynx-nat.c:
	* linux-thread-db.c:
	* linux-nat.h:
	* linespec.c:
	* libunwind-frame.h:
	* libunwind-frame.c:
	* language.h:
	* language.c:
	* macroexp.c:
	* macrocmd.c:
	* m88kbsd-nat.c:
	* m88k-tdep.h:
	* m88k-tdep.c:
	* m68klinux-tdep.c:
	* m68klinux-nat.c:
	* m68kbsd-tdep.c:
	* m68kbsd-nat.c:
	* m68k-tdep.h:
	* m68k-tdep.c:
	* mips-linux-nat.c:
	* mips-irix-tdep.c:
	* minsyms.c:
	* memattr.h:
	* memattr.c:
	* mem-break.c:
	* mdebugread.h:
	* main.h:
	* main.c:
	* macrotab.h:
	* macrotab.c:
	* macroscope.h:
	* macroscope.c:
	* macroexp.h:
	* nbsd-tdep.c:
	* mt-tdep.c:
	* monitor.h:
	* monitor.c:
	* mn10300-tdep.h:
	* mn10300-tdep.c:
	* mn10300-linux-tdep.c:
	* mipsv4-nat.c:
	* mipsread.c:
	* mipsnbsd-tdep.h:
	* mipsnbsd-tdep.c:
	* mipsnbsd-nat.c:
	* mips64obsd-tdep.c:
	* mips64obsd-nat.c:
	* mips-tdep.h:
	* mips-mdebug-tdep.c:
	* mips-linux-tdep.c:
	* osabi.h:
	* osabi.c:
	* ocd.h:
	* ocd.c:
	* observer.c:
	* objfiles.h:
	* objfiles.c:
	* objc-lang.h:
	* objc-lang.c:
	* objc-exp.y:
	* nto-tdep.h:
	* nto-tdep.c:
	* nto-procfs.c:
	* nlmread.c:
	* nbsd-tdep.h:
	* ppcobsd-tdep.c:
	* ppcobsd-nat.c:
	* ppcnbsd-tdep.h:
	* ppcnbsd-tdep.c:
	* ppcnbsd-nat.c:
	* ppcbug-rom.c:
	* ppc-tdep.h:
	* ppc-sysv-tdep.c:
	* ppc-linux-tdep.c:
	* ppc-linux-nat.c:
	* ppc-bdm.c:
	* parser-defs.h:
	* parse.c:
	* p-valprint.c:
	* p-typeprint.c:
	* p-lang.h:
	* p-lang.c:
	* remote-fileio.h:
	* remote-fileio.c:
	* remote-est.c:
	* remote-e7000.c:
	* regset.h:
	* regset.c:
	* reggroups.h:
	* reggroups.c:
	* regcache.h:
	* regcache.c:
	* proc-why.c:
	* proc-service.c:
	* proc-events.c:
	* printcmd.c:
	* ppcobsd-tdep.h:
	* sentinel-frame.h:
	* sentinel-frame.c:
	* scm-valprint.c:
	* scm-tags.h:
	* scm-lang.h:
	* scm-lang.c:
	* scm-exp.c:
	* s390-tdep.h:
	* rom68k-rom.c:
	* remote.h:
	* remote-utils.c:
	* remote-st.c:
	* remote-sim.c:
	* remote-sds.c:
	* remote-rdp.c:
	* remote-rdi.c:
	* remote-hms.c:
	* sim-regno.h:
	* shnbsd-tdep.h:
	* shnbsd-tdep.c:
	* shnbsd-nat.c:
	* sh-tdep.h:
	* serial.h:
	* serial.c:
	* ser-unix.h:
	* ser-unix.c:
	* ser-tcp.c:
	* ser-pipe.c:
	* ser-go32.c:
	* ser-e7kpc.c:
	* ser-base.h:
	* ser-base.c:
	* solib.c:
	* solib-svr4.h:
	* solib-svr4.c:
	* solib-sunos.c:
	* solib-som.h:
	* solib-som.c:
	* solib-pa64.h:
	* solib-pa64.c:
	* solib-osf.c:
	* solib-null.c:
	* solib-legacy.c:
	* solib-irix.c:
	* solib-frv.c:
	* solib-aix5.c:
	* sol-thread.c:
	* sparc64-linux-tdep.c:
	* sparc64-linux-nat.c:
	* sparc-tdep.h:
	* sparc-tdep.c:
	* sparc-sol2-tdep.c:
	* sparc-sol2-nat.c:
	* sparc-nat.h:
	* sparc-nat.c:
	* sparc-linux-tdep.c:
	* sparc-linux-nat.c:
	* source.h:
	* source.c:
	* somread.c:
	* solist.h:
	* solib.h:
	* std-regs.c:
	* stack.h:
	* stack.c:
	* stabsread.h:
	* sparcobsd-tdep.c:
	* sparcnbsd-tdep.c:
	* sparcnbsd-nat.c:
	* sparc64obsd-tdep.c:
	* sparc64nbsd-tdep.c:
	* sparc64nbsd-nat.c:
	* sparc64fbsd-tdep.c:
	* sparc64fbsd-nat.c:
	* sparc64-tdep.h:
	* sparc64-tdep.c:
	* sparc64-sol2-tdep.c:
	* sparc64-nat.c:
	* ui-file.c:
	* typeprint.h:
	* typeprint.c:
	* tramp-frame.h:
	* tramp-frame.c:
	* trad-frame.h:
	* trad-frame.c:
	* tracepoint.h:
	* top.c:
	* tobs.inc:
	* thread.c:
	* terminal.h:
	* target.h:
	* symfile.h:
	* stop-gdb.c:
	* vaxbsd-nat.c:
	* vax-tdep.h:
	* vax-tdep.c:
	* vax-nat.c:
	* varobj.h:
	* varobj.c:
	* value.h:
	* value.c:
	* valprint.h:
	* valprint.c:
	* v850-tdep.c:
	* uw-thread.c:
	* user-regs.c:
	* ui-out.h:
	* ui-out.c:
	* ui-file.h:
	* xcoffsolib.h:
	* xcoffsolib.c:
	* wrapper.c:
	* wince.c:
	* wince-stub.h:
	* wince-stub.c:
	* vaxobsd-tdep.c:
	* vaxnbsd-tdep.c:
	* gdb_gcore.sh:
	* copying.c:
	* configure.ac:
	* aclocal.m4:
	* acinclude.m4:
	* reply_mig_hack.awk:
	* observer.sh:
	* gdb_mbuild.sh:
	* arm-linux-tdep.c:
	* blockframe.c:
	* dbug-rom.c:
	* environ.h:
	* dwarf2loc.h:
	* gdb-events.sh:
	* glibc-tdep.h:
	* gdb_wait.h:
	* gdbthread.h:
	* i386-sol2-tdep.c:
	* hppabsd-tdep.c:
	* hppa-linux-nat.c:
	* hppa-hpux-nat.c:
	* ia64-linux-tdep.c:
	* infptrace.c:
	* linespec.h:
	* maint.c:
	* mips-mdebug-tdep.h:
	* remote-m32r-sdi.c:
	* s390-nat.c:
	* rs6000-nat.c:
	* remote-utils.h:
	* sh3-rom.c:
	* sh-linux-tdep.c:
	* top.h:
	* symtab.h:
	* symmisc.c:
	* symfile-mem.c:
	* srec.h:
	* user-regs.h:
	* version.h:
	* valarith.c:
	* xstormy16-tdep.c:
	* wrapper.h:
	* Makefile.in:
	* f-exp.y:
	* cris-tdep.c:
	* cp-name-parser.y:
	* procfs.c:
	* proc-utils.h:
	* proc-flags.c:
	* proc-api.c:
	* p-exp.y:
	* m68hc11-tdep.c:
	* m2-exp.y:
	* kod.h:
	* kod-cisco.c:
	* jv-exp.y:
	* hppa-linux-tdep.c: Add (c) after Copyright.  Update the FSF
	address.
2005-12-17 22:34:03 +00:00
Andrew Cagney da3331ec16 2003-04-12 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Add missing opaque declarations.
	* gdbarch.h: Regnerate.
	* symtab.h: Add missing opaque declarations.
	* value.h, target.h, symfile.h, stabsread.h: Ditto.
	* x86-64-tdep.h, xmodem.h, monitor.h, typeprint.h: Ditto.
	* srec.h, solib-svr4.h, source.h, inferior.h: Ditto.
	* ser-unix.h, serial.h, remote-utils.h, gdbcore.h: Ditto.
	* ppc-tdep.h, ocd.h, mips-tdep.h, gdbtypes.h: Ditto.
	* buildsym.h, builtin-regs.h, linespec.h, language.h: Ditto.
	* i387-tdep.h, gdbthread.h, event-top.h, gdb.h: Ditto.
	* dwarf2cfi.h, doublest.h, disasm.h, cp-abi.h: Ditto.
	* cli-out.h, c-lang.h, ax-gdb.h, arch-utils.h: Ditto.
	* ada-lang.h, config/nm-lynx.h, config/nm-linux.h: Ditto.
	* config/sparc/tm-sp64.h, config/rs6000/tm-rs6000.h: Ditto.
	* config/pa/tm-hppah.h, config/m68k/tm-delta68.h: Ditto.
	* cli/cli-setshow.h, cli/cli-script.h: Ditto.
2003-04-12 17:41:26 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Jason Molenda c5aa993b1f import gdb-1999-07-07 post reformat 1999-07-07 20:19:36 +00:00
Stan Shebs 7a292a7adf import gdb-19990422 snapshot 1999-04-26 18:34:20 +00:00
Stan Shebs c906108c21 Initial creation of sourceware repository 1999-04-16 01:35:26 +00:00