Commit Graph

27879 Commits

Author SHA1 Message Date
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
Sami Wagiaalla 505500db28 Add Python support for GDB events.
2011-02-04  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.python/py-evthreads.c: New file.
	* gdb.python/py-evthreads.exp: New file.
	* gdb.python/py-events.py: New file.
	* gdb.python/py-events.exp: New file.
	* gdb.python/py-events.c: New file.

2011-02-04  Sami Wagiaalla  <swagiaal@redhat.com>
                Oguz Kayral <oguzkayral@gmail.com>

	* python/py-inferior.c (python_on_normal_stop): New function.
	(python_on_resume): New function.
	(python_inferior_exit): New function.
	(gdbpy_initialize_inferior): Add normal_stop, target_resumed, and
	inferior_exit observers.
	* python/py-evtregistry.c: New file.
	* python/py-threadevent.c : New file.
	* python/py-event.c: New file.
	* python/py-evts.c: New file.
	* python/py-continueevent.c: New file.
	* python/py-bpevent.c: New file.
	* python/py-signalevent.c: New file.
	* python/py-exetiedevent.c: New file.
	* python/py-breakpoint.c (gdbpy_breakpoint_from_bpstats): New function.
	Move struct breakpoint_object from here...
	* python/python-internal.h: ... to here.
	* python/py-event.h: New file.
	* python/py-events.h: New file.
	* Makefile.in (SUBDIR_PYTHON_OBS): Add py-breakpointstopevent.o,
	py-continueevent.o, py-event.o, py-eventregistry.o, py-events.o,
	py-exitedevent.o, py-signalstopevent.o, and py-stopevent.o.
	(SUBDIR_PYTHON_SRCS): Add py-breakpointstopevent.c,
	py-continueevent.c, py-event.c, py-eventregistry.c, py-events.c,
	py-exitedevent.c, py-signalstopevent.c, and py-stopevent.c.
	Add build rules for all the above.
2011-02-04 21:54:16 +00:00
Tom Tromey 9e0ac56407 * dwarf2read.c (dwarf2_section_empty_p): New function.
(dwarf2_read_section): Use dwarf2_section_empty_p.
	(dwarf2_section_size): New function.
	(dwarf2_get_section_info): Unconditionally read section.
	(dwarf2_read_index): Use dwarf2_section_empty_p.
	(partial_read_comp_unit_head): Use dwarf2_section_size.
	(dwarf2_symbol_mark_computed): Likewise.
2011-02-04 20:33:09 +00:00
Pedro Alves cef35b0f37 * gdbint.texinfo (Formatting): Mention some formatting guidelines
for casts and unary operators.
2011-02-04 19:10:12 +00:00
David Daney eee5b35e00 2011-02-04 David Daney <ddaney@caviumnetworks.com>
* NEWS: Add item for "catch syscall" on mips*-linux* targets.
2011-02-04 18:45:15 +00:00
Tom Tromey f1cbe1d302 * gdb.texinfo (GDB/MI Async Records): Document that symbols-loaded
is not useful.
2011-02-04 18:35:04 +00:00
David Daney 385203ed4d gdb/
2011-02-04 David Daney <ddaney@caviumnetworks.com>

	* mips-linux-tdep.c: Include xml-syscall.h.
	(mips_linux_get_syscall_number): New function.
	(mips_linux_init_abi): Add calls to
	mips_linux_get_syscall_number() and set_xml_syscall_file_name().
	* data-directory/Makefile.in (SYSCALLS_FILES): Add
	mips-o32-linux.xml, mips-n32-linux.xml and mips-n64-linux.xml
	* syscalls/mips-n32-linux.xml: New file.
	* syscalls/mips-n64-linux.xml: New file.
	* syscalls/mips-o32-linux.xml: New file.
gdb/testsuite/
2011-02-04 David Daney <ddaney@caviumnetworks.com>

	* gdb.base/catch-syscall.exp: Enable for mips*-linux*.
2011-02-04 18:34:43 +00:00
Ulrich Weigand 9277c30c29 * dwarf2read.c (dwarf2_ranges_read): Skip empty range entries.
Complain about inverted range entries.
	(dwarf2_record_block_ranges): Likewise.
2011-02-04 18:13:25 +00:00
Thiago Jung Bauermann a3be78903d Fix some typos.
* breakpoint.c (update_watchpoint): Fix name of the
	update_global_location_list function.
	(print_one_breakpoint): Fix typo.
	(_initialize_breakpoint): Remove extra space in hbreak help
	string.
	* breakpoint.h (struct bp_location) <length>: Fix field
	description.
