Commit Graph

4441 Commits

Author SHA1 Message Date
Tom Tromey 9addecb9fb PR c++/13653:
* thread.c (struct current_thread_cleanup) <was_removable>: New
	field.
	(do_restore_current_thread_cleanup): Restore 'removable' field.
	(restore_current_thread_cleanup_dtor): Likewise.
	(make_cleanup_restore_current_thread): Initialize new field.
testsuite/gdb
	* gdb.base/inferior-died.c: New file.
	* gdb.base/inferior-died.exp: New file.
2012-02-16 14:35:00 +00:00
Aleksandar Ristovski 4cb6da1cdd * frame.c (find_frame_sal): Initialize sal->pspace field from frame
data.
	* stack.c (set_last_displayed_sal): Validate that PSPACE is not NULL.

testuite:
	* gdb.base/break-inline.exp: New file.
	* gdb.base/break-inline.c: New file.
2012-02-15 19:27:59 +00:00
Tom Tromey 3af2590d3e PR gdb/12659:
* infcmd.c (registers_info): Print just the current register's
	name.
gdb/testsuite
	* gdb.base/pc-fp.exp: Add "info register" tests.
2012-02-15 19:13:14 +00:00
Tom Tromey 29988831db * gdb.base/regs.exp: Remove. 2012-02-15 18:49:27 +00:00
Pedro Alves 10010058f2 2012-02-15 Pedro Alves <palves@redhat.com>
* gdb.trace/backtrace.exp: Issue UNSUPPORTED instead of PASS when
	the target doesn't support tracepoints.
	* gdb.trace/circ.exp: Ditto.
	* gdb.trace/collection.exp: Ditto.
	* gdb.trace/packetlen.exp: Ditto.
	* gdb.trace/passc-dyn.exp: Ditto.
	* gdb.trace/report.exp: Ditto.
	* gdb.trace/tfind.exp: Ditto.
	* gdb.trace/tspeed.exp: Ditto.
	* gdb.trace/tsv.exp: Ditto.
	* gdb.trace/unavailable.exp: Ditto.
	* gdb.trace/while-dyn.exp: Ditto.
2012-02-15 18:09:20 +00:00
Pedro Alves a2e0062d4b 2012-02-15 Pedro Alves <palves@redhat.com>
* gdb.trace/circ.exp (trace_buffer_normal): Rewrite using
	gdb_test_multiple, and call unsupported instead of fail, if the
	remote side does not support the request.
2012-02-15 17:20:07 +00:00
Pedro Alves a1999d4022 2012-02-15 Pedro Alves <palves@redhat.com>
* gdb.server/ext-attach.exp: Make sure gdb is disconnected.
	* gdb.server/ext-run.exp: Make sure gdb is disconnected.
	* gdb.server/file-transfer.exp: Make sure gdb is disconnected.
	* gdb.server/server-mon.exp: Make sure gdb is disconnected.
	* gdb.server/server-run.exp: Make sure gdb is disconnected.
	* lib/gdbserver-support.exp (gdbserver_start_extended): Only
	prepend "extended-" to $gdbserver_protocol if $gdbserver_protocol
	doesn't start with "extended-" already.
2012-02-15 12:51:17 +00:00
Pedro Alves 7cee1e5405 gdb/
2012-02-15  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_detach_1, extended_remote_attach_1): Tweak
	output to be like native targets'.
	(remote_pid_to_str): Special case the null ptid.

gdb/testsuite/
2012-02-15  Pedro Alves  <palves@redhat.com>

	Support extended-remote.  Avoid cascading timeouts.

	* gdb.base/attach.exp (do_attach_tests): Add expected output for
	the extended-remote target.  If attaching with no file fails, load
	the file manually.
	* gdb.server/ext-attach.exp: Adjust expected attach/detach output.
2012-02-15 12:48:55 +00:00
Stan Shebs 816338b563 2012-02-14 Stan Shebs <stan@codesourcery.com>
* NEWS: Mention enable count command.
	* breakpoint.h (struct breakpoint): New field enable_count.
	* breakpoint.c (enable_breakpoint_disp): Add count argument.
	(enable_breakpoint): Add arg to call.
	(struct disp_data): New struct.
	(do_enable_breakpoint_disp): Interp arg as disp_data and unpack.
	(do_map_enable_once_breakpoint): Create a struct and pass it.
	(do_map_enable_delete_breakpoint): Ditto.
	(do_map_enable_count_breakpoint): New function.
	(enable_count_command): New function.
	(bpstat_stop_status): Decrement enable_count.
	(print_one_breakpoint_location): Report enable count.
	(_initialize_breakpoint): Add enable count command.

	* gdb.texinfo (Disabling Breakpoints): Document enable count.

	* gdb.base/ena-dis-br.exp: Add enable count test.
2012-02-14 23:28:15 +00:00
Pedro Alves cc30c4bd19 gdb/doc/
2012-02-13  Pedro Alves  <palves@redhat.com>

	* gdb.texinfo (MIPS boards): Refer to mips-elf instead of
	mips-idt-ecoff.

gdb/testsuite/
2012-02-13  Pedro Alves  <palves@redhat.com>

	* config/mips-idt.exp: Delete.
	* gdb.base/a2-run.exp: Remove mips-idt xfails.
	* gdb.base/bitfields.exp: Remove mips-idt restarts.
	* gdb.base/break.exp: Remove mips-idt references.
	* gdb.base/chng-syms.exp: Ditto.
	* gdb.base/default.exp: Ditto.
	* gdb.base/funcargs.exp (funcargs_reload): Delete.
	(top level): Don't call it.
	* gdb.base/opaque.exp: Remove mips-idt restarts.
	* gdb.base/ptype.exp: Remove mips-idt xfails.
	* gdb.base/scope.exp: Remove mips-idt restarts.
	* gdb.base/sepdebug.exp: Remove mips-idt references.
	* gdb.base/watchpoint.exp (maybe_clean_restart)
	(maybe_reinitialize): Delete.
	(test_disabling_watchpoints, test_disabling_watchpoints)
	(test_watchpoint_triggered_in_syscall)
	(test_watchpoint_and_breakpoint, test_inaccessible_watchpoint):
	Don't call them.
2012-02-13 18:09:59 +00:00
Jan Kratochvil 570083757c gdb/
Fix crash on loaded shlibs without loaded exec_bfd.
	* exec.c (exec_files_info): Do not crash on NULL EXEC_BFD.
	(set_section_command): Replace exec_bfd by p->bfd.

gdb/testsuite/
	* gdb.server/server-exec-info.exp: New file.
2012-02-12 19:15:01 +00:00
Pedro Alves 4a2d9c0801 2012-02-10 Pedro Alves <palves@redhat.com>
* gdb.base/break-interp.exp (test_attach_gdb): Assume $file is
	always non-empty.
	(test_attach): Always pass $exec to test_attach_gdb.
2012-02-10 16:06:50 +00:00
Tom Tromey 09fa21bd6f * gdb.python/py-symbol.exp: Use lookup_global_symbol for tests
before inferior is started.
2012-02-08 19:58:25 +00:00
Tom Tromey f0823d2ce8 PR python/12027:
* python/python-internal.h (frame_object_type): Declare.
	* python/py-symbol.c (sympy_needs_frame): New function.
	(sympy_value): New function.
	(symbol_object_getset): Add "needs_frame".
	(symbol_object_methods): Add "value".
	* python/py-frame.c (frame_object_type): No longer static.
gdb/doc
	* gdb.texinfo (Symbols In Python): Document Symbol.needs_frame and
	Symbol.value.
gdb/testsuite
	* gdb.python/py-symbol.exp: Test Symbol.needs_frame and
	Symbol.value.
	* gdb.python/py-symbol.c (qq): Set default value.
2012-02-07 19:47:16 +00:00
Tom Tromey 64e7d9dddc PR python/13599:
* python/py-symbol.c (sympy_line): New function.
	(symbol_object_getset): Add "line".
gdb/doc
	* gdb.texinfo (Symbols In Python): Document Symbol.line.
gdb/testsuite
	* gdb.python/py-symbol.c (qq): New global.
	* gdb.python/py-symbol.exp: Add test for frame-less
	lookup_symbol.
	* gdb.python/py-symtab.exp: Fix line number.
2012-02-07 19:42:27 +00:00
Joel Brobecker f7e44f6574 GDB/MI: crash printing "_task" (Ada) argument
In GDB/MI mode, trying to print the arguments of the frame corresponding
to the body of a task ("-stack-list-arguments 1") causes the debugger to
crash.

This is because the compiler adds an implicit argument to that task body
called "_task". mi/mi-cmd-stack.c:list_args_or_locals, which is
responsible for printing the value of our arguments, finds that our
"_task" symbol is an argument, and thus tries to fing the non-argument
equivalent:

              if (SYMBOL_IS_ARGUMENT (sym))
                sym2 = lookup_symbol (SYMBOL_NATURAL_NAME (sym),
                                      block, VAR_DOMAIN,
                                      (int *) NULL);

Unfortunately, it tries using the natural name, which doesn't always
work for Ada parameters, in particular those who are internally-
generated. In our case, The "_task" parameter's natural name is
"<_task>", and that symbol does not exist.  So sym2 is NULL, thus
causing the crash a little later on when trying to dereference it.
We should be using the symbol linkage name in this case, the same
way iterate_over_block_arg_vars already does.

gdb/ChangeLog:

        * mi/mi-cmd-stack.c (list_args_or_locals): For argument symbols,
        use SYMBOL_LINKAGE_NAME to find the corresponding non-argument
        symbol.  Add assertion that sym2 is never NULL.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_task_arg: New testcase.
2012-02-03 07:32:40 +00:00
Pedro Alves 4c9ed63c1f 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.reverse/until-precsave.exp: Also put "record save" under the
	extended timeout.
2012-02-02 18:10:07 +00:00
Pedro Alves c0b9f2c6e8 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.gdb/complaints.exp: Skip if gdb,noinferiorio is set.
	* gdb.gdb/selftest.exp (test_with_self): Handle gdb,noinferiorio.
2012-02-02 18:09:07 +00:00
Pedro Alves 5f8cefd757 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.base/term.exp: Rewrite.
	* gdb.base/term.c: New.
2012-02-02 18:07:58 +00:00
Pedro Alves 2f3a2569b8 2012-02-02 Pedro Alves <palves@redhat.com>
* gdb.base/default.exp (run "r" abbreviation, run): Add
	extended-remote expected output.
2012-02-02 18:05:35 +00:00
Tom Tromey f149aabd96 PR gdb/9307:
* symtab.c (lookup_language_this): Set block_found.
gdb/testsuite
	* gdb.cp/dispcxx.exp: New file.
	* gdb.cp/dispcxx.cc: New file.
2012-02-02 14:58:33 +00:00
Tom Tromey 03bef283c2 PR gdb/13431:
* jit.c (struct jit_inferior_data): Rewrite.
	(struct jit_objfile_data): New.
	(get_jit_objfile_data): New function.
	(add_objfile_entry): Update.
	(jit_read_descriptor): Return int.  Replace descriptor_addr
	argument with inf_data.  Update.  Don't call error.
	(jit_breakpoint_re_set_internal): Reorder logic.  Update.  Look up
	descriptor here.
	(jit_inferior_init): Don't look up descriptor.  Don't call error.
	(jit_reset_inferior_data_and_breakpoints)
	(jit_inferior_created_observer): Remove.
	(jit_inferior_exit_hook): Update.
	(jit_executable_changed_observer): Remove.
	(jit_event_handler): Update.
	(free_objfile_data): Reset inferior data if needed.
	(_initialize_jit): Update.
gdb/testsuite
	* gdb.base/jit-simple.exp: New file.
	* gdb.base/jit-simple.c: New file.
2012-02-01 20:21:22 +00:00
Yao Qi a79b18b537 gdb/testsuite/
* gdb.base/skip.exp: Make test result unique.
2012-01-31 00:10:58 +00:00
Jan Kratochvil f0d1a53ee3 gdb/testsuite/
* gdb.base/valgrind-db-attach.exp (attach to debugger): Fix
	compatibility with valgrind-3.7.0.
2012-01-30 06:48:08 +00:00
Pedro Alves 4b3c9f41b6 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (no_hw): New global.
	(maybe_clean_restart, maybe_reinitialize): If no_hw is set,
	disable hw watchpoints.
	(test_wide_location_1, test_wide_location_2): If no_hw is set,
	don't expect hw watchpoints.
	(no_hw_watchpoints): Always clean restart.
	(do_tests): New procedure, factored out from the top level.
	(top level): Run tests twice.  Once with hw watchpoints enabled,
	another time with hw watchpoints disabled.
2012-01-27 14:01:23 +00:00
Pedro Alves a13491c8b5 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_no_hw_watchpoints): New, factored
	out from the top level.
	(top level): Call it instead.
2012-01-27 14:00:41 +00:00
Pedro Alves f2c8a05131 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (top level): Re-enable hardware
	watchpoints sooner.
2012-01-27 13:59:57 +00:00
Pedro Alves 654d7a9e20 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (top level): Delete watch ival3.
2012-01-27 13:59:21 +00:00
Pedro Alves 274f47f34a 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): Expect
	"You may have requested too many hardware
	breakpoints/watchpoints".
2012-01-27 13:58:46 +00:00
Pedro Alves e4d63ba2ed 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (maybe_clean_restart)
	(maybe_reinitialize): New.
	(test_disabling_watchpoints): Call maybe_reinitialize.  Don't
	expect "hit N times".
	(test_disabling_watchpoints, test_complex_watchpoint)
	(test_watchpoint_and_breakpoint, test_inaccessible_watchpoint):
	Call maybe_clean_restart.
	(top level): Use clean_restart.  Remove "mips-idt-*"
	reinitialization.
2012-01-27 13:58:11 +00:00
Pedro Alves dbd95dafec 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp: Always run test_complex_watchpoint.
2012-01-27 13:56:56 +00:00
Pedro Alves f3ad2025d7 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp: Clean restart after tests that don't
	require `initialize' anymore.  Remove unnecessary `initialize'
	calls.
2012-01-27 13:55:58 +00:00
Pedro Alves 100aa3aee0 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (wp_set): Delete.
	(initialize, test_simple_watchpoint, top level): Remove dead code.
