Commit Graph

17208 Commits

Author SHA1 Message Date
Michael Snyder e5b3d7d6f3 2011-02-26 Michael Snyder <msnyder@vmware.com>
* i387-tdep.c (i387_supply_xsave): Avoid shadowing a function
	param with a local variable of the same name.
2011-02-26 23:45:01 +00:00
Michael Snyder 5eee517dae 2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-low.c (linux_nat_xfer_osdata): Rename local variable so
	that it does not shadow a function parameter.
2011-02-26 23:34:44 +00:00
Michael Snyder 8fbf6b9321 2011-02-26 Michael Snyder <msnyder@vmware.com>
* i386-nat.c (i386_length_and_rw_bits): Document that case
	statement is meant to fall through.
2011-02-26 22:04:51 +00:00
Michael Snyder cb969d6141 2011-02-26 Michael Snyder <msnyder@vmware.com>
* expprint.c (dump_subexp_body_standard): Document that case
	statement is meant to fall through.
2011-02-26 21:50:41 +00:00
Michael Snyder f2c4ead516 2011-02-26 Michael Snyder <msnyder@vmware.com>
* amd64-linux-tdep.c (amd64_linux_syscall_record): Delete
	dead if statement.  Condition can't be false.
2011-02-26 19:41:35 +00:00
Michael Snyder b021a22166 2011-02-25 Michael Snyder <msnyder@vmware.com>
* arm-tdep.c: Fix typos in comments.
	* bsd-uthread.c: Ditto.
	* completer.c: Ditto.
	* corelow.c: Ditto.
	* cp-namespace.c: Ditto.
	* cp-support.c: Ditto.
	* cris-tdep.c: Ditto.
	* dbxread.c: Ditto.
	* dwarf2read.c: Ditto.
	* frame.h: Ditto.
	* gdbtypes.h: Ditto.
	* inferior.h: Ditto.
	* mdebugread.c: Ditto.
	* mips-tdep.c: Ditto.
	* ppc-linux-nat.c: Ditto.
	* ppc-linux-tdep.c: Ditto.
	* printcmd.c: Ditto.
	* sol-thread.c: Ditto.
	* solib-frv.c: Ditto.
	* solist.h: Ditto.
	* sparc64-tdep.c: Ditto.
	* spu-tdep.c: Ditto.
	* stabsread.c: Ditto.
	* symfile.c: Ditto.
	* valops.c: Ditto.
	* varobj.c: Ditto.
	* vax-nat.c: Ditto.
	* python/py-block.c: Ditto.
	* python/py-symbol.c: Ditto.
	* python/py-symtab.c: Ditto.
	* python/py-value.c: Ditto.
	* tui/tui-win.c: Ditto.
2011-02-26 02:07:10 +00:00
Michael Snyder c82c0b55e7 2011-02-25 Michael Snyder <msnyder@vmware.com>
* inferior.c (print_inferior): Accept a string instead of an int
	for requested_inferiors, and use get_number_or_range to parse it.
	(info_inferiors_command): Pass args string to print_inferior.
	(initialize_inferiors): Change help string for info inferiors.
	* inferior.h (print_inferior): Export prototype change.

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

	* gdb.multi/base.exp: Add tests for info inferiors with args.
2011-02-25 19:19:26 +00:00
Tom Tromey ee00cd23cf * common/ax.def (invalid2): Set to 0x31. 2011-02-25 14:21:05 +00:00
Jan Kratochvil 0502ed8ce1 gdb/
* dwarf2loc.c (disassemble_dwarf_expression) <DW_OP_breg[0-9]+>: Use
	L and plongest.
	(disassemble_dwarf_expression) <DW_OP_bregx>: Drop variable offset,
	use L and plongest.
	(disassemble_dwarf_expression) <DW_OP_fbreg>: Use L and plongest.
2011-02-25 08:35:36 +00:00
Michael Snyder 2c9de9123d 2011-02-24 Michael Snyder <msnyder@vmware.com>
* Makefile.in (clean): Make clean should remove generated files
	observer.h and observer.inc.
