Commit Graph

29281 Commits

Author SHA1 Message Date
Jan Kratochvil 509f0fd941 gdb/
Fix compatibility with older GCCs.
	* dwarf2loc.c (dwarf_expr_reg_to_entry_parameter): Initialize parameter.
	* stack.c (read_frame_arg): Initialize val_deref.
2011-10-09 20:57:03 +00:00
Jan Kratochvil e1b16eb466 gdb/
Add forgotten gdb/dwarf2-frame-tailcall.c.
	Add forgotten gdb/dwarf2-frame-tailcall.h.
2011-10-09 20:21:48 +00:00
Jan Kratochvil 2bda9cc5ee gdb/
Entry values NEWS entries, DWARF disassembly support.
	* NEWS: New entry values entry.
	(set print entry-values, show print entry-values)
	(set debug entry-values, show debug entry-values): New entries.
	* dwarf2loc.c (disassemble_dwarf_expression): New parameters start and
	indent.  Remove variable start.  Move header printing out.  Respect
	INDENT.  Support DW_OP_GNU_entry_value.
	(locexpr_describe_location_1): Move the header printing here, extend
	the disassemble_dwarf_expression passed parameters.

gdb/testsuite/
	* gdb.arch/amd64-entry-value.s: New file.
	* gdb.mi/mi2-amd64-entry-value.s: New file.
2011-10-09 19:46:05 +00:00
Jan Kratochvil a471c5941e gdb/
Display @entry parameter values even for references.
	* ada-valprint.c (ada_val_print_1) <TYPE_CODE_REF>: Try also
	coerce_ref_if_computed.
	* c-valprint.c (c_val_print) <TYPE_CODE_REF>: Likewise.
	* dwarf2expr.c (dwarf_block_to_dwarf_reg_deref): New function.
	(execute_stack_op) <DW_OP_GNU_entry_value>: Add -1 deref_size to the
	existing push_dwarf_reg_entry_value call.  Add new detection calling
	dwarf_block_to_dwarf_reg_deref.  Update the error message.
	(ctx_no_push_dwarf_reg_entry_value): New parameter deref_size.
	* dwarf2expr.h
	(struct dwarf_expr_context_funcs) <push_dwarf_reg_entry_value>: Add new
	parameter deref_size, describe it in the comment.
	(ctx_no_push_dwarf_reg_entry_value): Add new parameter deref_size.
	(dwarf_block_to_dwarf_reg_deref): New declaration.
	* dwarf2loc.c (dwarf_entry_parameter_to_value): Add new parameter
	deref_size, describe it in the function comment.  New variables
	data_src and size, fetch the alternative block accoring to DEREF_SIZE.
	(dwarf_expr_push_dwarf_reg_entry_value): Add new parameter deref_size,
	describe it in the function comment.  Fetch the alternative block
	accoring to DEREF_SIZE.
	(entry_data_value_coerce_ref, entry_data_value_copy_closure)
	(entry_data_value_free_closure, entry_data_value_funcs): New.
	(value_of_dwarf_reg_entry): New variables checked_type, target_type,
	outer_val, target_val, val and addr.  Try to fetch and create also
	referenced value content.
	(pieced_value_funcs): NULL value for coerce_ref.
	(needs_dwarf_reg_entry_value): Add new parameter deref_size.
	* f-valprint.c (f_val_print) <TYPE_CODE_REF>: Try also
	coerce_ref_if_computed.
	* opencl-lang.c (opencl_value_funcs): NULL value for coerce_ref.
	* p-valprint.c (pascal_val_print) <TYPE_CODE_REF>: Likewise.
	* stack.c (read_frame_arg): Compare also dereferenced values.
	* value.c (value_computed_funcs): Make the parameter v const, use
	value_lval_const for it.
	(value_lval_const, coerce_ref_if_computed): New function.
	(coerce_ref): New variable retval.  Call also coerce_ref_if_computed.
	* value.h (struct lval_funcs): New field coerce_ref.
	(value_computed_funcs): Make the parameter v const.
	(value_lval_const, coerce_ref_if_computed): New declarations.

gdb/testsuite/
	Display @entry parameter values even for references.
	* gdb.arch/amd64-entry-value.cc (reference, datap, datap_input): New
	functions.
	(main): New variables regvar, nodatavarp, stackvar1, stackvar2.  Call
	reference and datap_input.
	* gdb.arch/amd64-entry-value.exp (reference, breakhere_reference): New
	breakpoints.
	(continue to breakpoint: entry_reference: reference)
	(entry_reference: bt at entry)
	(continue to breakpoint: entry_reference: breakhere_reference)
	(entry_reference: bt, entry_reference: ptype regparam)
	(entry_reference: p regparam, entry_reference: ptype regparam@entry)
	(entry_reference: p regparam@entry, entry_reference: p &regparam@entry)
	(entry_reference: p regcopy, entry_reference: p nodataparam)
	(entry_reference: p nodataparam@entry): New tests.
2011-10-09 19:43:41 +00:00
Jan Kratochvil 36b11add17 gdb/
Support @entry in input expressions.
	* c-exp.y (ENTRY, unknown_cpp_name): New.
	(exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'.
	(unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY)
	(variable: name_not_typename '@' ENTRY, name: ENTRY)
	(name_not_typename: ENTRY): New.
	(yylex): Recognize ENTRY.
	* eval.c (evaluate_subexp_standard): Support also OP_VAR_ENTRY_VALUE.
	* expprint.c (print_subexp_standard, dump_subexp_body_standard):
	Likewise.
	* parse.c (operator_length_standard): Likewise.
	* std-operator.def: New operator OP_VAR_ENTRY_VALUE.

gdb/doc/
	Support @entry in input expressions.
	* gdb.texinfo (Variables): Describe @entry names suffix.
	(Print Settings): Add anchor for `set print entry-values'.

gdb/testsuite/
	Support @entry in input expressions.
	* gdb.arch/amd64-entry-value.exp (entry: p i@entry, entry: p j@entry)
	(entry_stack: p s1@entry, entry_stack: p s2@entry)
	(entry_stack: p d9@entry, entry_stack: p da@entry, tailcall: p i@entry)
	(tailcall: p j@entry): New tests.
	* gdb.cp/koenig.cc (A::entry): New function.
	(main): Call it.
	* gdb.cp/koenig.exp (p entry (c)): New test.
2011-10-09 19:41:17 +00:00
Jan Kratochvil 3343315ba7 gdb/
Display referenced values in backtraces.
	* printcmd.c (print_variable_and_value): Set OPTS.DEREF_REF to 1.
	* stack.c (print_frame_arg): Likewise.
2011-10-09 19:38:29 +00:00
Jan Kratochvil ac71a68c85 gdb/
Make some lval_funcs methods to default on NULL.
	* valops.c (value_fetch_lazy): Check if lval_computed read method is
	NULL.
	(value_assign): Check if lval_computed write method is NULL.
	* value.h (struct lval_funcs): Comment NULL values for read and write
	methods.
2011-10-09 19:36:06 +00:00
Jan Kratochvil e18b27534c gdb/
Display @entry parameter values (without references).
	* dwarf2expr.c (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset):
	New functions.
	* dwarf2expr.h (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset):
	New declarations.
	* dwarf2loc.c (dwarf2_find_location_expression): Support location list
	entry record.
	(dwarf_entry_parameter_to_value, value_of_dwarf_reg_entry)
	(value_of_dwarf_block_entry, locexpr_read_variable_at_entry): New
	functions.
	(dwarf2_locexpr_funcs): Install locexpr_read_variable_at_entry.
	(loclist_read_variable_at_entry): New function.
	(dwarf2_loclist_funcs): Install loclist_read_variable_at_entry.
	* dwarf2read.c (read_call_site_scope): Support also DW_OP_fbreg in
	DW_AT_location, call dwarf_block_to_sp_offset for it.
	* frame.h (print_entry_values_no, print_entry_values_only)
	(print_entry_values_preferred, print_entry_values_if_needed)
	(print_entry_values_both, print_entry_values_compact)
	(print_entry_values_default, print_entry_values): New declarations.
	(struct frame_arg): New field entry_kind.
	(read_frame_arg): New parameter entryargp.
	* mi/mi-cmd-stack.c (list_arg_or_local): New gdb_assert for
	arg->entry_kind.  Optionally print the `@entry' suffix.
	(list_args_or_locals): New variable entryarg, initialize it.
	Initialize also entry_kind of arg and entryarg.  Conditionalize
	list_arg_or_local for arg, add list_arg_or_local for entryarg.  Call
	xfree for entryarg.error.
	* stack.c (print_entry_values_no, print_entry_values_only)
	(print_entry_values_preferred, print_entry_values_if_needed)
	(print_entry_values_both, print_entry_values_compact)
	(print_entry_values_default, print_entry_values_choices)
	(print_entry_values): New variables.
	(print_frame_arg): New gdb_assert for arg->entry_kind.  Optionally
	print the `@entry' suffix, possibly in combination for
	print_entry_values_compact.
	(read_frame_arg): New parameter entryargp, new variables entryval,
	entryval_error and val_equal.  Read in also entryargp, respect
	print_entry_values, compare the values using val_equal, fill in also
	argp->entry_kind (together with entryargp->entry_kind).
	(print_frame_args): New variable entryarg, initialize it.
	Conditionalize print_frame_arg for arg, add print_frame_arg for
	entryarg.  Call xfree for entryarg.error.
	(_initialize_stack): Call add_setshow_enum_cmd for `entry-values'.
	* symtab.h (struct symbol_computed_ops): New field
	read_variable_at_entry.

gdb/doc/
	Display @entry parameter values (without references).
	* gdb.texinfo (Tail Call Frames): Add anchor.  Add self tail call
	example.
	(Print Settings): New description of set print entry-values and show
	print entry-values.

gdb/testsuite/
	Display @entry parameter values (without references).
	* gdb.arch/amd64-entry-value.cc (locexpr, stacktest, data, data2)
	(different, validity, invalid): New functions.
	(main): Call them.
	* gdb.arch/amd64-entry-value.exp: New breakpoints breakhere_locexpr,
	stacktest, breakhere_stacktest, different, breakhere_different,
	breakhere_validity and breakhere_invalid.
	(entry: bt): Update for @entry.
	(entry_locexpr: *, entry_stack: *, entry_equal: *, entry_different: *)
	(entry_validity: *, entry_invalid: *): Many new tests.
	* gdb.base/break.exp
	(run until breakpoint set at small function, optimized file): Accept
	also the @entry suffix.
	* gdb.mi/Makefile.in (PROGS): Add mi2-amd64-entry-value.
	* gdb.mi/mi2-amd64-entry-value.c: New files.
	* gdb.mi/mi2-amd64-entry-value.exp: New files.
2011-10-09 19:34:19 +00:00
Jan Kratochvil 93d86cefdf gdb/
Code reshuffle.
	* frame.h (struct frame_arg): New definition.
	(read_frame_arg): New declaration.
	* mi/mi-cmd-stack.c (list_arg_or_local): New functiom from ...
	(list_args_or_locals): ... the code here.  New variable arg, call
	read_frame_arg and list_arg_or_local with it.  Unify the
	PRINT_SIMPLE_VALUES and PRINT_ALL_VALUES cases.  Call xfree for
	arg.error.
	* stack.c (print_frame_arg): New functiom from the code of
	print_frame_args.
	(read_frame_arg): New function.
	(print_frame_args): Remove variable val.  New variable arg, call
	read_frame_arg and print_frame_arg with it.  Call xfree for arg.error.
2011-10-09 19:30:25 +00:00
Jan Kratochvil 2d6c5dc2c7 gdb/
Protect entry values against self tail calls.
	* dwarf2loc.c (VEC (CORE_ADDR), func_verify_no_selftailcall): New.
	(dwarf_expr_dwarf_reg_entry_value): Call func_verify_no_selftailcall.

gdb/testsuite/
	Protect entry values against self tail calls.
	* gdb.arch/amd64-entry-value.cc (self2, self): New.
	(main): Call self.
	* gdb.arch/amd64-entry-value.exp (self: breakhere, self: bt)
	(set debug entry-values 1, self: bt debug entry-values): New tests.
2011-10-09 19:29:11 +00:00
Jan Kratochvil 111c64899c gdb/
Recognize virtual tail call frames.
	* Makefile.in (SFILES): Add dwarf2-frame-tailcall.c.
	(HFILES_NO_SRCDIR): Add dwarf2-frame-tailcall.h.
	(COMMON_OBS): Add dwarf2-frame-tailcall.o.
	* dwarf2-frame-tailcall.c: New file.
	* dwarf2-frame-tailcall.h: New file.
	* dwarf2-frame.c: Include dwarf2-frame-tailcall.h.
	(execute_cfa_program): New function comment.  Return INSN_PTR.  Reset
	REGS.PREV only after CIE execution.
	(struct dwarf2_frame_cache): New field tailcall_cache.
	(dwarf2_frame_cache): New variables entry_pc, entry_cfa_sp_offset,
	entry_cfa_sp_offset_p and instr.  Execute FDE instructions in two
	parts, try to find entry_cfa_sp_offset.  Call
	dwarf2_tailcall_sniffer_first.
	(dwarf2_frame_prev_register): Call dwarf2_tailcall_prev_register_first
	when appropriate.
	(dwarf2_frame_dealloc_cache): New function.
	(dwarf2_frame_sniffer): Preinitialize cache by dwarf2_frame_cache.
	(dwarf2_frame_unwind): Install dwarf2_frame_dealloc_cache.
	(dwarf2_signal_frame_unwind): Do not install dwarf2_frame_dealloc_cache.
	(dwarf2_append_unwinders): Add dwarf2_tailcall_frame_unwind.
	(dwarf2_frame_cfa): Support also dwarf2_tailcall_frame_unwind.
	* dwarf2loc.c (func_addr_to_tail_call_list)
	(tailcall_dump, call_sitep, VEC (call_sitep), chain_candidate)
	(call_site_find_chain_1, call_site_find_chain): New.
	* dwarf2loc.h (struct call_site_chain): New.
	(call_site_find_chain): New declaration.
	* frame.c (get_frame_address_in_block): Support also TAILCALL_FRAME.
	* frame.h (enum frame_type): New entry TAILCALL_FRAME.
	* python/py-frame.c (gdbpy_initialize_frames): Add TAILCALL_FRAME.
	* stack.c (frame_info): Support also TAILCALL_FRAME.

gdb/doc/
	Recognize virtual tail call frames.
	* gdb.texinfo (Optimized Code): Add reference to Tail Call Frames.
	(Tail Call Frames): New node.
	(Frames In Python): Add gdb.TAILCALL_FRAME.

gdb/testsuite/
	Recognize virtual tail call frames.
	* gdb.arch/amd64-entry-value.cc (c, a, b, amb_z, amb_y, amb_x, amb)
	(amb_b, amb_a): New.
	(main): Call a and b.
	* gdb.arch/amd64-entry-value.exp (tailcall: breakhere, tailcall: bt)
	(tailcall: p i, tailcall: p j, set $sp0=$sp, up, p $sp0 == $sp, frame 3)
	(p $sp0 + sizeof (void *) == $sp, ambiguous: breakhere, ambiguous: bt):
	New tests.
2011-10-09 19:26:44 +00:00
Jan Kratochvil bb984ff154 gdb/
Tail call sites reader implementation.
	* dwarf2read.c (read_call_site_scope): Recognize DW_AT_GNU_tail_call,
	fill in TYPE_TAIL_CALL_LIST.
	* gdbtypes.h (struct func_type): New field tail_call_list.
	(struct call_site): New field tail_call_next.
	(TYPE_TAIL_CALL_LIST): New definition.
2011-10-09 19:23:41 +00:00
Jan Kratochvil 8e3b41a906 gdb/
Implement basic support for DW_TAG_GNU_call_site.
	* block.c: Include gdbtypes.h and exceptions.h.
	(call_site_for_pc): New function.
	* block.h (call_site_for_pc): New declaration.
	* defs.h: Include hashtab.h.
	(make_cleanup_htab_delete, core_addr_hash, core_addr_eq): New
	declarations.
	* dwarf2-frame.c (dwarf2_frame_ctx_funcs): Install
	ctx_no_push_dwarf_reg_entry_value.
	* dwarf2expr.c (read_uleb128, read_sleb128): Support R as NULL.
	(dwarf_block_to_dwarf_reg): New function.
	(execute_stack_op) <DW_OP_GNU_entry_value>: Implement it.
	(ctx_no_push_dwarf_reg_entry_value): New function.
	* dwarf2expr.h (struct dwarf_expr_context_funcs): New field
	push_dwarf_reg_entry_value.
	(ctx_no_push_dwarf_reg_entry_value, dwarf_block_to_dwarf_reg): New
	declarations.
	* dwarf2loc.c: Include gdbcmd.h.
	(dwarf_expr_ctx_funcs): New forward declaration.
	(entry_values_debug, show_entry_values_debug, call_site_to_target_addr)
	(dwarf_expr_reg_to_entry_parameter)
	(dwarf_expr_push_dwarf_reg_entry_value): New.
	(dwarf_expr_ctx_funcs): Install dwarf_expr_push_dwarf_reg_entry_value.
	(dwarf2_evaluate_loc_desc_full): Handle NO_ENTRY_VALUE_ERROR.
	(needs_dwarf_reg_entry_value): New function.
	(needs_frame_ctx_funcs): Install it.
	(_initialize_dwarf2loc): New function.
	* dwarf2loc.h (entry_values_debug): New declaration.
	* dwarf2read.c (struct dwarf2_cu): New field call_site_htab.
	(read_call_site_scope): New forward declaration.
	(process_full_comp_unit): Copy call_site_htab.
	(process_die): Support DW_TAG_GNU_call_site.
	(read_call_site_scope): New function.
	(dwarf2_get_pc_bounds): Support NULL HIGHPC.
	(dwarf_tag_name): Support DW_TAG_GNU_call_site.
	(cleanup_htab): Delete.
	(write_psymtabs_to_index): Use make_cleanup_htab_delete instead of it.
	* exceptions.h (enum errors): New NO_ENTRY_VALUE_ERROR.
	* gdb-gdb.py (StructMainTypePrettyPrinter): Support
	FIELD_LOC_KIND_DWARF_BLOCK.
	* gdbtypes.h (enum field_loc_kind): New entry
	FIELD_LOC_KIND_DWARF_BLOCK.
	(struct main_type): New loc entry dwarf_block.
	(struct call_site, FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK)
	(TYPE_FIELD_DWARF_BLOCK): New.
	* python/py-type.c: Include dwarf2loc.h.
	(check_types_equal): Support FIELD_LOC_KIND_DWARF_BLOCK.  New
	internal_error call on unknown FIELD_LOC_KIND.
	* symtab.h (struct symtab): New field call_site_htab.
	* utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete)
	(core_addr_hash, core_addr_eq): New functions.

