Commit Graph

17221 Commits

Author SHA1 Message Date
Hui Zhu 175ff332d0 2010-12-28 Hui Zhu <teawater@gmail.com>
* gdbarch.sh (ax_pseudo_register_collect,
	ax_pseudo_register_push_stack): new callbacks.
	(agent_expr): Forward declare.
	* gdbarch.h, gdbarch.c: Regenerate.
	* ax-gdb.c (gen_expr): Remove pseudo-register check code.
	* ax-general.c (user-regs.h): New include.
	(ax_reg): Call gdbarch_ax_pseudo_register_push_stack.
	(ax_reg_mask): Call gdbarch_ax_pseudo_register_collect.
	* mips-tdep.c (ax.h): New include.
	(mips_ax_pseudo_register_collect,
	mips_ax_pseudo_register_push_stack): New functions.
	(mips_gdbarch_init): Set mips_ax_pseudo_register_collect and
	mips_ax_pseudo_register_push_stack.
2010-12-28 16:00:13 +00:00
Yao Qi f32bf4a4c9 2010-12-28 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_register_aliases): Remove sp, pc, and fp.
2010-12-28 13:26:46 +00:00
Joel Brobecker f73b1357df remove target_acknowledge_created_inferior
This target_ops routine appears to be unused in practice, so this patch
removes it.

gdb/ChangeLog:

        * inf-child.c (inf_child_acknowledge_created_inferior): Delete.
        (inf_child_target): Do not set t->to_acknowledge_created_inferior.
        * inf-ptrace.c (inf_ptrace_create_inferior): Remove call to
        target_acknowledge_created_inferior.
        * inf-ttrace.c (inf_ttrace_him): Likewise.
        * target.h (struct target_ops): Delete to_acknowledge_created_inferior
        field.
        (target_acknowledge_created_inferior): Delete.
        * target.c (update_current_target): Remove setting of
        to_acknowledge_created_inferior field. Do default value for that
        field either.
        (debug_to_acknowledge_created_inferior): Delete.
        (setup_target_debug): Remove setting of
        current_target.to_acknowledge_created_inferior.
2010-12-28 11:40:27 +00:00
Pedro Alves 128070bb74 gdb/
* breakpoint.c (breakpoint_restore_shadows): When looking for the
	location with the lowest address that overlaps the memory range we
	want to restore shadows for, account for multiple locations at the
	same address.
2010-12-27 19:37:04 +00:00
Thiago Jung Bauermann 35df450089 Code cleanup - renaming.
* breakpoint.c: Use bl for `*bp_location' variables, blp_tmp for
	`**bp_location' helper variables, b_tmp for `*breakpoint' helper
	variables.
2010-12-27 13:49:45 +00:00
Hui Zhu 6229fbeaa6 2010-12-27 Kevin Buettner <kevinb@redhat.com>
Hui Zhu  <teawater@gmail.com>

	* mips-tedp.c (mips_register_name): Add comments.
2010-12-27 08:17:34 +00:00
Yao Qi 621c6d5b11 2010-12-23 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_analyze_prologue): Move some code ...
	(EXTRACT_MOVW_MOVT_IMM_T): ... here.  New macro.
	(EXTRACT_MOVW_MOVT_IMM_A): New macro.
	(arm_analyze_load_stack_chk_guard): New.
	(arm_skip_stack_protector): New.
	(arm_skip_prologue): Adjust post_prologue_pc by
	arm_skip_stack_protector.
2010-12-23 14:38:34 +00:00
Joel Brobecker 81ec3cceb2 Add missing _() marker in error message.
gdb/ChangeLog:

	* mi/mi-main.c (mi_cmd_remove_inferior): Use _() marker for error
	message.  Change spelling of "can not" into "cannot".
2010-12-23 04:30:39 +00:00
Yao Qi 0e8708c7b0 2010-12-23 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_gdbarch_init): Remove invoke to
	set_gdbarch_deprecated_fp_regnum.
2010-12-23 03:20:10 +00:00
Marc Khouzam 8fa067afb2 * inferior.c (remove_inferior_command): Don't remove an active inferior.
* mi/mi-main.c (mi_cmd_remove_inferior): Ditto.
2010-12-22 18:30:19 +00:00
Tom Tromey a7658b96f6 gdb
* thread.c (print_thread_info): Make a ui-out table in CLI mode.
gdb/testsuite
	* gdb.threads/execl.exp: Update.
	* gdb.threads/linux-dp.exp: Update.
	* gdb.threads/manythreads.exp: Update.
	* gdb.threads/tls.exp: Update.
2010-12-21 19:10:15 +00:00
Yao Qi 544838827c 2010-12-20 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_register_reggroup_p): New.
	(arm_gdbarch_init): Set arm_register_reggroup_p for hook
	register_reggroup_p.
2010-12-20 06:19:05 +00:00
Yao Qi 8ab03ccb04 2010-12-20 Yao Qi <yao@codesourcery.com>
* features/arm-core.xml:  Add attribute type to reg from r0 to r12.
	* features/arm-with-iwmmxt.c: Regenerate.
	* features/arm-with-neon.c: Regenerate.
	* features/arm-with-vfpv2.c: Regenerate.
	* features/arm-with-vfpv3.c: Regenerate.
2010-12-20 06:09:23 +00:00
Marc Khouzam 57bf2d7ed8 * mi/mi-main.c (mi_cmd_remove_inferior): Don't delete current inferior.
(get_other_inferior): New.
2010-12-18 02:10:05 +00:00
Marc Khouzam b3422a0d89 * python/py-progspace.c (py_free_pspace): Obtain arch another
way to avoid dereferencing a null pointer.
2010-12-18 02:08:43 +00:00
Michael Snyder 5f2302abf8 2010-12-17 Michael Snyder <msnyder@vmware.com>
* utils.c (do_my_cleanups): Comment fix-up.
2010-12-18 00:11:46 +00:00
Kevin Buettner 930bd0e01a * mips-tdep.c (make_mips16_addr): New function.
(mips_elf_make_msymbol_special): Don't set the low bit in the
	symbol's address.
	(mips_read_pc, mips_unwind_pc, mips_addr_bits_remove): Strip bit
	indicating mips16 address, if present.
	(mips_write_pc): Set bit indicating mips16 address when in a mips16
	function.
	(mips_eabi_push_dummy_call, mips_o64_push_dummy_call): Likewise,
	but for each function pointer argument to inferior function call.
2010-12-17 21:39:27 +00:00
Tom Tromey 900c7f9d20 * psympriv.h (struct partial_symtab) <readin>: Move field
earlier.
2010-12-17 17:19:36 +00:00
Kevin Buettner ee51a8c7e1 * mips-tdep.c (mips_convert_register_float_case_p)
(mips_convert_register_gpreg_case_p): New functions.
	(mips_convert_register_p): Invoke new functions above.
	(mips_register_to_value): Add case for fetching value shorter
	than 64 bits from a 64-bit register.
	(mips_value_to_register): Add case for storing value shorter
	than 64 bits into a 64-bit register.
2010-12-16 22:50:48 +00:00
Tom Tromey fa595c2727 2010-12-16 Joel Borggrén-Franck <joel.borggren.franck@gmail.com>
* python/py-value.c (value_object_type) <tp_flags>: Add
	Py_TPFLAGS_BASETYPE.
2010-12-16 17:40:27 +00:00
Mike Frysinger 448a92bf2b NEWS: Mention new sim --map-info flag. 2010-12-16 13:05:28 +00:00
Doug Evans fc1a9d6e90 * dwarf2read.c (_initialize_dwarf2_read): Fix help text of
"save gdb-index" command.
2010-12-16 01:43:01 +00:00
Tom Tromey 5b79abe7f1 gdb
* infrun.c (save_infcall_control_state): Handle the
	exception-resume breakpoint.
	(restore_infcall_control_state): Likewise.
	(discard_infcall_control_state): Likewise.
gdb/testsuite
2010-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.cp/nextoverthrow.cc (dummy): Return int 0.
	(NextOverThrowDerivates) <resumebpt>: New.
	(resumebpt_test): New.
	(main): Call resumebpt_test.
	* gdb.cp/nextoverthrow.exp: New block for test of "resumebpt".
2010-12-15 21:19:50 +00:00
Kevin Buettner 8bdf35dcae * mips-tdep.c (mips_pseudo_register_write): Sign extend 32-bit
cooked values that are being transferred to 64-bit raw registers.
	(mips_pseudo_register_read): Revise to preserve symmetry with
	mips_pseudo_register_write().
