Commit Graph

27659 Commits

Author SHA1 Message Date
Doug Evans ad727bb22e * symfile.h (quick_symbol_functions): Clarify usage of
map_symbol_filenames.
2010-12-09 19:52:23 +00:00
Tom Tromey 305aeedc41 gdb
* mi/mi-parse.h (mi_parse): Update.
	* mi/mi-parse.c (mi_parse_cleanup): New function.
	(mi_parse): Add 'token' argument.  Throw exception on error.
	* mi/mi-main.c (mi_print_exception): New function.
	(mi_execute_command): Use mi_print_exception.  Catch exceptions
	from mi_parse.
gdb/testsuite
	* gdb.base/interp.exp: Add regression test.
2010-12-09 19:23:49 +00:00
Tom Tromey 186c406b19 gdb
PR c++/9593:
	* thread.c (clear_thread_inferior_resources): Call
	delete_longjmp_breakpoint.
	* infrun.c (handle_inferior_event): Handle exception breakpoints.
	(handle_inferior_event): Likewise.
	(insert_exception_resume_breakpoint): New function.
	(check_exception_resume): Likewise.
	* inferior.h (delete_longjmp_breakpoint_cleanup): Declare.
	* infcmd.c (delete_longjmp_breakpoint_cleanup): No longer static.
	(step_1): Set thread's initiating frame.
	(until_next_continuation): New function.
	(until_next_command): Support exception breakpoints.
	(finish_command_continuation): Delete longjmp breakpoint.
	(finish_forward): Support exception breakpoints.
	* gdbthread.h (struct thread_info) <initiating_frame>: New field.
	* breakpoint.h (enum bptype) <bp_exception, bp_exception_resume,
	bp_exception_master>: New constants.
	(struct bpstat_what) <is_longjmp>: New field.
	(set_longjmp_breakpoint): Update.
	* breakpoint.c (create_exception_master_breakpoint): New function.
	(update_breakpoints_after_exec): Handle bp_exception_master.  Call
	create_exception_master_breakpoint.
	(print_it_typical): Handle bp_exception_master, bp_exception.
	(bpstat_stop_status): Handle bp_exception_master.
	(bpstat_what): Handle bp_exception_master, bp_exception,
	bp_exception_resume.
	(bptype_string): Likewise.
	(print_one_breakpoint_location): Likewise.
	(allocate_bp_location): Likewise.
	(set_longjmp_breakpoint): Handle exception breakpoints.  Change
	interface.
	(delete_longjmp_breakpoint): Handle exception breakpoints.
	(mention): Likewise.
	(struct until_break_command_continuation_args) <thread_num>: New
	field.
	(until_break_command_continuation): Call
	delete_longjmp_breakpoint.
	(until_break_command): Support exception breakpoints.
	(delete_command): Likewise.
	(breakpoint_re_set_one): Likewise.
	(breakpoint_re_set): Likewise.
gdb/testuite
	* gdb.java/jnpe.java: New file.
	* gdb.java/jnpe.exp: New file.
	* gdb.cp/nextoverthrow.exp: New file.
	* gdb.cp/nextoverthrow.cc: New file.
2010-12-09 16:09:54 +00:00
gdbadmin 87cc8f36a7 *** empty log message *** 2010-12-09 00:00:02 +00:00
Doug Evans 4e4666e6f7 * gdbtypes.h (TYPE_IS_OPAQUE): Reformat. 2010-12-08 21:35:59 +00:00
Doug Evans 73e2eb35ba * gdbtypes.c (check_typedef): Tweak comment. 2010-12-08 21:33:20 +00:00
Doug Evans 0a5429f697 PR symtab/12302
* dwarf2read.c (struct psymtab_cu_index_map): New struct.
	(hash_psymtab_cu_index, eq_psymtab_cu_index): New functions.
	(struct addrmap_index_data): New struct.
	(add_address_entry): Remove arg `pst', new args `start', `end'.
	(add_address_entry_worker, write_address_map): New functions.
	(write_psymtabs_to_index): Address table generation moved to
	write_address_map.  Build a table mapping psymtab to CU index
	to pass to it.
2010-12-08 19:03:35 +00:00
Doug Evans 7e17e08811 * dwarf2read.c (write_psymtabs_to_index): When stat fails, pass file
name to perror.
2010-12-08 18:26:40 +00:00
Doug Evans d4637a0471 * symfile.h (quick_symbol_functions): Clarify usage of
expand_symtabs_with_filename.
	* dwarf2read.c (dw2_expand_symtabs_with_filename): Only iterate over
	comp units, ignore type units.
2010-12-08 18:04:08 +00:00
Doug Evans 1ef75ecca6 * dwarf2read.c (dw2_expand_symtabs_with_filename): Use FILENAME_CMP. 2010-12-08 17:31:52 +00:00
gdbadmin 4937863dfe *** empty log message *** 2010-12-08 00:00:03 +00:00
Doug Evans 74dd2ca6a7 * dwarf2read.c (dw2_lookup_symtab): Remove duplicate call to
gdb_realpath.
2010-12-07 17:30:52 +00:00
Doug Evans aae1c79a03 PR python/12227
* NEWS: Mention -data-directory.
	* main.c (captured_main): Recognize -data-directory.

	doc/
	* gdb.texinfo (Mode Options): Document -data-directory.
	(Data Files): Add reference to -data-directory.

	testsuite/
	* gdb.base/catch-syscall.exp (do_syscall_tests): Remove setting
	of data-directory.
	* lib/gdb-python.exp (gdb_check_python_config): Delete, all callers
	updated.
	* lib/gdb.exp (INTERNAL_GDBFLAGS): Add -data-directory.
2010-12-07 17:26:06 +00:00
gdbadmin ee6352bb19 *** empty log message *** 2010-12-07 00:00:02 +00:00
Marc Khouzam 8e0e408ae6 2010-12-06 Marc Khouzam <marc.khouzam@ericsson.com>
* mi/mi-parse.c (mi_parse): Missing else.
2010-12-06 14:16:43 +00:00
gdbadmin a2c86c8224 *** empty log message *** 2010-12-06 00:00:03 +00:00
gdbadmin 7353ec481f *** empty log message *** 2010-12-05 00:00:33 +00:00
Masaki Muranaka 97fc68fe16 * configure.tgt: Accept microblaze*-*-linux* for linux target
and microblaze*-*-* for  as target.
2010-12-04 02:10:53 +00:00
gdbadmin 5492beb9c8 *** empty log message *** 2010-12-04 00:00:33 +00:00
gdbadmin d91ffc6b21 *** empty log message *** 2010-12-03 00:00:33 +00:00
Michael Snyder d426f7b419 2010-11-29 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdb.base/callfuncs.exp: Test for skip_float_tests.
	* gdb.base/call-sc.exp: Ditto.
	* gdb.base/finish.exp: Ditto.
	* gdb.base/return.exp: Ditto.
	* gdb.base/return2.exp: Ditto.
2010-12-02 21:34:14 +00:00
Keith Seitz d03a3acf07 * linespec.c (find_method): Move name canonicalization outside
the loop.
	Be paranoid and use a cleanup.
2010-12-02 20:05:59 +00:00
gdbadmin 985f879c3a *** empty log message *** 2010-12-02 00:00:33 +00:00
Doug Evans 148c11bf2e * dwarf2read.c (save_gdb_index_command): Add comment. 2010-12-01 19:37:36 +00:00
Ulrich Weigand 4aac0db70f * valops.c (value_assign): Returned value is never lazy. If a
C++ class type is returned, fix incorrect enclosing type / embedded
	offset.  If internal variable is returned, allocate new internalvar
	value using value_of_internalvar.

	* NEWS: Document changes in behavior of "print x = 0" and similar
	expressions.
2010-12-01 16:49:41 +00:00
gdbadmin ba4b845cec *** empty log message *** 2010-12-01 00:00:33 +00:00
Doug Evans 5fa290c134 * lib/gdb.exp (gdb_test_sequence): Return result of gdb_expect_list.
(gdb_expect_list): Fix spelling errors in comments.
	* gdb.arch/system-gcore.exp: Use gdb_test_sequence instead of
	send_gdb/gdb_expect_list where applicable.
	* gdb.base/call-ar-st.exp: Ditto.
	* gdb.base/funcargs.exp: Ditto.
	* gdb.base/gcore.exp: Ditto.
	* gdb.base/page.exp: Ditto.
	* gdb.base/sigaltstack.exp: Ditto.
	* gdb.base/siginfo.exp: Ditto.
	* gdb.base/sigstep.exp: Ditto.
	* gdb.base/trace-commands.exp: Ditto.
2010-11-30 17:41:14 +00:00
gdbadmin 46a4d0e06b *** empty log message *** 2010-11-30 00:00:32 +00:00
Doug Evans 4e04c971fb * python/lib/gdb/printing.py (register_pretty_printer): Change
printer-name:subprinter-name to printer-name;subprinter-name.
	* python/lib/gdb/command/pretty_printers.py (parse_printer_regexps):
	Ditto.
	(InfoPrettyPrinter, EnablePrettyPrinter, DisablePrettyPrinter): Ditto.

	doc/
	* gdb.texinfo (Pretty-Printer Introduction): Change
	printer-name:subprinter-name to printer-name;subprinter-name.

	testsuite/
	* gdb.python/py-pp-maint.exp: Change printer-name:subprinter-name to
	printer-name;subprinter-name.
2010-11-29 23:20:58 +00:00
Tom Tromey 8cf6f0b103 gdb
* opencl-lang.c (lval_func_check_synthetic_pointer): New
	function.
	* value.h (struct lval_funcs) <indirect, check_synthetic_pointer>:
	New fields.
	(value_bits_synthetic_pointer): Declare.
	* value.c (value_bits_synthetic_pointer): New function.
	* valprint.c (valprint_check_validity): Handle synthetic
	pointers.
	* valops.c (value_ind): Use new 'indirect' lval_funcs method.
	* valarith.c (value_ptradd): Use set_value_component_location.
	* p-valprint.c (pascal_object_print_value_fields): Handle
	synthetic pointers.
	* jv-valprint.c (java_print_value_fields): Handle synthetic
	pointers.
	* dwarf2read.c (dwarf_stack_op_name): Add
	DW_OP_GNU_implicit_pointer.
	(dwarf2_fetch_die_location_block): Add get_frame_pc, baton
	arguments.  Handle location lists.
	(fill_in_loclist_baton): New function.
	(dwarf2_symbol_mark_computed): Use it.
	* dwarf2loc.h (dwarf2_find_location_expression): Declare.
	(dwarf2_fetch_die_location_block): Add get_frame_pc, baton
	arguments.
	* dwarf2loc.c (dwarf2_find_location_expression): Rename from
	find_location_expression.  No longer static.  Update all callers.
	(dwarf_expr_frame_pc): New function.
	(per_cu_dwarf_call): Add get_frame_pc, baton arguments.  Update
	all callers.
	(struct piece_closure) <per_cu>: New field.
	(allocate_piece_closure): Add per_cu argument.
	(read_pieced_value): Handle DWARF_VALUE_IMPLICIT_POINTER.
	(check_pieced_value_bits): Remove validity argument, add check_for
	argument.  Handle DWARF_VALUE_IMPLICIT_POINTER.
	(check_pieced_value_validity, check_pieced_value_invalid):
	Update.
	(check_pieced_synthetic_pointer): New function.
	(get_frame_address_in_block_wrapper): New function.
	(indirect_pieced_value): New function.
	(pieced_value_funcs): Update.
	(invalid_synthetic_pointer): New function.
	(dwarf2_evaluate_loc_desc_full): Rename from
	dwarf2_evaluate_loc_desc.  Add byte_offset argument.
	(dwarf2_evaluate_loc_desc): Rewrite.
	(dwarf2_loc_desc_needs_frame): Set new field on context.
	(get_ax_pc): New function.
	(disassemble_dwarf_expression): Handle
	DW_OP_GNU_implicit_pointer.
	* dwarf2expr.h (enum dwarf_value_location)
	<DWARF_VALUE_IMPLICIT_POINTER>: New constant.
	(struct dwarf_expr_context) <get_frame_pc>: New field.
	(struct dwarf_expr_piece) <v.ptr>: New field.
	* dwarf2expr.c (add_piece): Handle DWARF_VALUE_IMPLICIT_POINTER.
	(execute_stack_op): Handle DW_OP_GNU_implicit_pointer.
	* dwarf2-frame.c (no_get_frame_pc): New function.
	(execute_stack_op): Set new field on context.
	* cp-valprint.c (cp_print_value_fields): Handle synthetic
	pointers.