2012-01-27 13:54:52 +00:00
Pedro Alves c79a8e1135 2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_inaccessible_watchpoint): Fix
	typo.
2012-01-27 13:54:03 +00:00
Pedro Alves 048fe15a05 2012-01-27 Pedro Alves <palves@redhat.com>
* config/extended-gdbserver.exp: New file.
	* lib/gdbserver-support.exp (gdbserver_start_extended): Extend
	comment.
	(gdbserver_start_multi, mi_gdbserver_start_multi): New.
	* boards/native-extended-gdbserver.exp: New file.
2012-01-27 13:02:22 +00:00
Pedro Alves 4033a6bf64 2012-01-26 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp: Replace send_gdb/gdb_expect by gdb_test
	and gdb_test_multiple.
2012-01-26 10:50:59 +00:00
Pedro Alves 3d7f4b8126 2012-01-26 Pedro Alves <palves@redhat.com>
Make test messages unique, and more identifiable.
	* gdb.multi/watchpoint-multi.exp: Change test messages.
2012-01-26 10:09:43 +00:00
Tom Tromey 484abf42a0 * gdb.base/solib-disc.exp: Fix regexps. 2012-01-25 16:20:31 +00:00
Tom Tromey edcc512082 PR symtab/12406:
* solib.c (update_solib_list): Update the program space's
	added_solibs and deleted_solibs fields.
	* progspace.h (struct program_space) <added_solibs,
	deleted_solibs>: New fields.
	(clear_program_space_solib_cache): Declare.
	* progspace.c (release_program_space): Call
	clear_program_space_solib_cache.
	(clear_program_space_solib_cache): New function.
	* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Call
	bpstat_stop_status.  Use handle_solib_event.
	* breakpoint.c: Include gdb_regex.h.
	(print_solib_event): New function.
	(bpstat_print): Use print_solib_event.
	(bpstat_stop_status): Add special case for bp_shlib_event.
	(handle_solib_event): New function.
	(bpstat_what): Use handle_solib_event.
	(struct solib_catchpoint): New.
	(dtor_catch_solib, insert_catch_solib, remove_catch_solib)
	(breakpoint_hit_catch_solib, check_status_catch_solib)
	(print_it_catch_solib, print_one_catch_solib)
	(print_mention_catch_solib, print_recreate_catch_solib): New
	functions.
	(catch_solib_breakpoint_ops): New global.
	(catch_load_or_unload, catch_load_command_1)
	(catch_unload_command_1): New functions.
	(internal_bkpt_check_status): Add special case for
	bp_shlib_event.
	(internal_bkpt_print_it): Use print_solib_event.
	(initialize_breakpoint_ops): Initialize
	catch_solib_breakpoint_ops.
	(_initialize_breakpoint): Register "catch load" and "catch
	unload".
	* breakpoint.h (handle_solib_event): Declare.
	* NEWS: Add entry for "catch load" and "catch unload".
gdb/doc
	* gdb.texinfo (Set Catchpoints): Document "catch load" and "catch
	unload".
	(Files): Mention new catch commands.
	(GDB/MI Async Records): Likewise.
gdb/testsuite
	* lib/mi-support.exp (mi_expect_stop): Add special case for
	solib-event.
	* gdb.base/catch-load-so.c: New file.
	* gdb.base/catch-load.exp: New file.
	* gdb.base/catch-load.c: New file.
	* gdb.base/break-interp.exp (reach_1): Update regexp.
2012-01-24 21:39:18 +00:00
Jan Kratochvil 30b91c9079 gdb/testsuite/
Fix fuzzy results.
	* gdb.mi/var-cmd.c (do_locals_tests): Initialize variables lsimple,
	lpsimple and func.
2012-01-24 20:35:35 +00:00
Gary Benson 53fe178334 ChangeLog:
Delete #if 0'd out code.
	* stack.c (print_frame_label_vars): Remove.
	(catch_info): Likewise.
	(_initialize_stack): Remove "info catch" command.
	* NEWS: Mention the above.

doc/ChangeLog:
	Delete #if 0'd out code.
	* gdb.texinfo (Frame Info): Remove "info catch".

testsuite/ChangeLog:
	Delete #if 0'd out code.
	* gdb.base/default.exp (info catch): Remove.
	* gdb.base/gdb_history (info catch): Likewise.
	* gdb.base/help.exp (info catch): Likewise.
2012-01-24 15:13:30 +00:00
Jan Kratochvil d0d8b0c667 gdb/
Fix watchpoints to be specific for each inferior.
	* breakpoint.c (watchpoint_in_thread_scope): Verify also
	current_program_space.
	* i386-nat.c (i386_inferior_data_cleanup): New.
	(i386_inferior_data_get): Replace variable inf_data_local by an
	inferior_data call.
	(i386_use_watchpoints): Initialize i386_inferior_data.
	* linux-nat.c (linux_nat_iterate_watchpoint_lwps): Use INFERIOR_PTID
	specific iterate_over_lwps.

gdb/testsuite/
	Fix watchpoints to be specific for each inferior.
	* gdb.multi/watchpoint-multi.c: New file.
	* gdb.multi/watchpoint-multi.exp: New file.
2012-01-24 13:49:58 +00:00
Jan Kratochvil 4403d8e9b3 gdb/
Fix watchpoints across inferior fork.
	* amd64-linux-nat.c (update_debug_registers_callback): Update the
	comment for linux_nat_iterate_watchpoint_lwps.
	(amd64_linux_dr_set_control, amd64_linux_dr_set_addr): Use
	linux_nat_iterate_watchpoint_lwps.
	(amd64_linux_prepare_to_resume): New comment on Linux kernel.
	* i386-linux-nat.c (update_debug_registers_callback): Update the
	comment for linux_nat_iterate_watchpoint_lwps.
	(i386_linux_dr_set_control, i386_linux_dr_set_addr): Use
	linux_nat_iterate_watchpoint_lwps.
	(i386_linux_prepare_to_resume): New comment on Linux kernel.
	* i386-nat.c: Include inferior.h.
	(dr_mirror): Remove.
	(i386_inferior_data, struct i386_inferior_data)
	(i386_inferior_data_get): New.
	(i386_debug_reg_state): Use i386_inferior_data_get.
	(i386_cleanup_dregs, i386_update_inferior_debug_regs)
	(i386_insert_watchpoint, i386_remove_watchpoint)
	(i386_stopped_data_address, i386_insert_hw_breakpoint)
	(i386_remove_hw_breakpoint): New variable state, use
	i386_debug_reg_state instead of DR_MIRROR.
	* linux-nat.c (delete_lwp): New declaration.
	(num_lwps): Move here from downwards.
	(delete_lwp_cleanup): New.
	(linux_child_follow_fork): Create new child_lp, call
	linux_nat_new_thread and linux_nat_prepare_to_resume before calling
	PTRACE_DETACH.
	(num_lwps): Move upwards.
	(linux_nat_iterate_watchpoint_lwps): New.
	* linux-nat.h (linux_nat_iterate_watchpoint_lwps_ftype): New.
	(linux_nat_iterate_watchpoint_lwps_ftype): New declaration.

gdb/testsuite/
	Fix watchpoints across inferior fork.
	* gdb.threads/watchpoint-fork-child.c: New file.
	* gdb.threads/watchpoint-fork-mt.c: New file.
	* gdb.threads/watchpoint-fork-parent.c: New file.
	* gdb.threads/watchpoint-fork-st.c: New file.
	* gdb.threads/watchpoint-fork.exp: New file.
	* gdb.threads/watchpoint-fork.h: New file.
2012-01-24 13:46:55 +00:00
Pedro Alves 050a2e1dab gdb/
2012-01-23  Pedro Alves  <palves@redhat.com>

	* top.c (caution): Update comment.
	(execute_command): Don't consider the current value of `caution'.

gdb/testsuite/
2012-01-23  Pedro Alves  <palves@redhat.com>

	* gdb.base/call-signal-resume.exp: Allow output after "return".
2012-01-23 17:11:50 +00:00
Pedro Alves 6a52fb620c 2012-01-20 Pedro Alves <palves@redhat.com>
* gdb.python/py-finish-breakpoint.py: Fix typo.
2012-01-20 20:00:14 +00:00
Ulrich Weigand 145b16a97a ChangeLog:
* defs.h (enum info_proc_what): Moved here from linux-nat.c
	* infcmd.c: (info_proc_cmd_1): New function.
	(info_proc_cmd): New function, moved here from equivalent routine
	orignally in linux-nat.c.
	(info_proc_cmd_mappings): Likewise.
	(info_proc_cmd_stat): Likewise.
	(info_proc_cmd_status): Likewise.
	(info_proc_cmd_cwd): Likewise.
	(info_proc_cmd_cmdline): Likewise.
	(info_proc_cmd_exe): Likewise.
	(info_proc_cmd_all): Likewise.
	(_initialize_infcmd): Install "info proc" command and subcommands.

	* target.h (struct target_ops): Add to_info_proc.
	(target_info_proc): Add prototype.
	* target.c (target_info_proc): New function.

	* procfs.c (procfs_info_proc): Add prototype.
	(info_proc_cmd): Rename into ...
	(procfs_info_proc): ... this.  Update argument types as appropriate
	for a to_info_proc implementation.  Handle "what" argument.
	(procfs_target): Install procfs_info_proc.
	(_initialize_procfs): No longer install "info proc" command.

	* linux-nat.c: (enum info_proc_what): Remove.
	(linux_nat_info_proc_cmd_1): Rename into ...
	(linux_nat_info_proc): ... this.  Update argument types as appropriate
	for a to_info_proc implementation.
	(linux_nat_info_proc_cmd): Remove.
	(linux_nat_info_proc_cmd_mappings): Likewise.
	(linux_nat_info_proc_cmd_stat): Likewise.
	(linux_nat_info_proc_cmd_status): Likewise.
	(linux_nat_info_proc_cmd_cwd): Likewise.
	(linux_nat_info_proc_cmd_cmdline): Likewise.
	(linux_nat_info_proc_cmd_exe): Likewise.
	(linux_nat_info_proc_cmd_all): Likewise.
	(linux_target_install_ops): Install linux_nat_info_proc.
	(_initialize_linux_nat): No longer install "info proc" command
	and subcommands.

testsuite/ChangeLog:

	* gdb.base/info-proc.exp: Also run on remote targets.  Main
	"info proc" command is now always present; whether target supports
	actual info proc operation is detected when attempting to issue
	the command.
2012-01-20 09:49:01 +00:00
Jan Kratochvil 26f6125ebd gdb/testsuite/
* .gdbinit: Remove.
2012-01-19 12:44:01 +00:00
Pedro Alves eb5227ce35 2012-01-19 Pedro Alves <palves@redhat.com>
* gdb.java/jprint.exp: Don't rely on inferior output, but instead
	look at the funtions' returns.
	* gdb.java/jprint.java (jvclass.addprint, jprint.print(int))
	(jprint.print(int, int)): Change return type to int.  Adjust.
2012-01-19 12:37:28 +00:00
Paul Pluzhnikov 1db333787d 2012-01-18 Paul Pluzhnikov <ppluzhnikov@google.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/9538
	* symfile.c (find_separate_debug_file): New function.
	(terminate_after_last_dir_separator): Likewise.
	(find_separate_debug_file_by_debuglink): Also try realpath.
	* configure.ac (AC_CHECK_FUNCS): Add lstat.
	* configure: Regenerate.
	* config.in: Regenerate.

testsuite/ChangeLog:

2012-01-18  Paul Pluzhnikov  <ppluzhnikov@google.com>

	PR gdb/9538
	* gdb.base/sepdebug.exp: New test.
2012-01-18 18:58:43 +00:00
Pedro Alves b9736cf836 2012-01-18 Pedro Alves <palves@redhat.com>
* gdb.ada/mi_task_info.exp (-ada-task-info with no argument):
	Allow output before ^done.
2012-01-18 17:00:17 +00:00
Tom Tromey 4aac40c837 gdb
* NEWS: Add item.
	* symtab.h (compare_filenames_for_search): Declare.
	* symtab.c (compare_filenames_for_search): New function.
	(iterate_over_some_symtabs): Use it.
	* symfile.h (struct quick_symbol_functions)
	<map_symtabs_matching_filename>: Change spec.
	* psymtab.c (partial_map_symtabs_matching_filename): Use
	compare_filenames_for_search.  Update for new spec.
	* dwarf2read.c (dw2_map_symtabs_matching_filename): Use
	compare_filenames_for_search.  Update for new spec.
	* breakpoint.c (clear_command): Use compare_filenames_for_search.
gdb/doc
	* gdb.texinfo (Specify Location): Document relative file name
	handling.
gdb/testsuite
	* gdb.linespec/linespec.exp: Change some tests to use $decimal.
	Add tests for relative directory.
2012-01-16 20:40:53 +00:00
Tom Tromey cafec44190 gdb
PR python/13281:
	* gdbtypes.h (TYPE_FLAG_ENUM): New macro.
	(struct main_type) <flag_flag_enum>: New field.
	* dwarf2read.c (process_enumeration_scope): Detect "flag" enums.
	* NEWS: Add entries.
	* c-valprint.c (c_val_print) <TYPE_CODE_ENUM>: Handle "flag"
	enums.
	* python/lib/gdb/printing.py (_EnumInstance): New class.
	(FlagEnumerationPrinter): Likewise.
gdb/doc
	* gdb.texinfo (gdb.printing): Document FlagEnumerationPrinter.
gdb/testsuite
	* gdb.base/printcmds.c (enum flag_enum): New.
	(three): New global.
	* gdb.base/printcmds.exp (test_print_enums): Add test for flag
	enum printing.
	* gdb.python/py-pp-maint.py (build_pretty_printer): Instantiate
	FlagEnumerationPrinter.
	* gdb.python/py-pp-maint.exp: Add tests for FlagEnumerationPrinter.
	* gdb.python/py-pp-maint.c (enum flag_enum): New.
	(fval): New global.
2012-01-16 19:44:16 +00:00
Pedro Alves abcc497831 2012-01-16 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (banned_procedures): New variable.
	(banned_variables_traced): Rename to ...
	(banned_traced): ... this.
	(gdb_init): Also trace banned procedures.
	(gdb_finish): Also untrace banned procedures.