2011-02-04 17:27:19 +00:00
Pedro Alves 041274d86d * regcache.c (registers_changed_ptid): Don't explictly always
clear `current_regcache'.  Only clear current_thread_ptid and
	current_thread_arch when PTID matches.  Only reinit the frame
	cache if PTID matches the current inferior_ptid.  Move alloca(0)
	call to ...
	(registers_changed): ... here.
2011-02-04 15:46:49 +00:00
gdbadmin fcc82f68c5 *** empty log message *** 2011-02-04 00:00:32 +00:00
Ulrich Weigand c1c2ab58e4 * arm-tdep.c (arm_skip_stack_protector): Accept any symbol that
starts with __stack_chk_guard as stack guard symbol.
2011-02-03 18:34:55 +00:00
Andrew Burgess 9011945e46 http://sourceware.org/ml/gdb-patches/2010-12/msg00300.html
Improve the ordering of line table entries when dealing with the end
of sequence markers.  This will allow us to disassemble over the border
between two compile units while also displaying source code information.
2011-02-03 14:45:37 +00:00
gdbadmin 876c33db72 *** empty log message *** 2011-02-03 00:00:32 +00:00
Ulrich Weigand e0634ccfe8 * arm-tdep.c (skip_prologue_function): Add GDBARCH and IS_THUMB
arguments.  Skip in-prologue calls to glibc __aeabi_read_tp
	implementation even if no symbols are available.
	(thumb_analyze_prologue): Update call to skip_prologue_function.
	(arm_analyze_prologue): Likewise.
2011-02-02 19:45:32 +00:00
Ulrich Weigand 0e9e9abd6f * arm-tdep.c: Include "observer.h".
(arm_prologue_this_id): Use frame PC if get_frame_func returns 0.
	(arm_exidx_data_key): New static variable.
	(struct arm_exidx_entry, arm_exidx_entry_s): New data types.
	(struct arm_exidx_data): Likewise.
	(arm_exidx_data_free): New function.
	(arm_compare_exidx_entries): Likewise.
	(arm_obj_section_from_vma): Likewise.
	(arm_exidx_new_objfile): Likewise.
	(arm_find_exidx_entry): Likewise.
	(arm_exidx_fill_cache): Likewise.
	(arm_exidx_unwind_sniffer): Likewise.
	(arm_exidx_unwind): New global variable.
	(arm_gdbarch_init): Append unwinder arm_exidx_unwind.
	(_initialize_arm_tdep): Attach arm_exidx_new_objfile to new_objfile
	observer.  Register arm_exidx_data_key as objfile data.
2011-02-02 19:44:44 +00:00
Ulrich Weigand 2e9e421ffe * arm-tdep.c (arm_analyze_load_stack_chk_guard): Avoid build break
due to accessing uninitialized variable.  Fix indentation.
2011-02-02 18:03:35 +00:00
Pedro Alves 580688f393 gdb/
* c-valprint.c (c_value_print): When doing virtual base pointer
	adjustment, create a new value with adjusted contents rather than
	changing the contents of the value being printed (and getting it
	wrong).

	gdb/testsuite/
	* gdb.cp/virtbase.cc (VirtualBase, VirtualMiddleA, VirtualMiddleB)
	(Virtual): New structs.
	(virtual_o, virtual_middle_b): New globals.
	* gdb.cp/virtbase.exp: New tests.
2011-02-02 17:41:54 +00:00
Pedro Alves 3d2c1d41d4 * xml-support.c (xml_find_attribute): New.
(xinclude_start_include): Use it.
	* xml-support.h (xml_find_attribute): Declare.
	* memory-map.c (memory_map_start_memory)
	(memory_map_start_property): Use xml_find_attribute.
	* osdata.c (osdata_start_osdata, osdata_start_column): Use
	xml_find_attribute.
	* remote.c (start_thread): Use xml_find_attribute.
	* solib-target.c (library_list_start_segment)
	(library_list_start_section, library_list_start_library)
	(library_list_start_list): Use xml_find_attribute.
	* xml-tdesc.c (tdesc_start_target, tdesc_start_feature)
	(tdesc_start_union, tdesc_start_struct, tdesc_start_flags)
	(tdesc_start_field): Use xml_find_attribute.
2011-02-02 16:12:59 +00:00
Ulrich Weigand 0af3e2db57 * opencl-lang.c (STRINGIFY): Rename to OCL_STRING.
(BUILD_OCL_VTYPES): Update.
2011-02-02 13:47:06 +00:00
Joel Brobecker c1039e3cb7 fix gdb+python build failure if using non-GNU sed
Non-GNU sed do not like the '?' quantifier when used in a s/// regexp
that involve back-references, causing the build to fail when trying
to link with Python support. This fixes it by using the '*' quantifier
instead.

gdb/ChangeLog:

 	* configure.ac: Work around non-GNU sed limitation when computing
 	python version number.
 	* configure: Regenerate.
2011-02-02 04:36:21 +00:00
gdbadmin 73b45f0445 *** empty log message *** 2011-02-02 00:00:03 +00:00
Jan Kratochvil 600ea1bed9 gdb/
Fix debug printing of TYPE_INSTANCE.
	* expprint.c (print_subexp_standard) <TYPE_INSTANCE>: New.
	(dump_subexp_body_standard) <TYPE_INSTANCE>: New.
2011-02-01 18:56:34 +00:00
Jan Kratochvil 56c1241406 gdb/
Fix debug printing of BINOP_IN, OP_OBJC_MSGCALL,
	OP_F77_UNDETERMINED_ARGLIST, OP_COMPLEX, OP_OBJC_SELECTOR, OP_NAME,
	OP_OBJC_NSSTRING, OP_F90_RANGE and OP_DECFLOAT.
	* ada-operator.inc: Rename the file to ...
	* ada-operator.def: ... here, wrap all the entries by macro OP.
	* expprint.c (op_name_standard): Remove all the entries.  Include
	"std-operator.def" instead.
	* expression.h (enum exp_opcode): Include "std-operator.def" and
	"ada-operator.def".  Move all the entries ...
	* std-operator.def: ... here, wrap all the entries by macro OP.
2011-02-01 18:54:01 +00:00
gdbadmin 9c3b1b2d16 *** empty log message *** 2011-02-01 00:00:03 +00:00
Paul Pluzhnikov d3f0f85341 2011-01-31 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.base/jit.exp: New file.
	* gdb.base/jit-main.c: New file.
	* gdb.base/jit-solib.c: New file.
2011-01-31 21:44:52 +00:00
Paul Pluzhnikov c52b559d66 2011-01-31 Paul Pluzhnikov <ppluzhnikov@google.com>
* breakpoint.h (remove_jit_event_breakpoints): New prototype.
	* breakpoint.c (remove_jit_event_breakpoints): New function.
	* jit.c (jit_descriptor_addr): Delete.
	(registering_code): Delete.
	(clear_int): Delete.
	(jit_inferior_data): New variable.
	(struct jit_inferior_data): New type.
	(get_jit_inferior_data): New function.
	(jit_inferior_data_cleanup): New function.
	(jit_read_descriptor): Adjust.
	(jit_register_code): Adjust.
	(jit_breakpoint_re_set_internal): New function; move code here ...
	(jit_inferior_init): ... from here.
	(jit_breakpoint_re_set): Adjust.
	(jit_reset_inferior_data_and_breakpoints): New function.
	(jit_inferior_created_observer): Adjust.
	(jit_inferior_exit_hook): Adjust.
	(jit_executable_changed_observer): New function.
	(jit_event_handler): Adjust.
	(_initialize_jit): Adjust.
2011-01-31 21:43:12 +00:00
Paul Pluzhnikov 03673fc718 2011-01-31 Paul Pluzhnikov <ppluzhnikov@google.com>
* breakpoint.h (remove_jit_event_breakpoints): New prototype.
	* breakpoint.c (remove_jit_event_breakpoints): New function.
	* jit.c (jit_descriptor_addr): Delete.
	(registering_code): Delete.
	(clear_int): Delete.
	(jit_inferior_data): New variable.
	(struct jit_inferior_data): New type.
	(get_jit_inferior_data): New function.
	(jit_inferior_data_cleanup): New function.
	(jit_read_descriptor): Adjust.
	(jit_register_code): Adjust.
	(jit_breakpoint_re_set_internal): New function; move code here ...
	(jit_inferior_init): ... from here.
	(jit_breakpoint_re_set): Adjust.
	(jit_reset_inferior_data_and_breakpoints): New function.
	(jit_inferior_created_observer): Adjust.
	(jit_inferior_exit_hook): Adjust.
	(jit_executable_changed_observer): New function.
	(jit_event_handler): Adjust.
	(_initialize_jit): Adjust.
2011-01-31 21:37:01 +00:00
Michael Snyder e839132de9 2011-01-31 Michael Snyder <msnyder@vmware.com>
* m32r-tdep.c (m32r_gdbarch_init): Replace accidentally deleted
	line.
2011-01-31 20:21:02 +00:00
Ulrich Weigand b2030fb51f * gdb.opencl/convs_casts.exp: Use tbreak instead of break to
proceed to initial kernel entry point.
	* gdb.opencl/datatypes.exp: Likewise.
	* gdb.opencl/operators.exp: Likewise.
	* gdb.opencl/vec_comps.exp: Likewise.
2011-01-31 19:05:23 +00:00
Sami Wagiaalla 2db19d1e4d Added new namespace tests.
2011-01-31  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/nsnested.cc: New.
	* gdb.cp/nsnested.exp: New.
	* gdb.cp/nsnoimports.exp: New.
	* gdb.cp/nsnoimports.cc: New.
2011-01-31 18:29:02 +00:00
Tom Tromey 47a80e9093 PR python/12216:
* python/python.c (execute_gdb_command): Call
	prevent_dont_repeat.
	* top.c (suppress_dont_repeat): New global.
	(dont_repeat): Use it.
	(prevent_dont_repeat): New function.
	* command.h (prevent_dont_repeat): Declare.
2011-01-31 16:52:35 +00:00
Tom Tromey 45a4356715 * infcmd.c (finish_backward): Use breakpoint_set_silent.
* python/py-breakpoint.c (bppy_set_silent): Use
	breakpoint_set_silent.
	(bppy_set_thread): Use breakpoint_set_thread.
	(bppy_set_task): Use breakpoint_set_task.
	* breakpoint.h (breakpoint_set_silent, breakpoint_set_thread)
	(breakpoint_set_task): Declare.
	(make_breakpoint_silent): Remove.
	* breakpoint.c (breakpoint_set_silent): New function.
	(breakpoint_set_thread): Likewise.
	(breakpoint_set_task): Likewise.
	(make_breakpoint_silent): Remove.
2011-01-31 15:16:59 +00:00
Tom Tromey 09d682a4f3 * breakpoint.h (user_breakpoint_p): Declare.
* breakpoint.c (user_breakpoint_p): New function.
	(breakpoint_1): Use it.
	(save_breakpoints): Likewise.
2011-01-31 15:07:49 +00:00
Joel Brobecker 9c4ea6c5a9 allow building GDB with Python support on MinGW
This makes several adjustements to the configure python-config.py
scripts to deal with the differences between a Unix install of Python
and a Windows install of Python (as downloaded from the Python website).

Differences:

  - The Python executable is directly in the python prefix directory
    as opposed to inside the bin/ subdirectory.

  - The name of the python library is does not have a dot in the version
    number: On Unix, we have libpython2.7, while on Windows, it's
    libpython27.  So the regexp extracting the python version from
    the Python lib filename had to be adjusted slightly.

    Also, the tests checking the name of the libpython had to be
    adjusted to allow for that.

  - There are no link options following the -lpython<version> switch
    on Windows, but the regexp extracting the python version was
    using it as a delimiter.  It had to be removed.

  - python-config.py does not work on Windows, mostly because
    some sysconfig variables are missing.  They are not necessary
    so the script was adapted to skip them if not defined.

  - The paths returned by python-config.py follow the Windows filename
    convention in terms of the directory separator, and this is causing
    trouble when the build environment is cygwin (while the compiler
    and Python are MinGW).  We could have fixed that in the configure
    script, but it felt simpler to do so in python-config.py

gdb/ChangeLog:

        * configure.ac: Add handling of Python distribution on Windows.
        * python-config.py: If the LIBS, SYSLIBS, LIBPL and/or LINKFORSHARED
        sysconfig variables are not defined, then do not use them.
        On Windows, if LIBPL is not defined, then use prefix + '/libs'
        instead.  On Windows, return all paths using forward-slashes
        rather than backslashes.
2011-01-31 04:42:08 +00:00
Joel Brobecker ac534cba29 do not use python<version> subdir when including Python .h file
This is preparation work for being able to build GDB with Python
support on MinGW.

So far, the "python<version>" subdirectory needs to be specified
when including a Python header file.  In order to do that, we have
some special configury that tweaks the include path returned by
python-config.py such that the use of the subdirectory in the include
is necessary.  This was done in order to protect ourselves from
possible filename conflicts, since some of the filenames chosen by
Python were a little generic.

The problem is that this cannot work with a standard Python install
on MinGW systems.  On such systems, the .h files are located in
<python_prefix>/include.  So, in preparation for allowing us to build
GDB on MinGW with Python support enabled, this patch changes the
requirement to provide the "python<version>" subdirectory in the
include directive.

The positive consequence is that we no longer need to have a set
of #include directives for each version of Python, since the include
directive is now the same for all versions of Python.  However, the
downside is that we are losing the level of protection we were trying
to achieve by forcing the subdirectory in the include directive.
In order to reduce a bit the consequences of a possible conflict,
this patch also changes the location where the -I/path/to/python
switch goes, to be last in the list (suggested by Doug Evans).

One last change is the fact that we are now including Python.h
and all other Python include headers using angle brackets rather
than double-quotes.  This fixes a problem on case-insensitive
systems where #include "Python.h" causes our gdb/python/python.h
header to be included instead of Python's <Python.h> header.

gdb/ChangeLog:

	* configure.ac: Remove fallback behavior for building
	against Python.  Remove tweaking of Python include path.
	Add PYTHON_CPPFLAGS and PYTHON_LIBS substitution.
	(AC_TRY_LIBPYTHON):  Adjust program used in linking test.
	If link is successful, set PYTHON_CPPFLAGS and PYTHON_LIBS.
	Always restore CPPFLAGS and LIBS after linking test.
	* configure: Regenerated.
	* Makefile.in (INTERNAL_CPPFLAGS): Add @PYTHON_CPPFLAGS@.
	(INSTALLED_LIBS, CLIBS): Add @PYTHON_LIBS@.
	* python/python-internal.h: Adjust includes of Python .h files.
2011-01-31 04:41:27 +00:00
Joel Brobecker c2f0d045af Add missing i18n markup in tracepoint.c:traceframe_walk_blocks
gdb/ChangeLog:

 	* tracepoint.c (traceframe_walk_blocks): Add missing i18n markup
 	in error message.
2011-01-31 03:12:06 +00:00
Joel Brobecker 6b0c4c1f05 fix typo during interactive_mode check in gdb_has_a_terminal
Discovered by Pierre Muller.

gdb/ChangeLog:

        * inflow.c (gdb_has_a_terminal): Fix typo in interactive_mode
        value test.

gdb/testsuite/ChangeLog:

        * gdb.base/interact.exp: Add extra tests that verify that
        the value of the interactive-mode setting does not change
        after the script is sourced.
2011-01-31 03:11:40 +00:00
gdbadmin f4b54baf38 *** empty log message *** 2011-01-31 00:00:02 +00:00
Yao Qi 672c979515 2011-01-31 Yao Qi <yao@codesourcery.com>
* arm-linux-nat.c: Update calls to regcache_register_status
	instead of regcache_valid_p.
	* aix-thread.c: Likewise.
	* i386gnu-nat.c: Likewise.
2011-01-30 23:16:33 +00:00
gdbadmin 9ed0894745 *** empty log message *** 2011-01-30 00:00:03 +00:00
Jan Kratochvil 80b23b6aeb gdb/
Fix crash.
	* valops.c (compare_parameters): Verify TYPE_NFIELDS before
	touching TYPE_FIELD_ARTIFICIAL.

gdb/testsuite/
	* gdb.cp/noparam.exp: New file.
	* gdb.cp/noparam.cc: New file.
2011-01-29 10:30:20 +00:00
gdbadmin 21355e73e3 *** empty log message *** 2011-01-29 00:00:03 +00:00
Richard Earnshaw 4cd712bdad * MAINTAINERS: Move myself from Responsible Maintainers to Authorized
Committers.
2011-01-28 16:32:26 +00:00
Pedro Alves ffd5ec2486 gdb/
* tracepoint.c (tfile_xfer_partial): If there's no traceframe
	selected, don't try iterating over the traceframe's blocks.
	(tfile_has_stack): If there's no traceframe selected, then there's
	no stack.
	(tfile_has_registers): If there's no traceframe selected, then
	there's no registers.

	gdb/testsuite/
	* gdb.trace/tfile.exp: Test that with no traceframe selected,
	there's no stack or registers.
2011-01-28 16:18:55 +00:00
Pedro Alves e8c9e0a18f gdb/
* target.c (memory_xfer_partial): No need to restore shadows if we
	haven't read anything.
2011-01-28 16:00:16 +00:00
Pedro Alves de15c4ab2d gdb/
* mips-tdep.c (mips_print_register): Use get_frame_register_value
	and val_print_scalar_formatted.
2011-01-28 15:42:01 +00:00
Pedro Alves 1c79eb8a7d gdb/gdbserver/
* regcache.c (init_register_cache): Initialize
	regcache->register_status.
	(free_register_cache): Release regcache->register_status.
	(regcache_cpy): Copy register_status.
	(registers_to_string): Print 'x's for unavailable registers.
	(supply_register): Mark the register's status valid or
	unavailable, depending on whether a buffer was passed in or not.
	(supply_register_zeroed): New.
	(supply_regblock): Mark the registers' status valid or
	unavailable, depending on whether a buffer was passed in or not.
	* regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
	(struct regcache): New `register_status' field.
	(supply_register_zeroed): Declare.
	* i387-fp.c (i387_xsave_to_cache): Zero out registers using
	supply_register_zeroed, rather than passing a NULL buffer to
	supply_register.
	* tracepoint.c (fetch_traceframe_registers): Update comment.