gdb/testsuite
	* gdb.dwarf2/implptr.exp: New file.
	* gdb.dwarf2/implptr.c: New file.
	* gdb.dwarf2/implptr.S: New file.
2010-11-29 21:18:16 +00:00
Phil Muldoon 94b6973efe 2010-11-29 Phil Muldoon <pmuldoon@redhat.com>
PR python/12199

	* python/py-breakpoint.c (bppy_delete_breakpoint): New function.

2010-11-29  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12199

	* gdb.python/py-breakpoint.exp: Test the delete method.

2010-11-29  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12199

	* gdb.texinfo (Breakpoints In Python): Document "delete" method.
2010-11-29 13:49:05 +00:00
gdbadmin 755fb75f05 *** empty log message *** 2010-11-29 00:00:33 +00:00
Jan Kratochvil 8358c15c55 gdb/
Fix step_resume_breakpoint unsaved during an infcall.
	* gdbthread.h (struct thread_control_state): Move here field
	step_resume_breakpoint ...
	(struct thread_info): ... from here.
	* infrun.c (save_infcall_control_state): Reset
	control.step_resume_breakpoint to NULL.
	(restore_infcall_control_state, discard_infcall_control_state): Delete
	control.step_resume_breakpoint.
	* arm-linux-tdep.c, infrun.c, thread.c: Update all the references to
	the moved field.

gdb/testsuite/
	Fix step_resume_breakpoint unsaved during an infcall.
	* gdb.base/step-resume-infcall.exp: New file.
	* gdb.base/step-resume-infcall.c: New file.
2010-11-28 04:33:47 +00:00
Jan Kratochvil 16c381f058 gdb/
Rename and move inferior_thread_state and inferior_status.
	* gdbthread.h (struct thread_control_state): New struct, move fields
	step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
	trap_expected, proceed_to_finish, in_infcall, step_over_calls,
	stop_step and stop_bpstat here from struct thread_info.
	(struct thread_suspend_state): New struct, move field stop_signal here
	from struct thread_info.
	(struct thread_info): Move the fields above from this struct.
	* inferior.h: Move the inferior_thread_state and inferior_status
	declarations comment to their definitions at infrun.c.
	(struct inferior_control_state): New struct, move field stop_soon from
	struct inferior here.
	(struct inferior_suspend_state): New empty struct.
	(struct inferior): New fields control and suspend.  Move out field
	stop_soon.
	* infrun.c (struct inferior_thread_state): Rename to ...
	(infcall_suspend_state): ... here.  Replace field stop_signal by
	fields thread_suspend and inferior_suspend.
	(save_inferior_thread_state): Rename to ...
	(save_infcall_suspend_state): ... here.  New variable inf.  Update the
	code for new fields.
	(restore_inferior_thread_state): Rename to ...
	(restore_infcall_suspend_state): ... here.  New variable inf.  Update
	the code for new fields.
	(do_restore_inferior_thread_state_cleanup): Rename to ...
	(do_restore_infcall_suspend_state_cleanup): ... here.
	(make_cleanup_restore_inferior_thread_state): Rename to ...
	(make_cleanup_restore_infcall_suspend_state): ... here.
	(discard_inferior_thread_state): Rename to ...
	(discard_infcall_suspend_state): ... here.
	(get_inferior_thread_state_regcache): Rename to ...
	(get_infcall_suspend_state_regcache): ... here.
	(struct inferior_status): Rename to ...
	(struct infcall_control_state): ... here.  Replace fields
	step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
	trap_expected, proceed_to_finish, in_infcall, step_over_calls,
	stop_step, stop_bpstat and stop_soon by fields thread_control and
	inferior_control.
	(save_inferior_status): Rename to ...
	(save_infcall_control_state): ... here.  Update the code for new
	fields.
	(restore_inferior_status): Rename to ...
	(restore_infcall_control_state): ... here.  Update the code for new
	fields.
	(do_restore_inferior_status_cleanup): Rename to ...
	(do_restore_infcall_control_state_cleanup): ... here.
	(make_cleanup_restore_inferior_status): Rename to ...
	(make_cleanup_restore_infcall_control_state): ... here.
	(discard_inferior_status): Rename to ...
	(discard_infcall_control_state): ... here.
	* alpha-tdep.c, breakpoint.c, dummy-frame.c, dummy-frame.h,
	exceptions.c, fbsd-nat.c, gdbthread.h, infcall.c, infcmd.c,
	inferior.c, inferior.h, infrun.c, linux-nat.c, mi/mi-interp.c,
	mips-tdep.c, procfs.c, solib-irix.c, solib-osf.c, solib-spu.c,
	solib-sunos.c, solib-svr4.c, thread.c, windows-nat.c: Update all the
	references to the moved fields and renamed functions.
2010-11-28 04:31:25 +00:00
gdbadmin f0df11bdc9 *** empty log message *** 2010-11-28 00:00:02 +00:00
gdbadmin c1025aea50 *** empty log message *** 2010-11-27 00:00:02 +00:00
Jan Kratochvil 35515841e0 gdb/
* infcall.c (struct inferior_thread_state) <siginfo_gdbarch>: Fix up
	the comment.
	(save_inferior_thread_state): Reset tp->stop_signal.
2010-11-26 03:39:10 +00:00
Jan Kratochvil 7ea1453336 Fix ChangeLog entry. 2010-11-26 00:33:56 +00:00
Jan Kratochvil fef8420a2d gdb/
* infcall.c (caller_state_cleanup): Remove variable caller_state_cleanup.
2010-11-26 00:30:31 +00:00
gdbadmin 96fc67061a *** empty log message *** 2010-11-26 00:00:03 +00:00
Marc Khouzam f5a8e22b7e 2010-11-25 Marc Khouzam <marc.khouzam@ericsson.com>
PR breakpoints/12217

	* breakpoint.c (is_marker_spec): Check for NULL.
2010-11-25 23:17:30 +00:00
Pedro Alves 5038964414 * breakpoint.h: No longer include python.h or python-internal.h.
(struct breakpoint_object): Forward declare.
	* defs.h (PyObject) [!HAVE_PYTHON]: Don't define.
	* varobj.c (PyObject) [!HAVE_PYTHON]: Define.
	* python/py-breakpoint.c (build_bp_list): Cast py_bp_object to
	PyObject pointer.
	(gdbpy_breakpoint_created): Remove casts around py_bp_object
	accesses.
2010-11-25 13:10:07 +00:00
Joel Brobecker 50a9972898 Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined)
bfd_uses_spe_extensions should only be used when BFD has been built
with ELF support.  The typical way of checking that in GDB is to use
the HAVE_ELF macro.

gdb/ChangeLog:

        * rs6000-tdep.c (bfd_uses_spe_extensions): Use bfd_elf_get_obj_attr_int
        only if HAVE_ELF is defined.
2010-11-25 00:23:39 +00:00
gdbadmin 5239e966f1 *** empty log message *** 2010-11-25 00:00:33 +00:00
Jan Kratochvil a418ecb545 gdb/
Code cleanup.
	* infrun.c (struct inferior_status) <stepping_over_breakpoint>
	(save_inferior_status) <stepping_over_breakpoint>
	(restore_inferior_status) <stepping_over_breakpoint>: Rename to
	trap_expected.
	(struct inferior_status) <step_resume_break_address>: Remove.
2010-11-24 19:08:30 +00:00
Jan Kratochvil d82142e25d gdb/
* infrun.c (struct inferior_status, save_inferior_status)
	(restore_inferior_status): Group and reorder the fields, comment their
	groups.
2010-11-24 19:05:46 +00:00
Jan Kratochvil 2edb89d30e gdb/
Code cleanup.
	* dictionary.c
	(struct dict_vector) <iter_match_first, iter_match_next>
	(iter_match_first_hashed, iter_match_next_hashed)
	(iter_match_first_linear, iter_match_next_linear)
	(dict_iter_match_first, dict_iter_match_next, iter_match_first_hashed)
	(iter_match_next_hashed, iter_match_first_linear)
	(iter_match_next_linear): Use symbol_compare_ftype.
	* dictionary.h: Include symfile.h.
	(dict_iter_match_first, dict_iter_match_next): Use
	symbol_compare_ftype.
	* dwarf2read.c (dw2_map_matching_symbols): Likewise.
	* psymtab.c (match_partial_symbol, match_partial_symbol, map_block)
	(map_matching_symbols_psymtab): Likewise.
	* symfile.h (symbol_compare_ftype): New typedef.
	(struct quick_symbol_functions) <map_matching_symbols): Use
	symbol_compare_ftype.
2010-11-24 19:01:51 +00:00
Thiago Jung Bauermann f6df29bc29 2010-11-24 Edjunior Machado <emachado@br.ibm.com>
* gdb.asm/powerpc.inc: Use 'sys_exit' on gdbasm_exit0 macro.
2010-11-24 18:06:18 +00:00
Thiago Jung Bauermann f2b5a5cf6f 2010-11-24 Edjunior Machado <emachado@br.ibm.com>
* gdb.asm/asm-source.exp: Add new target "powerpc64"; expect leading `.'
	on ppc64's symbols; "finish" and "return" commands must accept to
	show the caller line again as well as the line after.
	* gdb.asm/powerpc64.inc: New file.
2010-11-24 17:57:34 +00:00
gdbadmin c50acd7bbb *** empty log message *** 2010-11-24 00:00:33 +00:00
Doug Evans 6b0ecdc2c4 * lib/gdb.exp (gdb_test_sequence): New function.
(gdb_expect_list): Add verbose -log call for each pattern.
	* gdb.base/signals.exp (test_handle_all_print): Call it.
	Reduce timeout increment from 6 minutes to 1 minute.
	* gdb.server/ext-run.exp: Call it.
2010-11-23 22:25:37 +00:00
Tom Tromey 39037522c8 gdb
* configure: Rebuild.
	* configure.ac (READLINE_TEXI_INCFLAG): New subst.
gdb/doc
	* gdb.texinfo (Top): Check SYSTEM_READLINE.
	(Editing): Likewise.
	(Command History): Likewise.
	(TUI Keys): Likewise.
	(Bug Reporting): Conditionally include rluser.texi and
	inc-history.texinfo.
	* Makefile.in (READLINE_TEXI_INCFLAG): New variable.
	(GDB_DOC_SOURCE_INCLUDES): Add comment.
	(GDBvn.texi): Set SYSTEM_READLINE when appropriate.
	(gdb.dvi): Use READLINE_TEXI_INCFLAG.
	(gdb.pdf): Likewise.
	(gdb.info): Likewise.
	(gdb/index.html): Likewise.
2010-11-23 14:39:16 +00:00
Tom Tromey 5ae98d2512 gdb
* Makefile.in (SUBDIRS): Add doc.
	* configure: Rebuild.
	* configure.ac: Don't configure in doc.  Create doc/Makefile.
gdb/doc
	* Makefile.in (Makefile): Run ../config.status.
	(distclean): Update.
	* configure: Remove.
	* configure.ac: Remove.
2010-11-23 14:37:26 +00:00
Phil Muldoon ea976c60e2 2010-11-23 Phil Muldoon <pmuldoon@redhat.com>
PR python/12212

	* python/py-inferior.c (find_thread_object): Check if PIDGET
	returns 0.

2010-11-23  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/12212

	* gdb.python/python.exp: Check that selected_thread raises an
	error when no inferior is loaded.
2010-11-23 13:33:23 +00:00
Joel Brobecker d94e4f4f7c Delete redundant variable in ada_template_to_fixed_record_type_1.
gdb/ChangeLog:

        * ada-lang.c (ada_template_to_fixed_record_type_1): Delete bit_incr.
2010-11-23 01:12:05 +00:00
Joel Brobecker 96dbd2c132 [Ada] array pointers encoded as typedef to fat pointer
A recent change in check_typedef caused the following regression,
considering:

        type String_Access is access String;
        S1 : String_Access := null;

Trying to print S1, we get:

        (gdb) print s1
        $1 = (string) (null)

The type name is wrong.  We were expecting:

        (gdb) print s1
        $1 = (string_bug.string_access) (null)

The extensive comment in this patch explains how pointers to arrays
are encoded when the array is a "fat pointer".  What happened is
that the change in check_typedef broke a type-equality test that
we were performing.   The test really was on the fringe, but it
turns out that, for what we're doing, we're really only interested
in the main-type portion of the type.

The patch adjust the check accordingly.

gdb/ChangeLog:

        * ada-lang.c (ada_to_fixed_type): Expand function documentation.
        Return the original type if the main type portions match rather
         than when the type themselves match.
2010-11-23 01:10:54 +00:00
Joel Brobecker 27f2a97baf GDB SEGV while trying to print uninitialize variant record
We have a variant record whose value is defined as follow:

   type Discriminant_Record (Num1, Num2,
                             Num3, Num4 : Natural) is record
      Field1 : My_Record_Array (1 .. Num2);
      Field2 : My_Record_Array (Num1 .. 10);
      Field3 : My_Record_Array (Num1 .. Num2);
      Field4 : My_Record_Array (Num3 .. Num2);
      Field5 : My_Record_Array (Num4 .. Num2);
   end record;
   Dire : Discriminant_Record (1, 7, 3, 0);

However, we're trying to print "Dire" before it is elaborated.
This is common if one breaks on a function and then starts doing
"info locals" for instance.

What happens is that GDB reads bogus values for fields Num1 to
Num4, and deduces a bogus (ginormouos) size for component
"Field1".  The length is so large that it then later causes
an overflow in the overall record length computation. Things
go downhill from there, because length(field1) > length(record).
So, when after we've fetched the value of the record based on
the computed size, we crash trying to access unallocated memory
when accessing field1...

The first fix we can do is to check the size of the field
against the maximum object size.  If it exceeds that size,
then we know the record will also exceed that size...

gdb/ChangeLog:

        * ada-lang.c (ada_template_to_fixed_record_type_1):
        For dynamic fields, check the field size against the maximum
        object size.
2010-11-23 01:07:22 +00:00
Joel Brobecker 1324a0d9b5 support for mips-irix on-stack trampolines
On mips-irix, the debugger has trouble stepping over the following
line of code:

    S: Shape'Class := R;   <<<<---- STOP here

Here is what happens:

    (gdb) n
    warning: GDB can't find the start of the function at 0x7fff2bd8.

        GDB is unable to find the start of the function at 0x7fff2bd8
    and thus can't determine the size of that function's stack frame.
    This means that GDB may be unable to access that stack frame, or
    the frames below it.
        This problem is most likely caused by an invalid program counter or
    stack pointer.
        However, if you think GDB should simply search farther back
    from 0x7fff2bd8 for code which looks like the beginning of a
    function, you can increase the range of the search using the `set
    heuristic-fence-post' command.
    0x7fff2bd8 in ?? ()

