Commit Graph

27879 Commits

Author SHA1 Message Date
Hui Zhu f994e27a0b 2011-02-21 Hui Zhu <teawater@gmail.com>
* agentexpr.texi (Bytecode Descriptions): Add printf.
	* gdb.texinfo (Tracepoint Action Lists): Add printf.
2011-02-21 08:40:27 +00:00
Hui Zhu f9c6ff7236 2011-02-21 Hui Zhu <teawater@gmail.com>
* tracepoint.c (tp_printf): New function.
	(eval_agent_expr): Handle gdb_agent_op_printf.
2011-02-21 08:39:14 +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
gdbadmin c0c8b2f268 *** empty log message *** 2011-02-21 00:00:32 +00:00
gdbadmin b177df88cf *** empty log message *** 2011-02-20 00:00:33 +00:00
Michael Snyder 7d357efd13 2011-02-19 Michael Snyder <msnyder@vmware.com>
* reverse.c (delete_one_bookmark): Argument is now bookmark
	id rather than pointer to bookmark struct.
	(delete_bookmark_command): Use get_number_or_range.
	(goto_bookmark_command): Parse with get_number instead of strtoul.
	(bookmark_1): New function.  Print info for one bookmark.
	(bookmarks_info): Use get_number_or_range and bookmark_1.
2011-02-19 19:10:48 +00:00
Michael Snyder 65ebfb52d9 2011-02-18 Michael Snyder <msnyder@vmware.com>
* thread.c (thread_apply_command): Re-implement using
	get_number_or_range.
2011-02-19 01:24:55 +00:00
Michael Snyder 7a45ebd700 2011-02-18 Michael Snyder <msnyder@vmware.com>
* thread.c (info_threads_command): Re-implement using
	get_number_or_range.
2011-02-19 01:02:56 +00:00
gdbadmin 22e881728a *** empty log message *** 2011-02-19 00:00:33 +00:00
Tom Tromey 94d5e490f0 gdb
* common/ax.def: New file.
	* ax.h (enum agent_op): Use ax.def.
	* ax-general.c (aop_map): Use ax.def.
gdbserver
	* Makefile.in (tracepoint-ipa.o): Depend on ax.def.
	(tracepoint.o): Likewise.
	* tracepoint.c (enum gdb_agent_op): Use ax.def.
	(gdb_agent_op_names): Likewise.
2011-02-18 21:12:07 +00:00
Tom Tromey c7f96d2b95 gdb
* ax-general.c (aop_map): Add pick and rot.
	* dwarf2loc.c (compile_dwarf_to_ax) <DW_OP_over>: Reimplement.
	<DW_OP_rot>: Implement.
	* ax.h (enum agent_op) <aop_pick, aop_rot>: New constants.
	(ax_pick): Declare.
	* ax-general.c (ax_pick): New function.
doc
	* agentexpr.texi (Bytecode Descriptions): Document pick and rot.