2012-01-16 17:31:25 +00:00
Pedro Alves 97ccebe869 2012-01-16 Pedro Alves <palves@redhat.com>
Remove all calls to strace.
2012-01-16 16:21:53 +00:00
Jan Kratochvil 2af7517b11 gdb/testsuite/
* gdb.dwarf2/dw2-namespaceless-anonymous.S: New file.
	* gdb.dwarf2/dw2-namespaceless-anonymous.exp: New file.
2012-01-14 10:46:35 +00:00
Paul Pluzhnikov 9241a8bcf3 2012-01-13 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.base/attach-pie-misread.exp: Pass -pie only to the linker.
	* gdb.base/pie-execl.exp: Likewise.
2012-01-13 18:39:31 +00:00
Keith Seitz 3848a17fe5 PR mi/10586
* gdb.mi/var-cmd.c (struct anonymous): New structure.
	(do_anonymous_type_tests): New function.
	(main): Call do_anonymous_type_tests.
	* gdb.mi/mi2-var-child.exp: Add anonymous type tests.
	(verify_everything): New procedure.
	* gdb.mi/mi-var-cp.cc (class A): New class.
	(anonymous_structs_and_unions): New function.
	(main): Call anonymous_structs_and_unions.
	* gdb.mi/mi-var-cp.exp: Add anonymous type tests.
	(verify_everything): New procedure.
2012-01-12 22:50:49 +00:00
Keith Seitz 440e2fca6a * lib/mi-support.exp: Expand comments about PATH_EXPR.
(varobj_tree::get_path_expr): Assume that all varobjs are
	compound unless they are known simple types.
	Adjust path expressions based on parent type, path parent type,
	and tree language.
	(varobj_tree::walk_tree): Add LANGUAGE parameter and save it into
	the root varobj.
	(mi_walk_varobj_tree): Add LANGUAGE parameter.
2012-01-12 22:28:34 +00:00
Pedro Alves 675399c96d 2012-01-11 Pedro Alves <palves@redhat.com>
* gdb.base/default.exp (core-file): Don't expect "GDB can't read
	core files on this machine" anymore.
2012-01-11 10:59:51 +00:00
Paul N. Hilfinger 97ddaa9bd5 Add test for use of "<block>::<variable>" syntax for locals in watch.
First, fix a technical problem with the function recurser.  The test sets a
watch on local_x at a point where its value is technically undefined.  The
test is written assuming that the value is not initially 2, but nothing in the
C standard guarantees that.

Second, augment the existing test for variables in recursive calls to check an
equivalent expression that explicitly sets the scope of the local variable
being tracked.

2012-01-11  Paul Hilfinger  <hilfingr@adacore.com>

	* gdb.base/watchpoint.c (recurser): Initialize local_x.
	(main): Repeat recurser call.
	* gdb.base/watchpoint.exp: Check that 'watch recurser::local_x' is
	equivalent to 'local_x'.
2012-01-11 10:36:18 +00:00
Paul N. Hilfinger ea73357595 Add testcase for locals identified with FUNCTION::VAR syntax.
This test stops inside a recursive function after a few levels of recursion,
goes up some frames, and then accesses a local variable with 'print foo::val'
rather than the usual 'print val' to see if the former pays attention to the
selected frame.

2012-01-11  Paul Hilfinger  <hilfingr@adacore.com>
    	    Joel Brobecker <brobecker@adacore.com>

	* gdb.base/recpar.c, gdb.base/recpar.exp: New files.
2012-01-11 10:35:12 +00:00
Pedro Alves 2ca0b532fd 2012-01-05 Khoo Yit Phang <khooyp@cs.umd.edu>
* infrun.c (normal_stop): Don't skip calling the normal_stop
	observers if the thread was doing a multi-step, but stopped for
	some reason other than stepping.

gdb/testsuite/
2012-01-05  Pedro Alves  <alves.ped@gmail.com>

	* gdb.mi/mi-stepn.c, gdb.mi/mi-stepn.exp: New files.
	* gdb.python/py-events.c (first): Add bits for new "step N" test.
	* gdb.python/py-events.exp: Test that "step N" tripping on a
	breakpoint emits a breakpoint event.
2012-01-05 13:11:31 +00:00
Joel Brobecker c5a5708100 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:28:28 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Joel Brobecker 6e68186627 more copyright notice reformatting.
gdb/ChangeLog:

        * ada-lang.c: Reformat the copyright notice.

gdb/testsuite/ChangeLog:

        * gdb.base/auxv.exp: Reformat the copyright notice.
2012-01-03 13:31:01 +00:00
Yao Qi 3c2d6aff67 gdb/testsuite/
* gdb.trace/strace.exp (strace_trace_on_same_addr): New.
	(strace_trace_on_diff_addr): New.
	* gdb.trace/strace.c: (main): Add two local variables.
2012-01-03 02:38:37 +00:00
Ulrich Weigand 0852fee32a * gdb.cell/fork.exp: Delete breakpoints after reaching main.
* gdb.cell/gcore.exp: Likewise.
	* gdb.cell/solib-symbol.exp: Use "info symbol" instead of "break"
	to verify the correct instance of main is selected.