The program does in fact jump to this code location, which is a trampoline
located on the stack (there is an implicit call to a routine internally
generated by the Ada expander). As it is on the stack, GDB is naturally
 unable to find the bounds of the current function, or any debugging
information, and is thus unable to continue.

This patch adds support for this sort of trampoline.

gdb/ChangeLog:

        * mips-irix-tdep.c (mips_irix_n32_stack_tramp_frame_init): New
        function.
        (mips_irix_n32_stack_tramp_frame): New static global.
        (mips_irix_init_abi): Add mips_irix_n32_stack_tramp_frame to
        list of unwinder.
2010-11-23 01:06:08 +00:00
Joel Brobecker 09e7f15bcf [Ada/tasks] Optimize ATCB lookups
Type symbols that are used to decode the Ada task control block may be
duplicated in any unit that uses a tasking feature; an Ada lookup of
these symbols would collect all the duplicated instances and could
provoke the load of a huge amount of debug symbols in the process.

However, when decoding the task information, we are only interested in
one instance; and we have the full name of the symbol anyway. So use
a C lookup instead of an Ada lookup.

2010-11-05  Jerome Guitton  <guitton@adacore.com>

	* ada-tasks.c (get_tcb_types_info): Use C lookups to get
	ATCB symbols.
2010-11-23 01:04:54 +00:00
Joel Brobecker 3a867c2212 infinite recursion with ada_check_typedef
When trying to resolve an incomplete type, if there is no complete
version of that type available, GDB can go in an infinite loop.

This is because ada_check_typedef makes a recursive call to itself,
in an attempt to make sure that the returned type is never a typedef.
However, when no complete type is found, the current logic causes us
to keep going indefinitely through the same path...

This patch fixes the problem by performing the recursive call to
ada_check_typedef only when a TYPE_CODE_TYPDEF layer needs to be
stripped.

gdb/ChangeLog:

        * ada-lang.c (ada_check_typedef): Call ada_check_typedef only
        if type1 is a typedef.
2010-11-23 01:03:54 +00:00
Joel Brobecker df30368de1 Add `_finalizer' to the list of known GNAT auxilary routines.
This is a new routine that is being generated by the expander in
the context of controlled types.  This patch adds it to the list of such
routines so that the debugger does not show it when selecting the first
"user" frame (when switching tasks for instance).

gdb/ChangeLog:

        * ada-lang.h (ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS): Add
        "_finalizer" to the list.
2010-11-23 01:01:22 +00:00
Joel Brobecker 4889bbbc1d Remove commented-out code in symfile.c
This patch removes some code that has been `#if 0'-ed since at least
1999 or 2000...

gdb/ChangeLog:

        * symfile.c: Remove all "#if 0"/"#endif" blocks.
2010-11-23 00:59:58 +00:00
Joel Brobecker 0d14a78186 symfile.c: Add missing second space after period.
gdb/ChangeLog:

        * symfile.c: Add missing second space after period in various comments.
2010-11-23 00:58:55 +00:00
Joel Brobecker feb864b7f7 Minor comment reformatting in ada-typeprint.c
gdb/ChangeLog:

        * ada-typeprint.c (print_array_type): Fix formatting in comment.
        (print_selected_record_field_types): Fix formatting in function
        documentation.