gdbserver
	* tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
	gdb_agent_op_rot>: New constants.
	(gdb_agent_op_names): Add pick and roll.
	(eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
	cases.
2011-02-18 20:55:45 +00:00
Tom Tromey 66694b75a4 * Makefile.in (HFILES_NO_SRCDIR): Don't mention ada-operator.inc. 2011-02-18 20:31:18 +00:00
Jan Kratochvil eeaafae2bd gdb/
* cp-support.c (make_symbol_overload_list_namespace): Do not call
	make_symbol_overload_list_block with NULL BLOCK.
	* valarith.c (unop_user_defined_p): Resolve also TYPE_CODE_TYPEDEF.

gdb/testsuite/
	* gdb.cp/typedef-operator.exp: New file.
	* gdb.cp/typedef-operator.cc: New file.
2011-02-18 19:10:48 +00:00
Pedro Alves 3c3fe74c6f * breakpoint.c (get_number_trailer): No longer accept a NULL PP.
* breakpoint.h (get_number_or_range): Declare.
	* printcmd.c (ALL_DISPLAYS): Declare.
	(delete_display): Reimplement taking a display pointer.
	(undisplay_command): Accept a range of displays to delete, using
	get_number_or_range.
2011-02-18 16:43:53 +00:00
Pierre Muller 13163d8050 * c-valprint.c (c_val_print): Add embedded_offset to address
for arrays of unspecified length.
	* p-valprint.c (pascal_val_print): Likewise.
2011-02-18 14:17:38 +00:00
Yao Qi b434a28f71 2011-02-18 Yao Qi <yao@codesourcery.com>
* gdb/arm-tdep.c (arm_displaced_step_copy_insn): Move code to ...
	(arm_process_displaced_insn): .. here. Remove parameter INSN.
	(thumb_process_displaced_insn): New.
	* gdb/arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Update
	call to arm_process_displaced_insn.
	* gdb/arm-tdep.h : Update declaration of arm_process_displaced_insn.
2011-02-18 05:01:54 +00:00
gdbadmin 0bbd5bccf3 *** empty log message *** 2011-02-18 00:00:33 +00:00
Michael Snyder e338d953a9 2011-02-17 Michael Snyder <msnyder@vmware.com>
* gdb.threads/thread-find.exp: Fix regular expressions.
2011-02-17 22:08:12 +00:00
Pedro Alves f65d55530c Prefix filenames with gdb.trace/ 2011-02-17 19:06:07 +00:00
Tom Tromey 9f6f94ff25 * dwarf2loc.h (dwarf2_compile_expr_to_ax): Declare.
* dwarf2loc.c (dwarf2_compile_expr_to_ax): Rename from
	compile_dwarf_to_ax.  No longer static.  Call
	dwarf2_compile_cfa_to_ax.
	(locexpr_tracepoint_var_ref): Update.
	(loclist_tracepoint_var_ref): Update.
	* dwarf2-frame.h (dwarf2_compile_cfa_to_ax): Declare.
	* dwarf2-frame.c (execute_cfa_program): Remove 'this_frame'
	argument; add 'gdbarch' and 'pc'.
	(dwarf2_compile_cfa_to_ax): New function.
	(dwarf2_frame_cache): Update.
2011-02-17 16:20:44 +00:00
Joel Brobecker e67ad678a1 [Ada] Fix unconstrained packed array size
When ada-lang transforms an array descriptor type (an XUP structure)
into an array type, the size of the array type is computed by using
the element size, and multiplying it by the number of elements in
that array. This does not work, however, for packed arrays, where
the *packed* size in bits needs to be used.

This usually does not cause any problem, because we end up reading
more memory than needed.  However, we have observed on LynxOS
a memory error while trying to read the entire array, because
the larger-than-needed read tried to read past the end of the stack
into inaccessible memory.

This patch fixes the problem by correctly computing the array size
in bytes in the case of packed arrays.

gdb/ChangeLog:

        * ada-lang.c (ada_type_of_array): Fix the size of the array
        in the case of an unconstrained packed array.

gdb/testsuite/ChangeLog:

        * gdb.ada/packed_array: Expand testcase to test printing of
        unconstrained packed array.
2011-02-17 06:42:57 +00:00
Joel Brobecker 93084bcabb dw2-ranges.exp: simplify using clean_restart
gdb/testsuite/ChangeLog:

        * gdb.dwarf2/dw2-ranges.exp: Simplify using clean_restart.
2011-02-17 05:21:29 +00:00
Yao Qi 946ebb0d70 2011-02-17 Yao Qi <yao@codesourcery.com>
* common/Makefile.in: Add more targets for make.
2011-02-17 02:15:22 +00:00
gdbadmin acad30882c *** empty log message *** 2011-02-17 00:00:03 +00:00
Tom Tromey 1ba1b3533c * dwarf2loc.c (unimplemented): Fix typo. 2011-02-16 21:45:38 +00:00
Tom Tromey b1bfef6533 * dwarf2loc.c (unimplemented): Handle unnamed opcodes.
(compile_dwarf_to_ax) <default>: Use unimplemented.
	<DW_OP_deref>: Update.
	(disassemble_dwarf_expression): Update.
	* dwarf2read.c (dwarf_stack_op_name): Remove 'def' argument.
	(decode_locdesc): Update.
	* dwarf2expr.h (dwarf_stack_op_name): Update.
2011-02-16 21:32:05 +00:00
Tom Tromey 5f1e6f1949 * ax.h (struct aop_map) <name>: Now const. 2011-02-16 21:02:29 +00:00
Pedro Alves a0c78a733a 2011-02-16 Tom Tromey <tromey@redhat.com>
gdb/
	* ax-gdb.c.c (gen_expr) <UNOP_MEMVAL>: Handle value kinds other
	than axs_rvalue.

2011-02-16  Pedro Alves  <pedro@codesourcery.com>

	gdb/testsuite/
	* collection.c (globalarr3): New global.
	(main): Initialize it before collecting, and and clear it
	afterwards.
	* collection.exp (gdb_collect_globals_test): Test collecting with
	'{type} addr', where the addr expression is not an rvalue.
2011-02-16 18:07:58 +00:00
Yao Qi a42244dbec 2011-02-16 Yao Qi <yao@qiyaows>
* infrun.c (get_displaced_step_closure_by_addr): New.
	* inferior.h: Declare it.
	* arm-tdep.c: (arm_pc_is_thumb): Call
	get_displaced_step_closure_by_addr.  Adjust MEMADDR if it
	returns non-NULL.
2011-02-16 14:54:42 +00:00
Ken Werner 3dfcbbd281 gdb/testsuite/ChangeLog
2011-02-16  Ken Werner  <ken.werner@de.ibm.com>

        * gdb.opencl/datatypes.exp: Allow "false" when printing the content of
        a bool variable. Expect correct OpenCL names for vector types. Use the
        uc3 variable name instead of referring to the uchar3 built-in type.
        Escape the asterisk at the half pointer test.
2011-02-16 14:38:53 +00:00
Pedro Alves 08807d5afd 2011-02-16 Pedro Alves <pedro@codesourcery.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>

	gdb/
	* tracepoint.c (memrange_sortmerge): Fix list A's end calculation.

2011-02-16  Pedro Alves  <pedro@codesourcery.com>

	gdb/testsuite/
	* collection.c (globalarr2): New global.
	(main): Initialize it before collecting, and and clear it
	afterwards.
	* collection.exp (gdb_collect_globals_test): Test collecting
	overlapping memory ranges.
2011-02-16 12:59:05 +00:00
Pedro Alves fb68ae733b Fix pasto... 2011-02-16 11:57:41 +00:00
Pedro Alves 29976f3f7e gdb/
* value.c (value_contents_copy_raw): Extend describing comment.
	Assert that the destination contents we're overwriting are wholly
	available.
	* value.h (value_contents_copy): Extend describing comment.
2011-02-16 11:55:59 +00:00
Pedro Alves cd24cfaa4f * value.c (value_available_contents_eq): Remove redundant local
variables.  Fix available contents comparision.
	* value.h (value_available_contents_eq): Extend describing
	comment.
2011-02-16 10:13:53 +00:00
Yao Qi 60bbf3380a 2011-02-16 Yao Qi <yao@codesourcery.com>
* thread.c (info_threads_command): Add missing i18n markup and remove
        trailing newline.
2011-02-16 09:46:09 +00:00
gdbadmin 7d58ce8f4b *** empty log message *** 2011-02-16 00:00:02 +00:00
Paul Pluzhnikov 17450429ce 2011-02-15 Paul Pluzhnikov <ppluzhnikov@google.com>
* breakpoint.c (longjmp_names): New variable.
	(struct breakpoint_objfile_data): New type.
	(breakpoint_objfile_key): New variable.
	(msym_not_found): New variable.
	(msym_not_found_p): New predicate.
	(get_breakpoint_objfile_data): New function.
	(create_overlay_event_breakpoint): Check per-objfile cache for
	symbols first.
	(create_longjmp_master_breakpoint): Likewise.
	(create_std_terminate_master_breakpoint): Likewise.
	(create_exception_master_breakpoint): Likewise.
	(_initialize_breakpoint): Register per-objfile data key.
2011-02-15 21:43:25 +00:00
Michael Snyder cdf99611e7 Fix mis-merge of changelog. 2011-02-15 21:25:05 +00:00
Paul Pluzhnikov af02033e0a 2011-02-15 Paul Pluzhnikov <ppluzhnikov@google.com>
* breakpoint.c ((create_overlay_event_breakpoint): Const-propagate
	parameter value.
	(create_longjmp_master_breakpoint): Loop over longjmp names.
	(create_std_terminate_master_breakpoint): Const-propagate parameter
	value.
	(update_breakpoints_after_exec): Adjust.
	(breakpoint_re_set): Adjust.
2011-02-15 21:23:34 +00:00
Michael Snyder 60f98dde0a 2011-02-15 Michael Snyder <msnyder@vmware.com>
* command.h (enum command_class): New class 'no_set_class', for
	"show" commands without a corresponding "set" command.
	* value.c (_initialize_values): Use 'no_set_class' for "show values".
	* copying.c (_initialize_copying): Ditto for "show copying" and
	"show warranty".
	* cli/cli-cmds.c (init_cli_cmds): Ditto for "show commands" and
	"show version".
	* cli/cli-setshow.c (cmd_show_list): Skip "show" commands for
	which there is no corresponding "set" command (eg. "show copying").

2011-02-14  Michael Snyder  <msnyder@vmware.com>

	* gdb.texinfo (threads): Document argument for "info threads" cmd.
	Document new command "thread find".

2011-02-15  Michael Snyder  <msnyder@vmware.com>

	* gdb.base/default.exp: Add tests for thread commands.
	* gdb.base/help.exp: Add tests for thread commands.
	* gdb.threads/thread-find.exp: New test for thread find command.
2011-02-15 21:17:53 +00:00
Jan Kratochvil b708a5c7d3 Merge gdb/common/ChangeLog back to gdb/ChangeLog. 2011-02-15 21:14:02 +00:00
Jan Kratochvil 0feedb2cc8 gdb/
* Makefile.in (ACLOCAL_AMFLAGS): Add `-I ../config'.
	* aclocal.m4: Regenerated with aclocal-1.11.1.
	* common/configure: Regenerate with autoconf-2.64.

gdb/gdbserver/
	* aclocal.m4: Regenerated with aclocal-1.11.1.
2011-02-15 21:05:54 +00:00
Ken Werner 648cd113ef gdb/ChangeLog
2011-02-15  Ken Werner  <ken.werner@de.ibm.com>

	* opencl-lang.c (build_opencl_types): Set the size of the built-in
	bool data type to a size of one byte.

gdb/testsuite/ChangeLog

2011-02-15  Ken Werner  <ken.werner@de.ibm.com>

	* gdb.opencl/datatypes.exp: Expect the size of a bool to be one byte.
2011-02-15 20:10:13 +00:00
Pedro Alves 5657161fbd gdb/
* target.c (memory_xfer_live_readonly_partial): Document where to
	look for interface description.
2011-02-15 17:22:21 +00:00
Yao Qi 494e194e77 2011-02-15 Yao Qi <yao@codesourcery.com>
PR tdep/12352
	* arm-tdep.c (copy_ldr_str_ldrb_strb): Replace PC with SP in
	order to store PC value on stack instead of text section.

2011-02-15  Yao Qi  <yao@codesourcery.com>

	PR tdep/12352
	* gdb.arch/arm-disp-step.S : New test for str instruction.
	* gdb.arch/arm-disp-step.exp : Likewise
2011-02-15 14:26:34 +00:00
Thiago Jung Bauermann d9492458a1 gdb/
* rs6000-tdep.c (IS_EFP_PSEUDOREG): Use correct constant for
	the EFP register set size.
	(efpr_pseudo_register_read): Use regcache_raw_read_part to read
	data from the VMX register.
	(efpr_pseudo_register_write): Use regcache_raw_write_part to read
	and write data from/to the VMX register.

gdb/testsuite/
	* gdb.arch/vsx-regs.exp: Add "vector_register1_vr" and
	"vector_register2_vr" test strings.  Test the extended floating
	point registers (F32~F63).
	* lib/gdb.exp (skip_vsx_tests): Update compile flags for the
	IBM XL C compiler.  Make the test program use a register provided
	by the compiler for the lxvd2x instruction.
2011-02-15 13:35:23 +00:00
gdbadmin ad9bb468ae *** empty log message *** 2011-02-15 00:00:03 +00:00
Michael Snyder db5f229b95 2011-02-14 Michael Snyder <msnyder@vmware.com>
* command.h (enum command_class): New class 'no_set_class', for
	"show" commands without a corresponding "set" command.
	* value.c (_initialize_values): Use 'no_set_class' for "show values".
	* copying.c (_initialize_copying): Ditto for "show copying" and
	"show warranty".
	* cli/cli-cmds.c (init_cli_cmds): Ditto for "show commands" and
	"show version".
	* cli/cli-setshow.c (cmd_show_list): Skip "show" commands for
	which there is no corresponding "set" command (eg. "show copying").
2011-02-14 23:41:33 +00:00
Michael Snyder 08e796bc55 2011-02-14 Michael Snyder <msnyder@vmware.com>
* gdb.texinfo (Threads): Update example of new thread message.
2011-02-14 23:14:35 +00:00
Pedro Alves 424447eef3 * exec.c (section_table_available_memory): Change `len' parameter
type to ULONGEST.
	* exec.h (section_table_available_memory): Ditto.
	* value.h (read_value_memory): Rename the `offset' parameter to
	`embedded_offset'.
2011-02-14 22:08:48 +00:00
Pedro Alves e0ccc0c7e0 Add proper attribution. 2011-02-14 19:20:45 +00:00
Pedro Alves c0f61f9c37 gdb/
* memrange.c (compare_mem_ranges): Mention sort order in
	describing comment.
	(normalize_mem_ranges): Add comment.  Fix ra->length calculation.
	* tracepoint.c (traceframe_available_memory): Extend comment to
	mention what happens to RESULT when the target does not support
	the query.
2011-02-14 19:19:18 +00:00
Pedro Alves 6bfc80c738 * value.c (mark_value_bytes_unavailable): Fix indexing the `bef'
range.
2011-02-14 12:54:42 +00:00
Pedro Alves e730304246 * value.c (value_bits_valid, value_bits_synthetic_pointer):
No longer handle NULL values.
2011-02-14 11:52:48 +00:00
Pedro Alves 8af8e3bc81 gdb/
* exceptions.h (NOT_AVAILABLE_ERROR): New error.
	* value.c: Include "exceptions.h".
	(require_available): Throw NOT_AVAILABLE_ERROR instead of a
	generic error.
	* cp-abi.c: Include gdb_assert.h.
	(baseclass_offset): Add `embedded_offset' and `val' parameters.
	Assert the method is implemented.  Wrap NOT_AVAILABLE_ERROR
	errors.
	* cp-abi.h (baseclass_offset): Add `embedded_offset' and `val'
	parameters.  No longer returns -1 on error.
	(struct cp_abi_ops) <baseclass_offset>: Add `embedded_offset' and
	`val' parameters.
	* cp-valprint.c: Include exceptions.h.
	(cp_print_value): Handle NOT_AVAILABLE_ERROR errors when fetching
	the baseclass_offset.  Handle unavailable base classes.  Use
	val_print_invalid_address.
	* p-valprint.c: Include exceptions.h.
	(pascal_object_print_value): Handle NOT_AVAILABLE_ERROR errors
	when fetching the baseclass_offset.  No longer expect
	baseclass_offset returning -1.  Handle unavailable base classes.
	Use val_print_invalid_address.
	* valops.c (dynamic_cast_check_1): Rename `contents' parameter to
	`valaddr' parameter, and change its type to gdb_byte pointer.  Add
	`embedded_offset' and `val' parameters.  Adjust.
	(dynamic_cast_check_2): Rename `contents' parameter to `valaddr'
	parameter, and change its type to gdb_byte pointer.  Add
	`embedded_offset' and `val' parameters.  Adjust.  No longer expect
	baseclass_offset returning -1.
	(value_dynamic_cast): Use value_contents_for_printing rather than
	value_contents.  Adjust.
	(search_struct_field): No longer expect baseclass_offset returning
	-1.
	(search_struct_method): If reading memory from the target is
	necessary, wrap it in a new value to pass to baseclass_offset.  No
	longer expect baseclass_offset returning -1.
	(find_method_list): No longer expect baseclass_offset returning
	-1.  Use value_contents_for_printing rather than value_contents.
	* valprint.c (val_print_invalid_address): New function.
	* valprint.h (val_print_invalid_address): Declare.
	* gdbtypes.c (is_unique_ancestor_worker): New `embedded_offset'
	and `val' parameters.  No longer expect baseclass_offset returning
	-1.  Adjust.
	* gnu-v2-abi.c: Include "exceptions.h".
	(gnuv2_baseclass_offset): Add `embedded_offset' and `val'
	parameters.  Handle unavailable memory.  Recurse through
	gnuv2_baseclass_offset directly, rather than through
	baseclass_offset.  No longer returns -1 on not found, instead
	throw an error.
	* gnu-v3-abi.c (gnuv3_baseclass_offset): Add `embedded_offset' and
	`val' parameters.  Adjust.

	gdb/testsuite/
	* gdb.trace/unavailable.cc (class Base, class Middle, class
	Derived): New types.
	(derived_unavail, derived_partial, derived_whole): New globals.
	(virtual_partial): New global.
	(virtualp): Point at virtual_partial.
	* gdb.trace/unavailable.exp (gdb_collect_globals_test): Add tests
	related to unavailable vptr.
2011-02-14 11:35:45 +00:00
Pedro Alves 1b28d0b3be gdb/testuite/
* gdb.trace/unavailable.cc (a, b, c): New globals.
	(main): Set and clear them.
	* gdb.trace/unavailable.exp (gdb_collect_globals_test): Collect
	`a' and `c', and check that `b' isn't collected, although `a' and
	`c' are.

	gdb/
	* tracepoint.c (memrange_sortmerge): Don't merge ranges that are
	almost but not quite adjacent.
2011-02-14 11:34:31 +00:00
Pedro Alves ec0a52e162 gdb/testsuite/
* gdb.trace/unavailable.cc (struct Virtual): New.
	(virtualp): New global pointer.
	* gdb.trace/unavailable.exp (gdb_collect_globals_test): Test
	printing a pointer to an object whose type has a vtable, with
	print object on.

	gdb/
	* value.h (value_entirely_available): Declare.
	* value.c (value_entirely_available): New function.
	* c-valprint.c (c_value_print): Don't try fetching the pointer's
	real type if the pointer is unavailable.
2011-02-14 11:33:24 +00:00
Pedro Alves 24e6bceefb gdb/
* valops.c (value_repeat): Use read_value_memory instead of
	read_memory.

	gdb/testsuite/
	* gdb.trace/unavailable.exp (gdb_collect_globals_test): Test that
	value repeat handles unavailableness.
2011-02-14 11:32:17 +00:00
Pedro Alves 39d3738556 gdb/
* value.h (value_contents_copy, value_contents_copy_raw): Declare.
	* value.c (value_contents_copy_raw, value_contents_copy): New
	functions.
	(value_primitive_field): Use value_contents_copy_raw instead of
	memcpy.
	* valops.c (value_fetch_lazy): Use value_contents_copy instead of
	memcpy.
	(value_array, value_slice): Ditto.
	* valarith.c (value_subscripted_rvalue): Use
	value_contents_copy_raw instead of memcpy.

	gdb/testsuite/
	* gdb.trace/unavailable.exp (gdb_collect_globals_test): Add new
	tests for building arrays from unavailable values, subscripting
	non-memory rvalue unvailable arrays, and accessing fields or
	baseclasses of non-lazy unavailable values,
	* gdb.trace/unavailable.cc (small_struct, small_struct_b): New
	struct types.
	(g_smallstruct, g_smallstruct_b): New globals.
2011-02-14 11:30:37 +00:00
Pedro Alves 06d72e16c4 gdb/testsuite/
* gdb.trace/unavailable.cc, gdb.trace/unavailable.exp: New files.
2011-02-14 11:29:04 +00:00
Pedro Alves a3d34bf49a <unavailable> references.
gdb/
	* valops.c (get_value_at): Use value_from_contents_and_address,
	avoiding read_memory.
2011-02-14 11:27:36 +00:00
Pedro Alves 9fc6d940ae gdb/
* c-valprint.c (c_val_print): Print a string with unavailable
	contents as an array.
2011-02-14 11:26:42 +00:00
Pedro Alves 5467c6c807 gdb/
* value.h (unpack_bits_as_long): Delete declaration.
	(unpack_value_bits_as_long): Declare.
	(unpack_value_field_as_long): Declare.
	(value_field_bitfield): Declare.
	* value.c (unpack_bits_as_long): Rename to...
	(unpack_value_bits_as_long_1): ... this.  Add embedded_offset and
	value parameters.  Return the extracted result in a new output
	parameter.  If the value contents are unavailable, return false,
	otherwise return true.
	(unpack_value_bits_as_long): New.
	(unpack_field_as_long): Rename to...
	(unpack_value_field_as_long_1): ... this.  Add embedded_offset and
	Add embedded_offset and value parameters.  Return the extracted
	result in a new output parameter. If the value contents are
	unavailable, return false, otherwise return true.
	(unpack_value_field_as_long): New.
	(unpack_field_as_long_1): New.
	(unpack_field_as_long): Reimplement as wrapper around
	unpack_value_field_as_long_1.
	(value_field_bitfield): New function.
	* valops.c (value_fetch_lazy): When fetching a bitfield, use
	unpack_value_bits_as_long.  Mark the value as unavailable, if it
	is unavailable.
	* jv-valprint.c (java_print_value_fields): Use
	value_field_bitfield.
	* p-valprint.c (pascal_object_print_value_fields): Use
	value_field_bitfield.
	* cp-valprint.c (cp_print_value_fields): Use value_field_bitfield.
2011-02-14 11:25:59 +00:00
Pedro Alves 3158c6ed12 * value.c (get_internalvar_integer): Also return the int value of
TYPE_CODE_INT INTERNALVAR_VALUE values.
	(set_internalvar): Don't special case TYPE_CODE_INT.
2011-02-14 11:25:12 +00:00
Pedro Alves 9fbdca0d66 gdb/
* value.c (struct internalvar) <enum internalvar_kind>: Remove
	INTERNALVAR_POINTER.
	<pointer>: Delete.
	(value_of_internalvar): Remove INTERNALVAR_POINTER handling.
	(set_internalvar): Remove special TYPE_CODE_PTR handling.
	(preserve_one_internalvar): Remove INTERNALVAR_POINTER handling.
2011-02-14 11:24:19 +00:00
Pedro Alves c8c1c22fea gdb/
* value.h (value_available_contents_eq): Declare.
	* value.c (find_first_range_overlap): New function.
	(value_available_contents_eq): New function.
	* valprint.c (val_print_array_elements): Use
	value_available_contents_eq.
	* ada-valprint.c (val_print_packed_array_elements): Use
	value_available_contents_eq.
	* jv-valprint.c (java_value_print): Use
	value_available_contents_eq.
2011-02-14 11:23:33 +00:00
Pedro Alves e6e4e7014d gdb/
* target.c (target_read_live_memory): New function.
	(memory_xfer_live_readonly_partial): New.
	(memory_xfer_partial): If reading from a traceframe, fallback to
	reading unavailable read-only memory from read-only regions of
	live target memory.
	* tracepoint.c (disconnect_tracing): Adjust.
	(set_current_traceframe): New, factored out from
	set_traceframe_number.
	(set_traceframe_number): Reimplement to only change the traceframe
	number on the GDB side.
	(do_restore_current_traceframe_cleanup): Adjust.
	(make_cleanup_restore_traceframe_number): New.
	(cur_traceframe_number): New global.
	(tfile_open): Set cur_traceframe_number to no traceframe.
	(set_tfile_traceframe): New function.
	(tfile_trace_find): If looking up a traceframe using any method
	other than by number, make sure the current tfile traceframe
	matches gdb's current traceframe.  Update the current tfile
	traceframe if the lookup succeeded.
	(tfile_fetch_registers, tfile_xfer_partial)
	(tfile_get_trace_state_variable_value): Make sure the remote
	traceframe matches gdb's current traceframe.
	* remote.c (remote_traceframe_number): New global.
	(remote_open_1): Set it to -1.
	(set_remote_traceframe): New function.
	(remote_fetch_registers, remote_store_registers)
	(remote_xfer_memory, remote_xfer_partial)
	(remote_get_trace_state_variable_value): Make sure the remote
	traceframe matches gdb's current traceframe.
	(remote_trace_find): If looking up a traceframe using any method
	other than by number, make sure the current remote traceframe
	matches gdb's current traceframe.  Update the current remote
	traceframe if the lookup succeeded.
	* infrun.c (fetch_inferior_event): Adjust.
	* tracepoint.h (set_current_traceframe): Declare.
	(get_traceframe_number, set_traceframe_number): Add describing
	comments.
2011-02-14 11:22:29 +00:00
Pedro Alves e6ca34fcfb Mark pieces of values as unavailable if the corresponding memory
is unavailable.

	gdb/
	* valops.c: Include tracepoint.h.
	(value_fetch_lazy): Use read_value_memory.
	(read_value_memory): New.
	* value.h (read_value_memory): Declare.
	* dwarf2loc.c (read_pieced_value): Use read_value_memory.
	* exec.c (section_table_available_memory): New function.
	* exec.h (section_table_available_memory): Declare.
2011-02-14 11:21:25 +00:00
Pedro Alves 2a7498d819 2011-02-14 Pedro Alves <pedro@codesourcery.com>
gdb/
	* Makefile.in (SFILES): Add memrange.c.
	(HFILES_NO_SRCDIR): Add memrange.h.
	(COMMON_OBS): Add memrange.o.
	* memrange.c: New file.
	* memrange.h: New file.
	* tracepoint.c: Include memrange.h.
	(struct mem_range): Delete.
	(mem_range_s): Delete.
	(traceframe_available_memory): New function.
	* tracepoint.h (traceframe_available_memory): Declare.
2011-02-14 11:20:27 +00:00
Pedro Alves 4d1f5c790b 2011-02-14 Pedro Alves <pedro@codesourcery.com>
gdb/
	* target.h (struct traceframe_info): Forward declare.
	(enum target_object): Add TARGET_OBJECT_TRACEFRAME_INFO.
	(struct target_ops) <to_traceframe_info>: New field.
	(target_traceframe_info): New.
	* target.c (update_current_target): Inherit and default
	to_traceframe_info.
	* remote.c (PACKET_qXfer_traceframe_info): New.
	(remote_protocol_features): Register qXfer:traceframe-info:read.
	(remote_xfer_partial): Handle TARGET_OBJECT_TRACEFRAME_INFO.
	(remote_traceframe_info): New.
	(init_remote_ops): Install it.
	(_initialize_remote): Install "set/show remote traceframe-info"
	commands.
	* tracepoint.h (parse_traceframe_info): Declare.
	* tracepoint.c (struct mem_range): New.
	(mem_range_s): New typedef.
	(struct traceframe_info): New.
	(traceframe_info): New global.
	(free_traceframe_info): New function.
	(clear_traceframe_info): New function.
	(start_tracing, tfind_1, set_traceframe_number): Clear traceframe
	info.
	(build_traceframe_info): New function.
	(tfile_traceframe_info): New function.
	(init_tfile_ops): Install tfile_traceframe_info.
	(traceframe_info_start_memory, free_result): New functions.
	(memory_attributes, traceframe_info_elements): New globals.
	(parse_traceframe_info, get_traceframe_info): New functions.
	* features/traceframe-info.dtd: New file.
	* Makefile.in (XMLFILES): Add traceframe-info.dtd.

	gdb/gdbserver/
	* server.c (handle_qxfer_traceframe_info): New.
	(qxfer_packets): Register "traceframe-info".
	(handle_query): Report support for qXfer:traceframe-info:read+.
	* tracepoint.c (match_blocktype): New.
	(traceframe_find_block_type): Rename to ...
	(traceframe_walk_blocks): ... this.  Add callback filter argument,
	and use it.
	(traceframe_find_block_type): New, reimplemented on top of
	traceframe_walk_blocks.
	(build_traceframe_info_xml): New.
	(traceframe_read_info): New.
	* server.h (traceframe_read_info): Declare.

	gdb/doc/
	* gdb.texinfo (Remote Configuration): Mention set/show remote
	traceframe-info.
	(Tools/Packages Optional for Building GDB): Mention that expat is
	used for traceframe info.
	(Remote Protocol) <Menu>: Add "Traceframe Info Format".
	(General Query Packets) <qSupported>: Describe the
	qXfer:traceframe-info:read feature.
	(qXfer::read): Describe qXfer:traceframe-info:read.
	(Traceframe Info Format): New section.
2011-02-14 11:19:26 +00:00
Pedro Alves b3b9301ef4 gdb/
* target.h (struct traceframe_info): Forward declare.
	(enum target_object): Add TARGET_OBJECT_TRACEFRAME_INFO.
	(struct target_ops) <to_traceframe_info>: New field.
	(target_traceframe_info): New.
	* target.c (update_current_target): Inherit and default
	to_traceframe_info.
	* remote.c (PACKET_qXfer_traceframe_info): New.
	(remote_protocol_features): Register qXfer:traceframe-info:read.
	(remote_xfer_partial): Handle TARGET_OBJECT_TRACEFRAME_INFO.
	(remote_traceframe_info): New.
	(init_remote_ops): Install it.
	(_initialize_remote): Install "set/show remote traceframe-info"
	commands.
	* tracepoint.h (parse_traceframe_info): Declare.
	* tracepoint.c (struct mem_range): New.
	(mem_range_s): New typedef.
	(struct traceframe_info): New.
	(traceframe_info): New global.
	(free_traceframe_info): New function.
	(clear_traceframe_info): New function.
	(start_tracing, tfind_1, set_traceframe_number): Clear traceframe
	info.
	(build_traceframe_info): New function.
	(tfile_traceframe_info): New function.
	(init_tfile_ops): Install tfile_traceframe_info.
	(traceframe_info_start_memory, free_result): New functions.
	(memory_attributes, traceframe_info_elements): New globals.
	(parse_traceframe_info, get_traceframe_info): New functions.
	* features/traceframe-info.dtd: New file.
	* Makefile.in (XMLFILES): Add traceframe-info.dtd.

	gdb/gdbserver/
	* server.c (handle_qxfer_traceframe_info): New.
	(qxfer_packets): Register "traceframe-info".
	(handle_query): Report support for qXfer:traceframe-info:read+.
	* tracepoint.c (match_blocktype): New.
	(traceframe_find_block_type): Rename to ...
	(traceframe_walk_blocks): ... this.  Add callback filter argument,
	and use it.
	(traceframe_find_block_type): New, reimplemented on top of
	traceframe_walk_blocks.
	(build_traceframe_info_xml): New.
	(traceframe_read_info): New.
	* server.h (traceframe_read_info): Declare.

	gdb/doc/
	* gdb.texinfo (Remote Configuration): Mention set/show remote
	traceframe-info.
	(Tools/Packages Optional for Building GDB): Mention that expat is
	used for traceframe info.
	(Remote Protocol) <Menu>: Add "Traceframe Info Format".
	(General Query Packets) <qSupported>: Describe the
	qXfer:traceframe-info:read feature.
	(qXfer::read): Describe qXfer:traceframe-info:read.
	(Traceframe Info Format): New section.
2011-02-14 11:13:12 +00:00
Pedro Alves 4e07d55ffb Base support for <unavailable> value contents.
gdb/
	* value.h (value_bytes_available): Declare.
	(mark_value_bytes_unavailable): Declare.
	* value.c (struct range): New struct.
	(range_s): New typedef.
	(ranges_overlap): New function.
	(range_lessthan): New function.
	(ranges_contain_p): New function.
	(struct value) <unavailable>: New field.
	(value_bytes_available): New function.
	(mark_value_bytes_unavailable): New function.
	(require_not_optimized_out): Constify parameter.
	(require_available): New function.
	(value_contents_all, value_contents): Require all bytes be
	available.
	(value_free): Free `unavailable'.
	(value_copy): Copy `unavailable'.
	* valprint.h (val_print_unavailable): Declare.
	* valprint.c (valprint_check_validity): Rename `offset' parameter
	to `embedded_offset'.  If printing a scalar, check whether the
	value chunk is available.
	(val_print_unavailable): New.
	(val_print_scalar_formatted): Check whether the value is
	available.
	* python/py-prettyprint.c (apply_val_pretty_printer): Refuse
	pretty-printing unavailable values.
2011-02-14 11:10:53 +00:00
gdbadmin 911684cfb7 *** empty log message *** 2011-02-14 00:00:02 +00:00
Jan Kratochvil bc9a5551ca gdb/
Fix const/volatile qualifiers of C++ types, PR c++/12328.
	* c-typeprint.c (c_type_print_args): Update the function comment.  New
	variable param_type, initialize it.  Remove const/volatile qualifiers
	for language_cplus and !show_artificial.  Use param_type.

gdb/testsuite/
	Fix const/volatile qualifiers of C++ types, PR c++/12328.
	* gdb.cp/overload-const.exp: New file.
	* gdb.cp/overload-const.cc: New file.
2011-02-13 09:15:54 +00:00
Jan Kratochvil 93b55aa198 gdb/
* symtab.c (find_pc_sect_line): New variable objfile, initialize it
	from S.  Iterate S using ALL_OBJFILE_SYMTABS.  Verify BV for each S.
	* symtab.h (struct symtab) <next>: Comment extension.
2011-02-13 09:09:36 +00:00
gdbadmin f865a34fb9 *** empty log message *** 2011-02-13 00:00:32 +00:00
Yao Qi 181d9476d8 2011-02-12 Yao Qi <yao@codesourcery.com>
* Makefile.in (CLEANDIRS): Remove duplicated common dir.
2011-02-12 13:07:39 +00:00
Yao Qi d40a55942b 2011-02-11 Yao Qi <yao@codesourcery.com>
* Makefile.in: Add copyright header.
2011-02-12 02:57:01 +00:00
gdbadmin fce1433dcd *** empty log message *** 2011-02-12 00:00:03 +00:00
Pedro Alves c5187ac67b * infrun.c (proceed): Move switching out and in of tfind mode from
here ...
	(fetch_inferior_event): ... to here.
2011-02-11 15:07:50 +00:00
Yao Qi 4f3e6fb7a0 2011-02-11 Yao Qi <yao@codesourcery.com>
* Makefile.in: Remove signals.o from COMMON_OBS.  Link
	libcommon.a.
	* configure.ac: Add common to sub dir.
	* configure: Regenerate.

common/
2011-02-11  Yao Qi  <yao@codesourcery.com>

	Build libcommon.a.

	* Makefile.in: New.
	* configure.ac: New.
	* aclocal.m4: New.
	* configure: Generate.

gdbserver/
2011-02-11  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Call AC_PROG_RANLIB.
	* Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
	* configure: Regenerate.
2011-02-11 09:57:25 +00:00
gdbadmin 00a9652c1b *** empty log message *** 2011-02-11 00:00:33 +00:00
Pedro Alves fc01361832 Fix whitespace. 2011-02-10 18:40:22 +00:00
Pedro Alves 2287cc7e0e * vec.h (VEC_block_remove): Place VEC_ASSERT_INFO on the right
side of the parenthesis.

	Merge from GCC:
	2010-07-13  Jakub Jelinek  <jakub@redhat.com>
        * vec.h (VEC_block_remove): Fix comment.
2011-02-10 18:31:28 +00:00
gdbadmin bf8b9e1e88 *** empty log message *** 2011-02-10 00:00:03 +00:00
gdbadmin 4fdf02beb7 *** empty log message *** 2011-02-09 00:00:33 +00:00
Michael Snyder fd62cb89c5 2011-02-08 Michael Snyder <msnyder@vmware.com>
* linux-nat.c (linux_nat_filter_event): Fix typo in comment.
2011-02-08 22:35:57 +00:00
Jan Kratochvil 56d2815c98 gdb/
* i386-tdep.c (i386_process_record): Rename l suffixes to d suffixes
	in comments for pcmpgtd, pcmpeqd, psubd, paddd, pcmpgtd, pcmpeqd,
	psubd and paddd.
2011-02-08 14:01:47 +00:00
Jan Kratochvil 4f7d61a85a gdb/
PR 12361.
	* i386-tdep.c (i386_process_record) <0x660f3807>: Fix the comment to
	phsubsw.
	(i386_process_record) <lddqu>: Fix the opcode to 0xf20ff0.
	(i386_process_record) <0x0f3807>: Fix the comment to phsubsw.
2011-02-08 13:58:02 +00:00
Ulrich Weigand 54fcddd0ac include/ChangeLog:
* dwarf2.h (enum dwarf_calling_convention): Add DW_CC_GDB_IBM_OpenCL.

gdb/ChangeLog:

	* dwarf2read.c (read_subroutine_type): Set special calling
	convention flag for functions compiled by IBM XL C for OpenCL.
	* ppc-sysv-tdep.c: Include "dwarf2.h"
	(ppc_sysv_abi_push_dummy_call): Implement IBM OpenCL vector types
	calling convention.
	(do_ppc_sysv_return_value): Add FUNC_TYPE argument.  Implement
	IBM OpenCL vector types calling convention.
	(ppc_sysv_abi_return_value): Pass through FUNC_TYPE.
	(ppc_sysv_abi_broken_return_value): Likewise.
	(ppc64_sysv_abi_push_dummy_call): Implement IBM OpenCL vector
	types calling convention.
	(ppc64_sysv_abi_return_value): Likewise.
	* spu-tdep.c: Include "dwarf2.h"
	(spu_return_value): Implement IBM OpenCL vector types calling
	convention.

gdb/testsuite/ChangeLog:

	* gdb.opencl/callfuncs.cl: New file.
	* gdb.opencl/callfuncs.exp: New test.
	* gdb.opencl/Makefile.in (EXECUTABLES): Add callfuncs.
2011-02-08 13:30:10 +00:00
Ulrich Weigand d6dafb7c8e ChangeLog:
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Implement
	correct ABI for AltiVec vector arguments.

testsuite/ChangeLog:

	* gdb.arch/altivec-abi.c (vec_func): Make use of intv_on_stack_f
	when computing result.
	* gdb.arch/altivec-abi.exp: Update expected results.
2011-02-08 13:25:01 +00:00
gdbadmin dd1910a2e2 *** empty log message *** 2011-02-08 00:00:33 +00:00
Pedro Alves 32b72a4208 * valprint.c (val_print): Extend comment.
* ada-valprint.c (ada_valprint): Rewrite comment deferring
	interface explanation to val_print.
	(ada_val_print_array): Adjust comment to current interface.
	(print_field_values): Adjust comment to current interface.
	* c-valprint.c (c_val_print): Rewrite comment deferring interface
	explanation to val_print.
	* f-valprint.c (f_val_print): Ditto.
	* jv-valprint.c (java_val_print): Ditto.
	* m2-valprint.c (m2_val_print): Ditto.
	* p-valprint.c (pascal_val_print): Ditto.
2011-02-07 17:49:32 +00:00
Thiago Jung Bauermann a449c2d800 * gdb.base/break-interp.exp: Remove ${objdir} from test messages.
* gdb.base/jit.exp: Likewise.
	* gdb.base/pie-execl.exp: Likewise.
	* gdb.base/solib-nodir.exp: Likewise.
	* gdb.base/solib-overlap.exp: Likewise.
2011-02-07 13:35:42 +00:00
Thiago Jung Bauermann 9998af43c6 * breakpoint.c (parse_breakpoint_sals): Fix description. 2011-02-07 13:30:33 +00:00
Pedro Alves 764880b7ed gdb/server/
* server.c (gdb_read_memory): Change return semantics to allow
	partial transfers.
	(handle_search_memory_1): Adjust.
	(process_serial_event) <'m' packet>: Handle partial transfers.
	* tracepoint.c (traceframe_read_mem): Handle partial transfers.

	gdb/testsuite/
	* gdb.trace/collection.c (global_pieces): New.
	* gdb.trace/collection.exp (gdb_collect_global_in_pieces_test):
	New procedure.
	(gdb_trace_collection_test): Call it.
2011-02-07 12:14:14 +00:00
gdbadmin 66ab83dd8a *** empty log message *** 2011-02-07 00:00:33 +00:00
gdbadmin 82e9c0cf2b *** empty log message *** 2011-02-06 00:00:33 +00:00
Hui Zhu c17a9e4688 Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00
gdbadmin 4d0fd3f682 *** empty log message *** 2011-02-05 00:00:03 +00:00