gdb/testsuite/
	Implement basic support for DW_TAG_GNU_call_site.
	* gdb.arch/Makefile.in (EXECUTABLES): Add amd64-entry-value.
	* gdb.arch/amd64-entry-value.cc: New file.
	* gdb.arch/amd64-entry-value.exp: New file.
2011-10-09 19:21:39 +00:00
Jan Kratochvil b6cdc2c1b5 gdb/
Code reshuffle.
	* gdb-gdb.py (StructMainTypePrettyPrinter): Change
	TYPE_SPECIFIC_CALLING_CONVENTION to TYPE_SPECIFIC_FUNC.  Move
	calling_convention under func_stuff there.
	* gdbtypes.c (make_function_type): Call INIT_FUNC_SPECIFIC.
	(init_type) <TYPE_CODE_FUNC>: Likewise.
	(recursive_dump_type): Change TYPE_SPECIFIC_CALLING_CONVENTION to
	TYPE_SPECIFIC_FUNC.  New comment for tail_call_list.
	* gdbtypes.h (enum type_specific_kind): Change
	TYPE_SPECIFIC_CALLING_CONVENTION to TYPE_SPECIFIC_FUNC.
	(struct main_type) <type_specific>: Change calling_convention to
	func_stuff.  Move calling_convention to ...
	(struct func_type): ... this new struct.
	(INIT_FUNC_SPECIFIC): New #define.
	(TYPE_CALLING_CONVENTION): Change calling_convention to func_stuff.
2011-10-09 19:10:52 +00:00
Jan Kratochvil 181cebd4f8 gdb/
Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
	* dwarf2-frame.c (execute_stack_op): Initialize ctx->ref_addr_size.
	* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_implicit_pointer>: Use
	ctx->ref_addr_size.  Handle its invalid value.
	* dwarf2expr.h (struct dwarf_expr_context): New field ref_addr_size.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full)
	(dwarf2_loc_desc_needs_frame): Initialize ctx->ref_addr_size.
	* dwarf2loc.h (dwarf2_per_cu_ref_addr_size): New declaration.
	* dwarf2read.c (decode_locdesc): Initialize ctx->ref_addr_size.
	(dwarf2_per_cu_ref_addr_size): New function.

gdb/testsuite/
	Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
	* gdb.dwarf2/implptr-64bit.S: New file.
	* gdb.dwarf2/implptr-64bit.exp: New file.
2011-10-09 18:46:41 +00:00
Jan Kratochvil c471e7909f gdb/
Code cleanup.
	* dwarf2read.c (per_cu_header_read_in): New function.
	(dwarf2_per_cu_addr_size, dwarf2_per_cu_offset_size): Use it, with new
	variables cu_header_local and cu_headerp.
2011-10-09 18:43:32 +00:00
Jan Kratochvil 741f5e3c63 gdb/
Fix initial language detection with -readnow.
	* dwarf2read.c (dw2_find_symbol_file): Handle OBJF_READNOW case.
	* symfile.h (struct quick_symbol_functions): State find_symbol_file
	searches only for global symbols.

gdb/testsuite/
	Fix initial language detection with -readnow.
	* gdb.cp/readnow-language.cc: New file.
	* gdb.cp/readnow-language.exp: New file.
2011-10-09 18:37:27 +00:00
Jan Kratochvil a73d2258a7 gdb/
Fix printed anonymous struct name.
	* dwarf2read.c (fixup_partial_die): Handle for anonymous structs also
	DW_TAG_interface_type.  Strip for anonymous structs any prefixes.
	(anonymous_struct_prefix): New function.
	(determine_prefix): New variables retval.  Call anonymous_struct_prefix.
	(dwarf2_name): Strip for anonymous structs any prefixes.

gdb/testsuite/
	Fix printed anonymous struct name.
	* gdb.cp/anon-struct.exp (print type of X::t2): New test.
2011-10-09 18:33:28 +00:00
Joseph Myers af36949570 * gdb.base/solib-symbol.exp: Do not include directories in
filenames in expected messages.
2011-10-09 18:14:41 +00:00
gdbadmin 40d990bedc *** empty log message *** 2011-10-09 00:00:02 +00:00
gdbadmin 99df68896e *** empty log message *** 2011-10-08 00:00:03 +00:00
Doug Evans 9c15afc467 * gdb.texinfo (gdb.printing): Document new `replace' arg to
register_pretty_printer.
2011-10-07 23:01:54 +00:00
Doug Evans 1fa57852d6 * python/lib/gdb/printing.py (register_pretty_printer): New argument
`replace'.

	testsuite/
	* gdb.python/py-pp-maint.py: Add tests for `replace' arg.
2011-10-07 22:46:15 +00:00
Doug Evans 690a49373c * python/lib/gdb/printing.py: Whitespace cleanup. 2011-10-07 22:25:57 +00:00
Doug Evans 749fd4eab6 * python/py-value.c (valpy_call): Initialize ftype to avoid compiler
warning.
2011-10-07 22:02:42 +00:00
Doug Evans 5631e5967f Fix PR spelling, 13624 -> 13264. 2011-10-07 21:56:17 +00:00
Pedro Alves 4c38200f7d 2011-10-07 Pedro Alves <pedro@codesourcery.com>
* linux-nat.h (ALL_LWPS): Remove the ptid parameter.
	* amd64-linux-nat.c (amd64_linux_dr_set_control)
	(amd64_linux_dr_set_addr, amd64_linux_dr_unset_status): Adjust.
	* arm-linux-nat.c (arm_linux_insert_hw_breakpoint)
	(arm_linux_remove_hw_breakpoint, arm_linux_insert_watchpoint)
	(arm_linux_remove_watchpoint): Adjust.
	* i386-linux-nat.c (i386_linux_dr_set_control)
	(i386_linux_dr_set_addr, i386_linux_dr_unset_status): Adjust.
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint)
	(ia64_linux_remove_watchpoint): Adjust.
	* mips-linux-nat.c (write_watchpoint_regs): Adjust.
	* ppc-linux-nat.c (ppc_linux_insert_hw_breakpoint)
	(ppc_linux_insert_hw_breakpoint, ppc_linux_remove_hw_breakpoint)
	(ppc_linux_insert_mask_watchpoint)
	(ppc_linux_remove_mask_watchpoint, ppc_linux_insert_watchpoint)
	(ppc_linux_remove_watchpoint): Adjust.
	* s390-nat.c (s390_insert_watchpoint, s390_remove_watchpoint):
	Adjust.
2011-10-07 17:15:15 +00:00
Corinna Vinschen b7ff339d9e * windows-nat.c: Include wchar.h to avoid compiler warnings.
(clear_win32_environment): New function for Cygwin to clear out
	Win32 environment.
	(windows_create_inferior): Prepare new environment from in_env
	for Cygwin, too.
2011-10-07 13:52:11 +00:00
Phil Muldoon f287c1f320 2011-10-07 Phil Muldoon <pmuldoon@redhat.com>
PR python/13624

	* python/py-value.c (valpy_call): Check that arguments are
	a tuple.
        (is_intlike): Remove call to CHECK_TYPEDEF.
	(valpy_nonzero): Catch GDB exceptions.
	(valpy_absolute): Ditto.
        (valpy_lazy_string): Ditto.
        (valpy_call): Ditto.
        (valpy_get_is_optimized_out): Ditto.
        (valpy_long): Ditto.
        (valpy_float): Ditto.
        (valpy_int): Call CHECK_TYPEDEF.  Catch GDB exceptions.
        (valpy_richcompare): Ditto.
2011-10-07 13:46:11 +00:00
Phil Muldoon 99f5279d98 2011-10-07 Phil Muldoon <pmuldoon@redhat.com>
PR python/12930
	PR python/12802

	* gdb.texinfo (Breakpoints In Python): Clarify behavior in the
	stop method.
2011-10-07 13:23:18 +00:00
Ulrich Weigand 03583c206f * inferior.h (disable_randomization): Declare.
* infrun.c (disable_randomization): New global variable.
	(show_disable_randomization): New function.
	(set_disable_randomization): Likewise.
	(_initialize_infrun): Install set/show disable-randomization
	commands.
	* linux-nat.c (disable_randomization): Remove.
	(show_disable_randomization): Likewise.
	(set_disable_randomization): Likewise.
	(_initialize_linux_nat): No longer install set/show
	disable-randomization commands here.
	(linux_nat_supports_disable_randomization): New function.
	(linux_nat_add_target): Install it.
	* remote.c (PACKET_QDisableRandomization): New enum value.
	(remote_protocol_packets): Support QDisableRandomization.
	(_initialize_remote): Likewise.
	(remote_supports_disable_randomization): New function.
	(init_remote_ops): Install it.
	(extended_remote_supports_disable_randomization): New function.
	(init_extended_remote_ops): Install it.
	(extended_remote_disable_randomization): New function.
	(extended_remote_create_inferior_1): Call it.
	* target.h (struct target_ops): Add to_supports_disable_randomization.
	(target_supports_disable_randomization): Add prototype.
	* target.c (target_supports_disable_randomization): New function.
	(find_default_supports_disable_randomization): Likewise.
	(init_dummy_target): Install it.

doc/
	* gdb.texinfo (Starting your Program): "set disable-randomization"
	is no longer Linux-specific.
	(Remote Configuration): Document "set remote
	disable-randomization-packet".
	(General Query Packets): Document "QDisableRandomization" packet
	and add it to "qSupported" list.

gdbserver/
	* configure.ac: Check support for personality routine.
	* configure: Regenerate.
	* config.in: Likewise.
	* linux-low.c: Include <sys/personality.h>.
	Define ADDR_NO_RANDOMIZE if necessary.
	(linux_create_inferior): Disable address space randomization when
	forking inferior, if requested.
	(linux_supports_disable_randomization): New function.
	(linux_target_ops): Install it.
	* server.h (disable_randomization): Declare.
	* server.c (disable_randomization): New global variable.
	(handle_general_set): Handle QDisableRandomization.
	(handle_query): Likewise for qSupported.
	(main): Support --disable-randomization and --no-disable-randomization
	command line arguments.
	* target.h (struct target_ops): Add supports_disable_randomization.
	(target_supports_disable_randomization): New macro.
2011-10-07 12:06:48 +00:00
Kevin Pouget 01b7169780 Add missing files to previous commit (Allow Python notification of new object-file loadings.) 2011-10-07 08:39:57 +00:00
Kevin Pouget bd054e06e3 Fix ChangeLog messup (Allow Python notification of new object-file loadings.) 2011-10-07 07:51:20 +00:00
Kevin Pouget 20c168b519 Allow Python notification of new object-file loadings.
* Makefile.in (SUBDIR_PYTHON_SRCS): Add py-newobjfilevent.c.
	(SUBDIR_PYTHON_OBS): Add py-newobjfileevent.o.
	Add build rule for this file.
	* python/py-event.h (emit_new_objfile_event): New prototype.
	(newobjfile): New Python event emitter.
	* python/py-evts.c (gdbpy_initialize_py_events): Add new_objfile to
	Python event registry.
	* python/py-inferior.c: Include objfiles.h
	(python_new_objfile): New function.
	(gdbpy_initialize_inferior): Add python_new_objfile to the new objfile
	observers.
	* python/py-newobjfileevent.c: New file.
	* python-internal.h (gdbpy_initialize_new_objfile_event): New
	prototype.
	* python/python.c (_initialize_python): Add
	gdbpy_initialize_new_objfile_event call.
	* NEWS: Add item for new Python event "gdb.newobjfile"

2011-10-06  Kevin Pouget  <kevin.pouget@st.com>

	Allow Python notification of new object-file loadings.
	* gdb.texinfo (Events In Python): Document `gdb.NewObjFileEvent'
	event type.