2010-11-23 00:58:04 +00:00
Joel Brobecker 04f9d4d055 copy/paste typo when registering the `show ravenscar' prefix command
gdb/ChangeLog:

        * ravenscar-thread.c (_initialize_ravenscar): Fix copy/paste typo
        in name of "show ravenscar" prefix command name.
2010-11-23 00:56:52 +00:00
Joel Brobecker b64edec429 Add missing \n in `show ravenscar task-switching' output
A new-line was missing at the end of the output of the `show ravenscar
task-switching' command.  For instance:

    (gdb) show ravenscar task-switching
    Support for Ravenscar task/thread switching is enabled(gdb)

This patch fixes it.

gdb/ChangeLog:

        * ravenscar-thread.c (show_ravenscar_task_switching_command):
        Add missing '\n' in output.
2010-11-23 00:55:50 +00:00
Joel Brobecker 7f39f34a0e [Ada/ravenscar] New name for active-thread symbol
The GNAT Ravenscar implementation has recently been enhanced to allow
programs using that runtime to run on multi-cpu systems.  One of the
changes that were made is that the name of the symbol we use to
determine which task is the currently-running task has changed.

This patch enhances the debugger to use the new name, and fallback on
the old name if not found (this is for compatibility with older versions
of the compiler/runtime).

gdb/ChangeLog:

        * ravenscar-thread.c (running_thread_name): Change value.
        (read_thread_id): Remove advance declaration.
        (get_running_thread_msymbol): New function.
        (has_ravenscar_runtime): Use get_running_thread_msymbol to
        compute msym_running_thread.
        (get_running_thread_id): Renames read_thread_id. Slight modifications
        to not take any argument anymore, using get_running_thread_msymbol
        to determine which symbol to use instead.
        (ravenscar_running_thread): Use get_running_thread_id instead of
        read_thread_id.
2010-11-23 00:55:08 +00:00
Joel Brobecker f3890d597d Move ChangeLog entry to the correct ChangeLog file. 2010-11-23 00:34:42 +00:00
Joel Brobecker da700e1a61 ravenscar/sparc: cannot fetch registers from non-active thread
gdb/ChangeLog:

        * ravenscar-sparc-thread.c (supply_register_at_address):
        Fix passing of buf in call to regcache_raw_supply.
2010-11-23 00:29:45 +00:00
gdbadmin 200e3f16e7 *** empty log message *** 2010-11-23 00:00:03 +00:00
Jan Kratochvil 594e8718e7 gdb/
* dwarf2read.c (dwarf2_read_index): Ignore higher .gdb_index versions.
2010-11-22 20:35:02 +00:00
Tom Tromey 7ba86c9e66 * Makefile.in (.PRECIOUS): Reference ada-lex.c. 2010-11-22 20:30:58 +00:00
gdbadmin 9babbdcebf *** empty log message *** 2010-11-22 00:00:03 +00:00
gdbadmin 9da4c17bba *** empty log message *** 2010-11-21 00:00:03 +00:00
Jan Kratochvil c0efa7954e gdb/testsuite/
* gdb.dwarf2/dw2-stack-boundary.exp: New file.
	* gdb.dwarf2/dw2-stack-boundary.S: New file.
2010-11-20 01:53:04 +00:00
Jan Kratochvil ec3aa56733 gdb/testsuite/
* gdb.dwarf2/dw2-ada-ffffffff.S: New file.
	* gdb.dwarf2/dw2-ada-ffffffff.exp: New file.
2010-11-20 01:49:17 +00:00
gdbadmin da0680ac61 *** empty log message *** 2010-11-20 00:00:03 +00:00
Keith Seitz 1bfda48e8c * data-directory/Makefile.in (SYSCALLS_INSTALL_DIR):
Remove extraneous '/' after $(DESTDIR).
	(PYTHON_INSTALL_DIR): Likewise.
2010-11-19 23:36:32 +00:00
Jan Kratochvil 3f1eff0a2c gdb/
Fix stale memory references.
	* elfread.c (elf_symfile_read): Replace xmalloc by bfd_alloc, drop
	xfree, new comment.
2010-11-19 22:30:47 +00:00
Tom Tromey 954d8cae71 2010-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey  <tromey@redhat.com>

	* Makefile.in (.y.c): Directly create $@ from YLWRAP.
	(.PHONY): Remove for .y outputs.
2010-11-19 18:10:51 +00:00
Tom Tromey d53d4ac5aa 2010-11-19 Will Drewry <wad@google.com>
Tavis Ormandy  <taviso@google.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2read.c (decode_locdesc): Enforce location description stack
	boundaries.
2010-11-19 16:35:13 +00:00
gdbadmin ee9357b4cb *** empty log message *** 2010-11-19 00:00:02 +00:00
Doug Evans d82490117c * gdb.server/ext-run.exp: Fix intermittent failures. 2010-11-18 20:25:12 +00:00
Pierre Muller 77bc06753c * arm-tdep.c (arm_in_function_epilogue_p): Fix code when "MOV SP"
instruction is found.
2010-11-18 16:38:20 +00:00
gdbadmin bd0d264f1b *** empty log message *** 2010-11-18 00:00:02 +00:00
Tom Tromey ba19bb4d8d * value.c (value_entirely_optimized_out): Check the
'check_any_valid' field.
2010-11-17 19:53:37 +00:00
gdbadmin 53403d2c53 *** empty log message *** 2010-11-17 00:00:02 +00:00
Jan Kratochvil 19f220c3b4 gdb/
* ada-lang.c (modify_general_field): Remove.
	(make_array_descriptor): Replace all modify_general_field calls by
	modify_field.
	* value.c (modify_field): Update comment.  New variable bytesize.
	Normalize BITPOS.  Initialize BYTESIZE, use it.
2010-11-16 22:13:02 +00:00
Jan Kratochvil 87df528e2a gdb/
* dwarf2read.c (dw2_forget_cached_source_info): Clear the FULL_NAMES
	elements after xfree.
2010-11-16 22:04:52 +00:00
Tom Tromey 97924a976b * gdb-add-index.sh: Really remove. 2010-11-16 17:38:40 +00:00
Jan Kratochvil 9816fde3d4 gdb/
Code cleanup.
	* dwarf2read.c (alloc_one_comp_unit): Rename prototype to ...
	(init_one_comp_unit): ... this one.
	(prepare_one_comp_unit): New prototype.
	(dw2_require_line_header, process_psymtab_comp_unit): Use
	init_one_comp_unit.
	(process_psymtab_comp_unit): Use prepare_one_comp_unit.
	(load_partial_comp_unit): Remove variable attr.  Use
	init_one_comp_unit with xmalloc.  Use prepare_one_comp_unit.
	(load_full_comp_unit): Use init_one_comp_unit with xmalloc.  Use
	prepare_one_comp_unit.
	(read_signatured_type): Remove variable attr.  Use init_one_comp_unit.
	Use prepare_one_comp_unit.
	(alloc_one_comp_unit): Rename to ...
	(init_one_comp_unit): ... here and remove there calloc, new parameter
	cu.
	(prepare_one_comp_unit): New function.
2010-11-16 04:36:26 +00:00
Mike Frysinger a1f2ce7d60 gdbserver: fix warning in nommu clone
Building gdbserver for nommu targets atm fails with:
	linux-low.c: In function 'linux_tracefork_child':
	linux-low.c:4151: error: pointer of type 'void *' used in arithmetic

So cast the void* to a char*.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-16 03:27:05 +00:00
gdbadmin 572e7c1b61 *** empty log message *** 2010-11-16 00:00:03 +00:00
Doug Evans cb80163c46 revert previous patch 2010-11-15 17:25:09 +00:00
Doug Evans f4704706be * gdb.base/maint.exp (maint print statistics): Increase timeout for
all targets.  Restore old timeout afterwards.
2010-11-15 17:17:57 +00:00
gdbadmin 7eb3536ef8 *** empty log message *** 2010-11-15 00:00:33 +00:00
Pierre Muller 73c964d623 * arm-tdep.c (arm_in_function_epilogue_p): Fix code to avoid
possible used of uninitialized variable.
2010-11-14 12:10:59 +00:00
gdbadmin ef13ebfec9 *** empty log message *** 2010-11-14 00:00:34 +00:00
gdbadmin df6008afc8 *** empty log message *** 2010-11-13 00:00:33 +00:00
Nathan Froyd 74af9197f1 gdb/
* rs6000-tdep.c (bfd_uses_spe_extensions): New function.
	(rs6000_gdbarch_init): Call it.
2010-11-12 21:54:31 +00:00
Nathan Froyd e52d501632 gdb/
* rs6000-tdep.c (gdb_print_insn_powerpc): Disassemble e500
	instructions if debugging an E500 binary.
2010-11-12 21:53:10 +00:00
Nathan Froyd d4eba7d1b0 gdb/testsuite/
* gdb.stabs/gdb11479.exp: Use runto_main.
2010-11-12 21:49:55 +00:00
Nathan Froyd b04c2f88b6 gdb/testsuite/
* gdb.base/break-entry.exp: Skip if using a stub.
2010-11-12 21:47:47 +00:00
Nathan Froyd ae9d7ce40f gdb/testsuite/
* gdb.python/py-inferior.exp: Pack values in target endianness.
2010-11-12 21:44:49 +00:00
Tom Tromey 621c83642d gdb
* varobj.c (value_get_print_value): Rearrange.  Pass stream to
	apply_varobj_pretty_printer.
	* c-lang.c: Include exceptions.h.
	(c_get_string): Throw MEMORY_ERROR when appropriate.
	* python/py-prettyprint.c (enum string_repr_result): New.
	(print_stack_unless_memory_error): New function.
	(print_string_repr): Change return type.  Use
	print_stack_unless_memory_error.
	(print_children): Use print_stack_unless_memory_error.
	(apply_val_pretty_printer): Update.  Don't print children if
	string representation threw an exception.
	(apply_varobj_pretty_printer): Add 'stream' argument.  Use
	print_stack_unless_memory_error.
	* python/python.c (gdbpy_gdb_error, gdbpy_gdb_memory_error): New
	globals.
	(_initialize_python): Initialize them.
	* python/python-internal.h (GDB_PY_HANDLE_EXCEPTION): Use
	gdbpy_convert_exception.
	(GDB_PY_SET_HANDLE_EXCEPTION): Likewise.
	(gdbpy_gdb_error, gdbpy_gdb_memory_error): Declare.
	(gdbpy_convert_exception): Declare.
	(apply_varobj_pretty_printer): Update.
	* python/py-utils.c (gdbpy_convert_exception): New function.
gdb/doc
	* gdb.texinfo (Basic Python): Update.  Add xref.
	(Exception Handling): Document new exception classes.
	(Types In Python): Update.
	(Frames In Python): Update.
gdb/testsuite
	* gdb.python/py-prettyprint.c (main): Add new 'ns2' local.
	* gdb.python/py-prettyprint.exp (run_lang_tests): Add test for
	MemoryError.
	* gdb.python/python.exp (gdb_py_test_multiple): Update exception
	type.
	* gdb.python/py-value.exp (test_value_in_inferior): Add test for
	MemoryError.
	(test_subscript_regression): Update exception type.
2010-11-12 20:49:43 +00:00
Marc Khouzam f1b9e6e7ee 2010-11-12 Marc Khouzam <marc.khouzam@ericsson.com>
* mi/mi-main.c (mi_cmd_target_detach): Accept new
        thread-group id format.
2010-11-12 18:46:42 +00:00
Jan Kratochvil 74884f7bdd gdb/
* spu-tdep.c (spu_catch_start): Fix compilation error typo.
2010-11-12 12:38:39 +00:00
gdbadmin e493c3b7f3 *** empty log message *** 2010-11-12 00:00:02 +00:00
Phil Muldoon 84f4c1fe05 2010-11-11 Phil Muldoon <pmuldoon@redhat.com>
* python/py-breakpoint.c (BPPY_REQUIRE_VALID): Check if bp is
	NULL.
	(BPPY_SET_REQUIRE_VALID): Ditto.
	(bpnum_is_valid): Delete function.
	(bppy_get_visibility): New function.
	(bppy_new): Parse for, and validate internal keyword.  Pass
	internal keyword to breakpoint or watchpoint functions.
	(build_bp_list): New function.
	(gdbpy_breakpoints): Rewrite.  Use build_bp_list and
	iterate_over_breakpoints.
	(gdbpy_breakpoint_created): Rewrite.  Do not store breakpoints in a
	look-aside vector.
	(gdbpy_breakpoint_deleted): Rewrite, defer breakpoint management
	to internal breakpoint chain.

	* breakpoint.c (set_breakpoint_number): New function.
	(breakpoint_1): Check if breakpoint number is more than zero.
	(set_raw_breakpoint_without_location): Set py_bp_object to NULL.
	(create_breakpoint_sal): Take a new parameter called internal.
	Call set_breakpoint_number with internal parameter.  Do not
	mention internal breakpoints.  All callers updated.
	(create_breakpoint): Ditto.
	(create_breakpoints_sal): Ditto.
	(watch_command_1): Ditto.
	(watch_command_wrapper): Take a new parameter called internal.
	All callers updated.
	(rwatch_command_wrapper): Ditto.
	(awatch_command_wrapper): Ditto.
	(save_breakpoints): Update breakpoint save condition check.
	(iterate_over_breakpoints): New function.
	* breakpoint.h: Add conditional python includes.  Add py_bp_object
	and comment to struct breakpoint.  Update all callers.
	* defs.h: Add PyObject definition for GDB builds without Python.

2010-11-11  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.texinfo (Breakpoints In Python): Document "internal"
	parameter, and visible attribute.


2010-11-11  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-breakpoint.exp: Add internal watchpoint and
	breakpoint tests.
2010-11-11 14:11:56 +00:00
gdbadmin d5906a46f1 *** empty log message *** 2010-11-11 00:00:33 +00:00
Doug Evans f61a2da754 * python/lib/gdb/command/pretty_printers.py
(do_enable_pretty_printer_1): Handle printer.subprinters is None.
2010-11-10 23:44:14 +00:00
Doug Evans 4dfea56049 * value.c (set_value_enclosing_type): Renamed from
value_change_enclosing_type.  All callers updated.
	* value.h (set_value_enclosing_type): Update.
	* valops.c (value_full_object): Always return a copy if we need to
	make changes to the input value.
2010-11-10 17:47:23 +00:00
gdbadmin fd3646071c *** empty log message *** 2010-11-10 00:00:03 +00:00
Pedro Alves a1442452ec gdb/
* breakpoint.c (watch_command_1): Get a pointer of the lazy
	version of the expression's value, even if reading the value from
	memory fails.  When creating a -location watchpoint, get the
	value's address from the lazy value pointer.

	gdb/testsuite/
	* gdb.base/watchpoint.exp: Test "watch -location" with an
	innacessible location.
2010-11-09 18:23:52 +00:00
Jan Kratochvil efd11a33a1 gdb/testsuite/
* gdb.base/maint.exp: Expect "." prefix.
	* gdb.base/nodebug.exp: Expect "." Likewise.
	* gdb.base/sepsymtab.exp: Expect "." Likewise.
	* gdb.base/watchpoint-cond-gone.exp: Likewise.
	* gdb.base/watchpoint.exp: Expect a software watch to be created for
	POWER server processors.
2010-11-09 04:44:17 +00:00
gdbadmin d9435e4b81 *** empty log message *** 2010-11-09 00:00:33 +00:00
Jan Kratochvil aa00efb580 gdb/testsuite/
* gdb.base/break-entry.exp: convert entry point for
	ppc64 and expect leading `.' on ppc64's symbols
2010-11-08 18:05:56 +00:00
gdbadmin fff50f7175 *** empty log message *** 2010-11-08 00:00:32 +00:00
Jan Kratochvil 803b5f9525 gdb/
* infrun.c (restore_inferior_thread_state): Use
	discard_inferior_thread_state to free the data.
	(discard_inferior_thread_state): xfree also siginfo_data.
2010-11-07 22:25:16 +00:00
gdbadmin 91cd6f4fcf *** empty log message *** 2010-11-07 00:00:03 +00:00
gdbadmin b89883f710 *** empty log message *** 2010-11-06 00:00:03 +00:00
Doug Evans b521dba831 * gdb.python/py-param.exp: Delete, contents moved to ...
* gdb.python/py-parameter.exp: ... here.  New file.
	Add test for gdb.parameter ("directories").
2010-11-05 17:07:36 +00:00
Doug Evans 99e7ae30ed Make gdb.parameter("directories") work.
New command "set directories".
	* NEWS: Document them.
	* source.c (set_directories_command): New function.
	(show_directories_1): Renamed from show_directories.
	All callers updated.
	(show_directories_command): New function.
	(_initialize_source): Install "directories" as a set/show
	variable instead of just a show command.

	doc/
	* gdb.texinfo (Source Path): Document "set directories".

	testsuite/
	* gdb.base/help.exp: Update expected output.
	* gdb.python/py-parameter.exp: New file.
2010-11-05 16:55:40 +00:00
Ken Werner f4b8a18de7 gdb:
* NEWS: Mention OpenCL C language support.
	* Makefile.in (SFILES): Add opencl-lang.c.
	(COMMON_OBS): Add opencl-lang.o.
	* opencl-lang.c: New File
	* defs.h (enum language): Add language_opencl.
	* dwarf2read.c (read_file_scope): Handle DW_AT_producer for the
	IBM XL C OpenCL compiler.
	* c-lang.h: Include "parser-defs.h".
	(evaluate_subexp_c): Declare.
	* c-lang.c (evaluate_subexp_c): Remove the static qualifier.
	(c_op_print_tab): Add declaration.
	* eval.c (binop_promote): Handle language_opencl.
	* c-exp.y: Lookup the primitive types instead of referring to the
	builtins.

gdb/testsuite:
	* Makefile.in (ALL_SUBDIRS): Add gdb.opencl.
	* configure.ac (AC_OUTPUT): Add gdb.opencl/Makefile.
	* configure: Regenerate.
	* gdb.opencl/Makefile.in: New File.
	* gdb.opencl/datatypes.exp: Likewise.
	* gdb.opencl/datatypes.cl: Likewise.
	* gdb.opencl/operators.exp: Likewise.
	* gdb.opencl/operators.cl: Likewise.
	* gdb.opencl/vec_comps.exp: Likewise.
	* gdb.opencl/vec_comps.cl: Likewise.
	* gdb.opencl/convs_casts.exp: Likewise.
	* gdb.opencl/convs_casts.cl: Likewise.
	* lib/opencl.exp: Likewise.
	* lib/opencl_hostapp.c: Likewise.
	* lib/opencl_kernel.cl: Likewise.
	* lib/cl_util.c: Likewise.
	* lib/cl_util.c: Likewise.
	* gdb.base/default.exp (set language): Add "opencl" to the list of
	languages.

