Commit Graph

32857 Commits

Author SHA1 Message Date
Gary Benson afacd7f34a 2013-06-04 Gary Benson <gbenson@redhat.com>
* gdb.base/break-probes.exp: New file.
	* gdb.base/break-probes.c: Likewise.
	* gdb.base/break-probes-solib.c: Likewise.
	* gdb.base/info-shared.exp: New file.
	* gdb.base/info-shared.c: Likewise.
	* gdb.base/info-shared-solib1.c: Likewise.
	* gdb.base/info-shared-solib2.c: Likewise.
2013-06-04 13:31:00 +00:00
Gary Benson a29a3fb7a3 2013-06-04 Jan Kratochvil <jan.kratochvil@redhat.com>
Gary Benson  <gbenson@redhat.com>

	* lib/gdb.exp (build_executable_from_specs): Use gdb_compile_pthread,
	gdb_compile_shlib or gdb_compile_shlib_pthreads where appropriate.
	* lib/prelink-support.exp (build_executable_own_libs): Allow INTERP
	to be set to "no" to indicate that no ld.so copy should be made.
	* gdb.base/break-interp.exp (solib_bp): New constant.
	(reach_1): Use the above instead of "_dl_debug_state".
	(test_attach): Likewise.
	(test_ld): Likewise.
	* gdb.threads/dlopen-libpthread.exp: New file.
	* gdb.threads/dlopen-libpthread.c: Likewise.
	* gdb.threads/dlopen-libpthread-lib.c: Likewise.
	* gdb.base/solib-corrupted.exp: Disable test if GDB is using probes.
2013-06-04 13:23:32 +00:00
Gary Benson f9e148520a 2013-06-04 Gary Benson <gbenson@redhat.com>
* breakpoint.h (handle_solib_event): Moved function declaration
	to solib.h.
	* breakpoint.c (handle_solib_event): Moved function to solib.c.
	(bpstat_stop_status): Pass new argument to handle_solib_event.
	* solib.h (update_solib_breakpoints): New function declaration.
	(handle_solib_event): Moved function declaration from
	breakpoint.h.
	* solib.c (update_solib_breakpoints): New function.
	(handle_solib_event): Moved function from breakpoint.c.
	Updated to call solib_ops->handle_event if not NULL.
	* solist.h (target_so_ops): New fields "update_breakpoints" and
	"handle_event".
	* infrun.c (set_stop_on_solib_events): New function.
	(_initialize_infrun): Use the above for "set
	stop-on-solib-events".
	(handle_inferior_event): Pass new argument to handle_solib_event.
	* solib-svr4.c (probe.h): New include.
	(svr4_free_library_list): New forward declaration.
	(probe_action): New enum.
	(probe_info): New struct.
	(probe_info): New static variable.
	(NUM_PROBES): New definition.
	(svr4_info): New fields "using_xfer", "probes_table" and
	"solib_list".
	(free_probes_table): New function.
	(free_solib_list): New function.
	(svr4_pspace_data_cleanup): Free probes table and solib list.
	(svr4_copy_library_list): New function.
	(svr4_current_sos_via_xfer_libraries): New parameter "annex".
	(svr4_read_so_list): New parameter "prev_lm".
	(svr4_current_sos_direct): Renamed from "svr4_current_sos".
	(svr4_current_sos): New function.
	(probe_and_action): New struct.
	(hash_probe_and_action): New function.
	(equal_probe_and_action): Likewise.
	(register_solib_event_probe): Likewise.
	(solib_event_probe_at): Likewise.
	(solib_event_probe_action): Likewise.
	(solist_update_full): Likewise.
	(solist_update_incremental): Likewise.
	(disable_probes_interface_cleanup): Likewise.
	(svr4_handle_solib_event): Likewise.
	(svr4_update_solib_event_breakpoint): Likewise.
	(svr4_update_solib_event_breakpoints): Likewise.
	(svr4_create_solib_event_breakpoints): Likewise.
	(enable_break): Free probes table before creating breakpoints.
	Use svr4_create_solib_event_breakpoints to create breakpoints.
	(svr4_solib_create_inferior_hook): Free the solib list.
	(_initialize_svr4_solib): Initialise
	svr4_so_ops.handle_solib_event and svr4_so_ops.update_breakpoints.
2013-06-04 13:17:06 +00:00
Gary Benson ced63ec087 2013-06-04 Gary Benson <gbenson@redhat.com>
* target.h (target_ops): New field
	"to_augmented_libraries_svr4_read".
	(target_augmented_libraries_svr4_read): New macro.
	* target.c (update_current_target): Handle
	to_augmented_libraries_svr4_read.
	* remote.c (remote_state): New field
	"augmented_libraries_svr4_read".
	(remote_augmented_libraries_svr4_read_feature): New function.
	(remote_protocol_features): Add entry for
	"augmented-libraries-svr4-read".
	(remote_augmented_libraries_svr4_read): New function.
	(init_remote_ops): Initialize
	remote_ops.to_augmented_libraries_svr4_read.
2013-06-04 13:10:53 +00:00
Gary Benson 85dc5a128b 2013-06-04 Gary Benson <gbenson@redhat.com>
* gdb.texinfo (General Query Packets/qSupported): Added
	"qXfer:libraries-svr4:read" and "augmented-libraries-svr4-read".
	to the table of currently defined stub features.
	Added a more detailed entry for "augmented-libraries-svr4-read".
	(General Query Packets/qXfer:libraries-svr4:read): Documented
	the augmented form of this packet.