2011-02-24 18:09:51 +00:00
Joel Brobecker a04b0428ab Revert the following change (not approved yet):
2011-02-21  Hui Zhu  <teawater@gmail.com>
	* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h.
	* ax-gdb.c (gen_printf_expr_callback): New function.
	* ax-gdb.h (gen_printf_expr_callback): Forward declare.
	* ax-general.c (ax_memcpy): New function.
	(ax_print): Handle "printf".
	(ax_reqs): Ditto.
	* ax.h (ax_memcpy): Forward declare.
	* common/ax.def (invalid2): Removed.
	(printf): New entry.
	* printcmd.c (printcmd.h): New include.
	(string_printf): New function.
	(ui_printf): Removed.
	(printf_command): Remove static.  Call string_printf.
	(eval_command): Call string_printf.
	* printcmd.h: New file.
	* tracepoint.c (validate_actionline,
	encode_actions_1): handle printf_command.
2011-02-24 07:39:48 +00:00
Tom Tromey 2b52013fe3 * ax-general.c (ax_pick): Add missing newline. 2011-02-23 21:02:47 +00:00
Michael Snyder e5a67952d6 2011-02-21 Michael Snyder <msnyder@vmware.com>
* breakpoint.c (breakpoint_1): Change first argument from an int
	to a char pointer, so that the function now accepts a list of
	breakpoints rather than just one.  Use new function
	'number_is_in_list' to implement.
	(breakpoints_info): Pass char * instead of int to breakpoint_1.
	(watchpoints_info): Ditto.
	(tracepoints_info): Ditto.
	(maintenance_info_breakpoints): Ditto.
	(_initialize_breakpoint): Update help strings to reflect the fact
	that these functions can now take more than one argument.
	* cli/cli-utils.c (number_is_in_list): New function.
	* cli/cli-utils.h (number_is_in_list): Export.

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

	* gdb.texinfo (Set Breaks): Add @dots{} to arguments of info break.
	(Set Watchpoints): Add @dots{} to argument of info watchpoints.
	(Listing Tracepoints): Add @dots{} to argument of info tracepoints.

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

	* gdb.base/break.exp: Add tests for "info break" with arguments.
	* gdb.trace/infotrace.exp: Update patterns for error and help.
	* gdb.base/completion.exp: Update pattern.
	* gdb.base/ena-dis-br.exp: Update pattern.
	* gdb.base/help.exp: Update patterns.
2011-02-23 19:20:39 +00:00
Michael Snyder fbcb778d0c 2011-02-22 Michael Snyder <msnyder@vmware.com>
* memattr.c (mem_enable_command): Use get_number_or_range.
	(mem_disable_command): Ditto.
	(mem_delete_command): Ditto.
	(_initialize_mem): Tweak usage message to reflect multiple
	arguments.

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

	* gdb.base/memattr.exp: New test.
	* gdb.base/memattr.c: Test load for memattr.exp.
