Commit Graph

28961 Commits

Author SHA1 Message Date
Paul Koning 5af65ec072 * python/py-cmd.c (gdbpy_string_to_argv): Decrement reference
count of item appended to list.
* python/py-type.c (typy_fields): Likewise.
2011-09-15 18:33:15 +00:00
Paul Koning 883640a804 Fix ChangeLog typo 2011-09-15 17:20:56 +00:00
Paul Koning d812018b48 * gdb.texinfo: Make style of Python functions and methods match
the syntax of Python.  Also put class and module names explicitly
on function, member, and variable names, matching Python
documentation conventions.
2011-09-15 16:09:42 +00:00
Joel Brobecker d93db82c58 Add period at end of sentence in top entry. 2011-09-15 15:49:53 +00:00
Paul Koning 72be8ccc5e MAINTAINERS (Right After Approval): Add myself to the list 2011-09-15 15:40:22 +00:00
Kevin Pouget 92f6badcc0 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR threads/12628
	* linux-fork.c (checkpoint_command): Disallow checkpointing of
	processes with multiple threads.
	(inf_has_multiple_thread_cb): New function.
	(inf_has_multiple_threads): New function.
2011-09-15 12:47:07 +00:00
Kevin Pouget 2aa483373c 2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR Python/12692 Add gdb.selected_inferior() to Python interface.
	* python/py-inferior.c (GdbMethods): New Python method definition.

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

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

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

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

	PR gdb/13175

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

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

	PR gdb/13175

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

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

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

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