2011-10-06  Kevin Pouget  <kevin.pouget@st.com>

	Allow Python notification of new object-file loadings.
	* gdb.python/py-events.exp: Test newobjfile event.
	* gdb.python/py-events.py: Register newobjfile callback.
	* gdb.python/py-events.c: Add call to shared library
	* gdb.python/py-events-shlib.c: New file.
2011-10-07 07:38:30 +00:00
Joseph Myers 8031b6f821 * gdb.base/fixsection.exp: Do not include directories in filename
in expected message.
2011-10-07 00:24:38 +00:00
gdbadmin 9ad26a41a7 *** empty log message *** 2011-10-07 00:00:02 +00:00
gdbadmin a664570eec *** empty log message *** 2011-10-06 00:00:03 +00:00
Pierre Muller 7fea69231b Add tests for passing of environment variables to inferior.
* gdb.base/testenv.c: New test source.
	* gdb.base/testenv.exp: New expect test.
2011-10-05 14:23:37 +00:00
Tristan Gingold b1c8db38fc 2011-10-05 Tristan Gingold <gingold@adacore.com>
* ada-tasks.c (read_atcb): Make ravenscar_task_name static.
        Extract the ravenscar task name from the symbol for the atcb.
2011-10-05 07:41:13 +00:00
gdbadmin 98acb30286 *** empty log message *** 2011-10-05 00:00:32 +00:00
Paul Koning 687f2a88e7 * gdb.python/py-value.c (main): Break before return. 2011-10-04 17:43:16 +00:00
Paul Koning 0dab82e9b3 * python/py-type.c (typy_make_iter): Add forward declaration.
(typy_fields_items):  Use the gdb.Type iterator.
2011-10-04 16:20:03 +00:00
Paul Koning 84ad80e63a * NEWS: Add entry for Python gdb.Type mapping methods. 2011-10-04 15:55:39 +00:00
Paul Koning 699df94d5a Fix misplaced documentation entry (Paul Koning, 2011-09-28) 2011-10-04 15:54:35 +00:00
Kevin Pouget cb6be26b8b 2011-10-04 Kevin Pouget <kevin.pouget@st.com>
PR python/12691: Add the inferior to Python exited event
       * python/py-exitedevent.c (create_exited_event_object): Add inferior
       to exited_event.
       * python/py-event.h (emit_exited_event): Likewise
       * python/-inferior.c (python_inferior_exit): Likewise

 2011-10-04  Kevin Pouget  <kevin.pouget@st.com>

       PR python/12691: Add the inferior to Python exited event
       * gdb.python/py-events.exp: Test the inferior attribute of exited
       event with a fork.
       * gdb.python/py-events.py: Print inferior number on exit.
       * gdb.python/py-events.c: Fork the inferior.

 2011-10-04  Kevin Pouget  <kevin.pouget@st.com>

       PR python/12691: Add the inferior to Python exited event
       * gdb.texinfo (Events In Python): Describe exited inferior attribute.
2011-10-04 08:04:13 +00:00
gdbadmin 54d2bafcf2 *** empty log message *** 2011-10-04 00:00:33 +00:00
Joel Brobecker a05336a1c8 [doco] rephrase `presence of' with `support for'.
gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Miscellaneous Commands): Minor
        rephasing.
2011-10-03 21:39:03 +00:00
Joel Brobecker 5d77fe4431 [Ada/doco] Document the new -ada-task-info GDB/MI command.
gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Ada Tasking Commands): New node.
        (GDB/MI Miscellaneous Commands): Add `ada-task-info'
        as possible feature returned by the `-list-features'
        command.
2011-10-03 21:38:51 +00:00
Joel Brobecker 6005b21039 [Ada] Add field "thread-id" in -ada-task-info output
This patch enhances the -ada-task-info command, adding a new
field called "thread-id" in the command output.  This field
provides the ID of the task's corresponding thread (if that
information could not be determined, the field is omitted).

This field is useful in the context of GDB/MI users, because
it allows a quick translation from Ada task to thread, and
thus easy use of all the commands that take a --thread argument.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): Add "thread-id" field
        in output of -ada-task-info GDB/MI command.