2010-12-15 20:53:08 +00:00
Tom Tromey 45ccdddcbf 2010-12-15 Greg Watson <g.watson@computer.org>
* f-exp.y (yylex): Check entire token against keywords.
2010-12-15 19:28:31 +00:00
Doug Evans a86caf66bb Rename "maint set python auto-load" to "set auto-load-scripts".
* NEWS: Mention it.
	* python/py-auto-load.c (auto_load_scripts): Renamed from
	gdbpy_auto_load.
	(load_auto_scripts_for_objfile): Update.
	(gdbpy_initialize_auto_load): Rename "maint set python auto-load" to
	"set auto-load-scripts".

	doc/
	* gdb.texinfo (Startup): Document auto-loading of scripts during
	startup.
	(Auto-loading): Delete "maint set python auto-load on|off".
	Add "set auto-load-scripts on|off".
2010-12-15 17:28:00 +00:00
Kevin Buettner a8852dc55e * mips-tdep.c (mips_eabi_push_dummy_call): Place signed, rather
than unsigned, values in registers.
2010-12-14 21:07:50 +00:00
H.J. Lu b6c882c784 Move gdb ChangeLog entry to gdb/ChangeLog. 2010-12-14 14:50:42 +00:00
Joel Brobecker 043b651001 build failure on IRIX when building with Python support.
This is a nasty interaction between Python and GDB. Basically,
Python causes some macros to be unilaterally defined in order
to turns some features on:

    /* Define to activate features from IEEE Stds 1003.1-2001 */
    #define _POSIX_C_SOURCE 200112L

    /* Define to the level of X/Open that your system supports */
    #define _XOPEN_SOURCE 600

But the problem is that they turn off defines provided by some
system headers on which we depend. Namely:

  * sys/siginfo.h:

        #if _SGIAPI
        #define siginfo __siginfo
        #endif

  * sys/ucontext.h:

        #if _SGIAPI && !defined(__SGI_NOUCONTEXT_COMPAT)
        [...]
        #define fp_r            __fp_r
        [...]
        #define fp_csr          __fp_csr
        [...]
        #endif

The important macro here is _SGIAPI, defined as follow in standards.h:

        #define _SGIAPI ((defined(_SGI_SOURCE) && \
                                _NO_POSIX && _NO_XOPEN4 && _NO_XOPEN5) || \
                        (_ANSIMODE && _NO_POSIX && _NO_XOPEN4 && _NO_XOPEN5))

If one builds GDB without Python, then _SGIAPI is true, and all is fine.
But building with Python causes both _POSIX_C_SOURCE and _XOPEN_SOURCE
to trip all the _NO_[...] tests (_NO_POSIX, _NO_XOPEN4, _NO_XOPEN5).
And so we get build failures because we try to use undefined types, or
non-existent component names inside the regset structure.

The latter problem is observed only within irix5-nat.c, which means
that it is specific to IRIX.  So it's easy to write the code in a way
that it does not require the macros (just use the real component names,
rather than relying on the macros to do the translation).

The former, on the other hand, is a little trickier, because the problem
occurs inside a generic unit (procfs.c). The solution I chose was to
adjust the configure script to add -Dsiginfo=__siginfo to the CPPFLAGS
if building with python using GCC on IRIX.

We hadn't seen this sort of issue up to now because the affect units
have not been dependent on the python includes up to now.  Recent changes
have made them indirectly dependent on Python, thus triggering the issues.

gdb/ChangeLog:

        * irix5-nat.c: Replace fp_r, fp_regs and fp_scr by __fp_r, __fp_regs
        and __fp_scr respectively throughout.
        * configure.ac: Compile with -Dsiginfo=__siginfo if building with
        Python using GCC on IRIX.
        * configure: Regenerate.
2010-12-14 07:17:15 +00:00
Kevin Buettner c6490bf2ed * solib-svr4.c (enable_break): Don't attempt to place breakpoints,
when attaching, on the names in bkpt_names: _start, __start, and
	main.
2010-12-13 15:45:55 +00:00
Stan Shebs 0914bcdbf6 2010-12-12 Stan Shebs <stan@codesourcery.com>
* value.c (value_of_internalvar): Add case for trace state
	variables.

	* gdb.trace/tsv.exp: Test print command on trace state variables.
2010-12-13 05:29:32 +00:00
Doug Evans 7b9f3c509c * dwarf2read.c (dwarf2_per_objfile): New member quick_file_names_table.
(dwarf2_per_cu_quick_data): Move definition down to "quick functions"
	section.  Delete members lines full_names.  Rename read_lines to
	no_file_data.
	(quick_file_names): New struct.
	(hash_file_name_entry, eq_file_name_entry): New functions.
	(delete_file_name_entry, create_quick_file_names_table): New functions.
	(dwarf2_read_index): Initialize quick_file_names_table.
	(dw2_get_file_names): Renamed from dw2_require_line_header.
	Return pointer to quick_file_names entry.  All callers updated.
	(dw2_get_real_path): Renamed from dw2_require_full_path.
	Replace per_cu arg with pointer to quick_file_names entry.
	All callers updated.
	(dw2_free_cached_file_names): New function.
	(dw2_forget_cached_source_info): Call it (via htab_traverse_noresize).
	(dwarf2_initialize_objfile): Initialize quick_file_names_table in
	the OBJF_READNOW case.
	(dwarf2_free_objfile): Rewrite freeing of quick file names tables.
