Commit Graph

26158 Commits

Author SHA1 Message Date
Vladimir Prus 4baf5cf487 * tracepoint.c (tvariables_info_1): Actually compute
the number of rows in the result.
2010-03-24 19:37:06 +00:00
Pedro Alves 4a5e7a5b0a gdb/
* remote.c (crc32): Constify `buf' parameter.
	(remote_verify_memory): New, abstracted out from...
	(compare_sections_command): ... this.  Remove hardcoded target
	checks.
	(init_remote_ops): Install remote_verify_memory.
	* target.c (target_verify_memory): New.
	* target.h (struct target_ops) <to_verify_memory>: New field.
	(target_verify_memory): Declare.
2010-03-24 01:12:13 +00:00
Pedro Alves 2280c721d8 * server.c (handle_query): Assign, not compare. 2010-03-24 00:14:54 +00:00
Pedro Alves d50171e439 Teach linux gdbserver to step-over-breakpoints.
* linux-low.c (can_hardware_single_step): New.
	(supports_breakpoints): New.
	(handle_extended_wait): If stopping threads, read the stop pc of
	the new cloned LWP.
	(get_pc): New.
	(get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
	low target doesn't support retrieving the PC.
	(add_lwp): Set last_resume_kind to resume_continue.
	(linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
	(linux_attach): Don't clear stop_expected.  Set the lwp's
	last_resume_kind to resume_stop.
	(linux_detach_one_lwp): Don't check for removed breakpoints.
	(check_removed_breakpoint): Delete.
	(status_pending_p): Rename to ...
	(status_pending_p_callback): ... this.  Don't check for removed
	breakpoints.  Don't consider threads that are stopped from GDB's
	perspective.
	(linux_wait_for_lwp): Always read the stop_pc here.
	(cancel_breakpoint): New.
	(step_over_bkpt): New global.
	(linux_wait_for_event_1): Implement stepping over breakpoints.
	(gdb_wants_lwp_stopped): New.
	(gdb_wants_all_stopped): New.
	(linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
	single-step traps here.  Store the thread's last reported target
	wait status.
	(send_sigstop): Don't clear stop_expected.  Always set it,
	instead.
	(mark_lwp_dead): Remove reference to pending_is_breakpoint.
	(cancel_finished_single_step): New.
	(cancel_finished_single_steps): New.
	(wait_for_sigstop): Don't cancel finished single-step traps here.
	(linux_resume_one_lwp): Don't check for removed breakpoints.
	Don't set `step' on non-hardware step archs.
	(linux_set_resume_request): Ignore resume_stop requests if already
	stopping or stopped.  Set the lwp's last_resume_kind.
	(resume_status_pending_p): Don't check for removed breakpoints.
	(need_step_over_p): New.
	(start_step_over): New.
	(finish_step_over): New.
	(linux_resume_one_thread): Always queue a sigstop for resume_stop
	requests.  Clear the thread's last reported target waitstatus.
	Don't use the `suspended' flag.  Don't consider pending breakpoints.
	(linux_resume): Start a step-over if necessary.
	(proceed_one_lwp): New.
	(proceed_all_lwps): New.
	(unstop_all_lwps): New.
	* linux-low.h (struct lwp_info): Rewrite comment for the
	`suspended' flag.  Add the `stop_pc' field.  Delete the
	`pending_stop_pc' field.  Tweak the `stepping' flag's comment.
	Add `'last_resume_kind' and `need_step_over' fields.
	* inferiors.c (struct thread_info): Delete, moved elsewhere.
	* mem-break.c (struct breakpoint): Delete `reinserting' flag.
	Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
	(set_raw_breakpoint_at): New.
	(set_breakpoint_at): Rewrite to use it.
	(reinsert_breakpoint_handler): Delete.
	(set_reinsert_breakpoint): New.
	(reinsert_breakpoint_by_bp): Delete.
	(delete_reinsert_breakpoints): New.
	(uninsert_breakpoint): Rewrite.
	(uninsert_breakpoints_at): New.
	(reinsert_breakpoint): Rewrite.
	(reinsert_breakpoints_at): New.
	(check_breakpoints): Rewrite.
	(breakpoint_here): New.
	(breakpoint_inserted_here): New.
	(check_mem_read): Adjust.
	* mem-break.h (breakpoints_supported, breakpoint_here)
	(breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
	(reinsert_breakpoint_by_bp): Delete declaration.
	(delete_reinsert_breakpoints): Declare.
	(reinsert_breakpoint): Delete declaration.
	(reinsert_breakpoints_at): Declare.
	(uninsert_breakpoint): Delete declaration.
	(uninsert_breakpoints_at): Declare.
	(check_breakpoints): Adjust prototype.
	* server.h: Adjust include order.
	(struct thread_info): Declare here.  Add a `last_status' field.
2010-03-24 00:05:03 +00:00
gdbadmin 8541339168 *** empty log message *** 2010-03-24 00:00:04 +00:00
Pedro Alves 4dfd542337 * gdb.threads/pthreads.c (thread1, thread2, main): Fix printf
format strings and add casts to avoid compiler warnings.
2010-03-23 23:50:22 +00:00
Michael Snyder 30ba68cb7e 2010-03-23 Michael Snyder <msnyder@vmware.com>
* server.c (crc32): New function.
	(handle_query): Add handling for 'qCRC:' request.
2010-03-23 22:43:50 +00:00
Vladimir Prus 1814801734 * gdb.texinfo (GDB/MI Tracepoint Commands): Document MI tracepoint
commands.
2010-03-23 22:10:08 +00:00
Vladimir Prus 011aacb08e Implement -trace-save.
* mi-cmds.h (mi_cmds_trace_save): Declare.
	* mi-cmds.c (mi_cmds): Register -trace-save.
	* mi/mi-main.c (mi_cmd_trace_save): New.
	* remote.c (remote_save_trace_data): Take const parameter.
	* target.h (struct target_ops::to_save_trace_data): Take
	const parameter.
	* target.c (update_current_target): Adjust to the above.
	* tracepoint.c (trave_save): New, extracted from
	(trace_save_command): ...this.
	(tfile_trace_find): Remove message that is unnecessary now
	that 'tfind' reports found frame.
	* tracepoint.h (trace_save): Declare.
2010-03-23 22:05:46 +00:00
Vladimir Prus f197e0f1b1 Implement -trace-find.
* mi/mi-cmds.c (mi_cmds): Register -trace-find.
	* mi/mi-cmds.h (mi_cmd_trace_find): Declare.
	* mi/mi-main.c (mi_cmd_trace_find): New.
	* target.h (struct target_ops): Document to_trace_find.
	* tracepoint.h (tfind_1): Declare.
	* tracepoint.c (finish_tfind_command): Rename to...
	(tfind_1): ...this.
	* remote.c (remote_trace_find): Return -1 if target say
	there's no frame.  Improve error diagnostics.
2010-03-23 22:01:47 +00:00
Vladimir Prus 40e1c229a2 -trace-define-variable and -trace-list-variables.
* tracepoint.c (create_trace_state_variable): Make
    	private copy of name, as opposed to assuming the
    	pointer lives forever.
    	(tvariables_info_1): New.
    	(tvariables_info): Use the above.
    	* tracepoint.h (create_trace_state_variable, tvariables_info_1):
    	Declare.
    	* mi/mi-cmds.c (mi_cmds): Register -trace-define-variable
    	and -trace-list-variables.
    	* mi/mi-cmds.h (mi_cmd_trace_define_variable)
    	(mi_cmd_trace_list_variables): New.
    	* mi/mi-main.c (mi_cmd_trace_define_variable)
    	(mi_cmd_trace_list_variables): New.
2010-03-23 21:50:11 +00:00
Vladimir Prus 9b4c786c6c Implement -break-passcount.
* mi/mi-cmd-break.c (mi_cmd_break_passcount): New.
	* mi/mi-cmds.c (mi_cmds): Register -break-passcount.
	* mi/mi-cmds.h (mi_cmd_break_passcount): Declare.
2010-03-23 21:48:14 +00:00
Vladimir Prus f224b49dcd -trace-start/-trace-end/-trace-status.
* mi/mi-cmds.c (mi_cmds): Register -trace-start, -trace-status
	and -trace-stop.
	* mi/mi-cmds.h (mi_cmd_trace_start, mi_cmd_trace_status)
	(mi_cmd_trace_stop): Declare.
	* mi/mi-main.c (mi_cmd_trace_start, mi_cmd_trace_status)
	(mi_cmd_trace_stop): New.
	* tracepoint.c (start_tracing): New, extracted from...
	(trace_start_command): ...this.
	(trace_status_mi): New.
	* tracepoint.h (struct trace_status): Document
	stopping_tracepoint.
	(start_tracing, stop_tracing, trace_status_mi): Declare.
2010-03-23 21:46:33 +00:00
Vladimir Prus 6534d786b1 Implement creating tracepoints with -break-insert.
* mi/mi-cmd-break.c (mi_cmd_break_insert): Handle -a
	to mean that tracepoint should be created.