2011-10-03 21:38:39 +00:00
Joel Brobecker 75082e8cbb [Ada] New GDB/MI command: -ada-tasks-info
This patch introduces a new GDB/MI command: -ada-tasks-info,
which is meant to be the MI equivalent of the CLI `info tasks'
command.

This new command returns an array, with each row corresponding
to one task.  For now, the columns of the array corresponds to
the columns displayed in the CLI output.

gdb/ChangeLog:

        * ada-lang.h (struct inferior): Declare.
        (print_ada_task_info): Add declaration.
        * ada-tasks.c (print_ada_task_info): Make non-static.
        * mi/mi-cmds.c (mi_cmds): Add "ada-task-info".
        * mi/mi-cmds.h (mi_cmd_ada_task_info): Add declaration.
        * mi/mi-main.c: #include "ada-lang.h".
        (mi_cmd_list_features): Add "ada-task-info" to the list
        of supported features.
        (mi_cmd_ada_task_info): New function.
2011-10-03 21:38:31 +00:00
Joel Brobecker 7ed7d71926 Crash sourcing Python script on Windows
gdb/ChangeLog:

        * python/python.c (python_run_simple_file): New function.
        (source_python_script, source_python_script_for_objfile):
        Replace call to PyRun_SimpleFile by call to
        python_run_simple_file.
2011-10-03 20:46:19 +00:00
Edjunior Barbosa Machado fb21370048 * gdb.base/jit.exp: Add testcase name to log message 2011-10-03 20:13:57 +00:00
Paul Koning aa2071bd24 * gdb.python/py-value.exp
(python inval = gdb.parse_and_eval('*(int*)0'))
(python argc_lazy = gdb.parse_and_eval('argc'), sanity check argc)
(set argc=2, python print argc_lazy): New tests.
2011-10-03 16:15:26 +00:00
Paul Koning 3fcaed3833 * python/py-value.c (valpy_get_address): Use Py_XINCREF.
(value_to_value_object): Fetch value if it was lazy.
2011-10-03 16:14:39 +00:00
gdbadmin 34788f4a2b *** empty log message *** 2011-10-03 00:00:03 +00:00
Jan Kratochvil 8e5c319d86 gdb/
Code cleanup.
	* solib-svr4.c (svr4_default_sos):  Remove variables head and link_ptr.
	Rearrange the code for it.
2011-10-02 21:05:59 +00:00
Joel Brobecker dd11a36cfe thread-specific breakpoints not saved properly by save-breakpoint
Initially, I noticed that the save command was often missing
new lines in the file that it generated.  For instance, consider:

        % gdb save-bp
        (gdb) b break_me
        (gdb) b save-bp.c:27
        (gdb) save breakpoints bps

The contents of the bps file would be:

        % cat bps
        break break_mebreak save-bp.c:27

Looking further into the problem, I realized that the missing newlines
are just a consequence of a missing call to print_recreate_thread.
After having generated the breakpoint location in the break command,
we cannot put a new line until we have looked at whether we need to
add a 'thread NUM' argument.

gdb/ChangeLog:

        * breakpoint.c (bkpt_print_recreate): Add call to
        print_recreate_thread.

gdb/testsuite/ChangeLog:

        * gdb.base/save-bp.exp, gdb.base/save-bp.c: New files.
2011-10-02 02:13:13 +00:00
gdbadmin 2fed52b14d *** empty log message *** 2011-10-02 00:00:03 +00:00
Jan Kratochvil 46f886f1f5 gdb/testsuite/
* gdb.python/py-value.exp (test_value_in_inferior): New variable
	can_read_0, test for it.
	(python print gdb.parse_and_eval('*(int*)0')): Rename to ...
	(parse_and_eval with memory error): ... here, make it untested if
	can_read_0.
2011-10-01 11:02:11 +00:00
gdbadmin 4ca9de19cd *** empty log message *** 2011-10-01 00:00:32 +00:00
Marek Polacek c5cb204fbb gdb.python/python.exp: fix up race 2011-09-30 15:07:33 +00:00
Mike Frysinger 723b724b17 gdbserver: add support for FDPIC loadmaps
The DSBT support is very close to the FDPIC code, so extend the existing
loadmap support to work with FDPIC loadmaps too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-30 00:01:59 +00:00
gdbadmin 1f7c9b6179 *** empty log message *** 2011-09-30 00:00:32 +00:00
Joseph Myers 68fb0ec00b * lib/gdb.exp (is_amd64_regs_target, is_x86_like_target): Allow
for 64-bit multilibs from i?86-* targets.
2011-09-29 15:17:50 +00:00
Marek Polacek 6aee0d90b5 lib/gdb.exp: Fix a typo 2011-09-29 14:36:47 +00:00
Marek Polacek e9101ff5a7 gdb.base/foll-fork.exp: fix up race 2011-09-29 14:13:00 +00:00
Yao Qi 24bdad53a9 gdb/doc/
* gdb.texinfo (Files): Update options for `add-symbol-file'.
	Add one space after option `-s'.  Remove @r{} markup.
2011-09-29 02:25:49 +00:00
Yao Qi 412946b6ba gdb/
* symfile.c (add_symbol_file_command): Update message on usage.
2011-09-29 02:04:25 +00:00
gdbadmin d8250e5afa *** empty log message *** 2011-09-29 00:00:32 +00:00
Paul Koning 7a81bdbf67 * gdb.python/py-type.c (enum E): New.
* gdb.python/py-type.exp (test_fields): Add tests for Python
mapping access to fields.
(test_enums): New test for field access on enums.
2011-09-28 20:06:01 +00:00
Paul Koning a73bb89264 * python/py-type.c (make_fielditem, typy_field_names, typy_items)
(typy_length, typy_get, typy_has_key, typy_make_iter)
(typy_iterkeys, typy_iteritems, typy_itervalues, typy_iter)
(typy_iterator_iter, typy_iterator_iternext)
(typy_iterator_dealloc): New functions to implement standard
Python mapping methods on gdb.Type object.
(gdb.TypeIterator): New Python type.
* python/python-internal.h (gdbpy_iter_kind): New enum.
* doc/gdb.texinfo (gdb.Type): Document field access by dictionary
key syntax.
2011-09-28 20:04:52 +00:00
David S. Miller fe10a582b6 Fix complex floats on sparc.
* sparc-tdep.h (SPARC_F2_REGNUM, SPARC_F3_REGNUM, SPARC_F4_REGNUM,
	SPARC_F5_REGNUM, SPARC_F6_REGNUM, SPARC_F7_REGNUM): New enums.
	* sparc-tdep.c (sparc_complex_floating_p): New function.
	(sparc32_store_arguments): Handle complex floats.
	(sparc32_extract_return_value): Likewise.
	(sparc32_store_return_value): Likewise.
	(sparc32_stabs_argument_has_addr): Likewise.
	* sparc64-tdep.c (sparc64_complex_floating_p): New function.
	(sparc64_store_floating_fields): Handle complex floats.
	(sparc64_store_arguments): Likewise.
	(sparc64_store_return_value): Likewise.
2011-09-28 17:59:42 +00:00
Eli Zaretskii c93dbcba16 Support "set environment" and "unset environment" in MinGW builds.
* windows-nat.c (env_sort) [!__CYGWIN__]: Function restored from
	before the change on 2006-12-09.
	(windows_create_inferior) [!__CYGWIN__]: Restore code that
	generates the environment block for CreateProcessA, modulo the
	Cygwin-specific parts that are not needed here.
2011-09-28 09:07:54 +00:00
gdbadmin 27ebf5b696 *** empty log message *** 2011-09-28 00:00:32 +00:00
Tristan Gingold f00c55f832 2011-09-27 Tristan Gingold <gingold@adacore.com>
* target.h (enum target_object): Add TARGET_OBJECT_DARWIN_DYLD_INFO.
	* solib-darwin.c (DYLD_VERSION_MAX): Update number.
	(darwin_solib_get_all_image_info_addr_at_init): New function.
	(darwin_solib_read_all_image_info_addr): Likewise.
	(darwin_solib_create_inferior_hook): Use the above two functions.
	* darwin-nat.c (darwin_execvp): Renames retval to res.
	(darwin_read_write_inferior): Update comment.
	(darwin_read_dyld_info): New function.
	(darwin_xfer_partial): Handle DYLD_INFO.
2011-09-27 15:30:18 +00:00
Stan Shebs 6710bf39b7 Add return address collection for tracepoints.
* tracepoint.c (encode_actions_1): Add case for $_ret.
	(validate_actionline): Check for $_ret.
	(trace_dump_actions): Ditto.
	* ax-gdb.h (gen_trace_for_return_address): Declare.
	* ax-gdb.c: Include arch-utils.h.
	(gen_trace_for_return_address): New function.
	(agent_command): Add return address special case.
	* amd64-tdep.c: Include ax.h and ax-gdb.h.
	(amd64_gen_return_address): New function.
	(amd64_init_abi): Call it.
	* i386-tdep.c: Include ax.h and ax-gdb.h.
	(i386_gen_return_address): New function.
	(i386_init_abi): Call it.
	* arch-utils.h (default_gen_return_address): Declare.
	* arch-utils.c (default_gen_return_address): New function.
	* gdbarch.sh (gen_return_address): New method.
	* gdbarch.h, gdbarch.c: Regenerate.

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

	* gdb.trace/collection.exp: Test collection of $_ret.
2011-09-27 13:09:37 +00:00
gdbadmin efc7c64ad1 *** empty log message *** 2011-09-27 00:00:02 +00:00
gdbadmin 1781ecd0cb *** empty log message *** 2011-09-26 00:00:33 +00:00
gdbadmin 5b2148d58f *** empty log message *** 2011-09-25 00:00:02 +00:00
gdbadmin 8f4b00933a *** empty log message *** 2011-09-24 00:00:03 +00:00
Joseph Myers e04e5beb2e PR gdb/13079
* i386-tdep.c (i386_frame_align): New.
	(i386_gdbarch_init): Use i386_frame_align.
2011-09-23 14:50:30 +00:00
Yao Qi f3d6df6d3a gdb/
* i386-linux-nat.c (i386_linux_resume): Use read_memory_unsigned_integer
	to get address.
2011-09-23 07:27:19 +00:00
gdbadmin 1cd16a81ad *** empty log message *** 2011-09-23 00:00:02 +00:00
Tristan Gingold e69860f1b6 2011-09-22 Tristan Gingold <gingold@adacore.com>
* fork-child.c (fork_inferior): Add exec_fun parameter.
	Call exec_fun or execvp.
	* inferior.h: Adjust prototype.
	* gnu-nat.c (gnu_create_inferior): Adjust fork_inferior call.
	* inf-ttrace.c (inf_ttrace_create_inferior): Ditto.
	* inf-ptrace.c (inf_ptrace_create_inferior): Ditto.
	* procfs.c (procfs_create_inferior): Ditto.
	* darwin-nat.c (darwin_execvp): New function.
	(darwin_create_inferior): Use it.
2011-09-22 10:22:28 +00:00
Andreas Tobler b2a6bdebec 2011-09-22 Andreas Tobler <andreast@fgznet.ch>
* lib/gdb.exp (gdb_compile): Set rpath and remove -ldl from the
	list of compilation switches for <*-*-freebsd*>.
2011-09-22 04:58:22 +00:00
Yao Qi 4b51d87b48 gdb/
* infrun.c (context_switch): Print debug message when switching to
	a different thread.
2011-09-22 02:58:31 +00:00
gdbadmin e506952ffc *** empty log message *** 2011-09-22 00:00:03 +00:00
Ulrich Weigand 56b9d9ac05 * s390-tdep.c (s390_function_arg_pass_by_reference): Handle
complex and vector types.
	(s390_return_value_convention): Likewise.

	(s390_value_from_register): Call check_typedef.
	(extend_simple_arg): Likewise.
	(alignment_of): Likewise.
	(s390_push_dummy_call): Likewise.
	(s390_return_value): Likewise.
2011-09-21 17:00:31 +00:00
Ulrich Weigand 55329a5ca8 Fix ChangeLog dates. 2011-09-21 16:49:14 +00:00
Ulrich Weigand 71487fd776 * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
(arm_linux_hwbp_cap): New static variable.
	(arm_linux_get_hwbp_cap): Replace by ...
	(arm_linux_init_hwbp_cap): ... this new function.
	(arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
	(arm_linux_get_hw_watchpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_max_length): Likewise.
	(arm_arch_setup): Call arm_linux_init_hwbp_cap.
	(arm_prepare_to_resume): Use perror_with_name instead of error.
2011-09-21 16:15:27 +00:00
Joseph Myers b2cd6b2948 * event-top.c (async_disconnect): If an exception is thrown from
quit_cover, call pop_all_targets.  Use TRY_CATCH instead of
	catch_errors.
	* top.c (quit_cover): Return void and take no arguments.
	* top.h (quit_cover): Update prototype.
2011-09-21 15:21:28 +00:00
Ulrich Weigand 09b4ad9fcb * linux-arm-low.c: Include <signal.h>.
(PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
	(struct arm_linux_hwbp_cap): New data type.
	(arm_hwbp_type, arm_hwbp_control_t): New typedefs.
	(struct arm_linux_hw_breakpoint): New data type.
	(MAX_BPTS, MAX_WPTS): Define.
	(struct arch_process_info, struct arch_lwp_info): New data types.
	(arm_linux_get_hwbp_cap): New function.
	(arm_linux_get_hw_breakpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_max_length): Likewise.
	(arm_hwbp_control_initialize): Likewise.
	(arm_hwbp_control_is_enabled): Likewise.
	(arm_hwbp_control_is_initialized): Likewise.
	(arm_hwbp_control_disable): Likewise.
	(arm_linux_hw_breakpoint_equal): Likewise.
	(arm_linux_hw_point_initialize): Likewise.
	(struct update_registers_data): New data structure.
	(update_registers_callback: New function.
	(arm_insert_point): Likewise.
	(arm_remove_point): Likewise.
	(arm_stopped_by_watchpoint): Likewise.
	(arm_stopped_data_address): Likewise.
	(arm_new_process): Likewise.
	(arm_new_thread): Likewise.
	(arm_prepare_to_resume): Likewise.
	(the_low_target): Register arm_insert_point, arm_remove_point,
	arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
	arm_new_thread, and arm_prepare_to_resume.
2011-09-21 12:39:50 +00:00
gdbadmin fc436fd907 *** empty log message *** 2011-09-21 00:00:33 +00:00
Joseph Myers 67ba4e42a0 * mi/mi-main.c (mi_load_progress): Restore saved_uiout value to
current_uiout, not uiout.
2011-09-20 15:19:28 +00:00
gdbadmin 34082fcaca *** empty log message *** 2011-09-20 00:00:03 +00:00
Doug Evans 562f943bcc * python/py-auto-load.c (source_section_scripts): Fix file
descriptor leak.
	* python/python.c (source_python_script_for_objfile): Tweak comments.
2011-09-19 19:01:40 +00:00
Stan Shebs 3c9057f381 * gdb.trace/tspeed.exp: New file.
* gdb.trace/tspeed.c: New file.
2011-09-19 16:55:26 +00:00
Kevin Pouget 0672bf414a [OBV] fix typos in ChangeLog 2011-09-19 10:50:53 +00:00
gdbadmin d061e45b9a *** empty log message *** 2011-09-19 00:00:32 +00:00
Yao Qi 3451853062 Support displaced stepping for Thumb 16-bit insns.
gdb/
	* arm-tdep.c (THUMB_NOP) Define.
	(thumb_copy_unmodified_16bit): New.
	(thumb_copy_b, thumb_copy_bx_blx_reg): New.
	(thumb_copy_alu_reg): New.
	(arm_copy_svc): Move some common code to ...
	(install_svc): ... here.  New.
	(thumb_copy_svc): New.
	(install_pc_relative): New.
	(thumb_copy_pc_relative_16bit): New.
	(thumb_decode_pc_relative_16bit): New.
	(thumb_copy_16bit_ldr_literal): New.
	(thumb_copy_cbnz_cbz): New.
	(cleanup_pop_pc_16bit_all): New.
	(thumb_copy_pop_pc_16bit): New.
	(thumb_process_displaced_16bit_insn): New.
	(thumb_process_displaced_32bit_insn): New.
	(thumb_process_displaced_insn): process thumb instruction.

	Support displaced stepping for Thumb 32-bit insns.
	gdb/
	* arm-tdep.c (thumb_copy_unmodified_32bit): New.
	(thumb2_copy_preload): New.
	(thumb2_copy_copro_load_store): New.
	(thumb2_copy_b_bl_blx): New.
	(thumb2_copy_alu_imm): New.
	(thumb2_copy_load_reg_imm): New.
	(thumb2_copy_load_literal): New
	(thumb2_copy_block_xfer): New.
	(thumb_32bit_copy_undef): New.
	(thumb_32bit_copy_unpred): New.
	(thumb2_decode_ext_reg_ld_st): New.
	(thumb2_decode_svc_copro): New.
	(decode_thumb_32bit_store_single_data_item): New.
	(thumb_copy_pc_relative_32bit): New.
	(thumb_decode_pc_relative_32bit): New.
	(decode_thumb_32bit_ld_mem_hints): New.
	(thumb2_copy_table_branch): New
	(thumb_process_displaced_32bit_insn): Process Thumb 32-bit
	instructions.

	gdb/testsuite/
	* gdb.arch/arm-disp-step.S (test_ldr_literal): Test for Thumb
	instructions.
	(test_adr_32bit, test_pop_pc): Likewise.
	(test_ldr_literal_16, test_cbz_cbnz, test_adr): New test for
	Thumb instructions.
	* gdb.arch/arm-disp-step.exp (test_ldm_stm_pc): Match $gdb_prompt
	in gdb_test_multiple.
	(test_ldr_literal_16, test_cbz_cbnz, test_adr): New.
2011-09-18 14:34:55 +00:00
Yao Qi 2b16b2e33b gdb/
* arm-tdep.c (install_copro_load_store): PC is set 4-byte aligned.
	(install_b_bl_blx): Likewise.
2011-09-18 14:18:07 +00:00
Yao Qi ab254057b8 gdb/testsuite/
* lib/gdb.exp (can_single_step_to_signal_handler): New.
	* gdb.base/kill-after-signal.exp: Call it.  Skip if target doesn't
	support single step to signal handler.
2011-09-18 02:36:27 +00:00
gdbadmin f5b1e24db0 *** empty log message *** 2011-09-18 00:00:32 +00:00
Yao Qi 0f6f04bad9 gdb/
* arm-tdep.c (install_ldr_str_ldrb_strb): Renamed to ...
        (install_load_store): ... this.  New.
        Change parameter BYTE to SIZE.
        (arm_copy_ldr_str_ldrb_strb): Update caller.
        (arm_decode_ld_st_word_ubyte): Update caller.
2011-09-17 14:37:59 +00:00
Yao Qi 9c317b7184 gdb/testsuite/
* gdb.base/disp-step-fork.c: New.
	* gdb.base/disp-step-syscall.exp: New.
	* gdb.base/disp-step-vfork.c: New.
2011-09-17 13:34:01 +00:00
Yao Qi e2d966398c gdb/
* infrun.c (displaced_step_fixup): Move some code ...
	(displaced_step_restore): ... here.  New function.
	(handle_inferior_event): Cleanup displaced stepping state for both
	child and parent when get forked or vforked event.
	* regcache.c (get_thread_arch_aspace_regcache): New function.
	get_thread_arch_regcache (): Call it.
2011-09-17 13:29:32 +00:00
gdbadmin f8c9c016f7 *** empty log message *** 2011-09-17 00:00:03 +00:00
Joel Brobecker a812315168 [Ada] Re-implement `info tasks' command using ui-out
This is in preparation for providing a GDB/MI equivalent of
the `info tasks' command.  The previous implementation was using
various printf commands to generate the command output, which
does not work at all if we want to use that same code to generate
the result for that new GDB/MI command.

This patch thus re-implements the `info tasks' command (with no
arguments) in a way that makes it GDB/MI friendly.

There is an additional hicup, which is the fact that the `info tasks'
command displays a completely different type of output when a task
ID is given. For instance:

    (gdb) info task 2
    Ada Task: 0x644d20
    Name: my_callee
    Thread: 0
    LWP: 0x5809
    Parent: 1 (main_task)
    Base Priority: 48
    State: Blocked in accept or select with terminate

The above output is better when in CLI mode, but really not
what we want when in GDB/MI mode. In GDB/MI mode, we want to
follow what the `-thread-info' command does when a task-id
is given as an argument, which is to produce the same table,
but with only one element/task in it.

For compatibility as well as practical reasons, we do not want
to change the output of the `info task TASKNO' command when in
CLI mode.  But it's easy to preserve this behavior while providing
the desirable output when in GDB/MI mode.  For this, the function
used to generated the `info tasks' output has been enhanced to take
an argument interpreted as a string. The CLI command knows to never
provide that argument, while the GDB/MI command will pass one if
provided by the user.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): New function, merging
        short_task_info and info_tasks together.  Reimplement using
        ui-out instead of printing to stdout directly.  Move the code
        building and checking the task list here, instead of leaving it
        in info_tasks_command.
        (info_task): Move the code building and checking the task
        list here, instead of leaving it in info_tasks_command.
        (info_tasks_command): Delete code building and checking
        the task list - moved elsewhere.  Update calls to info_tasks
        and info_task.

One of the minor changes the switch caused is the introduction
of a space between the "current" column, and the task "ID"
column, which wasn't there before.  This matches what we do
in the "info threads" command, so I kept that change.  This
required an adjustment in the testsuite, however...