2010-12-12 19:19:27 +00:00
Mark Kettenis 1583e7ea01 Fix mail addres in ChangeLog. 2010-12-12 19:06:21 +00:00
Mark Kettenis 89fa5cc879 * mips64obsd-tdep.c (floatformats_mips64_quad): New define.
(mips64obsd_init_abi): Set long_double_bit and long_double_format.
2010-12-12 18:23:25 +00:00
Mark Kettenis 7a58cce85c * sparc-tdep.c: Fix typo in comment. 2010-12-12 17:41:19 +00:00
Doug Evans ae2de4f869 * dwarf2read.c: Whitespace cleanup, plus comment additions.
No code changes.
2010-12-10 22:00:00 +00:00
Tom Tromey 66cb815960 * NEWS: Document exception-handling change. 2010-12-10 20:33:44 +00:00
Marc Khouzam 30a7f059d8 * mi/mi-parse.c (mi_parse): Wrong error message. 2010-12-09 20:41:54 +00:00
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
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
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
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
Masaki Muranaka 97fc68fe16 * configure.tgt: Accept microblaze*-*-linux* for linux target
and microblaze*-*-* for  as target.
2010-12-04 02:10:53 +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
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
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
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
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
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
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
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
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
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
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
Tom Tromey ba19bb4d8d * value.c (value_entirely_optimized_out): Check the
'check_any_valid' field.
2010-11-17 19:53:37 +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
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
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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Daniel Jacobowitz 417b511093 * tracepoint.c (merge_uploaded_trace_state_variables): Only print
messages if info_verbose.
2010-10-08 20:45:21 +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
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
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
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
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
Doug Evans 11570e7189 * dwarf2read.c (_initialize_dwarf2_read): Add usage info to help text
for `save gdb-index' command.
2010-10-01 20:47:45 +00:00
Tom Tromey 72b9f47f1e * symfile.h (allocate_symtab): Update.
* symfile.c (allocate_symtab): Make 'filename' const.
	* psymtab.c (add_psymbol_to_bcache): Make 'name' const.
	(add_psymbol_to_list): Likewise.
	* psympriv.h (struct partial_symtab) <filename, dirname>: Now
	const.
	(add_psymbol_to_list): Update.
	* mdebugread.c (new_symtab): Make 'name' const.
	(psymtab_to_symtab_1): Make 'filename' const.
	* elfread.c (elfstab_offset_sections): Update.
	* dwarf2read.c (dwarf_decode_lines): Make 'comp_dir' const.
	(dwarf2_start_subfile): Make 'dirname' and 'comp_dir' const.
	(psymtab_include_file_name): Update.
	* dbxread.c (find_stab_function_addr): Make 'filename' const.
	* buildsym.h (start_subfile): Update.
	* buildsym.c (start_subfile): Make arguments const.
2010-10-01 20:26:11 +00:00
Michael Snyder 55e3947383 2010-09-30 Ali Lakhia <lakhia@alumni.utexas.net>
* fork-child.c (breakup_args): Fix crash if shell forking is
	disabled at compile time.
2010-10-01 17:35:30 +00:00
Joel Brobecker 05e522ef51 [Ada] array and bounds in fat pointer can be a stub
This patch adds handling of the case when a fat pointer has the
P_ARRAY and/or P_BOUNDS fields defined as a stub.  In that case,
this stub needs to be resolved.

There are two issues:

  . First, making sure that the resolution takes place itself.
    That's the change to ada_check_typedef.

  . Make sure that the type returned after resolution is not itself
    a typedef.  This is the change to ada_check_typedef.

gdb/ChangeLog (Jerome Guitton, Joel Brobecker):

        * ada-lang.c (desc_bounds): Add handling of the case where
        the P_BOUNDS field is a pointer to a stub.
        (desc_data_target_type): Same for P_ARRAY field.
        (ada_check_typedef): Strip the typedef layers from the type
        found by ada_find_any_type.
2010-10-01 16:25:00 +00:00
Joel Brobecker 49a45ecfd2 [sparc] inferior SEGV while calling Ada subprogram
gdb/ChangeLog:

        * sparc-tdep.c (sparc32_frame_align): New function.
        (sparc32_gdbarch_init): Set the frame_align gdbarch method.
        * sparc64-tdep.c (sparc64_frame_align): New function.
        (sparc64_gdbarch_init): Set the frame_align gdbarch method.
2010-10-01 15:55:14 +00:00
H.J. Lu a5916a62fd Set MAX_REGISTER_SIZE to 64.
2010-09-30  H.J. Lu  <hongjiu.lu@intel.com>

	* defs.h (MAX_REGISTER_SIZE): Set to 64.
2010-10-01 00:43:40 +00:00
Tom Tromey 00b5771c2a * symfile.h (struct sym_fns) <next>: Remove.
(add_symtab_fns): Update.
	* symfile.c (sym_fns_ptr): New typedef.
	(symtab_fns): Now a VEC.
	(add_symtab_fns): Update.  Change argument type.
	(find_sym_fns): Update.  Change return type.
	(get_symfile_segment_data): Update.
	* objfiles.h (struct objfile) <sf>: Now const.
	* somread.c (som_sym_fns): Now const.  Update.
	* xcoffread.c (xcoff_sym_fns): Now const.  Update.
	* mipsread.c (ecoff_sym_fns): Now const.  Update.
	* machoread.c (macho_sym_fns): Now const.  Update.
	* elfread.c (elf_sym_fns): Now const.  Update.
	(elf_sym_fns_gdb_index): Likewise.
	* dbxread.c (aout_sym_fns): Now const.  Update.
	* coffread.c (coff_sym_fns): Now const.  Update.
2010-09-30 19:14:30 +00:00
Tom Tromey 38f12cfce2 gdb
* value.c (value_primitive_field): Take 'offset' into account for
	packed field.
gdb/testsuite
	* gdb.base/anon.exp: New file.
	* gdb.base/anon.c: New file.
2010-09-30 18:58:08 +00:00
Tom Tromey 9ae8282da7 gdb
* completer.c (count_struct_fields): Handle anonymous structs and
	unions.
	(add_struct_fields): Likewise.
gdb/testsuite
	* gdb.base/completion.exp: Test completion through anonymous
	union.
	* gdb.base/break1.c (struct some_struct): Add anonymous union.
2010-09-30 17:51:39 +00:00
Jan Kratochvil e9e07ba6db gdb/
Fix printing parameters of inlined functions.
	* ada-lang.c (is_known_support_routine)
	(ada_unhandled_exception_name_addr_from_raise): Provide NULL parameter
	for find_frame_funname.
	* python/py-frame.c (frapy_name): Likewise.
	* stack.c (find_frame_funname): New parameter funcp.  Update the
	function comment.  Fill it in.
	(print_frame): New variable func.  Initialize it by
	find_frame_funname.  Print arguments only if FUNC is not NULL.  Use
	FUNC as the parameter of print_args_stub.
	* stack.h (find_frame_funname): New parameter funcp.  Remove the
	function declaration comment.

gdb/testsuite/
	Fix printing parameters of inlined functions.
	* gdb.dwarf2/dw2-inline-param.exp: New file.
	* gdb.dwarf2/dw2-inline-param-main.c: New file.
	* gdb.dwarf2/dw2-inline-param.S: New file.
2010-09-30 10:29:00 +00:00
Jan Kratochvil cd2effb255 gdb/
PR corefiles/12071.
	* inferior.c (have_live_inferiors): New variables old_chain, inf and
	tp.  Iterate INFERIOR_LIST and call target_has_execution.

gdb/testsuite/
	PR corefiles/12071.
	* gdb.base/corefile.exp (quit with a process, no question: load core)
	(quit with a core file): New tests.
2010-09-30 10:24:40 +00:00
Jan Kratochvil bceffbf360 gdb/
Fix GDB crash on inferior calls with self-referencing classes.
	* gnu-v3-abi.c (gnuv3_pass_by_reference): Do not call itself on static
	member fields.

gdb/testsuite/
	Fix GDB crash on inferior calls with self-referencing classes.
	* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: New file.
	* gdb.dwarf2/dw2-cp-infcall-ref-static-main.c: New file.
	* gdb.dwarf2/dw2-cp-infcall-ref-static.S: New file.
2010-09-29 22:32:52 +00:00
Doug Evans abc72ce4c6 Workaround for gcc/45682.
* dwarf2read.c (partial_die_info): New fields fixup_called,
	linkage_name.
	(guess_partial_die_structure_name): Renamed from guess_structure_name.
	Move definition next to use.  Use linkage_name to determine if class
	is in a namespace.  All callers updated.
	(fixup_partial_die): Return early if already called.
	Set fixup_called when done.
	(guess_full_die_structure_name): New function.
	(determine_prefix): Call it for class/struct/union dies if c++ and
	.debug_types section is present and parent is DW_TAG_compile_unit.
2010-09-29 16:41:24 +00:00
Joel Brobecker 0ac7be2557 Add a sparc simulator with the sparc bareboard target.
gdb/ChangeLog:

        * configure.tgt (sparc-*-*): Set gdb_sim to ../sim/erc32/libsim.a.
        (sparc-*-rtems*): Delete, now redundant with the sparc-*-* case.
2010-09-28 21:46:09 +00:00
Joel Brobecker 6e1bb179c2 [doco] document support for Ravenscar profile
This announces the support for debugging Ada programs using
the Ravenscar Profile, as well as documents the new commands
introduced as part of this effort.

gdb/ChangeLog:

        * NEWS: Announce Ravenscar Profile support.

gdb/doc/ChangeLog:

        * gdb.texinfo (Ravenscar Profile): New node.
2010-09-28 21:40:23 +00:00
Joel Brobecker 036b1ba8ec Add support for GNAT Ravenscar run-time library.
gdb/ChangeLog (Jerome Guitton, Joel Brobecker):

	* ravenscar-thread.c, ravenscar-thread.h, ravenscar-sparc-thread.c:
	New files.
	* configure.tgt (sparc-*-*): Add ravenscar-thread.o and
	ravenscar-sparc-thread.o to gdb_target_obs.
2010-09-28 21:39:31 +00:00
Joel Brobecker 474011fbad [Ada] Add ada-tasks.c:iterate_over_live_ada_tasks
This new function is needed by the ravenscar-thread layer.

gdb/ChangeLog:

        * ada-tasks.c (iterate_over_live_ada_tasks): New function.
        * ada-lang.h (iterate_over_live_ada_tasks): Declare.
2010-09-28 21:39:03 +00:00
Pierre Muller 99e24b9065 * amd64-windows-tdep.c (amd64_skip_main_prologue): New function.
(amd64_windows_init_abi): Register amd64_skip_main_prologue as gdbarch
	skip_main_prologue method.
2010-09-27 22:05:40 +00:00
Tom Tromey 987d643c0f * dwarf2read.c (dwarf2_read_index): Only allow version 3.
(write_psymbols): Add 'psyms_seen' and 'is_static' arguments.
	Only emit a given psymbol once.
	(struct signatured_type_index_data) <psyms_seen>: New field.
	(write_one_signatured_type): Update.
	(cleanup_htab): New function.
	(write_psymtabs_to_index): Update.  Create psyms_seen hash.  Bump
	version to 3.
	(save_gdb_index_command): Update index documentation.
2010-09-27 18:42:36 +00:00
Tom Tromey d3aff95935 * bcache.c (expand_hash_table): Use hash_function, not hash. 2010-09-27 17:41:36 +00:00
Tom Tromey 716b65bf40 * gdb_wchar.h: Change minimum libiconv to 0x108. 2010-09-27 17:28:50 +00:00
Jan Kratochvil 1736ad1102 gdb/
Fix lost siginfo_t for inferior calls.
	* infrun.c
	(struct inferior_thread_state) <siginfo_gdbarch, siginfo_data>: New.
	(save_inferior_thread_state): New variables regcache, gdbarch and
	siginfo_data.  Initialize SIGINFO_DATA if gdbarch_get_siginfo_type_p.
	Move INF_STATE allocation later, pre-clear it.  Initialize REGISTERS
	using REGCACHE.
	(restore_inferior_thread_state): New variables regcache and gdbarch.
	Restore SIGINFO_DATA for matching GDBARCH.  Restore REGISTERS using
	REGCACHE.  Free also SIGINFO_DATA.

gdb/testsuite/
	Fix lost siginfo_t for inferior calls.
	* gdb.base/siginfo-infcall.exp: New file.
	* gdb.base/siginfo-infcall.c: New file.
2010-09-24 18:35:28 +00:00
Tom Tromey 4b5246aacb * dwarf2read.c (dw2_expand_symtabs_matching): Add missing
MAYBE_SWAPs.
	(dw2_map_symbol_names): Likewise.
2010-09-24 16:11:46 +00:00
Sami Wagiaalla 2a7d6a257f Fix find_oload_champ_namespace_loop memory leak.
2010-09-24  Sami Wagiaalla  <swagiaal@redhat.com>

	* valops.c (find_oload_champ_namespace_loop): replace incorrect
	discard_cleanups do_cleanups.
2010-09-24 14:47:53 +00:00
Pedro Alves e6ee044df3 PR gdb/11842
gdb/
	* amd64-linux-nat.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.

	gdb/gdbserver/
	* linux-x86-low.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.
2010-09-24 13:44:01 +00:00
Pedro Alves b53a162374 gdb/
* amd64-linux-nat.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.

	gdb/gdbserver/
	* linux-x86-low.c (compat_siginfo_from_siginfo)
	(siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
	si_code is < 0.  Check for si_code == SI_TIMER before checking for
	si_code < 0.
2010-09-24 13:41:43 +00:00
Pedro Alves 96a8853a47 * objfiles.h (ALL_OBJSECTIONS): Handle breaks in the inner loop. 2010-09-24 11:15:55 +00:00
Joel Brobecker 39383a48f7 [Ada] Do not compute task ptid when debugging core file
After thread support over core files was added for GNU/Linux was added,
we started noticing the following type of crash when trying to perform
task switches (this is a bit accademic, since task switching is not
supported when debugging core files - this is what our testcase was
verifying).

(please check out the comment inside ada-tasks.c:task_command for
more details on this topic)

The reason for the crash comes from the fact that the GNU/Linux thread
layer now gets pushed on the target stack, causing the associated
to_get_ada_task_ptid target method to be activated.  This routine
makes the assumption that, for all threads, the private area is not
NULL.  This is incorrect in the case of core files, as the core layer
creates some threads with no private data.

But, taking a step back, we don't need to try to compute the task ptid,
as we'll never be using it anyways (we only use it for task switching).
So the fix is to avoid the ptid computation altogether when debugging
a core file.

gdb/ChangeLog:

        * ada-tasks.c (read_atcb): Do not compute the task ptid when
        debugging a core file.
2010-09-22 22:50:54 +00:00
Jan Kratochvil d31d2fc374 gdb/
Code cleanup.
	* objfiles.c (allocate_objfile) <objfile->name != NULL>: Remove.
	(free_objfile) <objfile->name != NULL>: Remove the conditional around
	xfree.
	* objfiles.h (struct objfile) <name>: New comment it is never NULL.
	* python/py-auto-load.c (auto_load_new_objfile) <!objfile->name>:
	Remove.
	* python/py-objfile.c (objfpy_get_filename) <obj->objfile->name>
	Remove the conditional.
	* python/py-progspace.c (pspy_get_filename) <objfile->name>: Likewise.
2010-09-22 20:00:53 +00:00
Jan Kratochvil 7f6130ff85 gdb/
* main.c: Include objfiles.h.
	(captured_main): New variable objfile.  Call
	load_auto_scripts_for_objfile for ALL_OBJFILES.
2010-09-22 19:59:15 +00:00
Jan Kratochvil c2b0a2291a gdb/
* dwarf2read.c (die_needs_namespace) <DW_TAG_variable>: Add also
	DW_TAG_constant.

gdb/testsuite/
	* gdb.fortran/module.exp (fully qualified name of DW_TAG_constant):
	New test.
	* gdb.fortran/module.f90 (mod1) <var_const>: New constant.
2010-09-22 19:22:44 +00:00
Joel Brobecker 72929c628e DWARF: Add support for DW_TAG_constant DIEs
gdb/ChangeLog:

        * dwarf2read.c (scan_partial_symbols): Add handling of
        DW_TAG_constant DIEs.
        (add_partial_symbol, load_partial_dies, new_symbol): Likewise.

gdb/testsuite/ChangeLog:

        * gdb.dwarf2/dw2-const.S, gdb.dwarf2/dw2-const.exp: New files.
2010-09-22 16:15:34 +00:00
Joel Brobecker 496c0e1ba7 Allow disabling of gdbserver build (--enable-gdbserver=yes/no/auto).
This patch adds a new --enable-gdbserver=yes/no/auto command-line switch
in gdb/configure.  The primary purpose is to allow a user to disable the
build & install of gdbserver when not desired.  It also allows the user
to request gdbserver in which case the configure script will abort if
automatic building of gdbserver is not supported for that configuration.

The default keeps things as is: We automatically build gdbserver if
building for a native configuration and if gdbserver is supported for
that configuration.

gdb/ChangeLog:

        * configure.ac: Add support for --enable-gdbserver.
        * configure: Regenerate.

At AdaCore, this is mostly intended for ia64-linux, where we currently
do not want to distribute gdbserver.  This will be useful in the context
of I417-033, where we are now using "make install" to determine what
needs to be packaged inside the GNAT Pro package.
2010-09-22 16:15:01 +00:00
Sami Wagiaalla ec32282347 Fix PR 12028: "GDB crashes on a double free during overload resolution "
2010-09-22  Sami Wagiaalla  <swagiaal@redhat.com>

	PR C++/12028
	* valops.c (find_oload_champ_namespace_loop): removed incorrect
	'old_cleanups' reassignment.

2010-09-22  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/pr12028.cc: New.
	* gdb.cp/pr12028.exp: New.
2010-09-22 15:48:59 +00:00
Jan Kratochvil 1558ab4ce7 gdb/
* charset.c (wchar_iterate) <EILSEQ>: Return any possibly converted
	characters.
2010-09-16 19:20:51 +00:00
Phil Muldoon 875b4ff565 2010-09-16 Phil Muldoon <pmuldoon@redhat.com>
PR mi/11407
	* mi/mi-cmd-stack.c (list_args_or_locals): Catch exceptions from
	read_var_value and common_val_print and print a warning.

2010-09-16  Phil Muldoon  <pmuldoon@redhat.com>
            Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR mi/11407
	* gdb.mi/dw2-ref-missing-frame-func.c: New File.
	* gdb.mi/dw2-ref-missing-frame-main.c New File.
	* gdb.mi/dw2-ref-missing-frame.S New File.
	* gdb.mi/dw2-ref-missing-frame.exp New File.
2010-09-16 13:47:55 +00:00
Jan Kratochvil 65dedcb26b gdb/
* MAINTAINERS (GLOBAL MAINTAINERS) <Jan Kratochvil>: Move the entry to
	keep the list in alphabetical order.  Use longer e-mail address.
2010-09-15 22:53:53 +00:00
Tom Tromey 0e780a22f0 * MAINTAINERS (GLOBAL MAINTAINERS): Add Jan Kratochvil. 2010-09-15 22:26:25 +00:00
Tom Tromey 62234ccc1e * charset.c (iconv_open): New define.
(iconv): Likewise.
	(iconv_close): Likewise.
	(phony_iconv_open): Add "phony_" prefix.
	(phony_iconv_close): Likewise.
	(phony_iconv): Likewise.
	* gdb_wchar.h: Check _LIBICONV_VERSION, __STDC_ISO_10646__.
	Change how INTERMEDIATE_ENCODING is defined.
2010-09-15 20:18:47 +00:00
Doug Evans 4950bc1c0c * dwarf2read.c (struct die_info): Fix comment. 2010-09-15 18:14:47 +00:00
Alan Modra 349126ea35 PR 4606
* gcore.c (gcore_create_callback): Clear SEC_HAS_CONTENTS rather
	than setting SEC_NEVER_LOAD on sections that need not be copied.
2010-09-15 03:30:30 +00:00
Tom Tromey 923c6a3dd1 * psympriv.h (add_psymbol_to_list, init_psymbol_list)
(start_psymtab_common, allocate_psymtab, discard_psymtab):
	Declare.
	* symfile.h (extend_psymbol_list): Remove.
	(add_psymbol_to_list, init_psymbol_list, start_psymtab_common)
	(allocate_psymtab, discard_psymtab): Move to psympriv.h.
	* psymtab.c (extend_psymbol_list): Move earlier.  Now static.
2010-09-14 22:50:30 +00:00
Jan Kratochvil a9e6a4bb4e gdb/
* dwarf2read.c (dw2_map_ada_symtabs): Remove the internal_error.
	Update the comment.
2010-09-14 21:28:53 +00:00
Tom Tromey 7155d5780a gdb
PR symtab/8399:
	* dwarf2loc.c (locexpr_describe_location_piece): Don't call error
	for unrecognized frame base expression.
gdb/testsuite
	PR symtab/8399:
	* gdb.threads/tls.exp: Remove kfail.  Update expected output.
2010-09-14 19:39:59 +00:00
Tom Tromey 515ed53230 gdb
PR exp/11803:
	* value.c (value_static_field): Use value_of_variable.
gdb/testsuite
	PR exp/11803:
	* gdb.threads/tls.exp: Use C++.
	(check_thread_local): Use K::another_thread_local.
	* gdb.threads/tls.c (class K): New.
	(another_thread_local): Now a member of K.
	(spin): Update.  No longer K&R C.
2010-09-14 19:08:30 +00:00
Pierre Muller b467f5808f * m32r-rom.c: Replace winsock.h with winsock2.h header.
* remote-m32r-sdi.c: Replace winsock.h by winsock2.h.
2010-09-14 08:01:12 +00:00
Sami Wagiaalla 450ca57cac Fix PR 11992: C++ 'this' scope sometimes does not work
2010-09-13  Sami Wagiaalla  <swagiaal@redhat.com>

	PR symtab/11992:
	* c-exp.y (classify_name): Check is_a_member_of_this before returning
	UNKNOWN_CPP_NAME.

2010-09-13  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/koenig.cc: created class for testing member lookup.
	* gdb.cp/koenig.exp: Added test for member lookup.
2010-09-13 20:41:05 +00:00
Joel Brobecker 1aee700988 [NEWS] Announce gdbserver support for x86-lynxos
This patch adjusts the NEWS entry for the LynxOS gdbserver to include
x86-lynxos to the list of supported platforms.

gdb/ChangeLog:

        * NEWS: Add x86-lynxos to the list of platforms supported by
        gdbserver.
2010-09-13 20:37:34 +00:00
Joel Brobecker 5ec6ebf9c9 [NEWS] Announce support for PowerPC LynxOS 5.x.
This adjusts the news entry about ppc-lynxos to add version 5.x
of the OS to the list of supported versions...

gdb/ChangeLog:

        * NEWS: Announce GDBserver support for version 5.x of ppc-lynxos.
2010-09-13 19:10:51 +00:00
Tom Tromey 1863c96c05 * Makefile.in (HFILES_NO_SRCDIR): Add progspace.h. 2010-09-13 17:59:59 +00:00
H.J. Lu 0c5acf93f1 Set 256bit vector type name to builtin_type_vec256i.
2010-09-13  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-tdep.c (i386_ymm_type): Set type name to
	builtin_type_vec256i.
2010-09-13 17:39:48 +00:00
Michael Snyder 1c6272a6b3 2010-09-12 Michael Snyder <msnyder@vmware.com>
* i386-tdep.c (i386_gdbarch_init): Fix typo in comments.
2010-09-12 21:49:40 +00:00
H.J. Lu e866c49707 Fix typo in comments.
2010-09-12  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-tdep.c (i386_gdbarch_init): Fix typo in comments.
2010-09-12 18:33:17 +00:00
H.J. Lu 9191d39074 Remove amd64_register_name.
2010-09-11  H.J. Lu  <hongjiu.lu@intel.com>

	* amd64-tdep.c (amd64_register_name): Removed.
	(amd64_init_abi): Don't call set_gdbarch_register_name.

	* i386-tdep.c (i386_ymmh_regnum_p): Make it static.

	* i386-tdep.h (i386_ymmh_regnum_p): Removed.
2010-09-11 19:09:35 +00:00
Jan Kratochvil 8d4d924b76 gdb/
Redirect also uiout and stdtarg{,err} in execute_command_to_string.
	* cli-logging.c (struct saved_output_files) <targerr>: New.
	(set_logging_redirect, pop_output_files, handle_redirections):
	Redirect also gdb_stdtargerr.
	* defs.h (struct ui_out, make_cleanup_ui_out_redirect_pop): New
	declarations.
	* event-top.c (gdb_setup_readline, gdb_disable_readline): Redirect
	also gdb_stdtargerr.
	* top.c (execute_command_to_string): Move make_cleanup_ui_file_delete
	to the top.  Redirect also gdb_stdlog, gdb_stdtarg and gdb_stdtargerr.
	Use ui_out_redirect, register make_cleanup_ui_out_redirect_pop.
	* tui/tui-io.c (tui_setup_io): Redirect also gdb_stdtargerr.
	* utils.c (do_ui_out_redirect_pop, make_cleanup_ui_out_redirect_pop):
	New functions.

gdb/testsuite/
	* gdb.python/python.exp (set height 0, collect help from uiout)
	(verify help to uiout): New tests.
2010-09-11 16:00:27 +00:00
Pierre Muller 3329c4b5af * hppa-tdep.c (unwind_command): Use host_address_to_string function
to display a host address.
	* monitor.c (monitor_read_memory): Likewise.
	* xtensa-tdep.c (xtensa_push_dummy_call): Likewise.
2010-09-10 16:17:14 +00:00
Pierre Muller 5e8db3985c * coffread.c (struct coff_symbol): Change c_value type from `long' to
`CORE_ADDRESS' as it might contain target addresses.
2010-09-10 16:12:22 +00:00
Pierre Muller 37049e3199 * alpha-mdebug-tdep.c (find_proc_desc): Use SYMBOL_VALUE_BYTES macro
before cast to pointer to avoid warning.
2010-09-10 16:04:58 +00:00
Kevin Buettner 351a3e56c1 * v850-tdep.c (v850_gdbarch_init): Change the v850's `char'
type to be signed.
2010-09-09 23:04:46 +00:00
Ulrich Weigand 6afafb5482 * dwarf2read.c (fixup_partial_die): Do not set dummy name for
anonymous class partial DIEs.
2010-09-09 16:42:39 +00:00
Daniel Jacobowitz 60430eff89 * dwarf2read.c (dwarf2_compute_name): Check that the first
argument is a pointer.
2010-09-08 23:34:11 +00:00
Daniel Jacobowitz f1078f667a * dwarf2read.c (read_func_scope, read_structure_type)
(read_common_block): Check for a NULL return from new_symbol.
2010-09-08 23:14:52 +00:00
Jan Kratochvil 824308520b gdb/
* dwarf2read.c (dwarf2_read_index): Return on no SEC_HAS_CONTENTS.
2010-09-08 19:49:28 +00:00
Daniel Jacobowitz c767944bf2 gdb/
* dwarf2read.c (read_structure_type): Move processing of
	fields and member functions from here...
	(process_structure_scope): ... to here.

	gdb/testsuite/
	* gdb.cp/templates.cc (Empty, FunctionArg): New classes.
	(FunctionArg::method): New function.
	(empty, arg): New variables.
	(main): Call arg.method.
	* gdb.cp/templates.exp (test_template_args): New function.
	(do_tests): Call it.