2012-01-02 18:04:26 +00:00
Joel Brobecker 12c3e59c33 Update the copyright header of various files...
... to follow the correct syntax (according to the gospel of
gnulib's update-copyright). In other words:
  - no comma after the last year;
  - FSF spelled exactly "Free Software Foundation, Inc.", with
    the comma and the period at the end.

sim/common/ChangeLog:

	* dv-sockser.h, sim-assert.h, sim-fpu.c: Reformat the copyright
	header.

sim/m32c/ChangeLog:

	* blinky.S, gloss.S, sample.S: Reformat copyright header.

sim/mn10300/ChangeLog:

	* sim-main.h: Reformat copyright header.

sim/ppc/ChangeLog:

	* dp-bit.c: Reformat copyright header.

gdb/ChangeLog:

        * gdb/common/gdb_thread_db.h, gdb/dbxread.c, gdb/environ.c,
        gdb/gcore.h, gdb/rs6000-tdep.h, gdb/s390-nat.c, gdb/tic6x-tdep.c:
        Reformat the copyright header.

gdb/gdbserver/ChangeLog:

	* terminal.h: Reformat copyright header.

gdb/testsuite/ChangeLog:

	* dg-extract-results.sh, gdb.arch/gcore.c, gdb.arch/gdb1558.c,
	gdb.arch/i386-gnu-cfi.c, gdb.base/complex.c, gdb.base/cvexpr.c,
	gdb.base/gcore.c, gdb.base/gdb1555-main.c, gdb.base/gdb1555.c,
	gdb.base/gdb1821.c, gdb.base/long_long.c, gdb.base/restore.c,
	gdb.base/sepdebug.c, gdb.base/type-opaque-lib.c,
	gdb.base/type-opaque-main.c, gdb.cp/maint.exp, gdb.cp/namespace1.cc,
	gdb.cp/pr9631.cc, gdb.cp/psmang1.cc, gdb.cp/psmang2.cc,
	gdb.cp/try_catch.cc, gdb.cp/virtfunc.cc, gdb.hp/gdb.base-hp/reg.exp,
	gdb.mi/basics.c, gdb.mi/mi-stack.c, gdb.mi/mi-var-child.c,
	gdb.mi/mi2-var-child.exp, gdb.mi/var-cmd.c,
	gdb.threads/thread_check.c: Reformat copyright header.
2012-01-02 15:37:37 +00:00
Edjunior Barbosa Machado e4a7ca93ab Fixing previous Changelog entry (removing the unnecessary "gdb/testsuite/" line
and adding the missing period)
2011-12-30 14:30:39 +00:00
Edjunior Barbosa Machado c0f378ec1b 2011-12-30 Edjunior Machado <emachado@linux.vnet.ibm.com>
gdb/testsuite/
	* gdb.python/py-finish-breakpoint.exp: Add `.' prefix for ppc64
	* gdb.python/py-finish-breakpoint2.exp: Skip testcase if python support
	is not enabled.
2011-12-30 14:11:57 +00:00
Jan Kratochvil 3bc96cfbb2 gdb/testsuite/
* gdb.python/py-finish-breakpoint.c (test_exec_exit): Change the
	parameter to self_exec, adjust the function.
	(main): Check for argv[1] "exit".  Use argv[0] for test_exec_exit.
	* gdb.python/py-finish-breakpoint.exp (set var self_exec = 0): New test.
	(set var do_exit = 0): Remove test.
	(newline at end of file): Add one.
2011-12-27 21:29:41 +00:00
Joel Brobecker 095bcf5ed3 Ignore data minimal symbols for breakpoint linespecs
gdb/ChangeLog:

        * linespec.c (struct collect_minsyms) [list_mode]: New field.
        (add_minsym): Ignore data symbols if not in list mode.
        (search_minsyms_for_name): Set local.list_mode.

gdb/testsuite/ChangeLog:

        * gdb.base/dmsym.c, gdb.base/dmsym_main.c, gdb.base/dmsym.exp:
        New files.
2011-12-27 04:07:04 +00:00
Jan Kratochvil 18d19bd150 gdb/testsuite/
Fix racy FAILs.
	* gdb.threads/fork-thread-pending.c (barrier): New variable.
	(thread_function, thread_forker): Call pthread_barrier_wait for it.
	(main): Call pthread_barrier_init for it.
2011-12-26 21:37:17 +00:00
Jan Kratochvil e809353af1 gdb/testsuite/
Fix double send_gdb leading to racy FAILs.
	* gdb.base/break.exp (set silent break bp_location1): Replace
	3x send_gdb and gdb_expect by gdb_test.
	* gdb.base/fileio.exp: Replace 2x send_gdb by gdb_exit and sleep.
	* gdb.base/foll-vfork.exp (vfork_and_exec_child_follow_to_main_bp)
	(vfork_and_exec_child_follow_through_step): Use gdb_test_no_output
	instead of send_gdb.  Twice.
	* gdb.base/sepdebug.exp (set silent break bp_location1): Replace
	3x send_gdb and gdb_expect by gdb_test.
	* gdb.mi/mi-nsmoribund.exp: Replace 3x send_gdb by mi_gdb_test.
2011-12-26 11:24:55 +00:00
Jan Kratochvil da8cb7ec98 gdb/testsuite/
* gdb.linespec/linespec.exp: Compile using {c++}.
2011-12-24 23:54:20 +00:00
Jan Kratochvil ae1a303ef4 gdb/testsuite/
* gdb.cp/templates.exp (test_template_typedef): Import gdb_prompt.
	(print destructor of template typedef): Extend it for gcc/51668 XFAIL.
	(verify GCC PR debug/51668): New test.
2011-12-23 18:01:26 +00:00
Kevin Pouget cc72b2a2da Introduce gdb.FinishBreakpoint in Python
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-finishbreakpoint.o.
	(SUBDIR_PYTHON_SRCS): Add python/py-finishbreakpoint.c.
	Add build rule for this file.
	* infcmd.c (print_return_value): Split to create get_return_value.
	(get_return_value): New function based on print_return_value. Handle
	case where stop_registers are not set.
	* inferior.h (get_return_value): New prototype.
	* python/py-breakpoint.c (bppy_pending_object): Make non-static.
	(gdbpy_breakpoint_created): Set is_py_finish_bp is necessary.
	(struct breakpoint_object): Move to python-internal.h
	(BPPY_REQUIRE_VALID): Likewise.
	(BPPY_SET_REQUIRE_VALID): Likewise.
	(gdbpy_breakpoint_created): Initialize is_finish_bp.
	(gdbpy_should_stop): Add  pre/post hooks before/after calling stop
	method.
	* python/python-internal.h (breakpoint_object_type): Add as extern.
	(bppy_pending_object): Likewise.
	(typedef struct breakpoint_object) Removed.
	(struct breakpoint_object): Moved from py-breakpoint.c.
	Add field is_finish_bp.
	(BPPY_REQUIRE_VALID): Moved from py-breakpoint.c.
	(BPPY_SET_REQUIRE_VALID): Likewise.
	(frame_object_to_frame_info): New prototype.
	(gdbpy_initialize_finishbreakpoints): New prototype.
	(bpfinishpy_is_finish_bp): Likewise.
	(bpfinishpy_pre_stop_hook): Likewise.
	(bpfinishpy_post_stop_hook): Likewise.
	* python/py-finishbreakpoint.c: New file.
	* python/py-frame.c(frame_object_to_frame_info): Make non-static and
	accept PyObject instead of frame_object.
	(frapy_is_valid): Don't cast to frame_object.
	(frapy_name): Likewise.
	(frapy_type): Likewise.
	(frapy_unwind_stop_reason): Likewise.
	(frapy_pc): Likewise.
	(frapy_block): Likewise.
	(frapy_function): Likewise.
	(frapy_older): Likewise.
	(frapy_newer): Likewise.
	(frapy_find_sal): Likewise.
	(frapy_read_var): Likewise.
	(frapy_select): Likewise.
	* python/python.c (gdbpy_is_stopped_at_finish_bp): New noop function.
	(_initialize_python): Add gdbpy_initialize_finishbreakpoints.
	* python/python.h: Include breakpoint.h
	(gdbpy_is_stopped_at_finish_bp): New prototype.

doc/
	* gdb.texinfo (Finish Breakpoints in Python): New subsection.
	(Python API): Add menu entry for Finish Breakpoints.

testsuite/
	* Makefile.in (EXECUTABLES): Add py-finish-breakpoint and
	py-finish-breakpoint2
	(MISCALLANEOUS): Add py-events-shlib.so and py-events-shlib-nodebug.so
	* gdb.python/py-breakpoint.exp (mult_line): Define and use variable
	instead of line number.
	* gdb.python/py-finish-breakpoint.c: New file.
	* gdb.python/py-finish-breakpoint.exp: New file.
	* gdb.python/py-finish-breakpoint.py: New file.
	* gdb.python/py-finish-breakpoint2.cc: New file.
	* gdb.python/py-finish-breakpoint2.exp: New file.
	* gdb.python/py-finish-breakpoint2.py: New file.
2011-12-23 17:06:16 +00:00
Jan Kratochvil 6538471c25 gdb/testsuite/
Fix compatibility with gcc-4.7.
	* gdb.python/py-frame-inline.c (f): Use inline for __always_inline__.
2011-12-23 14:57:39 +00:00
Jan Kratochvil 3b7962f954 gdb/testsuite/
Partial fix of compatibility with gcc-4.7.
	* gdb.cp/templates.exp (ptype T5<int>, ptype t5i): Turn all PASS cases
	into XFAIL "new without size_t".  Permit size_t for the KFAIL case.
	Add comment to add a PASS case in the future.
2011-12-23 14:49:54 +00:00
Ulrich Weigand 7052e42c35 gdb/
PR tdep/12797
	* arm-tdep.c (arm_return_value): Handle complex types.

gdb/testsuite/
	PR tdep/12797
	* gdb.base/callfuncs.exp: Remove KFAIL.
2011-12-21 21:13:15 +00:00
Joel Brobecker 9ac7f98e7c [Ada] Breakpoints on task bodies
Consider the following declaration:

    package Pck is
       task Dummy_Task is
          entry Start;
       end Dummy_Task;
    end Pck;

Inserting a breakpoint on the body of that task does not currently
work:

    (gdb) b pck.dummy_task
    "pck.dummy_task" is not a function
    Make breakpoint pending on future shared library load? (y or [n]) n

What happens here is that the compiler generates two symbols:

  (a) Symbol `pck__dummy_task' which is a *variable* referencing
      the task;

  (b) Symbol `pck__dummy_taskTKB' which is the subprogram implementing
      the body of the task.

The symbol lookup only finds the variable before of the TKB suffix in
the subprogram name. This patch fixes the problem by adjusting the
ada-lang.c:is_name_suffix routine to recognize "TKB" suffixes.  But
that's not enough, because the search in the symtab is performed via
the block dictionary, using a hashing algorithm. So, for the search
to find `pck__dummy_taskTKB', I had to modify the hashing function
to ignore TKB suffixes as well.

gdb/ChangeLog:

        * ada-lang.c (is_name_suffix): Add handling of "TKB" suffixes.
        Update function documentation.
        * dictionary.c (dict_hash): Ignore "TKB" suffixes in hash
        computation.

gdb/testsuite/ChangeLog:

        * gdb.ada/task_bp: New testcase.
2011-12-21 07:10:59 +00:00
Jan Kratochvil f6eeced03d gdb/
* symfile.c (reread_symbols): Move free_objfile_separate_debug,
	preserve_values, sym_finish and clear_objfile_data calls before BFD
	close.  Move free_objfile_separate_debug as the very first call.  New
	comment on the ordering.

gdb/testsuite/
	* gdb.base/reread.exp: If srcfile2 fails to build retry it with
	-DNO_SECTIONS.
	* gdb.base/reread2.c <!NO_SECTIONS>: New sections block.
2011-12-19 22:20:07 +00:00
Jan Kratochvil 72225e1798 gdb/testsuite/
* gdb.cp/ptype-cv-cp.exp (ptype v_volatile_const_my_int): Make
	PR gcc/45997 XFAIL conditional for gcc <= 4.5.
	* gdb.python/py-type.exp (python print ttype.template_argument(2)):
	Change PR gcc/41736 to the more specific PR gcc/46955.  Make it
	conditional for gcc <= 4.5.
2011-12-19 13:42:50 +00:00
Jan Kratochvil 13ac8d2c29 gdb/doc/
* gdbint.texinfo (Testsuite): Describe KFAIL and XFAIL in Writing
	tests.

gdb/testsuite/
	* gdb.cp/ptype-cv-cp.exp (ptype v_volatile_const_my_int): Replace KFAIL
	by XFAIL.
	* gdb.cp/static-method.exp (info addr A::func())
	(list static-method.cc:xxx::(anonymous namespace)::A::func)
	(list 'static-method.cc:xxx::(anonymous namespace)::A::func')
	(list 'static-method.cc':'xxx::(anonymous namespace)::A::func')
	(list static-method.cc:'xxx::(anonymous namespace)::A::func'): Likewise.
	* gdb.cp/temargs.exp (test value of F in k2_m, test type of F in k3_m)
	(test value of F in k3_m): Likewise.
	* gdb.python/py-type.exp (python print ttype.template_argument(2)):
	Likewise.
2011-12-19 13:37:34 +00:00
Jan Kratochvil 049682ba03 gdb/testsuite/
* gdb.threads/attach-stopped.exp (continue (*: attach2 continue))
	(*: attach2 stop interrupt, *: attach2, exit leaves process sleeping):
	Remove.
	* gdb.threads/attachstop-mt.c: Remove.
	* gdb.threads/attachstop-mt.exp: Remove.
2011-12-19 10:31:43 +00:00
Mark Kettenis 2c9d87964d * gdb.arch/amd64-i386-address.exp: Skip on *-*-openbsd*. 2011-12-17 13:54:51 +00:00
Doug Evans f4aa210198 fix typo in previous entry 2011-12-16 20:04:35 +00:00
Doug Evans cfd16f96e3 * boards/native-stdiogdbserver.exp: New file. 2011-12-16 20:02:05 +00:00
Doug Evans 966be4fd6a * boards/native-gdbserver.exp: New file. 2011-12-16 19:37:47 +00:00
Doug Evans e0f9f06220 * NEWS: Add entry for stdio gdbserver.
gdbserver/
	* linux-low.c (linux_create_inferior): If stdio connection,
	redirect stdin from /dev/null, stdout to stderr.
	* remote-utils.c (remote_is_stdio): New static global.
	(remote_connection_is_stdio): New function.
	(remote_prepare): Handle stdio connection.
	(remote_open): Ditto.
	(remote_close): Don't close stdin for stdio connections.
	(read_prim,write_prim): New functions.  Replace all calls to
	read/write to these.
	* server.c (main): Watch for "-" argument.  Move call to
	remote_prepare before start_inferior.
	* server.h (STDIO_CONNECTION_NAME): New macro.
	(remote_connection_is_stdio): Declare.

	doc/
	* gdb.texinfo (Server): Document -/stdio argument to gdbserver.

	testsuite/
	* lib/gdbserver-support.exp (gdb_target_cmd): Recognize stdio
	gdbserver output.
	(gdbserver_default_get_remote_address): New function.
	(gdbserver_start): Call gdb,get_remote_address to compute argument
	to "target remote" command.
2011-12-16 19:06:38 +00:00
Phil Muldoon 1c3ad6ab98 2011-12-16 Phil Muldoon <pmuldoon@redhat.com>
* ChangeLog: Fix path typo.
	* doc/ChangeLog: Ditto.
2011-12-16 16:15:46 +00:00
Phil Muldoon 80b6e7564f 2011-12-16 Phil Muldoon <pmuldoon@redhat.com>
* testsuite/gdb.python/py-function.exp: Change "on" to "full" for
	python print-stack.  Add set/show python print-stack
	off|full|message tests.

2011-12-16  Phil Muldoon  <pmuldoon@redhat.com>

	* python/python.c: Define python_excp_enums.
	(eval_python_from_control_command): Do not call gdbpy_print_stack.
	(python_command): Ditto.
	(gdbpy_print_stack): Rewrite to use new enum constants.
	(maint_set_python): Remove function.
	(maint_show_python): Ditto.
	(_initialize_python): Do not add "maint" commands.  Add "set/show
	python print-stack commands".
	* NEWS: Update to reflect removal for "maint set/show
	print-stack"

2011-12-16  Phil Muldoon  <pmuldoon@redhat.com>

	* doc/gdb.texinfo (Python Commands): Remove "maint set/show print
	stack".  Add documentation for "set/show python print-stack".
2011-12-16 15:55:40 +00:00
Yao Qi 1576bd00ee gdb/testsuite/
* gdb.trace/strace.c: New
	* gdb.trace/strace.exp: New.
2011-12-15 12:43:03 +00:00
Tom Tromey d6a0f6e0c7 * gdb.dwarf2/dw2-inline-param.exp: Log the objcopy command. 2011-12-14 19:59:25 +00:00
Doug Evans 31015e1de0 * lib/gdb.exp (gdb_start_cmd): Fix error return value. 2011-12-14 19:50:18 +00:00
Pedro Alves 7b50312ad6 gdb/
2011-12-14  Pedro Alves  <pedro@codesourcery.com>

	PR threads/10729

	* linux-nat.c (linux_nat_new_thread): Change parameter to an lwp
	pointer.
	(linux_nat_prepare_to_resume): New global.
	(lwp_free): New.
	(purge_lwp_list): Use it.
	(add_lwp): Call linux_nat_new_thread even on the first LWP.
	Adjust to interface change.
	(delete_lwp): Call lwp_free instead of xfree.
	(detach_callback, linux_nat_detach, resume_lwp, linux_nat_resume)
	(linux_handle_syscall_trap, linux_handle_extended_wait)
	(linux_nat_filter_event, resume_stopped_resumed_lwps): Call
	linux_nat_prepare_to_resume before resuming.
	(linux_stop_lwp): New.
	(linux_nat_set_new_thread): Adjust.
	(linux_nat_set_prepare_to_resume): New.
	* linux-nat.h (struct arch_lwp_info): Forward declare.
	(struct lwp_info) <arch_private>: New field.
	(linux_stop_lwp): Declare.
	(linux_nat_set_new_thread): Adjust.
	(linux_nat_set_prepare_to_resume): New.

	* i386-nat.c (DR_NADDR, DR_STATUS, DR_CONTROL)
	(struct i386_debug_reg_state): Move to i386-nat.h.
	(dr_mirror): Comment.
	(i386_debug_reg_state): New.
	(i386_update_inferior_debug_regs): Simplify.
	(i386_stopped_data_address): Use the debug register state from the
	inferior, not from the local cache.
	* i386-nat.h (struct i386_dr_low_type): Delete reset_addr and
	unset_status fields.  New get_addr and get_control fields.
	(DR_FIRSTADDR, DR_LASTADDR, DR_CONTROL): Moved from i386-nat.c.
	(DR_NADDR, DR_STATUS): New.
	(struct i386_debug_reg_state): Moved from i386-nat.c.

	* amd64-linux-nat.c (struct arch_lwp_info): New.
	(amd64_linux_dr): Delete global.
	(amd64_linux_dr_get_addr): New.
	(amd64_linux_dr_get_control): New.
	(amd64_linux_dr_unset_status): Delete.
	(amd64_linux_dr_set_addr): Reimplement.
	(amd64_linux_dr_reset_addr): Delete.
	(update_debug_registers_callback): New.
	(amd64_linux_dr_set_control): Reimplement.
	(amd64_linux_dr_set_addr): Reimplement.
	(amd64_linux_prepare_to_resume): New.
	(amd64_linux_new_thread): Change parameter to an lwp pointer.
	Reimplement.
	(_initialize_amd64_linux_nat): No longer install
	i386_dr_low.reset_addr and i386_dr_low.unset_status.  Install
	amd64_linux_dr_get_control as i386_dr_low.get_control.  Install
	amd64_linux_dr_get_addr as i386_dr_low.get_addr.  Install
	amd64_linux_prepare_to_resume.
	* i386-linux-nat.c (DR_FIRSTADDR, DR_LASTADDR, DR_STATUS)
	(DR_CONTROL): Delete.
	(struct arch_lwp_info): New.
	(i386_linux_dr): Delete global.
	(i386_linux_dr_set_control): Reimplement.
	(i386_linux_dr_get_addr): New.
	(i386_linux_dr_set_addr): Reimplement.
	(i386_linux_dr_get_control): New.
	(update_debug_registers_callback): New.
	(i386_linux_dr_unset_status): Delete.
	(i386_linux_dr_set_addr): Reimplement.
	(i386_linux_prepare_to_resume): New.
	(i386_linux_new_thread): Change parameter to an lwp pointer.
	Reimplement.
	(_initialize_i386_linux_nat): No longer install
	i386_dr_low.reset_addr and i386_dr_low.unset_status.  Install
	i386_linux_dr_get_control as i386_dr_low.get_control.  Install
	i386_linux_dr_get_addr as i386_dr_low.get_addr.  Install
	i386_linux_prepare_to_resume.

	* arm-linux-nat.c (arm_linux_new_thread): Change parameter to an
	lwp pointer.  Adjust.
	* ia64-linux-nat.c (ia64_linux_new_thread): Likewise.
	* mips-linux-nat.c (mips_linux_new_thread): Likewise.
	* ppc-linux-nat.c (ppc_linux_new_thread): Likewise.
	* s390-nat.c (s390_fix_watch_points): Likewise.

	* i386-darwin-nat.c (DR_FIRSTADDR, DR_LASTADDR, DR_STATUS)
	(DR_CONTROL): Delete.
	(i386_darwin_dr_reset_addr): Delete.
	(i386_darwin_dr_get_addr): New.
	(i386_darwin_dr_get_control): New.
	* go32-nat.c
	(go32_get_dr7, go32_get_dr): New.
	(init_go32_ops): No longer install i386_dr_low.reset_addr.
	Install go32_get_dr7 as i386_dr_low.get_control.  Install
	go32_get_dr as i386_dr_low.get_addr.
	* i386bsd-nat.c (i386bsd_dr_get): New.
	(i386bsd_dr_reset_addr): Delete.
	(i386bsd_dr_get_addr): New.
	(i386bsd_dr_get_status): Use i386bsd_dr_get.
	(i386bsd_dr_get_control): New.
	* i386bsd-nat.h (i386bsd_dr_reset_addr): Delete.
	(i386bsd_dr_get_addr): New.
	(i386bsd_dr_get_control): New.
	* i386fbsd-nat.c (_initialize_i386fbsd_nat): No longer install
	i386_dr_low.reset_addr and i386_dr_low.unset_status.  Install
	i386bsd_dr_get_control as i386_dr_low.get_control.  Install
	i386bsd_dr_get_addr as i386_dr_low.get_addr.
	* windows-nat.c (init_windows_ops): No longer install
	i386_dr_low.reset_addr and i386_dr_low.unset_status.  Install
	cygwin_get_dr7 as i386_dr_low.get_control.  Install cygwin_get_dr
	as i386_dr_low.get_addr.
	(cygwin_get_dr): New.
	(cygwin_get_dr7): New.

gdb/testsuite/
2011-12-14  Pedro Alves  <pedro@codesourcery.com>

	PR threads/10729

	* gdb.mi/watch-nonstop.c: New file.
 	* gdb.mi/mi-watch-nonstop.exp: New file.
2011-12-14 17:20:32 +00:00
Pedro Alves 924437bc13 gdb/doc/
2011-12-13  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Implementing a Remote Stub): Explain that you
	should transfer control to the stub in the startup code instead of
	in main.  Mention the need to get past the initial breakpoint.