2011-01-28 13:36:32 +00:00
Pedro Alves 85724a0e60 2011-01-28 Pedro Alves <pedro@codesourcery.com>
* i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
	buffer explicit.
2011-01-28 12:58:00 +00:00
gdbadmin 0fda7d1689 *** empty log message *** 2011-01-28 00:00:33 +00:00
Pedro Alves 9f41c73181 gdb/
* tracepoint.c (tfile_read): New.
	(tfile_open): Use it.
	(tfile_get_traceframe_address): Use it.
	(tfile_trace_find): Use it.
	(walk_blocks_callback_func): New typedef.
	(match_blocktype): New function.
	(traceframe_walk_blocks): New function.
	(traceframe_find_block_type): New function.
	(tfile_fetch_registers, tfile_xfer_partial)
	(tfile_get_trace_state_variable_value): Use
	traceframe_find_block_type and tfile_read.
2011-01-27 21:39:24 +00:00
gdbadmin 7d71f58245 *** empty log message *** 2011-01-27 00:00:05 +00:00
Kevin Buettner cdefc55df3 * remote-mips.c: Add internationalization mark ups. Remove
trailing \n from already marked up strings.
2011-01-26 23:13:22 +00:00
Tom Tromey a81766d88f gdb
* python/py-prettyprint.c (print_string_repr): Clear
	'addressprint' option when calling val_print_string.
	(print_children): Handle Val_pretty_default.  Clear 'addressprint'
	option when calling val_print_string.