2010-09-08 19:09:43 +00:00
Daniel Jacobowitz 561d38252c * gnu-v3-abi.c (gnuv3_print_method_ptr): Do not use
the domain type.
	(gnuv3_make_method_ptr): Likewise.
2010-09-08 18:53:34 +00:00
Tom Tromey 9bd89d67b6 * breakpoint.c (create_breakpoint): Add missing _(). 2010-09-08 18:05:42 +00:00
Doug Evans 1d040b0d09 * dwarf2-frame.h (dwarf2_frame_build_info): Delete, unused. 2010-09-08 17:52:50 +00:00
Tom Tromey 774b6a14e0 Revert:
2010-09-01  Tom Tromey  <tromey@redhat.com>
	* dwarf2read.c, gdbtypes.c, psymtab.c, symfile.h, symtab.c,
	symtab.h: Revert earlier change.
2010-09-08 17:17:42 +00:00
Sami Wagiaalla fc95672973 Fix custom bcache hash regression.
2010-09-09  Sami Wagiaalla  <swagiaal@redhat.com>

	* psymtab.c (add_psymbol_to_bcache): Initialize
	obj_section.
	memset psymbol.ginfo.value to 0.
2010-09-07 15:00:00 +00:00
Pedro Alves 48f9886d47 * infrun.c (resume): Extend comment on ignoring single-step
requests on vfork parents waiting for a vfork-done.
2010-09-06 14:22:07 +00:00
Jan Kratochvil 423ec54cd3 gdb/
* corelow.c (core_open): Use target_signal_from_host if CORE_GDBARCH
	is NULL.
	* fork-child.c (startup_inferior) <resume_signal>: Use enum
	target_signal type.
	* linux-nat.c (linux_nat_resume): Use target_signal_to_host before
	calling strsignal.  Use enum target_signal type for saved_signo.
	(linux_handle_extended_wait) <signo>: Use enum target_signal type.
	(linux_nat_wait_1): Use enum target_signal type for signo.  Use
	target_signal_to_host before calling strsignal.
	* remote-m32r-sdi.c (m32r_wait, m32r_detach): Replace 0 by
	TARGET_SIGNAL_0.