2013-06-04 13:07:45 +00:00
Gary Benson 7f91dbec54 2013-06-04 Gary Benson <gbenson@redhat.com>
* NEWS: Update.
2013-06-04 13:02:15 +00:00
Gary Benson b1fbec6251 2013-06-04 Gary Benson <gbenson@redhat.com>
* server.c (handle_query): Add "augmented-libraries-svr4-read+"
	to qSupported response when appropriate.
	(handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
	with nonzero-length annex.
	* linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
	arguments supplied in annex.
2013-06-04 12:59:21 +00:00
Gary Benson 607ece04f4 2013-06-04 Gary Benson <gbenson@redhat.com>
* objfiles.h (inhibit_section_map_updates): New function
	declaration.
	(resume_section_map_updates): Likewise.
	(resume_section_map_updates_cleanup): Likewise.
	* objfiles.c (objfile_pspace_info): Removed field
	"objfiles_changed_p".  New fields "new_objfiles_available",
	"section_map_dirty" and "inhibit_updates".
	(allocate_objfile): Set new_objfiles_available.
	(free_objfile): Set section_map_dirty.
	(objfile_relocate1): Likewise.
	(in_plt_section): Likewise.
	(find_pc_section): Update the conditions under which the
	section map will be updated.
	(inhibit_section_map_updates): New function.
	(resume_section_map_updates): Likewise.
	(resume_section_map_updates_cleanup): Likewise.
2013-06-04 12:53:34 +00:00
Gary Benson 9ee6a5acd5 2013-06-04 Gary Benson <gbenson@redhat.com>
* probe.h (get_probe_argument_count): New declaration.
	(evaluate_probe_argument): Likewise.
	* probe.c (get_probe_argument_count): New function.
	(evaluate_probe_argument): Likewise.
	(probe_safe_evaluate_at_pc): Use the above new functions.
2013-06-04 12:50:21 +00:00
Alan Modra 845d47080b * ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
* rs6000-tdep.c (read_insn): Add frame param, don't assume big-endian.
	(ppc_insns_match_pattern): Add frame param.  Avoid multiple
	target mem reads on optional insns.
	* ppc-linux-tdep.c (ppc_skip_trampoline_code): Update
	ppc_insns_match_pattern calls.
	* ppc64-tdep.c (ppc64_standard_linkage2, ppc64_standard_linkage3):
	Add match for power7 thread safety insns, and new order of
	std 2,40(1) insn.  Correct code shown for _dl_runtime_resolve
	invocation in comment, and update rest of comment.
	(PPC64_STANDARD_LINKAGE1_LEN, PPC64_STANDARD_LINKAGE2_LEN,
	PPC64_STANDARD_LINKAGE3_LEN): Delete.
	(ppc64_standard_linkage2_target): Update insn offsets.
	(ppc64_skip_trampoline_code): Use a single insn buffer.  Match newer
	stubs first.  Update calls.
2013-06-04 02:44:35 +00:00
Yao Qi 404e278f8d gdb/
* solib.c (solib_find): Don't need dir separator if path has
	drive spec.
2013-06-04 01:33:31 +00:00
gdbadmin 0e8faa7b6e *** empty log message *** 2013-06-04 00:00:32 +00:00
Joel Brobecker f6aea118f8 Revert "fix cleanup handling in macho_symfile_read"
This patch indirectly causes a SEGV by creating a dangling pointer.
Reverting this patch while working on a clearer memory management
method for this part of the code.

gdb/Changelog:

        Revert:
        * machoread.c (macho_symfile_read): Assign first cleanup to
        'back_to'.
2013-06-03 13:22:29 +00:00
Yao Qi 87967e273f gdb/
* mi/mi-cmd-var.c (mi_no_values, mi_simple_values): Move to
	mi-parse.c.  Make them static.
	(mi_all_values): Likewise.
	(mi_parse_values_option): Move to mi-parse.c.  Rename it to
	mi_parse_print_values.  Make it external.
	* mi/mi-cmds.h (mi_no_values, mi_simple_values, mi_all_values):
	Remove the declarations.
	* mi/mi-parse.c (mi_parse_print_values): Moved from mi-cmd-var.c.
	* mi/mi-parse.h (mi_parse_print_values): Declare.
	* mi/mi-cmd-stack.c: Include mi-parse.h.
	(parse_print_values): Remove
	(mi_cmd_stack_list_locals): Call mi_parse_print_values instead
	of parse_print_values.
	(mi_cmd_stack_list_args, mi_cmd_stack_list_variables): Likewise.
2013-06-03 03:16:24 +00:00
gdbadmin 2590d1455c *** empty log message *** 2013-06-03 00:00:03 +00:00
gdbadmin e55608f4cc *** empty log message *** 2013-06-02 00:00:32 +00:00
gdbadmin bb8779ef82 *** empty log message *** 2013-06-01 00:00:02 +00:00
Doug Evans d1ec4ce7c9 * linux-x86-low.c (ps_get_thread_area): Properly extend address to
64 bits in 64-cross-32 environment.
2013-05-31 19:14:33 +00:00
Yao Qi 3ca73e0c7d gdb/
* tracepoint.c (all_tracepoint_actions_and_cleanup): Declare.
	(encode_actions): Move code to ...
	(all_tracepoint_actions_and_cleanup): ... here.  New.
	(trace_dump_command): Likewise.
2013-05-31 10:06:02 +00:00
gdbadmin e8de40a833 *** empty log message *** 2013-05-31 00:00:32 +00:00
Tom Tromey 4e993a190a maintenance_expand_symtabs leaks a cleanup
It turns out that maintenance_expand_symtabs was missing a call to
do_cleanups.  I found this using the cleanup checker.

	* symmisc.c (maintenance_expand_symtabs): Call do_cleanups.
2013-05-30 17:44:54 +00:00
Tom Tromey e3b76b4f44 fix up xml-support.c
xml-support.c has a function that returns a cleanup via an out parameter.

This changes this function to be a normal cleanup constructor --
returning the cleanup directly and returning the other result via an
out parameter.

This is sort of a hack, but it lets the checker work here.

I also noticed that gdb_xml_create_parser_and_cleanup does not need to
be exported any more.

	* xml-support.c (gdb_xml_create_parser_and_cleanup): Rename from
	gdb_xml_create_parser_and_cleanup_1.  Return a cleanup.  Remove
	'old_chain' argument.  Add 'parser_result' argument.
	(gdb_xml_create_parser_and_cleanup): Remove old version.
	(gdb_xml_parse_quick): Update.
	(xml_process_xincludes): Update.
	* xml-support.h (gdb_xml_create_parser_and_cleanup): Don't
	declare.
2013-05-30 17:41:38 +00:00
Tom Tromey db26349c64 fix compile_rx_or_error
compile_rx_or_error looks like a constructor, but it can return NULL.
This patch changes it to remove the NULL return, making it work
like any other cleanup constructor.

This is a stylistic patch but I think it is also better for code to
follow the normal conventions.

	* probe.c (collect_probes): Check arguments for NULL before
	calling compile_rx_or_error.
	* utils.c (compile_rx_or_error): Require 'rx' to be non-NULL.
	Remove NULL return.
2013-05-30 17:39:34 +00:00
Tom Tromey 77f9e71302 some fixes to infrun.c
This fixes some of the problems in infrun.c that the checker reported.
I filed the remaining problems as bugs.

This patch is purely stylistic.

	* infrun.c (adjust_pc_after_break): Introduce an outer null
	cleanup.
2013-05-30 17:37:50 +00:00
Tom Tromey 45475de718 fix mi-cmd-var.c
This is a stylistic change in mi-cmd-var.c that adds outer cleanups
where needed by the checker.

	* mi/mi-cmd-var.c (varobj_update_one): Add an outer null cleanup.
2013-05-30 17:37:12 +00:00
Tom Tromey ac5007fd4e fix cli-script.c
read_command_lines_1 had some (IMNSHO) spaghetti-ish code for cleanup
handling.  This makes the code much simpler to understand, by
introducing an outer cleanup.

This is another case where a stylistic change for the checker is also
nice for the reader.

	* cli/cli-script.c (read_command_lines_1): Use a null cleanup
	for 'old_chain'.  Do not check 'head' before processing
	cleanups.
2013-05-30 17:36:29 +00:00
Tom Tromey cd82eddcf1 fix mi-cmd-stack.c
mi-cmd-stack.d had a conditional cleanup, "cleanup_tuple" that
confused the checker.  However, there was no need for this, since it
was only used via do_cleanups at the end of the function, just before
another call to do_cleanups.

So, while this is a stylistic patch for the checker, I also consider
it a generic improvement for readers of the code.

	* mi/mi-cmd-stack.c (list_arg_or_local): Remove
	"cleanup_tuple".
2013-05-30 17:35:40 +00:00
Tom Tromey 57cee33aee fix dbxread.c
This is a stylistic change to make some code in dbxread.c analyzable
by the checker.

	* dbxread.c (dbx_read_symtab): Declare 'back_to' in a more
	inner scope.  Unconditionally call do_cleanups.
2013-05-30 17:34:18 +00:00
Tom Tromey 795d915c9b fix source.c
find_and_open_source can leak a cleanup.

	* source.c (find_and_open_source): Call do_cleanups.
2013-05-30 17:33:41 +00:00
Tom Tromey 1fc3cf4a5a fix linux-thread-db.c
This is a stylistic change to make it so the checker can analyze a
function in linux-thread-db.c.

	* linux-thread-db.c (thread_db_load_search): Unconditionally
	call do_cleanups.
2013-05-30 17:31:48 +00:00
Tom Tromey e35ac9bf5c fix in solib-aix.c
solib_aix_bfd_open has an early "return" that doesn't run cleanups.
This fixes the problem by dropping the null_cleanup and using a later
cleanup as the master cleanup for the function.

	* solib-aix.c (solib_aix_bfd_open): Don't use a null cleanup
	for 'cleanup'; instead use a later one.
2013-05-30 17:31:00 +00:00
Tom Tromey f330038710 use explicit returns to avoid checker confusion
The checker does not understand the idiom

if (except.reason < 0) {
   do_cleanups (whatever);
   GDB_PY_HANDLE_EXCEPTION (except);
}

because it doesn't realize that the nested 'if' actually has the same
condition.

This fixes instances of this to be more explicit.

	* python/py-breakpoint.c (bppy_get_commands): Use
	explicit, unconditional return.
	* python/py-frame.c (frapy_read_var): Likewise.
	* python/python.c (gdbpy_decode_line): Likewise.
2013-05-30 17:30:03 +00:00
Tom Tromey c27e16e3f1 fix cp-namespace.c
cp_lookup_symbol_imports_or_template could return without
running cleanups.

	* cp-namespace.c (cp_lookup_symbol_imports_or_template): Call
	do_cleanups on all return paths.
2013-05-30 17:29:06 +00:00
Tom Tromey 5ae85e4448 fix top.c
execute_command can leak a cleanup along one return path.

	* top.c (execute_command): Discard 'cleanup_if_error' cleanups.
2013-05-30 17:27:44 +00:00
Tom Tromey 73b8d9dab1 fix one bug in stabsread.c
Some code in stabsread.c can return without running cleanups.

	* stabsread.c (read_struct_type): Call do_cleanups along
	all return paths.
2013-05-30 17:25:15 +00:00
Maciej W. Rozycki 7d26658403 * mips-linux-tdep.c: Adjust formatting throughout. 2013-05-30 17:23:05 +00:00
Tom Tromey 0f900f54b5 fix mipsread.c
Some code in mipsread.c could leak cleanups along some return paths.

	* mipsread.c (read_alphacoff_dynamic_symtab): Call do_cleanups
	along all return paths.
2013-05-30 17:21:51 +00:00
Tom Tromey a991ac289d fix one bug in symfile.c
find_separate_debug_file could leak a cleanup along some return paths.

	* symfile.c (find_separate_debug_file): Call do_cleanups
	along all return paths.
2013-05-30 17:21:15 +00:00
Tom Tromey 1abaf0423f fix symtab.c
search_symbols had some bad code resulting in a cleanup being both
discarded and run.

	* symtab.c (search_symbols): Introduce a null cleanup for
	'retval_chain'.
2013-05-30 17:20:02 +00:00
Tom Tromey edefe1dab2 fix py-value.c
Some code in py-value.c could exit a loop without running some
cleanups made in the loop.

	* python/py-value.c (valpy_binop): Call do_cleanups before
	exiting loop.
2013-05-30 17:18:54 +00:00
Tom Tromey 54f72dcc36 fix py-prettyprint.c
print_children, in py-prettyprint.c, could call do_cleanups twice on
the same cleanup.

	* python/py-prettyprint.c (print_children): Remove extra
	do_cleanups call.
2013-05-30 17:17:25 +00:00
Tom Tromey af1c697129 fix py-frame.c
A couple return paths in frapy_read_var were missing do_cleanups calls.

	* python/py-frame.c (frapy_read_var): Call do_cleanups along
	all return paths.
2013-05-30 17:16:05 +00:00
Tom Tromey b862ce75d2 fix py-breakpoint.c
One return path in bppy_get_commands was missing a do_cleanups call.

	* python/py-breakpoint.c (bppy_get_commands): Call do_cleanups
	along all return paths.
2013-05-30 17:14:35 +00:00
Tom Tromey e12fefc804 simplify cli-logging.c for analysis
This is another stylistic patch.  It changes cli-logging.c to be
analyzable by the checker, again following the method of adding an
outer cleanup and unconditionally calling do_cleanups.

	* cli/cli-logging.c (set_logging_redirect): Unconditionally
	call do_cleanups.
2013-05-30 17:13:19 +00:00
Tom Tromey 4867f990df fix varobj.c
c_value_of_root is missing a call to do_cleanups at one return.
This fixes the problem by removing that return and letting control
fall through.

	* varobj.c (c_value_of_root): Call do_cleanups along all
	return paths.
2013-05-30 17:11:38 +00:00
Tom Tromey 4fd2d6afa0 make a cleanup unconditionally in tracepoint.c
This is another cosmetic patch.  It introduces an "outer" cleanup in
trace_dump_command and arranges to unconditionally call do_cleanups.
This lets the checker analyze the function.

	* tracepoint.c (trace_dump_command): Unconditionally call
	do_cleanups.
2013-05-30 17:10:41 +00:00
Tom Tromey 752eb8b456 fix two buglets in breakpoint.c
First, output_thread_groups leaks a cleanup along one return path.

Second, parse_cmd_to_aexpr could return without running its cleanups,
if there was an exception in a TRY_CATCH.

	* breakpoint.c (output_thread_groups, parse_cmd_to_aexpr): Call
	do_cleanups earlier.
2013-05-30 17:09:02 +00:00
Tom Tromey e42d0aa5ba fix cleanup handling in macho_symfile_read
macho_symfile_read leaks a cleanup by assigning to 'back_to' too late.

	* machoread.c (macho_symfile_read): Assign first cleanup to
	'back_to'.
2013-05-30 17:06:31 +00:00
Tom Tromey 4bbc010a2d fix cleanup handling in m32r_load
m32r_load is missing a call to do_cleanups along one return path.

	* m32r-rom.c (m32r_load): Call do_cleanups at all returns.
2013-05-30 17:05:32 +00:00
Tom Tromey b963592585 fix list_available_thread_groups
list_available_thread_groups, in mi-main.c, leaks a cleanup.
This changes it to call do_cleanups.

	* mi/mi-main.c (list_available_thread_groups): Call do_cleanups.
2013-05-30 17:04:47 +00:00
Tom Tromey 25f4350049 cleanup fixes for inf-ptrace.c
This is one of the stylistic patches.  The code here in inf-ptrace.c
is not incorrect, but it is in a style that the cleanup checker cannot
handle.  This patch changes it to a simpler style, following the usual
method of introducing an unconditional "outer" cleanup.

	* inf-ptrace.c (inf_ptrace_create_inferior): Unconditionally
	call discard_cleanups.
	(inf_ptrace_attach): Likewise.
2013-05-30 17:04:03 +00:00
Tom Tromey d6a2e54a5d cleanup fixes for remote-mips.c
remote-mips.c has a few 'return's where cleanups are not run.

	* remote-mips.c (mips_exit_debug): Call do_cleanups on all
	return paths.
	(mips_initialize): Likewise.
	(common_open): Call do_cleanups.
2013-05-30 17:03:00 +00:00
Tom Tromey 48be7c1b92 fix up cleanup handling in internal_vproblem
internal_vproblem can return, so this introduces proper cleanup
handling there.  Otherwise it may make a cleanup that is leaked.

	* utils.c (internal_vproblem): Call do_cleanups.
2013-05-30 17:01:16 +00:00
Tom Tromey e61727abf0 fix linespec bug noticed by the checker
This fixes a linespec bug noticed by the cleanup checker.

find_linespec_symbols did this:

  cleanup = demangle_for_lookup (name, state->language->la_language,
				 &lookup_name);
[...]
      cleanup = make_cleanup (xfree, canon);

But this is wrong, as it makes a subsequent call to do_cleanups not
clean up all the local state.

	* linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'.
2013-05-30 16:57:38 +00:00
Tom Tromey b81b921f79 remove erroneous return from setup_user_args
This fixes setup_user_args to drop a useless and confusing "return".

	* cli/cli-script.c (setup_user_args): Don't return after error.
2013-05-30 16:31:33 +00:00
Tom Tromey fe48dfb1ce fix cleanups in som_symtab_read
This fixes som_symtab_read not to leak cleanups.

	* somread.c (som_symtab_read): Call do_cleanups.
2013-05-30 16:28:29 +00:00
Tom Tromey 27833de78f fix print_command_1
This is a stylistic patch to make it so the checker can analyze
print_command_1.  This amounts to installing an outer cleanup and
unconditionally invoking it.

	* printcmd.c (print_command_1): Unconditionally call do_cleanups.
2013-05-30 16:25:49 +00:00
Tom Tromey 5b3fca71ae some cleanup checker fixes
Fix some bugs pointed out by the cleanup checker.  This one just fixes
some simple CLI reports, where CLI commands know that their caller
will do cleanups.  This an older style with few instances, so it is
simpler to fix them up than to teach the checker about it.

	* cli/cli-cmds.c (cd_command, alias_command): Call do_cleanups.
	* cli/cli-dump.c (restore_binary_file): Call do_cleanups.
	* interps.c (interpreter_exec_cmd): Call do_cleanups.
	* source.c (show_substitute_path_command): Call do_cleanups.
	(unset_substitute_path_command, set_substitute_path_command):
	Likewise.
	* symfile.c (load_command): Call do_cleanups.
2013-05-30 16:24:36 +00:00
Tom Tromey af83e3f886 add the cleanup checker
This patch adds the cleanup checker.  This is a Python plugin for GCC
that checks some rules for cleanup handling.  In particular it tries
to notice when cleanups are left dangling at the end of a function.

It does this by applying a few simple rules.

First, it understands that a function whose return type is "struct
cleanup *" is a "cleanup constructor".  Such functions are expected to
return the first cleanup that they make.

Then, it has the notion of a "master cleanup".  The checker keeps a
stack of all cleanups made in a basic block.  The first element is
pushed on the stack is the master cleanup -- the one that must later
be passed to either do_cleanups or discard_cleanups.

It is not perfect -- some constructs confuse it.  So, part of this
series rewrites some code in gdb so that it is analyzable.  I'll note
these spots and you can decide whether or not this is a good idea.

This patch also changes gcc-with-excheck to give it options.  Now you
must use either -Xc (for the cleanup checker) or -Xx (for the
exception checker).

	* contrib/cleanup_check.py: New file.
	* contrib/gcc-with-excheck: Add option parsing.
2013-05-30 16:22:06 +00:00
Joel Brobecker 564eac4292 windows_delete_thread: Add missing space in cast expression
gdb/ChangeLog:

	* windows-nat.c (windows_delete_thread): Add missing space
	in cast expression.
2013-05-30 13:52:31 +00:00
Hafiz Abid Qadeer 4790207643 2013-05-30 Hafiz Abid Qadeer <abidh@codesourcery.com>
* inferior.c (top level): Include tilde.h.
	(add_inferior_command): Call tilde_expand on the value of 'exec'
	argument.
2013-05-30 12:54:17 +00:00
Yao Qi 23da373ae1 gdb/
* tracepoint.c (encode_actions_1): Remove parameter 't'.
	Caller update.
	(encode_actions): Likewise.
	* remote.c (remote_download_tracepoint): Caller update.
	* tracepoint.h (encode_actions): Update declaration.
2013-05-30 09:29:18 +00:00
Pedro Alves a6e6f79133 Fix build breakage with Python 2.4.
With Python 2.4, we see this build failure:

./python/python-internal.h: In function 'gdb_Py_DECREF':
./python/python-internal.h:179: warning: dereferencing 'void *' pointer
./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union

Python 2.4 forgets to cast 'op' to PyObject pointer on the ob_refcnt
accesses:

  #define Py_DECREF(op)                                   \
          if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
              --(op)->ob_refcnt != 0)                     \
                  _Py_CHECK_REFCNT(op)                    \
          else                                            \
                  _Py_Dealloc((PyObject *)(op))