2010-03-23 21:41:55 +00:00
Vladimir Prus 51661e93bc * breakpoint.c (check_no_tracepoint_commands): Use
current spelling of 'teval'.
2010-03-23 21:36:05 +00:00
Vladimir Prus 58ddf7c9cd Remove conflict marker. 2010-03-23 21:34:30 +00:00
Vladimir Prus a7bdde9e63 Unify actions and commands
* defs.h (read_command_lines, read_command_lines_1): New
	parameters validator and closure.
	* tracepoint.h (struct action_line): Remove.
	* breakpoint.h (struct breakpoint): Remove the 'actions'
	field.
	* defs.h (enum command_control_type): New value
	while_stepping_control.
	(struct command_line): Add comments.
	* breakpoint.c (breakoint_is_tracepoint): New.
	(breakpoint_set_commands): For tracepoints,
	verify the commands are permissible.
	(check_tracepoint_commands): New.
	(commands_command): Require that each new line is validated using
	check_tracepoint_command, if we set commands for a tracepoint.
	(create_tracepoint_from_upload): Likewise.
	(print_one_breakpoint_location): Remove the code to print
	actions specifically.
	(tracepoint_save_command): Relay to print_command_lines.
	* cli/cli-script.c (process_next_line): New parameters validator
	and closure. Handle 'while-stepping'. Call validator if not null.
	(read_command_lines, read_command_lines1): Likewise.
	(recurse_read_control_structure): New parameters validator and
	closure. Handle while_stepping_control.
	(print_command_lines): Handle while-stepping.
	(get_command_line, define_command, document_command): Adjust.
	* remote.c (remote_download_tracepoint): Adjust.
	* tracepoint.c (make_cleanup_free_actions, read_actions)
	(free_actions, do_free_actions_cleanup): Remove.
	(trace_actions_command): Use read_command_lines.
	(validate_actionline): Use error in one place.
	(encode_actions_1): New, extracted from...
	(encode_actions): ...this. Also use cleanups for exception
	safety.
	(trace_dump_command): Adjust.
	* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
	it's tracepoint.
2010-03-23 21:32:28 +00:00
Mike Frysinger 64e3cf3d4f gdb: fix building with system readline
Building gdb with --enable-targets=all and --with-system-readline hits a
failure in a few targets all related to the inclusion of some opcodes
headers.  The usage of the bundled readline results in an -I to the top
srcdir, but if that isn't used, then there is no such -I path.  A few gdb
targets use this implicitly to include opcodes/ source header files.  So
make sure there is always an explicit -I path to the opcodes/ directory.
2010-03-23 21:31:29 +00:00
Pedro Alves b9a881c2d2 * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
lwp had been stopped by a watchpoint.
2010-03-23 18:00:57 +00:00
gdbadmin 405f531a1a *** empty log message *** 2010-03-23 00:00:03 +00:00
Jan Kratochvil c847d045a6 gdb/testsuite/
* dg-extract-results.sh: Sync with GCC HEAD (import r155655, r157175
	and r157645).
2010-03-22 20:38:58 +00:00
Stan Shebs 52e9fde813 2010-03-22 Stan Shebs <stan@codesourcery.com>
* value.c (value_static_field): Be lazy about the field's value.
2010-03-22 18:47:00 +00:00
Tom Tromey 508ccb1f2c 2010-03-22 Reid Kleckner <reid@kleckner.net>
PR gdb/11094
	* breakpoint.c (disable_breakpoints_in_unloaded_shlib): Add
	bp_jit_event.
	(disable_breakpoints_in_shlibs): Likewise.
2010-03-22 17:36:28 +00:00
Jan Kratochvil 5f717f1dbd gdb/testsuite/
* gdb.dwarf2/dw2-empty-namespace.exp, gdb.dwarf2/dw2-empty-namespace.S:
	New.
2010-03-22 16:53:21 +00:00
Daniel Jacobowitz 7d6d51d5fd * gdb.python/Makefile.in (EXECUTABLES): Add py-mi.
* gdb.python/py-mi.exp (binfile): Rename to py-mi.
2010-03-22 15:32:26 +00:00
Ulrich Weigand acebe513da * dwarf2read.c (partial_die_parent_scope): Work around buggy
GCC 4.1 debug info generation (GCC PR c++/28460).
	(determine_prefix): Likewise.
2010-03-22 13:21:39 +00:00
gdbadmin 197d2099b8 *** empty log message *** 2010-03-22 00:00:03 +00:00
gdbadmin 213efadf9f *** empty log message *** 2010-03-21 00:00:09 +00:00
Daniel Jacobowitz 957b8b5a0f * tui/tui-disasm.c (tui_get_begin_asm_address): Default to
get_current_arch.
	* tui/tui-layout.c (extract_display_start_addr): Likewise.
2010-03-20 05:17:10 +00:00
gdbadmin 515cc1798a *** empty log message *** 2010-03-20 00:00:04 +00:00
Stan Shebs 3b11a01527 2010-03-19 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c (gen_fetch): Handle bool.
	(gen_usual_unary): Ditto.
	(gen_cast): Ditto.
	(gen_equal): New function.
	(gen_less): New function.
	(gen_expr_binop_rest): Call them, also return integer type from
	logical operations.
	(gen_expr): Ditto.

	* gdb.trace/ax.exp: New file.
2010-03-19 22:00:17 +00:00
Tom Tromey 2078179266 * jv-lang.c (jv_dynamics_objfile_data_key)
(jv_type_objfile_data_key): New globals.
	(class_symtab): Move earlier.
	(jv_per_objfile_free): New function.
	(get_dynamics_objfile): Call set_objfile_data.  Add 'gdbarch'
	parameter.
	Remove ancient #if 1.
	(add_class_symbol): Remove redundant declaration.
	(java_lookup_class): Use alloc_type, not alloc_type_arch.
	(java_link_class_type): Mark as static.  Update.
	(jv_clear_object_type): New function.
	(set_java_object_type): Likewise.
	(get_java_object_type): Use set_java_object_type.
	(is_object_type): Likewise.
	(_initialize_java_language): Register new objfile keys.
	(get_java_class_symtab): Add 'gdbarch' parameter.
	(add_class_symtab_symbol): Update.
	(type_from_class): Update.
2010-03-19 19:08:41 +00:00
Stan Shebs cf3e25cabf 2010-03-19 Stan Shebs <stan@codesourcery.com>
* ax-general.c (ax_const_l): Fix a sizing bug.
2010-03-19 18:21:03 +00:00
Doug Evans 6bb85cd171 * lib/gdb.exp (gdb_compile_test): Watch for "compiler not installed"
output from gcc.
2010-03-19 17:59:37 +00:00
Doug Evans d7d158ed1d * gdb.base/break-interp.exp (prelinkNO): Handle prelink binaries
named /usr/sbin/prelink<foo>.
2010-03-19 17:57:17 +00:00
gdbadmin 860deac3a2 *** empty log message *** 2010-03-19 00:00:03 +00:00
gdbadmin f1ae44c904 GDB 7.1 released. 2010-03-18 22:25:24 +00:00
Stan Shebs 4daf5ac07e 2010-03-18 Stan Shebs <stan@codesourcery.com>
Pedro Alves  <pedro@codesourcery.com>

	* target.h (struct target_ops): New method
	to_set_circular_trace_buffer.
	(target_set_circular_trace_buffer): New macro.
	* target.c (update_current_target): Add
	to_set_circular_trace_buffer, fix to_set_disconnected_tracing
	default behavior.
	* remote.c (remote_set_circular_trace_buffer): New function.
	(init_remote_ops): Add it to vector.
	* tracepoint.h (struct trace_status): New field traceframes_created,
	change buffer_size and buffer_free to int.
	* tracepoint.c (circular_trace_buffer): New global.
	(start_tracing): Send values of disconnected tracing and circular
	trace buffer settings.
	(set_circular_trace_buffer): New function.
	(parse_trace_state): Handle total space and frames created.
	(trace_status_command): Display total space and total frames
	created.
	(trace_save): Write out new status values.
	(parse_trace_status): Set traceframe_count, traceframes_created,
	buffer_free and buffer_size to -1 by default.
	(_initialize_tracepoint): New setshow for circular-trace-buffer.
	* NEWS: Mention the circular trace buffer option.

	* gdb.texinfo (Starting and Stopping Trace Experiments): Describe
	circular-trace-buffer.
	(Tracepoint Packets): Describe QTBuffer, and details of the
	qTStatus reply.

	* gdb.trace/circ.exp: Test circular-trace-buffer.
	* gdb.trace/tfile.exp: Update tstatus test.
2010-03-18 21:23:35 +00:00
Joel Brobecker e8d054800a [dwarf] Anonymous nested function causes SEGV during psymbol read
According to the DWARF3 standard, a function always has a name attribute
(Section 3.3 - Subroutine and Entry Point Entries).  The only exception
is when a DW_AT_abstract_origin attribute is provided, in which case
the name may be inherited from the referenced DIE.

The problem occured because our compiler generated a subprogram DIE
for a nested function where the name attribute was missing (and no
abstract-origin either).  Our code in add_partial_symbol is not
prepared to deal with the situation, and happily just tries  to compute
the length of the (NULL) function name.

This normally cannot happen, because there is already a guard in
scan_partial_symbols, where we (silently!) ignore anonymous dies,
including anonymous subprograms. Unfortunately, there is a flaw that
affects Ada and other languages that allow nested subprograms. For
nested subprograms, we do not go through scan_partial_symbols and
thus we are missing the name check.

This patch adds the name check in the nested subprogram case. It also
adds a complaint which is emitted during the psymtab->symtab conversion
phase.