gdb/gdbserver/
	* target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
2010-09-06 13:59:03 +00:00
Jan Kratochvil a6eb9bc860 gdb/
* common/signals.c (ANY): Remove.
	(SET): No longer use ANY.

include/gdb/
	* signals.def: Replace all ANY uses by SET with specific numbers.
	* signals.h (ANY): Remove.
2010-09-06 13:34:03 +00:00
Yao Qi 74609e7188 2010-09-06 Yao Qi <yao@codesourcery.com>
* infrunc(resume): When inferior is waiting_for_vfork_done,
	clear step and don't use displaced stepping.
2010-09-06 13:10:28 +00:00
Daniel Jacobowitz 8464be7681 * breakpoint.c (can_use_hardware_watchpoint): Handle the first
value specially.

	testsuite/
	* gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint
	before disabling hardware watchpoints.
	(test_inaccessible_watchpoint): Check that hardware watchpoints
	are used.  Test for watchpoints on a constant address.
2010-09-04 15:30:09 +00:00
Jan Kratochvil 33d62d6487 gdb/
Code cleanup - split print_stop_reason.
	* infrun.c (enum inferior_stop_reason): Remove.
	(print_stop_reason): Remove by splitting into ...
	(print_exited_reason, print_signal_exited_reason)
	(print_no_history_reason, print_signal_received_reason)
	(print_end_stepping_range_reason): ... these new functions.  Update
	the preceding comment.
	(handle_inferior_event): Change the calls to print_exited_reason,
	print_signal_exited_reason, print_no_history_reason,
	print_signal_received_reason, print_end_stepping_range_reason.
	(handle_step_into_function, handle_step_into_function_backward):
	Change the calls to print_end_stepping_range_reason.