...

  #define _Py_CHECK_REFCNT(OP)                                    \
  {       if ((OP)->ob_refcnt < 0)                                \
                  _Py_NegativeRefcount(__FILE__, __LINE__,        \
                                       (PyObject *)(OP));         \
  }

Python 2.7:

  #define Py_DECREF(op)                                   \
      do {                                                \
          if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA       \
          --((PyObject*)(op))->ob_refcnt != 0)            \
              _Py_CHECK_REFCNT(op)                        \
          else                                            \
          _Py_Dealloc((PyObject *)(op));                  \
      } while (0)

...

  #define _Py_CHECK_REFCNT(OP)                                    \
  {       if (((PyObject*)OP)->ob_refcnt < 0)                             \
                  _Py_NegativeRefcount(__FILE__, __LINE__,        \
                                       (PyObject *)(OP));         \
  }

gdb/
2013-05-30  Pedro Alves  <palves@redhat.com>

	* python/python-internal.h (gdb_Py_DECREF): Cast OP to PyObject
	pointer.
2013-05-30 08:56:56 +00:00
Yao Qi 36d25514de gdb/
* remote.c (remote_check_symbols): Remove unused parameter
	'objfile'.
	Declaration update.
	(remote_start_remote, remote_new_objfile): Caller update.
2013-05-30 00:40:21 +00:00
Yao Qi 62a813ccaf gdb/
* mi/mi-cmds.c (mi_cmds): Define MI command
	'-exec-arguments' by macro DEF_MI_CMD_CLI_1 instead of
	DEF_MI_CMD_CLI.

gdb/testsuite/
	* gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed):
	Add a test that no MI notification is emitted when executing
	-exec-arguments.
2013-05-30 00:25:16 +00:00
gdbadmin c0f316436d *** empty log message *** 2013-05-30 00:00:32 +00:00
Pedro Alves 28439a30ac [remote] Insert breakpoints in the right process.
I noticed that gdb.multi/multi-arch.exp wasn't passing with
extended-remote GDBserver with my pending multi-process+multi-arch
series anymore on current mainline, while it used to pass before:

 (gdb) run
 Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/ma-hangout
 Process /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/ma-hangout created; pid = 32067
 Warning:
 Cannot insert breakpoint 2.
 Error accessing memory address 0x4005c2: Unknown error -1.
 Cannot insert breakpoint -1.
 Temporarily disabling shared library breakpoints:
 breakpoint #-1

 (gdb) FAIL: gdb.multi/multi-arch.exp: starting inferior 2


Investigating manually, I found an easy way to reproduce.  You just
need breakpoints on distinct inferiors, and a way to have GDB install
them in one go:

 (gdb) set breakpoint always-inserted on
 (gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 2       breakpoint     del  n   <MULTIPLE>
 2.1                         y     0x00000000004005c2 in main at ../../../src/gdb/testsuite/gdb.multi/hello.c:40 inf 1
 2.2                         y     0x08048475         in main at ../../../src/gdb/testsuite/gdb.multi/hangout.c:22 inf 2
 (gdb) enable 2
 Warning:
 Cannot insert breakpoint 2.
 Error accessing memory address 0x4005c2: Unknown error -1.

And turning on remote debugging, we see:

 (gdb) set debug remote 1
 (gdb) disable 2
 (gdb) enable 2
 Sending packet: $Z0,4005c2,1#71...Packet received: E01
 Sending packet: $Z0,8048475,1#87...Packet received: OK
 Warning:
 Cannot insert breakpoint 2.
 Error accessing memory address 0x4005c2: Unknown error -1.

Notice that each of those Z0 breakpoints should be set in different
processes.  However, no Hg packet to select a process has been sent in
between, so GDBserver tries to plant both on the same process that
happens to be current.  The first Z0 then not so surprisingly fails.
IOW, the blame is on GDB, for telling GDBserver to plant both
breakpoints in the same process.

remote.c has a lazy scheme where it keeps a local cache of the
remote's selected general thread, and delays updating it on the remote
side until necessary (memory/register reads/writes, etc.).  This is
done to reduce RSP traffic.  The bug is that the Zx breakpoint
insert/remove methods weren't committing the selected thread/process
back to the remote side:

 Breakpoint 3, remote_insert_breakpoint (gdbarch=0x1383ae0, bp_tgt=0x140c2b0) at ../../src/gdb/remote.c:8148
 8148      if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE)
 (top-gdb) p inferior_ptid
 $3 = {pid = 3670, lwp = 0, tid = 3670}
 (top-gdb) p general_thread
 $4 = {pid = 3671, lwp = 0, tid = 3671}

IOW, a call to set_general_process is missing.

I did some auditing over remote.c, and added calls to all places I
found missing it.

This only used to work by chance before.  breakpoint.c switches to a
thread of the target process before installing a breakpoint location.
That calls switch_to_thread.  Before:

 2012-07-27  Yao Qi  <yao@codesourcery.com>

         * thread.c (switch_to_thread): Don't call registers_changed.

that caused the register caches to all be flushed and refetched before
installing the breakpoint location.  Given fetching registers commits
the remote general thread (with Hg), masking out the latent bug.

Tested on x86_64 Fedora 17 with GDBserver.

gdb/
2013-05-29  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_insert_breakpoint, remote_remove_breakpoint)
	(remote_insert_watchpoint, remote_remove_watchpoint)
	(remote_insert_hw_breakpoint, remote_remove_hw_breakpoint)
	(remote_verify_memory, compare_sections_command)
	(remote_search_memory): Set the general process/thread on the
	remote side.
2013-05-29 11:57:48 +00:00
Pedro Alves 6ac1c0821e [AArch64] Remove all traces of aarch64-without-fpu.xml.
The aarch64-without-fpu description is unused.

Linux requires an FPU, so the AArch64 native port always returns the
with-fpu variant:

static const struct target_desc *
aarch64_linux_read_description (struct target_ops *ops)
{
  initialize_tdesc_aarch64 ();
  return tdesc_aarch64;
}

When the target doesn't report a target description at all, we
fallback to a register set with an FPU:

aarch64_gdbarch_init ()
...
  if (!tdesc_has_registers (tdesc))
    tdesc = tdesc_aarch64;

This just removes the dead description.

Tested by building on x86_64 Fedora 17 with --enable=targets=all.

gdb/
2013-05-29  Pedro Alves  <palves@redhat.com>

	* aarch64-tdep.c: Don't include "features/aarch64-without-fpu.c".
	(_initialize_aarch64_tdep): Don't call
	initialize_tdesc_aarch64_without_fpu.
	* features/Makefile (WHICH): Remove reference to
	aarch64-without-fpu.
	* features/aarch64-without-fpu.c: Delete file.
	* regformats/aarch64-without-fpu.dat: Delete file.
2013-05-29 09:18:48 +00:00
gdbadmin 177565ddef *** empty log message *** 2013-05-29 00:00:02 +00:00
Pedro Alves 9b25f2d30c [GDBserver][AArch64] Remove references to aarch64-without-fpu.xml.
The GDBserver Aarch64 port includes the aarch64-without-fpu
description in the build, but doesn't actually use it anywhere.  As
Linux always requires an FPU, just remove the dead code.

gdb/gdbserver/
2013-05-28  Pedro Alves  <palves@redhat.com>

	* Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
	(aarch64-without-fpu.c): Delete rule.
	* configure.srv (aarch64*-*-linux*): Remove references to
	aarch64-without-fpu.o and aarch64-without-fpu.xml.
	* linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
	declaration.
2013-05-28 10:41:17 +00:00
Yao Qi a73e3634d1 gdb/
* tracepoint.c (stringify_collection_list): Remove parameter
	'string'.
	(encode_actions): Caller update.  Remove local variables.
2013-05-28 02:55:04 +00:00
gdbadmin 18e17b047d *** empty log message *** 2013-05-28 00:00:02 +00:00
gdbadmin 0513b0a3e8 *** empty log message *** 2013-05-27 00:00:03 +00:00
gdbadmin 89ca6a248b *** empty log message *** 2013-05-26 00:00:02 +00:00
gdbadmin b5cc0fabb4 *** empty log message *** 2013-05-25 00:00:03 +00:00
Jan Kratochvil 8f56dad4bb gdb/testsuite/
PR testsuite/12649
	* gdb.mi/mi-dprintf.exp (mi_continue_dprintf) (mi 2nd dprintf): Replace
	$mi_gdb_prompt expectation by mi_expect_stop.
	(mi 1st dprintf, agent, mi 2nd dprintf, agent)
	(mi info dprintf second time): Replace them by mi_send_resuming_command
	and mi_expect_stop.
2013-05-24 15:37:25 +00:00
Gary Benson c588eb206c 2013-05-24 Gary Benson <gbenson@redhat.com>
* gdb.base/solib-disc.exp (exec_opts): Remove unnecesary
	backslash.
	* gdb.base/unload.exp (exec_opts): Remove two unnecessary
	backslashes.
	* gdb.base/watchpoint-solib.exp (exec_opts): Remove unnecesary
	backslash.
2013-05-24 14:02:35 +00:00
Yao Qi c0ea94eb34 gdb/
* tracepoint.c (TFILE_PID): Remove.
	(tfile_open): Don't add thread and inferior.
	(tfile_close): Don't set 'inferior_ptid'.  Don't call
	exit_inferior_silent.
	(tfile_thread_alive): Remove.
	(init_tfile_ops): Don't set field 'to_thread_alive' of
	tfile_ops.

gdb/testsuite/

	* gdb.trace/tfile.exp: Test inferior and thread.
2013-05-24 12:27:39 +00:00
Pedro Alves 6740dc9c3e [gdbserver] Don't assume vCont;r ADDR1,ADDR2 comes with a ptid attached.
This bit:

+	  p1 = strchr (p, ':');
+	  decode_address (&resume_info[i].step_range_end, p, p1 - p);