gdb/testsuite
	* gdb.python/py-prettyprint.exp (run_lang_tests): Ensure no blank
	space before string output.  Add test for "set print pretty off"
	case.
2011-01-26 20:58:49 +00:00
Tom Tromey 74aedc4602 * python/python.c (gdbpy_solib_name): Use gdb_py_longest and
GDB_PY_LL_ARG.
	* python/python-internal.h (GDB_PY_LL_ARG, GDB_PY_LLU_ARG): New
	macros.
	(gdb_py_longest, gdb_py_ulongest): New typedefs.
	(gdb_py_long_from_longest, gdb_py_long_from_ulongest)
	(gdb_py_long_as_ulongest): New defines.
	(gdb_py_object_from_longest, gdb_py_object_from_ulongest)
	(gdb_py_int_as_long): Declare.
	* python/py-value.c (valpy_lazy_string): Use gdb_py_longest,
	GDB_PY_LL_ARG, gdb_py_object_from_longest.
	(valpy_long): Add comment.
	* python/py-utils.c (get_addr_from_python): Use
	gdb_py_long_as_ulongest.  Handle overflow properly.
	(gdb_py_object_from_longest): New function.
	(gdb_py_object_from_ulongest): Likewise.
	(gdb_py_int_as_long): Likewise.
	* python/py-type.c (typy_array): Use gdb_py_int_as_long.
	* python/py-symtab.c (salpy_get_pc): Use
	gdb_py_long_from_ulongest.
	(salpy_get_line): Use PyInt_FromLong.
	* python/py-param.c (set_parameter_value): Use
	gdb_py_int_as_long.
	* python/py-lazy-string.c (stpy_get_address): Use
	gdb_py_long_from_ulongest.
	* python/py-frame.c (frapy_pc): Use gdb_py_long_from_ulongest.
	* python/py-cmd.c (cmdpy_completer): Use gdb_py_int_as_long.
	* python/py-breakpoint.c (bppy_set_thread): Use
	gdb_py_int_as_long.
	(bppy_set_task): Likewise.
	(bppy_set_ignore_count): Likewise.
	(bppy_set_hit_count): Likewise.
	* python/py-block.c (blpy_get_start): Use
	gdb_py_object_from_ulongest.
	(blpy_get_end): Likewise.
	(gdbpy_block_for_pc): Use gdb_py_ulongest and GDB_PY_LLU_ARG.
