Commit Graph

32392 Commits

Author SHA1 Message Date
Pedro Alves 04f5fe89ae Fix remaining GDBserver issues with !HAVE_THREAD_DB_H.
The previous patches are still not sufficient to build gdbserver with
our copy of thread_db.h.

../../../src/gdb/gdbserver/thread-db.c: In function ‘find_one_thread’:
../../../src/gdb/gdbserver/thread-db.c:316:6: error: ‘struct lwp_info’ has no member named ‘th’
../../../src/gdb/gdbserver/thread-db.c: In function ‘attach_thread’:
../../../src/gdb/gdbserver/thread-db.c:341:6: error: ‘struct lwp_info’ has no member named ‘th’
../../../src/gdb/gdbserver/thread-db.c: In function ‘thread_db_get_tls_address’:
../../../src/gdb/gdbserver/thread-db.c:514:47: error: ‘struct lwp_info’ has no member named ‘th’
make: *** [thread-db.o] Error 1

First, linux-low.h is including <thread_db.h> directly instead of our
gdb_thread_db.h, although thread-db.c includes the latter.  Then the
'th' field of struct lwp_info is only defined if HAVE_THREAD_DB_H is
defined, which is not true if we're using our replacement copy of
thread_db.h.  We have a USE_THREAD_DB symbol defined if we're building
thread-db.c that's ideal for this, however, it's currently only
defined when compiling linux-low.c (through a Makefile rule).  The
patch makes it defined when compiling any file.