should not expect the ':' to be there.  An action without a ptid is
valid:

 "If an action is specified with no thread-id, then it is applied to any
 threads that don't have a specific action specified"

This is handled further below:

      if (p[0] == 0)
	{
	  resume_info[i].thread = minus_one_ptid;
	  default_action = resume_info[i];

	  /* Note: we don't increment i here, we'll overwrite this entry
	     the next time through.  */
	}
      else if (p[0] == ':')

A stub that doesn't support and report to gdb thread ids at all (like
metal metal targets) only will always only see a single default action
with no ptid.

Use unpack_varlen_hex instead of decode_address.  The former doesn't
need to be told where the hex number ends, and it actually returns
that info instead, which we can use for validation.

Tested on x86_64 Fedora 17.

gdb/gdbserver/
2013-05-24  Pedro Alves  <palves@redhat.com>

	* server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
	instead of strchr/decode_address.  Error if the range isn't split
	with a ','.  Don't assume there's be a ':' in the action.
2013-05-24 11:28:06 +00:00
Yao Qi db1ac43683 gdb/testsuite/
* gdb.base/range-stepping.exp: Skip the rest of tests if the
	test fails.
	* lib/range-stepping-support.exp (exec_cmd_expect_vCont_count):
	Return 0 if the test passes, otherwise return 1.
2013-05-24 09:57:12 +00:00
Joel Brobecker 5901af59c9 Fix gdb.info build failure
gdb.texinfo:36367: `Installed System-wide Configuration Scripts' has no Up field (perhaps incorrect sectioning?).
    gdb.texinfo:36367: warning: unreferenced node `Installed System-wide Configuration Scripts'.

gdb/doc/ChangeLog:

        * gdb.texinfo (System-wide Configuration Scripts): Renames
        "Installed System-wide Configuration Scripts". Add associated
        @menu block.
2013-05-24 04:50:26 +00:00
Doug Evans c0803dc23a Update to load fission.exp. 2013-05-24 01:33:50 +00:00
Doug Evans b6abb10ccc * boards/fission-dwp.exp: New file. 2013-05-24 01:30:05 +00:00
Doug Evans 20d7f21139 * contrib/cc-with-tweaks.sh (-p): Handle no dwo files. 2013-05-24 00:30:24 +00:00
gdbadmin e6ec244956 *** empty log message *** 2013-05-24 00:00:02 +00:00
Pedro Alves 8658d16d9d common/filestuff.c: No sockets on DJGPP.
Building gdb with --host=i586-pc-msdosdjgpp ends up with:

 i586-pc-msdosdjgpp-gcc -g -O2 -I../../src/gdb/config/djgpp  -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber -I./../intl -I../../src/gdb/gnulib/import -Ibuild-gnulib/import    -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o filestuff.o -MT filestuff.o -MMD -MP -MF .deps/filestuff.Tpo ../../src/gdb/common/filestuff.c
 ../../src/gdb/common/filestuff.c:38:24: fatal error: sys/socket.h: No such file or directory

There are no sockets on djgpp.  This #ifdef's out the bits in the file
that use sockets, depending on whether winsock or sys/socket.h is
available.

As alternative approach, given ser-tcp.c, ser-pipe.c, etc. are split
into separate files, and which to use is selected by configure.ac:

 dnl Figure out which of the many generic ser-*.c files the _host_ supports.
 SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
 case ${host} in
  *go32* ) SER_HARDWIRE=ser-go32.o ;;
  *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
  *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;;
 esac
 AC_SUBST(SER_HARDWIRE)

... I considered splitting filestuff.c similarly.  But I quickly gave
up on the idea, as it looked like a lot more complication over this
approach, for no real gain.  Plus, there are uses of these functions
outside the ser*.c framework.

gdbserver's configure.ac is already checking for sys/socket.h.

gdb/
2013-05-23  Pedro Alves  <palves@redhat.com>

	* common/filestuff.c [USE_WIN32API]: Define HAVE_SOCKETS.
	[HAVE_SYS_SOCKET_H]: Define HAVE_SOCKETS.
	(socket_mark_cloexec, gdb_socketpair_cloexec, gdb_socket_cloexec):
	Only define if HAVE_SOCKETS is defined.
	* configure.ac: Check for sys/socket.h.
	* config.in, configure: Regenerate.
2013-05-23 18:37:00 +00:00
Pedro Alves 21aa081e21 dwarf2read.c: Don't assume uint32_t is unsigned int on all hosts.
Building gdb on GNU/Linux, for --host=i586-pc-msdosdjgpp, I get:

 ../../src/gdb/dwarf2read.c: In function 'create_dwp_hash_table':
 ../../src/gdb/dwarf2read.c:8626:7: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format]
 ../../src/gdb/dwarf2read.c:8632:7: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format]
 ../../src/gdb/dwarf2read.c: In function 'create_dwo_in_dwp':
 ../../src/gdb/dwarf2read.c:8754:6: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' [-Werror=format]
 ../../src/gdb/dwarf2read.c: In function 'open_and_init_dwp_file':
 ../../src/gdb/dwarf2read.c:9248:6: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format]
 ../../src/gdb/dwarf2read.c:9248:6: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format]