gdb/testsuite/ChangeLog:

        * gdb.ada/tasks.exp: Make the expected output for
        the `info tasks' tests more resilient to spacing
        changes.
2011-09-16 19:09:57 +00:00
Joel Brobecker fbf0682413 [Ada] Remove `from_tty' parameter from ada-tasks.c:info_task
This parameter is unused, and probably will never be useful.

gdb/ChangeLog:

        * ada-tasks.c (info_task): Delete parameter `from_tty'.
2011-09-16 19:09:43 +00:00
Joel Brobecker 34a0bc90f4 [Ada] Remove `from_tty' parameter from ada-tasks.c:info_tasks
This parameter is unused, and probably will never be useful.

gdb/ChangeLog:

        * ada-tasks.c (info_tasks): Delete parameter `from_tty'.
2011-09-16 19:09:34 +00:00
Joel Brobecker 79779fa90b [Ada] Adjust ada-tasks.c:ada_build_task_list
Originally, this function had a parameter called `warn_if_null'
which would trigger a message to be printed on stdout if the
program was found to not use Ada tasking.  It used one of the printf_
functions for that, which is wrong when considering the context of
GDB/MI interpreters.

So, this patch changes this function to stop printing the message,
and leaves that part to the callers instead.  It also changes the
semantics slightly to return the number of tasks found, rather than
a yes/no answer.  Not strictly needed, but simple enough to do, and
potentially useful later.

gdb/ChangeLog:

        * ada-lang.h (ada_build_task_list): Remove parameter
        `warn_if_null'.
        * ada-tasks.c (ada_build_task_list): Remove parameter
        `warn_if_null'.  Adjust implementation and documentation.
        (valid_task_id, ada_get_environment_task)
        iterate_over_live_ada_tasks): Adjust call to ada_build_task_list.
        (info_tasks_command): Adjust implementation.
        (task_command): Likewise.
        * ravenscar-thread.c (ravenscar_find_new_threads): Fix call
        to ada_build_task_list.
2011-09-16 19:09:26 +00:00
Joel Brobecker e225eb91c1 [Ada] Store the Ada task list in per-inferior data
Instead of storing "the" Ada task list using a static global
in ada-tasks, this patch stores that information inside
per-inferior data.

We also add in the per-inferior data the location and type of
data used in the runtime to store that task list.  Previously,
this information was saved as a static variable in one of the
functions, but this approach has the major flaw that it does
not handle multi-inferior debugging.

gdb/ChangeLog:

        * ada-tasks.c (ada_tasks_check_symbol_table, task_list): Delete.
        (enum ada_known_tasks_kind, struct ada_tasks_inferior_data): New.
        (ada_tasks_inferior_data_handle): New static global.
        (get_ada_tasks_inferior_data): New function.
        (ada_get_task_number, get_task_number_from_id, valid_task_id)
        (ada_get_environment_task, iterate_over_live_ada_tasks)
        (add_ada_task, read_known_tasks_array, read_known_tasks_list):
        Adjust.
        (ada_set_current_inferior_known_tasks_addr): New function.
        (read_known_tasks, ada_build_task_list, short_task_info)
        (info_tasks, info_task, info_tasks_command, task_command_1)
        (task_command, ada_task_list_changed): Adjust.
        (ada_tasks_invalidate_inferior_data): New function.
        (ada_normal_stop_observer, ada_new_objfile_observer): Adjust.
        (_initialize_tasks): Set ada_tasks_inferior_data_handle.
        * ada-lang.h (struct inferior): Add declaration.
        (ada_task_list_changed): Update profile.
        * remote-wtx-pd.c: #include "inferior.h".
        (switch_to_pd_internal): Update call to ada_task_list_changed.
2011-09-16 19:09:17 +00:00
Joel Brobecker 6da9ca05ac [Ada] Make the ATCB type info program-space-specific
This module caches the type description of various elements of
the Ada Task Control Block (ATCB). This cache was implemented
as static globals, which is wrong in the case where we have
multiple inferiors. This change cleans things up a bit by moving
some of these static globals to a per-program-space area.

gdb/ChangeLog:

        * ada-tasks.c: #include "progspace.h" and "objfiles.h".
        (atcb_type, atcb_common_type, atcb_ll_type, atcb_call_type)
        (atcb_fieldno): Delete these static globals.
        (struct ada_tasks_pspace_data): New struct.
        (ada_tasks_pspace_data_handle): New static global.
        (get_ada_tasks_pspace_data): New function.
        (ada_tasks_invalidate_pspace_data): New function.
        (get_tcb_types_info, ptid_from_atcb_common, read_atcb)
        (read_known_tasks_list, ada_new_objfile_observer): Adjust.
        (_initialize_tasks): Create this module's per-progspace
        data handle.
2011-09-16 19:09:07 +00:00
Joel Brobecker dccd3cbdab [Ada] Rename struct tcb_fieldnos into atcb_fieldnos.
`atcb' is clearer than `tcb', as it stands for Ada Task Control
Block. This is also consistent with the rest of the code, which
uses atcb...

gdb/ChangeLog:

        * ada-tasks.c (struct atcb_fieldnos): Renames struct tcb_fieldnos.
2011-09-16 19:08:50 +00:00
Tristan Gingold f877b031e8 2011-09-16 Tristan Gingold <gingold@adacore.com>
* fork-child.c (fork_inferior): Update comment.  Use alloca
	instead of xmalloc for argv.  Move len and shell_command
	declarations in the block where they are used.
	Only call execvp.  Factorize failure code.
2011-09-16 15:41:09 +00:00
Jan Kratochvil ae0c443d84 gdb/
Code cleanup.
	* parse.c (write_exp_elt): Change argument to pass a pointer of union
	`exp_element' instead of an element of the same and make the function
	static.
	(write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_block)
	(write_exp_elt_objfile, write_exp_elt_longcst, write_exp_elt_dblcst)
	(write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_elt_intern):
	Change argument of `write_exp_elt' function call.
	Remove extra spaces from comments.
	* parser-defs.h (write_exp_elt): Remove prototype.
2011-09-16 14:36:55 +00:00
Hui Zhu d99f7e4842 2011-09-16 Hui Zhu <teawater@gmail.com>
* gdb.texinfo (Tracepoint Restrictions): Change *$esp@300
	to *(unsigned char *)$esp@300.
2011-09-16 09:07:01 +00:00
Jan Kratochvil 63a9aad80e gdb/testsuite/
* gdb.python/py-evthreads.exp (Run to breakpoint 1)
	(reached breakpoint 2, reached breakpoint 3): Update expected output.
2011-09-16 07:34:27 +00:00
gdbadmin d0bc107f79 *** empty log message *** 2011-09-16 00:00:33 +00:00
Stan Shebs 6b9801d456 * server.h (struct emit_ops): Add compare-goto fields.
* tracepoint.c (gdb_agent_op_sizes): New table.
	(emit_eq_goto): New function.
	(emit_ne_goto): New function.
	(emit_lt_goto): New function.
	(emit_le_goto): New function.
	(emit_gt_goto): New function.
	(emit_ge_goto): New function.
	(is_goto_target): New function.
	(compile_bytecodes): Recognize special cases of compare-goto
	combinations and call specialized emitters for them.
	* linux-x86-low.c (amd64_emit_eq_goto): New function.
	(amd64_emit_ne_goto): New function.
	(amd64_emit_lt_goto): New function.
	(amd64_emit_le_goto): New function.
	(amd64_emit_gt_goto): New function.
	(amd64_emit_ge_goto): New function.
	(amd64_emit_ops): Add the new functions.
	(i386_emit_eq_goto): New function.
	(i386_emit_ne_goto): New function.
	(i386_emit_lt_goto): New function.
	(i386_emit_le_goto): New function.
	(i386_emit_gt_goto): New function.
	(i386_emit_ge_goto): New function.
	(i386_emit_ops): Add the new functions.
2011-09-15 22:54:13 +00:00
Paul Koning 5af65ec072 * python/py-cmd.c (gdbpy_string_to_argv): Decrement reference
count of item appended to list.
* python/py-type.c (typy_fields): Likewise.
2011-09-15 18:33:15 +00:00
Paul Koning 883640a804 Fix ChangeLog typo 2011-09-15 17:20:56 +00:00
Paul Koning d812018b48 * gdb.texinfo: Make style of Python functions and methods match
the syntax of Python.  Also put class and module names explicitly
on function, member, and variable names, matching Python
documentation conventions.
2011-09-15 16:09:42 +00:00
Joel Brobecker d93db82c58 Add period at end of sentence in top entry. 2011-09-15 15:49:53 +00:00
Paul Koning 72be8ccc5e MAINTAINERS (Right After Approval): Add myself to the list 2011-09-15 15:40:22 +00:00
Kevin Pouget 92f6badcc0 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR threads/12628
	* linux-fork.c (checkpoint_command): Disallow checkpointing of
	processes with multiple threads.
	(inf_has_multiple_thread_cb): New function.
	(inf_has_multiple_threads): New function.
2011-09-15 12:47:07 +00:00
Kevin Pouget 2aa483373c 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* python/py-inferior.c (GdbMethods): New Python method definition.

doc:
	PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* gdb.texinfo (Inferiors In Python): Describe new
	gdb.selected_inferior() function.

testsuite:
	PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior().
2011-09-15 12:42:30 +00:00
Kevin Pouget 6839b47f2b 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
Handle multiple breakpoint hits in Python interface:
	* python/py-bpevent.c (create_breakpoint_event_object): Rename C/Python
	variable to breakpoints.
	* python/py-stopevent.c (emit_stop_event): Return a Python tuple of
	bps instead of single breakpoint. Fix some space typos.
	* python/py-stopevent.c (create_breakpoint_event_object): Rename
	variable to breakpoints.

testsuite:
	* gdb.python/py-events.exp: Set a duplicate breakpoint and check its
	presence.
	* gdb.python/py-events.py (breakpoint_stop_handler): Browse all the
	breakpoint hits.

doc:
	* gdb.texinfo (Events In Python): New function documentation:
	gdb.BreakpointEvent.breakpoints. Indicate that
	gdb.BreakpointEvent.breakpoint is now deprecated.
2011-09-15 12:27:20 +00:00
Kevin Pouget 672f9b6009 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
* breakpoint.c (describe_other_breakpoints): Do not write 'duplicate'
	note if the breakpoint is internal.
2011-09-15 12:18:29 +00:00
Kevin Pouget 43675ae423 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
* MAINTAINERS (Right After Approval): Add myself to the list
2011-09-15 11:53:03 +00:00
gdbadmin 2613efea9b *** empty log message *** 2011-09-15 00:00:02 +00:00
Pedro Alves 15148d6a1d 2011-09-14 Pedro Alves <pedro@codesourcery.com>
* infrun.c (prepare_for_detach, wait_for_inferior)
	(fetch_inferior_event): Don't flush the register cache.
	* remote.c (struct stop_reply) <regcache>: Add comment.
2011-09-14 12:26:29 +00:00
gdbadmin bc99db5140 *** empty log message *** 2011-09-14 00:00:33 +00:00
Jan Kratochvil d83e736b11 gdb/
Remove excessive DWARF expressions memory duplication.
	* dwarf2loc.c (per_cu_dwarf_call): Remove variable back_to and its use
	for block.data.
	(indirect_pieced_value): Remove variable result.  Remove variable
	back_to and its use for baton.data.
	(dwarf2_compile_expr_to_ax): Remove variable back_to and its use for
	block.data.
	* dwarf2read.c (dwarf2_fetch_die_location_block): Remove xmemdup.
	Update the function comment.
2011-09-13 21:44:27 +00:00
Jan Kratochvil 0935723e5e gdb/testsuite/
* gdb.python/py-events.exp: Remove pretty printing comment.
	* gdb.python/py-evsignal.exp: New file.
	* gdb.python/py-evthreads.c: Include signal.h.
	(thread3): Remove variable count3.  Remove variable bad and use raise
	instead.
	(thread2): Remove variable count2.  Move thread3 pthread_create here,
	merge pthread_join to a single line.
	(main): Remove variable count1.  Merge pthread_join with pthread_create
	to a single line.
	* gdb.python/py-evthreads.exp: Remove pretty printing comment.  New
	KFAIL python/12966 for gdbserver.  Test return value of
	gdb_compile_pthreads.  Use gdb_run_cmd.  Replace send_gdb and
	gdb_expect by gdb_test and gdb_test_multiple.
	(thread 2, thread 3): New tests.
2011-09-13 21:39:59 +00:00
Pedro Alves c65b3e0d43 2011-09-13 Pedro Alves <pedro@codesourcery.com>
* inferior.h (ALL_INFERIORS): New.
	* linux-thread-db.c (thread_db_find_new_threads_2): Remove check
	for a stopped thread.
	(thread_db_find_new_threads): Look for threads in all inferiors.
2011-09-13 19:27:01 +00:00
Pedro Alves a1398e0c56 2011-09-13 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (update_watchpoint): Handle the case of the
	watchpoint to update not being in the breakpoint list yet.
	(hw_watchpoint_use_count): New, factored out from
	hw_watchpoint_used_count.
	(hw_watchpoint_used_count): Rename to ...
	(hw_watchpoint_used_count_others): ... this.  Add `except'
	parameter.  Don't count resources of `except'.  Use
	hw_watchpoint_use_count.
2011-09-13 16:37:13 +00:00
Pedro Alves 305962315a 2011-09-13 Pedro Alves <pedro@codesourcery.com>
* gdbthread.h (enum thread_state): Moved here.
	(struct thread_info): Rename `executing_' field to `executing' and
	`state_' to `state'.
	* thread.c (enum thread_state): Moved to gdbthread.h.
	(new_thread, add_thread_silent, delete_thread_1)
	(any_live_thread_of_process, thread_alive, set_running)
	(set_running, is_thread_state, any_running, is_executing)
	(set_executing, finish_thread_state, print_thread_info)
	(do_captured_thread_select): Adjust.
2011-09-13 14:48:55 +00:00
Jan Kratochvil bede5f5f81 gdb/
Fix compatibility with gcc < 4.3 and non-gcc compilers.
	* amd64-tdep.c (amd64_skip_xmm_prologue): Convert 0b constants.