gdb/gdbserver/
2013-04-16  Pedro Alves  <palves@redhat.com>

	* Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
	(linux-low.o): Delete rule.
	* linux-low.h: Always include "gdb_thread_db.h" instead of
	conditionally including thread_db.h.
	(struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
	HAVE_THREAD_DB_H.
2013-04-16 18:20:40 +00:00
Pedro Alves 488a42b8c4 copyright.py: Don't update glibc_thread_db.h.
As glibc_thread_db.h is a 3rd party imported file, we should not
update its copyright year range in the new year process.

gdb/
2013-04-16  Pedro Alves  <palves@redhat.com>

	* copyright.py (EXCLUDE_LIST): Add gdb/common/glibc_thread_db.h.
2013-04-16 18:19:14 +00:00
Pedro Alves 85d494eaa5 Fix previous entry. 2013-04-16 18:18:12 +00:00
Pedro Alves f5fb825b47 Update glibc_thread_db.h from upstream.
Attempting to build gdbserver with our copy of thread_db.h yields:

In file included from ../../../src/gdb/gdbserver/../common/gdb_thread_db.h:4:0,
                 from ../../../src/gdb/gdbserver/thread-db.c:30:
../../../src/gdb/gdbserver/../common/glibc_thread_db.h:108:3: error: unknown type name ‘uint32_t’
In file included from ../../../src/gdb/gdbserver/../common/gdb_thread_db.h:4:0,
                 from ../../../src/gdb/gdbserver/thread-db.c:30:
../../../src/gdb/gdbserver/../common/glibc_thread_db.h:199:5: error: unknown type name ‘uintptr_t’
../../../src/gdb/gdbserver/../common/glibc_thread_db.h:269:3: error: unknown type name ‘intptr_t’
../../../src/gdb/gdbserver/../common/glibc_thread_db.h:270:3: error: unknown type name ‘intptr_t’


We used to have a workaround for this, but the patch to import
gnulib's stdint.h removed it:

  http://www.sourceware.org/ml/gdb-patches/2008-06/msg00050.html

and defs.h made to always include stdint.h.  However, gdbserver
doesn't include stdint.h in its equivalent server.h.

Rather than working around the issue, I've imported a more recent
version from glibc, which itself includes <stdint.h>.  Other than
copyright years and FSF snail mail address, the file hasn't been
touched since 2003 in glibc.  AFAICS, our version was updated last in
2000-09-03.

A note on the apparent license change: before the previous patch, this
file's contents were part of gdb_thread_db.h, and we can see that its
license's text was changed in this patch
<http://sourceware.org/ml/gdb-patches/2009-03/msg00251.html>.  That
was certainly just an easy to overlook grep/sed mistake that fell
through the cracks.

gdb/common/
2013-04-16  Pedro Alves  <palves@redhat.com>

	* glibc_thread_db.h: Update from upstream glibc
	(git 568035b7874a099087b77f7bba3e36a1173787b0).
2013-04-16 18:17:11 +00:00
Pedro Alves e115499952 Move fallback thread_db.h to a separate file.
Having this on a separate file makes it easier to import a new version
-- one can just copy over instead of having to care about preserving
the GDB-specific bits.

2013-04-16  Pedro Alves  <palves@redhat.com>

	* common/gdb_thread_db.h [!HAVE_THREAD_DB_H]: Factor out to ...
	* common/glibc_thread_db.h: ... this new file ...
	* common/gdb_thread_db.h [!HAVE_THREAD_DB_H]: ... and include it.
2013-04-16 18:14:55 +00:00
Pedro Alves e3b50a7f94 PR build/11881: LIBTHREAD_DB_SO can be undefined.
This patch:

 http://sourceware.org/ml/gdb-patches/2009-04/msg00115.html

Changed behaviour by only defining LIBTHREAD_DB_SO if thread_db.h exists. The
definition of LIBTHREAD_DB_SO and LIBTHREAD_DB_SEARCH_PATH should be moved
outside of #ifdef HAVE_THREAD_DB_H.

This is based on a patch attached to the PR, however, it needed a
tweak, as it was it broke the HAVE_THREAD_DB_H path.

2013-04-16  Will Newton  <will.newton@gmail.com>
	    Pedro Alves  <palves@redhat.com>

	PR build/11881

	* common/gdb_thread_db.h (LIBTHREAD_DB_SO)
	(LIBTHREAD_DB_SEARCH_PATH): Move outside of #ifdef
	HAVE_THREAD_DB_H.
2013-04-16 18:12:14 +00:00
Tom Tromey dee368d345 * gdb.texinfo (Set Catchpoints): Mention earliest version of
GCC that has the SDT probe points.
2013-04-16 15:44:32 +00:00
Pedro Alves 1c2e44502c NEWS: Mention "set foo unlimited".
Mention "set foo unlimited" in NEWS, right below the "New options"
section.

2013-04-16  Pedro Alves  <palves@redhat.com>
	    Eli Zaretskii  <eliz@gnu.org>

	* NEWS: Mention "set foo unlimited".
2013-04-16 14:36:53 +00:00
gdbadmin 74dfd54778 *** empty log message *** 2013-04-16 00:00:32 +00:00
Doug Evans 19c3d4c935 * dwarf2read.c (struct dwo_file): Replace member "cus" with "cu".
(struct create_dwo_cu_data): Renamed from create_dwo_info_table_data.
	(create_dwo_cu_reader): Renamed from
	create_dwo_debug_info_hash_table_reader.
	(create_dwo_cu): Renamed from create_dwo_debug_info_hash_table.
	Remove support for multiple CUs in a DWO file.
	(open_and_init_dwo_file, lookup_dwo_cutu): Update.
2013-04-15 23:53:38 +00:00
Doug Evans 4031ecc58a * dwarf2read.c (create_debug_types_hash_table): Use hex_string
instead of phex.
	(lookup_dwo_unit, create_dwo_debug_info_hash_table_reader): Ditto.
	(create_dwo_in_dwp): Ditto.
2013-04-15 22:14:40 +00:00
Siva Chandra Reddy a0d3f2f58f 2013-04-15 Siva Chandra Reddy <sivachandra@google.com>
Add option to link testcases with Pthreads library when
	using 'prepare_for_testing' in tests.

	testsuite/
	* lib/gdb.exp (build_executable_from_specs): Use
	gdb_compile_pthreads to compile if option "pthreads" is
	specified.
2013-04-15 20:37:37 +00:00
Tom Tromey b340913d3d * NEWS: Move recent entries into "since 7.6" section. 2013-04-15 18:24:48 +00:00
Tom Tromey cc16e6c915 PR c++/13588:
* NEWS: Update.
	* break-catch-throw.c (struct exception_catchpoint)
	<exception_rx, pattern>: New fields.
	(fetch_probe_arguments, dtor_exception_catchpoint)
	(check_status_exception_catchpoint)
	(print_one_detail_exception_catchpoint): New functions.
	(handle_gnu_v3_exceptions): Add "except_rx" argument.
	Compile regular expression if needed.
	(extract_exception_regexp): New function.
	(catch_exception_command_1): Use extract_exception_regexp.
	(compute_exception): Use fetch_probe_arguments.
	(initialize_throw_catchpoint_ops): Set dtor, print_one_detail,
	and check_status fields.
	* cp-abi.c (cplus_typename_from_type_info): New function.
	* cp-abi.h (cplus_typename_from_type_info): Declare.
	(struct cp_abi_ops) <get_typename_from_type_info>: New field.
	* gdb_regex.h (compile_rx_or_error): Declare.
	* gnu-v3-abi.c (gnuv3_get_typename_from_type_info): Update
	comment.
	(init_gnuv3_ops): Set get_type_from_type_info field.
	* probe.c (compile_rx_or_error): Move...
	* utils.c (compile_rx_or_error): ... here.
gdb/doc
	* gdb.texinfo (Set Catchpoints): Document regexp syntax for
	exception catchpoints.
gdb/testsuite
	* gdb.cp/exceptprint.exp: Add regexp catchpoint tests.
2013-04-15 18:13:01 +00:00
Tom Tromey 72f1fe8a88 PR c++/15176:
* NEWS: Update.
	* break-catch-throw.c (compute_exception): New function.
	(exception_funcs): New global.
	(_initialize_break_catch_throw): Create $_exception.
	* cp-abi.c (cplus_type_from_type_info): New function.
	* cp-abi.h (cplus_type_from_type_info): Declare.
	(struct cp_abi_ops) <get_type_from_type_info>: New field.
	* gnu-v3-abi.c (gnuv3_get_typename_from_type_info)
	(gnuv3_get_type_from_type_info): New functions.
	(init_gnuv3_ops): Set get_type_from_type_info ABI field.
gdb/doc
	* gdb.texinfo (Set Catchpoints): Document $_exception.
	(Convenience Vars): Mention $_exception.
gdb/testsuite
	* gdb.base/default.exp: Update for $_exception.
	* gdb.cp/exceptprint.cc: New file.
	* gdb.cp/exceptprint.exp: New file.
	* lib/gdb.exp (skip_libstdcxx_probe_tests): New proc.
2013-04-15 18:09:02 +00:00
Tom Tromey fc4746a2bd * break-catch-throw.c (struct exception_names): New.
(exception_functions): Change type.
	(re_set_exception_catchpoint): Look for SDT probes.
2013-04-15 18:06:42 +00:00
Tom Tromey 15a73f5615 PR c++/10119:
* break-catch-throw.c (exception_functions): New global.
	(gnu_v3_exception_catchpoint_ops): Move earlier.
	(struct exception_catchpoint): New.
	(classify_exception_breakpoint): Rewrite.
	(re_set_exception_catchpoint): New function.
	(handle_gnu_v3_exceptions): Return void.  Use init_catchpoint.
	Allocate a struct exception_catchpoint.
	(catch_exception_command_1): Update.
	(initialize_throw_catchpoint_ops): Set 're_set' method.
2013-04-15 18:05:48 +00:00
Tom Tromey 916703c090 * Makefile.in (SFILES): Add break-catch-throw.c
(COMMON_OBS): Add break-catch-throw.o.
	* break-catch-throw.c: New file.
	* breakpoint.c: Move exception-catching code to new file.
	(ep_parse_optional_if_clause): No longer static.
	* breakpoint.h (ep_parse_optional_if_clause): Declare.
2013-04-15 18:04:53 +00:00
Tom Tromey 6e72ca205c PR c++/9065:
* NEWS: Update.
	* breakpoint.c (watchpoint_exp_is_const): Add OP_TYPEID.
	* c-exp.y (TYPEID): New token.
	(exp): Add new TYPEID productions.
	(ident_tokens): Add "typeid".
	* cp-abi.c (cplus_typeid, cplus_typeid_type): New functions.
	* cp-abi.h (cplus_typeid, cplus_typeid_type): Declare.
	(struct cp_abi_ops) <get_typeid, get_typeid_type>: New fields.
	* eval.c (evaluate_subexp_standard) <OP_TYPEID>: New case.
	* expprint.c (dump_subexp_body_standard) <OP_TYPEID>: New
	case.
	* gnu-v3-abi.c (std_type_info_gdbarch_data): New global.
	(build_std_type_info_type, gnuv3_get_typeid_type)
	(gnuv3_get_typeid): New functions.
	(init_gnuv3_ops): Initialize std_type_info_gdbarch_data.  Set
	new fields on ABI object.
	* parse.c (operator_length_standard) <OP_TYPEID>: New case.
	* std-operator.def (OP_TYPEID): New.
gdb/testsuite
	* gdb.cp/typeid.cc: New file.
	* gdb.cp/typeid.exp: New file.
2013-04-15 17:36:14 +00:00
Tom Tromey 715c6909e2 * elfread.c (elf_symtab_read): Install versioned symbol under
unversioned name as well.
2013-04-15 17:31:17 +00:00
Tom Tromey 8de20a37d6 PR c++/11990:
* c-lang.c (cplus_language_defn): Use gdb_demangle.
	* c-typeprint.c (c_type_print_base): Use gdb_demangle.
	* cp-support.c (mangled_name_to_comp): Use gdb_demangle.
	(gdb_demangle): New function.
	* cp-support.h (gdb_demangle): Declare.
	* dwarf2read.c (dwarf2_physname, fixup_partial_die)
	(dwarf2_name): Use gdb_demangle.
	* gdbtypes.c (check_stub_method): Use gdb_demangle.
	* gnu-v3-abi.c (gnuv3_rtti_type): Strip @plt and version
	suffixes from name.
	(gnuv3_print_method_ptr): Use gdb_demangle.
	* jv-lang.c (java_demangle): Use gdb_demangle.
	* jv-typeprint.c (java_type_print_base): Use gdb_demangle.
	* language.c (unk_lang_demangle): Use gdb_demangle.
	* symtab.c (symbol_find_demangled_name)
	(demangle_for_lookup): Use gdb_demangle.
2013-04-15 17:30:36 +00:00
Tom Tromey 591f19e89b PR c++/12824:
* NEWS: Update.
	* breakpoint.c (enum exception_event_kind) <EX_EVENT_RETHROW>:
	New constant.
	(classify_exception_breakpoint): New function.
	(print_it_exception_catchpoint, print_one_exception_catchpoint)
	(print_mention_exception_catchpoint)
	(print_recreate_exception_catchpoint, handle_gnu_v3_exceptions)
	(catch_exception_command_1): Handle "rethrow" catchpoint.
	(catch_rethrow_command): New function.
	(_initialize_breakpoint): Add "catch rethrow" command.
gdb/doc
	* gdb.texinfo (Set Catchpoints): Reorganize exception
	catchpoints.  Document "catch rethrow".
	(Debugging C Plus Plus): Mention "catch rethrow".
gdb/testsuite
	* gdb.cp/exception.exp: Add "catch rethrow" tests.
2013-04-15 17:27:44 +00:00
Tom Tromey 02ae6bada6 * gdb.texinfo (Set Catchpoints): Remove obsolete text. 2013-04-15 17:20:39 +00:00
Pierre Muller 4d40cad203 * contrib/ari/gdb_ari.sh (write_pc rule): Do not consider
set_gdbarch_write_pc as deprecated anymore.
2013-04-15 14:23:54 +00:00
Joel Brobecker 30bcb45627 Add missing empty line in spu_write_pc.
gdb/ChangeLog:

        * spu-tdep.c (spu_write_pc): Add empty line after local variable
        declarations.
2013-04-15 13:04:05 +00:00
gdbadmin e34b903b88 *** empty log message *** 2013-04-15 00:00:02 +00:00
gdbadmin a0a532ee36 *** empty log message *** 2013-04-14 00:00:32 +00:00
Yao Qi da9160e4c8 gdb/
* ctf.c (_initialize_ctf): Include "completer.h".
	Call add_target_with_completer instead of add_target.

gdb/testsuite/

	* gdb.base/completion.exp: Test completion of command
	'target ctf' if target ctf is supported.
2013-04-13 14:14:08 +00:00
gdbadmin 4d207d5e9a *** empty log message *** 2013-04-13 00:00:02 +00:00
Jan Kratochvil 2c91021cac gdb/doc/
* gdb.texinfo (Auto-loading safe path): Add quick -iex using command
	line below the sample output.
2013-04-12 20:45:31 +00:00
Doug Evans fc4c25bf77 Re: "show configuration"/--configuration patch: mention --configuration too. 2013-04-12 17:14:22 +00:00
Doug Evans 3bbbf3149f Clean up "show configuration" entry. 2013-04-12 17:12:28 +00:00
Jan Kratochvil 39ed5604d7 gdb/
Fix GDB regression related to PR binutils/14813.
	* jit.c (mem_bfd_iovec_close): Return 0 for success.
	* minidebug.c (lzma_close): Add return value comment.
	* remote.c (remote_bfd_iovec_close): Return 0 for success.
	* solib-spu.c (spu_bfd_iovec_close): Likewise.
	* spu-linux-nat.c (spu_bfd_iovec_close): Likewise.
2013-04-12 16:04:07 +00:00
Jan Kratochvil 4936921797 gdb/
* config.in: Regenerate.
2013-04-12 16:02:29 +00:00
Tom Tromey d521ce577a * dwarf2-frame.c (struct comp_unit) <dwarf_frame_buffer>: Now
const.
	* dwarf2read.c (struct dwarf2_section_info) <buffer>: Now const.
	(struct die_reader_specs) <buffer>: Likewise.
	(die_reader_func_ftype): Make 'info_ptr' const.
	(struct line_header) <include_dirs, statement_program_start,
	statement_program_end>: Now const.
	(struct file_entry) <name>: Likewise.
	(struct partial_die_info) <sibling>: Likewise.
	(struct dwarf_block) <data>: Likewise.
	(dwarf2_read_section): Remove cast.
	(dwarf2_get_section_info): Make 'bufp' const.
	(read_index_from_section): Constify.
	(dw2_get_file_names_reader): Make 'info_ptr' const.
	(dw2_get_primary_filename_reader): Likewise.
	(read_comp_unit_head): Make 'info_ptr' and return type const.
	(read_and_check_comp_unit_head, read_and_check_type_unit_head):
	Likewise.
	(read_abbrev_offset): Constify.
	(dwarf2_create_include_psymtab): Make 'name' const.
	(create_debug_types_hash_table): Update.
	(read_cutu_die_from_dwo): Make 'result_info_ptr' const.
	(init_cutu_and_read_dies, init_cutu_and_read_dies_no_follow):
	Constify.
	(process_psymtab_comp_unit_reader, build_type_psymtabs_reader)
	(load_partial_comp_unit_reader): Make 'info_ptr' const.
	(read_comp_units_from_section): Constify.
	(peek_abbrev_code, peek_die_abbrev, skip_children, skip_one_die)
	(locate_pdi_sibling, load_full_comp_unit_reader): Make 'info_ptr'
	const.
	(dwarf2_compute_name, setup_type_unit_groups): Constify.
	(create_dwo_debug_info_hash_table): Make 'info_ptr' const.
	(create_dwp_hash_table, dwarf2_ranges_read)
	(dwarf2_record_block_ranges): Constify.
	(read_die_and_children, read_die_and_siblings_1)
	(read_die_and_siblings): Make 'info_ptr' and 'new_info_ptr'
	const.
	(read_full_die_1, read_full_die): Make 'info_ptr' const.
	(abbrev_table_read_table): Constify.
	(load_partial_dies): Make 'info_ptr' const.
	(read_partial_die, read_attribute_value, read_attribute): Make
	'info_ptr' and return type const.
	(read_address, read_initial_length)
	(read_checked_initial_length_and_offset, read_offset)
	(read_offset_1, read_n_bytes, read_direct_string): Make 'buf'
	const.
	(read_direct_string): Make 'buf' and return type const.
	(read_indirect_string_at_offset, read_indirect_string_from_dwz)
	(read_indirect_string): Make return type const.
	(read_unsigned_leb128, read_signed_leb128): Make 'buf' const.
	(read_addr_index_from_leb128, dwarf2_read_addr_index_reader): Make
	'info_ptr' const.
	(read_str_index): Make return type const.
	(add_include_dir): Make 'include_dir' const.
	(add_file_name): Make 'name' const.
	(dwarf_decode_line_header): Constify.
	(psymtab_include_file_name): Make return type const.
	(dwarf_decode_lines_1, dwarf_decode_lines): Constify.
	(dwarf2_start_subfile): Make 'filename' const.
	(dwarf2_const_value_attr): Make 'bytes' const.
	(read_signatured_type_reader): Make 'info_ptr' const.
	(decode_locdesc): Constify.
	(skip_form_bytes): Make 'bytes', 'buffer_end', and return type
	const.
	(skip_unknown_opcode): Make 'opcode_definitions', 'mac_ptr',
	'mac_end', and return type const.
	(dwarf_parse_macro_header): Make 'mac_ptr' and return type const.
	(dwarf_decode_macro_bytes): Make 'mac_ptr', 'mac_end', and return
	type const.
	(per_cu_header_read_in): Constify.
	* symfile.h (dwarf2_get_section_info): Update.
2013-04-12 14:55:28 +00:00
Tom Tromey d47a1bc1fa * symtab.h (struct general_symbol_info) <value.bytes>: Make const. 2013-04-12 14:49:25 +00:00
Eli Zaretskii dccca75d80 NEWS: Document 'show configuration'. 2013-04-12 08:57:43 +00:00
Eli Zaretskii 6eaaf48b1c Implement a new command to show GDB build-time configuration parameters.
* top.c (print_gdb_configuration): New function, displays the
	details about GDB configure-time parameters.
	(print_gdb_version): Mention "show configuration".

	* cli/cli-cmds.c (show_configuration): New function.
	(_initialize_cli_cmds): Add the "show configuration" command.

	* main.c (captured_main) <print_configuration>: New static var.
	<long_options>: Use it.
	If --configuration was given, call print_gdb_configuration.

	* doc/gdb.texinfo (Mode Options): Document '-configuration'.
	(Help): Document "show configuration".
	(Bug Reporting): Add requirements to include the configuration
	details in bug reports.
2013-04-12 08:57:07 +00:00
gdbadmin 3bcd3d1135 *** empty log message *** 2013-04-12 00:00:32 +00:00
Jan Kratochvil c96b3c4f35 gdb/
Fix parsing tabs in ${gdb_target_obs}.
	* configure.tgt (gdb_have_gcore): Replace case with for and if.
2013-04-11 16:53:01 +00:00
Jan Kratochvil b292c78318 gdb/
* Makefile.in (HAVE_NATIVE_GCORE_TARGET): New.
	(generated_files): Add gcore.
	(install-only, uninstall): Add gcore if HAVE_NATIVE_GCORE_TARGET or
	HAVE_NATIVE_GCORE_HOST.
	(gcore): New.
	* NEWS (Changes since GDB 7.6): Mention newly installed gcore.
	* config/alpha/alpha-osf3.mh, config/i386/fbsd.mh,
	config/i386/fbsd64.mh, config/i386/i386gnu.mh, config/i386/i386sol2.mh,
	config/i386/sol2-64.mh, config/mips/irix5.mh, config/mips/irix6.mh,
	config/powerpc/fbsd.mh, config/sparc/fbsd.mh, config/sparc/sol2.mh:
	Add HAVE_NATIVE_GCORE_HOST.
	* configure: Regenerate.
	* configure.ac (HAVE_NATIVE_GCORE_TARGET): New, set it, AC_SUBST it.
	New AC_SUBST fir GDB_TRANSFORM_NAME and GCORE_TRANSFORM_NAME.  New
	AC_CONFIG_FILES for gcore.
	* configure.tgt: Add gdb_have_gcore to the initial comment.  Set
	gdb_have_gcore.
	* gdb_gcore.sh: Rename to ...
	* gcore.in: ... here.  Remove gcore.sh comment.  Use GDB_TRANSFORM_NAME
	and GCORE_TRANSFORM_NAME substitutions.

gdb/doc/
	* Makefile.in (MAN1S): Add gcore.1.
	Remove "Host, target, and site specific Makefile fragments" comment.
	(@host_makefile_frag@, HAVE_NATIVE_GCORE_TARGET): New.
	(install-man1, uninstall-man1): Conditionalize gcore.1.
	(gcore.1): New.
	* gdb.texinfo (Man Pages): Add gcore man.
	(gcore man): New node.
2013-04-11 14:13:44 +00:00
Jan Kratochvil d6cb50a201 gdb/
* remote.c (unpush_and_perror): Add output message final dot.
2013-04-11 13:14:04 +00:00
Yao Qi cf2cb5ec99 gdb/
* tracepoint.c (tfile_interp_line): Fit parameters line and
	utpp in one line.
2013-04-11 05:05:49 +00:00
Joel Brobecker 07293be448 Do not overwrite so_list's so_name in solib_map_sections
gdb/ChangeLog:

        * solib.c (solib_map_sections): Remove code overwriting
        SO->SO_NAME with the bfd's filename.
2013-04-11 01:18:49 +00:00
gdbadmin 117548399a *** empty log message *** 2013-04-11 00:00:33 +00:00
Pedro Alves f81d112039 Accept "set foo unlimited" in integer/uinteger/zuinteger_unlimited commands.
Currently, several commands take "0" or "-1" to mean "unlimited".

"show" knows when to print "unlimited":

 (gdb) show height
 Number of lines gdb thinks are in a page is 45.
 (gdb) set height 0
 (gdb) show height
 Number of lines gdb thinks are in a page is unlimited.

However, the user can't herself specify "unlimited" directly:

 (gdb) set height unlimited
 No symbol table is loaded.  Use the "file" command.
 (gdb)

This patch addresses that, by adjusting the set handler for all
integer/uinteger/zuinteger_unlimited commands to accept literal
"unlimited".  It also installs a completer.  Presently, we complete on
symbols by default, and at
<http://sourceware.org/ml/gdb-patches/2013-03/msg00864.html> I've
shown a WIP prototype that tried to keep that half working in these
commands.  In the end, it turned out to be more complicated than
justifiable, IMO.  It's super rare to want to pass the value of a
variable/symbol in the program to a GDB set/show knob.  That'll still
work, it's just that we won't assist with completion anymore.  This
patch just sticks with the simple, and completes on "unlimited", and
nothing else.  This simplification means that

  "set he<tab><tab>"

is all it takes to get to:

  "set height unlimited"

The patch then goes through all integer/uinteger/zuinteger_unlimited
commands in the tree, and updates both the online help and the manual
to mention that "unlimited" is accepted in addition to 0/-1.  In the
cases where the command had no online help text at all, this adds it.
I've tried to make the texts read in a way that "unlimited" is
suggested before "0" or "-1" is.

Tested on x86_64 Fedora 17.

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

	* cli/cli-decode.c (integer_unlimited_completer): New function.
	(add_setshow_integer_cmd, add_setshow_uinteger_cmd)
	(add_setshow_zuinteger_unlimited_cmd): Install the "unlimited"
	completer.
	* cli/cli-setshow.c: Include "cli/cli-utils.h".
	(is_unlimited_literal): New function.
	(do_set_command): Handle literal "unlimited" arguments.
	* frame.c (_initialize_frame) <set backtrace limit>: Document
	"unlimited".
	* printcmd.c (_initialize_printcmd) <set print
	max-symbolic-offset>: Add help text.
	* record-full.c (_initialize_record_full) <set record full
	insn-number-max>: Likewise.
	* record.c (_initialize_record) <set record
	instruction-history-size, set record function-call-history-size>:
	Add help text.
	* ser-tcp.c (_initialize_ser_tcp) <set tcp connect-timeout>: Add
	help text.
	* tracepoint.c (_initialize_tracepoint) <set trace-buffer-size>:
	Likewise.
	* source.c (_initialize_source) <set listsize>: Add help text.
	* utils.c (initialize_utils) <set height, set width>: Likewise.
	<set pagination>: Mention "set height unlimited".
	* valprint.c (_initialize_valprint) <set print elements, set print
	repeats>: Document "unlimited".

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

	* gdb.texinfo (Process Record and Replay): Document that "set
	record full insn-number-max", "set record
	instruction-history-size" and "set record
	function-call-history-size" accept "unlimited".
	(Backtrace): Document that "set backtrace limit" accepts
	"unlimited".
	(List): Document that "set listsize" accepts "unlimited".
	(Print Settings)" Document that "set print max-symbolic-offset",
	"set print elements" and "set print repeats" accept "unlimited".
	(Starting and Stopping Trace Experiments): Document that "set
	trace-buffer-size" accepts "unlimited".
	(Remote Configuration): Document that "set tcp connect-timeout"
	accepts "unlimited".
	(Command History): Document that "set history size" accepts
	"unlimited".
	(Screen Size): Document that "set height" and "set width" accepts
	"unlimited".  Adjust "set pagination"'s description to suggest
	"set height unlimited" instead of "set height 0".

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

	* gdb.base/completion.exp: Test "set height", "set listsize" and
	"set trace-buffer-size" completion.
	* gdb.base/setshow.exp: Test "set height unlimited".
	* gdb.trace/trace-buffer-size.exp: Test "set trace-buffer-size
	unlimited".
2013-04-10 15:11:12 +00:00
Pedro Alves 2f9d54cfce make -gdb-exit call disconnect_tracing too, and don't lose history if the target errors on "quit"
Gareth mentions in PR gdb/15275:

 "The MI '-gdb-exit' command mi_cmd_gdb_exit() never calls disconnect_tracing()
 and therefore exits correctly."

It should, so to get out of tfind mode, as quit may detach instead of
kill, and we don't want to confuse the memory/register accesses
etc. of the detach process.  So we should push down the disconnect
tracing bits at least to quit_force.  But we can't as is, as that
would swallow the error thrown by answering "no" to:

  Trace is running but will stop on detach; detach anyway? (y or n)

So to address that, we split disconnect_tracing in two.  One part that
does the query, and another part that does the rest, and we make
quit_force call the latter.

Looking at quit_force, it does several things, some of which are a bit
independent of the others.  It first kills/detaches, and then writes
history, and then runs the final cleanups.  It seems better to me to
do each of these things even if the previous thing throws.  E.g., as
is, if something throws while detaching, then we skip writing history.

Tested on x86_64 Fedora 17.

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

	* cli/cli-cmds.c (quit_command): Call query_if_trace_running
	instead of disconnect_tracing.
	* infcmd.c (detach_command, disconnect_command): Call
	query_if_trace_running.  Adjust.
	* top.c: Include "tracepoint.h".
	(quit_target): Delete.  Contents moved ...
	(quit_force): ... here.  Wrap each stage of teardown in
	TRY_CATCH.  Call disconnect_tracing before detaching.
2013-04-10 14:10:35 +00:00
Yao Qi 393fd4c376 gdb/
2013-04-10  Hui Zhu  <hui@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* configure.ac: Check libbabeltrace is installed.
	* config.in: Regenerate.
	* configure: Regenerate.
	* Makefile.in (LIBBABELTRACE): New.
	(CLIBS): Add LIBBABELTRACE.
	* ctf.c: Include "exec.h".
	(CTF_EVENT_ID_STATUS, CTF_EVENT_ID_TSV_DEF): New macros.
	(CTF_EVENT_ID_TP_DEF, ctf_save_write_int32): New macros.
	(ctf_save_metadata_header): Define new type aliases in
	metadata.
	(ctf_write_header): Define event type "tsv_def" and "tp_def"
	in metadata.  Start a new faked packet for trace status.
	(ctf_write_status): Write trace status to CTF.
	(ctf_write_uploaded_tsv): Write TSV to CTF.
	(ctf_write_uploaded_tp): Write tracepoint definition to CTF.
	(ctf_write_definition_end): End the faked packet.

	(ctx, ctf_iter, trace_dirname): New.
	(start_pos): New variable.
	(ctf_destroy, ctf_open_dir, ctf_open): New.
	(SET_INT32_FIELD, SET_ARRAY_FIELD, SET_STRING_FIELD): New
	macros.
	(ctf_read_tsv, ctf_read_tp, ctf_close, ctf_files_info): New.
	(ctf_fetch_registers, ctf_xfer_partial): New.
	(ctf_get_trace_state_variable_value): New.
	(ctf_get_tpnum_from_frame_event): New.
	(ctf_get_traceframe_address): New.
	(ctf_trace_find, ctf_has_stack): New.
	(ctf_has_registers, ctf_traceframe_info, init_ctf_ops): New.
	(ctf_get_trace_status, ctf_read_status): New.
	(_initialize_ctf): New.
	* tracepoint.c (get_tracepoint_number): New
	(get_uploaded_tsv): Remove 'static'.
 	(struct traceframe_info, trace_regblock_size): Move it to ...
	* tracepoint.h: ... here.
	(get_tracepoint_number): Declare it.
	(get_uploaded_tsv): Declare it.

	* NEWS: Mention new configure option.

gdb/doc/

2013-04-10  Yao Qi  <yao@codesourcery.com>

	* gdb.texinfo (Trace Files): Add "target ctf".

gdb/testsuite/

2013-04-10  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/actions.exp: Save trace data to CTF.
	Change to ctf target if GDB supports, read CTF data in ctf
	target, and check the actions of tracepoints.
	* gdb.trace/while-stepping.exp: Likewise.
	* gdb.trace/report.exp: Test GDB saves trace data to CTF
	format and read CTF trace file if GDB supports.
	* gdb.trace/tstatus.exp: Save trace data to CTF.  If ctf
	target is supported, change to ctf target, read trace data and
	check output of command "tstatus".
	* gdb.trace/tsv.exp: Save trace frame to CTF.  If GDB supports,
	read CTF data by target ctf and call check_tsv.
2013-04-10 09:42:57 +00:00
Yao Qi b7a273f8c6 gdb/testsuite/
* gdb.trace/actions.exp (check_tracepoint): New.
	(top level): Start the tracing and check the actions of
	tracepoints.  Save trace data to tfile format.  Restart GDB
	and read trace file in tfile target.  Check the actions of
	tracepoints again.
	* gdb.trace/while-stepping.exp: Likewise.
2013-04-10 06:12:01 +00:00
Yao Qi f37867715f gdb/testsuite/
* gdb.trace/report.exp: Use standard_output_file for saved
	trace file.
2013-04-10 05:35:56 +00:00
Hui Zhu 5c2b44181d 2013-04-10 Pedro Alves <palves@redhat.com>
Hui Zhu  <hui@codesourcery.com>

	* breakpoint.c (dprintf_re_set): New.
	(initialize_breakpoint_ops): Set dprintf_breakpoint_ops re_set
	to dprintf_re_set.

2013-04-10  Hui Zhu  <hui@codesourcery.com>

	* gdb.base/Makefile.in (EXECUTABLES): Add dprintf-pending.
	(MISCELLANEOUS): Add dprintf-pendshr.sl.
	* gdb.base/dprintf-pending.c, gdb.base/dprintf-pending.exp: New.
2013-04-10 04:35:21 +00:00
Joel Brobecker a5c6673503 Remove solib-svr4.o from gdb_target_obs for ppc-aix.
gdb/ChangeLog:

        * configure.tgt (gdb_target_obs) <powerpc-*-aix* | rs6000-*-*>:
        Remove solib-svr4.o from the list.
2013-04-10 00:47:32 +00:00
gdbadmin 066938319f *** empty log message *** 2013-04-10 00:00:03 +00:00
Joel Brobecker 9e77999c3a Fix build failure in varobj.c:update_dynamic_varobj_children...
... when !HAVE_PYTHON.

gdb/ChangeLog:

        * varobj.c (update_dynamic_varobj_children) [!HAVE_PYTHON]:
        Use gdb_assert_not_reached instead of invalid boolean expression.
2013-04-09 23:30:50 +00:00
Jan Kratochvil f7543f0a4f gdb/testsuite/
* gdb.server/server-kill.exp (tstatus): Permit also ECONNRESET
	response.
2013-04-09 15:26:44 +00:00
Pedro Alves 1927e61863 Avoid potencially-stale errno usage.
The current throw_perror_with_name/TARGET_CLOSE_ERROR calls assume
errno is still set to the right error, although remote_unpush_target
is called in between, which may well change errno.

Tested on x86_64 Fedora 17 w/ gdbserver.

gdb/
2013-04-09  Pedro Alves  <palves@redhat.com>

	* remote.c (unpush_and_perror): New function.
	(readchar, remote_serial_write): Use it.
2013-04-09 12:18:34 +00:00
Markus Metzger 10782d74c0 gdb/
* NEWS: Mention new btrace RSP packets.
2013-04-09 08:04:32 +00:00
Tom Tromey 4c8429eff1 * symmisc.c (dump_msymbols): Cast fprintf_filtered argument to
long.
2013-04-09 02:17:17 +00:00
gdbadmin 6b2021910a *** empty log message *** 2013-04-09 00:00:03 +00:00
Tom Tromey 8625fc1bba * maint.c (print_bfd_section_info): Print the section index.
* symmisc.c (dump_msymbols): Print the section index.
2013-04-08 20:20:46 +00:00
Tom Tromey e27d198cc4 PR symtab/8424:
* blockframe.c (find_pc_partial_function_gnu_ifunc): Check
	SYMBOL_SECTION, not SYMBOL_OBJ_SECTION.
	* breakpoint.c (resolve_sal_pc): Update.
	* elfread.c (elf_gnu_ifunc_record_cache): Update.
	* findvar.c (struct minsym_lookup_data) <objfile>: New field.
	(minsym_lookup_iterator_cb): Use it.
	(default_read_var_value): Update.
	* hppa-hpux-tdep.c (hppa64_hpux_in_solib_call_trampoline):
	Update.
	* infcmd.c (jump_command): Update.
	* linespec.c (minsym_found): Update.
	* maint.c (maintenance_translate_address): Update.
	* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Update.
	(prim_record_minimal_symbol_full): Don't set SYMBOL_OBJ_SECTION.
	* parse.c (write_exp_msymbol): Update.
	* printcmd.c (address_info): Update.
	* psymtab.c (find_pc_sect_psymbol): Update.
	(fixup_psymbol_section): Check SYMBOL_SECTION, not
	SYMBOL_OBJ_SECTION.
	(add_psymbol_to_bcache): Correctly initialize SYMBOL_SECTION.
	Don't initialize SYMBOL_OBJ_SECTION.
	* spu-tdep.c (spu_catch_start): Update.
	* stabsread.c (define_symbol): Don't set SYMBOL_SECTION.
	* symmisc.c (dump_msymbols, print_symbol): Update.
	* symtab.c (fixup_section): Don't set 'obj_section'.  Change
	how fallback section is computed.
	(fixup_symbol_section): Update.
	(find_pc_sect_symtab, find_function_start_sal, skip_prologue_sal):
	Update.
	(allocate_symbol, initialize_symbol, allocate_template_symbol):
	Initialize SYMBOL_SECTION.
	* symtab.h (struct general_symbol_info) <section>: Update comment.
	<obj_section>: Remove.
	(SYMBOL_OBJ_SECTION): Add 'objfile' argument.  Rewrite.
	(SYMBOL_OBJFILE): New macro.
2013-04-08 20:18:11 +00:00
Tom Tromey e6dc44a8f5 * coffread.c (record_minimal_symbol): Update.
* dbxread.c (record_minimal_symbol): Update.
	* elfread.c (record_minimal_symbol): Update.
	* machoread.c (macho_symtab_add_minsym): Update.
	* mdebugread.c (record_minimal_symbol, parse_partial_symbols):
	Update.
	* minsyms.c (prim_record_minimal_symbol): Update.
	(prim_record_minimal_symbol_full): Remove 'bfd_section'
	argument.
	(prim_record_minimal_symbol_and_info): Likewise.
	* minsyms.h (prim_record_minimal_symbol_full)
	(prim_record_minimal_symbol_and_info): Update.
	* symtab.c (allocate_symbol, initialize_symbol)
	(allocate_template_symbol): Initialize SYMBOL_SECTION.
	* xcoffread.c (record_minimal_symbol, scan_xcoff_symtab):
	Update.
2013-04-08 20:13:22 +00:00
Tom Tromey 36192a8d54 PR symtab/8423:
* solib-som.c (som_solib_section_offsets): Use BFD section
	indices.  Set offsets for all sections.
	* somread.c (som_symtab_read): Compute BFD section for
	symbol.  Use prim_record_minimal_symbol_and_info.
	(som_symfile_read): Fix comment.
	(struct find_section_offset_arg): New.
	(find_section_offset, set_section_index): New functions.
	(som_symfile_offsets): Use set_section_index to compute
	section indices.
bfd/
	* som.c (bfd_section_from_som_symbol): No longer static.
	* som.h (bfd_section_from_som_symbol): Declare.
2013-04-08 20:08:21 +00:00
Tom Tromey 65cf356359 * coffread.c (cs_to_section): Use gdb_bfd_section_index.
* elfread.c (record_minimal_symbol, elf_symtab_read): Use
	gdb_bfd_section_index.
	* gdb_bfd.c (gdb_bfd_section_index, gdb_bfd_count_sections):
	New functions.
	* gdb_bfd.h (gdb_bfd_section_index, gdb_bfd_count_sections):
	Declare.
	* machoread.c (macho_symtab_add_minsym, macho_symfile_offsets):
	Update.
	* objfiles.c (add_to_objfile_sections_full): New function.
	(add_to_objfile_sections): Use it.
	(build_section_table): Rewrite.
	(objfile_relocate1): Use gdb_bfd_section_index.  Update.
	* objfiles.h (obj_section_offset): Use gdb_bfd_section_index.
	(struct objfile) <sections>: Update comment.
	(ALL_OBJFILE_OSECTIONS): Skip sections where the_bfd_section
	is NULL.
	(ALL_OBJSECTIONS): Use it.
	* solib-dsbt.c (dsbt_relocate_main_executable): Update.
	* solib-frv.c (frv_relocate_main_executable): Update.
	* solib-target.c (solib_target_relocate_section_addresses):
	Use gdb_bfd_section_index.
	* symfile.c (build_section_addr_info_from_section_table):
	Use gdb_bfd_section_index.
	(build_section_addr_info_from_bfd, place_section): Likewise.
	* symtab.c (fixup_section): Update.
	* xcoffread.c (find_targ_sec): Use gdb_bfd_section_index.
2013-04-08 20:04:42 +00:00
Tom Tromey 7cbd4a934e * minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
	Remove objfile argument.
	(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
	Return bound_minimal_symbol.
	* minsyms.c (lookup_minimal_symbol_by_pc_1)
	(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
	Return bound_minimal_symbol.
	(in_gnu_ifunc_stub): Update.
	(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
	Remove 'objfile_p' argument.
	(lookup_solib_trampoline_symbol_by_pc): Update.
	* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
	arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
	c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
	glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
	i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
	linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
	mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
	ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
	stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 19:59:09 +00:00
Tom Tromey f85f34ede8 * ada-lang.c (ada_decode_symbol): Check and set 'ada_mangled'.
Use symbol's obstack, not an objfile.
	* coffread.c (process_coff_symbol): Update.
	* dwarf2read.c (fixup_go_packaging, new_symbol_full): Update.
	* jv-lang.c (add_class_symbol): Update.
	* mdebugread.c (new_symbol): Update.
	* minsyms.c (prim_record_minimal_symbol_full)
	(terminate_minimal_symbol_table): Update.
	* psymtab.c (add_psymbol_to_bcache): Clear entire symbol.  Update.
	* stabsread.c (define_symbol, read_enum_type): Update.
	* symtab.c (symbol_set_demangled_name, symbol_get_demangled_name):
	Handle Ada specially.
	(symbol_set_language): Add 'obstack' argument.
	(symbol_set_names): Update.
	(symbol_natural_name, symbol_demangled_name): Always use
	ada_decode_symbol.
	* symtab.h (struct general_symbol_info)
	<language_specific::obstack>: New field.
	<ada_mangled>: New field.
	(SYMBOL_SET_LANGUAGE): Add 'obstack' argument.
	(symbol_set_language): Update.
2013-04-08 19:56:03 +00:00
Tom Tromey ccde22c0a4 * symtab.c (symbol_init_cplus_specific, symbol_set_demangled_name):
Take an obstack, not an objfile.
	(symbol_set_names): Update.
	* symtab.h (symbol_set_demangled_name): Update.
2013-04-08 19:53:18 +00:00
Tom Tromey e623cf5da2 * coffread.c (process_coff_symbol, coff_read_enum_type): Call
allocate_symbol.
	* dwarf2read.c (fixup_go_packaging): Call allocate_symbol.
	(read_func_scope): Call allocate_template_symbol.
	(new_symbol_full): Call allocate_symbol.
	* jit.c (finalize_symtab): Call allocate_symbol.
	* jv-lang.c (add_class_symbol): Call allocate_symbol.
	* mdebugread.c (parse_symbol, new_block): Call allocate_symbol.
	* stabsread.c (patch_block_stabs, define_symbol, read_enum_type)
	(common_block_end): Call allocate_symbol.
	* symtab.c (allocate_symbol, initialize_symbol)
	(allocate_template_symbol): New functions.
	* symtab.c (allocate_symbol, initialize_symbol)
	(allocate_template_symbol): Declare.
	* xcoffread.c (process_xcoff_symbol): Call initialize_symbol.
2013-04-08 19:48:30 +00:00
Pedro Alves f6de8ec262 create_breapoint / explicit mode: Error out if there's garbage after the breakpoint location.
If !PARSE_CONDITION_AND_THREAD, then ARG is just the location, nothing
else.  The fact that the describing comment of create_breakpoint
doesn't mention this just looks like an oversight of when extra_string
was added.  "parse_condition_and_thread" has been a misnomer ever
since extra_string was added -- better rename it avoid more confusion.
This makes it "parse_arg", as that'll remain stable even if/when more
explicit parameters are added.

gdb/
2013-04-08  Pedro Alves  <palves@redhat.com>
	    Keith Seitz  <keiths@redhat.com>

	* breakpoint.c (create_breakpoint): Rename
	"parse_condition_and_thread" parameter to "parse_arg".  Update
	describing comment.  If !PARSE_ARG, then error out if ARG is not
	the empty string after extracting the location.
	* breakpoint.h (create_breakpoint): Rename
	"parse_condition_and_thread" parameter to "parse_arg".

gdb/testsuite/
2013-04-08  Pedro Alves  <palves@redhat.com>

	* gdb.mi/mi-break.exp (test_error): Add tests with garbage after
	the location.
2013-04-08 14:09:30 +00:00
Aleksandar Ristovski f65ce5fb99 Add const to lm_addr_check.
* solib-svr4.c (lm_addr_check): Add const qualifier to 'so' arg.
2013-04-08 14:03:56 +00:00
gdbadmin 934335bf47 *** empty log message *** 2013-04-08 00:00:02 +00:00
Yao Qi cc5925ad7e gdb/
* remote.c (remote_trace_find): Change type of parameters 'addr1'
	and 'addr2' to CORE_ADDR.
	* target.c (update_current_target): Update.
	* target.h (struct target_ops) <to_trace_find>: Change parameter
	type to CORE_ADDR.
	* tracepoint.c (tfind_1): Change type of parameters 'addr1' and
	'addr2' to CORE_ADDR.
	(tfile_trace_find): Likewise.
	(tfile_get_traceframe_address): Change return type to CORE_ADDR.
	Change local variable 'addr' to type CORE_ADDR.
	* tracepoint.h (tfind_1): Update declaration.
2013-04-07 10:23:34 +00:00
Jan Kratochvil afe1492b21 gdb/doc/
* Makefile.in (gdb.1, gdbserver.1, gdbinit.5): Use $(srcdir).
2013-04-07 06:20:19 +00:00
Jan Kratochvil 0ed630cb00 gdb/doc/
* Makefile.in (install-man1, install-man5, uninstall-man1)
	(uninstall-man5): Replace $(MANS) by $(MAN1S) and $(MAN5S) respectively.
2013-04-07 06:04:58 +00:00
Jan Kratochvil 480b27bfaa gdb/gdbserver/
* Makefile.in (install-only): Fix make install regression.
2013-04-07 05:53:22 +00:00
gdbadmin 4ebcdc5d1a *** empty log message *** 2013-04-07 00:00:03 +00:00
Jan Kratochvil cba5a7bf0f gdb/doc/
* Makefile.in (POD2MAN1, POD2MAN5): Replace $(VERSION) by ../version.in.
2013-04-06 15:52:06 +00:00
Jan Kratochvil 5b8b6385be gdb/doc/
* gdb.texinfo (gdbserver man): Rename tty to comm.  Swap --attach
	parameters order.  Remove "On some targets" for --attach.  Document the
	--multi parameter and extended-remote command.  Document all the
	options.
2013-04-06 08:58:53 +00:00
Eli Zaretskii d9ac066415 Unbreak Windows-hosted cross debugger builds.
* windows-nat.c (windows_get_absolute_argv0): Move from here...
	* mingw-hdep.c (windows_get_absolute_argv0): ...to here.
	Include main.h.

	* windows-nat.h (windows_get_absolute_argv0): Move prototype from
	here...
	* main.h (windows_get_absolute_argv0): ...to here.
2013-04-06 06:52:06 +00:00
gdbadmin 524d4a957a *** empty log message *** 2013-04-06 00:00:03 +00:00
Doug Evans 02142a6c8b * dwarf2read.c (struct dwarf2_per_objfile): Tweak comment.
(read_cutu_die_from_dwo): Add comments.
	(read_structure_type): Update comment.
	(read_enumeration_type, read_namespace_type): Update comment.
	(read_die_type, get_die_type_at_offset, get_die_type): Update comment.
2013-04-05 21:48:25 +00:00
Jan Kratochvil 906ccdf016 gdb/doc/
* gdb.texinfo (gdb man): Mention option -p.  Include Fortran to
	the list of supported languages.
2013-04-05 20:02:58 +00:00
Jan Kratochvil 43662968f1 gdb/
Convert man pages to texinfo, new gdbinit.5 texinfo page.
	* Makefile.in (gdb.z): Remove.
	(install-only): Remove $(man1dir) and gdb.1 installation.
	* gdb.1: Remove.

gdb/gdbserver/
	Convert man pages to texinfo, new gdbinit.5 texinfo page.
	* Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
	installation.
	* gdbserver.1: Remove.

gdb/doc/
	Convert man pages to texinfo, new gdbinit.5 texinfo page.
	* Makefile.in (mandir, man1dir, man5dir, SYSTEM_GDBINIT, MANCONF,
	(TEXI2POD, POD2MAN1, POD2MAN5, MAN1S, MAN5S, MANS, man): New.
	(diststuff): Add man.
	(install-man, install-man1, install-man5, uninstall-man, uninstall-man1)
	(uninstall-man5): New.
	(STAGESTUFF): Add *.1 and *.5.
	(GDBvn.texi): Add SYSTEM_GDBINIT.
	(gdb.1, gdbserver.1, gdbinit.5): New.
	(maintainer-clean realclean): Add $(MANS).
	(install): Add install-man.
	(uninstall): Add uninstall-man.
	* gdb.texinfo (@include gdb-cfg.texi): Wrap it by @c man begin INCLUDE.
	(@copying): Wrap it by @c man begin COPYRIGHT.
	(Top): Add Man Pages.
	(Man Pages, gdb man, gdbserver man, gdbinit man): New.
2013-04-05 20:01:33 +00:00
Jan Kratochvil 9ead1b844c gdb/
Fix compatibility with Linux kernel 3.8.3.
	* linux-tdep.c (linux_find_memory_regions_full): Move variable number
	to more inner block.  Remove parsing of NUMBER from outer block.
	Parse NUMBER only if KEYWORD has been identified.
2013-04-05 19:17:15 +00:00
Jan Kratochvil d1794952ba gdb/
Fix variable name shadowing.
	* linux-tdep.c (linux_find_memory_regions_full): Rename outer variable
	filename to mapsfilename and update its uses.
2013-04-05 19:14:44 +00:00
Eli Zaretskii 9025569e3a Avoid warning in "make tags".
* Makefile.in (TAGS): Avoid warning from etags when $GDB_NM_FILE is
	empty.  See http://sourceware.org/ml/gdb-patches/2012-08/msg00504.html
	and http://sourceware.org/ml/gdb-patches/2013-04/msg00055.html for
	details of the problem.
2013-04-05 13:24:24 +00:00
gdbadmin 4b7654eed7 *** empty log message *** 2013-04-05 00:00:02 +00:00
Sandra Loosemore b8abfd5827 2013-04-04 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/

	* gdb.cp/cplabel.exp: Allow empty directory in file reported
	for breakpoint location.
2013-04-04 21:01:40 +00:00
Sandra Loosemore 156bffd096 2013-04-04 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/

	* gdb.linespec/linespec.exp: Make dir/file:line tests
	conditional for non-remote hosts only.
2013-04-04 20:59:12 +00:00
Pedro Alves c9a6ce02b5 tracepoint->step_count fixes
If a tracepoint's actions list includes a while-stepping action, and
then the actions are changed to a list without any while-stepping
action, the tracepoint's step_count will be left with a stale value.
For example:

 (gdb) trace subr
 Tracepoint 1 at 0x4004d9: file ../../../src/gdb/testsuite//actions-changed.c, line 31.
 (gdb) actions
 Enter actions for tracepoint 1, one per line.
 End with a line saying just "end".
 >collect $reg
 >end
 (gdb) set debug remote 1
 (gdb) tstart
 Sending packet: $QTinit#59...Packet received: OK
 Sending packet: $QTDP:1:00000000004004d9:E:0:0-#a3...Packet received: OK
 Sending packet: $QTDP👎00000000004004d9:R03FFFFFFFFFFFFFFFFFF#2b...Packet received: OK
 (gdb) tstop
 Sending packet: $QTStop#4b...Packet received: OK
 Sending packet: $QTNotes:#e8...Packet received: OK
 (gdb) actions
 Enter actions for tracepoint 1, one per line.
 End with a line saying just "end".
 >collect $reg
 >while-stepping 1
   >collect $reg
   >end
 >end
 (gdb) tstart
 Sending packet: $QTinit#59...Packet received: OK
 Sending packet: $QTDP:1:00000000004004d9:E:1:0-#a4...Packet received: OK
 Sending packet: $QTDP👎00000000004004d9:R03FFFFFFFFFFFFFFFFFF-#58...Packet received: OK
 Sending packet: $QTDP👎00000000004004d9:SR03FFFFFFFFFFFFFFFFFF#7e...Packet received: OK
 (gdb) tstop
 Sending packet: $QTStop#4b...Packet received: OK
 Sending packet: $QTNotes:#e8...Packet received: OK
 (gdb) actions
 Enter actions for tracepoint 1, one per line.
 End with a line saying just "end".
 >collect $regs
 >end
 (gdb) tstart
 Sending packet: $QTinit#59...Packet received: OK
 Sending packet: $QTDP:1:00000000004004d9:E:1:0-#a4...Packet received: OK
 Sending packet: $QTDP👎00000000004004d9:R03FFFFFFFFFFFFFFFFFF#2b...Packet received: OK

The last "$QTDP:1:00000000004004d9:E:1:0-#a4" should be "$QTDP:1:00000000004004d9:E:0:0-#a3".
In pseudo-diff:

  -$QTDP:1:00000000004004d9:E:1:0-#a4
  +$QTDP:1:00000000004004d9:E:0:0-#a3

A related issue is that the "commands" command actually supports
setting commands to a range of breakpoints/tracepoints at once.  But,
hacking "maint info breakpoints" to print t->step_count, reveals:

 (gdb) trace main
 Tracepoint 5 at 0x45a2ab: file ../../src/gdb/gdb.c, line 29.
 (gdb) trace main
 Note: breakpoint 5 also set at pc 0x45a2ab.
 Tracepoint 6 at 0x45a2ab: file ../../src/gdb/gdb.c, line 29.
 (gdb) commands 5-6
 Type commands for breakpoint(s) 5-6, one per line.
 End with a line saying just "end".
 > while-stepping 5
  >end
 > end
 (gdb) maint info breakpoints 5
 Num     Type           Disp Enb Address            What
 5       tracepoint     keep y   0x000000000045a2ab in main at ../../src/gdb/gdb.c:29 inf 1
         step_count=5
         ^^^^^^^^^^^^
         while-stepping 5
         end
         not installed on target
 (gdb) maint info breakpoints 6
 Num     Type           Disp Enb Address            What
 6       tracepoint     keep y   0x000000000045a2ab in main at ../../src/gdb/gdb.c:29 inf 1
         step_count=0
         ^^^^^^^^^^^^
         while-stepping 5
         end
         not installed on target
 (gdb)

that tracepoint 6 doesn't end up with the correct step_count.

The issue is that here:

 static void
 do_map_commands_command (struct breakpoint *b, void *data)
 {
  struct commands_info *info = data;

  if (info->cmd == NULL)
    {
      struct command_line *l;

      if (info->control != NULL)
	l = copy_command_lines (info->control->body_list[0]);
      else
	{
	  struct cleanup *old_chain;
	  char *str;

	  str = xstrprintf (_("Type commands for breakpoint(s) "
			      "%s, one per line."),
			    info->arg);

	  old_chain = make_cleanup (xfree, str);

	  l = read_command_lines (str,
				  info->from_tty, 1,
				  (is_tracepoint (b)
				   ? check_tracepoint_command : 0),
				  b);

	  do_cleanups (old_chain);
	}

      info->cmd = alloc_counted_command_line (l);
    }

validate_actionline is never called for tracepoints other than the
first (the copy_command_lines path).  Right below, we have:

  /* If a breakpoint was on the list more than once, we don't need to
     do anything.  */
  if (b->commands != info->cmd)
    {
      validate_commands_for_breakpoint (b, info->cmd->commands);
      incref_counted_command_line (info->cmd);
      decref_counted_command_line (&b->commands);
      b->commands = info->cmd;
      observer_notify_breakpoint_modified (b);
    }

And validate_commands_for_breakpoint looks like the right place to put
a call; if we reset step_count there too, we have a nice central fix
for the first issue as well, because trace_actions_command calls
breakpoint_set_commands that also calls
validate_commands_for_breakpoint.

We end up calling validate_actionline twice for the first tracepoint,
since read_command_lines calls it too, through
check_tracepoint_command, but that should be harmless.

2013-04-04  Pedro Alves  <palves@redhat.com>
	    Hui Zhu  <hui@codesourcery.com>

	* breakpoint.c (validate_commands_for_breakpoint): If validating a
	tracepoint, reset its STEP_COUNT and call validate_actionline.

2013-04-04  Stan Shebs  <stan@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.trace/Makefile.in (PROGS): Add actions-changed.
	* gdb.trace/actions-changed.c: New file.
	* gdb.trace/actions-changed.exp: New file.
	* lib/trace-support.exp (gdb_trace_setactions): Rename to ...
	(gdb_trace_setactions_command): ... this.  Add "actions_command"
	parameter, and handle it.
	(gdb_trace_setactions, gdb_trace_setcommands): New procedures.
2013-04-04 19:22:38 +00:00
Yao Qi 4bd05f2493 gdb/testsuite/
* gdb.server/server-kill.exp: Use command 'tstatus' instead of
	'step'.
2013-04-04 02:16:04 +00:00
gdbadmin 9e1097d62d *** empty log message *** 2013-04-04 00:00:32 +00:00
Doug Evans bf6af49608 * dwarf2read.c (read_die_and_siblings_1): Renamed from
read_die_and_siblings.
	(read_die_and_siblings): New function.
	(read_cutu_die_from_dwo): Dump die if requested.
	(read_die_and_children): Call read_full_die_1 and
	read_die_and_siblings_1.
	(read_full_die): Dump die if requested.

	* dwarf2read.c (read_comp_units_from_section): Add debugging printf.
2013-04-03 19:45:00 +00:00
Doug Evans 0ac5b59e25 * dwarf2read.c (struct dwo_file): New member comp_dir.
Rename member name to dwo_name.  All uses updated.
	(hash_dwo_file): Include comp_dir in computation.
	(eq_dwo_file): Ditto.
	(lookup_dwo_file_slot): New arg comp_dir.  All callers updated.
	(create_dwo_in_dwp, lookup_dwo_in_dwp, open_and_init_dwo_file): Ditto.
2013-04-03 19:11:01 +00:00
Doug Evans 5ff888ce0e * psymtab.c (read_psymtabs_with_fullname): Don't call
psymtab_to_fullname if the basenames are different.
2013-04-03 18:48:54 +00:00
Jan Kratochvil ec83d2110d gdb/
* NEWS (Changes in GDB 7.6): Update the data-disassemble for "fullname".
	New entry about "fullname" presence.
2013-04-03 18:28:49 +00:00
Pedro Alves 4f4352f74d NEWS: Mention x86_64/Cygwin as new native configuration too.
x86_64/Cygwin is only mentioned as a new target, but we gained support
for building a native x86_64/Cygwin debugger too.

gdb/
2013-04-03  Pedro Alves  <palves@redhat.com>

	* NEWS: Mention x86_64/Cygwin as new native configuration.
2013-04-03 18:04:33 +00:00
Yao Qi 3758b5ce95 gdb/testsuite/
* gdb.trace/mi-traceframe-changed.exp: Update tfile name to
	"tfile-basic.tf".
	(test_tfind_tfile): Likewise.
2013-04-03 10:11:46 +00:00
Yao Qi 1dcaed0de0 gdb/testsuite/
* gdb.trace/tfile.c (write_basic_trace_file): Pass argument
	"tfile-basic.tf" instead of "basic.tf".
	(write_error_trace_file): Pass argument "tfile-error.tf"
	instead of "error.tf".
	* gdb.trace/tfile.exp: Update tfile names to
	"tfile-basic.tf" and "tfile-error.tf".
2013-04-03 03:43:54 +00:00
Sandra Loosemore 0e7a53fca6 2013-04-02 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
	* gdb.cp/ovsrch.exp (test_class): Correct regexp to allow
	empty directory in file for breakpoint hit.
2013-04-03 01:40:19 +00:00