2010-09-04 14:27:46 +00:00
Jan Kratochvil 14dba4b472 gdb/
* breakpoint.c (save_breakpoints): Use RETURN_MASK_ALL.
	* cli-out.c: Include vec.h.
	(cli_field_fmt, cli_spaces, cli_text, cli_message, cli_flush): New
	variable stream, initialize it, use it.
	(cli_redirect): New function comment.  Replace the stream and
	original_stream fields by the new streams field.  Remove the
	original_stream != NULL conditional, assert error on NULL instead.
	(out_field_fmt, field_separator): New variable stream, initialize it, use it.
	(cli_out_data_ctor): Assert non-NULL stream.  Replace the stream and
	original_stream fields by the new streams field.
	(cli_out_set_stream): Replace the stream field by the new streams
	field.
	* cli-out.h: Include vec.h.
	(ui_filep): New typedef, call DEF_VEC_P for it.
	(struct cli_ui_out_data): Replace the stream and original_stream
	fields by the new streams field.
	* cli/cli-logging.c (set_logging_redirect): Call ui_out_redirect with
	NULL first.  Extend the comment.
	(handle_redirections): Call ui_out_redirect with output.
	* python/py-breakpoint.c (bppy_get_commands): Move ui_out_redirect
	calls outside of the TRY_CATCH block.

gdb/testsuite/
	* gdb.base/ui-redirect.exp: New file.
2010-09-03 15:42:04 +00:00
gdbadmin b04bc5d4a7 GDB 7.2 released. 2010-09-03 01:29:09 +00:00
Joel Brobecker 080db4e0b0 Back out the change introducing the "record pic" feature.
gdb/ChangeLog:

	Back out the following change:
	| 2010-06-29  Hui Zhu  <teawater@gmail.com>
	| * record.c (set_record_pic_cmdlist,
	| show_record_pic_cmdlist): New variables.
	| (set_record_pic_command,
	| show_record_pic_command): New functions.
	| (record_pic_function, record_pic_line, record_pic_enum,
	| set_record_pic_type, record_pic_hide_nofunction,
	| record_pic_hide_nosource, record_pic_hide_same): New variables.
	| (record_pic_fputs): New function.
	| (function_list, node_list, edge_list): New struct.
	| (function_list, node_list, edge_list): New variables.
	| (record_pic_cleanups, record_pic_node,
	| record_pic_edge, cmd_record_pic): New functions.
	| (_initialize_record): Add new commands for record pic.
2010-09-02 22:52:06 +00:00
Jan Kratochvil ba7208835a Fix ChangeLog entries cli-logging.c -> cli/cli-logging.c . 2010-09-02 18:40:12 +00:00
Daniel Jacobowitz 0a4f61e3e4 * config.in, configure: Regenerated.
* configure.ac: Check for waitpid.
	* ser-pipe.c (pipe_close): Wait for the program to exit.
2010-09-02 17:12:38 +00:00
Jan Kratochvil 58b61394cf gdb/
* cli-logging.c: Include gdb_assert.h.
	(set_logging_overwrite): New function.
	(logging_redirect): New comment.
	(logging_no_redirect_file, set_logging_redirect)
	(pop_output_files) <logging_no_redirect_file>: New.
	(handle_redirections) <!logging_redirect>: New variable
	no_redirect_file.  Remove file autoclose for tee_file_new.  No longer
	discard cleanup for the close of former OUTPUT.  Set
	LOGGING_NO_REDIRECT_FILE.
	(handle_redirections) <logging_redirect>: gdb_assert
	LOGGING_NO_REDIRECT_FILE.
	(show_logging_command) <logging_redirect handling>: Adjust messages
	for SAVED_FILENAME not NULL.
	(_initialize_cli_logging): Install set_logging_overwrite and
	set_logging_redirect.
2010-09-02 15:42:03 +00:00
Jan Kratochvil 706774f2ca gdb/
* iq2000-tdep.c (iq2000_scan_prologue): Initialize SAL.END.
2010-09-02 14:00:21 +00:00
Jan Kratochvil 9a35ccf756 gdb/
* Makefile.in (GDB_WARN_CFLAGS_NO_FORMAT): Convert it to the no- form.
	(monitor.o): Replace $(INTERNAL_WARN_CFLAGS) by $(INTERNAL_CFLAGS) and
	add $(GDB_WARN_CFLAGS_NO_FORMAT).
	(printcmd.o): Replace $(INTERNAL_CFLAGS_BASE) by $(INTERNAL_CFLAGS).
2010-09-02 13:58:06 +00:00
Yao Qi ba9b2ec30d 2010-09-02 Yao Qi <yao@codesourcery.com>
* linux-nat.c (status_to_str): Use WTERMSIG to extract the signal
        number from a WIFSIGNALED status.