2011-02-23 18:30:22 +00:00
Doug Evans 6e6fbe60bc Add gdb.lookup_global_symbol python function.
* NEWS: Add entry.
	* python/py-symbol.c (gdbpy_lookup_global_symbol): New function.
	* python/python-internal.h (gdbpy_lookup_global_symbol): Declare it.
	* python/python.c (GdbMethods): Add entry for lookup_global_symbol.

	doc/
	* gdb.texinfo (Symbols In Python): Document lookup_global_symbol.
	Clarify behaviour of lookup_symbol when `block' argument is omitted,
	add description of result, fix @defun formatting.

	testsuite/
	* gdb.python/py-symbol.exp: Test lookup_global_symbol.
2011-02-22 22:48:12 +00:00
Tom Tromey 79b97fa8ff * language.c (language_class_name_from_physname): Rename
'curr_language' argument to 'lang'; use in body.
2011-02-22 18:53:45 +00:00
Michael Snyder 298f437a6b 2011-02-22 Michael Snyder <msnyder@vmware.com>
* cli/cli-utils.c (number_is_in_list): Check for zero return.
2011-02-22 18:45:05 +00:00
Pedro Alves b7ea3126c0 gdb/
* frame-unwind.h: Fix comment to mention the this frame, not the
	next.
2011-02-22 17:51:24 +00:00
Tom Tromey 58ee6d605a * symfile.c (auto_solib_limit): Remove.
* symfile.h (auto_solib_limit): Remove.
2011-02-22 15:58:37 +00:00
Joel Brobecker 36238dbca5 Delete Makefile.in:INSTALLED_LIBS (unused)
gdb/ChangeLog:

        * Makefile.in (INSTALLED_LIBS): Delete.  Update comment.
2011-02-22 08:00:25 +00:00
Michael Snyder aea5b2797c 2011-02-21 Michael Snyder <msnyder@vmware.com>
* gdbthread.h (print_thread_info): Change prototype.
	* thread.c (print_thread_info): Accept char* instead of int for
	requested_threads argument.  Use new function number_is_in_list
	to determine which threads to list.
	(info_threads_command): Pass char* to print_thread_info.
	* cli/cli-utils.c (number_is_in_list): New function.
	* cli/cli-utils.h (number_is_in_list): Export.
	* mi/mi-main.c (mi_cmd_thread_info): Pass char* to
	print_thread_info.
	(print_one_inferior): Ditto.
	(mi_cmd_list_thread_groups): Ditto.

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

	* gdb.threads/thread-find.exp: Update patterns for changes in
	output of "info threads" command.
2011-02-21 23:40:47 +00:00
Jan Kratochvil 8caa75eee4 gdb/
* common/Makefile.in (CFLAGS): New.
	(COMPILE): Add $(CFLAGS).
2011-02-21 20:04:25 +00:00
Tom Tromey ea666128f4 * breakpoint.c (catch_syscall_command_1): Fix typo. 2011-02-21 18:40:08 +00:00
Tom Tromey e9cafbccd2 * reverse.c: Include cli-utils.h.
* printcmd.c: Include cli-utils.h.
	(string_printf): Use skip_spaces.
	* cli/cli-utils.h: New file.
	* cli/cli-utils.c: New file.
	* cli/cli-dump.h (skip_spaces): Move to cli-utils.h.
	* cli/cli-dump.c (skip_spaces): Move to cli-utils.c.
	* breakpoint.h (get_number, get_number_or_range): Move to
	cli-utils.h.
	* breakpoint.c: Include cli-utils.h.
	(get_number_trailer, get_number, get_number_or_range)
	(ep_skip_leading_whitespace): Move to cli-utils.c.
	(create_breakpoint_sal, find_condition_and_thread)
	(decode_static_tracepoint_spec, watch_command_1)
	(watch_maybe_just_location, ep_parse_optional_if_clause)
	(catch_fork_command_1, catch_exec_command_1)
	(catch_syscall_command_1): Use skip_spaces, skip_to_space.
	* Makefile.in (SUBDIR_CLI_OBS): Add cli-utils.o.
	(SUBDIR_CLI_SRCS): Add cli-utils.c.
	(HFILES_NO_SRCDIR): Add cli-utils.h.
	(cli-utils.o): New target.
2011-02-21 18:13:17 +00:00
Pierre Muller f67fd822d0 * remote.c (remote_close): Reset INFERIOR_PTID to NULL_PTID
before calling discard_all_inferiors.
2011-02-21 15:56:16 +00:00
Ulrich Weigand c9def01dfc * opencl-lang.c (STRUCT_OCL_TYPE): Remove.
(struct builtin_opencl_type): Remove.
	(builtin_opencl_type): Change return type to "struct type **".
	(lookup_opencl_vector_type): Update caller.
	(opencl_language_arch_info): Copy primitive type vector from gdbarch.
	(build_opencl_types): Install plain array of "struct type *"
	instead of "struct builtin_opencl_type".
2011-02-21 15:53:10 +00:00
Ulrich Weigand e3039479e4 ChangeLog:
* arm-linux-nat.c: Include "observer.h" and "gdbthread.h".
	(PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define.
	(struct arm_linux_hwbp_cap): New type.
	(arm_linux_get_hwbp_cap): New function.
	(arm_linux_get_hw_breakpoint_count): Likewise.
	(arm_linux_get_hw_watchpoint_count): Likewise.
	(arm_linux_can_use_hw_breakpoint): Likewise.
	(arm_hwbp_type): New type.
	(arm_hwbp_control_t): Likewise.
	(struct arm_linux_hw_breakpoint): Likewise.
	(struct arm_linux_thread_points): Likewise.
	(arm_threads): New global variable.
	(arm_linux_find_breakpoints_by_tid): New function.
	(arm_hwbp_control_initialize): Likewise.
	(arm_hwbp_control_is_enabled): Likewise.
	(arm_hwbp_control_disable): Likewise.
	(arm_linux_hw_breakpoint_initialize): Likewise.
	(arm_linux_get_hwbp_type): Likewise.
	(arm_linux_hw_watchpoint_initialize): Likewise.
	(arm_linux_hw_breakpoint_equal): Likewise.
	(arm_linux_insert_hw_breakpoint1): Likewise.
	(arm_linux_remove_hw_breakpoint1): Likewise.
	(arm_linux_insert_hw_breakpoint): Likewise.
	(arm_linux_remove_hw_breakpoint): Likewise.
	(arm_linux_region_ok_for_hw_watchpoint): Likewise.
	(arm_linux_insert_watchpoint): Likewise.
	(arm_linux_remove_watchpoint): Likewise.
	(arm_linux_stopped_data_address): Likewise.
	(arm_linux_stopped_by_watchpoint): Likewise.
	(arm_linux_watchpoint_addr_within_range): Likewise.
	(arm_linux_new_thread): Likewise.
	(arm_linux_thread_exit): Likewise.
	(_initialize_arm_linux_nat): Install hardware breakpoint/watchpoint
	related target callbacks.  Register arm_linux_new_thread and
	arm_linux_thread_exit.
	* arm-tdep.h (arm_pc_is_thumb): Add prototype.
	* arm-tdep.c (arm_pc_is_thumb): Make global.
	(arm_gdbarch_init): Call set_gdbarch_have_nonsteppable_watchpoint.

testsuite/ChangeLog:

	* lib/gdb.exp (skip_hw_breakpoint_tests): Add arm*-*-* target.
	(skip_hw_watchpoint_tests): Likewise.
	(skip_hw_watchpoint_multi_tests): Likewise.
2011-02-21 15:03:38 +00:00
Ulrich Weigand b5db5dfca6 * breakpoint.c (update_watchpoint): Do not attempt to recreate
per-frame locations while within a function epilogue.
2011-02-21 14:59:34 +00:00
Pierre Muller e25b2cfa2a * ser-mingw.c (ser_windows_close): Reformat comment to better conform
to GNU coding standards.
2011-02-21 13:40:32 +00:00
Pierre Muller 4af53f973a Allow use of mingw native on Windows 95 OS.
* src/gdb/ser-mingw.c (CancelIo): New macro for dynamically loaded
	DLL entry.
	(ser_windows_close): Only call CancelIo if function exists.
	(_initialize_ser_windows): Use LoadLirary/GetProcAddress
	to check for existence of CancelIo function in kernel32 DLL.
2011-02-21 11:47:12 +00:00
Hui Zhu d0e92d82d8 2011-02-21 Hui Zhu <teawater@gmail.com>
* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h.
	* ax-gdb.c (gen_printf_expr_callback): New function.
	* ax-gdb.h (gen_printf_expr_callback): Forward declare.
	* ax-general.c (ax_memcpy): New function.
	(ax_print): Handle "printf".
	(ax_reqs): Ditto.
	* ax.h (ax_memcpy): Forward declare.
	* common/ax.def (invalid2): Removed.
	(printf): New entry.
	* printcmd.c (printcmd.h): New include.
	(string_printf): New function.
	(ui_printf): Removed.
	(printf_command): Remove static.  Call string_printf.
	(eval_command): Call string_printf.
	* printcmd.h: New file.
	* tracepoint.c (validate_actionline,
	encode_actions_1): handle printf_command.
2011-02-21 08:38:14 +00:00
Michael Snyder 7d357efd13 2011-02-19 Michael Snyder <msnyder@vmware.com>
* reverse.c (delete_one_bookmark): Argument is now bookmark
	id rather than pointer to bookmark struct.
	(delete_bookmark_command): Use get_number_or_range.
	(goto_bookmark_command): Parse with get_number instead of strtoul.
	(bookmark_1): New function.  Print info for one bookmark.
	(bookmarks_info): Use get_number_or_range and bookmark_1.
2011-02-19 19:10:48 +00:00
Michael Snyder 65ebfb52d9 2011-02-18 Michael Snyder <msnyder@vmware.com>
* thread.c (thread_apply_command): Re-implement using
	get_number_or_range.
2011-02-19 01:24:55 +00:00
Michael Snyder 7a45ebd700 2011-02-18 Michael Snyder <msnyder@vmware.com>
* thread.c (info_threads_command): Re-implement using
	get_number_or_range.
2011-02-19 01:02:56 +00:00
Tom Tromey 94d5e490f0 gdb
* common/ax.def: New file.
	* ax.h (enum agent_op): Use ax.def.
	* ax-general.c (aop_map): Use ax.def.
gdbserver
	* Makefile.in (tracepoint-ipa.o): Depend on ax.def.
	(tracepoint.o): Likewise.
	* tracepoint.c (enum gdb_agent_op): Use ax.def.
	(gdb_agent_op_names): Likewise.
2011-02-18 21:12:07 +00:00
Tom Tromey c7f96d2b95 gdb
* ax-general.c (aop_map): Add pick and rot.
	* dwarf2loc.c (compile_dwarf_to_ax) <DW_OP_over>: Reimplement.
	<DW_OP_rot>: Implement.
	* ax.h (enum agent_op) <aop_pick, aop_rot>: New constants.
	(ax_pick): Declare.
	* ax-general.c (ax_pick): New function.
doc
	* agentexpr.texi (Bytecode Descriptions): Document pick and rot.
gdbserver
	* tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
	gdb_agent_op_rot>: New constants.
	(gdb_agent_op_names): Add pick and roll.
	(eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
	cases.
2011-02-18 20:55:45 +00:00
Tom Tromey 66694b75a4 * Makefile.in (HFILES_NO_SRCDIR): Don't mention ada-operator.inc. 2011-02-18 20:31:18 +00:00
Jan Kratochvil eeaafae2bd gdb/
* cp-support.c (make_symbol_overload_list_namespace): Do not call
	make_symbol_overload_list_block with NULL BLOCK.
	* valarith.c (unop_user_defined_p): Resolve also TYPE_CODE_TYPEDEF.

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

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

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

gdb/ChangeLog:

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

gdb/testsuite/ChangeLog:

        * gdb.ada/packed_array: Expand testcase to test printing of
        unconstrained packed array.
2011-02-17 06:42:57 +00:00
Yao Qi 946ebb0d70 2011-02-17 Yao Qi <yao@codesourcery.com>
* common/Makefile.in: Add more targets for make.
2011-02-17 02:15:22 +00:00
Tom Tromey 1ba1b3533c * dwarf2loc.c (unimplemented): Fix typo. 2011-02-16 21:45:38 +00:00
Tom Tromey b1bfef6533 * dwarf2loc.c (unimplemented): Handle unnamed opcodes.
(compile_dwarf_to_ax) <default>: Use unimplemented.
	<DW_OP_deref>: Update.
	(disassemble_dwarf_expression): Update.
	* dwarf2read.c (dwarf_stack_op_name): Remove 'def' argument.
	(decode_locdesc): Update.
	* dwarf2expr.h (dwarf_stack_op_name): Update.
2011-02-16 21:32:05 +00:00
Tom Tromey 5f1e6f1949 * ax.h (struct aop_map) <name>: Now const. 2011-02-16 21:02:29 +00:00
Pedro Alves a0c78a733a 2011-02-16 Tom Tromey <tromey@redhat.com>
gdb/
	* ax-gdb.c.c (gen_expr) <UNOP_MEMVAL>: Handle value kinds other
	than axs_rvalue.

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

	gdb/testsuite/
	* collection.c (globalarr3): New global.
	(main): Initialize it before collecting, and and clear it
	afterwards.
	* collection.exp (gdb_collect_globals_test): Test collecting with
	'{type} addr', where the addr expression is not an rvalue.
2011-02-16 18:07:58 +00:00
Yao Qi a42244dbec 2011-02-16 Yao Qi <yao@qiyaows>
* infrun.c (get_displaced_step_closure_by_addr): New.
	* inferior.h: Declare it.
	* arm-tdep.c: (arm_pc_is_thumb): Call
	get_displaced_step_closure_by_addr.  Adjust MEMADDR if it
	returns non-NULL.
2011-02-16 14:54:42 +00:00
Pedro Alves 08807d5afd 2011-02-16 Pedro Alves <pedro@codesourcery.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>

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

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

	gdb/testsuite/
	* collection.c (globalarr2): New global.
	(main): Initialize it before collecting, and and clear it
	afterwards.
	* collection.exp (gdb_collect_globals_test): Test collecting
	overlapping memory ranges.
2011-02-16 12:59:05 +00:00