gdb/doc:
	* gdb.texinfo: (Summary) Add mention about OpenCL C language support.
	(OpenCL C): New node.
2010-11-05 14:31:30 +00:00
Jan Kratochvil 075ff26d5b gdb/
Fix configure --enable-plugins --without-python.
	* configure.ac (for ELF support in BFD) <"$plugins" = "yes">: New.
	* configure: Regenerate.
2010-11-05 01:50:18 +00:00
Jan Kratochvil 14ad321702 gdb/
* solib.c (solib_read_symbols): Call exception_fprintf even without
	FROM_TTY.  Print also so->so_name.
2010-11-05 01:40:28 +00:00
gdbadmin 0bd0fa1e7f *** empty log message *** 2010-11-05 00:00:03 +00:00
Sami Wagiaalla a9d5ef47f3 Fix derived class overload problem.
2010-11-04  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdbtypes.h (struct rank): Created subrank.
	* gdbtypes.c: Initialized subrank for all
	'BADNESS' constants.
	(distance_to_ancestor): New function.
	(is_ancestor): Use distance_to_ancestor.
	(is_public_ancestor): Ditto.
	(sum_ranks): Handle subrank.
	(compare_ranks): Ditto.
	(rank_one_type): Subrank base conversions.

2010-11-04  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/overload.exp: Added test for inheritance
	overload.
	* gdb.cp/overload.cc: Ditto.
	* gdb.cp/oranking.exp: Removed releveant kfails.
2010-11-04 20:43:25 +00:00
Sami Wagiaalla 6403aeeaa1 Create and use struct rank.
2010-11-04  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdbtypes.h: Create struct rank.
	Convert all 'BADNESS' macros to const struct rank declarations.
	(sum_ranks): New function.
	(compare_ranks): New function.
	* valops.c (find_oload_champ): Updated.
	(classify_oload_match): Use compare_ranks.
	Improved comments.
	(compare_parameters): Use compare_ranks.
	* gdbtypes.c: Initialize 'BADNESS' constants.
	(sum_ranks): New function.
	(compare_ranks): New function.
	(compare_badness): Use compare_ranks.
	(rank_function): Use global constants instead of literals.
	(rank_one_type): Ditto.
	Return struct rank.
	Use sum_ranks.
2010-11-04 20:26:23 +00:00
Doug Evans 23fa7f66ac * python/py-prettyprint.c (find_pretty_printer_from_gdb): Fix comment.
(find_pretty_printer): Fix comments.
2010-11-04 20:18:42 +00:00
Jan Kratochvil 03eb1c79d4 gdb/testsuite/
* gdb.ada/null_array.exp (print my_table): Call get_compiler_info and
	check test_compiler_info.
2010-11-04 18:52:11 +00:00
Hui Zhu 608bcef267 2010-11-04 Hui Zhu <teawater@gmail.com>
* tracepoint.c (remote_trace_set_readonly_regions): Change lma to vma.
2010-11-04 04:48:21 +00:00
gdbadmin 1dd6f20d5e *** empty log message *** 2010-11-04 00:00:33 +00:00
Joel Brobecker 9addb3b96c [Ada] move some variables to scope where they are used
I noticed that some variables are only used inside one side of
an if/else blob. So I moved these variables inside that block for
better clarity.

gdb/ChangeLog:

        * ada-valprint.c (ada_val_print_array): Move variables `eltlen'
        and `len' declaration and computation inside block where they
        are being used.
2010-11-03 23:20:33 +00:00
Joel Brobecker 75be741bdf [Ada] fix warning when printing empty array
This patch should fix the following regression:

     (gdb) print my_table
    -$1 = ()
    -(gdb) PASS: gdb.ada/null_array.exp: print my_table
    +$1 = (warning: unable to get bounds of array, assuming null array
    +)
    +(gdb) FAIL: gdb.ada/null_array.exp: print my_table

The problem was introduced by a change in val_print_array_elements
which removed a check for the case where the array's high bound
is smaller than the array's low bound (empty array).

This change restores the check and forces the len to zero in that case.
Looking at the patch that caused the regression, I suspect that we may
have other parts that might have been broken (non-zero array low bound?).

gdb/ChangeLog:

        * valprint.c (val_print_array_elements): Put back handling of
        empty arrays.
2010-11-03 23:20:13 +00:00
Ken Werner dbc98a8b6e gdb:
* dwarf2read.c (read_array_type): Read the DW_AT_byte_size from the
	DIE and set the length of the type.
	* gdbtypes.h (get_array_bounds): Move here from valprint.h.
	* gdbtypes.c (get_array_bounds): Move here from valprint.c and
	return 0 if the corresponding bounds of the type are undefined.
	* valprint.h (get_array_bounds): Move declaration to gdbtypes.h.
	* valprint.c (get_array_bounds): Move implementation to gdbtypes.c.
	(val_print_array_elements): Use get_array_bounds to compute the number
	of array elements instead of dividing the length of the array by the
	length of the element types.
	* valarith.c (vector_binop): Likewise.
	* valops.c (value_cast): Likewise.
	* c-valprint.c (c_val_print): Likewise.
	* c-typeprint.c (c_type_print_varspec_suffix): Likewise.

gdb/testsuite:
	* gdb.base/gnu_vector.exp: Adjust expect messages.
2010-11-03 14:21:58 +00:00
Ken Werner 120bd36024 gdb:
* valarith.c (value_pos, value_neg, value_complement): Handle
	vector types.
	* valops.c (value_one): Likewise.

gdb/testsuite:
	* gdb.base/gnu_vector.exp: Add unary operator tests.
2010-11-03 14:06:27 +00:00
Ken Werner c37f7098e9 gdb:
* value.h (value_non_lval): Declare.
	* value.c (value_non_lval): New function.
	* eval.c (evaluate_subexp_standard) <UNOP_POSTINCREMENT,
	UNOP_POSTDECREMENT>: Call value_non_lval to ensure to return a
	non-lvalue.

gdb/testsuite:
	* gdb.base/exprs.exp: Add tests for pre-/post- in-/decrement operators.
2010-11-03 13:49:38 +00:00
gdbadmin e9ed54eec6 *** empty log message *** 2010-11-03 00:00:02 +00:00
Doug Evans 7b51bc51e1 New python module gdb.printing, and new commands info pretty-printer,
enable pretty-printer, disable pretty-printer.
	* NEWS: Mention them.
	* data-directory/Makefile.in (PYTHON_FILES): Add gdb/printing.py,
	gdb/command/__init__.py, gdb/command/pretty_printers.py.
	* python/lib/gdb/__init__.py: Install pretty-printer commands.
	* python/lib/gdb/printing.py: New file.
	* python/lib/gdb/command/__init__.py: New file.
	* python/lib/gdb/command/pretty_printers.py: New file.

	doc/
	* gdb.texinfo (Pretty Printing): Expand into three sections,
	introduction, example, and commands.
	(Python API): Delete section Disabling Pretty-Printers, merge into
	Selecting Pretty-Printers.
	(Writing a Pretty-Printer): New section.  Move the pretty-printer
	example here, and reformat to match python coding style.  Add a second
	example using the gdb.printing module.
	(Python modules): Add gdb.printing.

	testsuite/
	* gdb.python/py-pp-maint.c: New file.
	* gdb.python/py-pp-maint.exp: New file.
	* gdb.python/py-pp-maint.py: New file.
2010-11-02 22:44:13 +00:00
Tom Tromey 50c97f3812 gdb
* NEWS: Mention Guile removal.
	* defs.h (enum language) <language_scm>: Remove.
	* Makefile.in (SFILES): Remove scm-exp.c, scm-lang.c,
	scm-valprint.c.
	(HFILES_NO_SRCDIR): Remove scm-lang.h, scm-tags.h.
	(COMMON_OBS): Remove scm-exp.o, scm-lang.o, scm-valprint.o.
	* scm-exp.c, scm-lang.c, scm-valprint.c, scm-lang.h, scm-tags.h:
	Remove.
gdb/testsuite
	* gdb.base/default.exp: Remove "scheme" from language list.
2010-11-02 18:55:54 +00:00
Doug Evans 9dea916356 * top.c: #include "python/python.h".
(gdb_init): Add a comment regarding initialize_all_files.
	Call finish_python_initialization at the end.
	* python/python.h (finish_python_initialization): Declare.
	* python/python.c (finish_python_initialization): New function.
	(_initialize_python): Move python-implemented initialization there
	and call it.
	(GdbMethods): Use #ifdef HAVE_PYTHON for consistency.
2010-11-02 16:48:43 +00:00
Jan Kratochvil a289b8f64e gdb/
Revert:
	2010-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
		    Pedro Alves  <pedro@codesourcery.com>
	* gdbthread.h (currently_stepping): New declaration.
	* infrun.c (currently_stepping): Remove the forward declaration.
	(currently_stepping): Make it global.
	* linux-nat.c (resume_callback) <lp->stopped && lp->status == 0>: New
	variables tp and step, initialized them.  Pass STEP to to_resume.
	Print also possibly "PTRACE_SINGLESTEP" if STEP.  Initialize LP->STEP.
	* remote.c (currently_stepping_callback): New.
	(remote_vcont_resume)
	<ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid)>:
	New variable tp.  Call currently_stepping_callback and step such
	thread.

gdb/testsuite/
	Revert:
	2010-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* gdb.threads/sigstep-threads.exp: New file.
	* gdb.threads/sigstep-threads.c: New file.
2010-11-02 01:37:32 +00:00
gdbadmin ab2a306104 *** empty log message *** 2010-11-02 00:00:33 +00:00
Hui Zhu 2209c8070c 2010-10-31 Hui Zhu <teawater@gmail.com>
* tracepoint.c (tfile_xfer_partial): Change lma to vma.
2010-11-01 07:00:13 +00:00
gdbadmin 3d9e6b12b0 *** empty log message *** 2010-11-01 00:00:33 +00:00
gdbadmin 42b71c30c3 *** empty log message *** 2010-10-31 00:00:03 +00:00
Doug Evans 9eeee97773 * gdb.texinfo (Python): Fix long line. 2010-10-30 04:39:47 +00:00
gdbadmin 6fc63b03dd *** empty log message *** 2010-10-30 00:00:02 +00:00
gdbadmin b2ee48aae6 *** empty log message *** 2010-10-29 00:00:02 +00:00
Hui Zhu 0a2a54b8b0 2010-10-28 Hui Zhu <teawater@gmail.com>
* tracepoint.c (trace_save): Change utp->actions to
	utp->step_actions.
2010-10-28 03:38:36 +00:00
gdbadmin 9842990da6 *** empty log message *** 2010-10-28 00:00:02 +00:00
gdbadmin 0ffc4adf95 *** empty log message *** 2010-10-27 00:00:32 +00:00
Joel Brobecker 284a3db383 fix typo in _FILE_OFFSET_BITS comment
This fixes a typo that MichaelS noticed in a patch I submitted and
forgot to fix.

gdb/ChangeLog:

	* (_FILE_OFFSET_BITS): Fix typo in comment.
2010-10-26 18:08:04 +00:00
Joel Brobecker aed1781d40 Fix build failures with python support on sparc-solaris
There were two types of errors, mostly compiler warnings:

  1. _FILE_OFFSET_BITS being redefined in pyconfig.h;
     This is a problem we're familiar with, having seen similar
     issues on GNU/Linux systems. I used a similar solution.

  2. GCC 4.5 complains that calls to PyEval_InitThreads and
     PyEval_ReleaseLock have no effect.  This is because our Python
     is built without thread support, leading us to use the dummy
     #define in python-internal.h which just gets replaced by `0'.
     Since this function returns void (checked versions 2.4 and 2.7),
     I simply removed the 0.

gdb/ChangeLog:

        python/python-internal.h (_FILE_OFFSET_BITS): Undefine.
        (PyEval_InitThreads): Remove duplicate. Define as nothing.
        (PyEval_ReleaseLock): Define as nothing.