2011-09-13 08:26:11 +00:00
gdbadmin 43e4b79620 *** empty log message *** 2011-09-13 00:00:02 +00:00
Pedro Alves 4801a9a356 gdb/
2011-09-12  Pedro Alves  <pedro@codesourcery.com>
	    Matt Rice  <ratmice@gmail.com>

	PR gdb/13175

	* interps.c (struct interp) <interpreter_out>: Delete field.
	(interp_new): Remove the data and uiout parameters and adjust.
	(interp_set): Only set the current_uiout from the interpreter's
	uiout after initializing the interpreter.  Adjust call to
	init_proc.
	(interp_ui_out): Adjust to call procs->ui_out_proc.
	(interp_data, interp_name): New.
	* interps.h (interp_init_ftype): Add `self' parameter.
	(interp_ui_out_ftype): New typedef.
	(struct interp_procs) <ui_out_proc>: New method pointer.
	(interp_new): Remove the data and uiout parameters.
	(interp_data, interp_name): Declare.
	* tui/tui-interp.c (tui_init): Adjust prototype.
	(tui_ui_out): New.
	(_initialize_tui_interp): Install tui_ui_out.  Don't instanciate
	tui_out here.  Adjust call to interp_new.
	* tui/tui-io.c (tui_initialize_io): Don't set current_uiout here.
	* cli/cli-interp.c (cli_interpreter_init): Adjust prototype.
	(cli_ui_out): New.
	(_initialize_cli_interp): Install it.  Adjust call to interp_new.
	* mi/mi-common.h (struct mi_interp) <uiout>: New field.
	* mi/mi-interp.c (mi_interpreter_init): Adjust prototype.
	Initialize mi->uiout depending on the mi_version as extracted from
	the interpreter's name.
	(mi_ui_out): New.
	(_initialize_mi_interp): Install mi_ui_out.  Adjust calls to
	interp_new.  Don't allocate the ui_out's of the interpreters here.

gdb/testsuite/
2011-09-12  Matt Rice  <ratmice@gmail.com>
	    Pedro Alves  <pedro@codesourcery.com>

	PR gdb/13175

	* gdb.base/interp.exp: New tests.
	* gdb.base/interp.c: New file.
2011-09-12 21:25:22 +00:00
Aleksandar Ristovski d0afda0369 * ChangeLog: Fix comment and date. 2011-09-12 19:02:01 +00:00
Aleksandar Ristovski 59145f8cfb * solib.c (solib_used): New function.
(update_solib_list, reload_shared_libraries_1): Check if objfile is used
    by another so_list object before freeing it.
2011-09-12 19:00:22 +00:00
Doug Evans 24ece742a0 * gdb.dwarf2/clztest.exp: Fix initialization of tests array.
* gdb.dwarf2/typeddwarf.exp: Ditto.
2011-09-12 18:07:22 +00:00
gdbadmin caa900384a *** empty log message *** 2011-09-12 00:00:33 +00:00
Jan Kratochvil bdaf8d4acd gdb/
Code cleanup.
	* mi/mi-cmd-stack.c (list_args_or_locals): Use enum for the parameter
	values.
2011-09-11 09:54:18 +00:00
gdbadmin d9ff937efe *** empty log message *** 2011-09-11 00:00:05 +00:00
gdbadmin 8f00849d11 *** empty log message *** 2011-09-10 00:00:03 +00:00
Jan Kratochvil df15bd07df gdb/
Code cleanup.
	* amd64-tdep.c (amd64_skip_prologue): Move the XMM code to ...
	(amd64_skip_xmm_prologue): ... this new function.  Describe its
	parameters.  No longer use amd64_prologue_line_bug.
	* defs.h (producer_is_gcc_ge_4): New declaration.
	* dwarf2read.c (producer_is_gcc_ge_4): Move to utils.c.
	(process_full_comp_unit): Update its caller.  Remove
	amd64_prologue_line_bug initialization.
	* symtab.h (struct symtab): Remove field amd64_prologue_line_bug.
	* utils.c (producer_is_gcc_ge_4): Moved here from dwarf2read.c.
2011-09-09 19:41:14 +00:00
Pedro Alves ddf17726b2 Fixup last entry.
2011-09-09  Pedro Alves  <pedro@codesourcery.com>

	* linux-nat.h (enum resume_kind): New.
	(struct lwp_info) <last_resume_kind>: New field.
	* linux-nat.c (linux_child_follow_fork): Set last_resume_kind to
	resume_stop on the new lwp.
	(add_lwp): Set last_resume_kind as resume_continue by default.
	(lin_lwp_attach_lwp): Set last_resume_kind as resume_stop.
	(resume_lwp): New, factored out from resume_callback.  Also check
	for pending status in lp->waitstatus.
	(resume_callback): Reimplement.
	(resume_clear_callback): Set last_resume_kind as resume_stop.
	(resume_set_callback): Set last_resume_kind as resume_continue.
	(linux_nat_resume, linux_handle_extended_wait): Set
	last_resume_kind.
	(running_callback): Also check lp->waitstatus for pending events.
	(select_singlestep_lwp_callback): Check that lp->last_resume_kind
	is resume_step.
	(stop_and_resume_callback): Don't re-resume if the core wanted the
	lwp stopped.  Use resume_lwp instead of resume_callback.  Avoid
	using an invalidated pointer.
	(linux_nat_filter_event): Don't discard SIGSTOPs as delayed
	SIGSTOPs if the core wanted the LWP to stop.
	(linux_nat_wait_1) Don't consume a pending SIGSTOP if the core
	wanted the lwp to stop.  If the core wanted the lwp to stop, and
	the lwp stopped with a SIGSTOP, report a TARGET_SIGNAL_0 instead
	of TARGET_SIGNAL_STOP.
	(linux_nat_stop_lwp): Don't synchronously wait for the lwp to stop
	here.  Instead, signal the lwp, and set the last_resume_kind to
	resume_stop.
2011-09-09 19:29:51 +00:00
Pedro Alves 25289eb274 2011-09-09 Pedro Alves <pedro@codesourcery.com>
* linux-nat.h (enum resume_kind): New.
	(struct lwp_info) <last_resume_kind>: New field.
	(linux_child_follow_fork): Set last_resume_kind to resume_stop on
	the new lwp.
	(add_lwp): Set last_resume_kind as resume_continue by default.
	(lin_lwp_attach_lwp): Set last_resume_kind as resume_stop.
	(resume_lwp): New, factored out from resume_callback.  Also check
	for pending status in lp->waitstatus.
	(resume_callback): Reimplement.
	(resume_clear_callback): Set last_resume_kind as resume_stop.
	(resume_set_callback): Set last_resume_kind as resume_continue.
	(linux_nat_resume, linux_handle_extended_wait): Set
	last_resume_kind.
	(running_callback): Also check lp->waitstatus for pending events.
	(select_singlestep_lwp_callback): Check that lp->last_resume_kind
	is resume_step.
	(stop_and_resume_callback): Don't re-resume if the core wanted the
	lwp stopped.  Use resume_lwp instead of resume_callback.  Avoid
	using an invalidated pointer.
	(linux_nat_filter_event): Don't discard SIGSTOPs as delayed
	SIGSTOPs if the core wanted the LWP to stop.
	(linux_nat_wait_1) Don't consume a pending SIGSTOP if the core
	wanted the lwp to stop.  If the core wanted the lwp to stop, and
	the lwp stopped with a SIGSTOP, report a TARGET_SIGNAL_0 instead
	of TARGET_SIGNAL_STOP.
	(linux_nat_stop_lwp): Don't synchronously wait for the lwp to stop
	here.  Instead, signal the lwp, and set the last_resume_kind to
	resume_stop.
2011-09-09 19:27:50 +00:00
Pedro Alves f687d03564 2011-09-09 Pedro Alves <pedro@codesourcery.com>
* linux-nat.c (lin_lwp_attach_lwp): Return 1 (ignore) instead of
	-1 (error), if the lwp exits right after attaching.
2011-09-09 19:20:24 +00:00
gdbadmin 5f246d3146 *** empty log message *** 2011-09-09 00:00:02 +00:00
Stan Shebs bf15cbda54 * linux-x86-low.c (i386_emit_prologue): Save %ebx.
(i386_emit_epilogue): Restore %ebx.
2011-09-08 22:38:29 +00:00
Doug Evans 63d97a2024 * py-cmd.c: Some minor formatting fixes.
(gdbpy_parse_command_name): Rename text arg to name, make const.
	All callers updated.
	* python-internal.h (gdbpy_parse_command_name): Update.
2011-09-08 19:51:27 +00:00
Jan Kratochvil 7f06221767 gdb/testsuite/
Fix compatibility with x32 arch.
	* testsuite/gdb.dwarf2/typeddwarf.exp: Check also is_lp64_target.
	* testsuite/gdb.trace/backtrace.exp: Use is_amd64_regs_target and
	is_x86_like_target.
	* testsuite/gdb.trace/collection.exp: Likewise.
	* testsuite/gdb.trace/report.exp: Likewise.
	* testsuite/gdb.trace/unavailable.exp: Likewise.
	* testsuite/gdb.trace/while-dyn.exp: Likewise.
	* testsuite/lib/gdb.exp (is_amd64_regs_target): New function.
	(is_x86_like_target): Check also is_amd64_regs_target.
2011-09-08 17:40:54 +00:00
Doug Evans bc587a6bd2 * cli/cli-decode.c (add_cmd): Add comment. 2011-09-08 17:20:43 +00:00
Jan Kratochvil 08711b9a36 gdb/
PR breakpoints/12435
	* amd64-tdep.c (amd64_skip_prologue): New variables start_pc_sal,
	next_sal, buf, offset and xmmreg.  Advance PC if it sees the PR.
	* dwarf2read.c (process_full_comp_unit): Initialize
	amd64_prologue_line_bug.
	* symtab.h (struct symtab): New field amd64_prologue_line_bug.

gdb/testsuite/
	PR breakpoints/12435
	* gdb.arch/amd64-prologue-xmm.c: New file.
	* gdb.arch/amd64-prologue-xmm.exp: New file.
	* gdb.arch/amd64-prologue-xmm.s: New file.
2011-09-08 15:38:16 +00:00
Jan Kratochvil b2e7f004c7 gdb/
Fix TUI screen corruption.
	* utils.c (fputs_maybe_filtered): Replace !input_from_terminal_p by
	batch_flag.
2011-09-08 15:27:46 +00:00
Jan Kratochvil 8afd712c6f gdb/
* findvar.c (read_var_value): Never return NULL, throw an error
	instead.  Update the function comment.  State symbol name in the error
	messages.
	* python/py-frame.c (frapy_read_var): Remove handling of NULL from
	read_var_value.
	* stack.c (print_frame_args): Likewise.
	* valops.c (value_of_variable): Likewise.
2011-09-08 15:26:08 +00:00
Jan Kratochvil b99b5f66e1 gdb/
* stack.c (print_frame_args): New variable except.  Wrap
	read_var_value and common_val_print into TRY_CATCH.

gdb/testsuite/
	* gdb.dwarf2/dw2-param-error-main.c: New file.
	* gdb.dwarf2/dw2-param-error.S: New file.
	* gdb.dwarf2/dw2-param-error.exp: New file.
2011-09-08 15:24:25 +00:00
Pedro Alves a391a2f6df 2011-09-08 Pedro Alves <pedro@codesourcery.com>
* gdb.base/annota1.exp, gdb.base/annota3.exp: Extract the
	inferior's pid and look for a core dump named core.$pid.  Use
	`remote_file' commands on the host instead of hand coding shell
	commands on the build.
	* gdb.base/valgrind-db-attach.exp: Kill the program before
	finishing the test.
2011-09-08 14:56:34 +00:00
Jan Kratochvil 85bc8cb785 gdb/
* eval.c (evaluate_subexp_standard) <OP_THIS>: Update the value_of_this
	caller to value_of_this.
	* p-exp.y: Update the value_of_this caller to value_of_this_silent.
	Twice.
	* valops.c (value_of_this): Remove parameter complain and variable ret.
	Update function comment.  Never return NULL by this code.
	(value_of_this_silent): New function.
	* value.h (value_of_this): Remove parameter complain.
	(value_of_this_silent): New declaration.
2011-09-08 14:54:20 +00:00
gdbadmin f6c802f429 *** empty log message *** 2011-09-08 00:00:33 +00:00
Yao Qi ede1849f92 gdb/
* gdbthread.h (struct thread_info): Remove fields
	`stepping_through_solib_after_catch' and
	`stepping_through_solib_catchpoints'.
	* infrun.c (init_thread_stepping_state): Update.
	(process_event_stop_test, currently_stepping): Update.
	(currently_stepping_or_nexting_callback): Update.