2011-01-26 20:53:45 +00:00
Thiago Jung Bauermann e4f6d2ecc4 2011-01-25 Mathieu Lacage <mathieu.lacage@inria.fr>
PR/symtab 11766:
	* gdb/objfiles.h (struct objfile) <addr_low>: New field.
	* gdb/solib.c (solib_read_symbols): Check for addr_low in
	equality test for objfile, initialize addr_low if needed.
2011-01-26 01:55:19 +00:00
gdbadmin f829b0eccc *** empty log message *** 2011-01-26 00:00:02 +00:00
Pedro Alves b30aa27843 * tui/tui-regs.c (tui_register_format): Remove dead code. 2011-01-25 18:18:15 +00:00
Pedro Alves ab2188aa2a * printcmd.c (print_formatted): Use val_print_scalar_formatted
instead of print_scalar_formatted.
	(print_scalar_formatted): Don't handle 's' format strings here,
	and add an assertion that we never see such format here.
	* valprint.h (val_print_scalar_formatted): Declare.
	* valprint.c (val_print_scalar_formatted): New.
	* c-valprint.c (c_val_print): Use val_print_scalar_formatted
	instead of print_scalar_formatted.
	* jv-valprint.c (java_val_print): Ditto.
	* p-valprint.c (pascal_val_print): Ditto.
	* ada-valprint.c (ada_val_print_1): Ditto.
	* f-valprint.c (f_val_print): Ditto.
	* infcmd.c (registers_info): Ditto.
	* m2-valprint.c (m2_val_print): Ditto.
2011-01-25 17:59:00 +00:00
Pedro Alves 66d61a4cab * m2-valprint.c (print_unbounded_array): Pass
value_contents_for_printing rather than value_contents, to
	m2_print_array_contents.  Also pass in the value.
2011-01-25 17:43:29 +00:00
Jan Kratochvil 831adc1f7d gdb/
* dwarf2read.c (dwarf2_read_index, write_psymtabs_to_index)
	(save_gdb_index_command): Switch to .gdb_index version 4.
2011-01-25 17:25:12 +00:00
Pedro Alves 2062226976 * mi/mi-main.c (get_register): Use get_frame_register_value rather
than frame_register, and always pass a valid value to val_print.
2011-01-25 17:00:27 +00:00
Pedro Alves 585fdaa106 Centralize printing "<optimized out>".
gdb/
	* valprint.h (val_print_optimized_out): Declare.
	* cp-valprint.c (cp_print_value_fields): Use
	val_print_optimized_out.
	* jv-valprint.c (java_print_value_fields): Ditto.
	* p-valprint.c (pascal_object_print_value_fields): Ditto.
	* printcmd.c (print_formatted): Ditto.
	* valprint.c (valprint_check_validity): Ditto.
	(value_check_printable): Ditto.
	(val_print_optimized_out): New.

	gdb/doc/
	* gdb.texinfo: s/value optimized out/optimized out/g

	gdb/testsuite/
	* gdb.base/frame-args.exp: Adjust.
	* gdb.dwarf2/dw2-noloc.exp: Adjust.
	* gdb.dwarf2/dw2-inline-param.exp: Adjust.
	* gdb.dwarf2/pieces.exp: Adjust.
	* gdb.opt/clobbered-registers-O2.exp: Adjust.
	* gdb.opt/inline-locals.exp: Adjust.
	* gdb.threads/fork-child-threads.exp: Adjust.
2011-01-25 16:26:23 +00:00
Ken Werner d468832aa5 gdb/testsuite/ChangeLog
2011-01-25  Ken Werner  <ken.werner@de.ibm.com>

        * gdb.opencl/convs_casts.cl: Move program scope variables into the
        OpenCL kernel function. Add a comment as marker. Add address space
        qualifiers for the remaining program scope variables.
        * gdb.opencl/datatypes.cl: Likewise.
        * gdb.opencl/operators.cl: Likewise.
        * gdb.opencl/vec_comps.cl: Likewise.
        * gdb.opencl/convs_casts.exp: Replace gdb_test_multiple by gdb_test.
        Add breakpoint at the marker comment.
        * gdb.opencl/datatypes.exp: Likewise.
        * gdb.opencl/operators.exp: Likewise.
        * gdb.opencl/vec_comps.exp: Likewise.
2011-01-25 16:10:28 +00:00
Pedro Alves 29ec526351 gdb/
* infcmd.c (default_print_registers_info): Allocate values so to
	never pass a NULL value to val_print.
2011-01-25 15:47:58 +00:00
Pedro Alves de4127a3b2 * cp-valprint.c (cp_print_value): Treat the 'skip' local as
boolean.  Make sure to always pass a value that matches the
	contents buffer to callees.  Preserve `address' for following
	iterations.
	* value.c (value_contents_for_printing_const): New.
	(value_address): Constify value argument.
	* value.h (value_contents_for_printing_const): Declare.
	(value_address): Constify value argument.
2011-01-25 15:18:36 +00:00
Pedro Alves ee99023e12 * regcache.c (struct regcache_descr): Rename
sizeof_raw_register_valid_p field to sizeof_raw_register_status,
	and sizeof_cooked_register_valid_p to
	sizeof_cooked_register_status.
	(init_regcache_descr): Adjust.
	(struct regcache): Rename register_valid_p field to
	register_status.
	(regcache_xmalloc_1, regcache_xfree, regcache_save)
	(do_cooked_read): Adjust.
	(regcache_valid_p): Rename to ...
	(regcache_register_status): ... this.  Adjust.
	(regcache_invalidate): Adjust.
	(regcache_raw_read, regcache_cooked_read, regcache_raw_write):
	Adjust.
	(regcache_raw_supply): Adjust.  If buf i NULL, mark the register
	as unavailable, not valid.
	(regcache_dump): Adjust.
	* regcache.h (enum register_status): New.
	(regcache_register_status): Declare.
	(regcache_invalidate): Delete declaration.
	* corelow.c (get_core_registers): Adjust.
	* tracepoint.c (tfile_fetch_registers): Adjust.
	* trad-frame.c (REG_VALUE): Rename to ...
	(TF_REG_VALUE): ... this.
	(REG_UNKNOWN): Rename to ...
	(TF_REG_UNKNOWN): ... this.
	(trad_frame_set_value, trad_frame_set_unknown): Adjust.
	* mi/mi-main.c (register_changed_p): Adjust.
2011-01-25 12:47:25 +00:00
Pedro Alves 99e42fd82a * regcache.c (struct regcache_descr): Remove outdated comment.
(init_regcache_descr): Remove sizeof_raw_register_valid_p
	overallocate hack.
	(regcache_xmalloc): Rename to ...
	(regcache_xmalloc_1): ... this.  Add `readonly_p' parameter.
	Allocate the regcache type accordingly.
	(regcache_xmalloc): New as wrapper around regcache_xmalloc_1.
	(regcache_xfree): Asser the source is also readonly.  Copy sizeof
	cooked registers, not raw.
	(regcache_dup_no_passthrough): Delete.
	(get_thread_arch_regcache): Use regcache_xmalloc_1.
	* h8300-tdep.c (h8300_push_dummy_call): Tweak comment to not
	mention obsolete write_register_bytes.
	* regcache.h (regcache_dup_no_passthrough): Delete declaration.