2010-09-02 01:19:32 +00:00
Tom Tromey faf68db746 * symtab.h (lookup_type_symbol): Declare.
* symtab.c (lookup_symbol_in_language_full): Rename from
	lookup_symbol_in_language.  Add 'for_type' argument.
	(lookup_symbol_in_language): New function.
	(lookup_type_symbol): Likewise.
	(lookup_symbol_aux): Add 'for_type' argument.
	(match_symbol_aux): New function.
	(lookup_symbol_aux_symtabs): Use expand_one_symtab_matching.
	(match_transparent_type): New function.
	(basic_lookup_transparent_type): Use expand_one_symtab_matching.
	* symfile.h (struct quick_symbol_functions)
	<pre_expand_symtabs_matching>: Remove.
	<expand_one_symtab_matching>: New field.
	* psymtab.c (expand_one_symtab_matching_psymtabs): New function.
	(pre_expand_symtabs_matching_psymtabs): Remove.
	(psym_functions): Update.
	* gdbtypes.c (lookup_typename): Use lookup_type_symbol.
	* dwarf2read.c (dw2_lookup_symbol): Update comment.
	(dw2_pre_expand_symtabs_matching): Remove.
	(dw2_expand_one_symtab_matching): New function.
	(dwarf2_gdb_index_functions): Update.
2010-09-01 21:50:26 +00:00
Joel Brobecker 248c9dbc16 [NEWS] powerpc-lynxos gdbserver support
This adds an entry in the NEWS file announcing the GDBserver support
on powerpc-lynxos.

gdb/ChangeLog:

        * NEWS: Add entry announcing GDBserver support on powerpc-lynxos.
2010-09-01 20:47:02 +00:00
Marc Khouzam f75d858b7c * mi/mi-main.c (mi_cmd_list_target_features): Add `reverse'
as a feature reported by -list-target-features.

       * gdb.texinfo (GDB/MI Miscellaneous Commands): Document new
       feature `reverse' output by -list-target-features.
2010-09-01 19:03:54 +00:00
Joel Brobecker 0482b03b6a Generate regformats/rs6000/powerpc-32.dat
I will need this description for the ppc-lynxos debugger where, AFAICT,
we only have access to the core GP and FP registers.  So this adds
powerpc-32 to the list of targets for which a .dat file needs  to be
generated.

2010-04-30  Joel Brobecker  <brobecker@adacore.com>

        * features/Makefile (WHICH): Add rs6000/powerpc-32.
        (powerpc-32.o, powerpc-32.c): New rules.
        (clean): Also remove powerpc-32.c.
        * regformats/rs6000/powerpc-32.dat: Generate.
2010-09-01 18:56:35 +00:00
gdbadmin 8b034a19a7 Put ChangeLog entries in the right ChangeLog file. 2010-09-01 17:27:51 +00:00
gdbadmin eff1410f2b Compile memmem.o without -Werror.
This reproduces the same approach as in GDB to allow us to build
specific files without -Werror.

gdb/gdbserver/ChangeLog:

        * Makefile.in (INTERNAL_CFLAGS_BASE): New variable. Extracted
        from INTERNAL_CFLAGS.
        (INTERNAL_WARN_CFLAGS): New variable.
        (INTERNAL_CFLAGS): Adjust, using INTERNAL_WARN_CFLAGS.
2010-09-01 01:56:04 +00:00
gdbadmin 6cebaf6e1a use xsnprintf instead of snprintf.
snprintf is not available on LynxOS, so I changed the calls to snprintf
to calls to xsnprintf, which should be strictly equivalent.

gdb/gdbserver/ChangeLog:

        * utils.c (xsnprintf): Make non-static.
        * server.h: Add xsnprintf declaration.
        * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
        replace calls to snprintf by calls to xsnprintf throughout.
2010-09-01 01:53:43 +00:00
gdbadmin a1723c35ac include alloca.h if available.
On LynxOS, alloca is defined in allocal.h.  This fixes one warning that
occurs when building GDBserver for LynxOS.

gdb/gdbserver/ChangeLog:

        * configure.ac: Add configure check for alloca.
        * configure, config.in: Regenerate.
        * server.h: Include alloca.h if it exists.
        * gdbreplay.c: Include alloca.h if it exists.
2010-09-01 01:51:07 +00:00
Sami Wagiaalla 710e1a31c4 Create and use a specialized bcache type for psymbols
2010-08-31  Sami Wagiaalla  <swagiaal@redhat.com>

	* symfile.c (reread_symbols): Use psymbol_bcache_free, and
	psymbol_bcache_init.
	* psymtab.h (psymbol_bcache_init): New function prototype.
	(psymbol_bcache_free): New function prototype.
	(psymbol_bcache_get_bcache): New function prototype.
	* psymtab.c (psymbol_bcache_init): New function.
	(psymbol_bcache_free): New function.
	(psymbol_bcache_full): New function.
	(psymbol_bcache_get_bcache): New function.
	(add_psymbol_to_bcache): use psymbol_bcache_full.
	* objfiles.h (psymbol_cache): Change type of psymbol_cache to
	psymbol_bcache.
	* symmisc.c (print_symbol_bcache_statistics): Updated.
	(print_objfile_statistics): Updated.
	* objfiles.c (allocate_objfile): Use psymbol_bcache_init to initialize
	psymbol_cache.
	(free_objfile): Use psymbol_bcache_free.
2010-08-31 20:10:42 +00:00
Tom Tromey 6438229074 PR c++/11961:
* dwarf2read.c (new_symbol_full) <DW_TAG_template_type_param>:
	Don't set TYPE_NAME on the type.
2010-08-31 20:03:20 +00:00
Michael Snyder 8bbed40521 2010-08-31 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* infrun.c (set_exec_direction_func): Error out if target does not
	support reverse execution.