2011-09-07 14:24:48 +00:00
Yao Qi 6aa27652a7 gdb/
* gdbthread.h (struct thread_info): Comment on field
	`step_after_step_resume_breakpoint'.
2011-09-07 13:36:47 +00:00
Pedro Alves 00db5b9440 2011-09-07 Abhijit Halder <abhijit.k.halder@gmail.com>
* remote.c (remote_console_output): Reindent.
2011-09-07 10:34:15 +00:00
Luis Machado 861152be0e 2011-09-06 Luis Machado <lgustavo@codesourcery.com>
* frame.c (has_stack_frames): Check for currently selected
	traceframe.
2011-09-07 02:33:58 +00:00
gdbadmin 78f6c05846 *** empty log message *** 2011-09-07 00:00:03 +00:00
Pedro Alves ab821bc647 2011-09-06 Pedro Alves <pedro@codesourcery.com>
* event-top.h (MAXPROMPTS, struct prompts): Delete.
	(set_async_annotation_level, set_async_prompt, pop_prompt)
	(push_prompt, new_async_prompt): Delete declarations.
	* top.h (get_prompt, set_prompt): Change prototype.
	(get_prefix, set_prefix, get_suffix, set_suffix): Delete
	declarations.
	* top.c (command_loop):
	(top_prompt): New global.
	(get_prefix, set_prefix, get_suffix, ): Delete.
	(get_prompt, set_prompt): Rewrite.
	(show_new_async_prompt): Rename to ...
	(show_prompt): ... this.
	(init_main): Adjust.  Don't handle --annotate=2 here.
	* event-top.c (new_async_prompt): Delete.
	(the_prompts): Delete.
	(more_to_come): Make static.
	(display_gdb_prompt): Use top_level_prompt() to compute the top
	level prompt, and don't notify the before_prompt observers
	directly here.  Always trick readline into not trying to display
	the prompt if sync_execution and displaying the primary prompt.
	If displaying a local/secondary prompt, always show it, even if
	sync_execution is set.
	(change_annotation_level): Delete.
	(top_level_prompt): New, based on change_annotation_level.
	(push_prompt, pop_prompt): Delete.
	(async_disable_stdin): No longer pushes prompt.
	(command_line_handler): No longer pushes or pops prompt.  If more
	input is expected, call display_gdb_prompt with an explicit empty
	prompt.
	(async_stop_sig): Adjust.
	(set_async_annotation_level, set_async_prompt): Delete.
	* python/python.c (before_prompt_hook): Adjust.
2011-09-06 14:49:00 +00:00
gdbadmin 79610daafd *** empty log message *** 2011-09-06 00:00:32 +00:00
Pedro Alves f1d90504dc 2011-09-05 Pedro Alves <pedro@codesourcery.com>
PR cli/13110

	* infrun.c (fetch_inferior_event): Check if there's a selected
	thread before checking if the selected thread is executing.
2011-09-05 15:46:34 +00:00
Pedro Alves 0f641c0119 2011-09-05 Pedro Alves <pedro@codesourcery.com>
* inf-loop.c (execute_command): Don't check if the current thread
	if running before synchronously waiting for command completion.
	* infrun.c (fetch_inferior_event): Handle "set exec-done-display"
	here.
	(normal_stop): Call async_enable_stdin here.
	* inf-loop.c (inferior_event_handler): Don't call
	async_enable_stdin, nor handle "set exec-done-display" here.
2011-09-05 14:53:13 +00:00
gdbadmin b1d6090346 *** empty log message *** 2011-09-05 00:00:02 +00:00
gdbadmin 30368258e9 GDB 7.3.1 released. 2011-09-04 19:10:40 +00:00
Joel Brobecker 3191627805 NEWS: Change `7.3' into `7.3.1' in `Changes since GDB 7.3'.
gdb/ChangeLog:

        * NEWS: Change `7.3' into `7.3.1' in `Changes since GDB 7.3'.
2011-09-04 17:48:51 +00:00
Joel Brobecker e8d56f1846 NEWS: Add entry for OpenBSD/NetBSD build failure
gdb/ChangeLog:

        * NEWS: Add entry for OpenBSD/NetBSD build failure
2011-09-04 17:41:40 +00:00
Joel Brobecker 26829f2bab GDB Manual edition number and ISBN updates
This is in preparation for a re-print by the FSF of the GDB manual.

gdb/doc/ChangeLog:

        * gdb.texinfo: Set EDITION to "Tenth" and change ISBN.
2011-09-04 17:08:56 +00:00
gdbadmin da89270c44 *** empty log message *** 2011-09-04 00:01:03 +00:00
gdbadmin 366fa8a499 *** empty log message *** 2011-09-03 00:00:02 +00:00
Jan Kratochvil 5dd05d8c5e gdb/
* config/s390/s390.mh (NATDEPFILES): Add linux-procfs.o dependency.
2011-09-02 21:40:30 +00:00
matt rice 7d8e6458d5 PR gdb/10720
* event-top.c (cli_command_loop): Replace readline setup with
direct call to display_gdb_prompt.
(display_gdb_prompt): Do not call observer mechanism during
synchronous execution.

testsuite:
* lib/prompt.exp: New file for testing the first prompt.
* gdb.python/py-prompt.exp: Ditto.
* gdb.python/py-prompt.c: Ditto (copy of ext-attach.c).
2011-09-02 21:16:54 +00:00
Pedro Alves 84636d2874 2011-09-02 Pedro Alves <pedro@codesourcery.com>
* linux-nat.c (in_pid_list_p): New.
	(linux_record_stopped_pid): Delete.
	(lin_lwp_attach_lwp): Check if PTRACE_ATTACH failed because we're
	already attached to the LWP.  Return an indication if so.
	(linux_nat_filter_event): Adjust.
	* linux-thread-db.c (attach_thread): Handle lin_lwp_attach_lwp
	returning an indication to ignore this thread.
2011-09-02 21:03:06 +00:00
Pedro Alves 68e77c9e30 2011-09-02 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
	* gdb.threads/gcore-thread.exp: Set the global core_supported to
	0, before testing gcore.
2011-09-02 19:21:02 +00:00
Pedro Alves b4a14fd09b 2011-09-02 Pedro Alves <pedro@codesourcery.com>
* top.c: Include interps.h.
	(execute_command): If the target can async, but the interpreter is
	in sync mode, synchronously wait for the command to finish before
	returning.
	(execute_command_to_string): Force the interpreter to sync mode.
	* infrun.c: Include interps.h.
	(fetch_inferior_event): Don't restore the prompt yet if the
	interpreter is in sync mode.
	* interps.c (interpreter_async): New global.
	* interps.h (interpreter_async): Declare.
	* inf-loop.c: Include interps.h.
	(inferior_event_handler): Don't print the language change or run
	breakpoint commands yet if the interpreter in is sync mode.
	* main.c (captured_command_loop): Flip the interpreter to async
	mode.
	* cli/cli-script.c: Include interps.h.
	(execute_user_command, while_command, if_command): Force the
	interpreter to sync mode.
	* python/python.c: Include interps.h.
	(python_command, execute_gdb_command): Force the interpreter to
	sync mode.
2011-09-02 16:56:30 +00:00
Pedro Alves c709acd150 2011-09-02 Pedro Alves <pedro@codesourcery.com>
gdb/
	* value.c (show_convenience): Catch errors thrown while printing
	each internal variable.
	* infrun.c (validate_siginfo_access): New function.
	(siginfo_value_read, siginfo_value_write): Call it.
2011-09-02 12:18:27 +00:00
gdbadmin 86362dfd53 *** empty log message *** 2011-09-02 00:00:33 +00:00
Jan Kratochvil df6dc84da9 gdb/testsuite/
* dw2-ifort-parameter-debug.S: Update copyright year.
	* dw2-ifort-parameter.c: Update copyright year.
	* dw2-ifort-parameter.exp: Update copyright year.

	* dw2-ifort-parameter-debug.S: New file.
	* dw2-ifort-parameter.c: New file.
	* dw2-ifort-parameter.exp: New file.
2011-09-01 07:19:40 +00:00
Jan Kratochvil 9655e94382 gdb/
Revert:
	2010-05-21  Pierre Muller  <muller@ics.u-strasbg.fr>
	* dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter
	attribute.

gdb/testsuite/
	* dw2-ifort-parameter-debug.S: New file.
	* dw2-ifort-parameter.c: New file.
	* dw2-ifort-parameter.exp: New file.
2011-09-01 07:17:46 +00:00
Jie Zhang 943ca1dd02 * server.c (step_thread): Remove definition.
(process_serial_event): Don't handle Hs.
	* server.h (step_thread): Remove declaration.
	* target.c (set_desired_inferior): Remove use of step_thread.
2011-09-01 03:14:10 +00:00
gdbadmin 02715440a5 *** empty log message *** 2011-09-01 00:00:03 +00:00
gdbadmin 859bc7c199 *** empty log message *** 2011-08-31 00:00:03 +00:00
Yao Qi cb457ae284 gdb/
* solib-dsbt.c (bfd_lookup_symbol): Removed.
	(cmp_name): New.
	(enable_break2): Update caller.
	* solib-frv.c (bfd_lookup_symbol): Removed.
	(cmp_name): New.
	(enable_break2): Update caller.
	* solib-pa64.c (bfd_lookup_symbol): Removed.
	(cmp_name): New.
	* solib-svr4.c (bfd_lookup_symbol): Removed.
	(cmp_name_and_sec_flags): New.
	(enable_break): Update caller.
	* solib.c (gdb_bfd_lookup_symbol_from_symtab): New.
	(gdb_bfd_lookup_symbol_from_dyn_symtab): New.
	(gdb_bfd_lookup_symbol): New.
	* solib.h: Functions declarations.
2011-08-30 02:48:05 +00:00
Yao Qi 83d1a36ae4 gdb/
* Makefile.in (ALL_TARGET_OBS): Add tic6x-tdep.o tic6x-linux-tdep.o
	and solib-dsbt.o.
2011-08-30 02:09:05 +00:00
gdbadmin 0f1e5c9c08 *** empty log message *** 2011-08-30 00:00:32 +00:00
Jan Kratochvil c04b3e8fc5 gdb/
Fix TUI stepi on code without symbols.
	* tui/tui-stack.c (tui_show_frame_info): Remove error, set LOW for
	current PC instead.
2011-08-29 16:55:16 +00:00
gdbadmin b2a1944f3c *** empty log message *** 2011-08-29 00:00:03 +00:00
Jan Kratochvil cb0fd152d6 gdb/
Code cleanup.
	* mi/mi-cmd-stack.c (list_args_or_locals): Remove stb initialization
	and the static keyword.
	* mi/mi-cmd-target.c (mi_cmd_target_file_get, mi_cmd_target_file_put):
	Make prefix an array.
	* mi/mi-cmd-target.c (mi_cmd_target_file_delete): Likewise.
	* mi/mi-main.c (get_register): Remove stb initialization and the static
	keyword.
2011-08-28 20:43:43 +00:00
Jan Kratochvil 9117472339 gdb/
Code cleanup - make mi_opt const.
	* mi/mi-cmd-break.c (mi_cmd_break_insert, mi_cmd_break_watch): Make
	opts const.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise.
	* mi/mi-cmd-env.c (mi_cmd_env_path): Likewise.
	(mi_cmd_env_dir): Likewise.
	* mi/mi-cmd-target.c (mi_cmd_target_file_get): Likewise.
	(mi_cmd_target_file_put): Likewise.
	* mi/mi-cmd-target.c (mi_cmd_target_file_delete): Likewise.
	* mi/mi-cmd-var.c (mi_cmd_var_evaluate_expression): Likewise.
	* mi/mi-getopt.c (mi_getopt): Make opts and opt const.
	(mi_valid_noargs): Make opts const.
	* mi/mi-getopt.h (mi_getopt): Make opts and opt const.
	* mi/mi-main.c (mi_cmd_list_thread_groups): Make opts const.
	(mi_cmd_data_read_memory): Likewise.
	(mi_cmd_data_read_memory_bytes): Likewise.
	(mi_cmd_data_write_memory): Likewise.
2011-08-28 20:39:29 +00:00
gdbadmin 0271838660 *** empty log message *** 2011-08-28 00:00:02 +00:00
matt rice 5068b8e88d * solib-sunos.c (allocate_rt_common_objfile): Add missing arguments to
bcache_xmalloc,  replace bcache_xmalloc with call to
psymbol_bcache_init for psymbol_cache.
* symfile.c (reread_symbols): Remove extra calls to bcache_xmalloc.
2011-08-27 10:28:31 +00:00
gdbadmin 8623249e89 *** empty log message *** 2011-08-27 00:00:02 +00:00
Jan Kratochvil a4f2ce052b gdb/
* inf-loop.c (inferior_event_handler): Add exception_print in
	INF_EXEC_COMPLETE.
2011-08-26 21:47:21 +00:00
Jan Kratochvil 353d1d731a gdb/
* breakpoint.c (bpstat_do_actions): New variable cleanup_if_error, call
	make_bpstat_clear_actions_cleanup and discard_cleanups for it.
	* defs.h (make_bpstat_clear_actions_cleanup): New declaration.
	* exceptions.c (throw_exception): Remove the bpstat_clear_actions call.
	* inf-loop.c (inferior_event_handler): New variable cleanup_if_error,
	call make_bpstat_clear_actions_cleanup and discard_cleanups for it.
	Call bpstat_clear_actions for failed fetch_inferior_event_wrapper.
	* infrun.c (fetch_inferior_event): Call
	make_bpstat_clear_actions_cleanup.
	* top.c (execute_command): New variable cleanup_if_error, call
	make_bpstat_clear_actions_cleanup and discard_cleanups for it.
	* utils.c (do_bpstat_clear_actions_cleanup)
	(make_bpstat_clear_actions_cleanup): New functions.

gdb/testsuite/
	* gdb.base/commands.exp (error_clears_commands_left): New function.
	(): Call it.
2011-08-26 21:45:24 +00:00
Jan Kratochvil 5c07461a74 gdb/testsuite/
* gdb.mi/mi-inheritance-syntax-error.cc (A): Make `a' public.
	(C): Initialize `a'.
	* gdb.mi/mi-inheritance-syntax-error.exp
	(-data-evaluate-expression $path):  Expect `a' as 5.
2011-08-26 21:11:08 +00:00
Pedro Alves 3ced3da4a5 2011-08-26 Pedro Alves <pedro@codesourcery.com>
* linux-nat.c (linux_child_follow_fork): Don't set lp->resumed on
	either the parent or the child forks.  Rename a couple locals.