gdb/testsuite/
2011-12-13  Pedro Alves  <pedro@codesourcery.com>
	    Doug Evans  <dje@google.com>

	* lib/gdb.exp (gdb_run_cmd, runto_main, gdb_compile)
	(clean_restart): Remove references to the gdb_stub target board
	variable.
	(gdb_step_for_stub): Delete.

	* gdb.base/annota1.exp: Remove all references to [target_info
	exists gdb_stub], gdb_step_for_stub and usestubs.
	* gdb.base/annota3.exp: Ditto.
	* gdb.base/async.exp: Ditto.
	* gdb.base/break.exp: Ditto.
	* gdb.base/code-expr.exp: Ditto.
	* gdb.base/commands.exp: Ditto.
	* gdb.base/completion.exp: Ditto.
	* gdb.base/condbreak.exp: Ditto.
	* gdb.base/consecutive.exp: Ditto.
	* gdb.base/cvexpr.exp: Ditto.
	* gdb.base/define.exp: Ditto.
	* gdb.base/display.exp: Ditto.
	* gdb.base/ena-dis-br.exp: Ditto.
	* gdb.base/environ.exp: Ditto.
	* gdb.base/gnu-ifunc.exp: Ditto.
	* gdb.base/maint.exp: Ditto.
	* gdb.base/pending.exp: Ditto.
	* gdb.base/sect-cmd.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/unload.exp: Ditto.
	* gdb.base/watchpoint-solib.exp: Ditto.
	* gdb.cp/annota2.exp: Ditto.
	* gdb.cp/annota3.exp: Ditto.
	* gdb.dwarf2/dw2-inline-param.exp: Ditto.
	* gdb.hp/gdb.compat/xdb1.exp: Ditto.
	* gdb.mi/mi-pending.exp: Ditto.
	* gdb.trace/circ.exp: Ditto.
	* gdb.cp/ovldbreak.exp: Ditto.  Adjust expected line numbers.
	* gdb.base/list.exp: Ditto.

	* gdb.base/all-types.c: Remove all calls to set_debug_traps and
	breakpoint function and all references to the usestubs macro.
	* gdb.base/exprs.c: Ditto.
	* gdb.base/freebpcmd.c: Ditto.
	* gdb.base/bitfields.c: Ditto.
	* gdb.base/bitfields2.c: Ditto.
	* gdb.base/break.c: Ditto.
	* gdb.base/call-sc.c: Ditto.
	* gdb.base/call-signals.c: Ditto.
	* gdb.base/callfuncs.c: Ditto.
	* gdb.base/charset.c: Ditto.
	* gdb.base/consecutive.c: Ditto.
	* gdb.base/constvars.c: Ditto.
	* gdb.base/funcargs.c: Ditto.
	* gdb.base/int-type.c: Ditto.
	* gdb.base/interrupt.c: Ditto.
	* gdb.base/langs0.c: Ditto.
	* gdb.base/list0.c: Ditto.
	* gdb.base/mips_pro.c: Ditto.
	* gdb.base/miscexprs.c: Ditto.
	* gdb.base/nodebug.c: Ditto.
	* gdb.base/opaque0.c: Ditto.
	* gdb.base/pointers.c: Ditto.
	* gdb.base/printcmds.c: Ditto.
	* gdb.base/ptype.c: Ditto.
	* gdb.base/recurse.c: Ditto.
	* gdb.base/reread1.c: Ditto.
	* gdb.base/reread2.c: Ditto.
	* gdb.base/restore.c: Ditto.
	* gdb.base/return.c: Ditto.
	* gdb.base/run.c: Ditto.
	* gdb.base/scope0.c: Ditto.
	* gdb.base/sepdebug.c: Ditto.
	* gdb.base/setshow.c: Ditto.
	* gdb.base/setvar.c: Ditto.
	* gdb.base/sigall.c: Ditto.
	* gdb.base/signals.c: Ditto.
	* gdb.base/structs.c: Ditto.
	* gdb.base/structs2.c: Ditto.
	* gdb.base/testenv.c: Ditto.
	* gdb.base/twice.c: Ditto.
	* gdb.base/unwindonsignal.c: Ditto.
	* gdb.base/watchpoint.c: Ditto.
	* gdb.base/watchpoints.c: Ditto.
	* gdb.base/whatis.c: Ditto.
	* gdb.cp/classes.cc: Ditto.
	* gdb.cp/cplusfuncs.cc: Ditto.
	* gdb.cp/derivation.cc: Ditto.
	* gdb.cp/formatted-ref.cc: Ditto.
	* gdb.cp/misc.cc: Ditto.
	* gdb.cp/overload.cc: Ditto.
	* gdb.cp/ovldbreak.cc: Ditto.
	* gdb.cp/ref-params.cc: Ditto.
	* gdb.cp/ref-types.cc: Ditto.
	* gdb.cp/templates.cc: Ditto.
	* gdb.cp/virtfunc.cc: Ditto.
	* gdb.hp/gdb.aCC/run.c: Ditto.
	* gdb.hp/gdb.base-hp/callfwmall.c: Ditto.
	* gdb.hp/gdb.compat/xdb0.c: Ditto.
	* gdb.reverse/consecutive-reverse.c: Ditto.
	* gdb.reverse/sigall-reverse.c: Ditto.
	* gdb.reverse/until-reverse.c: Ditto.
	* gdb.reverse/watch-reverse.c: Ditto.
	* gdb.trace/actions.c: Ditto.
	* gdb.trace/circ.c: Ditto.
	* gdb.trace/collection.c: Ditto.
2011-12-13 17:22:11 +00:00
Pedro Alves fabde4854c 2011-12-13 Pedro Alves <pedro@codesourcery.com>
* gdb.base/watchpoint.c (struct foo2, foo2, struct foo4, foo4)
	(func6, func7): New.
	(main): Call func6 and func7.
	* gdb.base/watchpoint.exp (test_wide_location_1)
	(test_wide_location_2): New.
	(top level): Re-enable hardware watchpoints if necessary.  Call
	test_wide_location_1 and test_wide_location_2.
2011-12-13 16:05:24 +00:00
Yao Qi ff7d1690b4 2011-12-11 Yao Qi <yao@codesourcery.com>
* gdb.trace/status-stop.exp: Skip it if target doesn't support trace.
2011-12-12 02:11:45 +00:00
Joel Brobecker a6af7abe5d Warn if missing debug info for Ada exception catchpoints
This patch should help the user understand why the debugger is not
able to insert Ada exception catchpoints when the Ada runtime was
stripped of debugging info, as is often the case on many GNU/Linux
distros:

    (gdb) catch exception
    Your Ada runtime appears to be missing some debugging information.
    Cannot insert Ada exception catchpoint in this configuration.

gdb/ChangeLog:

        * ada-lang.c (ada_has_this_exception_support): Raise an error
        if we could find the Ada exception hook in the Ada runtime,
        but no debugging info for that hook.

gdb/testsuite/ChangeLog:

        * gdb.ada/catch_ex.exp, gdb.ada/mi_catch_ex.exp: Adjust
        expected output for unsupported case.
2011-12-11 17:36:10 +00:00
Jan Kratochvil 61638e15c5 gdb/testsuite/
PR testsuite/12649
	* gdb.trace/ftrace.exp (test_fast_tracepoints): Import gdb_prompt.
	Protect gdb_test_multiple by final $gdb_prompt match.
2011-12-10 23:05:08 +00:00
Jan Kratochvil 0a00efc364 gdb/testsuite/
* gdb.cp/static-method.exp (have_gcc_45682_fixed, info addr A::func()):
	New variable, new test.
	(list static-method.cc:xxx::(anonymous namespace)::A::func)
	(list 'static-method.cc:xxx::(anonymous namespace)::A::func')
	(list 'static-method.cc':'xxx::(anonymous namespace)::A::func')
	(list static-method.cc:'xxx::(anonymous namespace)::A::func'): KFAIL
	them if HAVE_GCC_45682_FIXED is not set.