gdb/ChangeLog:

        * dwarf2read.c (add_partial_subprogram): Make sure the subprogram
        DIE has a name before creating the associated partial symbol.
        (read_func_scope): Emit a complaint if the subprogram does not
        have a name or when we can't extract the subprogram PC bounds.

gdb/testsuite/ChangeLog:

        * gdb.dwarf2/dw2-anonymous-func.S: New file.
        * gdb.dwarf2/dw2-anonymous-func.exp: New testcase.

Tested on x86_64-linux, no regression.  Note that the testcase also
verifies that the psymtab->symtab conversion does not crash (this is
the purpose of the "list file1.txt:1" test.
2010-03-18 18:35:55 +00:00
Tom Tromey 40c549d600 * infcmd.c (finish_command_continuation): Wrap print_return_value
in TRY_CATCH.
2010-03-18 18:02:00 +00:00
Stan Shebs 1c40aa62ec Fix last checkin 2010-03-18 16:01:29 +00:00
Ulrich Weigand 441b986a3d ChangeLog:
* mi/mi-main.c (mi_cmd_list_thread_groups): Use get_current_arch
	instead of selected frame architecture.

testsuite/ChangeLog:

	* gdb.mi/gdb680.exp: Revert 2009-06-17 change.
2010-03-18 13:25:20 +00:00
Pedro Alves 4247603be5 gdb/
* infcmd.c (until_command): Use ERROR_NO_INFERIOR.  Ensure there's
	a valid selected thread, and that it is not running.
	(advance_command): Ditto.
	(finish_command): Ditto.

	gdb/testsuite/
	* gdb.base/default.exp: Adjust.
2010-03-18 13:21:40 +00:00
Stan Shebs 3a96536b17 2010-03-17 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c (require_rvalue): Disallow non-scalars.
2010-03-18 01:47:33 +00:00
Stan Shebs 573cda036a 2010-03-17 Stan Shebs <stan@codesourcery.com>
* infcall.c: Include tracepoint.h.
	(call_function_by_hand): Disallow calls in tfind mode.
	* infcmd.c: Include tracepoint.h.
	(ensure_not_tfind_mode): New function.
	(continue_1): Call it.
	(step_1) Ditto.
	(jump_command): Ditto.
	(signal_command): Ditto.
	(advance_command): Ditto.
	(until_command): Ditto.
	(finish_command): Ditto.
	* tracepoint.h (disconnect_or_stop_tracing): Declare.
2010-03-18 01:09:26 +00:00
gdbadmin d504198035 *** empty log message *** 2010-03-18 00:00:34 +00:00
Stan Shebs 400c6af037 2010-03-17 Stan Shebs <stan@codesourcery.com>
* ax-gdb.h (struct axs_value): New field optimized_out.
	(gen_trace_for_var): Add gdbarch argument.
	* ax-gdb.c (gen_trace_static_fields): New function.
	(gen_traced_pop): Call it, add gdbarch argument.
	(gen_trace_for_expr): Update call to it.
	(gen_trace_for_var): Ditto, and report optimized-out variables.
	(gen_struct_ref_recursive): Check for optimized-out value.
	(gen_struct_elt_for_reference): Ditto.
	(gen_static_field): Pass gdbarch instead of expression, assume
	optimization if field not found.
	(gen_var_ref): Set the optimized_out flag.
	(gen_expr): Error on optimized-out variable.
	* tracepoint.c (collect_symbol): Handle struct-valued vars as
	expressions, skip optimized-out variables with computed locations.
	* dwarf2loc.c (dwarf2_tracepoint_var_ref): Flag instead of
	erroring out if location expression missing.
	(loclist_tracepoint_var_ref): Don't error out here.
2010-03-17 22:04:43 +00:00
Tom Tromey a3b2a86bb7 * dwarf2read.c (dwarf2_get_section_info): Handle case where no
DWARF data is available.
2010-03-17 19:16:02 +00:00
Daniel Jacobowitz 38963c97b7 * symfile.c (generic_load): Reset breakpoints after loading. 2010-03-17 18:08:11 +00:00
Tom Tromey ddabfc735b * linux-nat.c (linux_nat_detach): Check debug_linux_nat. 2010-03-17 16:17:00 +00:00
Jan Kratochvil d8c09fb595 gdb/
* spu-tdep.c (spu_catch_start): Replace set_breakpoint call with the
	create_breakpoint call, adjust the parameters.
2010-03-17 13:38:56 +00:00
gdbadmin 7a6771ef40 *** empty log message *** 2010-03-17 00:00:33 +00:00
Jan Kratochvil bbb0eef699 gdb/
* dwarf2read.c (read_subrange_type): Set TYPE_HIGH_BOUND_UNDEFINED.
	* valarith.c (value_subscripted_rvalue): Suppress error if
	TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED.
2010-03-16 20:51:23 +00:00
Joel Brobecker b8d088acc8 Avoid switch to invalid ptid during Ada task switch.
This is to prevent an internal error during an Ada task switch. A task
switch is simply a thread switch under the hood. What we do is collect
the info from the Ada Task Control Block, deduce the associated thread
ptid, and then switch to that thread.  If the thread ptid computation
routine has not been implemented for the target, of if there is a bug,
then we end up computing a bogus ptid which GDB does not know about,
which eventually leads to an assertion failure:

    (gdb) task 1
    [New Thread 5715]
    /[...]/gdb/thread.c:595: internal-error: is_thread_state:
     Assertion `tp' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

When this happens, it's just nicer for the user to print an error
message, and cancel the task switch. After this patch is applied,
this is what we get:

    (gdb) task 1
    [New Thread 10250]
    Unable to compute thread ID for task 1.
    Cannot switch to this task.

gdb/ChangeLog:

        * ada-tasks.c (task_command_1): Check that the task ptid is valid
        before doing the associated thread switch.
2010-03-16 18:47:15 +00:00
Pedro Alves e92d13d5bc gdb/gdbserver/
* server.h (internal_error): Declare.
	(gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
	* utils.c (internal_error): New function.
2010-03-16 17:47:52 +00:00
Hui Zhu 46956e396d 2010-03-16 Holger Hans Peter Freyther <zecke@selfish.org>
* linux-record.c (record_linux_msghdr): Remove unintended semicolons.
2010-03-16 17:01:21 +00:00
Daniel Jacobowitz 322be96262 * MAINTAINERS: Update my email address. 2010-03-16 13:59:36 +00:00
Vladimir Prus 8cdf0e1506 Simplify MI breakpoint setting.
* breakpoint.c (break_command_really): Make nonstatic and
    	rename to...
    	(create_breakpoint): ...this. Rename prior function by this name
    	to...
    	(create_breakpoint_sal): ...this.
    	(create_breakpoints): Rename to...
    	(create_breakpoints_sal): ...this.
    	(set_breakpoint): Remove.
    	* breakpoint.h: Adjust to above changes.
    	* mi/mi-cmd-break.c (mi_cmd_break_insert): Simplify.
2010-03-16 08:42:20 +00:00
Stan Shebs ac0cd78b43 Fix a commit snafu 2010-03-16 00:52:54 +00:00
gdbadmin 6ad52ba97a *** empty log message *** 2010-03-16 00:00:03 +00:00
Stan Shebs b6e7192fae 2010-03-15 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c: Include cp-support.h.
	(find_field): Remove.
	(gen_primitive_field): New function.
	(gen_struct_ref_recursive): New function.
	(gen_struct_ref): Rewrite to call gen_struct_ref_recursive instead
	of find_field.
	(gen_static_field): New function.
	(gen_struct_elt_for_reference): New.
	(gen_namespace_elt): New.
	(gen_maybe_namespace_elt): New.
	(gen_aggregate_elt_ref): New.
	(gen_expr): Add OP_SCOPE, display opcode name in error message.
2010-03-15 23:53:21 +00:00
Tom Tromey 1054b214e2 * dwarf2read.c (die_needs_namespace): Also return 0 for
DW_TAG_subprogram.
2010-03-15 20:49:53 +00:00
Joel Brobecker 4dea3bb71a Requalify Ralf Corsepius' change as a "tiny change".
Ralf's copyright assignment does not cover GDB for the moment.
He only contributed one other change, in 2005, so this should be fine.
2010-03-15 17:32:55 +00:00
Sami Wagiaalla 13387711b2 2010-03-15 Sami Wagiaalla <swagiaal@redhat.com>
PR c++/7936:
        * cp-support.h: Added char *declaration element to using_direct
        data struct.
        (cp_add_using): Added char *declaration argument.
        (cp_add_using_directive): Ditto.
        (cp_lookup_symbol_imports): made extern.
        * cp-namespace.c: Updated with the above changes.
        * dwarf2read.c (read_import_statement): Ditto.
        (read_namespace): Ditto.
        (read_import_statement): Support import declarations.
        * cp-namespace.c (cp_lookup_symbol_imports): Check for imported
        declarations.
        Added support for 'declaration_only' search.
        (cp_lookup_symbol_namespace): Attempt to search for the name as
        is before consideration of imports.
        * symtab.c (lookup_symbol_aux_local): Added a 'declaration_only'
        search at every block level search.
        Now takes language argument.
        (lookup_symbol_aux): Updated.

    2010-03-15  Sami Wagiaalla  <swagiaal@redhat.com>

        * gdb.cp/shadow.exp: Removed kfail; test has been fix.
        * gdb.cp/nsusing.exp: Ditto.
2010-03-15 17:29:36 +00:00
Tom Tromey 6e31430b70 gdb
* c-exp.y (name_not_typename): Add 'operator' clause.
gdb/testsuite
	* gdb.cp/userdef.exp: Add tests for explicit calls to operator==.
	* gdb.cp/userdef.cc (operator==): New function.
	(main): New locals mem1, mem2.
2010-03-15 17:26:47 +00:00
Joel Brobecker 0f4b045ab1 Fix date in latest entry. 2010-03-15 17:06:41 +00:00
Joel Brobecker bf3071347e Fail gdb configure if target is not supported.
* configure.ac: Exit if ${gdb_target_obs}" is not set.
        * configure: Regenerate.
2010-03-15 17:03:03 +00:00
Andreas Schwab 64daa791ab * configure.srv: Fix typo setting srv_regobj. 2010-03-15 16:35:29 +00:00
Jan Kratochvil 4d9743afc8 gdb/
* symfile.c (addr_info_make_relative): Ignore also missing ".dynbss"
	and ".sdynbss".  Update the comment.
2010-03-15 09:31:34 +00:00
Jie Zhang f75150fead * MAINTAINERS: Update my email address. 2010-03-15 03:48:46 +00:00
Jie Zhang e2d69cb505 * lib/mi-support.exp (mi_gdb_target_load): Delete unused timeout var.
Declare and use new loadtimeout variable.
2010-03-15 03:43:13 +00:00
Daniel Jacobowitz f572f0a930 * gdb.base/printcmds.exp: Use gdb_file_cmd instead of gdb_load.
Use gdb_load later.
2010-03-15 02:57:57 +00:00
Daniel Jacobowitz 3c13bc11c3 * gdbtypes.h (TYPE_IS_OPAQUE): Correct HAVE_CPLUS_STRUCT check. 2010-03-15 02:42:54 +00:00
Pedro Alves f52cd8cdd8 * linux-low.c (fetch_register): Avoid passing a non string literal
format to `error'.
	(usr_store_inferior_registers): Ditto.
2010-03-15 00:31:16 +00:00
gdbadmin 19941bfa37 *** empty log message *** 2010-03-15 00:00:03 +00:00
Daniel Jacobowitz 43484f03bc * charset.c [USE_WIN32API]: Include <windows.h>.
(_initialize_charset): Correct type of w32_host_default_charset.
2010-03-14 22:38:38 +00:00
Pedro Alves 93ae6fdc31 * linux-low.c (linux_write_memory): Bail out early if peeking
memory failed.
2010-03-14 19:34:47 +00:00
Pedro Alves c3adc08c6f * linux-low.h (struct lwp_info): New fields
`stopped_by_watchpoint' and `stopped_data_address'.
	* linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
	here, and cache them in the lwp object.
	(wait_for_sigstop): Check stopped_by_watchpoint lwp field
	directly.
	(linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
	field.
	(linux_stopped_by_watchpoint): Rewrite.
	(linux_stopped_data_address): Rewrite.
2010-03-14 18:46:40 +00:00
Pedro Alves 51f4c0b08e * gdb.base/solib-disc.c (main): Make format of fprintf a string
literal.  Add missing endlines to prints to stderr.
2010-03-14 17:46:51 +00:00
Pedro Alves 5f25d77d67 * infrun.c (ptid_match): Don't assert that PTID is not a pid ptid. 2010-03-14 17:35:21 +00:00
gdbadmin 005c61b77b *** empty log message *** 2010-03-14 00:00:03 +00:00
Tom Tromey 1c809c6883 gdb
PR c++/9708:
	* dwarf2read.c (die_needs_namespace) <DW_TAG_variable>: A variable
	in a lexical block does not need a namespace.
	(new_symbol) <DW_TAG_variable>: Put extern variables on
	list_in_scope in all cases.
gdb/testsuite
	PR c++/9708:
	* gdb.cp/m-static.exp: Add regression test.
	* gdb.cp/m-static.cc (method): New method.
	(main): Call it.
2010-03-13 00:27:12 +00:00
gdbadmin e0ce539c57 *** empty log message *** 2010-03-13 00:00:33 +00:00
Stan Shebs 948103cf34 2010-03-12 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c (gen_expr): Add shift expressions.
	(gen_expr_binop_rest): Ditto.
2010-03-12 23:13:19 +00:00
Sami Wagiaalla 00ae8fef88 2010-03-12 Sami Wagiaalla <swagiaal@redhat.com>
* buildsym.c (finish_block): Reset using_directives pointer
	after block initialization.


2010-03-12  Sami Wagiaalla  <swagiaal@redhat.com>

	* gdb.cp/gdb2384-base.h: Created 'namespace B'.
	* gdb.cp/gdb2384-base.cc: Use 'namespace B'.
2010-03-12 21:13:15 +00:00
Pedro Alves 21e24d2119 gdb/testsuite/
* lib/gdb.exp (gdb_test_multiple): Handle -timeout.
2010-03-12 21:07:51 +00:00
Pedro Alves 759f0f0b7b gdb/testsuite/
* lib/gdb.exp (skip_stl_tests): New.
	(gdb_compile): Symbian needs -ldl.
	(shlib_target_file): New.
	(shlib_symbol_file): New.
	(gdb_load_shlibs): Use shlib_target_file.
	* lib/mi-support.exp (mi_load_shlibs): Use shlib_target_file.
	* gdb.cp/exception.exp: Use skip_stl_tests.
	* gdb.cp/bs15503.exp: Use skip_stl_tests.  Use untested.
	* gdb.cp/try_catch.exp: Use skip_stl_tests.
	* gdb.cp/mb-templates.exp: Ditto.
	* gdb.base/commands.exp: Relax regexes.
	* gdb.base/watchpoint-solib.exp: Don't skip on symbian.  Use
	shlib_target_file and shlib_symbol_file.
	* gdb.base/maint.exp: Allow lowercase t.  Allow .rodata in
	sections.
	* gdb.base/ending-run.exp: Accept E32Main for symbian.
	* gdb.base/solib-disc.exp: Use
	shlib_target_file and shlib_symbol_file.
	* gdb.base/unload.exp: Don't skip on symbian.  Use
	shlib_target_file and shlib_symbol_file.
	* gdb.base/list.exp: Check use_gdb_stub instead of is_remote.
2010-03-12 19:17:01 +00:00
Stan Shebs c942923237 2010-03-12 Stan Shebs <stan@codesourcery.com>
Nathan Sidwell  <nathan@codesourcery.com>

	* gdb.texinfo (Tracepoint Actions): Clarify that while-stepping is
	doing instruction stepping.
	(Tracepoint Restrictions): New node.
2010-03-12 19:15:52 +00:00
H.J. Lu 9cad29ac31 Restore sp for x86.
2010-03-12  H.J. Lu  <hongjiu.lu@intel.com>

	* amd64-tdep.c (amd64_word_names): Replace "sp" with "".
	* i386-tdep.c (i386_word_names): Likewise.
2010-03-12 15:12:35 +00:00
Pedro Alves 6a8f26716a * gdb.trace/backtrace.exp: Adjust for x86 and x86_64.
* gdb.trace/report.exp: Adjust for x86 and x86_64.
	Issue a tfind end before looking for a tracepoint frame.
	* gdb.trace/tfind.exp: Adjust tstatus output.
	Adjust disassembly output.
	* gdb.trace/while-dyn.exp: Adjust for x86 and x86_64.
2010-03-12 04:04:40 +00:00
Pedro Alves 2f4d88753b * target.c (memory_xfer_partial): Don't use the stack cache if
inspecting trace frames.
	* tracepoint.c (finish_tfind_command): Invalidate the target
	dcache.
2010-03-12 03:54:45 +00:00
gdbadmin 313660f395 *** empty log message *** 2010-03-12 00:01:04 +00:00
Jan Kratochvil ccf2624776 gdb/
* solib-svr4.c (LM_ADDR_CHECK) <info_verbose>: Use printf_unfiltered
	for the PIC displacement, print also the displacement value.
	(svr4_exec_displacement):  Print DISPLACEMENT if INFO_VERBOSE.

gdb/testsuite/
	* gdb.base/break-interp.exp: Create new displacement parameter value
	for the test_ld calls.
	(reach): New parameter displacement, verify its content.  New push of
	pf_prefix "reach-$func:".  Import global expect_out.
	(test_core): New parameter displacement, verify its content.  New push
	of pf_prefix "core:".  New command "set verbose on".  Import global
	expect_out.
	(test_attach): New parameter displacement, verify its content.  New
	push of pf_prefix "attach:".  New command "set verbose on".  Import
	global expect_out.
	(test_ld): New parameter displacement, pass it to the reach, test_core
	and test_attach calls and verify its content in the "ld.so exit" test.
	* gdb.base/prelink.exp: Remove gdb_exit and final return.
	(prelink): Update expected text, use gdb_test.
2010-03-11 22:07:03 +00:00
Kevin Buettner 477c84a75f * remote-mips.c (close_ports, mips_initialize_cleanups)
(mips_exit_cleanups, mips_send_command, mips_open, pmon_open)
	(ddb_open, lsi_open, mips_remove_breakpoint, mips_remove_watchpoint)
	(mips_stopped_by_watchpoint, send_srec, pmon_checkset)
	(pmon_make_fastrec, pmon_check_ack, mips_expect_download)
	(pmon_check_entry_address, pmon_check_total, pmon_end_download)
	(pmon_download, pmon_load_fast, _initialize_remote_mips): Add
	comments describing each of these functions.
	(mips_enter_debug, mips_exit_debug, common_open)
	(mips_signal_from_protocol, pmon_makeb64, pmon_zeroset): Add
	blank line after the comment describing the function.
2010-03-11 03:45:49 +00:00
Doug Evans e469c7fb68 * gdb.base/checkpoint.exp: Fix comment.
Lengthen timeout while doing >600 checkpoints test.
	Rename duplicate "kill all one" test to keep test names unique.
2010-03-11 00:20:29 +00:00
gdbadmin 90b21eb72d *** empty log message *** 2010-03-11 00:00:03 +00:00
Jan Kratochvil 01c30d6e99 gdb/
* solib-svr4.c (svr4_exec_displacement): Return now success, new
	parameter displacementp.  Update comment.
	(svr4_relocate_main_executable): Return if non-zero SECTION_OFFSETS
	element exists.  Return if svr4_exec_displacement was not successful.
	Update comment.
2010-03-10 20:55:44 +00:00
Jan Kratochvil 09919ac266 gdb/
* solib-svr4.c (read_program_header): Support type == -1 to read
	all program headers.
	(read_program_headers_from_bfd): New function.
	(svr4_static_exec_displacement): Remove and move the comment ...
	(svr4_exec_displacement): ... here.  Remove variable found.  New
	variable displacement.  Check also DYNAMIC.  Verify DISPLACEMENT
	alignment for ELF targets.  Compare target vs. exec_bfd PHDRs for ELF
	targets using read_program_headers_from_bfd.  Remove the call of
	svr4_static_exec_displacement.
2010-03-10 20:50:55 +00:00
Tom Tromey d146bf1edc * dwarf2read.c (struct pubnames_header): Remove.
(_PUBNAMES_HEADER): Remove.
	(_ACTUAL_PUBNAMES_HEADER_SIZE): Remove.
	(struct aranges_header): Remove.
	(_ARANGES_HEADER, _ACTUAL_ARANGES_HEADER_SIZE): Remove.
	(struct dwarf2_per_objfile) <pubnames, aranges>: Remove.
	(PUBNAMES_SECTION): Remove.
	(ARANGES_SECTION): Remove.
	(dwarf2_locate_sections): Don't handle pubnames or aranges.
	(dwarf2_build_psymtabs): Remove dead code.
	(dwarf2_build_psymtabs_easy): Remove.
2010-03-10 18:41:37 +00:00
Tom Tromey be391dcafc * elfread.c (elf_symfile_read): Don't call
dwarf2_build_frame_info.
	* dwarf2read.c (struct dwarf2_section_info) <readin>: New field.
	(struct dwarf2_per_objfile) <objfile>: New field.
	(dwarf2_has_info): Now idempotent.  Set objfile field.
	(dwarf2_read_section): Check and set readin field.  Call
	posix_madvise.
	(dwarf2_build_psymtabs): Don't read all sections.
	(read_type_comp_unit_head): Read types section.
	(create_debug_types_hash_table): Likewise.
	(init_cu_die_reader): Add asserts.
	(process_type_comp_unit): Add assert.
	(dwarf2_build_psymtabs_hard): Read info section.
	(load_partial_comp_unit): Add assert.
	(create_all_comp_units): Read info section.
	(load_full_comp_unit): Likewise.
	(dwarf2_ranges_read): Read ranges section.
	(dwarf2_record_block_ranges): Add assert.
	(dwarf2_read_abbrevs): Read abbrev section.
	(read_indirect_string): Read str section.
	(dwarf_decode_line_header): Read line section.
	(read_signatured_type_at_offset): Read types section.
	(dwarf_decode_macros): Read macinfo section.
	(dwarf2_symbol_mark_computed): Read loc section.
	* dwarf2-frame.c (dwarf2_frame_find_fde): Call
	dwarf2_build_frame_info.
	(dwarf2_build_frame_info): Unconditionally set
	dwarf2_frame_objfile_data on the objfile.
	* configure.ac: Check for posix_madvise.
	* config.in, configure: Rebuild.
2010-03-10 18:37:24 +00:00
Tom Tromey e38df1d074 * xcoffread.c (xcoff_start_psymtab): Update.
(xcoff_end_psymtab): Update.
	* psymtab.c (allocate_psymtab): Remove dead code.
	* psympriv.h (struct partial_symtab) <read_symtab_private>: Now
	void*.
	* mdebugread.c (parse_partial_symbols): Update.
	(new_psymtab): Likewise.
	* dwarf2read.c (process_psymtab_comp_unit): Update.
	(psymtab_to_symtab_1): Update.
	* dbxread.c (start_psymtab): Update.
	(end_psymtab): Likewise.
2010-03-10 18:27:00 +00:00
Tom Tromey ccefe4c44c gdb
* xcoffread.c: Include psymtab.h.
	(xcoff_sym_fns): Update.
	* symtab.h (struct partial_symbol): Remove.
	(PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove.
	(struct partial_symtab): Remove.
	(PSYMTAB_TO_SYMTAB): Remove.
	(lookup_partial_symbol, lookup_partial_symtab, find_pc_psymtab)
	(find_pc_sect_psymtab): Remove.
	(find_pc_sect_symtab_via_partial): Declare.
	(find_pc_psymtab, find_pc_sect_psymbol, psymtab_to_symtab)
	(find_main_psymtab): Remove.
	(find_main_filename): Declare.
	(fixup_psymbol_section): Remove.
	(fixup_section): Declare.
	* symtab.c: Include psymtab.h.
	(lookup_symtab): Use lookup_symtab method.
	(lookup_partial_symtab): Remove.
	(find_pc_sect_psymtab_closer): Remove.
	(find_pc_sect_psymtab): Remove.
	(find_pc_sect_symtab_via_partial): New function.
	(find_pc_psymtab, find_pc_sect_psymbol, find_pc_psymbol): Remove.
	(fixup_section): No longer static.
	(fixup_psymbol_section): Remove.
	(lookup_symbol_aux): Use lookup_symbol_aux_quick.
	(lookup_global_symbol_from_objfile): Likewise.
	(lookup_symbol_aux_psymtabs): Remove.
	(lookup_symbol_aux_quick): New function.
	(lookup_symbol_global): Use lookup_symbol_aux_quick.
	(lookup_partial_symbol): Remove.
	(basic_lookup_transparent_type_quick): New function.
	(basic_lookup_transparent_type): Use it.
	(find_main_psymtab): Remove.
	(find_main_filename): New function.
	(find_pc_sect_symtab): Use find_pc_sect_symtab method.
	(find_line_symtab): Use expand_symtabs_with_filename method.
	(output_partial_symbol_filename): New function.
	(sources_info): Use map_partial_symbol_filenames.
	(struct search_symbols_data): New type.
	(search_symbols_file_matches): New function.
	(search_symbols_name_matches): Likewise.
	(search_symbols): Use expand_symtabs_matching method.
	(struct add_name_data): Rename from add_macro_name_data.
	(add_macro_name): Update.
	(add_partial_symbol_name): New function.
	(default_make_symbol_completion_list): Use
	map_partial_symbol_names.
	(struct add_partial_symbol_name): New type.
	(maybe_add_partial_symtab_filename): New function.
	(make_source_files_completion_list): Use
	map_partial_symbol_filenames.
	(expand_line_sal): Use expand_symtabs_with_filename method.
	* symmisc.c: Include psymtab.h.
	(print_objfile_statistics): Use print_stats method.
	(dump_objfile): Use dump method.
	(dump_psymtab, maintenance_print_psymbols)
	(maintenance_info_psymtabs, maintenance_check_symtabs)
	(extend_psymbol_list): Remove.
	* symfile.h (struct quick_symbol_functions): New struct.
	(struct sym_fns) <qf>: New field.
	(sort_pst_symbols): Remove.
	(increment_reading_symtab): Declare.
	* symfile.c: Include psymtab.h.
	(compare_psymbols, sort_pst_symbols): Remove.
	(psymtab_to_symtab): Remove.
	(increment_reading_symtab): New function.
	(symbol_file_add_with_addrs_or_offsets): Use expand_all_symtabs
	method.
	(set_initial_language): Use find_main_filename.
	(allocate_psymtab, discard_psymtab, cashier_psymtab): Remove.
	(free_named_symtabs): Remove unused code.
	(start_psymtab_common, add_psymbol_to_bcache)
	(append_psymbol_to_list, add_psymbol_to_list, init_psymbol_list):
	Remove.
	* stack.c: Include psymtab.h, symfile.h.
	(backtrace_command_1): Use find_pc_sect_symtab_via_partial.
	* source.h (psymtab_to_fullname): Don't declare.
	* source.c: Include psymtab.h.
	(select_source_symtab): Use find_last_source_symtab method.
	(forget_cached_source_info): Use forget_cached_source_info
	method.
	(find_and_open_source): No longer static.
	(psymtab_to_fullname): Remove.
	* somread.c: Include psymtab.h.
	(som_sym_fns): Update.
	* psympriv.h: New file.
	* psymtab.h: New file.
	* psymtab.c: New file.
	* objfiles.h: (ALL_OBJFILE_PSYMTABS): Remove.
	(ALL_PSYMTABS, ALL_PSPACE_PSYMTABS): Likewise.
	* objfiles.c: Include psymtab.h.
	(objfile_relocate1): Use relocate method.
	(objfile_has_partial_symbols): Use has_symbols method.
	* mipsread.c: Include psymtab.h.
	(ecoff_sym_fns): Update.
	* mi/mi-cmd-file.c: Include psymtab.h.
	(print_partial_file_name): New function.
	(mi_cmd_file_list_exec_source_files): Use
	map_partial_symbol_filenames.
	* mdebugread.c: Include psympriv.h.
	* machoread.c: Include psympriv.h.
	(macho_sym_fns): Update.
	* m2-exp.y (yylex): Use lookup_symtab.
	* elfread.c: Include psympriv.h.
	(elf_sym_fns): Update.
	* dwarf2read.c: Include psympriv.h.
	* dbxread.c: Include psympriv.h.
	(aout_sym_fns): Update.
	* cp-support.c: Include psymtab.h.
	(read_in_psymtabs): Remove.
	(make_symbol_overload_list_qualified): Use
	expand_symtabs_for_function method.
	* coffread.c: Include psympriv.h.
	(coff_sym_fns): Update.
	* blockframe.c: Include psymtab.h.
	(find_pc_partial_function): Use find_pc_sect_symtab method.
	* ada-lang.h (ada_update_initial_language): Update.
	* ada-lang.c: Include psymtab.h.
	(ada_update_initial_language): Remove 'main_pst' argument.
	(ada_lookup_partial_symbol): Remove.
	(struct ada_psym_data): New type.
	(ada_add_psyms): New function.
	(ada_add_non_local_symbols): Use map_ada_symtabs method.
	(struct add_partial_datum): New type.
	(ada_add_partial_symbol_completions): New function.
	(ada_make_symbol_completion_list): Use map_partial_symbol_names.
	(ada_exception_support_info_sniffer): Update.
	* Makefile.in (SFILES): Add psymtab.c.
	(COMMON_OBS): Add psymtab.o.
	(HFILES_NO_SRCDIR): Add psymtab.h, psympriv.h.
gdb/doc
	* gdbint.texinfo (Symbol Handling): Update.
2010-03-10 18:20:08 +00:00
Pierre Muller 7d8500b756 2010-03-10 Pierre Muller <muller@ics.u-strasbg.fr>
* remote-fileio.c (cygwin_conv_path): Define macro for old cygwin API.
2010-03-10 16:39:20 +00:00
Sami Wagiaalla c0cc3a7670 2010-03-09 Sami Wagiaalla <swagiaal@redhat.com>
PR C++/11236:
	* cp-namespace.c (cp_add_using): Deleted.
	(cp_add_using_directive): Use obstack allocations.
	Merged the function cp_add_using into this one.
	Added 'struct obstack *' argument.
	(cp_scan_for_anonymous_namespaces): Updated.
	* cp-support.h: Updated.
	* dwarf2read.c (read_import_statement): Updated.
	(read_namespace): Updated.
2010-03-10 16:22:29 +00:00
Christopher Faylor 452fa0647c * windows-nat.c (cygwin_conv_path): Remove old macro. 2010-03-10 15:57:07 +00:00
Pedro Alves 60e1c644b7 gdb/
* breakpoint.c (condition_command): Handle watchpoint conditions.
	(is_hardware_watchpoint): Add comment.
	(is_watchpoint): New.
	(update_watchpoint): Don't reparse the watchpoint's condition
	unless necessary.
	(WP_IGNORE): New.
	(watchpoint_check): Use it.
	(bpstat_check_watchpoint): Handle it.
	(bpstat_check_breakpoint_conditions): Evaluate watchpoint local
	conditions in a frame where it makes sense.
	(watch_command_1): Store the innermost block of the condition
	expression.
	(delete_breakpoint): Delete the watchpoint condition expression.
	* breakpoint.h (struct bp_location) <cond>: Update comment.
	(struct breakpoint): New fields `cond_exp' and
	`cond_exp_valid_block'.

	gdb/testsuite/
	* gdb.base/watch-cond.c, gdb.base/watch-cond.exp: New.
2010-03-10 13:25:40 +00:00
Joel Brobecker af6b7be16a Adjust handling of Ada DIEs after dwarf2_physname patch.
* dwarf2read.c (dwarf2_compute_name): Add handling of Ada DIEs.
2010-03-10 08:08:46 +00:00
gdbadmin 68221cbf73 *** empty log message *** 2010-03-10 00:00:04 +00:00
Christopher Faylor 60c5c0213a * windows-nat.c (cygwin_conv_path): Redefine to properly convert from/to
posix/win32.
(windows_make_so): Use non-Cygwin 1.7 specific function.
(windows_create_inferior): Make sure that cygallargs points to original args in
non Cygwin 1.7.  case.
2010-03-09 19:10:39 +00:00
Michael Snyder 60a1502afc 2010-03-09 Michael Snyder <msnyder@vmware.com>
* i386-tdep.c (i386_record_lea_modrm_addr): Use extract_signed_int
	after target_read_memory to get host byte order.
	(i386_process_record): Ditto.
2010-03-09 18:25:41 +00:00
Keith Seitz 94af9270db dwarf2_physname patchset:
Based on work from Daniel Jacobowitz  <dan@codesourcery.com>
	* c-typeprint.c (cp_type_print_method_args): For non-static methods,
	print out const or volatile qualifiers, too.
	(c_type_print_args): Add parameters show_artificial and language.
	Skip artificial parameters when requested.
	Use the appropriate language printer.
	(c_type_print_varspec): Tell c_type_print_args to skip artificial
	parameters and pass language_c.
	* dwarf2read.c (die_list): New file global.
	(struct partial_die_info): Update comments for name field.
	(pdi_needs_namespace): Renamed to ...
	(die_needs_namespace): ... this. Rewrite.
	(dwarf2_linkage_name): Remove.
	(add_partial_symbol): Do not predicate the call to
	partial_die_full_name based on pdi_needs_namespace.
	Remove call to cp_check_possible_namespace_symbols and associated
	outdated comments.
	(guess_structure_name): Do not inspect child subprogram DIEs.
	(dwarf2_fullname): Update comments.
	Use die_needs_namespace to assist in computing the name.
	(read_func_scope): Use dwarf2_name to get the DIE's name.
	Use dwarf2_physname to get the "linkage name" of the DIE.
	(dwarf2_add_member_field): Use dwarf2_physname instead of
	dwarf2_linkage_name.
	(read_structure_type): For structs and classes, set TYPE_NAME, too.
	(determine_class): Remove.
	(read_partial_die): Ignore DW_AT_MIPS_linkage_name for all languages
	except Ada.
	(new_symbol): Unconditionally call dwarf2_name.
	Compute the "linkage name" using dwarf2_physname.
	Use dwarf2_name instead of dwarf2_full_name for enumerator DIEs.
	When determining to scan for anonymous C++ namespaces, ignore
	the linkage name.
	(dwarf2_physname): New function.
	(dwarf2_full_name): Move content to new function and call
	that.
	(dwarf2_compute_name): "New" function.
	(_initialize_dwarf2_read): Initialize die_list.
	* gnu-v3-eabi.c (gnu_v3_find_method_in): Remove unused variable
	physname.
	(gnu_v3_print_method_ptr): Use the physname for virtual methods
	without a demangled name.
	Print out type information for non-virtual methods.
        * linespec.c (decode_line_1): Force ANY string using "::" (or
	"." for java) to use decode_compound, and clean up any stray quoting.
        If we found a file symtab, re-evaluate whether the remainder is_quoted.
        (decode_compound): Stop consuming at an open parenthesis.
        Keep template parameters.
        Keep any overload information.
        Keep keywords like "const".
        Remove paren_pointer.
        Move is_quoted check from set_flags to here.
        Remove #if 0 code from 2000. Ten years is long enough.
        (find_method): Before comparing symbol names, canonicalize the string
        from the user.
        If a specific overload is requested, find it. Otherwise throw an error.
	(find_method_overload_end): New function.
	(set_flags): Remove.
        (decode_compound): Assume that parentheses are matched.
        It's a lot easier.
	* symtab.c (symbol_find_demangled_name): Add DMGL_VERBOSE flag
	to cplus_demangle.
	* linespec.c (decode_line_1): Keep important keywords like
	"const" and "volatile".
	* symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME): Remove.
	* typeprint.h (c_type_print_args): Add declaration.
	* ui-file.c (do_ui_file_obsavestring): New function.
	(ui_file_obsavestring): New function.
	* ui-file.h (ui_file_obsavestring): Add declaration.
	* valops.c (find_overload_match): Resolve the object to
	a non-pointer type.
	If the object is a data member, search the object for the member
	and return with staticp set.
	Use SYMBOL_NATURAL_NAME instead of SYMBOL_CPLUS_DEMANGLED_NAME.
	Do not attempt to extract a function name from non-function types.
	If the extracted function name and the original name are the same,
	we don't have a C++ method.

	From Jan Kratochvil  <jan.kratochvil@redhat.com>:
    	* dwarf2read.c (new_symbol <DW_TAG_enumerator>): Call dwarf2_full_name.

	* ada-lang.c (ada_lookup_symbol): Remove linkage_name parameters
	and arguments from symbol lookups.
	* ax-gdb.c (gen_expr): Likewise.
	* cp-namespace.c (cp_lookup_symbol_nonlocal, lookup_namespace_scope,
	cp_lookup_symbol_namespace, lookup_symbol_file, lookup_nested_type,
	lookup_possible_namespace_symbol): Likewise.
	* cp-support.c (read_in_psymtabs): Likewise.
	* cp-support.h (cp_lookup_symbol_nonlocal): Likewise.
	* language.h (la_lookup_symbol_nonlocal): Likewise.
	* scm-valprint.c (scm_inferior_print): Likewise.
	* solib-darwin.c (darwin_relocate_section_addresses): Likewise.
	* solib-svr.c (elf_lookup_lib): Likewise.
	* solib.c (show_auto_solib_add): Likewise.
	* solist.h (lookup_lib_global, solib_global_lookup): Likewise.
	* symmisc.c (maintenance_check_symtabs): Likewise.
	* symtab.c (lookup_symbol_in_language, lookup_symbol_aux,
	lookup_symbol_aux_local, lookup_symbol_aux_block,
	lookup_symbol_from_objfile, lookup_symbol_aux_symtabs,
	lookup_symbol_aux_psymtabs,basic_lookup_symbol_nonlocal,
	lookup_symbol_static, lookup_symbol_global, symbol_matches_domain,
	basic_lookup_transparent_type, find_main_psymtab,
	lookup_block_symbol): Likewise.
	* symtab.h (basic_lookp_symbol_nonlocal, lookup_symbol_static,
	lookup_symbol_global, lookup_symbol_aux_block,
	lookup_symbol_partial_symbol, lookup_block_symbol,
	lookup_global_symbol, value_maybe_namespace_elt): Likewise.
2010-03-09 18:09:08 +00:00
Keith Seitz cec808ecec * gdb.cp/cp-relocate.exp: Remove single-quoting of C++ methods.
* gdb.cp/cplusfuncs.cc (dm_type_short): New function.
        (dm_type_long): New function.
        (dm_type_unsigned_short): New function.
        (dm_type_unsigned_long): New function.
        (myint): New typedef.
        * gdb.cp/cplusfuncs.exp (probe_demangler): Add tests for short,
        long, unsigned shor and long, operator char*, and typedef.
        (test_lookup_operator_functions): Add operator char* test.
        (test_paddr_operator_functions): Likewise.
        (test_paddr_overloaded_functions): Use probe values for
        short, long, and unsigned short and long.
        (test_paddr_hairy_functions): If the demangler probe detected
        gdb type printers, "expect" them. Otherwise "expect" the v2 or v3
        demangler.
        * gdb.cp/expand-sals.exp: Backtrace may contain class names.
        * gdb.cp/member-ptr.exp: Refine expected result for "print pmf"
        and "print null_pmf".
        Add test "ptype a.*pmf".
        * gdb.cp/overload.exp: Allow optional "int" to appear with
        "short" and "long".
        * gdb.cp/ovldbreak.exp: Use append to construct super-duper
        long expect value for men_overload1arg.
        Allow "int" to appear with "short" and "long".
        When testing "info break", add argument for main (void).
        Also allow "int" to appear with "short" and "long".
        Ditto with "unsigned" and "long long".
	* gdb.java/jmain.exp: Do not enclose methods names in single
	quotes.
	* gdb.java/jmisc.exp: Likewise.
	* gdb.java/jprint.exp: Likewise.
	* gdb.python/py-symbol.exp: Update expected "linkage_name" value.

	From Jan Kratochvil  <jan.kratochvil@redhat.com>:
	* gdb.cp/exception.exp (backtrace after first throw)
	(backtrace after second throw): Allow a namespace before __cxa_throw.
	(backtrace after first catch, backtrace after second catch): Allow
	a namespace before __cxa_begin_catch.

	* gdb.cp/cpexprs.exp: New file.
	* gdb.cp/cpexprs.cc: New file.

	From Daniel Jacobowitz  <dan@codesourcery.com>
	* gdb.cp/cpexprs.exp (escape): Delete.  Change all callers
	to use string_to_regexp.
	(ctor, dtor): New functions.  Use them to match constructor
	and destructor function types.
	(Top level): Use runto_main.
2010-03-09 18:08:05 +00:00
Pierre Muller 9cb74f47a1 * python/python-internal.h: Include symtab.h. 2010-03-09 17:12:40 +00:00
Pierre Muller e13eedd538 * p-lang.c (is_pascal_string_type): Remove unneeded parentheses.
* p-valprint.c (pascal_val_print): Remove undeed block and fix
	indentation.
2010-03-09 08:30:54 +00:00
gdbadmin 840a467a0a *** empty log message *** 2010-03-09 00:00:33 +00:00
Tom Tromey bad5601415 * breakpoint.c (breakpoint_1): Add "QUIT". 2010-03-08 20:21:48 +00:00
Pedro Alves 081058572d * solib.c (solib_find): Replace extension if
solib_symbols_extension is set in the target gdbarch.
	* arm-symbian-tdep.c (arm_symbian_init_abi): Set
	solib_symbols_extension to "sym".
	* gdbarch.sh (solib_symbols_extension): New variable.
	(pstring): New function.
	* gdbarch.h, gdbarch.c: Regenerate.
2010-03-08 19:28:27 +00:00
Tom Tromey 7c95393435 gdb
PR cli/9591:
	* NEWS: Update.
	* utils.c: Include main.h.
	(fputs_maybe_filtered): Don't paginate if `batch_flag'.
	(defaulted_query): Use default answer if `batch_flag'.
	* main.h (batch_flag): Declare.
	* main.c (batch_flag): New global.
	(captured_main): Remove 'batch'.  Update.
gdb/doc
	PR cli/9591:
	* gdb.texinfo (Mode Options): Mention lack of pagination and
	confirmation with --batch.
	(Screen Size): Mention --batch.
	(Messages/Warnings): Likewise.
2010-03-08 19:20:38 +00:00
Pierre Muller 9c8ee2ab75 * Fix commit year 2010-03-08 19:17:54 +00:00
Kevin Buettner bbd2783ec0 * remote-mips.c (rockhopper_ops): New target_ops struct.
(MON_ROCKHOPPER): New mips_monitor_type.
	(read_hex_value): New function.
	(mips_request): Send 8-byte values with a 'T' packet.  Read the
	packet argument as a string and use read_hex_value to parse it.
	(mips_exit_debug): Wait for response when using MON_ROCKHOPPER.
	(rockhopper_open): New function.
	(mips_wait): Read the PC, FP and SP fields as strings.  Use
	read_hex_value to parse them and mips_set_register to commit them.
	(mips_set_register): New function.
	(mips_fetch_registers): Do not cast register value to "unsigned"
	when reading a MON_ROCKHOPPER 't' packet.  Use mips_set_register.
	(mips_store_registers): Use a 'T' packet to set registers when
	using MON_ROCKHOPPER.
	(pmon_end_download): Don't run initEther if using MON_ROCKHOPPER
	and expect the total to be printed before the entry address.
	(_initialize_remote_mips): Initialize and add rockhopper_ops.
2010-03-08 19:06:34 +00:00
Kevin Buettner 566f3d1734 * remote-mips.c (mips_fetch_word): Add new parameter, `valp'.
Change return value to int.  Store value fetched in location
	addressed by `val'.  Use function's return value as success
	or failure indicator.  Adjust all callers.
2010-03-08 18:41:00 +00:00
Kevin Buettner 8cfa2c71e3 * remote-mips.c (mips_fetch_word): Add new parameter, `valp'.
Change return value to int.  Store value fetched in location
	addressed by `val'.  Use function's return value as success
	or failure indicator.  Adjust all callers.
2010-03-08 18:22:06 +00:00
Pierre Muller f72d4b774a * p-lang.c (is_pascal_string_type): Check that TYPE arg is non NULL. 2010-03-08 16:55:17 +00:00
Hui Zhu 7155de5a7e 2010-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
Hui Zhu  <teawater@gmail.com>

	* record.c (record_open_1): Check tmp_to_stopped_by_watchpoint and
	tmp_to_stopped_data_address.
	(record_open): Reset tmp_to_stopped_by_watchpoint and
	tmp_to_stopped_data_address.
	* target.c (init_dummy_target): Add to_stopped_by_watchpoint and
	to_stopped_data_address.
2010-03-08 13:34:38 +00:00
Hui Zhu 580879fcfc 2010-03-08 Hui Zhu <teawater@gmail.com>
* i386-tdep.c (i386_process_record): Initialize regnum.
2010-03-08 12:57:11 +00:00
Jan Kratochvil b0fcb67f7d gdb/
* symfile.c (addr_info_make_relative): New variable sect_name, use it.
	Do not warn on ".gnu.liblist" and ".gnu.conflict".
2010-03-08 08:32:49 +00:00
Joel Brobecker 08597104eb Memory error when reading wrong core file.
* solib-svr4.c (solib_svr4_r_map): catch and print all exception
        errors while reading the inferior memory, and return zero if
        an exception was raised.
2010-03-08 07:45:49 +00:00
Michael Snyder ec6dbf3703 2010-03-07 Michael Snyder <msnyder@vmware.com>
* record.c (record_restore): Rename tmpu8 to rectype.
2010-03-08 01:49:35 +00:00
Michael Snyder 648d0c8bb0 2010-03-07 Michael Snyder <msnyder@vmware.com>
* i386-tdep.c (i386_record_lea_modrm_addr): Rename local variables
	tmpu8, tmpi16, tmpi32, tmpulongest to addr8, addr16, addr32, addr64.

	(i386_record_push): Rename local tmpulongest to addr.

	(i386_process_record): Rename local tmpulongest to addr.
2010-03-08 01:36:56 +00:00
Michael Snyder 955db0c0a4 2010-03-07 Michael Snyder <msnyder@vmware.com>
* i386-tdep.c (i386_process_record): Rename local variables
	tmpu16, tmpu32, tmpu64 to addr16, addr32, addr64.
2010-03-08 00:53:13 +00:00
Michael Snyder 425b824a1e 2010-03-07 Michael Snyder <msnyder@vmware.com>
* i386-tdep.c (i386_process_record): Rename tmpu8 to opcode8 and
	regnum.
2010-03-08 00:31:28 +00:00
gdbadmin 6a21634824 *** empty log message *** 2010-03-08 00:00:32 +00:00
Joel Brobecker 10760264fe Assertion failure after Ada task switch (target remote).
* remote.c (remote_get_ada_task_ptid): New function.
        (init_remote_ops): Set remote_ops.to_get_ada_task_ptid.
2010-03-07 14:36:45 +00:00
gdbadmin aeadae152e *** empty log message *** 2010-03-07 00:00:03 +00:00
Christopher Faylor b3c613f28f * windows-nat.c: Reorganize #ifdef __CYGWIN__ considerations into one block.
Define helper macros to reduce ifdefs in code.
(get_module_name): Use cygwin_buf_t for buffer and __PMAX for buffer size.
Call unadorned GetModuleFileNameEx rather than GetModuleFileNameEx*.
(windows_make_so): Use __PMAX to denote maximum buffer size and cygwin_buf_t
for buffer type.  Use GetSystemDirectory{W,A} as appropriate.
(get_image_name): Use __PMAX to denote maximum buffer size.
(handle_load_dll): Likewise.
(windows_pid_to_exec_file): Likewise.
(windows_create_inferior): Add many accommodations for older Cygwin and
non-Cygwin.
(bad_GetModuleFileNameExW): Control inclusion of this function based on
__USEWIDE conditional.
(bad_GetModuleFileNameExA): Likewise.
(_initialize_loadable): Just use real function names without the dyn_ part
since they are defined earlier.
2010-03-06 19:27:09 +00:00
Pedro Alves bce522a260 2010-03-06 Simo Melenius <simo.melenius@iki.fi>
* linux-low.c (linux_wait_for_lwp): Fetch the regcache after
	switching the current inferior, not before.
2010-03-06 00:11:42 +00:00
gdbadmin f9b023f2f6 *** empty log message *** 2010-03-06 00:00:03 +00:00
Tom Tromey f870a310ee gdb
2010-03-05  Corinna Vinschen  <vinschen@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* utils.c (host_char_to_target): Add 'gdbarch' argument.
	(parse_escape): Likewise.
	* python/py-utils.c (unicode_to_target_string): Update.
	(unicode_to_target_python_string): Update.
	(target_string_to_unicode): Update.
	* printcmd.c (printf_command): Update.
	* p-exp.y (yylex): Update.
	* objc-exp.y (yylex): Update.
	* mi/mi-parse.c: Include charset.h.
	(mi_parse_escape): New function.
	(mi_parse_argv): Use it.
	* jv-exp.y (yylex): Update.
	* i386-cygwin-tdep.c (i386_cygwin_auto_wide_charset): New
	function.
	(i386_cygwin_init_abi): Call set_gdbarch_auto_wide_charset.
	* gdbarch.sh (auto_charset, auto_wide_charset): New.
	* gdbarch.c: Rebuild.
	* gdbarch.h: Rebuild.
	* defs.h (parse_escape): Update.
	* cli/cli-setshow.c: Include arch-utils.h.
	(do_setshow_command): Update.
	* cli/cli-cmds.c (echo_command): Update.
	* charset.h (target_charset, target_wide_charset): Update.
	* charset.c: Include arch-utils.h.
	(target_charset_name): Default to "auto".
	(target_wide_charset_name): Likewise.
	(show_target_charset_name): Handle "auto".
	(show_target_wide_charset_name): Likewise.
	(be_le_arch): New global.
	(set_be_le_names): Add 'gdbarch' argument.
	(validate): Likewise.  Don't call set_be_le_names.
	(set_charset_sfunc, set_host_charset_sfunc)
	(set_target_charset_sfunc, set_target_wide_charset_sfunc):
	Update.
	(target_charset): Add 'gdbarch' argument.
	(target_wide_charset): Likewise.  Remove 'byte_order' argument.
	(auto_target_charset_name): New global.
	(default_auto_charset, default_auto_wide_charset): New functions.
	(_initialize_charset): Set auto_target_charset_name.  Allow "auto"
	for target charsets.  Copy result of nl_langinfo.  Use GetACP if
	USE_WIN32API.
	* c-lang.c (charset_for_string_type): Add 'gdbarch' argument,
	remove 'byte_order' argument.  Update.
	(classify_type): Likewise.
	(c_emit_char): Update.
	(c_printchar): Update.
	(c_printstr): Update.
	(c_get_string): Update.
	(evaluate_subexp_c): Update.
	* arch-utils.h (default_auto_charset, default_auto_wide_charset):
	Declare.
	* python/python.c (gdbpy_target_charset): New function.
	(gdbpy_target_wide_charset): Likewise.
	(GdbMethods): Update.
	* NEWS: Update.
gdb/doc
	* gdb.texinfo (Basic Python): Document target_charset and
	target_wide_charset.
gdb/testsuite
	* gdb.python/py-prettyprint.py (pp_nullstr.to_string): Use
	gdb.target_charset.
	(pp_ns.to_string): Likewise.
2010-03-05 20:18:19 +00:00
Tom Tromey 78e2826bcc * gdb.texinfo (Data): Link to pretty-printing.
(Output Formats): Likewise.  Correct text.
2010-03-05 20:01:21 +00:00
Ulrich Weigand 4e7386b0c7 * symfile.c (build_section_addr_info_from_objfile): Do not mask
off high address bits.
2010-03-05 19:32:44 +00:00
Ulrich Weigand aab48ede09 * python/py-lazy-string.c (gdbpy_extract_lazy_string): Extract
address as UnsignedLongLong, not LongLong.
2010-03-05 19:28:13 +00:00
Kevin Buettner 8eeafb51ab * remote-mips.c (gdbthread.h): Include.
(remote_mips_ptid): Declare.
	(mips_error): Only mourn the inferior when inferior_ptid is non-null.
	(common_open): Set inferior_ptid, add it as an inferior, and
	as a thread too.  Delete FIXME comment regarding start_remote().
	(mips_close): Invoke generic_mourn_inferior().
	(mips_kill): Make sure that target_mourn_inferior is invoked.
	(mips_mourn_inferior): Don't invoke generic_mourn_inferior, as
	it's now invoked from mips_close().
	(mips_load): Don't null out inferior_ptid.  Don't call
	clear_symtab_users().
	(mips_thread_alive, mips_pid_to_str): New functions.
	(_initialize_remote_mips): Initialize remote_mips_ptid.  Initialize
	to_thread_alive and to_pid_to_str operations.
2010-03-05 16:18:54 +00:00
gdbadmin 4170a0931d *** empty log message *** 2010-03-05 00:00:03 +00:00
Tom Tromey ae41149729 * dwarf2read.c (skip_one_die) <DW_FORM_ref_addr>: Use offset size
in DWARF 3 and later.
	(read_attribute_value) <DW_FORM_ref_addr>: Likewise.
2010-03-04 22:01:10 +00:00
Doug Evans 111f853cd1 * arm-tdep.c (arm_make_stub_cache): Delete unused locals reg,
unwound_fp.
2010-03-04 19:00:19 +00:00
Keith Seitz 0e0b460e6a * linespec.c (decode_line_1): Update comments for is_quote_enclosed.
If the filename portion of the linespec was quoted, recheck the
	remainder for additional quoting.
	(locate_first_half): Skip over completer chars, too.
2010-03-04 18:38:35 +00:00
Keith Seitz 0c199f28ac * gdb.cp/overload.exp: Test that the filename portion of a linespec
can be quoted.  Test that both the filename and function/line
	portions can be quoted at the same time.
2010-03-04 18:38:17 +00:00
Tom Tromey 1b93ff13d3 * printcmd.c (printf_command): Pass dummy argument to
printf_filtered.
2010-03-04 18:21:40 +00:00
Doug Evans fc36e83962 * arm-tdep.c (arm_stub_unwind_sniffer): Add comment. 2010-03-04 16:39:57 +00:00
Pedro Alves c7437ca6e4 gdb/
* breakpoint.c (update_watchpoint): Create a sentinel location if
	the software watchpoint isn't watching any memory.
	(breakpoint_address_bits): Skip dummy software watchpoint locations.

	gdb/testsuite/
	* gdb.base/watch-non-mem.c, gdb.base/watch-non-mem.exp: New.
2010-03-04 15:37:26 +00:00