2010-10-26 18:06:34 +00:00
Joel Brobecker 1e3fad37be replace strcmp by FILENAME_CMP for filename comparison
gdb/ChangeLog:

        * dwarf2read.c (psymtab_include_file_name): Replace call to strcmp
        by call to FILENAME_CMP.
2010-10-26 17:59:50 +00:00
Joel Brobecker 558b1900b0 avoid assignment inside if condition (dictionary.c)
This change gets rid of an ARI warning which was recently introduced
by one of our changes.

gdb/ChangeLog:

        * dictionary.c (dict_hash): Move assignment out of if condition.
2010-10-26 14:50:13 +00:00
gdbadmin 3213b810a8 *** empty log message *** 2010-10-26 00:00:03 +00:00
gdbadmin 4073872ae3 *** empty log message *** 2010-10-25 00:00:03 +00:00
gdbadmin b590ad6171 *** empty log message *** 2010-10-24 00:00:33 +00:00
gdbadmin e26f407edc *** empty log message *** 2010-10-23 00:00:02 +00:00
gdbadmin 03cb634e19 *** empty log message *** 2010-10-22 00:00:03 +00:00
Jie Zhang f474844cb7 * Makefile.in (install): Remove dependency of install-only and
recursively invoke make for install-only.
	* data-directory/Makefile.in: Add FLAGS_TO_PASS variable.
	(install): Pass FLAGS_TO_PASS when recursively make install-only.

	gdbserver/
	* Makefile.in: Add FLAGS_TO_PASS variable.
	(install): Remove dependency of install-only and recursively
	invoke make for install-only.
2010-10-21 23:50:46 +00:00
gdbadmin 3e05770224 *** empty log message *** 2010-10-21 00:00:03 +00:00
Michael Snyder cd017491ca 2010-10-20 Michael Snyder <msnyder@vmware.com>
* gdb.threads/fork-child-threads.exp: Don't run on remote target.
2010-10-20 23:58:07 +00:00
Doug Evans a0e0ffdffa * gdbint.texinfo (Misc Guidelines): Renamed from Coding.
All references updated.  Correct sections marked as subsections.
	(Coding Standards): New chapter.  Move the coding standard related
	subsections here.  Add section on Python coding standards.
2010-10-20 22:53:36 +00:00
Sami Wagiaalla 78c62ceee3 cvs add smartp.cc smartp.exp
Original changelog:
Support overloading of 'operator->'.
[...]
2010-10-19  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/smartp.exp: New test.
	* gdb.cp/smartp.cc : New test.
2010-10-20 18:56:09 +00:00
Hui Zhu 8991e9fa24 2010-10-20 Hui Zhu <teawater@gmail.com>
* tracepoint.c (tfile_get_traceframe_address): Call
	extract_signed_integer.
	(tfile_trace_find): Call extract_signed_integer and
	extract_unsigned_integer.  Change data_size to unsigned int.
	(tfile_fetch_registers): Call extract_unsigned_integer.
	(tfile_xfer_partial): Ditto.
	(tfile_get_trace_state_variable_value): Call
	extract_signed_integer and extract_unsigned_integer.
2010-10-20 14:03:17 +00:00
Vladimir Prus 21bce12043 * remote.c (remote_get_threadlist): If we got empty
response, bail out immediately, and don't emit any
	warnings.
2010-10-20 09:10:48 +00:00
gdbadmin a8f3b77c35 *** empty log message *** 2010-10-20 00:00:33 +00:00
Ulrich Weigand ad8b5167d7 * arm-tdep.c (thumb_get_next_pc_raw): Handle Thumb-16 encoding
for "mov pc, REG" as well.
	(thumb_instruction_changes_pc): Likewise.
2010-10-19 21:30:54 +00:00
Ulrich Weigand 8e6a5956eb * gdb.base/watch_thread_num.exp: Revert 2008-09-03 change.
Skip test completely if gdb,no_hardware_watchpoints.
2010-10-19 21:29:23 +00:00
Ulrich Weigand 2c04da0de0 * gdb.base/foll-fork.exp: Make regexps to match catchpoint hits more
strict, but do not check for any particular function name within libc.
2010-10-19 21:28:33 +00:00
Sami Wagiaalla 79afc5ef5d Support overloading of 'operator->'.
2010-10-19  Sami Wagiaalla  <swagiaal@redhat.com>

	 PR C++/11500:
	* valarith.c (value_x_unop): Handle STRUCTOP_PTR.
	* eval.c (evaluate_subexp_standard): Check for overload of
	'operator->'.
	* valarith.c (value_x_binop): Throw NOT_FOUND_ERROR.
	(value_x_unop): Ditto.
	* valops.c: Include "exceptions.h".
	(find_overload_match): Throw NOT_FOUND_ERROR.
	(value_struct_elt): Ditto.

2010-10-19  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/smartp.exp: New test.
	* gdb.cp/smartp.cc : New test.
2010-10-19 20:53:15 +00:00
Tom Tromey cca56ac7ae * python/py-cmd.c (cmdpy_function): Unreference exception state. 2010-10-19 20:11:37 +00:00
Sami Wagiaalla 026ffab798 Support pointer to bool conversion.
2010-10-19  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdbtypes.h: Introduce BOOL_PTR_CONVERSION_BADNESS.
	* gdbtypes.c (rank_one_type): Use BOOL_PTR_CONVERSION_BADNESS
	for conversion.
	Make all other conversions illegal.

2010-10-19  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/converts.exp: Test pointer to bool conversion.
	Test pointer to long conversion.
	* gdb.cp/oranking.exp: Removed relevant kfail.
2010-10-19 16:07:25 +00:00
Doug Evans 8c540a24cf * c-typeprint.c (c_type_print_base, case TYPE_CODE_TYPEDEF): Verify
assumptions of when this case happens.  Print "<unnamed typedef>".
2010-10-19 04:22:20 +00:00
gdbadmin a01c006446 *** empty log message *** 2010-10-19 00:00:32 +00:00
Tom Tromey 3a772aa44d gdb
* valprint.c (val_print_string): Pass 'encoding' to
	LA_PRINT_STRING.
gdb/testsuite
	* gdb.python/py-prettyprint.exp (run_lang_tests): Test encoding
	argument to lazy_string.
	* gdb.python/py-prettyprint.py (pp_ls_encoding): New global.
	(pp_ls.to_string): Use it.
	* gdb.python/py-prettyprint.c (main): Move declarations to top.
	Add "estring2" local.
2010-10-18 19:14:03 +00:00
gdbadmin 36ad8f020a *** empty log message *** 2010-10-18 00:00:33 +00:00
Jan Kratochvil 5fc3827b43 gdb/testsuite/
Fix s390x compatibility.
	* gdb.dwarf2/pr11465.S (DW_TAG_pointer_type): Use PTRBITS.  Twice.
	* gdb.dwarf2/pr11465.exp: Set ptrbits, use it for -DPTRBITS.