2011-01-25 12:13:20 +00:00
Pedro Alves f7605bc29f Stop remote_read_bytes from handling partial reads itself.
* remote-fileio.c: Include target.h.
	(remote_fileio_write_bytes): Delete.
	(remote_fileio_func_open, remote_fileio_func_write)
	(remote_fileio_func_rename, remote_fileio_func_unlink): Use
	target_read_memory.
	(remote_fileio_func_stat): Use target_read_memory and
	target_write_memory.
	(remote_fileio_func_gettimeofday): Use target_write_memory.
	(remote_fileio_func_system): Use target_read_memory.
	* remote.c (remote_write_bytes): Make it static.
	(remote_read_bytes): Don't handle partial reads here.
	* remote.h (remote_read_bytes): Delete declaration.
2011-01-25 11:54:00 +00:00
Pedro Alves d08aafeffe 2011-01-25 Pedro Alves <pedro@codesourcery.com>
* server.h (decode_xfer_write): Change prototype.
	* remote-utils.c (decode_xfer_write): Remove `annex' parameter,
	and don't extract the annex here.
	* server.c (decode_xfer_read): Remove `annex' parameter,
	and don't extract the annex here.
	(decode_xfer): New.
	(struct qxfer): New.
	(handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
	(handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
	(handle_qxfer_statictrace): New functions, abstracted out from
	handle_query, and made to use the struct qxfer interface.
	(handle_threads_qxfer_proper): Rename to ...
	(handle_qxfer_threads_proper): ... this.
	(handle_threads_qxfer): Rename to ...
	(handle_qxfer_threads): ... this.  Adjust.
	(qxfer_packets): New array.
	(handle_qxfer): New function.
	(handle_query): Use handle_qxfer.
2011-01-25 10:09:19 +00:00
Pedro Alves efc0eabd60 Simplify XML parsing a bit.
* xml-support.h (gdb_xml_parse_quick): Declare.
	* xml-support.c (gdb_xml_create_parser_and_cleanup_1): Renamed
	from gdb_xml_create_parser_and_cleanup, and added `old_chain'
	parameter.
	(gdb_xml_create_parser_and_cleanup): Reimplement on top of
	gdb_xml_create_parser_and_cleanup_1.
	(gdb_xml_parse_quick): New.
	* memory-map.c (parse_memory_map): Use gdb_xml_parse_quick.
	* osdata.c (osdata_parse): Ditto.
	* remote.c (remote_threads_info): Ditto.
	* solib-target.c (solib_target_parse_libraries): Ditto.
	* xml-syscall.c (syscall_parse_xml): Ditto.
	* xml-tdesc.c (tdesc_parse_xml): Ditto.
2011-01-25 09:49:59 +00:00
gdbadmin 9ad64e945d *** empty log message *** 2011-01-25 00:00:32 +00:00
Kevin Buettner 314d366acd * configure.tgt (mips*-*-elf): New; just like mips*-*-*, but
with remote-mips.o added to gdb_target_obs.
	* Makefile.in (ALL_TARGET_OBS): Add remote-mips.o.
2011-01-24 21:34:19 +00:00
Pedro Alves a491d753e8 * ada-valprint.c (val_print_packed_array_elements): Pass the
correct struct value to val_print.
	(ada_val_print_1): Ditto.
2011-01-24 21:28:12 +00:00
Pedro Alves 490f124f09 2011-01-24 Pedro Alves <pedro@codesourcery.com>
Don't lose embedded_offset in printing routines throughout.

	gdb/
	* valprint.h (val_print_array_elements): Change prototype.
	* valprint.c (val_print_array_elements): Add `embedded_offset'
	parameter, and adjust to pass it down to val_print, while passing
	`valaddr' or `address' unmodified.  Take embedded_offset into
	account when checking repetitions.
	* c-valprint.c (c_val_print): Pass embedded_offset to
	val_print_array_elements instead of adjusting `valaddr' and
	`address'.
	* m2-valprint.c (m2_print_array_contents, m2_val_print): Pass
	embedded_offset to val_print_array_elements instead of adjusting
	`valaddr'.
	* p-lang.h (pascal_object_print_value_fields): Adjust prototype.
	* p-valprint.c (pascal_val_print): Pass embedded_offset to
	val_print_array_elements and pascal_object_print_value_fields
	instead of adjusting `valaddr'.
	(pascal_object_print_value_fields): Add `offset' parameter, and
	adjust to use it.
	(pascal_object_print_value): Add `offset' parameter, and adjust to
	use it.
	(pascal_object_print_static_field): Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	* ada-valprint.c (val_print_packed_array_elements): Add `offset'
	parameter, and adjust to use it.  Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	(ada_val_print): Rename `valaddr0' parameter to `valaddr'.
	(ada_val_print_array): Add `offset' parameter, and adjust to use
	it.
	(ada_val_print_1): Rename `valaddr0' parameter to `valaddr', and
	`embedded_offset' to `offset'.  Don't re-adjust `valaddr'.
	Instead work with offsets.  Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.  Change `defer_val_int' local type to CORE_ADDR,
	and use value_from_pointer to extract a target pointer, rather
	than value_from_longest.
	(print_variant_part): Add `offset' parameter.  Replace
	`outer_valaddr' parameter by a new `outer_offset' parameter.
	Don't re-adjust `valaddr'.  Instead pass down adjusted offsets.
	(ada_value_print): Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	(print_record): Add `offset' parameter, and adjust to pass it
	down.
	(print_field_values): Add `offset' parameter.  Replace
	`outer_valaddr' parameter by a new `outer_offset' parameter.
	Don't re-adjust `valaddr'.  Instead pass down adjusted offsets.
	Use value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	* d-valprint.c (dynamic_array_type): Use
	value_contents_for_printing/value_embedded_offset, rather than
	value_contents.
	* jv-valprint.c (java_print_value_fields): Add `offset' parameter.
	Don't re-adjust `valaddr'.  Instead pass down adjusted offsets.
	(java_print_value_fields): Take `offset' into account.  Don't
	re-adjust `valaddr'.  Instead pass down adjusted offsets.
	(java_val_print): Take `embedded_offset' into account.  Pass it to
	java_print_value_fields.
	* f-valprint.c (f77_print_array_1): Add `embedded_offset'
	parameter.  Don't re-adjust `valaddr' or `address'.  Instead pass
	down adjusted offsets.
	(f77_print_array): Add `embedded_offset' parameter.  Pass it down.
	(f_val_print): Take `embedded_offset' into account.

	gdb/testsuite/
	* gdb.base/printcmds.c (some_struct): New struct and instance.
	* gdb.base/printcmds.exp (test_print_repeats_embedded_array): New
	procedure.
	<global scope>: Call it.
2011-01-24 18:54:17 +00:00
gdbadmin 23b1e6e450 *** empty log message *** 2011-01-24 00:00:03 +00:00
gdbadmin af1e3ccbec *** empty log message *** 2011-01-23 00:00:02 +00:00
gdbadmin bb38e8717f *** empty log message *** 2011-01-22 00:00:02 +00:00
Joel Brobecker 7bfc943420 move handing of "set interactive-mode" to gdb_has_a_terminal
The real purpose of this setting is really to override what the debugger
would otherwise guess from checking the stdin settings.  So it seems
more natural to see this setting being handled inside gdb_has_a_terminal
rather than input_is_terminal (which checks for other things, such as
whether the input is stdin, for instance).

This patch also adjust the command help and the associated section in
the GDB Manual to be a little clearer about that.

gdb/ChangeLog:

        * inflow.c: Include "gdbcmd.h".
        (interactive_mode): New static global, moved here from top.c.
        (show_interactive_mode): New function, moved here from top.c.
        use gdb_has_a_terminal instead of input_from_terminal_p to
        determine the current mode.
        (gdb_has_a_terminal): Add handling of the "iteractive-mode"
        setting.
        (_initialize_inflow): Add the "set/show interactive-mode"
        commands.  Moved here from top.c, after having adjusted slightly
        the help text.
        * top.c (interactive_mode, show_interactive_mode): Delete, moved
        to inflow.c.
        (input_from_terminal_p): Remove handling of "interactive-mode"
        setting, moved to infow.c.
        (init_main): Remove creation of the "set/show interactive-mode"
        commands, moved to inflow.c.

gdb/doc/ChangeLog:

        * gdb.texinfo (Other Misc Settings): Rework part of the
        documentation of the "set interactive mode" command.
2011-01-21 18:56:43 +00:00
Ken Werner 6da78614a3 gdb/testsuite/ChangeLog
2011-01-21  Ken Werner  <ken.werner@de.ibm.com>

        * lib/opencl.exp (skip_opencl_tests): Add missing compile_flags
        argument to the gdb_compile_opencl_hostapp call.
2011-01-21 14:05:51 +00:00
gdbadmin 995ac3ff08 *** empty log message *** 2011-01-21 00:00:33 +00:00
gdbadmin 2f1b715f20 *** empty log message *** 2011-01-20 00:00:32 +00:00
Joel Brobecker 446036530e [NEWS/ia64-hpux] Add entry for native ia64-hpux support
gdb/ChangeLog:

        * NEWS: Add entry for native ia64-hpux support.
2011-01-19 20:41:11 +00:00
Yao Qi ec64c9aa23 2011-01-19 Yao Qi <yao@codesourcery.com>
* lib/dwarf.exp (dwarf2_support): Change supported targets to a
	positve list.
2011-01-19 20:38:41 +00:00
Yao Qi 810cfdbbaf 2011-01-19 Yao Qi <yao@codesourcery.com>
* gdb.asm/asm-source.exp: Replace ARM target triplet with a
	canonical form.
	Remove "xscale-*-*"
	* gdb.xml/tdesc-regs.exp: Likewise.
	* gdb.python/py-section-script.exp: Replace ARM target triplet
	with canonical form.
	Match arm*-*-symbianelf*.
	* gdb.base/dup-sect.exp: Likewise.
	* lib/dwarf.exp: New.
	* gdb.dwarf2/callframecfa.exp: Check dwarf2 support by routine
	dwarf2_support.
	* gdb.dwarf2/dup-psym.exp: Likewise.
	* gdb.dwarf2/dw2-ada-ffffffff.exp: Likewise.
	* gdb.dwarf2/dw2-anonymous-func.exp: Likewise.
	* gdb.dwarf2/dw2-bad-parameter-type.exp: Likewise.
	* gdb.dwarf2/dw2-basic.exp: Likewise.
	* gdb.dwarf2/dw2-compressed.exp: Likewise.
	* gdb.dwarf2/dw2-const.exp: Likewise.
	* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Likewise.
	* gdb.dwarf2/dw2-cu-size.exp: Likewise.
	* gdb.dwarf2/dw2-double-set-die-type.exp: Likewise.
	* gdb.dwarf2/dw2-empty-namespace.exp: Likewise.
	* gdb.dwarf2/dw2-filename.exp: Likewise.
	* gdb.dwarf2/dw2-inheritance.exp: Likewise.
	* gdb.dwarf2/dw2-inline-param.exp: Likewise.
	* gdb.dwarf2/dw2-intercu.exp: Likewise.
	* gdb.dwarf2/dw2-intermix.exp: Likewise.
	* gdb.dwarf2/dw2-modula2-self-type.exp: Likewise.
	* gdb.dwarf2/dw2-noloc.exp: Likewise.
	* gdb.dwarf2/dw2-op-call.exp: Likewise.
	* gdb.dwarf2/dw2-producer.exp: Likewise.
	* gdb.dwarf2/dw2-ranges.exp: Likewise.
	* gdb.dwarf2/dw2-ref-missing-frame.exp: Likewise.
	* gdb.dwarf2/dw2-stack-boundary.exp: Likewise.
	* gdb.dwarf2/dw2-strp.exp: Likewise.
	* gdb.dwarf2/dw2-unresolved.exp: Likewise.
	* gdb.dwarf2/implptr.exp: Likewise.
	* gdb.dwarf2/mac-fileno.exp: Likewise.
	* gdb.dwarf2/member-ptr-forwardref.exp: Likewise.
	* gdb.dwarf2/pieces.exp: Likewise.
	* gdb.dwarf2/pr11465.exp: Likewise.
	* gdb.dwarf2/valop.exp: Likewise.
	* gdb.dwarf2/watch-notconst.exp: Likewise.
	* gdb.mi/dw2-ref-missing-frame.exp: Likewise.
2011-01-19 20:26:10 +00:00
Tom Tromey 4694da0147 gdb
PR mi/8618:
	* thread.c (free_thread): Free 'name'.
	(print_thread_info): Emit thread name.  Change CLI output.
	(thread_name_command): New function.
	(do_captured_thread_select): Emit newline.
	(_initialize_thread): Register 'thread name' command.
	* target.h (struct target_ops) <to_thread_name>: New field.
	(target_thread_name): New macro.
	* target.c (update_current_target): Handle to_thread_name.
	* python/py-infthread.c (thpy_get_name): New function.
	(thpy_set_name): Likewise.
	(thread_object_getset): Add "name".
	* linux-nat.c (linux_nat_thread_name): New function.
	(linux_nat_add_target): Set to_thread_name.
	* gdbthread.h (struct thread_info) <name>: New field.
gdb/doc
	* gdb.texinfo (Threads): Document thread name output and `thread
	name' command.
	(Threads In Python): Document Thread.name attribute.
	(GDB/MI Thread Commands): Document thread attributes.
gdb/testsuite
	* gdb.python/py-infthread.exp: Add thread tests.
2011-01-19 17:21:39 +00:00
gdbadmin c25658875f *** empty log message *** 2011-01-19 00:00:02 +00:00
Joel Brobecker 10d4437041 fix printing of Ada wide characters on ppc-aix
Same problem as before: We were downcasting the character value from
int to unsigned char, which caused an overflow.  The reason why we did
not see this problem before is probably related to the fact that
we're using stabs on AIX and thus characters types are defined as
a TYPE_CODE_INT (or TYPE_CODE_RANGE?).

gdb/ChangeLog:

        * ada-valprint.c (ada_print_scalar): Remove unsigned char downcast.
        (ada_val_print_1): Likewise.
2011-01-18 16:38:59 +00:00
Joel Brobecker e3acb1155b [powerpc] breakpoint inserted past function end
On powerpc, the prologue scanner reads instruction after instruction,
and just skips instructions that do not affect a frame.  This means
that it does not stop if if finds and unexpected instruction (which
could possibly happen with optimization, I presume). To avoid scanning
too many instructions, it tries to establish an upper limit.

The upper limit is first computed using the debugging (line) info,
but if that fails, it falls back on an arbitrary 100 bytes (or 25
instructions).  The problem is that, if the function is shorter than
those 25 instructions, we run the risk of skipping the entire function
and returning a PC that's outside our function.

In the event where we can find a symbol for a given PC (and therefore
can determine function start and end addresses), but cannot find an
upper limit using skip_prologue_using_sal, then we can at least limit
make sure that the 25 instructions do not put us beyour our function.
If it does, then further reduce the upper-limit to the end of the function.

gdb/ChangeLog:

        * rs6000-tdep.c (rs6000_skip_prologue): Make sure that the prologue
        upper limit address is not greater than the function end address
        when the upper limit could not be computed using the debugging
        info.
2011-01-18 16:18:26 +00:00
gdbadmin 849afc8b63 *** empty log message *** 2011-01-18 00:00:03 +00:00
Tom Tromey dc92e16124 * cli/cli-cmds.c (apropos_command): Free the compiled regex. Use
get_regcomp_error.
	* utils.c: Include gdb_regex.h.
	(do_regfree_cleanup): New function.
	(make_regfree_cleanup): Likewise.
	(get_regcomp_error): Likewise.
	* gdb_regex.h (make_regfree_cleanup, get_regcomp_error): Declare.
2011-01-17 16:50:42 +00:00
Tom Tromey f55af66d6e * cli/cli-cmds.c (apropos_command): Fix formatting. Don't call
re_compile_fastmap.
2011-01-17 16:20:56 +00:00
Pierre Muller a5a44b5381 * p-exp.y (intvar): New static variable, used to set CURRENT_TYPE
for internal variables.
	(last_was_structop): New static variable.
	(COMPLETE): New token.
	(field_exp): New rule to group all '.' suffix handling.
	Add mark_struct_expression calls when approriate to be able
	to correctly find fields for completion.
	(yylex): Adapt to handle field completion and set INTVAR when
	required.
2011-01-17 10:34:51 +00:00
gdbadmin e870b9ca1b *** empty log message *** 2011-01-17 00:00:33 +00:00
gdbadmin f9a63d49c7 *** empty log message *** 2011-01-16 00:00:33 +00:00
gdbadmin e8d8a7b622 *** empty log message *** 2011-01-15 00:00:03 +00:00
Yao Qi 2c291032cc 2011-01-14 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_register_reggroup_p): FPS register is in
	save_reggroup, restore_reggroup and all_reggroup.
2011-01-14 20:37:13 +00:00
Joel Brobecker b075872c94 new testcase printing wchar_t characters and strings
gdb/testsuite/ChangeLog:

        * gdb.base/wchar.c, gdb.base/wchar.exp: New testcases.
2011-01-14 19:33:37 +00:00
Joel Brobecker 2c3e6e2466 new testcase for Ada Wide Wide Characters and Strings
gdb/testsuite/ChangeLog:

        * gdb.ada/widewide: New testcase.
2011-01-14 19:33:19 +00:00
Joel Brobecker 447b483c37 Fix printing of Wide_Character & Wide_Wide_Character entities.
Wide_Characters and Wide_Wide_Characters are incorrectly printed.
Consider for instance:

    Medium : Wide_Character := Wide_Character'Val(16#dead#);

Trying to print the value of this variable yields:

    (gdb) p medium
    $1 = 57005 '["ad"]'

The integer value is correct (57005 = 0xdead), but the character
representation is not, it should be:

    $1 = 57005 '["dead"]'

Same for Wide_Wide_Characters.

There were two issues:
   (a) The first issue was in ada-valprint, where we were assuming
       that character types were 1 byte long;
   (b) The second problem was in c-valprint, where we were down-casting
       the integer value of the character to type `unsigned char',
       causing use to lose all but the lowest byte.

gdb/ChangeLog:

        * ada-valprint. (ada_printchar): Use the correct type length
        in call to ada_emit_char.
        * c-valprint.c (c_val_print): Remove cast in call to LA_PRINT_CHAR.
2011-01-14 19:32:56 +00:00
Pierre Muller 7b64a93b03 * solib-som.h (hpux_major_release): Declare variable here.
* solib-som.c:  Remove <sys/utsname.h> header.
	(DEFAULT_HPUX_MAJOR_RELEASE): New macro.
	(hpux_major_release): Make global, change default value to
	DEFAULT_HPUX_MAJOR_RELEASE.
	(get_hpux_major_release): Simply return HPUX_MAJOR_RELEASE.
	* hppa-hpux-nat.c: Add <sys/utsname.h> include.
	Add "solib-som.h" header.
	(set_hpux_major_release): New function.
	(_initialize_hppa_hpux_nat): Call set_hpux_major_release.
2011-01-14 18:39:31 +00:00