2011-08-26 19:55:00 +00:00
Pedro Alves a9f4bb2123 2011-08-26 Pedro Alves <pedro@codesourcery.com>
gdb/
	* linux-nat.c (wait_lwp): Avoid assuming errno is preserved by a
	library call.  Avoid reading the `status' local if all waitpid
	calls failed.
2011-08-26 19:26:40 +00:00
Pedro Alves e5798bef38 2011-08-26 Pedro Alves <pedro@codesourcery.com>
gdb/
	* common/linux-osdata.c (get_cores_used_by_process): Don't assume
	opening /proc/PID/task always succeeds.
2011-08-26 18:58:04 +00:00
Aleksandar Ristovski edb2aadf8b * linespec.c (symtab_from_filename): Check for the end of string. 2011-08-26 17:58:57 +00:00
Marc Khouzam 0d932b2f8e 2011-08-26 Marc Khouzam <marc.khouzam@ericsson.com>
PR mi/11912
	* varobj.c (cplus_describe_child): Add the keyword
	'class' to the output of the method when dealing
	with a cast to a base class.

2011-08-26  Marc Khouzam  <marc.khouzam@ericsson.com>

	PR mi/11912
	* gdb.mi/mi-inheritance-syntax-error.cc: New file.
	* gdb.mi/mi-inheritance-syntax-error.exp: New file.
	* gdb.mi/mi-var-cp.cc: Updated for new 'class'
	keyword in output of -var-info-path-expression.
2011-08-26 12:32:59 +00:00
Jan Kratochvil e93ca0199f gdb/
No functionality change.
	* breakpoint.c (bpstat_clear_actions): Remove the BS parameter, make
	function comment a reference, new variables tp and bs, move here code
	from throw_exception.
	* breakpoint.h (bpstat_clear_actions): Remove the BS parameter,
	describe it in the comment.
	* exceptions.c (throw_exception): Remove variable tp, move the code for
	bpstat_clear_actions to bpstat_clear_actions.
2011-08-26 09:28:27 +00:00
Jan Kratochvil bdb5404946 gdb/testsuite/
* gdb.trace/backtrace.exp: Use is_lp64_target to check 64bit target.
	* gdb.trace/collection.exp: Likewise.
	* gdb.trace/report.exp: Likewise.
	* gdb.trace/unavailable.exp: Likewise.
	* gdb.trace/while-dyn.exp: Likewise.
2011-08-26 09:20:44 +00:00
gdbadmin e2d6800e0f *** empty log message *** 2011-08-26 00:00:02 +00:00
Tom Tromey a9f54f60b5 2011-08-25 Andrew Oakley <andrew@ado.is-a-geek.net>
* gdb.texinfo (Types In Python): Document 'bitpos' for enums.
2011-08-25 17:59:49 +00:00
gdbadmin 0c99007d02 *** empty log message *** 2011-08-25 00:00:02 +00:00
Luis Machado e3deef738c Stop threads when attaching to a PID that is the tgid. 2011-08-24 12:17:39 +00:00
Luis Machado 13da1c9782 Move common linux procfs code to common/ 2011-08-24 12:07:28 +00:00
Hui Zhu f040079fa2 Fix a change log format issue. 2011-08-24 09:28:42 +00:00
Hui Zhu 4e5c165d88 2011-08-24 Hui Zhu <teawater@gmail.com>
* tracepoint.c (cond_string_is_same): New function.
	(find_matching_tracepoint): Add condition check
	by cond_string_is_same.
2011-08-24 09:24:10 +00:00
gdbadmin 20e757674f *** empty log message *** 2011-08-24 00:00:33 +00:00
Jan Kratochvil 6e2f5b2252 gdb/
Fix build error in Darwin port.
	* darwin-nat-info.c (darwin_debug_regions_recurse): New variable uiout.
2011-08-23 19:40:50 +00:00
gdbadmin 48996a3eab *** empty log message *** 2011-08-23 00:00:32 +00:00
gdbadmin d227b5d61d *** empty log message *** 2011-08-22 00:00:02 +00:00
Jan Kratochvil abf85f464b gdb/
Code cleanup.
	* breakpoint.c (bpstat_clear_actions): Remove clearing of commands_left.
	(command_line_is_silent): New function.
	(bpstat_do_actions_1): No longer use commands_left, use
	command_line_is_silent for commands.
	(bpstat_alloc): Remove clearing of commands_left.
	(bpstat_stop_status): Remove initialization of commands_left, use
	command_line_is_silent.
	* breakpoint.h (struct bpstats): Remove commands_left.
2011-08-21 14:33:07 +00:00
gdbadmin 66c70f7d55 *** empty log message *** 2011-08-21 00:00:33 +00:00
gdbadmin 9fd6810cf8 *** empty log message *** 2011-08-20 00:00:03 +00:00
gdbadmin 97ffa485e7 *** empty log message *** 2011-08-19 00:00:33 +00:00
Keith Seitz 59cde39c1e * gdb.cp/meth-typedefs.cc: New file.
* gdb.cp/meth-typedefs.exp: New file.
2011-08-18 16:19:01 +00:00
Keith Seitz 3a93a0c2ef PR c++/12266
* cp-name-parser.y (struct demangle_info): Remove unused
	member PREV.
	(d_grab): Likewise.
	(allocate_info): Change return type to struct demangle_info *.
	Always allocate a new demangle_info.
	Remove unused PREV pointer.
	(cp_new_demangle_parse_info): New function.
	(cp_demangled_name_parse_free): New function.
	(do_demangled_name_parse_free_cleanup): New function.
	(make_cleanup_cp_demangled_name_parse_free): New function.
	(cp_demangled_name_to_comp): Change return type to
	struct demangle_parse_info *.
	Allocate a new storage for each call.
	(main): Update usage for cp_demangled_name_to_comp
	API change.
	* cp-support.h (struct demangle_parse_info): New structure.
	(cp_demangled_name_to_comp): Update API change for
	return type.
	(cp_new_demangle_parse_info): Declare.
	(make_cleanup_cp_demangled_name_parse_free): New declaration.
	(cp_demangled_name_parse_free): Declare.
	* cp-support.c (cp_canonicalize_string): Update API
	change for cp_demangled_name_to_comp.
	(mangled_name_to_comp): Likewise.
	Return struct demangle_parse_info, too.
	(cp_class_name_from_physname): Update mangled_name_to_comp
	API change.
	(method_name_from_physname): Likewise.
	(cp_func_name): Update API change for cp_demangled_name_to_comp.
	(cp_remove_params): Likewise.
	* python/py-type.c (typy_legacy_template_argument): Likewise.

	* cp-support.h (cp_canonicalize_string_no_typedefs): Declare.
	(cp_merge_demangle_parse_infos): Declare.
	* cp-support.c (ignore_typedefs): New file global.
	(copy_string_to_obstack): New function.
	(inspect_type): New function.
	(replace_typedefs): New function.
	(replace_typedefs_qualified_name): New function.
	(cp_canonicalize_string_no_typedefs): New function.
	* cp-name-parser.y (cp_merge_demangle_parse_infos): New function.
	(cp_new_demangle__parse_info): Allocate and initialize the obstack.
	* linespec.c (find_methods): Use cp_canonicalize_string_no_typedefs
	instead of cp_canonicalize_string.
	(find_method): Likewise.
	(decode_compound): Before looking up the name, call
	cp_canonicalize_string_no_typedefs.
	(decode_variable): Likewise.
2011-08-18 16:17:39 +00:00
gdbadmin 0a35427e67 *** empty log message *** 2011-08-18 00:00:33 +00:00
Phil Muldoon fa3a4f150f 2011-08-17 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey  <tromey@redhat.com>
            Matt Rice <ratmice@gmail.com>

        * python/lib/gdb/prompt.py: New file.
        * python/lib/gdb/command/prompt.py: New file.
        * NEWS: Document set extended-prompt and gdb.prompt library

2011-08-17  Phil Muldoon  <pmuldoon@redhat.com>

        * gdb.texinfo (Prompt): Add set/show extended-prompt
        documentation
        (Basic Python): Add prompt_hook anchor.
        (Python modules): Reword module text to reflect multiple modules.
        (gdb.prompt): Document gdb.prompt module.

2011-08-17  Phil Muldoon  <pmuldoon@redhat.com>

        * gdb.python/python.exp: Add extended-prompt tests.
2011-08-17 10:41:22 +00:00
gdbadmin 142a8c5dcf *** empty log message *** 2011-08-17 00:00:32 +00:00
Yao Qi 85661b1e19 gdb/
* tic6x-linux-tdep.c: Move const arrays definition from here...
	* tic6x-tdep.c: to here ...
2011-08-16 04:15:23 +00:00
gdbadmin d3b7cdad07 *** empty log message *** 2011-08-16 00:00:02 +00:00
Jan Kratochvil c1049fca4e gdb/testsuite/
* gdb.arch/i386-dr3-watch.exp
	(watchpoint on gap1 does not fit debug registers)
	(delete all watchpoints): Fix racy expect strings.
2011-08-15 07:56:20 +00:00
gdbadmin 0a8328f5d5 *** empty log message *** 2011-08-15 00:00:03 +00:00
Yao Qi 11315641d5 gdb/
* NEWS: New port to Texas Instruments TMS320C6x.
2011-08-14 16:17:09 +00:00
Yao Qi 881127c98f gdb/gdbserver/
* target.h (struct target_ops): Fix indent.
	* win32-low.c (win32_target_ops): Fix comment.
2011-08-14 16:06:59 +00:00
Yao Qi d93f7b5c95 gdb/testsuite/
* gdb.base/maint.exp: set data_section to ".neardata".
	* gdb.base/savedregs.c (thrower): Trigger SIGILL on NO-MMU machine.
	* gdb.base/savedregs.exp: Handle SIGILL.
	* gdb.mi/mi-syn-frame.c (bar): Trigger SIGILL on NO-MMU machine.
	* gdb.xml/tdesc-regs.exp: Set core-regs for tic6x-*-*.
2011-08-14 15:58:40 +00:00
Yao Qi 58dbd54186 gdb/gdbserver/
* Makefile.in (clean): Remove tic6x-*.c files.
	(linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
	(tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
	(tic6x-c64xp-linux.c): Likewise.
	* configure.srv: Add support for tic6x-*-uclinux.
	* linux-tic6x-low.c: New.
	* linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
2011-08-14 15:25:45 +00:00
Yao Qi 8cd64e0034 gdb/
* configure.tgt: Handle tic6x-*-*linux and tic6x-*-*.
	* solib-dsbt.c: New file.  Support DSBT shared object.
	* tic6x-linux-tdep.c: New file.
	* tic6x-tdep.c: New file.
	* tic6x-tdep.h: New file.
2011-08-14 14:03:45 +00:00
Yao Qi 78d8519916 gdb/
* remote.c (PACKET_qXfer_fdpic): New enum value.
        (remote_protocol_features): Add qXfer:fdpic:read packet.
        (remote_xfer_partial): Support TARGET_OBJECT_FDPIC.
        (_initialize_remote): Add set/show remote read-fdpic-loadmap command.
        * target.h (enum target_object): Add TARGET_OBJECT_FDPIC.

        gdb/gdbserver:
        * target.h (struct target_ops): Add read_loadmap.
        * linux-low.c (struct target_loadseg): New type.
        (struct target_loadmap): New type.
        (linux_read_loadmap): New function.
        (linux_target_ops): Add linux_read_loadmap.
        * server.c (handle_query): Support qXfer:fdpic:read packet.
	* win32-low.c (win32_target_ops): Initialize field `read_loadmap' to NULL.

        gdb/doc/
        * gdb.texinfo : Document qXfer:fdpic:read packet.
2011-08-14 13:03:13 +00:00
Yao Qi d3e3fa9393 Add files missed in previous commit. 2011-08-14 12:50:14 +00:00
Yao Qi 224bbe4936 gdb/doc/
* gdb.texinfo (Standard Target Features): Document C6x features.
	(TIC6x Features): New node.

        gdb/
        * features/Makefile (WHICH): Add tic6x-c64xp tic6x-c64x tic6x-c62x
        tic6x-c64xp-linux tic6x-c64x-linux and tic6x-c62x-linux.
        * features/tic6x-c6xp.xml, features/tic6x-core.xml: New.
        * features/tic6x-gp.xml, features/tic6x-c62x.xml: New.
        * features/tic6x-c64x.xml, features/tic6x-c64xp.xml: New.
        * features/tic6x-c62x-linux.xml, features/tic6x-c64x-linux.xml: New.
        * features/tic6x-c64xp-linux.xml: New.
	* features/tic6x-c64xp.c, features/tic6x-c64x.c: Generated.
        * features/tic6x-c62x.c, features/tic6x-c64xp-linux.c: Generated.
        * features/tic6x-c64x-linux.c, features/tic6x-c62x-linux.c: Generated.
        * regformats/tic6x-c62x.dat, regformats/tic6x-c64x.dat: Generated.
        * regformats/tic6x-c64xp.dat, regformats/tic6x-c62x-linux.dat: Generated.
	* regformats/tic6x-c64x-linux.dat, regformats/tic6x-c64xp-linux.dat: Generated.

	* config/djgpp/fnchange.lst: Add features/tic6x-*.xml and
	features/tic6x-*.c files.
	Add regformats/tic6x-*.dat files.
2011-08-14 12:43:38 +00:00
gdbadmin 85f2921b7f *** empty log message *** 2011-08-14 00:00:33 +00:00
gdbadmin 271ade8bdb *** empty log message *** 2011-08-13 00:00:33 +00:00
Doug Evans 457e09f060 * NEWS: Mention new "type" attribute of python gdb.Symbol objects.
* python/py-symbol.c (sympy_get_type): New function.
	(symbol_object_getset): Add "type".

	doc/
	* gdb.texinfo (Symbols In Python): Document symbol.type.

	testsuite/
	* gdb.python/py-symbol.exp: Add test for symbol.type.
2011-08-12 22:21:57 +00:00
Pedro Alves d20c1c3fea 2011-08-12 Pedro Alves <pedro@codesourcery.com>
PR tui/13073

	gdb/
	* tui/tui-regs.c (tui_show_register_group): Skip registers with an
	empty name.
	(tui_show_register_group): Don't store a byte buffer in the data
	element's value.
	(tui_register_format): Skip registers with an empty name.
	(tui_get_register): Store a struct value in the data element's
	value field instead of a byte buffer holding the raw register
	contents.  Account for optimized-out and unavailable registers
	when comparing register contents.
2011-08-12 17:04:32 +00:00
Ulrich Weigand 5d0bb2fbbc * gdb.threads/pthreads.exp: Enable on non-native configurations.
* gdb.mi/mi-pthreads.exp: Likewise.
	* gdb.mi/mi2-pthreads.exp: Likewise.
	* gdb.mi/gdb669.exp.exp: Likewise.
2011-08-12 15:54:35 +00:00
gdbadmin 73c4877b17 *** empty log message *** 2011-08-12 00:00:03 +00:00