2010-10-17 18:55:09 +00:00
Jan Kratochvil 01f8c46dda gdb/
Fix the `stopped language detection' testcase for gcc-4.5.
	* dwarf2read.c (read_partial_die): Set also LANGUAGE_OF_MAIN.
	* symfile.c (set_initial_language): Move variable filename to a more
	inner block.  Prefer LANGUAGE_OF_MAIN.
	* symtab.c (language_of_main): New variable.
	(set_main_name): Always reset LANGUAGE_OF_MAIN.
	* symtab.h (language_of_main): New declaration.
2010-10-17 18:49:47 +00:00
Jan Kratochvil 8aeb23f364 gdb/
* gdbthread.h (currently_stepping): New declaration.
	* infrun.c (currently_stepping): Remove the forward declaration.
	(currently_stepping): Make it global.
	* linux-nat.c (resume_callback) <lp->stopped && lp->status == 0>: New
	variables tp and step, initialized them.  Pass STEP to to_resume.
	Print also possibly "PTRACE_SINGLESTEP" if STEP.  Initialize LP->STEP.
	* remote.c (currently_stepping_callback): New.
	(remote_vcont_resume)
	<ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid)>:
	New variable tp.  Call currently_stepping_callback and step such
	thread.

gdb/testsuite/
	* gdb.threads/sigstep-threads.exp: New file.
	* gdb.threads/sigstep-threads.c: New file.
2010-10-17 18:24:47 +00:00
Jan Kratochvil c1e5657246 gdb/
* infrun.c (follow_exec): Replace symbol_file_add_main by
	symbol_file_add with SYMFILE_DEFER_BP_RESET, set_initial_language and
	breakpoint_re_set.
	* m32r-rom.c (m32r_load, m32r_upload_command): Use parameter 0 for
	clear_symtab_users.
	* objfiles.c (free_all_objfiles): Likewise.
	* remote-m32r-sdi.c (m32r_load): Likewise.
	* solib-som.c (som_solib_create_inferior_hook): Likewise.
	* symfile.c (new_symfile_objfile): New comment for add_flags.  Call
	clear_symtab_users with ADD_FLAGS.
	(reread_symbols): Use parameter 0 for clear_symtab_users.
	(clear_symtab_users): New parameter add_flags.  Do not call
	breakpoint_re_set if SYMFILE_DEFER_BP_RESET.
	(clear_symtab_users_cleanup): Use parameter 0 for clear_symtab_users.
	* symtab.h (clear_symtab_users): New parameter add_flags.

gdb/testsuite/
	* gdb.base/pie-execl.exp: New file.
	* gdb.base/pie-execl.c: New file.
2010-10-17 17:45:17 +00:00
Jan Kratochvil 3a182a6912 gdb/
Fix GCC false warning.
	* varobj.c (value_get_print_value) <str_addr>: Initialize it.
2010-10-17 08:43:46 +00:00
gdbadmin ad65951529 *** empty log message *** 2010-10-17 00:00:32 +00:00
gdbadmin 591c895777 *** empty log message *** 2010-10-16 00:00:33 +00:00
Pierre Muller 3a9d7214ad * p-typeprint.c (pascal_type_print_method_args): Fix problem in
display of type of method arguments.
2010-10-15 23:08:04 +00:00
Tom Tromey 09ca9e2e34 PR python/11948:
* varobj.c (value_get_print_value): Use val_print_string to print
	lazy strings.
	* python/py-prettyprint.c (print_string_repr): Use
	val_print_string to print lazy strings.  Fix cleanup logic.
	(print_children): Likewise.
	* python/python-internal.h (gdbpy_extract_lazy_string): Update.
	* python/py-lazy-string.c (gdbpy_extract_lazy_string): Rewrite.
	Change return type to 'void', add 'addr' argument.
	* value.h (val_print_string): Update.
	* valprint.c (val_print_string): Add 'encoding' argument.
	* printcmd.c (print_formatted): Update.
	* p-valprint.c (pascal_val_print): Update.
	* m2-valprint.c (print_unpacked_pointer): Update.
	(m2_print_array_contents): Likewise.
	* jv-valprint.c (java_value_print): Update.
	* f-valprint.c (f_val_print): Update.
	* c-valprint.c (c_val_print): Update.
	* auxv.c (fprint_target_auxv): Update.
2010-10-15 18:54:13 +00:00
Jan Kratochvil 92163a10dc gdb/
PR exp/12117
	* gdbtypes.c (check_typedef): Clean up function comment.
	Keep track of instance flags as we strip typedefs and create a new
	type to preserve them if necessary.
	* gdbtypes.h (type) <instance_flags>: Extend the comment.

gdb/testsuite/
	PR exp/12117
	* gdb.cp/ptype-cv-cp.cc: New file.
	* gdb.cp/ptype-cv-cp.exp: New file.
2010-10-15 17:48:48 +00:00
Pierre Muller dae714134c * p-lang.c (is_pascal_string_type): Use TYPE_FIELD_NAME accessor. 2010-10-15 15:42:51 +00:00
gdbadmin 0a72ddf55c *** empty log message *** 2010-10-15 00:00:04 +00:00
Sami Wagiaalla 7062b0a0df Fixed void* vs int* overload issue (PR C++/10343).
2010-10-14  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdbtypes.h: Create BASE_PTR_CONVERSION_BADNESS.
	* gdbtypes.c (rank_one_type): Move type comparison code out of here
	to...
	(types_equal): ...here. And changed it as follows:
	Outside of typedefs type must be of the same TYPE_CODE.
	When compairing two pointers or references they are equal if their
	targets are equal.
	Correct pointer conversions.

2010-10-14  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/converts.cc: New test program.
	* gdb.cp/converts.exp: New test.
	* gdb.cp/overload.exp: Added test for void* vs int*.
	* gdb.cp/overload.exp: Ditto.
	* gdb.cp/oranking.exp: Removed related kfail.
2010-10-14 16:13:43 +00:00
Pierre Muller 5c3da5ea2e * p-lang.c (is_pascal_string_type): Avoid crashes on structures
having fields without names.
2010-10-14 15:18:54 +00:00
gdbadmin c2a41a5128 *** empty log message *** 2010-10-14 00:00:02 +00:00
Doug Evans 0e3509dbce New python module gdb.types.
* NEWS: Document it.
	* data-directory/Makefile.in (PYTHON_FILES): Add gdb/types.py.
	* python/lib/gdb/types.py: New file.

	testsuite/
	* lib/gdb-python.exp (gdb_check_python_config): New function.
	* gdb.python/Makefile.in (EXECUTABLES): Add lib-types.
	* gdb.python/lib-types.cc: New file.
	* gdb.python/lib-types.exp: New file.

	doc/
	* gdb.texinfo (Python): Add "Python modules".
	(Types in Python): Add reference to gdb.types section.
	(Python modules): New node.
2010-10-13 20:08:46 +00:00
Tom Tromey 577ce03a7c * language.h (LA_PRINT_ARRAY_INDEX): Fix argument name. 2010-10-13 17:38:09 +00:00
Doug Evans a737a51bb0 * c-typeprint.c: Whitespace cleanup.
(cp_type_print_method_args): Remove unnecessary forward decl.
	(cp_type_print_derivation_info): Ditto.
	(c_type_print_varspec_prefix): Mark as static at definition.
	(c_type_print_modifier): Fix arg descriptions.
2010-10-13 15:10:10 +00:00
Jan Kratochvil 8dc785338e gdb/
* python/py-breakpoint.c (bppy_set_condition): New comment.
	* python/py-cmd.c (cmdpy_function): Call also gdbpy_print_stack for
	failed PyUnicode_Decode.
	(cmdpy_completer): Skip element for failed
	python_string_to_host_string.
	(cmdpy_init): Return -1 on failed python_string_to_host_string.
	* python/py-frame.c (frapy_read_var): Extend the function comment.
	* python/py-function.c (fnpy_init): Return -1 on failed
	python_string_to_host_string.
	* python/py-inferior.c (infpy_read_memory, infpy_write_memory): Extend
	the function comment.
	(infpy_search_memory): Extend the function comment.  Remove the
	PyErr_SetString call on already set error state.
	* python/py-param.c (set_parameter_value): Extend the function
	comment.  Return -1 on failed python_string_to_host_string, twice.
	(set_attr): Extend the function comment.
	(compute_enum_values): Extend the function comment.  New variable
	back_to.  Protect self->enumeration by BACK_TO cleanups.  Return 0 on
	failed python_string_to_host_string.
	(get_doc_string): Call gdbpy_print_stack on failed
	python_string_to_host_string.
	(parmpy_init): Extend the function comment.
	* python/py-prettyprint.c (pretty_print_one_value): Likewise.
	(gdbpy_get_display_hint, print_children): Call gdbpy_print_stack on
	failed python_string_to_host_string.
	* python/py-value.c (valpy_new, valpy_getitem, valpy_call)
	(valpy_binop, valpy_richcompare): Extend the function comment.
	* python/python.c
	(struct python_env) <error_type, error_value, error_traceback>: New
	fields.
	(restore_python_env): Handle PyErr_Occurred.  Call PyErr_Restore.
	(ensure_python_env): Call PyErr_Fetch.
	* varobj.c (update_dynamic_varobj_children): Call gdbpy_print_stack on
	failed convert_value_from_python.
	(value_get_print_value): Call gdbpy_print_stack on failed
	python_string_to_target_python_string.

gdb/testsuite/
	* gdb.python/py-error.exp: New file.
	* gdb.python/py-error.py: New file.
2010-10-13 13:24:40 +00:00
gdbadmin a071456ba8 *** empty log message *** 2010-10-13 00:00:33 +00:00
Tom Tromey 1bdb0c5472 * python/py-prettyprint.c (search_pp_list): Fix error checking. 2010-10-12 22:44:20 +00:00
Sami Wagiaalla 0526b37ab5 Eliminate 'is_ancestor' redundant code.
2010-10-12  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdbtypes.c (do_is_ancestor): New function.
	(is_ancestor): Use do_is_ancestor.
	(is_public_ancestor): Use do_is_ancestor.
2010-10-12 20:58:17 +00:00
Jan Kratochvil 93c17e06d2 gdb/testsuite/
* gdb.base/break-interp.exp (test_ld): Replace gdb_expect by
	gdb_test_multiple.
2010-10-12 18:41:06 +00:00
Jan Kratochvil d8b34041e0 gdb/testsuite/
* gdb.base/break-interp.exp: Use ldlags for linking flags.
	* gdb.base/prelink.exp: Likewise.
	* gdb.base/solib-nodir.exp: Likewise.
	* lib/gdb.exp (gdb_compile) <*-*-openbsd*>
	(gdb_compile) <shlib_load>: Use ldlags for linking flags.
	* lib/prelink-support.exp (build_executable_own_libs): Likewise.
2010-10-12 18:12:49 +00:00
Ulrich Weigand e0cc584ecf * break-interp.exp (test_ld): Use two separate gdb_expect statements
for the "info files" test to avoid timeouts on slow machines.
2010-10-12 17:17:36 +00:00
Pierre Muller c1b5be3809 * ser-go32.c (struct dos_ops): Add missing fdopen field. 2010-10-12 15:40:03 +00:00
Matthew Gretton-Dann 6877026586 * gdb/arm-tdep.c (arm_mode_strings): Add NULL entry at end of array. 2010-10-12 08:46:15 +00:00
gdbadmin 60536292df *** empty log message *** 2010-10-12 00:00:02 +00:00
Jan Kratochvil cfc353b10d gdb/testsuite/
* gdb.cp/infcall-dlopen.cc (openlib): Support NULL FILENAME.
	(main): Make openlib dummy call.
2010-10-11 21:36:26 +00:00
Doug Evans 64b0002014 * c-typeprint.c (c_type_print_modifier): Add note that this prints
the address space id too.
2010-10-11 19:24:52 +00:00
Doug Evans 44592cc4ef * gdb.texinfo (Values From Inferior): Add reference to "Types in
Python" from gdb.Value.type description.
2010-10-11 15:46:09 +00:00
Jan Kratochvil 43b8e24199 gdb/
Fix attaching to re-prelinked executables on ppc64.
	* solib-svr4.c (svr4_exec_displacement): New variable plt2_asect,
	initialize it, try to adjust FILESZ field by it.
2010-10-11 08:50:33 +00:00
Jan Kratochvil d3d7896de3 gdb/testsuite/
Fix missing _start PIE relocation on ppc64 due to stop on dl_main.
	* break-interp.exp (reach): Move the core body ...
	(reach_1): ... here.  Use stop-on-solib-events for _dl_debug_state.
	(test_ld): Provide always real argument, even to the linker.  Replace
	dl_main by _dl_debug_state.
2010-10-11 08:47:47 +00:00
Jan Kratochvil 5e533c94a6 gdb/testsuite/
Fix results of prelinked PIEs on ppc*.
	* gdb.base/break-interp.exp (reach, test_core, test_attach_gdb):
	Accept also DISPLACEMENT "PRESENT".
	(main): Replace "ZERO" displacements by "PRESENT".
2010-10-11 08:45:12 +00:00
gdbadmin b44435fc67 *** empty log message *** 2010-10-11 00:00:33 +00:00
gdbadmin 8c2c26d54a *** empty log message *** 2010-10-10 00:00:33 +00:00
gdbadmin a76f98451d *** empty log message *** 2010-10-09 00:00:32 +00:00
Daniel Jacobowitz 417b511093 * tracepoint.c (merge_uploaded_trace_state_variables): Only print
messages if info_verbose.
2010-10-08 20:45:21 +00:00
Sami Wagiaalla 3354061073 Test case for unimplemented overload cases.
2010-10-08  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/oranking.exp: New test.
	* gdb.cp/oranking.cc: New test program.
2010-10-08 18:28:46 +00:00
Ken Werner 3bdf2bbd3e gdb:
* valops.c (value_cast): Handle vector types.
	* valarith.c (value_binop): Widen scalar to vector if appropriate.
gdb/testsuite:
	* gdb.base/gnu_vector.c (ia, ib, fa, fb): New variables.
	* gdb.base/gnu_vector.exp: Add tests for scalar to vector widening.
2010-10-08 16:50:55 +00:00
Ulrich Weigand ec3d575a7a * arm-tdep.c (thumb_expand_immediate): New function.
(thumb_instruction_changes_pc): Likewise.
	(thumb2_instruction_changes_pc): Likewise.
	(thumb_analyze_prologue): Handle 32-bit Thumb instructions during
	prologue parsing.  Improved support for optimized code.
	(thumb_scan_prologue): Do not reply on line-number information,
	use same heuristics as arm_scan_prologue insead.
	(skip_prologue_function): Accept functions
	"__tls_get_addr" and "__aeabi_read_tp".
2010-10-08 13:31:07 +00:00
Ulrich Weigand 4024ca9964 2010-10-08 Ulrich Weigand <uweigand@de.ibm.com>
Daniel Jacobowitz  <dan@codesourcery.com>

	* arm-tdep.c (thumb_in_function_epilogue_p)
	(arm_in_function_epilogue_p): New.
	(arm_gdbarch_init): Install arm_in_function_epilogue_p as
	gdbarch_in_function_epilogue_p callback.
2010-10-08 13:24:55 +00:00
gdbadmin 682ffa1ca8 *** empty log message *** 2010-10-08 00:00:32 +00:00
Doug Evans 00e14314cf * cc-with-index.sh (output_file): Default to a.out. 2010-10-07 19:34:52 +00:00
Doug Evans 3876f04ec9 * dwarf2read.c (mapped_index): Rename member index_table to
symbol_table and index_table_slots to symbol_table_slots.
	All uses updated.
	(create_symbol_hash_table): Renamed from create_index_table.
	All callers updated.
	(add_indices_to_cpool): Rename arg index_table to symbol_hash_table.
	(write_hash_table): Rename local index_table to symbol_hash_table.
2010-10-07 17:23:30 +00:00
Doug Evans 855c153ff2 * addrmap.h (addrmap_foreach_fn): New typedef.
(addrmap_foreach): Declare.
	* addrmap.c (struct addrmap_funcs): New member foreach.
	(addrmap_foreach): New function.
	(addrmap_fixed_foreach): New function.
	(addrmap_fixed_funcs): Update.
	(struct mutable_foreach_data): New struct.
	(addrmap_mutable_foreach_worker): New function.
	(addrmap_mutable_foreach): New function.
	(addrmap_mutable_funcs): Update.
2010-10-07 17:02:14 +00:00
Paul N. Hilfinger 1d2a4540a5 Correct dict_hash to our most recent version.
Several changes to dict_hash from Adacore's local version were inadvertantly
left out of the last change to that function.  These changes conservatively
cause dict_hash to revert to msymbol_hash_iw in more cases where the symbol
being hashed is known not to be Ada-encoded.  This avoids a few cases where
the function hashes large groups of names with similar prefixes to the same
value.

Changelog:

	gdb/
	* dictionary.c (dict_hash): Revert to msymbol_hash_iw in
	more cases.
2010-10-07 08:32:41 +00:00
Paul N. Hilfinger 40658b9446 Rework symbol searches to move Ada-specific stuff to ada-lang.c.
This is a clean-up of some of our symbol-lookup machinery to pull some
kludgy Ada-specific definitions out of psymtab.c.  In place of
map_ada_symtabs and ada_lookup_partial_symbol, we have a method
map_matching_symbols, which searches through all symbol tables and
partial symbol tables looking for a symbol that matches according to
a matching function that is passed as a parameter. This requires some
care, because partial symbol tables speed up searches by binary search,
while full symbol tables use hashing. To call map_matching_symbols, therefore,
you may need to supply both a matching function that is compatible with the
dictionary hash function and an ordering relation that is compatible with
strcmp_iw, which is used to order partial symbol tables.

Having added this general routine to psymtab.c, we use it in ada-lang.c
to rework add_non_local_symbols (now renamed add_nonlocal_symbols).

Changelog:

    gdb/

    * ada-lang.c (full_match): Declare.
    (ada_match_name): Rename to match_name (we should avoid prefixing static
    symbols with "ada_").
    (match_name): New name for ada_match_name.
    (struct ada_psym_data): Remove and replace with...
    (struct match_data): User data for map_matching_symbols.
    (ada_add_psyms): Remove.
    (aux_add_nonlocal_symbols): New function, used as callback for
    map_matching_symbols.
    (compare_names): Ordering function adopted from strcmp_iw for Ada-encoded
    symbols.
    (ada_add_non_local_symbols): Rename to add_nonlocal_symbols.
    (add_nonlocal_symbols): Renamed from ada_add_non_local_symbols.
    Rework to use map_matching_symbols instead of map_ada_symtabs.
    (ada_lookup_symbol_list): Use add_nonlocal_symbols.
    * psymtab.c: Include dependency on dictionary.h.
    (match_partial_symbol): New function.
    (ada_lookup_partial_symbol): Remove.
    (map_block): New function, auxiliary to map_matching_symbols_psymtab.
    (map_matching_symbols_psymtab): New function.
    (psym_functions): Replace map_ada_symtabs with map_matching_symbols_psymtab.
    * symfile.h: Replace map_ada_symtabs definition with map_matching_symbols.
2010-10-07 07:13:51 +00:00
Paul N. Hilfinger c4d840bdd6 Extend hashed symbol dictionaries to work with Ada
This patch allows Ada to speed up symbol lookup by using the facilities
in dictionary.[ch] for hashed lookups.  First, we generalize dictionary
search to allow clients to specify any matching function compatible with
the hashing function. Next, we modify the hashing algorithm so that symbols
that wild-match a name hash to the same value.  Finally, we modify Ada
symbol lookup to use these facilities.

Because this patch touches on a hashing algorithm used by other
languages, I took the precaution of doing a speed test on a list of
about 12000 identifiers (repeatedly inserting all of them into a table
and then doing a lookup on a million names at random, thus testing the
speed of the hashing algorithm and how well it distributed names).
There was actually a slight speedup, probably as a result of open-
coding some of the tests in msymbol_hash_iw.  By design, the revised
hashing algorithm produces the same results as the original on most
"normal" C identifiers.

We considered augmenting the dictionary interface still further by allowing
different hashing algorithms for different dictionaries, based on the
(supposed) language of the symbols in that dictionary.  While this produced
better isolation of the changes to Ada programs, the additional flexibility
also complicated the dictionary interface.  I'd prefer to keep things
simple for now.

Tested w/o regressions on Linux i686.

ChangeLog:

	gdb/
	* ada-lang.c (ada_match_name): Use new API for wild_match.
	(wild_match): Change API to be consistent with that of strcmp_iw;
	return 0 for a match, and switch operand order.
	(full_match): New function.
	(ada_add_block_symbols): Use dict_iter_match_{first,next} for
	matching to allow use of hashing.
	* dictionary.c (struct dict_vector): Generalize iter_name_first,
	iter_name_next ot iter_match_first, iter_match_next.
	(iter_name_first_hashed): Replace with iter_match_first_hashed.
	(iter_name_next_hashed): Replace with iter_match_next_hashed.
	(iter_name_first_linear): Replace with iter_match_first_linear.
	(iter_name_next_linear): Replace with iter_match_next_linear.
	(dict_iter_name_first): Re-implement to use dict_iter_match_first.
	(dict_iter_name_next): Re-implement to use dict_iter_match_next.
	(dict_iter_match_first): New function.
	(dict_iter_match_next): New function.
	(dict_hash): New function.
	* dictionary.h (dict_iter_match_first, dict_iter_match_next): Declare.
	* psymtab.c (ada_lookup_partial_symbol): Use new wild_match API.
2010-10-07 06:53:44 +00:00
Doug Evans 543ecec77c * data-directory/Makefile.in: Remove @host_makefile_frag@, @frags@. 2010-10-07 00:18:22 +00:00
gdbadmin 717d4e8dba *** empty log message *** 2010-10-07 00:00:02 +00:00
Doug Evans 9c9606fba2 * Makefile.in (REQUIRED_SUBDIRS): New var.
(subdir_do): Verify required subdir Makefiles exist.
2010-10-06 16:46:12 +00:00
Ken Werner 2f608a3a97 gdb:
* dwarf2read.c (read_tag_const_type): Handle const arrays.
gdb/testsuite:
	* gdb.base/constvars.c (logical, lugged, luck, lunar, lumen, lurk,
	lush, lynx) New constant.
	* gdb.base/constvars.exp: Test const array types.
	* gdb.dwarf2/dw2-strp.exp: Add const qualifier for ptype tests.
2010-10-06 16:13:35 +00:00
Doug Evans aa2e2d8d77 Create subdir data-directory.
* Makefile.in (XML_SYSCALL_DIR, XML_SYSCALL_FILES): Moved to
	data-directory/Makefile.in.
	(SUBDIRS): Add data-directory.
	(all): Remove xml-syscall-copy dependency.
	(xml-syscall-copy): Moved to data-directory/Makefile.in as
	stamp-syscalls.
	(xml-syscall-install): Moved to data-directory/Makefile.in as
	install-syscalls.
	(install-only): Remove xml-syscall-install dependency.
	(all-data-directory): New rule.
	(data-directory/Makefile): New rule.
	* configure.ac (AC_OUTPUT): Add data-directory/Makefile.
	* configure: Regenerate.
	* data-directory/Makefile.in: New file.
	* python/lib/gdb/__init__.py: New file.

	testsuite/
	* gdb.base/catch-syscall.exp (do_syscall_tests): Update location
	of syscall staging area.
2010-10-06 16:02:45 +00:00
Joel Brobecker aa27d0b360 [Ada] Fix ARI warnings in advance_wild_match
gdb/ChangeLog:

        * ada-lang.c (advance_wild_match): Delete local variable t2.
        Adjust code accordingly.  Minor reformatting.
2010-10-06 15:24:38 +00:00
Ken Werner 2844d6b5a2 gdb:
* gdbtypes.h (struct main_type): Remove flag_nottext.
	(enum type_flag_value): Remove TYPE_FLAG_NOTTEXT.
	(enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_NOTTEXT.
	(TYPE_NOTTEXT): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of flag_nottext.
	* gdbtypes.c (make_vector_type): Use TYPE_INSTANCE_FLAG_NOTTEXT instead
	of TYPE_FLAG_NOTTEXT.
	(init_type): Remove the initialization of the flag_nottext field.
	(gdbtypes_post_init): Use TYPE_INSTANCE_FLAG_NOTTEXT instead of
	TYPE_FLAG_NOTTEXT.
	* c-valprint.c (c_val_print): Remove TYPE_VECTOR check.
gdb/testsuite:
	* gdb.base/gnu_vector.c: Add variable c4.
	* gdb.base/gnu_vector.exp: Add tests for character vector printing.
	* gdb.arch/altivec-abi.exp: Fix expect pattern of character vectors.
2010-10-06 08:44:15 +00:00
gdbadmin 8d22faeb79 *** empty log message *** 2010-10-06 00:00:33 +00:00
Maciej W. Rozycki 7d8ac8bbbb * gdb.arch/altivec-abi.exp: Fix a typo. 2010-10-05 20:38:02 +00:00
Doug Evans ea65fe05d0 * cc-with-index.sh: New file. 2010-10-05 04:28:15 +00:00
Doug Evans b89be57b99 * dwarf2read.c (hash_strtab_entry): Insert blank line after
function comment.
	(eq_strtab_entry, create_strtab, add_string): Ditto.
	(hash_symtab_entry, eq_symtab_entry, delete_symtab_entry): Ditto.
	(create_index_table, create_mapped_symtab, find_slot): Ditto.
	(hash_expand, add_index_entry, add_indices_to_cpool): Ditto.
	(write_hash_table, add_address_entry, write_psymbols): Ditto.
	(write_obstack, unlink_if_set, write_one_signatured_type): Ditto.
	(write_psymtabs_to_index): Ditto.
2010-10-05 03:10:28 +00:00
Doug Evans 2fdf6df643 * dwarf2read.c (dw2_do_instantiate_symtab): Insert blank line after
function comment.
	(dw2_instantiate_symtab, dw2_get_cu, extract_cu_value): Ditto.
	(create_cus_from_index, create_addrmap_from_index): Ditto.
	(mapped_index_string_hash, find_slot_in_mapped_hash): Ditto.
	(dw2_setup, dw2_require_line_header, dw2_require_full_path): Ditto.
	(dw2_do_expand_symtabs_matching): Ditto.
2010-10-05 02:56:36 +00:00
gdbadmin e2be17a6d9 *** empty log message *** 2010-10-05 00:00:33 +00:00
Doug Evans f104871271 * Makefile.in (uninstall): Use $(DESTDIR). 2010-10-04 23:32:40 +00:00
Joel Brobecker 40bc484cc3 [Ada/funcalls] do not coerce fat pointers on the stack
When one of the parameter values in a subprogram calls is an array
whose value does not come from inferior memory, the debugger first
copies the array value in inferior memory.  Up to now, the memory
used to hold that copy was taken from the stack (just below the SP),
but this is causing problems on SPARC v9.

So the immediate fix is to follow what C does with arrays and strings,
which is allocate memory on the heap.

gdb/ChangeLog:

        * ada-lang.c: #include "value.h".
        (ensure_lval): Delete advance declaration.  Remove gdbarch and sp
        arguments.  Implement using value_allocate_space_in_inferior
        instead of allocating memory from the stack.
        (make_array_descriptor): Remove gdbarch and sp parameters.  Update
        calls to ensure_lval.
        (ada_convert_actual): Remove gdbarch and sp parameters.  Update
        calls to make_array_descriptor and ensure_lval.
        * ada-lang.h (ada_convert_actual): Update declaration.
        * infcall.c (value_arg_coerce): Update call to ada_convert_actual.
2010-10-04 22:32:31 +00:00
Doug Evans f17618eaf3 * python/python.c (_initialize_python): Define new function
GdbSetPythonDirectory in python.  Use it to update sys.path and
	gdb.__path__.
2010-10-04 15:30:25 +00:00
Paul N. Hilfinger 83e3a93c83 Have ptype handle types declared pragma Unchecked_Variants.
When a type is marked with pragma Unchecked_Variants, ptype did not print
variants having a single component, since the compiler produces incorrect
debugging output for such cases.  With this patch, we special-case these
components so that they print.

Changelog:

    * gdb/ada-typeprint.c (print_selected_record_field_types): New function,
    incorporating and generalizing print_record_field_types.
    (print_record_field_types): Change return value and update comment.
    Re-implement using print_selected_record_field_types.
    (print_choices): Print "=>" here.
    Handle case of unencoded variant branch.
    (print_variant_clauses): Reformat comment.
    Special-case unencoded variant branch.
2010-10-04 06:37:54 +00:00
Paul N. Hilfinger 7358912389 Replace wild_match with faster version and modify its interface.
This new version of wild_match is comparable in speed to strcmp_iw, and has
the same signature and same return value for equal names.

gdb/ChangeLog:
    * ada-lang.c (wild_match): Reimplement.
    Change API to eliminate unused length argument, reverse arguments and
    make 0 the 'true' return value.
    (advance_wild_match): New auxiliary function for wild_match to improve
    readability.
    (ada_match_name, ada_add_block_symbols): Use new API for wild_match.
    * psymtab.c (ada_lookup_partial_symbol, map_ada_symtabs): Use new
    API for wild_match.
    * symfile.h (map_ada_symtabs): Modify declaration to use new API for
    wild_match.
    * dwarf2read.c (dw2_map_ada_symtabs): Ditto.
2010-10-04 06:34:40 +00:00
gdbadmin 790c20f3f3 *** empty log message *** 2010-10-04 00:00:33 +00:00
gdbadmin dc14d28a1f *** empty log message *** 2010-10-03 00:00:02 +00:00
Maciej W. Rozycki 84a02e5838 * lib/mi-support.exp (thread_selected_re): Correct pattern used
to match a thread ID.
2010-10-02 17:48:23 +00:00