2010-08-31 19:31:00 +00:00
Jan Kratochvil 06253dd31f gdb/
Make linux_get_siginfo_type `type *' unique.
	* linux-tdep.c (linux_gdbarch_data_handle, struct linux_gdbarch_data)
	(init_linux_gdbarch_data, get_linux_gdbarch_data): New.
	(linux_get_siginfo_type): New variable linux_gdbarch_data.  Initialize
	it.  Use linux_gdbarch_data->siginfo_type as a persistent storage.
	(_initialize_linux_tdep): New.
2010-08-31 18:11:48 +00:00
Jan Kratochvil b8edc417a7 gdb/
Code cleanup.
	* defs.h (find_memory_region_ftype): New typedef.
	(exec_set_find_memory_regions): Use it.
	* exec.c (exec_set_find_memory_regions): Use find_memory_region_ftype.
	* fbsd-nat.c (fbsd_find_memory_regions): Likewise.
	* gcore.c (objfile_find_memory_regions): Likewise.
	* gnu-nat.c (gnu_find_memory_regions): Likewise.
	* linux-nat.c (linux_nat_find_memory_regions): Likewise.
	* procfs.c (iterate_over_mappings_cb_ftype): Remove.
	(iterate_over_mappings): Rename iterate_over_mappings_cb_ftype to
	find_memory_region_ftype.
	(insert_dbx_link_bpt_in_region): Likewise.
	(iterate_over_mappings): Likewise.  Drop the comment part about the
	function prototype.
	(find_memory_regions_callback): Use find_memory_region_ftype.
	(proc_find_memory_regions): Likewise.
	(info_mappings_callback): Rename iterate_over_mappings_cb_ftype to
	find_memory_region_ftype.
	* target.c (dummy_find_memory_regions): Use find_memory_region_ftype.
	* target.h (struct target_ops) <to_find_memory_regions>: Likewise.
2010-08-31 18:08:43 +00:00
Sami Wagiaalla cbd7053759 Enable custom bcache hash function.
2010-08-25  Sami Wagiaalla  <swagiaal@redhat.com>

	* psymtab.c (add_psymbol_to_bcache): Remove 'static' from
	'static partial_symbol psymbol'.
	(psymbol_hash): New function.
	(psymbol_compare): New function.
	* bcache.c (hash_continue): New.
	(hash): Use hash_continue.
	* bcache.c: Add hash_function and compare_function
	pointers to bcache struct.
	(bcache_full): Use bcache->hash_function, and
	bcache->compare_function.
	(bcache_compare): New function.
	(bcache_xmalloc): Take hash_function and
	compare_function arguments and initialize the
	bcach's pointers.
	Updated comment.
	* objfiles.c (allocate_objfile): Updated.
	* symfile.c (reread_symbols): Updated.
	* python/py-type.c (typy_richcompare): Updated.
2010-08-31 17:26:08 +00:00
Tom Tromey 03f17ccfe1 gdb
2010-08-30  Andre Poenitz  <andre.poenitz@nokia.com>
	    Tom Tromey  <tromey@redhat.com>

	PR python/11792:
	* python/py-value.c (valpy_get_dynamic_type): New function.
	(value_object_getset): Add "dynamic_type".
	(valpy_get_type): Fail on error.
gdb/doc
	PR python/11792:
	* gdb.texinfo (Values From Inferior): Document dynamic_type.
gdb/testsuite
	PR python/11792:
	* gdb.python/py-value.exp (test_subscript_regression): Add
	dynamic_type test.
2010-08-30 20:28:31 +00:00
Yao Qi 25b41d01ea 2010-08-30 Yao Qi <yao@codesourcery.com>
* arm-linux-tdep.c (arm_linux_sigreturn_return_addr): New.
	(arm_linux_syscall_next_pc): New.
	(arm_linux_copy_svc): Use arm_linux_sigreturn_return_addr instead.
	(arm_linux_init_abi): Initialize syscall_next_pc.
	* arm-tdep.c (thumb_get_next_pc_raw):  Get next pc of SWI in Thumb mode.
	(arm_get_next_pc_raw): Get next pc of SWI in ARM mode.
	* arm-tdep.h (struct gdbarch_tdep): Add a function pointer syscall_next_pc.
	Declare arm_frame_is_thumb.
2010-08-30 15:26:28 +00:00
Jan Kratochvil 5760d0ab88 gdb/
Code cleanup.
	* breakpoint.c (bpstat_alloc): Remove unused prototype.
	(bpstat_alloc): Change parameters cbs to bs_link_pointer.  Adjust the
	code.
	(bpstat_stop_status): Change root_bs into bs_head and bs_link.  Adjust
	calls of bpstat_alloc.  Remove explicit bs chain termination.
2010-08-30 09:49:12 +00:00
Jan Kratochvil 46a9699269 gdb/
Code cleanup.
	* linux-nat.c (pull_pid_from_list): Rename status to statusp.
	(my_waitpid): Likewise.
2010-08-28 08:38:25 +00:00
Doug Evans 36374493cd * dwarf2read.c (dw2_require_line_header): Read from .debug_types
as appropriate.
2010-08-27 23:09:58 +00:00
Tom Tromey 8b93c54cd7 * dwarf2read.c (dwarf2_attach_fields_to_type): Don't set
TYPE_FIELD_IGNORE_BITS.
2010-08-27 21:03:39 +00:00
Doug Evans 16be1145cb * dwarf2read.c (dwarf2_per_objfile_free): Reorganize buffers to match
the order they're defined in.  munmap .debug_types buffer.
2010-08-27 16:37:03 +00:00
Pedro Alves 889bf7c5fa Fix whitespace, tabs/spaces. 2010-08-27 12:02:20 +00:00
Doug Evans e254ef6a5f * dwarf2read.c (dw2_require_full_path): Rename parameter cu to per_cu.
(dw2_forget_cached_source_info): Rename local cu to per_cu.
	(dw2_lookup_symtab, dw2_do_expand_symtabs_matching): Ditto.
	(dw2_print_stats, dw2_expand_all_symtabs): Ditto.
	(dw2_expand_symtabs_with_filename, dw2_find_symbol_file): Ditto.
	(dw2_find_symbol_file, dw2_expand_symtabs_matching): Ditto.
	(dw2_map_symbol_filenames, dwarf2_initialize_objfile): Ditto.
	(dwarf2_free_objfile, write_one_signatured_type): Ditto.
	(write_psymtabs_to_index): Ditto.
2010-08-26 23:36:53 +00:00
Pedro Alves ae53ffa4b6 * NEWS: Mention libthread_db debugging with core files. 2010-08-26 19:47:23 +00:00
Doug Evans c6da4ceffb * dwarf2read.c (dwarf2_build_include_psymtabs): Remove unnecessary
forward decl.  Pass pst->dirname to dwarf_decode_lines.
	(psymtab_include_file_name): New function.
	(dwarf_decode_lines): Call it.  Update comments.
2010-08-26 16:47:55 +00:00
Pedro Alves cd02d79dc8 * dwarf2read.c (inherit_abstract_dies): Handle origin die's
compilation unit being different from target die's.
2010-08-25 18:20:07 +00:00
Doug Evans 673bfd454b PR symtab/11942
* dwarf2read.c (dwarf2_per_objfile): New members debug_info_type_hash,
	debug_types_type_hash.
	(dwarf2_cu, dwarf2_per_cu_data): Delete member type_hash.
	All uses updated.
	(lookup_die_type): Renamed from tag_type_to_tag.  First look in
	appropriate type_hash table.  All callers updated.
	(allocate_signatured_type_table): Renamed from
	allocate_signatured_type_hash_table.  All callers updated.
	(create_signatured_type_table_from_index): Renamed from
	create_signatured_type_hash_from_index.  All callers updated.
	(read_die_type): Add comment.  Move actual reading to ...
	(read_die_type_1): ... here.  New function.
	(follow_die_ref_or_sig): Tweak comment.
	(set_die_type): Rewrite to use appropriate choice of
	debug_info_type_hash or debug_types_type_hash.
	(get_die_type_at_offset): New function.
	(get_die_type): Call it.

	testsuite/
	PR symtab/11942
	* gdb.dwarf2/dw4-sig-types.cc: New file.
	* gdb.dwarf2/dw4-sig-types.h: New file.
	* gdb.dwarf2/dw4-sig-types-b.cc: New file.
	* gdb.dwarf2/dw4-sig-types.exp: New file.
2010-08-25 00:09:14 +00:00
Jan Kratochvil e8fd65ef54 gdb/
* python/py-type.c (typy_richcompare): Initialize worklist.
2010-08-24 17:24:28 +00:00
Daniel Jacobowitz 9779414d4e * arm-tdep.c: Include features/arm-with-m.c.
(arm_psr_thumb_bit): New.  Update all uses of CPSR_T to
	call this function.
	(arm_pc_is_thumb): Add a gdbarch argument.  Update all callers.
	Check is_m after force-mode.
	(arm_gdbarch_init): Check the binary before the target description.
	Add check for M profile attribute.  If we have an M-profile device,
	but no target register description, use arm-with-m.  Recognize the
	new org.gnu.gdb.arm.m-profile feature and its xpsr register.
	(_initialize_arm_tdep): Call initialize_tdesc_arm_with_m.
	* arm-tdep.h (XPSR_T): Define.
	(struct gdbarch_tdep): Add is_m member.
	* features/arm-m-profile.xml, features/arm-with-m.c,
	features/arm-with-m.xml: New files.

	doc/
	* gdb.texinfo (ARM Features): Document
	org.gnu.gdb.arm.m-profile.
2010-08-24 15:56:15 +00:00
Doug Evans e71ec85366 * dwarf2read.c (set_die_type): Fix typo in comment. 2010-08-23 21:49:26 +00:00
Doug Evans 9dc481d3a7 * dwarf2read.c (read_structure_type): Add comment.
(read_enumeration_type): Add comment.
	(process_enumeration_scope): Move definition of some locals
	closer to their use.
	(read_namespace_type): Add comment.
2010-08-23 21:44:39 +00:00
Tom Tromey f9ffd4bb11 gdb
PR python/11145:
	* python/py-value.c: Include expression.h.
	(valpy_do_cast): New function.
	(valpy_cast): Use it.
	(valpy_dynamic_cast): New function.
	(valpy_reinterpret_cast): Likewise.
	(value_object_methods): Add dynamic_cast, reinterpret_cast.
gdb/doc
	PR python/11145:
	* gdb.texinfo (Values From Inferior): Document dynamic_cast and
	reinterpret_cast methods.
gdb/testsuite
	PR python/11145:
	* gdb.python/py-value.c (Base, Derived): New types.
	(base): New global.
	* gdb.python/py-value.exp (test_subscript_regression): Add
	dynamic_cast test.
2010-08-23 20:29:19 +00:00
Tom Tromey 96f73ba54f PR python/11391:
* python/py-value.c (valpy_nonzero): Don't throw error for other
	Value types.
2010-08-23 20:27:49 +00:00