2011-12-10 15:58:14 +00:00
Yao Qi 4511b1ba87 2011-12-10 Hui Zhu <teawater@gmail.com>
Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (start_tracing): Clear `inserted' flag.

2011-12-10  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/status-stop.exp: New.
	* gdb.trace/status-stop.c: New.
2011-12-10 15:16:35 +00:00
Jan Kratochvil 27949e7316 gdb/testsuite/
* gdb.reverse/until-precsave.exp (run to end of main) Extend the
	timeout.
2011-12-09 17:36:02 +00:00
Tom Tromey d8ea793193 * gdb.cp/ovsrch.exp (test_class): Correctly use "a_param" in
condition.
2011-12-08 15:31:20 +00:00
Maciej W. Rozycki c7195df2f5 Fix ChangeLog typo. 2011-12-07 21:45:12 +00:00
Stan Shebs 1cc310d2dd * gdb.trace/tfind.exp: Update for output changes. 2011-12-07 21:24:05 +00:00
Pedro Alves d482a87555 2011-12-07 Pedro Alves <pedro@codesourcery.com>
* gdb.ada/catch_ex.exp: Skip as unsupported if "catch exception"
	throws "Cannot insert catchpoints in this configuration".
	* gdb.ada/mi_catch_ex.exp: Likewise.
2011-12-07 15:00:34 +00:00
Pedro Alves f0ba3972e9 2011-12-06 Pedro Alves <pedro@codesourcery.com>
gdb/
	* breakpoint.c (breakpoint_restore_shadows): Rename to ...
	(breakpoint_xfer_memory): ... this.  Change prototype.  Handle
	memory writes too.
	* breakpoint.h (breakpoint_restore_shadows): Delete.
	(breakpoint_xfer_memory): Declare.
	* mem-break.c (default_memory_insert_breakpoint)
	(default_memory_remove_breakpoint): Use target_write_raw_memory.
	(memory_xfer_partial): Rename to ...
	(memory_xfer_partial_1): ... this.  Don't mask out breakpoints
	here.
	(memory_xfer_partial): New.
	(target_write_raw_memory): New.
	* target.h (target_write_raw_memory): New.

	gdb/testsuite/
	* gdb.base/break-always.exp: Test changing memory at addresses
	with breakpoints inserted.
2011-12-06 20:03:14 +00:00
Tom Tromey f8eba3c616 the "ambiguous linespec" series
gdb
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * language.h (struct language_defn): Add new component
        la_symbol_name_compare.
        * symfile.h (struct quick_symbol_functions): Update the profile
        of parameter "name_matcher" for the expand_symtabs_matching
        method.  Update the documentation accordingly.
        * ada-lang.h (ada_name_for_lookup): Add declaration.
        * ada-lang.c (ada_name_for_lookup): New function, extracted out
        from ada_iterate_over_symbols.
        (ada_iterate_over_symbols): Do not encode symbol name anymore.
        (ada_expand_partial_symbol_name): Adjust profile.
        (ada_language_defn): Add value for la_symbol_name_compare field.
        * linespec.c: #include "ada-lang.h".
        (iterate_name_matcher): Add language parameter. Replace call
        to strcmp_iw by call to language->la_symbol_name_compare.
        (decode_variable): Encode COPY if current language is Ada.
        * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile
        of name_matcher parameter.  Adjust call to name_matcher.
        * psymtab.c (expand_symtabs_matching_via_partial): Likewise.
        (expand_partial_symbol_names): Update profile of parameter "fun".
        * psymtab.h (expand_partial_symbol_names): Update profile of
        parameter "fun".
        * symtab.c (demangle_for_lookup): Update function documentation.
        (search_symbols_name_matches): Add language parameter.
        (expand_partial_symbol_name): Likewise.
        * c-lang.c (c_language_defn, cplus_language_defn)
        (asm_language_defn, minimal_language_defn): Add value for
        la_symbol_name_compare field.
        * d-lang.c (d_language_defn): Likewise.
        * f-lang.c (f_language_defn): Ditto.
        * jv-lang.c (java_language_defn): Ditto.
        * m2-lang.c (m2_language_defn): Ditto.
        * objc-lang.c (objc_language_defn): Ditto.
        * opencl-lang.c (opencl_language_defn): Ditto.
        * p-lang.c (pascal_language_defn): Ditto.
        * language.c (unknown_language_defn, auto_language_defn)
        (local_language_defn): Ditto.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* linespec.c (iterate_over_all_matching_symtabs): Use
	LA_ITERATE_OVER_SYMBOLS.
	(lookup_prefix_sym, add_matching_symbols_to_info): Likewise.
	(find_function_symbols, decode_variable): Remove Ada special
	case.
	* language.h (struct language_defn) <la_iterate_over_symbols>: New
	field.
	(LA_ITERATE_OVER_SYMBOLS): New macro.
	* language.c (unknown_language_defn, auto_language_defn)
	(local_language_defn): Update.
	* c-lang.c (c_language_defn, cplus_language_defn)
	(asm_language_defn, minimal_language_defn): Update.
	* d-lang.c (d_language_defn): Update.
	* f-lang.c (f_language_defn): Update.
	* jv-lang.c (java_language_defn): Update.
	* m2-lang.c (m2_language_defn): Update.
	* objc-lang.c (objc_language_defn): Update.
	* opencl-lang.c (opencl_language_defn): Update.
	* p-lang.c (pascal_language_defn): Update.
	* ada-lang.c (ada_iterate_over_symbols): New function.
	(ada_language_defn): Update.

2011-12-06  Tom Tromey  <tromey@redhat.com>
	    Joel Brobecker  <brobecker@acacore.com>

	PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366,
	PR objc/8535, PR breakpoints/11657, PR breakpoints/11970,
	PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856,
	PR shlibs/8929, PR shlibs/7393:
	* python/py-type.c (compare_maybe_null_strings): Rename from
	compare_strings.
	(check_types_equal): Update.
	* utils.c (compare_strings): New function.
	* tui/tui-winsource.c (tui_update_breakpoint_info): Update for
	location changes.
	* tracepoint.c (scope_info): Update.
	(trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE.
	* symtab.h (iterate_over_minimal_symbols)
	(iterate_over_some_symtabs, iterate_over_symtabs)
	(find_pcs_for_symtab_line, iterate_over_symbols)
	(demangle_for_lookup): Declare.
	(expand_line_sal): Remove.
	* symtab.c (iterate_over_some_symtabs, iterate_over_symtabs)
	(lookup_symtab_callback): New functions.
	(lookup_symtab): Rewrite.
	(demangle_for_lookup): New function, extract from
	lookup_symbol_in_language.
	(lookup_symbol_in_language): Use it.
	(iterate_over_symbols): New function.
	(find_line_symtab): Update.
	(find_pcs_for_symtab_line): New functions.
	(find_line_common): Add 'start' argument.
	(decode_line_spec): Update.  Change argument to 'flags', change
	interpretation.
	(append_expanded_sal): Remove.
	(append_exact_match_to_sals): Remove.
	(expand_line_sal): Remove.
	* symfile.h (struct quick_symbol_functions) <lookup_symtab>:
	Remove.
	<map_symtabs_matching_filename>: New field.
	* stack.c (func_command): Only look in the current program space.
	Use DECODE_LINE_FUNFIRSTLINE.
	* source.c (line_info): Set pspace on sal.  Check program space in
	the loop.  Use DECODE_LINE_LIST_MODE.
	(select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE.
	* solib-target.c: Remove DEF_VEC_I(CORE_ADDR).
	* python/python.c (gdbpy_decode_line): Update.
	* psymtab.c (partial_map_expand_apply): New function.
	(partial_map_symtabs_matching_filename): Rename from
	lookup_partial_symbol.  Update arguments.
	(lookup_symtab_via_partial_symtab): Remove.
	(psym_functions): Update.
	* objc-lang.h (parse_selector, parse_method): Don't declare.
	(find_imps): Update.
	* objc-lang.c (parse_selector, parse_method): Now static.
	(find_methods): Change arguments.  Fill in a vector of symbol
	names.
	(uniquify_strings): New function.
	(find_imps): Change arguments.
	* minsyms.c (iterate_over_minimal_symbols): New function.
	* linespec.h (enum decode_line_flags): New.
	(struct linespec_sals): New.
	(struct linespec_result) <canonical>: Remove.
	<pre_expanded, addr_string, sals>: New fields.
	(destroy_linespec_result, make_cleanup_destroy_linespec_result)
	(decode_line_full): Declare.
	(decode_line_1): Update.
	* linespec.c (struct address_entry, struct linespec_state, struct
	collect_info): New types.
	(add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry)
	(eq_address_entry, maybe_add_address): New functions.
	(total_number_of_methods): Remove.
	(iterate_name_matcher, iterate_over_all_matching_symtabs): New
	functions.
	(find_methods): Change arguments.  Don't canonicalize input.
	Simplify logic.
	(add_matching_methods, add_constructors)
	(build_canonical_line_spec): Remove.
	(filter_results, convert_results_to_lsals): New functions.
	(decode_line_2): Change arguments.  Rewrite for new data
	structures.
	(decode_line_internal): Rename from decode_line_1.  Change
	arguments.  Add cleanups.  Update for new data structures.
	(linespec_state_constructor, linespec_state_destructor)
	(decode_line_full, decode_line_1): New functions.
	(decode_indirect): Change arguments.  Update.
	(locate_first_half): Use skip_spaces.
	(decode_objc): Change arguments.  Update for new data structures.
	Simplify logic.
	(decode_compound): Change arguments.  Add cleanups.  Remove
	fallback code, replace with error.
	(struct decode_compound_collector): New type.
	(collect_one_symbol): New function.
	(lookup_prefix_sym): Change arguments.  Update.
	(compare_symbol_name, add_all_symbol_names_from_pspace)
	(find_superclass_methods ): New functions.
	(find_method): Rewrite.
	(struct symtab_collector): New type.
	(add_symtabs_to_list, collect_symtabs_from_filename): New
	functions.
	(symtabs_from_filename): Change API.  Rename from
	symtab_from_filename.
	(collect_function_symbols): New function.
	(find_function_symbols): Change API.  Rename from
	find_function_symbol.  Rewrite.
	(decode_all_digits): Change arguments.  Rewrite.
	(decode_dollar): Change arguments.  Use decode_variable.
	(decode_label): Change arguments.  Rewrite.
	(collect_symbols): New function.
	(minsym_found): Change arguments.  Rewrite.
	(check_minsym, search_minsyms_for_name)
	(add_matching_symbols_to_info): New function.
	(decode_variable): Change arguments.  Iterate over all symbols.
	(symbol_found): Remove.
	(symbol_to_sal): New function.
	(init_linespec_result, destroy_linespec_result)
	(cleanup_linespec_result, make_cleanup_destroy_linespec_result):
	New functions.
	(decode_digits_list_mode, decode_digits_ordinary): New functions.
	* dwarf2read.c (dw2_map_expand_apply): New function.
	(dw2_map_symtabs_matching_filename): Rename from
	dw2_lookup_symtab.  Change arguments.
	(dwarf2_gdb_index_functions): Update.
	* dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR).
	* defs.h (compare_strings): Declare.
	* cli/cli-cmds.c (compare_strings): Move to utils.c.
	(edit_command, list_command): Use DECODE_LINE_LIST_MODE.  Call
	filter_sals.
	(compare_symtabs, filter_sals): New functions.
	* breakpoint.h (struct bp_location) <line_number, source_file>:
	New fields.
	(struct breakpoint) <line_number, source_file>: Remove.
	<filter>: New field.
	* breakpoint.c (print_breakpoint_location, init_raw_breakpoint)
	(momentary_breakpoint_from_master, add_location_to_breakpoint):
	Update for changes to locations.
	(init_breakpoint_sal): Add 'filter' argument.  Set 'filter' on
	breakpoint.
	(create_breakpoint_sal): Add 'filter' argument.
	(remove_sal, expand_line_sal_maybe): Remove.
	(create_breakpoints_sal): Remove 'sals' argument.  Handle
	pre-expanded sals and the filter.
	(parse_breakpoint_sals): Use decode_line_full.
	(check_fast_tracepoint_sals): Use get_sal_arch.
	(create_breakpoint): Create a linespec_sals.  Update.
	(break_range_command): Use decode_line_full.  Update.
	(until_break_command): Update.
	(clear_command): Update match conditions for linespec.c changes.
	Use DECODE_LINE_LIST_MODE.
	(say_where): Update for changes to locations.
	(bp_location_dtor): Free 'source_file'.
	(base_breakpoint_dtor): Free 'filter'.  Don't free 'source_file'.
	(update_static_tracepoint): Update for changes to locations.
	(update_breakpoint_locations): Disable ranged breakpoint if too
	many locations match.  Update.
	(addr_string_to_sals): Use decode_line_full.  Resolve all sal
	PCs.
	(breakpoint_re_set_default): Don't call expand_line_sal_maybe.
	(decode_line_spec_1): Update.  Change argument name to 'flags',
	change interpretation.
	* block.h (block_containing_function): Declare.
	* block.c (block_containing_function): New function.
	* skip.c (skip_function_command): Update.
	(skip_re_set): Update.
	* infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE.
	* mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE.
	* NEWS: Add entry.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow
	breakpoint's pspace to be NULL.
	* breakpoint.h (struct breakpoint) <pspace>: Update comment.
	* breakpoint.c (init_raw_breakpoint): Conditionally set
	breakpoint's pspace.
	(init_breakpoint_sal): Don't set breakpoint's pspace.
	(prepare_re_set_context): Conditionally switch program space.
	(addr_string_to_sals): Check executing_startup on location's
	program space.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove.
	* breakpoint.c (should_be_inserted): Explicitly check if program
	space is executing startup.
	(describe_other_breakpoints): Update.
	(disable_breakpoints_before_startup): Change executing_startup
	earlier.  Remove loop.
	(enable_breakpoints_after_startup): Likewise.
	(init_breakpoint_sal): Don't use bp_startup_disabled.
	(create_breakpoint): Don't use bp_startup_disabled.
	(update_global_location_list): Use should_be_inserted.
	(bkpt_re_set): Update.
gdb/testsuite
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs
        involving a fully qualified function name.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.ada/homonym.exp: Add three breakpoint tests.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.base/solib-weak.exp (do_test): Remove kfail.
	* gdb.trace/tracecmd.exp: Disable pending breakpoints earlier.
	* gdb.objc/objcdecode.exp: Update for output changes.
	* gdb.linespec/linespec.exp: New file.
	* gdb.linespec/lspec.cc: New file.
	* gdb.linespec/lspec.h: New file.
	* gdb.linespec/body.h: New file.
	* gdb.linespec/base/two/thefile.cc: New file.
	* gdb.linespec/base/one/thefile.cc: New file.
	* gdb.linespec/Makefile.in: New file.
	* gdb.cp/templates.exp (test_template_breakpoints): Update for
	output changes.
	* gdb.cp/re-set-overloaded.exp: Remove kfail.
	* gdb.cp/ovldbreak.exp: Update for output changes.  "all" test now
	makes one breakpoint.
	* gdb.cp/method2.exp (test_break): Update for output changes.
	* gdb.cp/mb-templates.exp: Update for output changes.
	* gdb.cp/mb-inline.exp: Update for output changes.
	* gdb.cp/mb-ctor.exp: Update for output changes.
	* gdb.cp/ovsrch.exp: Use fully-qualified names.
	* gdb.base/solib-symbol.exp: Run to main later.  Breakpoint now
	has multiple matches.
	* gdb.base/sepdebug.exp: Disable pending breakpoints.  Update for
	error message change.
	* gdb.base/list.exp (test_list_filename_and_number): Update for
	error message change.
	* gdb.base/break.exp: Disable pending breakpoints.  Update for
	output changes.
	* configure.ac: Add gdb.linespec.
	* configure: Rebuild.
	* Makefile.in (ALL_SUBDIRS): Add gdb.linespec.
gdb/doc
2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 18:54:43 +00:00
Ulrich Weigand c642a43456 ChangeLog:
* s390-tdep.h (S390_ORIG_R2_REGNUM): Define.
	(S390_LAST_BREAK_REGNUM): Likewise.
	(S390_SYSTEM_CALL_REGNUM): Likewise.
	(S390_NUM_REGS): Update.

	(s390_regmap_last_break): Add declaration.
	(s390x_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.

	(tdesc_s390_linux32v1): Add declaration.
	(tdesc_s390_linux32v2): Likewise.
	(tdesc_s390_linux64v1): Likewise.
	(tdesc_s390_linux64v2): Likewise.
	(tdesc_s390x_linux64v1): Likewise.
	(tdesc_s390x_linux64v2): Likewise.

	* s390-tdep.c: Include new target description files
	"features/s390-linux32v1.c", "features/s390-linux32v2.c",
	"features/s390-linux64v1.c", "features/s390-linux64v2.c",
	"features/s390x-linux64v1.c", and "features/s390x-linux64v2.c".
	(s390_cannot_store_register): New function.
	(s390_write_pc): Likewise.
	(s390_dwarf_regmap): Add fields for new registers.
	(s390_regmap_gregset): Likewise.
	(s390x_regmap_gregset): Likewise.
	(s390_regmap_fpregset): Likewise.
	(s390_regmap_upper): Likewise.
	(s390_regmap_last_break): New variable.
	(s390x_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.
	(s390_last_break_regset): Likewise.
	(s390x_last_break_regset): Likewise.
	(s390_system_call_regset): Likewise.
	(s390_upper_regset_sections): Rename to ...
	(s390_linux64_regset_sections): ... this.
	(s390_linux32_regset_sections): New variable.
	(s390x_linux64_regset_sections): Likewise.
	(s390_linux32v1_regset_sections): Likewise.
	(s390_linux32v2_regset_sections): Likewise.
	(s390_linux64v1_regset_sections): Likewise.
	(s390_linux64v2_regset_sections): Likewise.
	(s390x_linux64v1_regset_sections): Likewise.
	(s390x_linux64v2_regset_sections): Likewise.
	(s390_regset_from_core_section): Handle .reg-s390-last-break and
	.reg-s390-system-call core file sections.
	(s390_core_read_description): Check for presence of
	.reg-s390-last-break and .reg-s390-system-call core file
	sections and return appropriate target description.
	(s390_gdbarch_init): Detect Linux-specific registers "orig_r2",
	"last_break" and "system_call" in target description.  Install
	appropriate gdbarch_core_regset_sections array.
	Call set_gdbarch_cannot_store_register and set_gdbarch_write_pc.
	(_initialize_s390_tdep): Initialize additional target descriptions.

	* s390-nat.c: Include "elf/common.h".
	(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
	(have_regset_last_break): New static variable.
	(have_regset_system_call): Likewise.
	(s390_native_supply): Handle S390_ORIG_R2_REGNUM.
	(s390_native_collect): Likewise.
	(fetch_regset, store_regset, check_regset): New functions.
	(s390_linux_fetch_inferior_registers): Handle S390_LAST_BREAK_REGNUM
	and S390_SYSTEM_CALL_REGNUM.
	(s390_linux_store_inferior_registers): Likewise.
	(s390_read_description): Check for presence of NT_S390_LAST_BREAK
	and NT_S390_SYSTEM_CALL regsets and use appropriate description.

	* features/Makefile (WHICH): Add s390-linux32v1, s390-linux64v1,
	s390x-linux64v1, s390-linux32v2, s390-linux64v2, and s390x-linux64v2.
	(s390-linux32v1-expedite): Define.
	(s390-linux32v2-expedite): Likewise.
	(s390-linux64v1-expedite): Likewise.
	(s390-linux64v2-expedite): Likewise.
	(s390x-linux64v1-expedite): Likewise.
	(s390x-linux64v2-expedite): Likewise.

	* features/s390-linux32.xml: Add orig_r2 register.
	* features/s390-linux64.xml: Likewise.
	* features/s390x-linux64.xml: Likewise.
	* features/s390-linux32v1.xml: New file.
	* features/s390-linux32v2.xml: Likewise.
	* features/s390-linux64v1.xml: Likewise.
	* features/s390-linux64v2.xml: Likewise.
	* features/s390x-linux64v1.xml: Likewise.
	* features/s390x-linux64v2.xml: Likewise.

	* features/s390-linux32.c: Regenerate.
	* features/s390-linux64.c: Likewise.
	* features/s390x-linux64.c: Likewise.
	* features/s390-linux32v1.c: New generated file.
	* features/s390-linux32v2.c: Likewise.
	* features/s390-linux64v1.c: Likewise.
	* features/s390-linux64v2.c: Likewise.
	* features/s390x-linux64v1.c: Likewise.
	* features/s390x-linux64v2.c: Likewise.

	* regformats/s390-linux32.dat: Regenerate.
	* regformats/s390-linux64.dat: Regenerate.
	* regformats/s390x-linux64.dat: Regenerate.
	* regformats/s390-linux32v1.dat: New generated file.
	* regformats/s390-linux32v2.dat: Likewise.
	* regformats/s390-linux64v1.dat: Likewise.
	* regformats/s390-linux64v2.dat: Likewise.
	* regformats/s390x-linux64v1.dat: Likewise.
	* regformats/s390x-linux64v2.dat: Likewise.

gdbserver/ChangeLog:

	* Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
	(s390-linux32v2.o, s390-linux32v2.c): Likewise.
	(s390-linux64v1.o, s390-linux64v1.c): Likewise.
	(s390-linux64v2.o, s390-linux64v2.c): Likewise.
	(s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
	(s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
	* configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
	(srv_xmlfiles): Add new XML files.

	* linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
	and <sys/uio.h>.
	(PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
	(init_registers_s390_linux32v1): Add prototype.
	(init_registers_s390_linux32v2): Likewise.
	(init_registers_s390_linux64v1): Likewise.
	(init_registers_s390_linux64v2): Likewise.
	(init_registers_s390x_linux64v1): Likewise.
	(init_registers_s390x_linux64v2): Likewise.
	(s390_num_regs): Increment to 52.
	(s390_regmap): Add orig_r2 register.
	(s390_num_regs_3264): Increment to 68.
	(s390_regmap_3264): Add orig_r2 register.
	(s390_collect_ptrace_register): Handle orig_r2 register.
	(s390_supply_ptrace_register): Likewise.
	(s390_fill_last_break): New function.
	(s390_store_last_break): Likewise.
	(s390_fill_system_call): New function.
	(s390_store_system_call): Likewise.
	(target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
	register sets.
	(s390_check_regset): New function.
	(s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
	NT_S390_SYSTEM_CALL regsets and use appropriate description.
	Update target_regsets for available register sets.

testsuite/ChangeLog:

	* gdb.base/callfuncs.exp (fetch_all_registers): Filter out read-only
	last_break register on s390*-*-* targets.
2011-12-06 14:14:50 +00:00
Joel Brobecker b18003d168 fix incorrect assumption in gdb.ada/watch_arg
The testcase is assuming that the parameter being watched isn't being
modified. But the way the test program is written, this is not true
at all.  So this changes fixes the code to still reference the variable,
but in a way that does not modify its value.

gdb/testsuite:

        * gdb.ada/watch_arg/pck.ads, gdb.ada/watch_arg/pck.adb: New files.
        * gdb.ada/watch_arg/watch.adb: Adjust code to avoid modification
        of parameter X in procedure Foo.
2011-12-06 14:00:37 +00:00
Stan Shebs fe96589c7e * gdb.trace/tfind.exp: Update help string matches. 2011-12-05 23:32:52 +00:00
Jan Kratochvil 1820ab4711 gdb/testsuite/
* gdb.server/ext-run.exp (get process list): Accept also systemd
	as PID 1.
2011-12-05 18:27:44 +00:00
Jan Kratochvil e11ac3a350 gdb/testsuite/
* gdb.base/break-entry.exp: Move the target use_gdb_stub test before
	starting GDB.
	* gdb.base/default.exp: Replace target use_gdb_stub checks by global
	$use_gdb_stub.
	* gdb.base/display.exp: Likewise.
	* gdb.base/ending-run.exp: Likewise.
	* gdb.base/list.exp (test_listsize): Likewise.
	* gdb.base/setshow.exp: Likewise.
	* gdb.base/valgrind-db-attach.exp: Set global use_gdb_stub to 1.
	* lib/gdb.exp (gdb_run_cmd, gdb_start_cmd): Replace target use_gdb_stub
	check by global $use_gdb_stub.
	(gdb_test_multiple): Forbid run, start or attach for !$use_gdb_stub.
	(default_gdb_start): Set global use_gdb_stub from target use_gdb_stub.
	(default_gdb_init): Unset global $use_gdb_stub.
	(gdb_continue_to_end, rerun_to_main): Replace target use_gdb_stub check
	by global $use_gdb_stub.
	* lib/gdbserver-support.exp: Extend comments for set_board_info
	gdb_protocol and gdb,socketport.
	(gdbserver_start_extended): Set global gdbserver_protocol and
	gdbserver_gdbport.  Clear global use_gdb_stub.
	* lib/mi-support.exp (default_mi_gdb_start): Set global use_gdb_stub
	from target use_gdb_stub.
	(mi_run_cmd): Replace target use_gdb_stub check by global $use_gdb_stub.
2011-12-03 20:20:29 +00:00
Doug Evans 1d41d75cb6 * lib/gdb.exp (gdb_run_cmd, gdb_start_cmd, run_to_main): Add comments.
(gdb_step_for_stub): Add comments.
2011-12-03 18:01:50 +00:00
Maciej W. Rozycki d6d7a51a33 * lib/gdb.exp (gdb_expect): Pass all the exception conditions up
to the caller.
	(gdb_test_multiple): Likewise.
2011-12-02 23:58:01 +00:00
Jan Kratochvil 05acf27496 gdb/testsuite/
Fix gdb.mi/mi-solib.exp without system debug info installed.
	* lib/mi-support.exp (mi_expect_stop): Accept FILE also for `from'
	expect attribute, return 0 for it.  Update comments.