And:

 $ grep uint32_t /usr/i586-pc-msdosdjgpp/sys-include/*
 /usr/i586-pc-msdosdjgpp/sys-include/stdint.h:typedef unsigned long uint32_t;

As decided on the discussion at
<http://sourceware.org/ml/gdb-patches/2013-05/msg00788.html>, use
pulongest rather than PRIu32.

Tested on F17.  Also confirmed GDB still builds OK with
--host=i686-w64-mingw32.

gdb/
2013-05-23  Pedro Alves  <palves@redhat.com>

	* dwarf2read.c (create_dwp_hash_table, create_dwo_in_dwp)
	(open_and_init_dwp_file): Use %s/pulongest instead of %u for
	printing uint32_t variables.
2013-05-23 18:31:29 +00:00
Pedro Alves bc5065a70f range stepping: tests
This adds tests to verify range stepping is used as expected, by
inspecting the RSP traffic, looking for vCont;s and vCont;r packets.

gdb/testsuite/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.base/range-stepping.c: New file.
	* gdb.base/range-stepping.exp: New file.
	* gdb.trace/range-stepping.c: New file.
	* gdb.trace/range-stepping.exp: New file.
	* lib/range-stepping-support.exp: New file.
2013-05-23 17:19:05 +00:00
Pedro Alves c2d6af84da range stepping: gdbserver (x86 GNU/Linux)
This patch adds support for range stepping to GDBserver, teaching it
about vCont;r.

It'd be easy to enable this for all hardware single-step targets
without needing the linux_target_ops hook, however, at least PPC needs
special care, due to the fact that PPC atomic sequences can't be
hardware single-stepped through, a thing which GDBserver doesn't know
about.  So this leaves the support limited to x86/x86_64.

gdb/
2013-05-23  Pedro Alves  <palves@redhat.com>

	* NEWS: Mention GDBserver range stepping support.

gdb/gdbserver/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* linux-low.c (lwp_in_step_range): New function.
	(linux_wait_1): If the thread was range stepping and stopped
	outside the stepping range, report the stop to GDB.  Otherwise,
	continue stepping.  Add range stepping debug output.
	(linux_set_resume_request): Copy the step range from the resume
	request to the lwp.
	(linux_supports_range_stepping): New.
	(linux_target_ops) <supports_range_stepping>: Set to
	linux_supports_range_stepping.
	* linux-low.h (struct linux_target_ops)
	<supports_range_stepping>: New field.
	(struct lwp_info) <step_range_start, step_range_end>: New fields.
	* linux-x86-low.c (x86_supports_range_stepping): New.
	(the_low_target) <supports_range_stepping>: Set to
	x86_supports_range_stepping.
	* server.c (handle_v_cont): Handle 'r' action.
	(handle_v_requests): Append ";r" if the target supports range
	stepping.
	* target.h (struct thread_resume) <step_range_start,
	step_range_end>: New fields.
	(struct target_ops) <supports_range_stepping>:
	New field.
	(target_supports_range_stepping): New macro.
2013-05-23 17:17:50 +00:00
Pedro Alves c1e36e3e91 range stepping: gdb
This patch teaches GDB to take advantage of target-assisted range
stepping.  It adds a new 'r ADDR1,ADDR2' action to vCont (vCont;r),
meaning, "step once, and keep stepping as long as the thread is in the
[ADDR1,ADDR2) range".

Rationale:

When user issues the "step" command on the following line of source,

   a = b + c + d * e - a;

GDB single-steps every single instruction until the program reaches a
new different line.  E.g., on x86_64, that line compiles to:

   0x08048434 <+65>:    mov    0x1c(%esp),%eax
   0x08048438 <+69>:    mov    0x30(%esp),%edx
   0x0804843c <+73>:    add    %eax,%edx
   0x0804843e <+75>:    mov    0x18(%esp),%eax
   0x08048442 <+79>:    imul   0x2c(%esp),%eax
   0x08048447 <+84>:    add    %edx,%eax
   0x08048449 <+86>:    sub    0x34(%esp),%eax
   0x0804844d <+90>:    mov    %eax,0x34(%esp)
   0x08048451 <+94>:    mov    0x1c(%esp),%eax

and the following is the RSP traffic between GDB and GDBserver:

 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:3c840408;thread:p2e13.2e13;core:1;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:3e840408;thread:p2e13.2e13;core:2;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:42840408;thread:p2e13.2e13;core:2;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:47840408;thread:p2e13.2e13;core:0;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:49840408;thread:p2e13.2e13;core:0;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:4d840408;thread:p2e13.2e13;core:0;
 --> vCont;s:p2e13.2e13;c
 <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2e13.2e13;core:0;

IOW, a lot of roundtrips between GDB and GDBserver.

If we add a new command to the RSP, meaning "keep stepping and don't
report a stop until the program goes out of the [0x08048434,
0x08048451) address range", then the RSP traffic can be reduced down
to:

 --> vCont;r8048434,8048451:p2db0.2db0;c
 <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2db0.2db0;core:1;

As number of packets is reduced dramatically, the performance of
stepping source lines is much improved.

In case something is wrong with range stepping on the stub side, the
debug info or even gdb, this adds a "set/show range-stepping" command
to be able to turn range stepping off.

gdb/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdbthread.h (struct thread_control_state) <may_range_step>: New
	field.
	* infcmd.c (step_once, until_next_command): Enable range stepping.
	* infrun.c (displaced_step_prepare): Disable range stepping.
	(resume): Disable range stepping if stepping over a breakpoint or
	we have software watchpoints.  If range stepping is enabled,
	assert the thread is in the stepping range.
	(clear_proceed_status_thread): Clear may_range_step.
	(handle_inferior_event): Disable range stepping as soon as we know
	the thread that hit the event.  Re-enable it whenever we're going
	to step with a step range.
	* remote.c (struct vCont_action_support) <r>: New field.
	(use_range_stepping): New global.
	(remote_vcont_probe): Handle 'r' action.
	(append_resumption): Append an 'r' action if the thread may range
	step.
	(show_range_stepping): New function.
	(set_range_stepping): New function.
	(_initialize_remote): Call add_setshow_boolean_cmd to register the
	'set range-stepping' and 'show range-stepping' commands.
	* NEWS: Mention range stepping, the new vCont;r action, and the
	new "set/show range-stepping" commands.

gdb/doc/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.texinfo (Packets): Document 'vCont;r'.
	(Continuing and Stepping): Document target-assisted range
	stepping, and the 'set range-stepping' and 'show range-stepping'
	commands.
2013-05-23 17:15:35 +00:00
Pedro Alves d458bd84a8 Convert rs->support_vCont_t to a struct.
Convert the 'support_vCont_t' int field to a struct, in preparation
for adding more fields to it.

gdb/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* remote.c (struct vCont_action_support): New struct.
	(struct remote_state) <support_vCont_t>: Remove field.
	<vCont_actions_support>: New field.
	(remote_vcont_probe, remote_stop_ns): Update.
2013-05-23 17:13:57 +00:00
Pedro Alves ce4c476a0f Factor out in-stepping-range checks.
This adds a function for doing within-thread's-stepping-range checks,
and converts a couple spots to use it.  Following patches will add
more uses.

gdb/
2013-05-23  Yao Qi  <yao@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdbthread.h (pc_in_thread_step_range): New declaration.
	* thread.c (pc_in_thread_step_range): New function.
	* infrun.c (handle_inferior_event): Use it.
2013-05-23 17:12:51 +00:00
Joel Brobecker ce70887aa8 mi/mi-cmd-break.c: Use xsnprintf instead of sprintf (ARI fix)
gdb/ChangeLog:

        * mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
        of sprintf.
2013-05-23 06:39:42 +00:00
Joel Brobecker 0201faace7 Document new <data-dir>/system-gdbinit area
gdb/doc/ChangeLog:

        * gdb.texinfo (Installed System-wide Configuration Scripts):
        Add subsection describing the scripts now available under
        the data-dir's system-gdbbinit subdirectory.
        * NEWS: Add entry announcing the availability of system-wide
        configuration scripts for ElinOS and Wind River Linux.
2013-05-23 06:00:53 +00:00
gdbadmin 5fd133faea *** empty log message *** 2013-05-23 00:00:03 +00:00
Keith Seitz 55b87a526f * ada-lang.c (is_known_support_routine): Add explicit free of
'func_name' from find_frame_funname.
	(ada_unhandled_exception_name_addr_from_raise): Add cleanups
	for func_name from find_frame_funname.
	* python/py-frame.c (frapy_name): Add explicit free of
	'name' from find_frame_funname.
	* stack.c (find_frame_funname): Add comment explaining that
	funcp must be freed by the caller.
	Return copy of symbol names instead of pointers.
	(print_frame): Add a cleanup for 'funname' from
	find_frame_funname.
	* stack.h (find_frame_funname): Remove "const" from
	'funname' parameter.
2013-05-22 21:16:18 +00:00
Tom Tromey 5f2e6b00f8 PR c++/15401:
* c-valprint.c (c_value_print): Use value_addr for
	references.  Convert back to reference type with value_ref.
gdb/testsuite
	* gdb.cp/class2.cc (main): New local 'aref'.
	* gdb.cp/class2.exp: Check printing of 'aref'.
2013-05-22 20:51:49 +00:00
Doug Evans e6ba475a03 * gdb.threads/wp-replication.c (main): Insert some code at the start
to ensure the breakpoint on main is only hit once.  Fix comment.
2013-05-22 16:30:24 +00:00
Eli Zaretskii d85c48475f Fix reporting of DLL unload events on MS-Windows.
gdb/windows-nat.c (handle_unload_dll): Don't call solib_add for the
 unloaded DLL, it will be done by handle_solib_event.  See
 http://sourceware.org/ml/gdb-patches/2013-05/msg00713.html for the
 details.
2013-05-22 16:18:12 +00:00
Phil Muldoon 54eb231c4b 2013-05-22 Phil Muldoon <pmuldoon@redhat.com>
* ui-out.c: Create typedef ui_out_level_p and define vector
	operations for that type.
	(struct ui_out): Use a vector instead of an array.
	(current_level): Return level from a vector.
	(push_level): Create a level in a vector.
	(pop_level): Delete a level in a vector.
	(ui_out_new): Create initial level zero level, and store in a
	vector.
	(ui_out_destroy): Add vector cleanup.
2013-05-22 12:27:13 +00:00
Pedro Alves ac90359cdc Let the ARI know gdb_Py_DECREF is OK.
The ARI complains with:

> gdb/python/python-internal.h:177: code: editCase function: Function name starts lower case but has uppercased letters.
gdb/python/python-internal.h:177:gdb_Py_DECREF (void *op)

gdb_Py_DECREF is just wrapping a python macro that happens to be mixed case.

gdb/
2013-05-22  Pedro Alves  <palves@redhat.com>

	* python/python-internal.h (gdb_Py_DECREF): Tag with
	"ARI: editCase function".
2013-05-22 09:31:44 +00:00
gdbadmin 6415af12e6 *** empty log message *** 2013-05-22 00:00:03 +00:00
Paul Pluzhnikov 6dcc1893b6 2013-05-21 Paul Pluzhnikov <ppluzhnikov@google.com>
* solib-svr4.c (svr4_free_so): Protect against NULL dereference.
2013-05-21 23:41:29 +00:00
Pedro Alves c8c735b963 py_decref: Don't check for NULL before calling Py_DECREF.
The only difference between Py_DECREF and Py_XDECREF is that the latter allows passing
in a NULL object, while the former prohibits it.  Given that, it's natural to expect
the same from py_decref vs py_xdecref.

gdb/
2013-05-21  Pedro Alves  <palves@redhat.com>

	* python/py-prettyprint.c (apply_val_pretty_printer): Check
	whether PRINTER is NULL before installing a Py_DECREF cleanup.
	* python/py-utils.c (py_decref): Don't check for NULL before
	calling Py_DECREF.
2013-05-21 20:53:21 +00:00
Pedro Alves 1915daebe6 Centralize workaround for Python 2.6's Py_DECREF.
Wrap/redefine Py_DECREF ourselves, avoiding the need for uses to care
about extra braces due to the fact that Python only started wrapping Py_DECREF
in 'do {} while (0)' after 2.6.

gdb/
2013-05-21  Pedro Alves  <palves@redhat.com>

	* python/py-utils.c (py_decref): Remove extra braces.
	(gdb_pymodule_addobject): Remove extra braces.
	* python-internal.h (gdb_Py_DECREF): New static inline function.
	(Py_DECREF): Redefine as calling gdb_Py_DECREF.
2013-05-21 20:52:30 +00:00
Keith Seitz 52c935b6f5 * gdb.base/filesym.exp: Use gdb_test_multiple instead of
gdb_expect.
	Add test to flush the remaining input buffer so that this
	file passes testsuite/12649.
2013-05-21 19:11:50 +00:00
Philippe Waroquiers bd9673a4de Fix internal error caused by interaction between catch signal and fork 2013-05-21 18:47:05 +00:00
Sterling Augustine 69a97597d5 2013-05-21 Sterling Augustine <saugustine@google.com>
* boards/remote-stdio-gdbserver.exp: New file.
2013-05-21 17:58:46 +00:00
Jan Kratochvil ff6009d09a gdb/
Workaround Python 2.6.
	* python/py-utils.c (gdb_pymodule_addobject): Wrap Py_DECREF into
	a block.
2013-05-21 15:02:28 +00:00
Jan Kratochvil 44e9736318 gdb/testsuite/
PR testsuite/12649
	* gdb.mi/mi-dprintf.exp (mi_continue_dprintf): Fix expect strings for
	racy matches.
2013-05-21 15:00:32 +00:00
Jan Kratochvil 3641da115a gdb/
Code cleanup: constification.
	* solib.c (solib_ops): Make return type and ops variable type const.
	(set_solib_ops): Make the new_ops parameter and ops variable const.
	(solib_find, solib_map_sections, clear_so, free_so, update_solib_list)
	(solib_add, solib_keep_data_in_core, clear_solib)
	(solib_create_inferior_hook, in_solib_dynsym_resolve_code)
	(reload_shared_libraries, solib_global_lookup): Make the ops variable
	const.
	* solib.h (set_solib_ops): Make the new_ops parameter const.
2013-05-21 08:16:10 +00:00
Christian Groessler 023928657e * gdb.dwarf2/dw2-dir-file-name.exp: Don't use brace expansion,
since it's not supported in all shells.
2013-05-21 07:25:51 +00:00
Joel Brobecker 776af39ed7 Add new system-gdbinit infrastructure
gdb/ChangeLog:

        * data-directory/Makefile.in (SYSTEM_GDBINIT_SRCDIR): New
        variable.
        (VPATH): Add SYSTEM_GDBINIT_SRCDIR.
        (SYSTEM_GDBINIT_DIR, SYSTEM_GDBINIT_INSTALL_DIR)
        (SYSTEM_GDBINIT_FILES): New variables.
        (all): Add stamp-system-gdbinit.
        (stamp-system-gdbinit): New rule.
        (clean-system-gdbinit, install-system-gdbinit)
        (uninstall-system-gdbinit): New rules.  Make them .PHONY.
        (install-only): Add dependency on install-system-gdbinit.
        (uninstall): Add dependency on uninstall-system-gdbinit.
        (clean): Add dependency on clean-system-gdbinit.
        * system-gdbinit/elinos.py: New file.
        * system-gdbinit/wrs-linux.py: New file.
2013-05-21 06:50:12 +00:00
Joel Brobecker 1509e5737f [Ada] Fix cleanup leak in ada-lang.c:old_renaming_is_invisible
gdb/ChangeLog:

	* ada-lang.c (old_renaming_is_invisible): Fix cleanup leak.
2013-05-21 05:41:31 +00:00
Hui Zhu c5867ab65c 2013-05-21 Hui Zhu <hui@codesourcery.com>
* breakpoint.c (dprintf_breakpoint_ops): Remove its static.
	* breakpoint.h (dprintf_breakpoint_ops): Add extern.
	* mi/mi-cmd-break.c (ctype.h): New include.
	(gdb_obstack.h): New include.
	(mi_argv_to_format, mi_cmd_break_insert_1): New.
	(mi_cmd_break_insert): Call mi_cmd_break_insert_1.
	(mi_cmd_dprintf_insert): New.
	* mi/mi-cmds.c (mi_cmds): Add "dprintf-insert".
	* mi/mi-cmds.h (mi_cmd_dprintf_insert): New extern.

2013-05-21  Hui Zhu  <hui@codesourcery.com>

	* gdb.texinfo (GDB/MI Breakpoint Commands): Describe the
	"-dprintf-insert" command.

2013-05-21  Hui Zhu  <hui@codesourcery.com>

	* gdb.mi/Makefile.in (PROGS): Add "mi-dprintf".
	* gdb.mi/mi-dprintf.exp, gdb.mi/mi-dprintf.c: New.
2013-05-21 04:18:55 +00:00
gdbadmin a825696a06 *** empty log message *** 2013-05-21 00:00:32 +00:00
Doug Evans 6c9e2db469 * lib/dwarf.exp (Dwarf): New variable _abbrev_section.
(_handle_DW_TAG): Use it.
	(cu, tu): Replace parameters is_64, version, addr_size with options.
	All callers updated.  Add Fission support.
	* gdb.dwarf2/implptrconst.exp: Update callers of "cu".
	* gdb.dwarf2/method-ptr.exp: Ditto.
	* gdb.dwarf2/nostaticblock.exp: Ditto.
	* gdb.dwarf2/subrange.exp: Ditto.
	* gdb.dwarf2/missing-sig-type.exp: Update callers of "cu", "tu".
2013-05-20 22:11:37 +00:00
Tom Tromey 4a6e676ceb * gdb.gdb/python-selftest.exp: New file. 2013-05-20 20:43:28 +00:00
Tom Tromey 7d38e38f3f * python/py-prettyprint.c (search_pp_list): Decref 'attr'. 2013-05-20 20:39:31 +00:00
Tom Tromey 97b77b3951 * python/py-value.c (valpy_get_dynamic_type): Simplify
dynamic_type assignment.  Use Py_XINCREF.
2013-05-20 20:38:47 +00:00
Tom Tromey 53e6647928 * python/py-type.c (typy_fields): Unconditionally decref 'r'. 2013-05-20 20:37:48 +00:00
Tom Tromey dcf8783234 * python/py-frame.c (frapy_older, frapy_newer, gdbpy_newest_frame)
(gdbpy_selected_frame): Move object-construction code
	out of TRY_CATCH.
2013-05-20 20:37:06 +00:00
Tom Tromey aa36459a92 * python/py-arch.c (gdbpy_initialize_arch): Use
gdb_pymodule_addobject.
	* python/py-block.c (gdbpy_initialize_blocks): Use
	gdb_pymodule_addobject.
	* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Use
	gdb_pymodule_addobject.
	* python/py-cmd.c (gdbpy_initialize_breakpoints): Use
	gdb_pymodule_addobject.
	* python/py-event.c (gdbpy_initialize_event_generic): Use
	gdb_pymodule_addobject.
	* python/py-evtregistry.c (gdbpy_initialize_eventregistry): Use
	gdb_pymodule_addobject.
	* python/py-evts.c (add_new_registry): Use
	gdb_pymodule_addobject.
	(gdbpy_initialize_py_events): Likewise.
	* python/py-finishbreakpoint.c
	(gdbpy_initialize_finishbreakpoints): Use
	gdb_pymodule_addobject.
	* python/py-frame.c (gdbpy_initialize_frames): Use
	gdb_pymodule_addobject.
	* python/py-function.c (gdbpy_initialize_functions): Use
	gdb_pymodule_addobject.
	* python/py-inferior.c (gdbpy_initialize_inferior): Use
	gdb_pymodule_addobject.
	* python/py-infthread.c (gdbpy_initialize_thread): Use
	gdb_pymodule_addobject.
	* python/py-objfile.c (gdbpy_initialize_objfile): Use
	gdb_pymodule_addobject.
	* python/py-param.c (gdbpy_initialize_parameters): Use
	gdb_pymodule_addobject.
	* python/py-progspace.c (gdbpy_initialize_pspace): Use
	gdb_pymodule_addobject.
	* python/py-symbol.c (gdbpy_initialize_symbols): Use
	gdb_pymodule_addobject.
	* python/py-symtab.c (gdbpy_initialize_symtabs): Use
	gdb_pymodule_addobject.
	* python/py-type.c (gdbpy_initialize_types): Use
	gdb_pymodule_addobject.
	* python/py-utils.c (gdb_pymodule_addobject): New function.
	* python/py-value.c (gdbpy_initialize_values): Use
	gdb_pymodule_addobject.
	* python/python-internal.h (gdb_pymodule_addobject): Declare.
	* python/python.c (_initialize_python): Use
	gdb_pymodule_addobject.
2013-05-20 20:36:19 +00:00
Tom Tromey 3d4a3c3ea2 * python/py-cmd.c (cmdpy_completer): Use explicit decref.
* python/py-param.c (get_set_value, get_show_value): Use
	explicit decrefs.
	* python/python.c (start_type_printers, apply_type_printers):
	Use explicit decrefs.
2013-05-20 20:34:49 +00:00
Tom Tromey 72ff8829c1 * python/py-evts.c (gdbpy_initialize_py_events): Don't
incref the module.
2013-05-20 20:34:11 +00:00
Tom Tromey 02146ba51f * python/python.c (gdbpy_run_events): Decref the result
of PyObject_CallObject.
2013-05-20 20:32:56 +00:00
Tom Tromey 33ee792fe5 * python/py-symtab.c (set_sal): Use
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.  Return -1 on error.
	(symtab_and_line_to_sal_object): Update.
2013-05-20 20:31:18 +00:00
Tom Tromey fcb49fc817 * python/py-param.c (compute_enum_values): Decref 'item'. 2013-05-20 20:30:24 +00:00
Tom Tromey 0646da15da * mi/mi-main.c: Include python-internal.h.
(mi_cmd_list_features): Check gdb_python_initialized.
	* python/py-inferior.c (python_on_normal_stop, python_on_resume)
	(python_inferior_exit, python_new_objfile, add_thread_object)
	(delete_thread_object, py_free_inferior): Check
	gdb_python_initialized.
	* python/py-prettyprint.c (apply_val_pretty_printer): Check
	gdb_python_initialized.
	* python/py-type.c (save_objfile_types): Check
	gdb_python_initialized.
	* python/python-internal.h (gdb_python_initialized): Declare.
	* python/python.c (ensure_python_env): Throw exception if
	Python not initialized.
	(before_prompt_hook, source_python_script_for_objfile)
	(start_type_printers, apply_type_printers,
	free_type_printers): Check gdb_python_initialized.
	* varobj.c (varobj_get_display_hint)
	(dynamic_varobj_has_child_method, update_dynamic_varobj_children)
	(install_new_value_visualizer, varobj_set_visualizer)
	(value_get_print_value): Check gdb_python_initialized.
2013-05-20 20:29:44 +00:00
Tom Tromey 999633ede7 * python/py-arch.c (gdbpy_initialize_arch): Return 'int'.
Check errors.
	* python/py-auto-load.c (gdbpy_initialize_auto_load): Return 'int'.
	* python/py-block.c (gdbpy_initialize_blocks): Return 'int'.
	Check errors.
	* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Return 'int'.
	Check errors.
	* python/py-cmd.c (gdbpy_initialize_commands): Return 'int'.
	Check errors.
	* python/py-event.c (gdbpy_initialize_event): Return 'int'.
	Check errors.
	* python/py-event.h (GDBPY_NEW_EVENT_TYPE): Change generated
	init function to return 'int'.
	* python/py-evtregistry.c (gdbpy_initialize_eventregistry):
	Return 'int'.  Check errors.
	* python/py-evts.c (gdbpy_initialize_py_events): Return 'int'.
	Check errors.
	* python/py-finishbreakpoint.c (gdbpy_initialize_finishbreakpoints):
	Return 'int'.  Check errors.
	* python/py-frame.c (gdbpy_initialize_frames): Return 'int'.
	Check errors.
	* python/py-function.c (gdbpy_initialize_functions): Return 'int'.
	Check errors.
	* python/py-gdb-readline.c (gdbpy_initialize_gdb_readline):
	Check errors.
	* python/py-inferior.c (gdbpy_initialize_inferior): Return 'int'.
	Check errors.
	* python/py-infthread.c (gdbpy_initialize_thread): Return 'int'.
	Check errors.
	* python/py-lazy-string.c (gdbpy_initialize_lazy_string): Return 'int'.
	Check errors.
	* python/py-objfile.c (gdbpy_initialize_objfile): Return 'int'.
	Check errors.
	* python/py-param.c (gdbpy_initialize_parameters): Return 'int'.
	Check errors.
	* python/py-progspace.c (gdbpy_initialize_pspace): Return 'int'.
	Check errors.
	* python/py-symbol.c (gdbpy_initialize_symbols): Return 'int'.
	Check errors.
	* python/py-symtab.c (gdbpy_initialize_symtabs): Return 'int'.
	Check errors.
	* python/py-type.c (gdbpy_initialize_types): Return 'int'.
	Check errors.
	* python/py-value.c (gdbpy_initialize_values): Return 'int'.
	Check errors.
	* python/python-internal.h (gdbpy_initialize_auto_load,
	gdbpy_initialize_values, gdbpy_initialize_frames,
	gdbpy_initialize_symtabs, gdbpy_initialize_commands,
	gdbpy_initialize_symbols, gdbpy_initialize_symtabs,
	gdbpy_initialize_blocks, gdbpy_initialize_types,
	gdbpy_initialize_functions, gdbpy_initialize_pspace,
	gdbpy_initialize_objfile, gdbpy_initialize_breakpoints,
	gdbpy_initialize_finishbreakpoints,
	gdbpy_initialize_lazy_string, gdbpy_initialize_parameters,
	gdbpy_initialize_thread, gdbpy_initialize_inferior,
	gdbpy_initialize_eventregistry, gdbpy_initialize_event,
	gdbpy_initialize_py_events, gdbpy_initialize_stop_event,
	gdbpy_initialize_signal_event,
	gdbpy_initialize_breakpoint_event,
	gdbpy_initialize_continue_event,
	gdbpy_initialize_exited_event, gdbpy_initialize_thread_event,
	gdbpy_initialize_new_objfile_event, gdbpy_initialize_arch):
	Update.  Use CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
	* python/python.c (gdb_python_initialized): New global.
	(gdbpy_initialize_events): Return 'int'.  Check errors.
	(_initialize_python): Check errors.  Set
	gdb_python_initialized.
2013-05-20 20:28:52 +00:00
Tom Tromey 1886886089 * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope):
Decref the reslut of PyObject_CallMethod.
2013-05-20 20:27:44 +00:00
Tom Tromey 9f4ff0c296 * python/py-event.c (gdbpy_initialize_event_generic): Return
early if PyType_Ready fails.
2013-05-20 20:26:39 +00:00
Tom Tromey 0d3a2e8a79 * python/py-type.c (make_fielditem): Add gdb_assert_not_reached
as 'default' in the switch.
2013-05-20 20:25:40 +00:00
Tom Tromey b86af38a5a * python/py-inferior.c (gdbpy_inferiors): Update. Hoist
get_addr_from_python calls out of TRY_CATCH.
	(infpy_write_memory, infpy_search_memory): Likewise.
	* python/py-utils.c (get_addr_from_python): Return negative
	value on error.  Use TRY_CATCH.
	* python/python-internal.h (get_addr_from_python): Use
	CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
2013-05-20 20:24:49 +00:00
Doug Evans e19d3afbf8 * gdb.base/maint.exp: Fix test for "mt expand-symtabs" to account for
-fdebug-types-section.
2013-05-20 20:23:20 +00:00
Tom Tromey c127ec5867 * python/py-event.c (evpy_emit_event): Decref the
result of PyObject_CallFunctionObjArgs.
2013-05-20 20:23:19 +00:00
Tom Tromey ba327838ba * python/py-cmd.c (cmdpy_completer): Use iterator protocol.
Correctly decref.
2013-05-20 20:21:55 +00:00
Tom Tromey d819143244 * python/py-cmd.c (cmdpy_init): Decref 'ds_obj'. 2013-05-20 20:20:48 +00:00
Tom Tromey 5d153bd188 * python/py-event.h (gdbpy_initialize_event_generic): Use
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
	* python/py-evts.c (add_new_registry): Use
	CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
	* python/python-internal.h
	(CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION): New macro.
2013-05-20 20:19:54 +00:00
Tom Tromey 56cc411c4b * python/py-arch.c (archpy_disassemble): Update.
* python/py-type.c (typy_get_composite, typy_lookup_typename)
	(typy_lookup_type): Use GDB_PY_HANDLE_EXCEPTION.
	* python/py-utils.c (gdbpy_convert_exception): Return 'void'.
	* python/python-internal.h (CPYCHECKER_SETS_EXCEPTION): New
	macro.
	(GDB_PY_HANDLE_EXCEPTION): Update.
	(gdbpy_convert_exception): Update.  Use CPYCHECKER_SETS_EXCEPTION.
2013-05-20 20:19:03 +00:00
Tom Tromey 8919e1746d * python/python-internal.h (events_object_type): Remove. 2013-05-20 20:18:22 +00:00
Tom Tromey 9b08f22510 * python/py-event.h (evpy_emit_event): Use
CPYCHECKER_STEALS_REFERENCE_TO_ARG.
        * python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG):
        New macro.
2013-05-20 20:16:57 +00:00
Tom Tromey f04010ffab * py-evtregistry.c (create_event_object): Decref
eventregistry_object if PyList_New fails.
2013-05-20 20:16:24 +00:00
Tom Tromey 3919fd966c * py-cmd.c (gdbpy_string_to_argv): Check result of
PyList_New.
2013-05-20 20:14:51 +00:00
Tom Tromey 0430e8cba9 * python/python.c (before_prompt_hook): Add cleanup to
decref 'hook'.
2013-05-20 20:13:28 +00:00
Tom Tromey 764123e402 * python/py-function.c (fnpy_init): Decref result of
PyObject_GetAttrString.
2013-05-20 20:12:04 +00:00
Tom Tromey 634c58be55 * python/py-threadevent.c (get_event_thread): Use
CPYCHECKER_RETURNS_BORROWED_REF.
	* python/python-internal.h (CPYCHECKER_RETURNS_BORROWED_REF):
	New define.
	(pspace_to_pspace_object, objfile_to_objfile_object)
	(find_thread_object): Use it.
2013-05-20 20:10:03 +00:00
Tom Tromey 62eec1a534 * python/py-arch.c (arch_object_type): Use
CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-block.c (block_syms_iterator_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-bpevent.c (breakpoint_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-cmd.c (cmdpy_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-continueevent.c (continue_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-event.h (GDBPY_NEW_EVENT_TYPE):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-events.h (thread_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-evtregistry.c (eventregistry_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-exitedevent.c (exited_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-finishbreakpoint.c (finish_breakpoint_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-function.c (fnpy_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-inferior.c (inferior_object_type, membuf_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-infthread.c (thread_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-lazy-string.c (lazy_string_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-newobjfileevent.c (new_objfile_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-objfile.c (objfile_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-param.c (parmpy_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-progspace.c (pspace_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-signalevent.c (signal_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-symtab.c (symtab_object_type, sal_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-type.c (type_object_type, field_object_type)
	(type_iterator_object_type): Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-internal.h (CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF): New
	define.
	(value_object_type, block_object_type, symbol_object_type)
	(event_object_type, stop_event_object_type, breakpoint_object_type)
	(frame_object_type): Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
2013-05-20 20:09:01 +00:00
Andreas Tobler 81ea8796fe 2013-05-20 Andreas Tobler <andreas@fgznet.ch>
* Makefile.in (ALL_TARGET_OBS): Add ppcfbsd-tdep.o.
        (ALLDEPFILES): Add ppcfbsd-nat.c and ppcfbsd-tdep.c.
2013-05-20 18:00:36 +00:00
Doug Evans a2ce51a0ef When reading CU, stay in DWO. Be more tolerent of bad debug info.
For Fission.
	* dwarf2read.c (struct dwarf2_per_cu_data): New member
	reading_dwo_directly.
	(struct signatured_type): New member dwo_unit.
	(struct die_reader_specs): New member comp_dir.
	(create_signatured_type_table_from_index): Use malloc for
	all_type_units instead of objfile's obstack.
	(create_all_type_units): Ditto.
	(fill_in_sig_entry_from_dwo_entry): New function.
	(add_type_unit): New function.
	(lookup_dwo_signatured_type): New function.
	(lookup_dwp_signatured_type): New function.
	(lookup_signatured_type): New arg cu.  All callers updated.
	(init_cu_die_reader): Initialize comp_dir.
	(read_cutu_die_from_dwo): New arg stub_comp_dir.  All callers updated.
	Change assert of matching type signatures to call error on mismatch.
	(lookup_dwo_unit): Add assert.
	(init_tu_and_read_dwo_dies): New function.
	(init_cutu_and_read_dies): Call it.
	(build_type_unit_groups): Handle case of no type unit groups created.
	(hash_dwo_file, eq_dwo_file): Handle missing comp_dir.
	(lookup_dwo_cutu): Tweak complaint.
	(dwarf2_free_abbrev_table): Check for NULL abbrev_table.
	(dwarf2_per_objfile_free): Free all_type_units.
2013-05-20 17:24:21 +00:00
Joel Brobecker a25cd31f61 Add missing empty line after var declarations in handle_unload_dll
gdb/ChangeLog:

        * windows-nat.c (handle_unload_dll): Add missing empty line.
2013-05-20 10:27:26 +00:00
Joel Brobecker 4d804846db [dwarf] Mark all functions as prototyped except C functions.
This makes sure that the types of the arguments are taken into account
when performing an inferior function call to a non-C (or C-like)
function.  In particular, this makes sure that the arguments are
appropriatly converted to the correct type.

For instance, on x86_64-linux, with the following Ada code:

   procedure Set_Float (F : Float) is
   begin
      Global_Float := F;
   end Set_Float;

The following sequence shows that Float arguments are incorrectly
passed (Ada's Float type is the equivalent of type "float" in C):

    (gdb) call set_float (2.0)
    (gdb) print global_float
    $1 = 0.0

Putting a breakpoint inside set_float to inspect the value of
register xmm0 gives the first hint of the problem:

    (gdb) p $xmm0
    $2 = (v4_float => (0 => 0.0, 2.0, 0.0, 0.0),
          v2_double => (0 => 2.0, 0.0),
    [...]

It shows that the argument was passed as a double.

The code responsible for doing appropriate type conversions
for the arguments (value_arg_coerce) found that our function
was not prototyped, and thus could not use typing information
for the arguments. Instead, it defaulted to the value of "set
coerce-float-to-double", which by default is true, to determine
the argument type.

This patch fixes the problem by setting the PROTOTYPE flag
for all functions of any language except C and Objective C.

gdb/ChangeLog:

        * dwarf2read.c (prototyped_function_p): New function.
        (read_subroutine_type): Use it.

gdb/testsuite/ChangeLog:

        * gdb.ada/float_param: New testcase.
2013-05-20 09:45:13 +00:00
Joel Brobecker 1c432e72b0 De-indent example code in rs6000-aix-tdep.c (ARI fix)
This patch de-indents the code provided as a comment explaining
how the code declaring the ld_info32_desc and ld_info64_desc globals
was generated. The intent is to avoid an ARI warning about a macro
not starting at column zero of the line.

gdb/ChangeLog:

        * rs6000-aix-tdep.c: De-indent some example code provided
        as a comment.
2013-05-20 09:14:24 +00:00
gdbadmin fdc2322aef *** empty log message *** 2013-05-20 00:00:02 +00:00
gdbadmin 2f2fb5e626 *** empty log message *** 2013-05-19 00:00:33 +00:00
gdbadmin 3e68617657 *** empty log message *** 2013-05-18 00:00:02 +00:00
Edjunior Barbosa Machado 4feebbddff 2013-05-17 Edjunior Machado <emachado@linux.vnet.ibm.com>
* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Check if the
	region is ok for a hardware watchpoint using the new ptrace interface
	on Power servers.
2013-05-17 23:05:00 +00:00
Doug Evans 7d0c9981dc * NEWS: Mention new maintenance commands check-symtabs, and
expand-symtabs, and renamed check-psymtabs.
	* psymtab.c (maintenance_check_psymtabs): Renamed from
	maintenance_check_symtabs.  Only process already-expanded symbol
	tables.
	(_initialize_psymtab): Update.
	* symmisc.c (maintenance_check_symtabs): New function.
	(maintenance_expand_name_matcher): New function
	(maintenance_expand_file_matcher): New function
	(maintenance_expand_symtabs): New function.
	(_initialize_symmisc): Add "mt check-symtabs" and "mt expand-symtabs"
	commands.

	doc/
	* gdb.texinfo (Maintenance Commands): Update doc for
	"maint check-psymtabs".  Add doc for "maint check-symtabs",
	"maint expand-symtabs".

	testsuite/
	* gdb.base/maint.exp: Update test for "maint check-psymtabs".
	Add tests for "maint check-symtabs", "maint expand-symtabs".
2013-05-17 18:09:06 +00:00
Doug Evans 8d324e8329 * gdb.base/maint.exp: Remove testing of individual maint command
help output.
2013-05-17 18:05:19 +00:00
Tom Tromey 6cbc7c3d34 * python/py-inferior.c (infpy_read_memory): Don't call
PyErr_SetString if PyObject_New fails.
	* python/py-frame.c (frame_info_to_frame_object): Don't call
	PyErr_SetString if PyObject_New fails.
2013-05-17 16:52:34 +00:00
H.J. Lu a48b32c068 Replace hardcoded -ldl with check for availability
2013-05-17  Pavel Chupin  <pavel.v.chupin@intel.com>

	* acinclude.m4: Add check for dlopen in libdl.
	* configure.ac: Ditto.
	* configure: Regenerate.
2013-05-17 16:24:21 +00:00
Phil Muldoon 3de661e642 2013-05-17 Phil Muldoon <pmuldoon@redhat.com>
* frame.c (frame_stash): Convert to htab.
	(frame_addr_hash): New function.
	(frame_addr_hash_eq): New function.
	(frame_stash_create): Convert function to create
	a hash table.
	(frame_stash_add): Convert function to add an entry to a hash
	table.
	(frame_stash_find): Convert function to search the hash table.
	(frame_stash_invalidate): Convert function to empty the hash
	table.
	(get_frame_id): Only add to stash if a frame_id is created.
	(_initialize_frame): Call frame_stash_create.
2013-05-17 08:34:18 +00:00
Thomas Schwinge bb4168a9a7 Mark the following commit as tiny change:
gdb/
2013-05-16  Yue Lu  <hacklu.newborn@gmail.com>

	* configure.ac: Ensure MIG is available when building for GNU Hurd
	hosts.
	* configure: Regenerate.
2013-05-17 06:58:33 +00:00
Joel Brobecker 58794e1a64 [gdbserver/lynx178]: Fix null_ptid -vs- minus_one_ptid confusion in comment
gdb/gdbserver/ChangeLog:

        * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
        confusion in comment.
2013-05-17 06:53:53 +00:00
Joel Brobecker d631c5a779 gdbserver/lynx178: spurious SIG61 signal when resuming inferior.
On ppc-lynx178, resuming the execution of a program after hitting
a breakpoint sometimes triggers a spurious SIG61 event:

    (gdb) cont
    Continuing.

    Program received signal SIG61, Real-time event 61.
    [Switching to Thread 39]
    0x10002324 in a_test.task1 (<_task>=0x3ffff774) at a_test.adb:30
    30          select  -- Task 1

From this point on, continuing again lets the signal kill the program.
Using "signal 0" or configuring GDB to discard the signal does not
help either, as the program immediately reports the same signal again.

What happens is the following:

  - GDB sends a single-step order to gdbserver: $vCont;s:31
    This tells GDBserver to do a step using thread 0x31=49.
    GDBserver does the step, and thread 49 receives the SIGTRAP
    indicating that the step has finished.

  - GDB then sends a "continue", but this time does not specify
    which thread to continue: $vCont;c
    GDBserver uses an arbitrary thread's ptid to resume the program's
    execution (the current_inferior's ptid was chosen for that).
    See lynx-low.c:lynx_resume:

        if (ptid_equal (ptid, minus_one_ptid))
          ptid = thread_to_gdb_id (current_inferior);

So far on all LynxOS platforms, this has been good enough. But
not so on LynxOS 178. If the ptid used to resume the execution
is not the same as the thread that did the step, we get the weird
signal.

This patch fixes the problem by saving the ptid of the thread
that last caused an event, received during a call to waitpid.
The ptid is saved in per-process private data.

gdb/gdbserver/ChangeLog:

        * lynx-low.c (struct process_info_private): New type.
        (lynx_add_process): New function.
        (lynx_create_inferior, lynx_attach): Replace calls to
        add_process by calls to lynx_add_process.
        (lynx_resume): If PTID is null, then try using
        current_process()->private->last_wait_event_ptid.
        Add comments.
        (lynx_clear_inferiors): Delete.  The contents of that function
        has been inlined in lynx_mourn;
        (lynx_wait_1): Save the ptid in the process's private data.
        (lynx_mourn): Free the process' private data.  Replace call
        to lynx_clear_inferiors by call to clear_inferiors.
2013-05-17 06:47:44 +00:00
Yao Qi 96f7a20fe9 gdb/gdbserver
* i386-low.c (i386_length_and_rw_bits): Move the comment to
	the right place.
2013-05-17 02:22:52 +00:00
gdbadmin 4bebc771c7 *** empty log message *** 2013-05-17 00:00:32 +00:00
Thomas Schwinge 036c3acbab gdb/
2013-05-16  Yue Lu  <hacklu.newborn@gmail.com>

	* configure.ac: Ensure MIG is available when building for GNU Hurd
	hosts.
	* configure: Regenerate.
2013-05-16 21:54:34 +00:00
Luis Machado db0dfaa0e6 * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
	(linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
	PT_TEXT_END_ADDR guards.  Update comments.
	(linux_target_op) <read_offsets>: Conditionally define to
	linux_read_offsets if the target is UCLIBC and if it defines
	PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
2013-05-16 10:31:49 +00:00
Pedro Alves 177aadc492 gdb.ada/complete.exp: Fix FIXME.
2013-05-16  Pedro Alves  <palves@redhat.com>

	* gdb.ada/complete.exp (test_gdb_no_completion): Fix typo in
	comment.  Use gdb_test_no_output.
2013-05-16 10:13:33 +00:00
Joel Brobecker d1be32476e [dwarf]: Add DW_LANG_UPC support in set_cu_language.
gdb/ChangeLog:

        * dwarf2read.c (set_cu_language): Add DW_LANG_UPC handling.
2013-05-16 07:39:43 +00:00
Joel Brobecker b8fea896fe Missing do_cleanups in ada_make_symbol_completion_list.
This results in an internal-warning when trying the completion
when in Ada mode:

    (gdb) b simple<TAB>
    /[...]/cleanups.c:265: internal-warning: restore_my_cleanups has found a stale cleanup
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

gdb/ChangeLog:

        * ada-lang.c (ada_make_symbol_completion_list): Make sure
        all cleanups are done before returning from this function.

gdb/testsuite/ChangeLog:

        * gdb.ada/complete.exp: Add test verifying completion using
        the "tab" key.
2013-05-16 07:02:43 +00:00
gdbadmin 38d80a64fb *** empty log message *** 2013-05-16 00:00:02 +00:00
Keith Seitz bba5b66718 * gdb.base/filesym.exp: New completer test.
* gdb.base/filesym.c: New file.
2013-05-15 21:21:05 +00:00
Pedro Alves ed0f00b834 Remove my name from a couple tests.
Tested on x86_64 Fedora 17.

gdb/testsuite/
2013-05-15  Pedro Alves  <palves@redhat.com>

	* gdb.base/fixsection.c: Remove attribution.
	* gdb.base/watch-read.exp: Ditto.
2013-05-15 17:33:04 +00:00
Joel Brobecker af880d85b8 Remove forward enum declaration in utils.h.
These forward declarations are a GNU extension, and they trigger
a build warning when the compiler does not support it.

gdb/ChangeLog:

        * utils.h: #include "exceptions.h".
        (enum errors): Remove partial declaration.
2013-05-15 12:49:05 +00:00
Joel Brobecker 356a523362 ppc-aix core file relocation.
The current code attempts to provide relocation support when debugging
core files via the rs6000_xfer_partial method of the rs6000-nat
target_ops vector. However, this target_ops vector does not get pushed
on the target stack at all when debugging core files, thus bypassing
completely that part of the code.

This patch fixes the problem by extending corelow's core_xfer_partial
into handling the TARGET_OBJECT_LIBRARIES_AIX object.

gdb/ChangeLog:

	* gdbarch.sh (core_xfer_shared_libraries_aix): New method.
	* gdbarch.h, gdbarch.c: Regenerate.
	* corelow.c (core_xfer_partial): Add TARGET_OBJECT_LIBRARIES_AIX
	handling.

	* rs6000-aix-tdep.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add rs6000-aix-tdep.h.
	* rs6000-aix-tdep.c: Include "rs6000-aix-tdep.h" and
	"xml-utils.h".
	(struct field_info, struct ld_info_desc): New types.
	(ld_info32_desc, ld_info64_desc): New static constants.
	(struct ld_info): New type.
	(rs6000_aix_extract_ld_info): New function.
	(rs6000_aix_shared_library_to_xml): Likewise.
	(rs6000_aix_ld_info_to_xml): Likewise.
	(rs6000_aix_core_xfer_shared_libraries_aix): Likewise.
	(rs6000_aix_init_osabi): Add call to
	set_gdbarch_core_xfer_shared_libraries_aix.
	* rs6000-nat.c: Add "rs6000-aix-tdep.h" include.
	Remove "xml-utils.h" include.
	(LdInfo): Delete typedef.
	(ARCH64_DECL, LDI_FIELD, LDI_NEXT, LDI_FD, LDI_FILENAME):
	Delete macros.
	(rs6000_ptrace_ldinfo): Change return type to gdb_byte *.
	Adjust code accordingly.
	(rs6000_core_ldinfo): Delete, folded into
	rs6000_aix_core_xfer_shared_libraries_aix.
	(rs6000_xfer_shared_library): Delete.
	(rs6000_xfer_shared_libraries): Reimplement.
2013-05-15 12:26:14 +00:00
Markus Metzger 742ce053c1 The "record goto" command scans its arguments for "begin", "start", or "end".
Turn those into sub-commands.

Document the "record goto" command.
2013-05-15 07:04:12 +00:00
gdbadmin fba526b6fb *** empty log message *** 2013-05-15 00:00:32 +00:00
Jan Kratochvil e93ba63057 gdb/
* linespec.c (convert_linespec_to_sals): New comment for
	SOURCE_FILENAME assignment.
2013-05-14 20:41:45 +00:00
Jan Kratochvil 5821aace70 gdb/
* cleanups.c (restore_my_cleanups): Replace gdb_assert by
	internal_warning.
2013-05-14 20:39:12 +00:00
Tom Tromey a1b8c4cc7e * eval.c (parse_and_eval_long): Make 'exp' const.
* value.h (parse_and_eval_long): Update.
2013-05-14 20:37:57 +00:00
Tom Tromey 23b3a2c3d1 * ui-file.c (gdb_fopen): Make arguments const.
* ui-file.h (gdb_fopen): Make arguments const.
2013-05-14 20:35:24 +00:00
Tom Tromey ca623f82a4 * remote.c (remote_set_trace_notes): Make arguments const.
* target.c (update_current_target): Update cast.
	* target.h (to_set_trace_notes): Make arguments const.
2013-05-14 20:33:36 +00:00
Tom Tromey 503ebb2c1d * go32-nat.c (go32_terminal_info): Make 'args' const.
* inferior.h (child_terminal_info): Update.
	* inflow.c (child_terminal_info): Make 'args' const.
	* target.c (default_terminal_info): Make 'args' const.
	(debug_to_terminal_save_ours): Likewise.
	* target.h (struct target_ops) <to_terminal_info>: Make argument
	const.
2013-05-14 20:32:15 +00:00
Tom Tromey 85e1311a3c * gcore.c (create_gcore_bfd): Make 'filename' const.
* gcore.h (create_gcore_bfd): Make 'filename' const.
	* record-full.c (record_full_save): Make 'recfilename' const.
	* target.c (target_save_record): Make 'filename' const.
	* target.h (struct target_ops) <to_save_record>: Make 'filename'
	const.
	(target_save_record): Likewise.
2013-05-14 20:30:48 +00:00
gdbadmin ce355ebab0 *** empty log message *** 2013-05-14 00:00:02 +00:00
Tom Tromey 55fb6d274d * gdb.dwarf2/implptrconst.exp: Create a CU with 4 byte address
size and change type sizes to 4 bytes.
2013-05-13 19:32:17 +00:00
Tom Tromey 92ce080be6 fix PR number in ChangeLog 2013-05-13 16:57:20 +00:00
Tom Tromey d62bfeaff5 PR gdb/15538:
* dwarf2read.c (dwarf2_record_block_ranges): Ensure that the
	ranges section has been read.
2013-05-13 16:56:09 +00:00
Tom Tromey ac1ca910d7 PR exp/15364:
* eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT,
	STRUCTOP_PTR>: Return a not_lval value for
	EVAL_AVOID_SIDE_EFFECTS.
	* opencl-lang.c (evaluate_subexp_opencl): Return a not_lval value
	for EVAL_AVOID_SIDE_EFFECTS.
gdb/testsuite
	* gdb.base/exprs.exp (test_expr): Add regression test.
	* gdb.base/exprs.c (null_t_struct): New global.
2013-05-13 16:51:52 +00:00
Joel Brobecker 36d1c68c70 Float parameter passing in funcall on ppc-aix & ppc-lynx178.
Given the following code:

    float global_float = 0.0;

    void
    set_float (float f)
    {
      global_float = f;
    }

GDB incorrectly calls set_float if the set_float function is marked
as prototyped:

    (gdb) call set_float (5.0)
    (gdb) print global_float
    $1 = 2048

What happens, when the function is marked as prototyped, is that
GDB finds that the argument is a float, casts the value given in
the expression to a float, and then gives that float to ppc-aix/
ppc-lynx178's push_dummy_call gdbarch routine. The latter then blindly
copies it as is in the first floating-point register, instead of
making sure that it has the proper format first.

gdb/ChangeLog:

        * rs6000-aix-tdep.c (rs6000_push_dummy_call): Convert
        floating point registers to register type before storing
        value.
        * rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call):
        Likewise.
2013-05-13 10:27:35 +00:00
Muhammad Bilal 8414efeff8 * History saving should stay disabled for test cases *
I saw some test cases in gdb.base/default.exp and gdb.base/setshow.exp
are enabling the history saving.
Hence .gdb_history file is modified with history information even
though, by default, we have History saving disabled.
So we should modify GDB test cases so that history saving should stay
off for all test cases.



ChangeLog:

2013-05-13  Muhammad Bilal  <mbilal@codesourcery.com>

       * gdb.base/default.exp: Disable history saving.
       * gdb.base/setshow.exp: Likewise.
2013-05-13 08:49:23 +00:00
gdbadmin 8444d6e5fb *** empty log message *** 2013-05-13 00:00:32 +00:00
gdbadmin 8e0fcbead6 *** empty log message *** 2013-05-12 00:00:03 +00:00
gdbadmin f653ca4a15 *** empty log message *** 2013-05-11 00:00:02 +00:00
Tom Tromey 21ff46861c 2013-05-10 Joel Brobecker <brobecker@adacore.com>
Tom Tromey  <tromey@redhat.com>

	* common/filestuff.c (mark_fd_no_cloexec, unmark_fd_no_cloexec):
	New functions.
	* common/filestuff.c (mark_fd_no_cloexec, unmark_fd_no_cloexec):
	Declare.
	* darwin-nat.c (darwin_pre_ptrace): Use mark_fd_no_cloexec.
	(darwin_ptrace_him): Use unmark_fd_no_cloexec.
	* inf-ttrace.c (do_cleanup_pfds): Use unmark_fd_no_cloexec.
	(inf_ttrace_prepare): Use mark_fd_no_cloexec.
2013-05-10 17:01:00 +00:00
Tom Tromey d3685d60d6 gdb
Freddie Chopin  <freddie_chopin@op.pl>
	PR build/15414:
	* configure: Rebuild.
	* configure.ac (build_warnings): Do not use -Wformat-nonliteral
	with -Wno-format.
sim/common
	* acinclude.m4 (SIM_AC_OPTION_WARNINGS): Do not use
	-Wformat-nonliteral with -Wno-format.
sim/bfin
	* configure: Rebuild.
sim/cr16
	* configure: Rebuild.
sim/cris
	* configure: Rebuild.
sim/d10v
	* configure: Rebuild.
sim/igen
	* configure: Rebuild.
sim/m68hc11
	* configure: Rebuild.
sim/mips
	* configure: Rebuild.
sim/mn10300
	* configure: Rebuild.
sim/v850
	* configure: Rebuild.
2013-05-10 16:10:40 +00:00
Pedro Alves eb9fe518e9 Fix typo in "show remote traceframe-info-packet"
I noticed:

  (gdb) show remote traceframe-info-packet
  Support for the `qXfer:trace-frame-info:read' packet is auto-detected, currently unknown.
                         ^^^^^^^^^^^

The packet is actually qXfer:traceframe-info:read.

gdb/
2013-05-10  Pedro Alves  <palves@redhat.com>

	* remote.c (_initialize_remote): Fix spelling of
	qXfer:traceframe-info:read packet in packet config command.
2013-05-10 14:31:05 +00:00
Pedro Alves 9779ab84ac PR remote/15455 - QTro remote packet broken
In the function remote_trace_set_readonly_regions in gdb/remote.c, the
local variable 'offset' does not account for "QTro" at the start of
the packet with the result that if there are any read-only regions,
the packet is sent -- but without the "QTro" -- causing the remote
stub to report that the packet is unsupported:

  Sending packet: $:0000000000400200,(...),00000000004560a4#ab...Packet received:

vs the expected:

  Sending packet: $QTro:0000000000400200,(...),00000000004560a4#31...Packet received: OK

We don't see the problem when testing with GDBserver, as that supports
qXfer:trace-frame-info:read, meaning GDBserver never needs to read
from the read-only sections directly itself.  This commit adds a test
that explicitly disables qXfer:trace-frame-info:read.

gdb/
2013-05-10  David Taylor  <dtaylor@emc.com>

	PR remote/15455

	* remote.c (remote_trace_set_readonly_regions): Do not overwrite
	"QTro" at start of packet.

gdb/testsuite/
2013-05-10  Pedro Alves  <palves@redhat.com>

	PR remote/15455

	* gdb.trace/qtro.c: New file.
	* gdb.trace/qtro.exp: New file.
2013-05-10 13:59:45 +00:00