2011-12-02 22:35:17 +00:00
Jan Kratochvil 2268b414f4 gdb/
* Makefile.in (XMLFILES): Add library-list-svr4.dtd.
	* features/library-list-svr4.dtd: New file.
	* remote.c (PACKET_qXfer_libraries_svr4): New.
	(remote_protocol_features): new entry for PACKET_qXfer_libraries_svr4.
	(remote_xfer_partial): Handle TARGET_OBJECT_LIBRARIES_SVR4.
	* solib-svr4.c (struct svr4_library_list): New.
	[HAVE_LIBEXPAT]: Include xml-support.h.
	[HAVE_LIBEXPAT] (svr4_library_list_start_library)
	[HAVE_LIBEXPAT] (svr4_library_list_start_list, svr4_library_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_children)
	[HAVE_LIBEXPAT] (svr4_library_list_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_elements, svr4_parse_libraries)
	[HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries)
	[!HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries): New.
	(svr4_read_so_list): Extend the corruption message by addresses.
	(svr4_current_sos): New variable library_list, call
	svr4_current_sos_via_xfer_libraries.
	* target.h (enum target_object): New TARGET_OBJECT_LIBRARIES_SVR4.

gdb/gdbserver/
	* linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
	(read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
	New.
	(struct linux_target_ops): Install linux_qxfer_libraries_svr4.
	* linux-low.h (struct process_info_private): New member r_debug.
	* server.c (handle_qxfer_libraries): Call
	the_target->qxfer_libraries_svr4.
	(handle_qxfer_libraries_svr4): New function.
	(qxfer_packets): New entry "libraries-svr4".
	(handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
	* target.h (struct target_ops): New member qxfer_libraries_svr4.
	* remote.c (remote_xfer_partial): Call add_packet_config_cmd for
	PACKET_qXfer_libraries_svr4.

gdb/doc/
	* gdb.texinfo (Requirements, Remote Protocol): Reference also `Library
	List Format for SVR4 Targets'.
	(General Query Packets): New item qXfer:libraries-svr4:read.
	(Library List Format for SVR4 Targets): New node.

gdb/testsuite/
	* gdb.base/solib-corrupted.exp: Suppress test on is_remote target.
	(corrupted list): Adjust the expectation.
2011-12-02 22:26:54 +00:00
Jan Kratochvil 585861ead5 gdb/
PR threads/13448
	* dwarf2read.c (decode_locdesc): Handle DW_OP_const8u.
	For DW_OP_GNU_push_tls_address increment the value, new comment for it.

gdb/testsuite/
	PR threads/13448
	* gdb.dwarf2/dw2-var-zero-addr.S: New file.
	* gdb.dwarf2/dw2-var-zero-addr.exp: New file.
	* gdb.threads/tls-var-main.c: New file.
	* gdb.threads/tls-var.c: New file.
	* gdb.threads/tls-var.exp: New file.
2011-12-02 17:01:20 +00:00
Jan Kratochvil 968643aaa9 gdb/testsuite/
PR testsuite/12649
	* gdb.trace/collection.exp (gdb_collect_return_test): Import gdb_prompt.
	Protect gdb_test_multiple by final $gdb_prompt match.
	* gdb.trace/tspeed.exp (gdb_fast_trace_speed_test): Likewise.
	* gdb.trace/tstatus.exp (run_trace_experiment): Likewise.
	(test_tracepoints): Likewise.
2011-12-02 12:43:29 +00:00
Jan Kratochvil 9750bca92c gdb/
PR breakpoints/13346
	* dwarf2read.c (process_psymtab_comp_unit): Set
	PSYMTABS_ADDRMAP_SUPPORTED.
	* psympriv.h (struct partial_symtab): Comment textlow and texthigh
	validity.  New field psymtabs_addrmap_supported.
	* psymtab.c (find_pc_sect_psymtab_closer): New gdb_assert on
	psymtabs_addrmap_supported.
	(find_pc_sect_psymtab): Do not fallback to TEXTLOW and TEXTHIGH for
	!PSYMTABS_ADDRMAP_SUPPORTED.
	(dump_psymtab, maintenance_info_psymtabs): Print also
	psymtabs_addrmap_supported.

gdb/testsuite/
	PR breakpoints/13346
	* gdb.dwarf2/dw2-objfile-overlap-inner.S: New file.
	* gdb.dwarf2/dw2-objfile-overlap-outer.S: New file.
	* gdb.dwarf2/dw2-objfile-overlap.exp: New file.
2011-12-02 01:28:55 +00:00
Joel Brobecker ac1349b75a Make sure all types in gdb.ada/homonym testcase are used...
Otherwise, the compiler does not generate any debug info for them.
This fixes 3 FAILs:

    FAIL: gdb.ada/homonym.exp: ptype local_type_subtype at BREAK_1
    FAIL: gdb.ada/homonym.exp: ptype int_type at BREAK_1
    FAIL: gdb.ada/homonym.exp: ptype local_type_subtype at BREAK_2

gdb/testsuite/ChangeLog:

        * gdb.ada/homonym/pck.ads, gdb.ada/homonym/pck.adb: New files.
        * gdb.ada/homonym/homonym.adb: For use of all types defined
        locally inside both Get_Value subprograms.
2011-12-01 23:16:44 +00:00
Jan Kratochvil 26d44fafef gdb/testsuite/
Fix racy FAILs.
	* gdb.base/foll-exec.exp (zap_session): Use gdb_test_no_output instead
	of send_gdb.
2011-12-01 22:06:45 +00:00
Ulrich Weigand 514f64256c * gdb.base/testenv.exp: Skip on remote targets. Unset global
environment variable after test completed.
2011-11-30 08:25:17 +00:00
Ulrich Weigand 4255c8d248 * gdb.base/solib-nodir.exp: Skip if remote target.
* gdb.base/gdb.fortran.exp: Use shlib= flag when linking main
	application.  Call gdb_load_shlibs.
	* gdb.mi/mi-solib.exp: Use mi_load_shlibs instead of gdb_load_shlibs.
2011-11-30 08:24:32 +00:00
Joel Brobecker a35ad96ac8 New gdb.base/infoline.exp testcase.
gdb/testsuite/ChangeLog:

        * gdb.base/infoline.c, gdb.base/infoline.exp: New files.
2011-11-29 16:59:45 +00:00
Joel Brobecker 1a1d551388 wrong value returned by ada-lang.c:compare_names
The ada-lang.c:compare_names function returns the wrong value
when the first string starts with the same contents as the second
string, followed by '_' and then some characters that do not make
a symbol name suffix.  For instance:

    string1 = "generics__test_generics__instance__print"
    string2 = "generics__test_generics"

In that case, compare_names (string1, string2) return -1, when
clearly, string1 is greater than string2.

A consequence of this problem is that GDB may fail to lookup
"generics.test_generics" from our partial symtabs, because
partial symbols are ordered by strcmp_iw_ordered:

    (gdb) b generics.test_generics
    Function "generics.test_generics" not defined.
    Make breakpoint pending on future shared library load? (y or [n])

gdb/ChangeLog:

        * ada-lang.c (compare_names): Fix wrong return value in case
        string1 starts with the same contents as string2, followed
        by an underscore that do not start a symbol name suffix.

gdb/testsuite/ChangeLog:

        * gdb.ada/fullname_bp: New testcase.
2011-11-29 01:00:52 +00:00
Jan Kratochvil fb0aec578b gdb/testsuite/
Code cleanup.
	* gdb.reverse/i386-sse-reverse.exp (continue to end of sse4_test):
	Convert send_gdb and gdb_expect to gdb_test_multiple.
2011-11-25 23:53:45 +00:00
Jan Kratochvil 50b4ddf832 gdb/testsuite/
PR testsuite/12649
	* gdb.reverse/i386-sse-reverse.exp (continue to end of sse_test #2):
	Wrap send_gdb into a new gdb_test.
2011-11-25 23:50:15 +00:00
Jan Kratochvil 2376d946fa gdb/testsuite/
* gdb.base/jit-so.exp (one_jit_test): Add testcase name to log message.
2011-11-25 23:26:15 +00:00
Keith Seitz 1eec78bdad * lib/mi-support.exp (varobj_tree): New namespace and procs.
(mi_varobj_tree_test_children_callback): New proc.
	(mi_walk_varobj_tree): New proc.
2011-11-23 21:02:55 +00:00
Tom Tromey 36dfb11c8b gdb
PR mi/8444:
	* mi/mi-common.h (EXEC_ASYNC_SOLIB_EVENT, EXEC_ASYNC_FORK)
	(EXEC_ASYNC_VFORK, EXEC_ASYNC_SYSCALL_ENTRY)
	(EXEC_ASYNC_SYSCALL_RETURN, EXEC_ASYNC_EXEC): New constants.
	* mi/mi-common.c (async_reason_string_lookup): Add new reasons.
	* breakpoint.c (print_it_catch_fork, print_it_catch_vfork)
	(print_it_catch_syscall, print_it_catch_exec)
	(internal_bkpt_print_it): Use ui_out.  Emit stop reason.
	(bpstat_print): Add 'kind' argument.  Handle
	TARGET_WAITKIND_LOADED.
	* infrun.c (normal_stop): Update for bpstat_print change.  Don't
	handle TARGET_WAITKIND_LOADED here.
	* breakpoint.h (bpstat_print): Update.
gdb/testsuite
	* lib/mi-support.exp (mi_run_cmd_full): Rename from mi_run_cmd.
	Add "use_mi_command" argument.
	(mi_run_cmd, mi_run_with_cli): New procs.
	* gdb.mi/solib-lib.c: New file.
	* gdb.mi/solib-main.c: New file.
	* gdb.mi/mi-solib.exp: New file.
gdb/doc
	* gdb.texinfo (GDB/MI Async Records): Document new *stopped
	reasons.
2011-11-22 21:25:19 +00:00
Keith Seitz 56767571cc * gdb.mi/mi-var-display.exp: Remove XFAIL for c_variable-7.51,
-var-evaluate-expression of an enumeration and fix expected result.
	* gdb.mi/mi2-varvdisplay.exp: Likewise.
2011-11-21 21:53:50 +00:00
Doug Evans 0e965dd0b2 * gdb.cp/nextoverthrow.exp: Skip test if debug info for
_Unwind_DebugHook is missing.
2011-11-21 17:34:17 +00:00
Stan Shebs f196051f5e * NEWS: Mention tracepoint additions.
* breakpoint.h (struct tracepoint): New field traceframe_usage.
	* breakpoint.c (print_one_breakpoint_location): Identify
	tracepoints as such when reporting hit counts, report
	trace buffer usage.
	(create_tracepoint_from_upload): Copy status info.
	* tracepoint.h (struct trace_status): Rename error_desc to stop_desc,
	add fields user_name, notes, start_time, stop_time.
	(struct uploaded_tp): Add fields hit_count, traceframe_usage.
	* tracepoint.c (trace_user): New global.
	(trace_notes): New global.
	(trace_stop_notes): New global.
	(start_tracing): Add argument and trace note handling.
	(stop_tracing): Ditto.
	(trace_start_command): Add notes argument.
	(trace_stop_command): Ditto.
	(trace_status_command): Report additional status info.
	(trace_status_mi): Similarly.
	(trace_save): Update, record tracepoint status.
	(set_disconnected_tracing): Call target method directly.
	(send_disconnected_tracing_value): Remove.
	(set_trace_user): New function.
	(set_trace_notes): New function.
	(set_trace_stop_notes): New function.
	(parse_trace_status): Handle additional status.
	(parse_tracepoint_status): New function.
	(parse_tracepoint_definition): Call it.
	(tfile_get_tracepoint_status): New function.
	(init_tfile_ops): Use it.
	(_initialize_tracepoint): Add new setshows.
	* target.h (struct target_ops): New methods to_get_tracepoint_status
	and to_set_trace_notes.
	(target_get_tracepoint_status): New macro.
	(target_set_trace_notes): New macro.
	* target.c (update_current_target): Add new methods.
	* remote.c (remote_get_tracepoint_status): New function.
	(remote_set_trace_notes): New function.
	(init_remote_ops): Add them.
	* mi/mi-main.c (mi_cmd_trace_start): Add argument to call.
	(mi_cmd_trace_stop): Ditto.

	* tracepoint.c (struct tracepoint): New field traceframe_usage.
	(tracing_start_time): New global.
	(tracing_stop_time): New global.
	(tracing_user_name): New global.
	(tracing_notes): New global.
	(tracing_stop_note): New global.
	(cmd_qtstart): Set traceframe_usage, start_time.
	(stop_tracing): Set stop_time.
	(cmd_qtstatus): Report additional status.
	(cmd_qtp): New function.
	(handle_tracepoint_query): Call it.
	(cmd_qtnotes): New function.
	(handle_tracepoint_general_set): Call it.
	(get_timestamp): Rename from tsv_get_timestamp.

	* gdb.texinfo (Starting and Stopping Trace Experiments): Document
	note-related options and variables.
	(Tracepoint Packets): Document packet changes.

	* gdb.trace/tstatus.exp: New.
	* gdb.trace/actions.c: Include string.h.
2011-11-20 23:59:49 +00:00
Yao Qi bfccc43c12 gdb/
* breakpoint.c (create_breakpoint): Produce query message according to
	breakpoint's type.
	Allocate tracepoint per correct type.
	Don't check SALs for pending fast tracepoints.
	* tracepoint.c (process_tracepoint_on_disconnect): New.
	(disconnect_tracing): Call process_tracepoint_on_disconnect.

gdb/doc/
	* gdb.texinfo (Create and Delete Tracepoints): Mention pending
	tracepoint.

gdb/testsuite/
	* gdb.trace/pending.exp: New.
	* gdb.trace/pending.c: New.
	* gdb.trace/pendshr1.c: New.
	* gdb.trace/pendshr2.c: New.
	* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Check one
	tracepoint location becomes pending.
	(tracepoint_change_loc_2): New.
2011-11-18 01:21:35 +00:00
David S. Miller 73cd8ab132 * lib/gdb.exp (can_single_step_to_signal_handler): Return zero when
target is sparc*-*-linux*
2011-11-16 18:16:27 +00:00
Paul Koning 7742673004 * gdb.python/py-type.exp: New testcases for exceptions on scalar types 2011-11-15 21:17:40 +00:00
Doug Evans ed59ded5eb Make "!" an alias for "shell".
* NEWS: Add mention.
	* cli/cli-cmds.c (init_cli_cmds): Remove xdb_commands condition on
	adding "!" command, always add it.
	* cli/cli-decode.c (find_command_name_length): Recognize "!" as a
	command of length one.

	doc/
	* gdb.texinfo (Shell Commands): Document "!".

	testsuite/
	* gdb.base/shell.exp: New file.
2011-11-15 05:06:35 +00:00
Stan Shebs 405f8e9499 2011-11-14 Stan Shebs <stan@codesourcery.com>
Kwok Cheung Yeung  <kcy@codesourcery.com>

	* NEWS: Document shorter fast tracepoints and qTMinFTPILen packet.
	* i386-tdep.c (i386_fast_tracepoint_valid_at): Query target for
	the minimum instruction size for fast tracepoints.
	* target.h (struct target_ops): Add new method
	to_get_min_fast_tracepoint_insn_len.
	(target_get_min_fast_tracepoint_insn_len): New.
	* target.c (update_current_target): Set up new target operation.
	* remote.c (remote_write_bytes_aux): Fix typo.
	(remote_get_min_fast_tracepoint_insn_len): New.
	(init_remote_ops): Initialize new field.

	* gdb.texinfo (Create and Delete Tracepoints): Describe what is
	needed to get shorter fast tracepoints.
	(Tracepoint Packets): Document new qTMinFTPILen packet.

	* linux-x86-low.c (small_jump_insn): New.
	(i386_install_fast_tracepoint_jump_pad): Add arguments for
	trampoline and error message, build a trampoline and issue a small
	jump instruction to it.
	(x86_install_fast_tracepoint_jump_pad): Add arguments for
	trampoline and error message.
	(x86_get_min_fast_tracepoint_insn_len): New.
	(the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
	* linux-low.h (struct linux_target_ops): Add arguments to
	install_fast_tracepoint_jump_pad operation, add new operation.
	* linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
	arguments.
	(linux_get_min_fast_tracepoint_insn_len): New function.
	(linux_target_op): Add new operation.
	* tracepoint.c (gdb_trampoline_buffer): New IPA variable.
	(gdb_trampoline_buffer_end): Ditto.
	(gdb_trampoline_buffer_error): Ditto.
	(struct ipa_sym_addresses): Add fields for new IPA variables.
	(symbol_list): Add entries for new IPA variables.
	(struct tracepoint): Add fields to hold the address range of the
	trampoline used by the tracepoint.
	(trampoline_buffer_head): New static variable.
	(trampoline_buffer_tail): Ditto.
	(claim_trampoline_space): New function.
	(have_fast_tracepoint_trampoline_buffer): New function.
	(clone_fast_tracepoint): Fill in trampoline fields of tracepoint
	structure.
	(install_fast_tracepoint): Ditto, also add error buffer argument.
	(cmd_qtminftpilen): New function.
	(handle_tracepoint_query): Add response to qTMinFTPILen packet.
	(fast_tracepoint_from_trampoline_address): New function.
	(fast_tracepoint_collecting): Handle trampoline as part of jump
	pad space.
	(set_trampoline_buffer_space): New function.
	(initialize_tracepoint): Initialize new IPA variables.
	* target.h (struct target_ops): Add arguments to
	install_fast_tracepoint_jump_pad operation, add new
	get_min_fast_tracepoint_insn_len operation.
	(target_get_min_fast_tracepoint_insn_len): New.
	(install_fast_tracepoint_jump_pad): Add arguments.
	* server.h (IPA_BUFSIZ): Define.
	* linux-i386-ipa.c: Include extra header files.
	(initialize_fast_tracepoint_trampoline_buffer): New function.
	(initialize_low_tracepoint): Call it.
	* server.h (set_trampoline_buffer_space): Declare.
	(claim_trampoline_space): Ditto.
	(have_fast_tracepoint_trampoline_buffer): Ditto.

	* gdb.trace/ftrace.c: New.
	* gdb.trace/ftrace.exp: New.
2011-11-14 20:07:25 +00:00
Yao Qi 1e4d17643d gdb/
* remote.c (struct remote_state): <install_in_trace> new field.
	(PACKET_InstallInTrace): New enum value.
	(remote_install_in_trace_feature): Support InstallInTrace.
	(remote_supports_install_in_trace): Likewise.
	(remote_protocol_features): Likewise.
	(_initialize_remote): Likewise.
	(remote_can_download_tracepoint): New.
	* target.h (struct target): New field
	`to_can_download_tracepoint'.
	(target_can_download_tracepoint): New macro.
	* target.c (update_current_target): Update.
	* breakpoint.h (struct bp_location): Add comment on field
	`duplicate'.
	(should_be_inserted): Don't differentiate breakpoint and tracepoint.
	(remove_breakpoints): Don't remove tracepoints.
	(tracepoint_locations_match ): New.
	(breakpoint_locations_match): Call it.
	(disable_breakpoints_in_unloaded_shlib): Handle tracepoint.
	(download_tracepoint_locations): New.
	(update_global_location_list): Call it.
	* tracepoint.c (find_matching_tracepoint): Delete.
	(find_matching_tracepoint_location): Renamed from
	find_matching_tracepoint.  Return bp_location rather than
	tracepoint.
	(merge_uploaded_tracepoints): Set `inserted' field to 1 if
	tracepoint is found.

gdb/doc/
	* gdb.texinfo (Create and Delete Tracepoints): Describe changed
	behavior of tracepoint.
	(General Query Packets): New feature InstallInTrace.
	(Remote Configuration): Document "set remote
	install-in-trace-packet".

gdb/gdbserver/
	* server.c (handle_query): Handle InstallInTrace for qSupported.
	* tracepoint.c (add_tracepoint): Sort list.
	(install_tracepoint, download_tracepoint): New.
	(cmd_qtdp): Call them to install and download tracepoints.
	(sort_tracepoints): Removed.
	(cmd_qtstart): Update.

gdb/testsuite/
	* gdb.trace/change-loc-1.c: New.
	* gdb.trace/change-loc-2.c: New.
	* gdb.trace/change-loc.c: New.
	* gdb.trace/change-loc.exp:  New.
	* gdb.trace/change-loc.h:  New.
	* gdb.trace/trace-break.c (marker): Define new symbol.
	* gdb.trace/trace-break.exp (break_trace_same_addr_5):
        New.
	(break_trace_same_addr_6): New.
2011-11-14 15:18:54 +00:00
matt rice 71eba9c25e Move info definitions command to an info macro option. 2011-11-12 17:01:12 +00:00
Keith Seitz 1d93e29a97 PR gdb/12843
* gdb.base/linespecs.exp: New file.
2011-11-11 19:53:12 +00:00
Doug Evans a4b5b48aa8 * gdb.threads/print-threads.exp: Extend timeout for slower
tests.
2011-11-11 17:36:07 +00:00
Doug Evans 792a023056 * gdb.reverse/i387-env-reverse.exp: Extend timeout of
"record to end of main" test.
2011-11-10 19:22:07 +00:00
Doug Evans f6b47be484 * python/py-type.c (typy_fields_items): Call check_typedef.
testsuite/
	* gdb.python/py-type.c (TS): New typedef.
	(ts): New global.
	* gdb.python/py-type.exp: Test field list of typedef.
2011-11-10 19:15:10 +00:00
Joel Brobecker 22355c9080 read_frame_register_value and big endian arches
The read_frame_register_value function as it was implemented introduced
a regression on big-endian targets. The problem appears when trying to
get the value of an entity stored inside a register, and when the size
of the entity is smaller than the size of the register. In that case,
we were always reading the first N bytes of the register, which is wrong
for big-endian architectures, where we need to read the last N bytes of
the register.

gdb/ChangeLog:

        * findvar.c (read_frame_register_value): Read correct bytes from
        register on big-endian architectures.

gdb/testsuite/ChangeLog:

        * gdb.ada/small_reg_param: New testcase.
2011-11-10 17:14:41 +00:00
Tom Tromey a7860e76c9 gdb
PR c++/13342:
	* valops.c (value_full_object): Return early if real type is
	smaller than the enclosing type.
gdb/testsuite
	* gdb.cp/destrprint.exp: New file.
	* gdb.cp/destrprint.cc: New file.
2011-11-09 19:50:15 +00:00
Meador Inge 72a2e3dcf5 gdb/
* arm-tdep.c (thumb_analyze_prologue): Always fallback on the SP
register when the frame can't be determined.
* arm-tdep.c (arm_analyze_prologue): Ditto.

gdb/testsuite/
* gdb.arch/thumb-prologue.c (switch_stack_to_same): New test function.
(switch_stack_to_other): New test function.
* gdb.arch/thumb-prologue.exp: New test cases.
2011-11-09 00:53:40 +00:00