Commit Graph

33367 Commits

Author SHA1 Message Date
Doug Evans 20c681d15f * symtab.c (domain_name, search_domain_name): New functions.
* symtab.h (domain_name, search_domain_name): Declare.
2013-09-25 21:51:27 +00:00
Doug Evans ade7ed9e33 * symfile.h (struct quick_symbol_functions): Reorg arg list of
map_matching_symbols so objfile is first.  All uses updated.
	* dwarf2read.c (dw2_map_matching_symbols): Update signature.
	* psymtab.c (map_matching_symbols_psymtab): Update signature.
2013-09-25 21:44:11 +00:00
Ulrich Weigand 7d760051ff ChangeLog:
2013-09-25  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	PR shlibs/8882
	* solib-svr4.c (svr4_read_so_list): Skip the vDSO when reading
	link map entries.

testsuite/ChangeLog:
2013-09-25  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	PR shlibs/8882
	* gdb.base/corefile.exp: Add a check to assure warning-free
	core-file load.
2013-09-25 11:52:50 +00:00
Doug Evans 020f703635 * objfiles.c (free_objfile): Move comment. 2013-09-25 00:15:30 +00:00
Joel Brobecker 598402f0fe Delete unused ada-exp.y:string_to_operator
This function appears to have been unused since 2004.

gdb/ChangeLog:

        * ada-exp.y (string_to_operator): Delete.
        (dummy_string_to_ada_operator): Delete.
2013-09-24 19:41:35 +00:00
Joel Brobecker 874440b892 Fix name of file in ChangeLog entry (re-implement funcalls on x64-windows) 2013-09-24 17:24:20 +00:00
Joel Brobecker bf4d6c1cfc Revert use of classify callback in i386 gdbarch_tdep.
This is no longer useful, as it was introduced to reuse the funcall
handling code in amd64-tdep.c in the context of x64-windows. But
we have since then changed the implementations to be completely
independent of each other.

This reverts the non-windows-specific part of the change called:
    amd64: Integer parameters in function calls on Windows
(the x64-windows portion has already been reverted)

gdb/ChangeLog:

	Revert:
	* i386-tdep.h (enum amd64_reg_class): New, moved here from
	amd64-tdep.c.
	(struct gdbarch_tdep): Add fields call_dummy_num_integer_regs,
	call_dummy_integer_regs, and classify.
	* amd64-tdep.h (amd64_classify): Add declaration.
	* amd64-tdep.c (amd64_dummy_call_integer_regs): New static constant.
	(amd64_reg_class): Delete, moved to i386-tdep.h.
	(amd64_classify): Make non-static.  Move declaration to amd64-tdep.h.
	Replace call to amd64_classify by call to tdep->classify.
	(amd64_push_arguments): Get the list of registers to use for
	passing integer parameters from the gdbarch tdep structure,
	rather than using a hardcoded one.  Replace calls to amd64_classify
	by calls to tdep->classify.
	(amd64_push_dummy_call): Get the register number used for
	the "hidden" argument from tdep->call_dummy_integer_regs.
	(amd64_init_abi): Initialize tdep->call_dummy_num_integer_regs
	and tdep->call_dummy_integer_regs.  Set tdep->classify.
2013-09-24 16:14:15 +00:00
Joel Brobecker 849e975504 Revert use of memory_args_by_pointer in i386 gdbarch_tdep.
This is no longer useful, as it was introduced to reuse the funcall
handling code in amd64-tdep.c in the context of x64-windows. But
we have since then changed the implementations to be completely
independent of each other.

This reverts the non-windows-specific part of the change called:
    amd64-windows: memory args passed by pointer during function calls.
(the x64-windows portion has already been reverted)

gdb/ChangeLog:

        Revert:
        * i386-tdep.h (gdbarch_tdep): Add field memory_args_by_pointer.
        * amd64-tdep.c (amd64_push_arguments): Add handling of architectures
        where tdep->memory_args_by_pointer is non-zero.
2013-09-24 16:13:58 +00:00
Joel Brobecker c1459fd652 Revert use of integer_param_regs_saved_in_caller_frame in i386 gdbarch_tdep.
This is no longer useful, as it was introduced to reuse the funcall
handling code in amd64-tdep.c in the context of x64-windows. But
we have since then changed the implementations to be completely
independent of each other.

This reverts the non-windows-specific part of the change called:
    amd64-windows: 32 bytes allocated on stack by caller for integer
    parameter regs
(the x64-windows portion has already been reverted)

gdb/ChangeLog:

        Revert:
        * i386-tdep.h (struct gdbarch_tdep): Add new field
        integer_param_regs_saved_in_caller_frame.
        * amd64-tdep.c (amd64_push_dummy_call): Allocate some memory on
        stack if tdep->integer_param_regs_saved_in_caller_frame is set.
2013-09-24 16:13:49 +00:00
Joel Brobecker 20c2e3e0a3 Reimplement function calls on amd64-windows
This patch provides a standalone implementation of function calls
on amd64-windows, instead of providing some bits and pieces hooking
into the function call implementation meant for sysV (in amd64-tdep).
It makes better sense to do it this way, because the two ABIs are
actually very different; for instance, the concept of argument
classification, which is so central in the sysV ABI and drove the
the implementation in amd64-tdep, makes no sense for Windows. It
is therefore better for the Windows implementation to be completely
separate, rather than rely on adaptations of the sysV implementation.

gdb/ChangeLog:

        * amd64-tdep.c: #include "value.h"
        (amd64_windows_classify): Delete.
        (amd64_windows_passed_by_integer_register)
        (amd64_windows_passed_by_xmm_register)
        (amd64_windows_passed_by_pointer)
        (amd64_windows_adjust_args_passed_by_pointer)
        (amd64_windows_store_arg_in_reg, amd64_windows_push_arguments)
        (amd64_windows_push_dummy_call): New functions.
        (amd64_windows_init_abi): Remove setting of
        tdep->call_dummy_num_integer_regs, tdep->call_dummy_integer_regs,
        tdep->classify, tdep->memory_args_by_pointer and
        tdep->integer_param_regs_saved_in_caller_frame.
        Add call to set_gdbarch_push_dummy_call.
2013-09-24 16:13:40 +00:00
Jan Kratochvil 82bf32bc61 Support .dwp with the name of symlinked binary file
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2read.c (open_and_init_dwp_file): Try open_dwp_file also with
	objfile->original_name.

gdb/testsuite/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.dwarf2/dwp-symlink.c: New file.
	* gdb.dwarf2/dwp-symlink.exp: New file.
2013-09-24 14:03:43 +00:00
Jan Kratochvil 24ba069af8 Keep objfile original filename
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Pass down original filename for objfile.
	* coffread.c (coff_symfile_read): Update symbol_file_add_separate call.
	* elfread.c (elf_symfile_read): Likewise.
	* jit.c (jit_object_close_impl): Update allocate_objfile call, no
	longer set ORIGINAL_NAME.
	(jit_bfd_try_read_symtab): Update symbol_file_add_from_bfd call.
	* jv-lang.c (get_dynamics_objfile): Update allocate_objfile call.
	* machoread.c (macho_add_oso_symfile): Add parameter name.  Update
	symbol_file_add_from_bfd call.
	(macho_symfile_read_all_oso): Update two macho_add_oso_symfile calls.
	(macho_check_dsym): Add parameter filenamep.  Change function comment.
	Set *filenamep.
	(macho_symfile_read): New variable dsym_filename.  Update
	macho_check_dsym call.  Use it for symbol_file_add_separate.
	* objfiles.c (allocate_objfile): Add parameter name.  New comment for
	it.  Use it for objfile->original_name.
	(objfile_name): Return OBFD's filename, if available.
	* objfiles.h (allocate_objfile): Add new parameter name.
	* solib.c (solib_read_symbols): Update symbol_file_add_from_bfd call.
	* symfile-mem.c (symbol_file_add_from_memory): Update
	symbol_file_add_from_bfd call.
	* symfile.c (read_symbols): Update symbol_file_add_separate call, new
	comment for it.
	(symbol_file_add_with_addrs): New parameter name, add function comment
	for it.  Remove variable name.  Update allocate_objfile call.
	(symbol_file_add_separate): New parameter name, add function comment
	for it.  Update symbol_file_add_with_addrs call.
	(symbol_file_add_from_bfd): New parameter name.  Update
	symbol_file_add_with_addrs call.
	(symbol_file_add): Update symbol_file_add_from_bfd call.
	(reread_symbols): New variable original_name.  Save
	objfile->original_name by it.
	* symfile.h (symbol_file_add_from_bfd, symbol_file_add_separate): Add
	second parameter.
2013-09-24 14:00:06 +00:00
Jan Kratochvil 4262abfb98 Code cleanup: Add objfile_name accessor
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Code cleanup: Add objfile_name accessor function.
	* ada-lang.c (is_known_support_routine): Use objfile_name.
	* auto-load.c (source_gdb_script_for_objfile)
	(auto_load_objfile_script): Likewise.
	* coffread.c (coff_symtab_read, read_one_sym): Likewise.
	* dbxread.c (dbx_symfile_read): Likewise.
	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
	* dwarf2loc.c (locexpr_describe_location_piece): Likewise.
	* dwarf2read.c (dwarf2_get_dwz_file, dwarf2_read_index)
	(dw2_symtab_iter_next, dw2_expand_symtabs_matching)
	(lookup_dwp_signatured_type, lookup_dwo_unit)
	(dwarf2_build_psymtabs_hard, scan_partial_symbols, process_queue)
	(fixup_go_packaging, process_imported_unit_die, dwarf2_physname)
	(read_import_statement, create_dwo_cu, open_and_init_dwp_file)
	(lookup_dwo_cutu, read_call_site_scope, dwarf2_ranges_read)
	(dwarf2_record_block_ranges, read_common_block, read_typedef)
	(read_subrange_type, load_partial_dies, read_partial_die)
	(read_addr_index_1, read_str_index, dwarf_decode_lines_1)
	(die_containing_type, build_error_marker_type, lookup_die_type)
	(follow_die_ref_or_sig, follow_die_ref, dwarf2_fetch_die_loc_sect_off)
	(dwarf2_fetch_constant_bytes, follow_die_sig, get_signatured_type)
	(get_DW_AT_signature_type, write_psymtabs_to_index)
	(save_gdb_index_command): Likewise.
	* elfread.c (find_separate_debug_file_by_buildid, elf_symfile_read):
	Likewise.
	* expprint.c (dump_subexp_body_standard): Likewise.
	* gdbtypes.c (type_name_no_tag_or_error): Likewise.
	* jit.c (jit_object_close_impl): Use the objfile field name renamed to
	original_name.
	* linux-thread-db.c (try_thread_db_load_from_pdir_1): New variable
	obj_name, use objfile_name for it, use the variable.
	(try_thread_db_load_from_pdir, has_libpthread, thread_db_new_objfile):
	Use objfile_name.
	* machoread.c (macho_symtab_read, macho_check_dsym)
	(macho_symfile_relocate): Likewise.
	* maint.c (maintenance_translate_address): Likewise.
	* minidebug.c (find_separate_debug_file_in_section): Likewise.
	* minsyms.c (install_minimal_symbols): Likewise.
	* objfiles.c (allocate_objfile): Use the objfile field name renamed to
	original_name.
	(filter_overlapping_sections): Use objfile_name.
	(objfile_name): New function.
	* objfiles.h (struct objfile): Rename field name to original_name.
	(objfile_name): New prototype.
	* printcmd.c (sym_info, address_info): Use objfile_name.
	* probe.c (parse_probes, collect_probes, compare_probes)
	(info_probes_for_ops): Likewise.
	* progspace.c (clone_program_space): Likewise.
	* psymtab.c (require_partial_symbols, dump_psymtab, allocate_psymtab)
	(maintenance_info_psymtabs): Likewise.
	* python/py-auto-load.c (gdbpy_load_auto_script_for_objfile)
	(source_section_scripts): Likewise.
	* python/py-objfile.c (objfpy_get_filename): Likewise.
	* python/py-progspace.c (pspy_get_filename): Likewise.
	* solib-aix.c (solib_aix_get_toc_value): Likewise.
	* solib-som.c (match_main, som_solib_section_offsets): Likewise.
	* solib.c (solib_read_symbols): Likewise.
	* stabsread.c (scan_file_globals): Likewise.
	* stap-probe.c (handle_stap_probe): Likewise.
	* symfile.c (symbol_file_clear, separate_debug_file_exists)
	(find_separate_debug_file_by_debuglink): Likewise.
	(reread_symbols): Likewise.  Use the objfile field name renamed to
	original_name.
	(allocate_symtab): Use objfile_name.
	* symmisc.c (print_symbol_bcache_statistics, print_objfile_statistics)
	(dump_objfile, dump_msymbols, dump_symtab_1)
	(maintenance_print_msymbols, maintenance_print_objfiles)
	(maintenance_info_symtabs, maintenance_check_symtabs): Likewise.
	* target.c (target_translate_tls_address, target_info): Likewise.
	* xcoffread.c (xcoff_initial_scan): Make variable name const.  Use
	objfile_name.
2013-09-24 13:57:38 +00:00
Jan Kratochvil 4721dc1823 Code cleanup: rename variable
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Code cleanup.
	* probe.c (parse_probes): Rename variable objfile_name to
	objfile_namestr.
2013-09-24 13:54:42 +00:00
Jan Kratochvil a61d6db83d Remove solib-sunos.c
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Remove solib-sunos.c.
	* Makefile.in (ALLDEPFILES): Remove solib-sunos.c.
	* config/m68k/obsd.mh (NATDEPFILES): Remove solib-sunos.o.
	* objfiles.c (rt_common_objfile): Remove.
	(free_objfile): Remove rt_common_objfile comparison.
	* objfiles.h (rt_common_objfile): Remove.
	* solib-sunos.c: Remove.
	* symfile.c (reread_symbols): Remove solib-sunos.c comment.
2013-09-24 13:51:55 +00:00
Jan Kratochvil 2659903bfa Remove a.out NetBSD and OpenBSD hosts
gdb/
2013-09-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Remove a.out NetBSD and OpenBSD hosts.
	* NEWS (Removed native configurations): New.
	* config/arm/nbsdaout.mh: Remove.
	* config/i386/nbsdaout.mh: Remove.
	* config/i386/obsdaout.mh: Remove.
	* config/m68k/nbsdaout.mh: Remove.
	* config/sparc/nbsdaout.mh: Remove.
	* config/vax/nbsdaout.mh: Remove.
	* configure.host (arm*-*-netbsd*, i[34567]86-*-netbsd*)
	(i[34567]86-*-openbsd[0-2].*, i[34567]86-*-openbsd3.[0-3])
	(m68*-*-netbsd*, sparc-*-netbsd*, vax-*-netbsd*): Add them to obsolete
	error.
	(arm*-*-netbsd*, i[34567]86-*-netbsd*, i[34567]86-*-openbsd[0-2].*)
	(i[34567]86-*-openbsd3.[0-3], m68*-*-netbsd*, sparc-*-netbsdaout*)
	(sparc-*-netbsd*, vax-*-netbsd*): Remove.
2013-09-24 13:48:44 +00:00
Tom Tromey 4bda5690b5 revert erroneous checkin to mi-support.exp 2013-09-23 18:11:49 +00:00
Tom Tromey f60e2d5c2a (clh 9) 2013-09-23 18:07:46 +00:00
Andrew Burgess d3eaaf6622 In regcache use print_hex_chars.
https://sourceware.org/ml/gdb-patches/2013-09/msg00815.html

gdb/ChangeLog

        * regcache.c: Add include of valprint.h.
        (dump_endian_bytes): Delete.
        (regcache_dump): Use print_hex_chars not dump_endian_bytes.
2013-09-23 16:48:43 +00:00
Andrew Burgess 2cc762b50b Reuse print_hex_chars.
https://sourceware.org/ml/gdb-patches/2013-09/msg00768.html

gdb/ChangeLog

        * sh64-tdep.c (sh64_do_fp_register): Use print_hex_chars.
2013-09-23 09:18:44 +00:00
Doug Evans 6b4646ced5 * lib/dwarf.exp (build_executable_from_fission_assembler): New proc.
* gdb.dwarf2/fission-base.S: Update.  Split out .dwo into separate
	file.
	* gdb.dwarf2/fission-loclists.S: Ditto.
	* gdb.dwarf2/fission-reread.S: Ditto.
	* gdb.dwarf2/fission-base.exp: Skip of remote host.  Compile with
	build_executable_from_fission_assembler.
	* gdb.dwarf2/fission-loclists.exp: Ditto.
	* gdb.dwarf2/fission-reread.exp: Ditto.
2013-09-20 22:43:28 +00:00
Doug Evans 4fa7d39097 * lib/future.exp (gdb_find_objcopy, gdb_find_readelf): New procs.
* lib/gdb.exp (build_id_debug_filename_get): Update to use them.
	(gdb_gnu_strip_debug): Ditto.
	* lib/prelink-support.exp (section_get, prelink_no): Ditto.
	* gdb.arch/altivec-abi.exp: Ditto.
	* gdb.base/attach-pie-misread.exp: Ditto.
	* gdb.base/comprdebug.exp: Ditto.
	* gdb.base/dup-sect.exp: Ditto.
	* gdb.base/gnu-debugdata.exp: Ditto.
	* gdb.base/step-symless.exp: Ditto.
	* gdb.dwarf2/dw2-inline-param.exp: Ditto.
	* gdb.dwarf2/dw2-skip-prologue.exp: Ditto.
	* gdb.dwarf2/gdb-index.exp: Ditto.
2013-09-20 21:47:06 +00:00
Pedro Alves 961815297c Fix regressions caused by thread-specific breakpoint deletion.
The recent change to make GDB auto-delete thread-specific breakpoints
when the corresponding thread is deleted
(https://sourceware.org/ml/gdb-patches/2013-09/msg00038.html) caused
gdb.base/nextoverexit.exp to regress.

    Breakpoint 1, main () at .../gdb/testsuite/gdb.base/nextoverexit.c:21
    21        exit (0);
    (gdb) next
    [Inferior 1 (process 25208) exited normally]
    Thread-specific breakpoint -5 deleted - thread 1 is gone.
    Thread-specific breakpoint -6 deleted - thread 1 is gone.
    Thread-specific breakpoint -7 deleted - thread 1 is gone.
    Thread-specific breakpoint 0 deleted - thread 1 is gone.
    (gdb) FAIL: gdb.base/nextoverexit.exp: next over exit (the program exited)

We shouldn't be seeing this for internal or momentary breakpoints.  In
fact, we shouldn't even be trying to delete them, as whatever created
them will take care or it, and therefore it's dangerous to delete them
behind the creator's back.

I thought it'd still be good to tag thread-specific internal/momentary
breakpoints such that we'll no longer try to keep them insert in the
target, as they'll cause stops and thread hops in other threads, so I
tried disabling them instead.  That caused a problem when following a
child fork, and detaching from the parent, as we try to reset the
step-resume etc. breakpoints to the new child's thread
(breakpoint_re_set_thread), after the parent thread is already gone
(and the breakpoints are marked disabled).  I fixed that by
re-enabling internal/momentary breakpoints there, but, that didn't
feel super safe either (maybe we'd need a new flag in struct
breakpoint instead, to tag the thread-specific breakpoint as "not to
be inserted").  It felt like I was heading down a design rat hole,
and, other things will usually delete internal/momentary breakpoints
soon enough, so I left that little optimization for some other day.

So, internal/momentary breakpoints are no longer deleted/disabled at
all, and we end up with a one-liner fix.

Tested on x86_64 Fedora 17.

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

	* breakpoint.c (remove_threaded_breakpoints): Skip non-user
	breakpoints.
2013-09-19 14:45:33 +00:00
Thomas Schwinge 9b3f3ee63d gnu-nat.c: Don't install a deprecated_xfer_memory method.
This removes another instance of a deprecated_xfer_memory user.

gdb/
2013-09-19  Pedro Alves  <palves@redhat.com>
	    Thomas Schwinge  <thomas@codesourcery.com>
	    Yue Lu  <hacklu.newborn@gmail.com>

	* gnu-nat.c (gnu_read_inferior, gnu_write_inferior): Make static.
	Take a gdb_byte pointer instead of a char pointer.

	* gnu-nat.c (gnu_xfer_memory): Adjust interface as
	gnu_xfer_partial helper.
	(gnu_xfer_partial): New function.
	(gnu_target): Don't install a deprecated_xfer_memory hook.
	Install a to_xfer_partial hook.
2013-09-19 13:40:38 +00:00
Jan Kratochvil 69150c3d5a Mostly code cleanup: Constification.
gdb/
2013-09-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Constification.
	* main.c (captured_main): Replace catch_command_errors by
	catch_command_errors_const.  Twice.
	* symfile.c (symbol_file_add_main_1): Make args parameter const.
	(symbol_file_add): Make name parameter const.
	(symbol_file_add_main, symbol_file_add_main_1): Make args parameter const.
	(symfile_bfd_open): Make name parameter const, rename it to cname.  Add
	variable name.  Change their usage accordingly.
	* symfile.h (symbol_file_add, symfile_bfd_open): Make first parameter
	const.
	(symbol_file_add_main): Make args parameter const.
2013-09-19 12:44:46 +00:00
Ulrich Weigand 086850b237 2013-09-18 Raunaq Bathija <raunaq12@in.ibm.com>
Ulrich Weigand  <uweigand@de.ibm.com>

	* xcoffread.c (struct coff_symbol): Use CORE_ADDR as type
	of c_value member.
	(read_xcoff_symtab): Use CORE_ADDR as type of fcn_start_addr.
2013-09-18 17:47:56 +00:00
Pedro Alves d255f61f16 Also mention Yue Lu in previous commit's entry.
2013-09-18  Pedro Alves  <palves@redhat.com>
	    Yue Lu  <hacklu.newborn@gmail.com>

	* gnu-nat.c (inf_validate_procs, gnu_wait, gnu_resume)
	(gnu_create_inferior)
	(gnu_attach, gnu_thread_alive, gnu_pid_to_str, cur_thread)
	(set_sig_thread_cmd): Use the lwpid field of ptids to
	store/extract thread ids instead of the tid field.
	* i386gnu-nat.c (gnu_fetch_registers): Adjust.
2013-09-18 14:49:43 +00:00
Pedro Alves ca08a94cf0 Subject: [PATCH] [Hurd/gnu-nat.c] Use ptid_t.lwpid to store thread ids
instead of ptid_t.tid.

In preparation for reusing gnu-nat.c in gdbserver, switch to storing
thread ids in the lwpid field of ptid_t rather than in the tid
field.  The Hurd's thread model is 1:1, so it doesn't feel wrong
anyway.

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

	* gnu-nat.c (inf_validate_procs, gnu_wait, gnu_resume)
	(gnu_create_inferior)
	(gnu_attach, gnu_thread_alive, gnu_pid_to_str, cur_thread)
	(set_sig_thread_cmd): Use the lwpid field of ptids to
	store/extract thread ids instead of the tid field.
	* i386gnu-nat.c (gnu_fetch_registers): Adjust.
2013-09-18 14:47:51 +00:00
Andrew Burgess e4c6a2c42d Consistent display of "<optimized out>" for register values.
https://sourceware.org/ml/gdb-patches/2013-08/msg00170.html

gdb/ChangeLog

        * infcmd.c (default_print_one_register_info): Add detection of
        optimized out values.
        (default_print_registers_info): Switch to using
        get_frame_register_value.

gdb/testsuite/ChangeLog

        * gdb.dwarf2/dw2-reg-undefined.exp: Change pattern for info
        register to "<optimized out>", and also print the registers.
2013-09-18 14:02:31 +00:00
Pedro Alves a205fbfc18 gdbserver --wrapper also doesn't work on Cygwin.
Skip the test on Cygwin too.

2013-09-18  Pedro Alves  <palves@redhat.com>

	PR server/15967
	* gdb.server/wrapper.exp: Also return unsupported for Cygwin, and
	change text.
2013-09-18 13:21:41 +00:00
Markus Metzger 58c48e7253 When reverse-stepping, only insert a resume breakpoint at ecs->stop_func_start
if the function start is known.  Otherwise, keep single-stepping.
2013-09-18 13:02:42 +00:00
Pedro Alves c8d37639e3 [Hurd/gnu-nat] Fix old "signal-thread" command regression.
By inspection, I noticed that when I made the gnu-nat use
ptid(pid,0,tid) to represent a thread, instead of using ptid(tid,0,0),
in <https://sourceware.org/ml/gdb-patches/2008-08/msg00175.html>, I
introduced a bug.

The change was:

   else
     {
-      int tid = PIDGET (thread_id_to_pid (atoi (args)));
+      int tid = ptid_get_tid (thread_id_to_pid (atoi (args)));
       if (tid < 0)
 	error (_("Thread ID %s not known.  Use the \"info threads\" command to\n"
 	       "see the IDs of currently known threads."), args);

and thread_id_to_pid does:

 ptid_t
 thread_id_to_pid (int num)
 {
   struct thread_info *thread = find_thread_id (num);

   if (thread)
     return thread->ptid;
   else
     return pid_to_ptid (-1);
 }

(pid_to_ptid (-1) is the same as minus_one_ptid.)

So before, we were really looking at the pid, where thread_id_to_pid
stores the -1.

The right fix is to compare the whole ptid to minus_one_ptid, of
course.

Completely untested, but I think it's obvious enough, so I went ahead
and put it in.

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

	* gnu-nat.c (set_sig_thread_cmd): Compare the thread's ptid to
	minus_one_ptid instead of looking at the ptid's tid field and
	comparing that to -1.
2013-09-18 12:00:06 +00:00
Andrew Burgess 71926e2810 Fix whitespace error in previous commit.
https://sourceware.org/ml/gdb-cvs/2013-09/msg00108.html
  https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html

gdb/ChangeLog

        * main.h (get_gdb_program_name): Remove extra whitespace.
2013-09-18 11:45:20 +00:00
Andrew Burgess c88a15316e Add new function to access gdb_program_name.
https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html

gdb/ChangeLog

        * main.h (get_gdb_program_name): Add declaration.
        * main.c (get_gdb_program_name): Add definition.
2013-09-18 11:41:38 +00:00
Yao Qi ee47b2f89d gdb/gdbserver/
2013-09-18  Yao Qi  <yao@codesourcery.com>

	PR server/15959
	* server.c (start_inferior): Clear 'resume_info'.

gdb/testsuite/

2013-09-18  Yao Qi  <yao@codesourcery.com>

	* gdb.server/wrapper.c: New.
	* gdb.server/wrapper.exp: New.
2013-09-18 01:59:59 +00:00
Yao Qi 0f63d4db75 gdb/gdbserver/
Fix ChangeLog format issue.
2013-09-18 01:55:53 +00:00
Doug Evans 4390d890b5 * dwarf2read.c: Move definitions of complaint functions to after
forward declarations of local functions.
2013-09-17 22:12:55 +00:00
Pedro Alves 49fa26b041 PR gdb/11568 - delete thread-specific breakpoints on thread exit
PR gdb/11568 is about thread-specific breakpoints being left behind
when the corresponding thread exits.

Currently:

 (gdb) b start thread 2
 Breakpoint 3 at 0x400614: file thread-specific-bp.c, line 23.
 (gdb) b end
 Breakpoint 4 at 0x40061f: file thread-specific-bp.c, line 29.
 (gdb) c
 Continuing.
 [Thread 0x7ffff7fcb700 (LWP 14925) exited]
 [Switching to Thread 0x7ffff7fcc740 (LWP 14921)]

 Breakpoint 4, end () at thread-specific-bp.c:29
 29      }
 (gdb) info threads
   Id   Target Id         Frame
 * 1    Thread 0x7ffff7fcc740 (LWP 14921) "thread-specific" end () at thread-specific-bp.c:29
 (gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 2       breakpoint     keep y   0x0000000000400614 in start at thread-specific-bp.c:23
         breakpoint already hit 1 time
 3       breakpoint     keep y   0x0000000000400614 in start at thread-specific-bp.c:23 thread 2
         stop only in thread 2
 4       breakpoint     keep y   0x000000000040061f in end at thread-specific-bp.c:29
         breakpoint already hit 1 time

Note that the thread-specific breakpoint 3 stayed around, even though
thread 2 is gone.

There's no way that breakpoint can trigger again (*), so the PR argues
that the breakpoint should just be removed, like local watchpoints.
I'm ambivalent on this -- it could be reasonable to disable the
breakpoint (kind of like breakpoint in shared library code when the
DSO is unloaded), so the user could still use it as visual template
for creating other breakpoints (copy/paste command lists, etc.), or we
could have a way to change to which thread a breakpoint applies.  But,
several people pushed this direction, and I don't plan on arguing...

(*) - actually, there is ...  thread numbers are reset on "run", so
the user could do "break foo thread 2", "run", and expect the
breakpoint to hit again on the second thread.  But given gdb's thread
numbering can't really be stable, that'd only work sufficiently well
for thread 1, so we'd better call it unsupported.

So with the patch, whenever a thread is deleted from GDB's list, GDB
goes through the thread-specific breakpoints and deletes corresponding
breakpoints.  Since this is user-visible, GDB prints out:

  Thread-specific breakpoint 3 deleted - thread 2 is gone.

And of course, we end up with:

 (gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 2       breakpoint     keep y   0x0000000000400614 in start at thread-specific-bp.c:23
         breakpoint already hit 1 time
 4       breakpoint     keep y   0x000000000040061f in end at thread-specific-bp.c:29
         breakpoint already hit 1 time

2013-09-17  Muhammad Waqas <mwaqas@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	PR gdb/11568
	* breakpoint.c (remove_threaded_breakpoints): New function.
	(_initialize_breakpoint): Attach remove_threaded_breakpoints
	as thread_exit observer.

2013-09-17  Muhammad Waqas  <mwaqas@codesourccery.com>
	    Jan Kratochvil  <jan.kartochvil@redhat.com>
	    Pedro Alves  <palves@redhat.com>

	PR gdb/11568
	* gdb.thread/thread-specific-bp.c: New file.
	* gdb.thread/thread-specific-bp.exp: New file.
2013-09-17 19:32:47 +00:00
Sergio Durigan Junior e83b28bc76 This commit fixes a regression introduced by the new $_isvoid convenience
function.  It adds a check for $_isvoid during the test of "show convenience"
output.

gdb/testsuite/
2013-09-17  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.base/defaults.exp (<show_conv_list>): Add check for $_isvoid
	convenience function.
2013-09-17 19:24:51 +00:00
Pedro Alves 08d72866c0 PR gdb/15911: "info threads" changes the default source and line (for "break", "list")
"info threads" changes the default source for "break" and "list", to
whatever the location of the first/bottom thread in the thread list
is...

 (gdb) b start
 (gdb) c
 ...
 (gdb) list
 *lists "start"*
 (gdb) b 23
 Breakpoint 3 at 0x400614: file test.c, line 23.
 (gdb) info threads
   Id   Target Id         Frame
 * 2    Thread 0x7ffff7fcb700 (LWP 1760) "test" start (arg=0x0) at test.c:23
   1    Thread 0x7ffff7fcc740 (LWP 1748) "test" 0x000000323dc08e60 in pthread_join (threadid=140737353922304, thread_return=0x0) at pthread_join.c:93
 (gdb) b 23
 Breakpoint 4 at 0x323dc08d90: file pthread_join.c, line 23.
                                    ^^^^^^^^^^^^^^^
 (gdb) list
 93          lll_wait_tid (pd->tid);
 94
 95
 96        /* Restore cancellation mode.  */
 97        CANCEL_RESET (oldtype);
 98
 99        /* Remove the handler.  */
 100       pthread_cleanup_pop (0);
 101
 102

The issue is that print_stack_frame always sets the current sal to the
frame's sal.  print_frame_info (which print_stack_frame calls to do
most of the work) also sets the last displayed sal, but only if
print_what isn't LOCATION.  Now the call in question, from within
thread.c:print_thread_info, does pass in LOCATION as print_what, but
print_stack_frame doesn't have the same check print_frame_info has.
We could consider adding it, but setting these globals depending on
print_what isn't very clean, IMO.  What we have is two logically
distinct operations mixed in the same function(s):

  #1 - print frame, in the format specified by {print_what,
    print_level and print_args}.

  #2 - We're displaying a frame to the user, and I want the default
    sal to point here, because the program stopped here, or the user
    did some context-changing command (up, down, etc.).

So I added a new parameter to print_stack_frame & friends for point
#2, and went through all calls in the tree adjusting as necessary.

Tested on x86_64 Fedora 17.

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

	PR gdb/15911
	* ada-tasks.c (task_command_1): Adjust call to print_stack_frame.
	* bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd):
	* corelow.c (core_open):
	* frame.h (print_stack_frame, print_frame_info): New
	'set_current_sal' parameter.
	* infcmd.c (finish_command, kill_command): Adjust call to
	print_stack_frame.
	* inferior.c (inferior_command): Likewise.
	* infrun.c (normal_stop): Likewise.
	* linux-fork.c (linux_fork_context): Likewise.
	* record-full.c (record_full_goto_entry, record_full_restore):
	Likewise.
	* remote-mips.c (common_open): Likewise.
	* stack.c (print_stack_frame): New 'set_current_sal' parameter.
	Use it.
	(print_frame_info): New 'set_current_sal' parameter.  Set the last
	displayed sal depending on the new paremeter instead of looking at
	print_what.
	(backtrace_command_1, select_and_print_frame, frame_command)
	(current_frame_command, up_command, down_command): Adjust call to
	print_stack_frame.
	* thread.c (print_thread_info, restore_selected_frame)
	(do_captured_thread_select): Adjust call to print_stack_frame.
	* tracepoint.c (tfind_1): Likewise.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
	(mi_cmd_stack_info_frame): Likewise.
	* mi/mi-interp.c (mi_on_normal_stop): Likewise.
	* mi/mi-main.c (mi_cmd_exec_return, mi_cmd_trace_find): Likewise.

	gdb/testsuite/
	* gdb.threads/info-threads-cur-sal-2.c: New file.
	* gdb.threads/info-threads-cur-sal.c: New file.
	* gdb.threads/info-threads-cur-sal.exp: New file.
2013-09-17 18:26:41 +00:00
Luis Machado a7ea61cf67 Fix ChangeLog entry missing a ':' char. 2013-09-17 15:06:01 +00:00
Jiong Wang d6707650bf gdbserver/ChangeLog
* linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
	for each register.
2013-09-17 14:00:30 +00:00
Jiong Wang 9243dd0e80 2013-09-16 Jiong Wang <jiwang@tilera.com>
gdbserver/ChangeLog

        * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
	linux-tile-low.o to srv_tgtobj.
2013-09-17 13:56:54 +00:00
Yao Qi 57b0d98e59 gdb/testsuite/
* gdb.base/catch-load.c: Remove the include of "dlfcn.h".
	 [__WIN32__]: Include "windows.h" and define macro dlopen
	 and dlclose.
	[!__WIN32__]: Include "dlfcn.h".
	* gdb.base/catch-load.exp (one_catch_load_test): Match
	directory separator.
2013-09-17 07:00:50 +00:00
Doug Evans a587b477f2 * lib/gdb.exp (using_fission): New proc.
* gdb.base/info-macros.exp: Skip test if using Fission.
2013-09-16 23:59:02 +00:00
Doug Evans 0295a32e39 * gdb.base/break-interp.exp: Fix indentation. 2013-09-16 23:42:58 +00:00
Sergio Durigan Junior 6bc305f56c The error message in the function was saying
"You should provide one parameter..." while it should be saying "... one
argument...".  Replaced.

2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* value.c (isvoid_internal_fn): Replace "parameter" with
	"argument".
2013-09-16 21:07:14 +00:00
Stan Shebs 0a7cfe2cf5 * README: Update references to writing code for GDB.
* configure.ac (build_warnings): Remove obsolete comment.
	* configure: Regenerate.
	* gdbarch.sh: Remove references to gdbint.texinfo.
	* gdbarch.h: Regenerate.
	* gdbtypes.c (objfile_type): Remove comments referencing internals
	manual and D10V.

	[gdb/doc]
	Remove the internals manual gdbint.texinfo.
	* Makefile.in (INFO_DEPS): Remove gdbint.info.
	(PDFFILES): Remove gdbint.pdf.
	(HTMLFILES): Remove gdbint/index.html.
	(HTMLFILES_INSTALL): Remove gdbint.
	(GDBINT_DOC_FILES): Remove.
	(dvi): Remove gdbint.dvi.
	(ps): Remove gdbint.ps.
	* gdbint.texinfo: Remove file.
	* gdb.texinfo (Maintenance Commands): Remove reference to gdbint.
2013-09-16 18:00:34 +00:00
Sergio Durigan Junior a280dbd160 Based on the discussion at:
<https://sourceware.org/ml/gdb-patches/2013-09/msg00301.html>
<https://sourceware.org/ml/gdb-patches/2013-09/msg00383.html>

This patch adds a new convenience function called $_isvoid, whose
only purpose is to check whether an expression is void or not.
This became necessary because the new convenience variable
$_exitsignal (not yet approved) has a mutual exclusive behavior
with $_exitcode, i.e., when one is "defined" (i.e., non-void),
the other is cleared (i.e., becomes void).  Doug wanted a way to
identify which variable to use, and checking for voidness is the
obvious solution.

It is worth mentioning that my first attempt, after a conversation with
Doug, was to actually implement a new $_isdefined() convenience
function.  I would do that (for convenience variables) by calling
lookup_only_internalvar.  However, I found a few problems:

- Whenever I called $_isdefined ($variable), $variable became defined
  (with a void value), and $_isdefined always returned true.

- Then, I tried to implement $_isdefined ("variable"), and do the "$" +
  "variable" inside GDB, thus making it impossible for GDB to create the
  convenience variable.  However, it was hard to extract the string
  without having to mess with values and their idiossincrasies.
  Therefore, I decided to abandon this attempt (specially because I
  didn't want to spend too much time struggling with it).

Anyway, after talking to Doug again we decided that it would be easier
to implement $_isvoid, and this will probably help in cases like
<http://stackoverflow.com/questions/3744554/testing-if-a-gdb-convenience-variable-is-defined>.

I wrote a NEWS entry for it, and some new lines on the documentation.

gdb/
2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* NEWS: Mention new convenience function $_isvoid.
	* value.c (isvoid_internal_fn): New function.
	(_initialize_values): Add new convenience function $_isvoid.

gdb/doc/
2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.texinfo (Convenience Functions): Mention new convenience
	function $_isvoid.

gdb/testsuite/
2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.base/gdbvars.c (foo_void): New function.
	(foo_int): Likewise.
	* gdb.base/gdbvars.exp (test_convenience_functions): New
	function.  Call it.
2013-09-16 17:47:30 +00:00
Will Newton c623a6ef72 gdbserver, aarch64: Zero out regs in aarch64_linux_set_debug_regs.
Apply the same fix that was applied to aarch64-linux-nat.c.

2013-09-16  Will Newton  <will.newton@linaro.org>

	* linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
	out regs.
2013-09-16 14:22:19 +00:00
Pierre Muller 04a83fee11 * arm-linux-tdep.c: Add "elf/common.h" header.
Remove AT_HWCAP macro definintion as it is provided in
	added include file.
	* s390-tdep.c: Remove system header <elf.h>
	Add "elf/common.h" header for AT_HWCAP definition.
	(s390_core_read_description): Use correct CORE_ADDR
	for hwcap local variable used as third parameter
	of function target_auxv_search.
2013-09-16 11:28:53 +00:00
Pierre Muller 88505fac1c * common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e"
mode if operating system doesn't know O_CLOEXEC.
2013-09-14 06:26:35 +00:00
Jan Kratochvil d3846e71a9 Code cleanup: Move variable.
gdb/
2013-09-13  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Code cleanup.
	* symfile.c (reread_symbols): Move variable obfd_filename to a more
	inner block.
2013-09-13 14:21:03 +00:00
Ulrich Weigand 4ac33720d6 gdb/ChangeLog:
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* NEWS: Mention TDB support.
	* features/s390-tdb.xml: New file.
	* features/s390-te-linux64.xml: New file.
	* features/s390x-te-linux64.xml: New file.
	* features/Makefile (WHICH): Add new tdescs above.
	(s390-te-linux64-expedite): Set.
	(s390x-te-linux64-expedite): Set.
	* features/s390-te-linux64.c: New file (generated).
	* features/s390x-te-linux64.c: New file (generated).
	* regformats/s390-te-linux64.dat: New file (generated).
	* regformats/s390x-te-linux64.dat: New file (generated).
	* s390-tdep.h (HWCAP_S390_HIGH_GPRS): Define.
	(HWCAP_S390_TE): Likewise.
	(S390_TDB_DWORD0_REGNUM): Likewise.
	(S390_TDB_DWORD0_REGNUM): Likewise.
	(S390_TDB_ABORT_CODE_REGNUM): Likewise.
	(S390_TDB_CONFLICT_TOKEN_REGNUM): Likewise.
	(S390_TDB_ATIA_REGNUM): Likewise.
	(S390_TDB_R0_REGNUM): Likewise.
	(S390_TDB_R1_REGNUM): Likewise.
	(S390_TDB_R2_REGNUM): Likewise.
	(S390_TDB_R3_REGNUM): Likewise.
	(S390_TDB_R4_REGNUM): Likewise.
	(S390_TDB_R5_REGNUM): Likewise.
	(S390_TDB_R6_REGNUM): Likewise.
	(S390_TDB_R7_REGNUM): Likewise.
	(S390_TDB_R8_REGNUM): Likewise.
	(S390_TDB_R9_REGNUM): Likewise.
	(S390_TDB_R10_REGNUM): Likewise.
	(S390_TDB_R11_REGNUM): Likewise.
	(S390_TDB_R12_REGNUM): Likewise.
	(S390_TDB_R13_REGNUM): Likewise.
	(S390_TDB_R14_REGNUM): Likewise.
	(S390_TDB_R15_REGNUM): Likewise.
	(S390_NUM_REGS): Increase.
	(S390_IS_TDBREGSET_REGNUM): New macro.
	(s390_regmap_tdb): Declare.
	(s390_sizeof_tdbregset): Define.
	(tdesc_s390_te_linux64): Declare.
	(tdesc_s390x_te_linux64): Likewise.
	* s390-tdep.c: Add includes for "auxv.h", <elf.h>,
	"features/s390-te-linux64.c", and "features/s390x-te-linux64.c".
	(s390_regmap_tdb): New regmap.
	(s390_supply_tdb_regset): New function.
	(s390_tdb_regset): New regset.
	(s390_linux64v2_regset_sections): Add TDB regset to list.
	(s390x_linux64v2_regset_sections): Likewise.
	(s390_regset_from_core_section): Recognize TDB core note section.
	(s390_core_read_description): If HWCAP indicates TE support,
	select tdesc_s390_te_linux64 or tdesc_s390_s390x_te_linux64.
	(s390_gdbarch_init): Handle TDB regset.
	(_initialize_s390_tdep): Initialize new tdescs.
	* s390-nat.c (HWCAP_S390_HIGH_GPRS): Remove define.
	(have_regset_tdb): New variable.
	(s390_native_supply): Support register invalidation.
	(fetch_regset): Invalidate registers if ptrace yields ENODATA.
	(check_regset): Treat ENODATA as "regset exists".
	(s390_linux_fetch_inferior_registers): Add TDB.
	(s390_read_description): Check for TDB existence and select
	appropriate tdesc.
	* gdbserver/Makefile.in (clean): Add removal of new makefile
	targets.
	(s390-te-linux64.c): New makefile target.
	(s390x-te-linux64.c): Likewise.
	* gdbserver/configure.srv (srv_regobj): Append new objects
	s390-te-linux64.o and s390x-te-linux64.o.
	(srv_xmlfiles): Append new files s390-te-linux64.xml,
	s390x-te-linux64.xml, and s390-tdb.xml.
	* gdbserver/linux-s390-low.c (init_registers_s390_te_linux64): New
	declaration.
	(tdesc_s390_te_linux64): Likewise.
	(init_registers_s390x_te_linux64): Likewise.
	(tdesc_s390x_te_linux64): Likewise.
	(s390_check_regset): Treat ENODATA as "regset exists".
	(s390_arch_setup): Add TDB regset support.
	(initialize_low_arch): Initialize registers for new tdescs.

gdb/doc/ChangeLog:
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* gdb.texinfo (Decimal Floating Point format): Mention S/390.
	(Standard Target Features): Add new node to menu.
	(S/390 and System z Features): New node.

gdb/testsuite/ChangeLog:
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* gdb.arch/s390-tdbregs.c: New file.
	* gdb.arch/s390-tdbregs.exp: New file.
2013-09-13 14:17:31 +00:00
Ulrich Weigand 2ccd146855 2013-09-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
* s390-tdep.h (S390_IS_GREGSET_REGNUM): New macro.
	(S390_IS_FPREGSET_REGNUM): New macro.
	* s390-tdep.c (s390_dwarf_regmap): Make const.
	(regnum_is_gpr_full): New function for replacing repeated code.
	(s390_pseudo_register_name): Use it.
	(s390_pseudo_register_type): Likewise.
	(s390_pseudo_register_read): Likewise.
	(s390_pseudo_register_write): Likewise.
	(s390_unwind_pseudo_register): Likewise.
	(s390_regmap_gregset): New format for regmap.
	(s390x_regmap_gregset): Likewise.
	(s390_regmap_fpregset): Likewise.
	(s390_regmap_upper): Likewise.
	(s390_regmap_last_break): Likewise.
	(s390_regmap_system_call): Likewise.
	(s390_supply_regset): Adjust to new regmap format.
	(s390_collect_regset): Likewise.
	* s390-nat.c (s390_native_supply): Adjust to new regmap format.
	(s390_native_collect): Likewise.
	(supply_gregset): Likewise.
	(fill_gregset): Likewise.
	(supply_fpregset): Likewise.
	(fill_fpregset): Likewise.
	(fetch_regset): Likewise.
	(store_regset): Likewise.
	(s390_linux_fetch_inferior_registers): Likewise.
	(s390_linux_fetch_inferior_registers): Likewise.
2013-09-13 14:11:15 +00:00
Sanimir Agovic b3d3b4bda1 doc,mi: example refers to -list-features instead of -list-target-features
Corrected mi documentation about -list-target-features, example now uses the
correct mi command.

2013-09-13  Sanimir Agovic  <sanimir.agovic@intel.com>

	* gdb.texinfo (GDB/MI Miscellaneous Commands): Use
	-list-target-features in the example.
2013-09-13 08:04:02 +00:00
Stan Shebs b866c52d3b * README: New file. 2013-09-12 22:51:16 +00:00
Doug Evans dc59cba6fc * gdb.python/py-events.py (new_objfile_handler): Remove accidentally
added code to print event.inferior.
2013-09-12 22:39:26 +00:00
Andrew Pinski 1aa4cd774c 2013-09-12 Andrew Pinski <apinski@cavium.com>
* aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Zero out regs.
2013-09-12 07:14:37 +00:00
Jan Kratochvil edf9f00c51 minidebuginfo: Fix stripping/debuginfo
gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (MiniDebugInfo): Prepare file debug and use it to create
	mini_debuginfo.  Strip binary before adding mini_debuginfo to it.

gdb/testsuite/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/gnu-debugdata.exp (objcopy 1): Move it lower and use only
	debug part of the binary.
2013-09-11 08:31:44 +00:00
Jan Kratochvil 1d236d2308 minidebuginfo: ppc64 sync testcase->doc
gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Sync documentation with gdb.base/gnu-debugdata.exp.
	* gdb.texinfo (MiniDebugInfo): Add comment and "D" in the example.
2013-09-11 08:29:46 +00:00
Jan Kratochvil 5423b017be minidebuginfo: Obvious changes
gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (MiniDebugInfo): Fix two trailing dots.

gdb/testsuite/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/gnu-debugdata.exp (strip): Add -R .comment.
	(addlink): Add comment.
2013-09-11 08:28:04 +00:00
Ulrich Weigand d91fab15e7 2013-09-10 Andreas Arnez <arnez@linux.vnet.ibm.com>
* config/s390/s390.mh (NATDEPFILES): Add linux-waitpid.o.
2013-09-10 15:05:23 +00:00
Sanimir Agovic 9295cf6f8e test: adjust 'cd' regexpr to match an optional canonically pathname
New regexpr now correctly deals with trailing canonical pathname.

Before only the following output was matched:
(gdb) cd
Working directory /users/foo

In addition it now matches an optional trailing canonical pathname:
(gdb) cd
Working directory /users/foo
 (canonically /nfs/users/foo).

Triggered by `realpath .` != `pwd`

2013-09-10  Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/
	* gdb.base/default.exp: Adjust regexpr for 'cd' to match optional
	canonical pathname.
2013-09-10 07:32:25 +00:00
Andrew Burgess 5a5d8ead94 Remove use of deprecated_init_ui_hook from quit_confirm.
https://sourceware.org/ml/gdb-patches/2013-09/msg00224.html

gdb/ChangeLog

        * top.c (quit_confirm): Remove use of deprecated_init_ui_hook.
2013-09-09 12:13:58 +00:00
Pedro Alves 1385f66cf4 remote-sim.c: Send debug output to gdb_stdlog.
Tested by building for --target=arm-eabi, and playing with the debug
output a bit.

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

	* remote-sim.c (dump_mem, gdbsim_fetch_register)
	(gdbsim_store_register, gdbsim_kill, gdbsim_load)
	(gdbsim_create_inferior, gdbsim_open, gdbsim_close)
	(gdbsim_detach, gdbsim_resume_inferior, gdbsim_wait)
	(gdbsim_files_info, gdbsim_mourn_inferior): Send debug output to
	gdb_stdlog.
2013-09-06 18:29:42 +00:00
Pedro Alves 146ec4dbcf remote-sim.c: Don't install a deprecated_xfer_memory method.
Manually tested with a --target=arm-eabi build, and doing things like:

$ arm-eabi-gcc ~/gdb/tests/main.c -o a.out -c -g
$ ./gdb a.out
...
(gdb) tar sim
(gdb) load
(gdb) disassemble 0
Dump of assembler code for function main:
   0x00000000 <+0>:     mov     r12, sp
   0x00000004 <+4>:     push    {r11, r12, lr, pc}
   0x00000008 <+8>:     sub     r11, r12, #4
   0x0000000c <+12>:    sub     sp, sp, #8
   0x00000010 <+16>:    str     r0, [r11, #-16]
   0x00000014 <+20>:    str     r1, [r11, #-20]
   0x00000018 <+24>:    mov     r3, #0
   0x0000001c <+28>:    mov     r0, r3
   0x00000020 <+32>:    sub     sp, r11, #12
   0x00000024 <+36>:    ldm     sp, {r11, sp, pc}
End of assembler dump.
(gdb) p *0 = 1
        0x00000001

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

	* remote-sim.c (dump_mem): Constify buf parameter.
	gdbsim_xfer_inferior_memory): Rename to ...
	(gdbsim_xfer_memory): ... this.  Adjust interface as
	target_xfer_partial helper.
	(gdbsim_xfer_partial): New function.
	(init_gdbsim_ops): Don't install a deprecated_xfer_memory hook.
	Install a to_xfer_partial hook.  Send output to gdb_stdlog.
2013-09-06 18:10:39 +00:00
Pedro Alves fcde0081d9 remote-sim.c: cleanup debug output code.
Manually tested with a --target=arm-eabi build, and doing

$ arm-eabi-gcc ~/gdb/tests/main.c -o a.out -c -g
$ ./gdb a.out
...
(gdb) tar sim
(gdb) load
(gdb) set debug remote 1
(gdb) disassemble 0
Dump of assembler code for function main:
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x0, len 4, write 0
   0x00000000 <+0>:             0xe1a0c00d
mov     r12, sp
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x4, len 4, write 0
   0x00000004 <+4>:             0xe92dd800
push    {r11, r12, lr, pc}
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x8, len 4, write 0
   0x00000008 <+8>:             0xe24cb004
sub     r11, r12, #4
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0xc, len 4, write 0
   0x0000000c <+12>:            0xe24dd008
sub     sp, sp, #8
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x10, len 4, write 0
   0x00000010 <+16>:            0xe50b0010
str     r0, [r11, #-16]
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x14, len 4, write 0
   0x00000014 <+20>:            0xe50b1014
str     r1, [r11, #-20]
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x18, len 4, write 0
   0x00000018 <+24>:            0xe3a03000
mov     r3, #0
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x1c, len 4, write 0
   0x0000001c <+28>:            0xe1a00003
mov     r0, r3
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x20, len 4, write 0
   0x00000020 <+32>:            0xe24bd00c
sub     sp, r11, #12
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x24, len 4, write 0
   0x00000024 <+36>:            0xe89da800
ldm     sp, {r11, sp, pc}
End of assembler dump.
(gdb) p *0 = 1
gdbsim_xfer_inferior_memory: myaddr 0xc69bc0, memaddr 0x0, len 4, write 1
        0x00000001
$1 = 1

Which happens to differ from before, I think due to stdout line buffering:

(gdb) disassemble 0
Dump of assembler code for function main:
   0x00000000 <+0>:     gdbsim_xfer_inferior_memory: myaddr 0x0x7fffffffd400, memaddr 0x0, len 4, write 0
        0xe1a0c00d

But the new output looks reasonable to me, better even.

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

	* remote-sim.c (gdbsim_xfer_inferior_memory): Use
	host_address_to_string, and send debug output to gdb_stdlog.
2013-09-06 17:41:50 +00:00
Pedro Alves fb71d39e8c [gdbserver] Garbage collect unused dependency-tracking Makefile variables.
These used to be necessary for manual rule dependency tracking.
Nothing uses them anymore.  (regdat_sh is still needed.)

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

	* Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
	(signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
	(linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
	(server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
	(gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
	(mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
2013-09-06 12:04:56 +00:00
Pedro Alves 8e7e991006 [gdbserver] Update a couple Makefile rules.
These two are still written in the pre-auto-dependency-tracking style.
They probably were written before that, and committed afterwards
without adjustment.  An easy oversight to make.

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

	* Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
	explicit header dependencies and use $COMPILE/$POSTCOMPILE.
2013-09-06 11:54:07 +00:00
Pedro Alves 7c3a12caf5 [gdbserver] Fix IPA build.
Somehow, my builds yesterdays didn't trip on this...

../src/gdb/gdbserver/linux-amd64-ipa.c: In function ‘initialize_low_tracepoint’:
../src/gdb/gdbserver/linux-amd64-ipa.c:172:3: error: ‘ipa_tdesc’ undeclared (first use in this function)
../src/gdb/gdbserver/linux-amd64-ipa.c:172:3: note: each undeclared identifier is reported only once for each function it appears in

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

	* linux-amd64-ipa.c: Include tracepoint.h.
	* linux-i386-ipa.c: Include tracepoint.h.
2013-09-06 10:58:11 +00:00
Ricard Wanderlof 749c8b38fa Extract Linux-specific portitions of cris-tdep.c to a new file.
This brings in some standard functionality hitherdo missing from
the CRIS/CRISv32 port thanks to the new call to gdbarch_init_osabi,
as well as clearly showing that there is Linux support for this
platform by virtue of the existence of a cris-linux-tdep.c file.

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

	* Makefile.in (ALL_TARGET_OBS): Add cris-linux-tdep.o.
	* configure.tgt: Add cris-linux-tdep.o and linux-tdep.o to
	gdb_target_obs for cris target.
	* cris-tdep.c (struct gdbarch_tdep): Move to cris-tdep.h.
	(cris_gdbarch_init): Move calls to
	set_gdbarch_fetch_tls_load_module_address and
	set_solib_svr4_fetch_link_map_offsets to cris-linux-tdep.c.
	Add call to gdbarch_init_osabi.
	* cris-linux-tdep.c: New file.
	* cris-tdep.h: New file.
2013-09-06 10:50:10 +00:00
Andrew Burgess 43df09d937 OBVIOUS: Remove legacy comment referring to deprecated_init_ui_hook.
gdb/ChangeLog

	* tui/tui-io.c (tui_initialize_io): Remove legacy comment referring
	to deprecated_init_ui_hook.
2013-09-06 10:12:20 +00:00
Andrew Burgess 4d09c5b423 Give every interpreter a command_loop_proc.
https://sourceware.org/ml/gdb-patches/2013-09/msg00179.html

gdb/ChangeLog

        * cli/cli-interp.c (_initialize_cli_interp): Add a
        command_loop_proc to interp_procs.
        * event-top.c (cli_command_loop): Change signature to match
        interp_command_loop_ftype.
        * event-top.h (cli_command_loop): Same.
        * interps.c (interp_new): Require every interpreter to have a
        command_loop_proc.
        (current_interp_command_loop): Just call the command_loop_proc on
        the current interpreter.
        * tui/tui-interp.c (_initialize_tui_interp): Add a
        command_loop_proc to interp_procs.
2013-09-06 08:53:09 +00:00
Ricard Wanderlof 8eb3d7b6ca Add support for threaded debugging for CRISv32.
2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

	* cris-tdep.c (cris_gdbarch_init): Add call to
	get_gdbarch_fetch_tls_load_module_address.

gdbserver

	* linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
	(ps_get_thread_area): New function.
2013-09-06 08:37:17 +00:00
Andrew Burgess 1581d8a7b4 Fix filename format in previous ChangeLog entry.
I used the wrong format for the filenames in a previous changelog entry, I
incorrectly included the "gdb/" prefix.
2013-09-06 08:25:25 +00:00
Ricard Wanderlof 18b3c2f515 Cosmetic clean up of names of *elf_greg_t types for CRIS/CRISv32.
2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

	* cris-tdep.c (cris_elf_greg_t): Rename from elf_greg_t.
	(cris_elf_gregset_t): Rename from elf_gregset_t.
	(crisv32_elf_gregset_t): Adjust.
	(cris_supply_gregset, fetch_core_registers): Adjust.
2013-09-06 08:23:46 +00:00
Ricard Wanderlof dc8636efde Trivial patch to remove dependency on host unsigned long type
from cris-tdep.c.

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

	* cris-tdep.c (elf_greg_t): Change typedef to unsigned char[4]
2013-09-06 08:14:33 +00:00
Ricard Wanderlof eddddb9d52 Fix compilation for target gdbserver on CRISv32 platform.
One misspelled function call, and one superfluous typedef. The latter
causes an error of the following type when building:

linux-crisv32-low.c:372: error: conflicting types for 'elf_gregset_t'
/.../target/include/asm/elf.h:36:
error: previous declaration of 'elf_gregset_t' was here

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

	* linux-crisv32-low.c (elf_gregset_t): Delete typedef.
	(initialize_low_arch): Call init_registers_crisv32 rather than
	init_register_crisv32.
2013-09-06 08:04:19 +00:00
Pedro Alves 270c6aeaf2 Add missing new files from these previous commits:
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (handle_vFile, hostio_last_error_from_errno): Move
	to ...
	* hostio.h: ... this new file.
	* hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
	win32-low.c: Include hostio.h.

2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (gdb_client_data, handler_func, callback_handler_func)
	(delete_file_handler, add_file_handler, append_callback_event)
	(delete_callback_event, start_event_loop, initialize_event_loop):
	Move to event-loop.h and include it.
	* event-loop.h: New file.

2013-09-05  Pedro Alves  <palves@redhat.com>

	* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
	* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
	(loaded_dll, unloaded_dll): Move to ...
	* dll.h: ... this new file.
	* inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".

2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (current_process, get_thread_process, all_processes)
	(add_inferior_to_list, for_each_inferior, current_inferior)
	(remove_inferior, add_process, remove_process, find_process_pid)
	(have_started_inferiors_p, have_attached_inferiors_p)
	(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
	(clear_inferiors, find_inferior, find_inferior_id)
	(inferior_target_data, set_inferior_target_data)
	(inferior_regcache_data, set_inferior_regcache_data): Move to
	inferiors.h, and include it.
	* inferiors.h: New file.

2013-09-05  Pedro Alves  <palves@redhat.com>

	* ax.c, linux-low.c, linux-x86-low.c, server.c: Include
	tracepoint.h.
	* server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
	(disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
	(handle_tracepoint_general_set, handle_tracepoint_query)
	(tracepoint_finished_step, tracepoint_was_hit)
	(release_while_stepping_state_list, current_traceframe)
	(in_readonly_region, traceframe_read_mem)
	(fetch_traceframe_registers, traceframe_read_sdata)
	(traceframe_read_info, struct fast_tpoint_collect_status)
	(fast_tracepoint_collecting, force_unlock_trace_buffer)
	(handle_tracepoit_bkpts, initialize_low_tracepoint)
	(supply_fast_tracepoint_registers)
	(supply_static_tracepoint_registers, set_trampoline_buffer_space)
	(ipa_tdesc, claim_trampoline_space)
	(have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
	(agent_mem_read, agent_get_trace_state_variable_value)
	(agent_set_trace_state_variable_value, agent_tsv_read)
	(agent_mem_read_string, get_raw_reg_func_addr)
	(get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
	* tracepoint.h: ... this new file.

2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (perror_with_name, error, fatal, warning, paddress)
	(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
	include it.
	* utils.h: New file.

2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (remote_debug, noack_mode, transport_is_reliable)
	(gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
	(read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
	(getpkt, remote_prepare, remote_open, remote_close, write_ok)
	(write_enn, initialize_async_io, enable_async_io)
	(disable_async_io, check_remote_input_interrupt_request)
	(convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
	(dead_thread_notify, prepare_resume_reply)
	(decode_address_to_semicolon, decode_address, decode_m_packet)
	(decode_M_packet, decode_X_packet, decode_xfer_write)
	(decode_search_memory_packet, unhexify, hexify)
	(remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
	(look_up_one_symbol, relocate_instruction)
	(monitor_output): Move to remote-utils.h, and include it.
	* remote-utils.h: New file.
2013-09-05 22:18:48 +00:00
Pedro Alves 533b06003e [gdbserver] Split a new hostio.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (handle_vFile, hostio_last_error_from_errno): Move
	to ...
	* hostio.h: ... this new file.
	* hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
	win32-low.c: Include hostio.h.
2013-09-05 20:45:39 +00:00
Pedro Alves 0ce3d3b5aa [gdbserver] Split a new event-loop.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (gdb_client_data, handler_func, callback_handler_func)
	(delete_file_handler, add_file_handler, append_callback_event)
	(delete_callback_event, start_event_loop, initialize_event_loop):
	Move to event-loop.h and include it.
	* event-loop.h: New file.
2013-09-05 20:42:52 +00:00
Pedro Alves 799cdc3728 [gdbserver] Split a new dll.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
	* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
	(loaded_dll, unloaded_dll): Move to ...
	* dll.h: ... this new file.
	* inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
2013-09-05 20:41:55 +00:00
Pedro Alves 6a6bbd9d76 [gdbserver] Split a new inferiors.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (current_process, get_thread_process, all_processes)
	(add_inferior_to_list, for_each_inferior, current_inferior)
	(remove_inferior, add_process, remove_process, find_process_pid)
	(have_started_inferiors_p, have_attached_inferiors_p)
	(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
	(clear_inferiors, find_inferior, find_inferior_id)
	(inferior_target_data, set_inferior_target_data)
	(inferior_regcache_data, set_inferior_regcache_data): Move to
	inferiors.h, and include it.
	* inferiors.h: New file.
2013-09-05 20:41:22 +00:00
Pedro Alves f699aaba87 [gdbserver] Move bytecode compilation bits from server.h to ax.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (struct emit_ops, current_insn_ptr, emit_error):
	Move ...
        * ax.h: ... here.
2013-09-05 20:40:58 +00:00
Pedro Alves c144c7a0b7 [gdbserver] Split a new tracepoint.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* ax.c, linux-low.c, linux-x86-low.c, server.c: Include
	tracepoint.h.
	* server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
	(disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
	(handle_tracepoint_general_set, handle_tracepoint_query)
	(tracepoint_finished_step, tracepoint_was_hit)
	(release_while_stepping_state_list, current_traceframe)
	(in_readonly_region, traceframe_read_mem)
	(fetch_traceframe_registers, traceframe_read_sdata)
	(traceframe_read_info, struct fast_tpoint_collect_status)
	(fast_tracepoint_collecting, force_unlock_trace_buffer)
	(handle_tracepoit_bkpts, initialize_low_tracepoint)
	(supply_fast_tracepoint_registers)
	(supply_static_tracepoint_registers, set_trampoline_buffer_space)
	(ipa_tdesc, claim_trampoline_space)
	(have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
	(agent_mem_read, agent_get_trace_state_variable_value)
	(agent_set_trace_state_variable_value, agent_tsv_read)
	(agent_mem_read_string, get_raw_reg_func_addr)
	(get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
	* tracepoint.h: ... this new file.
2013-09-05 20:40:33 +00:00
Pedro Alves ff42e6abac [gdbserver] Split a new utils.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (perror_with_name, error, fatal, warning, paddress)
	(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
	include it.
	* utils.h: New file.
2013-09-05 20:39:48 +00:00
Pedro Alves 541af0f44b [gdbserver] Split a new remote-utils.h file out of server.h.
gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

	* server.h (remote_debug, noack_mode, transport_is_reliable)
	(gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
	(read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
	(getpkt, remote_prepare, remote_open, remote_close, write_ok)
	(write_enn, initialize_async_io, enable_async_io)
	(disable_async_io, check_remote_input_interrupt_request)
	(convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
	(dead_thread_notify, prepare_resume_reply)
	(decode_address_to_semicolon, decode_address, decode_m_packet)
	(decode_M_packet, decode_X_packet, decode_xfer_write)
	(decode_search_memory_packet, unhexify, hexify)
	(remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
	(look_up_one_symbol, relocate_instruction)
	(monitor_output): Move to remote-utils.h, and include it.
	* remote-utils.h: New file.
2013-09-05 20:39:17 +00:00
Pedro Alves eebdf26b45 [gdbserver] Delete _ macro (gettext).
server.h nowadays includes gdb_locale.h, which already brings this in.

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

	* server.h (_): Delete.
2013-09-05 20:38:45 +00:00
Andrew Burgess 257e6d53e2 Remove deprecated_command_loop_hook.
https://sourceware.org/ml/gdb-patches/2013-09/msg00174.html

gdb/ChangeLog

        * gdb/defs.h (deprecated_command_loop_hook): Remove, including
        references in comments.
        * gdb/interps.c (current_interp_command_loop): No longer use
        deprecated_command_loop_hook.
        (clear_interpreter_hooks): Remove deprecated_command_loop_hook
        setup.
        * gdb/top.c (deprecated_command_loop_hook): Remove.
2013-09-05 16:46:56 +00:00
Pedro Alves 7c33b57c15 dwarf2loc.c: minor cleanup. don't print integer with paddress.
A couple years ago, dwarf_expr_fetch used to return a CORE_ADDR.  It
was made to return a ULONGEST since, and the 'dwarf_regnum' local
adjusted accordingly, but, we kept printing it with paddress.
gdbarch_dwarf2_reg_to_regnum takes the register number as 'int', so
there's really no point in using ULONGEST/pulongest either.

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

	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): 'dwarf_regnum'
	local is now int instead of ULONGEST.  Print it with %d
	instead of paddress.
2013-09-05 14:49:13 +00:00
Tristan Gingold 9f8edbd563 2013-09-05 Tristan Gingold <gingold@adacore.com>
* MAINTAINERS: Remove avr maintainership.
2013-09-05 14:15:27 +00:00
Pedro Alves d5b495b40b Rework value_of_register in terms of value_of_register_lazy.
I noticed that value_of_register (used for getting values _of_
registers ($pc, $rax, etc.), rather than variables _in_ registers),
kind of builds a franken-value, by propagating the lval and address of
the frame register value, but not the entire location, like necessary
for lval_computed (if some unwinder ever returns that, the resulting
value will misbehave).  This gets in the way of printing optimized out
(not saved) lval_registers differently from other optimized out
values, as it doesn't make sure the resulting value is lval_register.

I started out by just doing something like:

-  VALUE_LVAL (reg_val) = lval;
-  set_value_address (reg_val, addr);
+  VALUE_LVAL (reg_val) = lval_register;

... just like value_of_register_lazy below.  That's sufficient to fix
the issue.

Then I noticed this is using frame_register, which we should avoid
nowadays, for it returns elements of a value, but not all that's
sometimes necessary (unavailable-ness is all or nothing with it, for
instance), and considered using get_frame_register_value instead
(which returns a struct value), and value_contents_copy, just like
value_fetch_lazy's handling of lval_register.  But at that point, I
realized we might as well just defer all that work to
value_of_register_lazy/value_fetch_lazy...

Doing it this way adds a frame_find_by_id lookup (from within
value_fetch_lazy), while we already have a frame pointer handy in
value_of_register.  I considered factoring out the lazy register
fetching out of value_fetch_lazy, into a function that takes a frame
pointer and call that instead, avoiding the lookup, but then it looked
like too much complication for an early optimization, and went back to
keeping it simple.

Tested on x86_64 Fedora 17.

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

	* findvar.c (value_of_register): Rework in terms of
	value_of_register_lazy.
2013-09-05 14:02:16 +00:00
Muhammad Bilal 40b917863f 2013-09-05 Muhammad Bilal <mbilal@codesourcery.com>
* symfile.c (add_symbol_file_command): Remove trailing
	 whitespaces and blank line after comment.
2013-09-05 13:13:25 +00:00
Pedro Alves 6eed16788b [TUI] Rewrite register-changed decision bits.
I stumbled on the TUI's register-changed decision code before (used to
decided whether the register should be highlighted in the register
window), for it is trying to compare all the different possible states
and contents or previous/current register contents, and as such may
need updating whenever the value machinery changes to have more state.
It's just much simpler and more future proof to compare the
previous/current printable representation instead.

The bit in tui_register_format that returns early if the register has
no name gets a bit in the way of the new prototype (what to return in
that case? NULL, empty string, etc.?).  Fortunately, that check isn't
really necessary.  All the callers will have already skipped unnamed
registers.

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

	* tui/tui-regs.c (tui_register_format): Don't look at the
	register's name here.  Return string representing register
	value instead of storing it in the data element.
	(tui_get_register): Compare register string representations
	instead of register value states and contents.
2013-09-05 11:50:48 +00:00
Pedro Alves 8eb6bda23e [PR tui/15933] TUI shows registers of the wrong frame the first time
I've stumbled on this by inspection.

When the TUI's register window is first displayed, it always shows the
registers of the current frame, instead of of the selected frame,
which is obviously bogus.

E.g.,

 (gdb) step             # into "function"
 (gdb) up
 (gdb) tui reg general  # or C-x 2, C-x 2

shows the registers of "function", rather than the caller's.

A subsequent:

 (gdb) frame

or

 (gdb) down
 (gdb) up

can be used as workaround to "fix" it.

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

	PR tui/15933
	* tui/tui-regs.c (tui_show_registers): Show registers of the
	selected frame, not the current frame.
2013-09-05 11:20:16 +00:00
Ricard Wanderlof 48b1f08c9a 2013-09-05 Ricard Wanderlof <ricardw@axis.com>
* MAINTAINERS: Add myself to Write After Approval.
2013-09-05 08:22:15 +00:00
Doug Evans 314bb8c368 * gdb.python/py-events.py (exit_handler): Verify we get the expected
event.
	(continue_handler, new_objfile_handler): Ditto.
	(test_events): Rename command to "test-events".
	(test_newobj_events): Rename command to "test-objfile-events".
	* gdb.python/py-events.exp: Update.
	* gdb.python/py-evsignal.exp: Update.
	* gdb.python/py-evthreads.exp: Update.
2013-09-04 23:49:21 +00:00
Doug Evans 89e63ee47a * dwarf2read.c (queue_and_load_all_dwo_tus): New function.
(queue_and_load_dwo_tu): New function.
	(lookup_dwo_signatured_type): Set per_cu.tu_read.
	(maybe_queue_comp_unit): Rename this_cu argument to dependent_cu.
	Make dependent_cu optional.
	(dw2_do_instantiate_symtab): If we just loaded a CU from a DWO,
	and an older .gdb_index is in use, queue and load all its TUs too.

	testsuite/
	* gdb.base/enumval.c (ZERO): New enum value.
	(main): Use it
	* gdb.base/enumval.exp: Test ability to print ZERO.
2013-09-04 23:05:32 +00:00
Jan Kratochvil 492c0ab72a Code cleanup: Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH.
gdb/
2013-09-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Code cleanup: Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH.
	* cli/cli-cmds.c (find_and_open_script): Add OPF_RETURN_REALPATH to
	variable search_flags.
	* defs.h (OPF_DISABLE_REALPATH): Rename to ...
	(OPF_RETURN_REALPATH): ... here.
	* dwarf2read.c (try_open_dwop_file): Set OPF_RETURN_REALPATH for flags.
	* exec.c (exec_file_attach): Remove OPF_DISABLE_REALPATH from openp
	call.  Twice.
	* nto-tdep.c (nto_find_and_open_solib): Add OPF_RETURN_REALPATH for
	openp call.
	* solib.c (solib_find): Likewise.  Four times.
	* source.c (openp): Change OPF_DISABLE_REALPATH to OPF_RETURN_REALPATH
	in the function comment and for the realpath_fptr variable.
	(source_full_path_of): Add OPF_RETURN_REALPATH for openp call.
	(find_and_open_source): Likewise.  Twice.
	* symfile.c (symfile_bfd_open): Likewise, also twice.
2013-09-04 20:09:39 +00:00
Doug Evans 23a44de810 * progspace.c (save_current_space_and_thread): Remove unnecessary
call to save_current_inferior.
2013-09-04 19:53:11 +00:00
Andrew Burgess 47061676f3 Avoid printing unavailable/optimized out registers (sh64-tdep.c)
https://sourceware.org/ml/gdb-patches/2013-08/msg00834.html

gdb/ChangeLog

        * sh64-tdep.c (sh64_do_register): Return after printing message
        about unavailable register contents.
2013-09-04 16:34:07 +00:00
Muhammad Bilal 41dc8db876 2013-09-04 Muhammad Bilal <mbilal@codesourcery.com>
Pedro Alves  <palves@redhat.com>

	* symfile.c (add_symbol_file_command): Error out on unknown
        option.  Handle EXPECTING_SEC_ADDR/EXPECTING_SEC_NAME before '-'
        options and collapse into single conditional branch.
2013-09-13  Muhammad Bilal  <mbilal@codesourcery.com>
            Pedro Alves  <palves@redhat.com>

	* gdb.base/relocate.exp: Check that invalid options are
	rejected.
2013-09-04 06:17:08 +00:00
Luis Machado 07107ca6f9 * inf-child.c (inf_child_follow_fork) New parameter
detach_fork.
	* inf-ptrace.c (inf_ptrace_follow_fork): Likewise.
	* inf-ttrace.c (inf_ttrace_follow_fork): Likewise.
	* inferior.h (detach_fork): Remove.
	* infrun.c (detach_fork): Adjust comment and make it
	static.
	(follow_fork): Pass detach_fork parameter to
	target_follow_fork.
	* linux-nat.c (linux_child_follow_fork): New parameter
	detach_fork.
	* target.c (target_follow_fork): New parameter detach_fork.
	Pass detach_fork as parameter and print its value.
	* target.h (struct target_ops) <to_follow_fork>: New int
	parameter.
	(target_follow_fork): New parameter detach_fork.
2013-09-03 17:22:45 +00:00
Joel Brobecker 3bec276888 Fix build failure in solib-ia64-hpux.c
The field "bfd" no longer exists in struct target_section.
Use the_bfd_section->owner instead.

gdb/ChangeLog:

        * solib-ia64-hpux.c (ia64_hpux_relocate_section_addresses):
        Replace sec->bfd by sec->the_bfd_section->owner.
2013-09-03 16:59:18 +00:00
Yao Qi c01cbb3d52 gdb/
* linux-tdep.c (linux_is_uclinux): New function.  Code moved
	from linux_has_shared_address_space.
	(linux_has_shared_address_space): Call linux_is_uclinux.
	* linux-tdep.h (linux_is_uclinux): Declare.
	* m68klinux-tdep.c (m68k_linux_get_sigtramp_info): Call
	linux_is_uclinux.
2013-09-02 23:09:57 +00:00
Yao Qi 7b00db47ce gdb/
* config/djgpp/fnchange.lst: Remove entry of
	i386-interix-nat.c and i386-interix-tdep.c.
	* configure.ac: Remove '*-*-interix*'.
	* configure: Re-generated.
	* defs.h (enum gdb_osabi): Remove GDB_OSABI_INTERIX.
	* i386-cygwin-tdep.c (i386_cygwin_osabi_sniffer): Remove
	obsolete comments.
	* osabi.c (gdb_osabi_names): Remove "Interix".
2013-09-02 23:07:07 +00:00
Yao Qi 0f9741f266 gdb/
* arch-utils.c: Fix typo in the comment to gdbarch_update_p.
2013-09-02 23:00:29 +00:00
Pedro Alves 3aafd2ffb6 [gdbserver] Fix trace-buffer-size.exp FAILs.
I'm seeing trace-buffer-size.exp failing (with gdbserver):

  (gdb) PASS: gdb.trace/trace-buffer-size.exp: tstatus check 2
  show trace-buffer-size 4
  Requested size of trace buffer is 4.
  (gdb) PASS: gdb.trace/trace-buffer-size.exp: show trace buffer size
  set trace-buffer-size -1
  memory clobbered past end of allocated block
  Remote connection closed
  (gdb) FAIL: gdb.trace/trace-buffer-size.exp: set trace buffer size 2
  set trace-buffer-size unlimited
  (gdb) PASS: gdb.trace/trace-buffer-size.exp: set trace-buffer-size unlimited

That "memory clobbered past end of allocated block" is mcheck triggering.

Valgrind shows:

  ==23624== Invalid write of size 1
  ==23624==    at 0x418DD8: clear_trace_buffer (tracepoint.c:1443)
  ==23624==    by 0x418F3A: init_trace_buffer (tracepoint.c:1497)
  ==23624==    by 0x41D95B: cmd_bigqtbuffer_size (tracepoint.c:4061)
  ==23624==    by 0x41DEEC: handle_tracepoint_general_set (tracepoint.c:4193)

clear_trace_buffer does:

  static void
  clear_trace_buffer (void)
  {
    trace_buffer_start = trace_buffer_lo;
    trace_buffer_free = trace_buffer_lo;
    trace_buffer_end_free = trace_buffer_hi;
    trace_buffer_wrap = trace_buffer_hi;
    /* A traceframe with zeroed fields marks the end of trace data.  */
    ((struct traceframe *) trace_buffer_free)->tpnum = 0;
    ((struct traceframe *) trace_buffer_free)->data_size = 0;
    traceframe_read_count = traceframe_write_count = 0;
    traceframes_created = 0;
  }

And the tpnum+data_size fields are over 4 bytes...  This fixes it by
ensuring we allocate space at least for an EOB.  We have code
elsewhere that relies on the EOB being present (like e.g.,
find_traceframe), so this seems simplest.

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

	* tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
	(init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
	allocated.
	(trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
2013-09-02 15:15:57 +00:00
Markus Metzger 1e038f67a9 record: upcase record_print_flag enumeration constants
* record.h (record_print_flag) <record_print_src_line,
	record_print_insn_range>: Rename into ...
	(record_print_flag) <record_print_src_line,
	record_print_insn_range>: ... this.  Update all users.
2013-09-02 15:06:11 +00:00
Pierre Muller cee83bcb49 * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
or WriteProcessMemory complete successfully and handle
	ERROR_PARTIAL_COPY error.
2013-09-02 14:32:19 +00:00
Pedro Alves 9a13b2fa01 server.c:gdb_read_memory: Fix error return.
When I added gdb_read_memory, with bits factored out from elsewhere, I
missed adjusting this error return.  gdb_read_memory has an interface
similar to Like GDB's xfer_partial:

> /* Read trace frame or inferior memory.  Returns the number of bytes
>   actually read, zero when no further transfer is possible, and -1 on
>   error.  Return of a positive value smaller than LEN does not
>   indicate there's no more to be read, only the end of the transfer.

Returning EIO, a positive value, is obviously bogus, for the caller
will confuse it with a successful partial transfer.

Found by inspection.

Tested on x86_64 Fedora 17.

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

	* server.c (gdb_read_memory): Return -1 on traceframe memory read
	error instead of EIO.
2013-09-02 14:14:58 +00:00
Pierre Muller 7126d5c82e Fix small indentation error in last commit 2013-09-02 13:11:13 +00:00
Pierre Muller 9e52adf9c6 * windows-nat.c (windows_xfer_memory): Handle ERROR_PARTIAL_COPY
error code.
2013-09-02 12:57:49 +00:00
Pierre Muller a238856838 * windows-nat.c (windows_xfer_memory): Fix compilation failure
by use of plongest function.
2013-09-02 12:45:55 +00:00
Tristan Gingold 9058cc3a1b 2013-09-02 Tristan Gingold <gingold@adacore.com>
* NEWS: Add entry mentioning support for native Windows x64
	SEH data.

	* amd64-windows-tdep.c: #include "objfiles.h", "frame-unwind.h",
	"coff/internal.h", "coff/i386.h", "coff/pe.h" and "libcoff.h".
	(struct amd64_windows_frame_cache): New struct.
	(amd64_windows_w2gdb_regnum): New global.
	(pc_in_range, amd64_windows_frame_decode_epilogue)
	(amd64_windows_frame_decode_insns, amd64_windows_find_unwind_info)
	(amd64_windows_frame_cache, amd64_windows_frame_prev_register)
	(amd64_windows_frame_this_id): New functions.
	(amd64_windows_frame_unwind): New static global.
	(amd64_windows_skip_prologue): New function.
	(amd64_windows_init_abi): Call frame_unwind_prepend_unwinder
	with amd64_windows_frame_unwind. Call set_gdbarch_skip_prologue
	with amd64_windows_skip_prologue.
2013-09-02 09:28:02 +00:00
gdbadmin 3161820bdf GDB 7.6.1 released. 2013-08-30 19:27:16 +00:00
Andrew Burgess 26c2b53cb0 gdb.base/code_elim.exp - force .bss creation.
https://sourceware.org/ml/gdb-patches/2013-08/msg00920.html

gdb/ChangeLog

        * gdb.base/code_elim1.c (my_bss_symbol): New variable added.
        (my_static_symbol): Add comment.
        (main): Reference my_bss_symbol.
2013-08-30 16:36:03 +00:00
Pedro Alves 02457c768f MI -trace-find, print frame with LOC_AND_ADDRESS instead of SRC_AND_LOC.
When I looked for print_stack_frame calls in MI, I wondered why this
one passing down SRC_AND_LOC.  print_stack_frame does:

  /* For mi, alway print location and address.  */
  if (ui_out_is_mi_like_p (current_uiout))
    print_what = LOC_AND_ADDRESS;

So it really doesn't matter which value is passed down, but, to avoid
confusion in readers, it's better to use the MI standard here.
There's another SRC_AND_LOC in mi-interp.c, but that one makes sense.

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

	* mi/mi-main.c (mi_cmd_trace_find): Use LOC_AND_ADDRESS instead of
	SRC_AND_LOC.
2013-08-30 15:37:37 +00:00
Pedro Alves e0162910f1 restore_selected_frame: tweak warning.
I noticed SRC_LINE has special handling within print_stack_frame (mid
statement handling), so I audited all uses, and noticed the one in
restore_selected_frame.  I actually added this warning myself back in
2008, but reading back, I think we can do better.  "reparsed frame" is
probably confusing to users.

Old:

 warning: Couldn't restore frame #2 in current thread, at reparsed frame #0

 45         w = 0;
 (gdb)

New:

 warning: Couldn't restore frame #2 in current thread.  Bottom (innermost) frame selected:
 #0  foo () at foo.c:45
 45         w = 0;
 (gdb)

Tested on x86_64 Fedora 17.

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

	* thread.c (restore_selected_frame): Use SRC_AND_LOC, and change
	warning text.
2013-08-30 15:32:45 +00:00
Pedro Alves 6391ce51cf bsd-kvm.c: Fix arguments to print_stack_frame.
1 is SRC_AND_LOC.

Then, this is passing -1 as print_level argument to print_stack_frame.
-1 is not a valid print_level value (it's a regular boolean).  But, it
used to be, before
<https://sourceware.org/ml/gdb-patches/2004-04/msg00585.html>.

What happened is that bsd-kvm.c did not exist at the time of that
patch, but went into the tree about a month after, without being
adjusted to the new interface.

Fixed now, exactly as e.g., ocd.c had been adjusted:

> --- ocd.c	18 Jan 2004 19:26:51 -0000	1.28
> +++ ocd.c	23 Apr 2004 14:29:12 -0000
> @@ -225,7 +225,7 @@
>    flush_cached_frames ();
>    registers_changed ();
>    stop_pc = read_pc ();
> -  print_stack_frame (get_selected_frame (), -1, 1);
> +  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC);

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

	* bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd):
	Adjust arguments to print_stack_frame.
2013-08-30 15:31:32 +00:00
Pedro Alves d1da058760 ada-tasks.c: write SRC_AND_LOC instead '1'.
1 is SRC_AND_LOC.

2013-08-30  Pedro Alves  <palves@redhat.com>

	* ada-tasks.c (task_command_1): Write SRC_AND_LOC instead '1'.
2013-08-30 15:28:40 +00:00
Pedro Alves adfd8245d8 frame.h: Delete stale declaration.
This is declaring a function that no longer exists.  It was deleted
back in 2003-01-13:

        ...
        show_and_print_stack_frame, print_only_stack_frame_stub,
	print_only_stack_frame): Delete functions.

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

	* frame.h (show_and_print_stack_frame): Delete declaration.
2013-08-30 15:26:04 +00:00
Phil Muldoon 96d9056e29 2013-08-30 Phil Muldoon <pmuldoon@redhat.com>
PR python/15461

	* python/py-arch.c (ARCHPY_REQUIRE_VALID): New macro.
	(archpy_name): Check for valid architecture.
	(archpy_disassemble): Ditto.


2013-08-30  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-arch.exp: Tests for invalid architecture.
2013-08-30 10:12:19 +00:00
Joel Brobecker 11cb8762fc thread support broken on ppc-aix.
Thread support got broken when adding 64bit support on ppc-aix.
Upon digging further, I found that the following patch...

   | * gdb_ptrace.h: Use ptrace64 instead of ptrace if HAVE_PTRACE64
   | is defined.
   | * rs6000-nat.c: Check for __ld_info64_ if compiling 64 BIT gdb.
   | (rs6000_ptrace32): Call ptrace64 instead of ptrace if present.
   | (rs6000_ptrace64): Call ptace64 instead of ptracex if present.
   | * configure.ac: Check for ptrace64.
   | * configure, config.in: Regenerate.

... is responsible for this regression:

    (gdb) x /x &__n_pthreads
    0xf06a8258 <__n_pthreads>: Cannot access memory at address 0xf06a8258

Prior to the patch, we have:

    (gdb) x /x &__n_pthreads
    0xf06a8258 <__n_pthreads>: 0x00000003

The problem occurs inside rs6000_ptrace32, while calling ptrace64.
The address is given to rs6000_ptrace32 as an "int *", while
ptrace64 takes a "long long". The cast causes the address to be
sign-extended, which results in GDB trying to read the wrong address.

This patch fixes the issue by casting the address to a "uintptr_t"
instead, and letting the compiler do the implicit conversion to
"long long" in the function call.

gdb/ChangeLog:

        * rs6000-nat.c (rs6000_ptrace32): Cast "addr" to "uintptr_t"
        instead of "long long" in call to ptrace64.
2013-08-29 21:02:15 +00:00
Sterling Augustine 489d4f4d01 2013-08-29 Sterling Augustine <saugustine@google.com>
* boards/remote-stdio-gdbserver.exp: Set rcp_prog and
        rsh_prog in new conditional.  Move use of REMOTE_PORTNUM into
        said conditional.
2013-08-29 19:22:06 +00:00
Andrew Burgess 1af12a7ddd Remove use of deprecated_command_loop_hook from mi code.
https://sourceware.org/ml/gdb-patches/2013-08/msg00605.html

gdb/ChangeLog

	* mi/mi-interp.c (mi_command_loop): Change signature to match
	interp_command_loop_ftype.
	(mi1_command_loop): Remove.
	(mi2_command_loop): Remove.
	(mi3_command_loop): Remove.
	(mi_interpreter_resume): Remove setting of
	deprecated_command_loop_hook.
	(_initialize_mi_interp): Set mi_command_loop as the command loop
	callback.
2013-08-29 16:59:48 +00:00
Sanimir Agovic acc900c21f 2013-08-29 Sanimir Agovic <sanimir.agovic@intel.com>
* valops.c (do_search_struct_field): Pass v2 instead of base_type to
	value_type.
2013-08-29 14:25:22 +00:00
Sanimir Agovic 548b762d1b cleanup: make allocate_value_contents static
2013-08-29  Sanimir Agovic  <sanimir.agovic@intel.com>

	* value.c (allocate_value_contents): Make static.
	* value.h (allocate_value_contents): Remove prototype.
2013-08-29 12:26:59 +00:00
Sanimir Agovic 08039c9efd cleanup: use value_lazy_at instead of allocate_value_lazy/attribute setter
I came across a pattern used to construct a value in the following way:

  struct value *val = allocate_value_lazy (type);
  VALUE_LVAL (val) = lval_memory;
  set_value_address (val, address);

Instead we fold the above call into:

  value_at_lazy (type, addr);

2013-08-27  Sanimir Agovic  <sanimir.agovic@intel.com>

	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use value_at_lazy instead
	of assembling value via allocate_value_lazy and attribute setter.
	* findvar.c (default_read_var_value): Use value_at_lazy instead of
	assembling value via allocate_value_lazy and attribute setter.
	* valops.c (do_search_struct_field): Use value_at_lazy instead of
	assembling value via allocate_value_lazy and attribute setter.
2013-08-29 12:25:03 +00:00
Sanimir Agovic 314c7de970 cleanup: replace allocate_value and memcpy with value_from_contents
2013-08-29  Sanimir Agovic  <sanimir.agovic@intel.com>

	* value.c (value_from_contents_and_address): Replace allocate_value and
	memcpy with value_from_contents.
2013-08-29 12:21:29 +00:00
Phil Muldoon 5b791bb530 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-arch.exp: Load gdb-python.exp.
2013-08-29 10:20:03 +00:00
Phil Muldoon 8f28f5226e 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>
* python/py-framefilter.c (py_print_frame): Remove usage of
	PyString_AsString.  Use python_string_to_host_string instead.
	Refactor function to work with a string as a new allocation
	instead of a pointer.
	(py_print_frame): Ditto.
	* python/lib/gdb/frames.py (return_list): Cain iterators together
	instead of adding them as a list.
	(_sort_list): Call return_list, and remove duplicate code.
	(execute_frame_filters): Convert iterator to a list with list().
	* python/lib/gdb/command/frame_filters.py
	(SetFrameFilterPriority._set_filter_priority): Convert priority
	attribute to an integer.
	* python/lib/gdb/FrameIterator.py (FrameIterator.next): Define
	wrapper function __next__.
	* python/lib/gdb/FrameDecorator.py: If basestring not defined,
	define as "str".

2013-08-29  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-framefilter.py (FrameFilter.filter): Check
	itertools for imap attribute.  Otherwise use map().
	(ElidingIterator): Define wrapper function __next__.
	* gdb.python/py-framefilter-mi.exp: Do not use execfile,
	use exec (open (read ())) instead.
	* gdb.python/py-framefilter.exp: Ditto.
	* gdb.python/py-arch.exp: Update print based test to Python 3.x
	compliance.
	* gdb.python/py-frame.exp: Ditto.
	* gdb.python/py-type.exp: Ditto.
2013-08-29 10:06:18 +00:00
Phil Muldoon ca422daf34 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>
* ChangeLog: Remove blank lines between PR and ChangeLog description.
2013-08-29 09:36:02 +00:00
Phil Muldoon 8ee002dfdc 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>
PR python/15752

	* python/py-framefilter.c (apply_frame_filter): Check
	gdb_python_initialized.  Exit if the Python frame-filter code
	cannot be initialized.
2013-08-29 09:24:33 +00:00
Phil Muldoon af4c453a83 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>
PR cli/15842

	* top.c (print_gdb_version): Remove erroneous newline after help
	text.
2013-08-29 09:09:22 +00:00
Yao Qi bf8793bb97 gdb/
* varobj.c (install_dynamic_child): Remove trailing space.
	Add one blank line after variable declaration.
2013-08-29 04:58:26 +00:00
Jan Kratochvil 1f0c498857 PR gdb/15415
gdb/
2013-08-27  Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/15415
	* corefile.c (get_exec_file): Use exec_filename.
	* defs.h (OPF_DISABLE_REALPATH): New definition.  Add new comment.
	* exec.c (exec_close): Free EXEC_FILENAME.
	(exec_file_attach): New variable canonical_pathname.  Use
	OPF_DISABLE_REALPATH.  Call gdb_realpath explicitly.  Set
	EXEC_FILENAME.
	* exec.h (exec_filename): New.
	* inferior.c (print_inferior, inferior_command): Use
	PSPACE_EXEC_FILENAME.
	* mi/mi-main.c (print_one_inferior): Likewise.
	* progspace.c (clone_program_space, print_program_space): Likewise.
	* progspace.h (struct program_space): New field pspace_exec_filename.
	* source.c (openp): Describe OPF_DISABLE_REALPATH.  New variable
	realpath_fptr, initialize it from OPF_DISABLE_REALPATH, use it.

gdb/testsuite/
2013-08-27  Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/15415
	* gdb.base/argv0-symlink.c: New file.
	* gdb.base/argv0-symlink.exp: New file.
2013-08-28 17:52:03 +00:00
Jan Kratochvil 602e3198bc PR server/15604
gdb/gdbserver/
2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR server/15604
	* linux-low.c: Include filestuff.h.
	(linux_create_inferior) <pid == 0>: Call close_most_fds.
	* lynx-low.c: Include filestuff.h.
	(lynx_create_inferior) <pid == 0>: Call close_most_fds.
	* server.c: Include filestuff.h.
	(main): Call notice_open_fds.
	* spu-low.c: Include filestuff.h.
	(spu_create_inferior) <pid == 0>: Call close_most_fds.
2013-08-28 17:40:58 +00:00
Tom Tromey 7893c16288 * gdb.dwarf2/gdb-index.exp (add_gdb_index): Use explicit test name
when saving index.
2013-08-28 14:20:43 +00:00
Will Newton 59ee9f94e5 gdb/common/linux-ptrace.c: Fix build on non-Intel architectures.
As uintptr_t is used stdint.h must be included on all architectures.

2013-08-28  Will Newton  <will.newton@linaro.org>

	* common/linux-ptrace.c: Include stdint.h unconditionally.
2013-08-28 14:09:31 +00:00
Jan Kratochvil c8a2a41934 gdb/
Code cleanup.
	* nto-tdep.c (nto_find_and_open_solib): Use OPF_TRY_CWD_FIRST.
2013-08-28 13:07:12 +00:00
Yao Qi ffa4ac956c gdb/
* event-top.c (gdb_setup_readline): Call stderr_fileopen
	instead of stdio_fileopen.
	* main.c (captured_main) [__MINGW32__]: Set stderr unbuffered.
	.Call stderr_fileopen instead of stdio_fileopen.
	* ui-file.c [__MINGW32__] (stderr_file_write): New function.
	[__MINGW32__] (stderr_file_fputs): New function.
	(stderr_fileopen): New function.
	* ui-file.h (stderr_fileopen): Declare.
2013-08-28 12:25:05 +00:00
Doug Evans 69d751e3c1 * dwarf2read.c (struct dwarf2_cu): Tweak comment.
(struct dwarf2_per_cu_data): Ditto.
	(maybe_queue_comp_unit): Delete forward decl.  Add comment.
	(process_imported_unit_die): Ditto.
	(follow_die_sig_1): Simplify assert.
2013-08-27 21:38:05 +00:00
Pedro Alves 44f3886761 windows-nat.c: Don't install a deprecated_xfer_memory method.
This stops another target from installing a
target_ops->deprecated_xfer_memory method.

Tested on native MinGW.

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

	* windows-nat.c (windows_xfer_memory): Adjust prototype to follow
	xfer_partial's interface.  Return TARGET_XFER_E_IO on error.
	(windows_xfer_partial): Defer TARGET_OBJECT_MEMORY handling to
	windows_xfer_memory directly.
	(init_windows_ops): Don't install a deprecated_xfer_memory method.
2013-08-27 11:36:09 +00:00
Pedro Alves d28d46b554 darwin-nat.c: Don't install a deprecated_xfer_memory method.
darwin_xfer_partial already handles TARGET_OBJECT_MEMORY, so this
method is not necessary.

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

	* darwin-nat.c (darwin_xfer_memory): Delete.
	(_initialize_darwin_inferior): Don't install a
	deprecated_xfer_memory method.
2013-08-27 11:05:39 +00:00
Yao Qi 6211c335ec Add options to skip unavailable locals
This is the patch to add new option '--skip-unavailable' to MI
commands '-stack-list-{locals, arguments, variables}'.  This patch
extends list_args_or_locals to add a new parameter 'skip_unavailable',
and don't list locals or arguments if values are unavailable and
'skip_unavailable' is true.

This is inspecting a trace frame (tfind mode), where only a few
locals have been collected.

-stack-list-locals, no switch vs new switch:

 -stack-list-locals --simple-values
 ^done,locals=[{name="array",type="unsigned char [2]"},{name="i",type="int",value="<unavailable>"}]
 -stack-list-locals --skip-unavailable --simple-values
 ^done,locals=[{name="array",type="unsigned char [2]"}]

-stack-list-arguments, no switch vs new switch:

 -stack-list-arguments --simple-values
 ^done,stack-args=[frame={level="0",args=[{name="j",type="int",value="4"},{name="s",type="char *",value="<unavailable>"}]},frame={level="1",args=[]}]
 -stack-list-arguments --skip-unavailable --simple-values
 ^done,stack-args=[frame={level="0",args=[{name="j",type="int",value="4"}]},frame={level="1",args=[]}]

-stack-list-variables, no switch vs new switch:

 -stack-list-variables --simple-values
 ^done,variables=[{name="j",arg="1",type="int",value="4"},{name="s",arg="1",type="char *",value="<unavailable>"},{name="array",type="unsigned char [2]"},{name="i",type="int",value="<unavailable>"}]
 -stack-list-variables --skip-unavailable --simple-values
 ^done,variables=[{name="j",arg="1",type="int",value="4"},{name="array",type="unsigned char [2]"}]

tests are added to test these new options.

gdb:

2013-08-27  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* mi/mi-cmd-stack.c (list_args_or_locals): Adjust prototype.
	(parse_no_frames_option): Remove.
	(mi_cmd_stack_list_locals): Handle --skip-unavailable.
	(mi_cmd_stack_list_args): Adjust.
	(mi_cmd_stack_list_variables): Handle --skip-unavailable.
	(list_arg_or_local): Add new parameter 'skip_unavailable'.  Return
	early if SKIP_UNAVAILABLE is true and ARG->val is unavailable.
	Caller update.
	(list_args_or_locals): New parameter 'skip_unavailable'.
	Handle it.
	* valprint.c (scalar_type_p): Rename to ...
	(val_print_scalar_type_p): ... this.  Make extern.
	(val_print, value_check_printable): Adjust.
	* valprint.h (val_print_scalar_type_p): Declare.
	* value.c (value_entirely_unavailable): New function.
	* value.h (value_entirely_unavailable): Declare.

	* NEWS: Mention the new option "--skip-unavailable" to MI
	commands '-stack-list-locals', '-stack-list-arguments' and
	'-stack-list-variables'.

gdb/doc:

2013-08-27  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* gdb.texinfo (GDB/MI Stack Manipulation) <-stack-list-locals>:
	Document new --skip-unavailable option.
	<-stack-list-variables>: Document new --skip-unavailable option.

gdb/testsuite:

2013-08-27  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/entry-values.exp: Test unavailable entry value is
	not shown when option '--skip-unavailable' is specified.
	* gdb.trace/mi-trace-unavailable.exp (test_trace_unavailable):
	Add tests for new option '--skip-unavailable'.
2013-08-27 05:20:57 +00:00
Yao Qi 242f1fd7ee Add mi_getopt_allow_unknown
This patch is to add a new function mi_getopt_allow_unknown, which
returns -1 silently (without throwing error) when unknown option is
met, and use this function to parse options for command
'-stack-list-arguments'.

gdb/
	* mi/mi-cmd-stack.c (parse_no_frames_option): Remove.
	(mi_cmd_stack_list_args): Use mi_getopt_silent to handle
	options.
	* mi/mi-getopt.c (mi_getopt): Remove.
	(mi_getopt_1): Renamed from mi_getopt.  Add one parameter
	'error_on_unknown'.
	(mi_getopt): Call mi_getopt_1.
	(mi_getopt_silent): New.
	* mi/mi-getopt.h (mi_getopt_silent): Declare.
2013-08-27 03:04:45 +00:00
Yao Qi ce4ea2bb17 gdb/testsuite/
* lib/gdb.exp (gdb_remote_download): Don't pass $tofile to
	remote_download if it is empty.
2013-08-27 00:19:02 +00:00
Doug Evans 779bd27081 PR symtab/15885
* dwarf2read.c (dw2_dump): Print some minimal information indicating
	.gdb_index is in use.
	* symfile.c (reread_symbols): Reset objfile->sf.

	testsuite/
	* gdb.dwarf2/Makefile.in (EXECUTABLES): Add gdb-index.
	(clean): rm -f *.gdb-index *.with-index.
	* gdb.dwarf2/gdb-index.exp: New testcase.
2013-08-26 18:43:40 +00:00
Doug Evans 52e260a34e * NEWS: Document "mt print objfiles" now takes optional regexp.
* symmisc.c (maintenance_print_objfiles): Argument is now an optional
	regexp of objfiles to print.
	(_initialize_symmisc): Update doc string for "mt print objfiles".

	doc/
	* gdb.texinfo (Maintenance Commands): "maint print objfiles" now takes
	an optional regexp.
2013-08-26 18:41:31 +00:00
Doug Evans 260b681b41 * dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of
missing debug info checks.
2013-08-26 18:38:37 +00:00
Doug Evans 6e45f15898 * lib/gdb.exp (run_on_host): Moved here from gnu-debugdata.exp.
* gdb.base/gnu-debugdata.exp (run): Moved to gdb.exp and renamed to
	run_on_host.  All callers updated.
2013-08-26 18:30:02 +00:00
Ulrich Weigand a85c52f205 2013-08-26 Raunaq Bathija <raunaq12@in.ibm.com>
Ulrich Weigand  <uweigand@de.ibm.com>

	* xcoffread.c (arrange_linetable): Add fix to correctly handle
	line tables generated by XLC compiled binaries.
2013-08-26 15:28:28 +00:00
Yao Qi b122423813 gdb/testsuite/
* gdb.trace/entry-values.c (end): New
	(main): Call end.
	* gdb.trace/entry-values.exp: Load trace-support.exp.  Set
	tracepoint and collect data.  Test entry value is unavailable.
2013-08-24 01:54:59 +00:00
Yao Qi b39a8faf7c gdb/testsuite/
* lib/dwarf.exp (_location): Handle DW_OP_deref_size.
	* gdb.trace/entry-values.c: New.
	* gdb.trace/entry-values.exp: New.
2013-08-24 01:53:06 +00:00
Doug Evans db68bbae94 * symmisc.c (dump_symtab): Delete prototype.
(dump_msymbols, dump_objfile): Ditto.
	(maintenance_info_symtabs): Mark as dont_repeat.
	(_initialize_symmisc): Improve doc string for "mt info symtabs".
2013-08-24 00:29:13 +00:00
Doug Evans 4f00dda370 * elfread.c (elf_symfile_read): Move "Done reading minimal symbols"
debugging printf to better location.
2013-08-24 00:12:25 +00:00
Pedro Alves 23d577b0bc target.c:target_read_live_memory: Fix type of local.
'ret' is used to hold the return of target_read, and pass it on.  Both
target_read and target_read_live_memory return LONGEST.

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

	* target.c (target_read_live_memory): Change type of 'ret' local
	to LONGEST.
2013-08-23 14:03:25 +00:00
Pedro Alves 00d8452480 remote.c: don't install a deprecated_xfer_memory hook.
There's no need for deprecated_xfer_memory nowadays.  Memory access
goes through target_xfer_partial/TARGET_OBJECT_MEMORY, etc.  In fact,
the remote target already handles that, and is deferring to the same
helpers the deprecated_xfer_memory hook is.  Basically, only a few
adjustments to make these helper routines's interfaces closer to
target_xfer_partial's were necessary.

Tested on x86_64 Fedora 17 w/ gdbserver.

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

	* remote.c (remote_write_bytes_aux, remote_write_bytes)
	(remote_read_bytes): Change return type to LONGEST, and adjust to
	return a target_xfer_error on error.
	(remote_xfer_memory): Delete.
	(remote_flash_write): Change type of 'ret' local to LONGEST.
	(remote_xfer_partial, remote_xfer_partial): Adjust.
	(init_remote_ops): Don't install a deprecated_xfer_memory hook.
2013-08-23 13:12:17 +00:00
Pierre Muller 1ed3ee940d ARI fix: Push # directives to start of line.
* rs6000-nat.c (rs6000_ptrace32, rs6000_ptrace64): Rule applied.
2013-08-23 06:51:18 +00:00
Muhammad Waqas 9eaabc7557 2013-08-12 Muhammad Waqas <mwaqas@codesourcery.com>
PR gdb/15501
	* breakpoint.c (enable_command, disable_command): Iterate over
	all specified breakpoint locations.
2013-07-12  Muhammad Waqas  <mwaqas@codesourccery.com>

	PR gdb/15501
	* gdb.base/ena-dis-br.exp: Add test to verify
 	enable/disable commands work correctly with
	multiple arguments that include multiple locations.
2013-08-23 06:22:10 +00:00
Luis Machado 101158d99a * common/linux-ptrace.c (linux_fork_to_function): Push #
directives to the start of the line.
	(linux_check_ptrace_features): Fix warning message to use
	the "_" markup.
2013-08-23 02:34:34 +00:00
Luis Machado 96d7229d2a Unify ptrace options discovery code and make both GDB and
gdbserver use it.

	gdb/
	* Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-nat.h and
	nat/linux-waitpid.h.
	(linux-waitpid.o): New object file rule.
	* common/linux-ptrace.c: Include nat/linux-waitpid.h.
	(current_ptrace_options): Moved from linux-nat.c.
	(linux_ptrace_test_ret_to_nx): Use type casts for ptrace
	parameters.
	(linux_fork_to_function): New function.
	(linux_grandchild_function): Likewise.
	(linux_child_function): Likewise.
	(linux_check_ptrace_features): New function, heavily
	based on linux-nat.c:linux_test_for_tracefork.
	(linux_enable_event_reporting): New function.
	(ptrace_supports_feature): Likewise.
	(linux_supports_tracefork): Likewise.
	(linux_supports_traceclone): Likewise.
	(linux_supports_tracevforkdone): Likewise.
	(linux_supports_tracesysgood): Likewise.
	* common/linux-ptrace.h (HAS_NOMMU): Moved from
	gdbserver/linux-low.c.
	(linux_enable_event_reporting): New declaration.
	(linux_supports_tracefork): Likewise.
	(linux_supports_traceclone): Likewise.
	(linux_supports_tracevforkdone): Likewise.
	(linux_supports_tracesysgood): Likewise.
	* config.in (PTRACE_TYPE_ARG4): Regenerate.
	* config/aarch64/linux.mh (NATDEPFILES): Add linux-waitpid.o.
	* config/alpha/alpha-linux.mh (NATDEPFILES): Likewise.
	* config/arm/linux.mh (NATDEPFILES): Likewise.
	* config/i386/linux.mh (NATDEPFILES): Likewise.
	* config/i386/linux64.mh (NATDEPFILES): Likewise.
	* config/ia64/linux.mh (NATDEPFILES): Likewise.
	* config/m32r/linux.mh (NATDEPFILES): Likewise.
	* config/m68k/linux.mh (NATDEPFILES): Likewise.
	* config/mips/linux.mh (NATDEPFILES): Likewise.
	* config/pa/linux.mh (NATDEPFILES): Likewise..
	* config/powerpc/linux.mh (NATDEPFILES): Likewise..
	* config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise.
	* config/powerpc/spu-linux.mh (NATDEPFILES): Likewise.
	* config/sparc/linux.mh (NATDEPFILES): Likewise.
	* config/sparc/linux64.mh (NATDEPFILES): Likewise.
	* config/tilegx/linux.mh (NATDEPFILES): Likewise.
	* config/xtensa/linux.mh (NATDEPFILES): Likewise.
	* configure.ac (AC_CACHE_CHECK): Add void * to the list of
	ptrace's 4th argument's types.
	Check the type of PTRACE_TYPE_ARG4.
	* configure: Regenerate.
	* linux-nat.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
	(SYSCALL_SIGTRAP): Moved to nat/linux-nat.h.
	(linux_supports_tracefork_flag): Remove.
	(linux_supports_tracesysgood_flag): Likewise.
	(linux_supports_tracevforkdone_flag): Likewise.
	(current_ptrace_options): Moved to
	common/linux-ptrace.c.
	(linux_tracefork_child): Remove.
	(my_waitpid): Remove.
	(linux_test_for_tracefork): Renamed to
	linux_check_ptrace_features and moved to common/linux-ptrace.c.
	(linux_test_for_tracesysgood): Remove.
	(linux_supports_tracesysgood): Remove.
	(linux_supports_tracefork): Remove.
	(linux_supports_tracevforkdone): Remove.
	(linux_enable_tracesysgood): Remove.
	(linux_enable_event_reporting): Remove.
	(linux_init_ptrace): New function.
	(linux_child_post_attach): Call linux_init_ptrace.
	(linux_child_post_startup_inferior): Call linux_init_ptrace.
	(linux_child_follow_fork): Call linux_supports_tracefork
	and linux_supports_tracevforkdone.
	(linux_child_insert_fork_catchpoint): Call
	linux_supports_tracefork.
	(linux_child_insert_vfork_catchpoint): Likewise.
	(linux_child_set_syscall_catchpoint): Call
	linux_supports_tracesysgood.
	(lin_lwp_attach_lwp): Call linux_supports_tracefork.
	* nat/linux-nat.h: New file.
	* nat/linux-waitpid.c: New file.
	* nat/linux-waitpid.h: New file.

	gdb/gdbserver/
	* Makefile.in: Explain why ../target and ../nat are not
	listed as include file search paths.
	(linux-waitpid.o): New object file rule.
	* configure.srv (srv_native_linux_obj): New variable.
	Replace all occurrences of linux native object files with
	$srv_native_linux_obj.
	* linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
	(HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
	(linux_enable_event_reporting): Remove declaration.
	(my_waitpid): Moved to common/linux-waitpid.c.
	(linux_wait_for_event): Pass ptid when calling
	linux_enable_event_reporting.
	(linux_supports_tracefork_flag): Remove.
	(linux_enable_event_reporting): Likewise.
	(linux_tracefork_grandchild): Remove.
	(STACK_SIZE): Moved to common/linux-ptrace.c.
	(linux_tracefork_child): Remove.
	(linux_test_for_tracefork): Remove.
	(linux_look_up_symbols): Call linux_supports_traceclone.
	(initialize_low): Remove call to linux_test_for_tracefork.
	* linux-low.h (PTRACE_TYPE_ARG3): Move to
	common/linux-ptrace.h.
	(PTRACE_TYPE_ARG4): Likewise.
	Include linux-ptrace.h.
2013-08-22 23:46:30 +00:00
Sergio Durigan Junior a5829458a1 Adding missing files from my last commit. 2013-08-22 22:06:11 +00:00
Sergio Durigan Junior 9f94866008 [Committing the `catch syscall' patch for ARM, from Samuel Bronson.]
This time, it passes all the tests and comes with a nearly complete
XML file (plus a script that can nearly regenerate the XML file).

(I elected to leave out __ARM_NR_cmpxchg, since it has dire warnings
to the effect that the only pieces of code that should be aware of it
are the implementation and the __kuser_cmpxchg code in entry-armv.S.)

gdb/
2013-08-14  Samuel Bronson  <naesten@gmail.com>

	ARM Linux support for `catch syscall'.
	* syscalls/arm-linux.py: New file.
	* syscalls/arm-linux.xml: Likewise.
	* arm-linux-tdep.c (arm_linux_get_syscall_number): New function.
	(arm_linux_init_abi): Register the new function and syscall xml file.
	* data-directory/Makefile.in: Install the new syscall xml file.
	* NEWS: Brag about this.

gdb/testsuite/
2013-08-14  Samuel Bronson  <naesten@gmail.com>

	ARM Linux support for `catch syscall'.
	* gdb.base/catch-syscall.exp: Test this on ARM now.
	(fill_all_syscalls_numbers): ARM has close/chroot on 6/61, too.
2013-08-22 20:32:54 +00:00
Tom Tromey e630b97400 fix dwz.exp on 32-bit targets
This fixes dwz.exp on 32-bit targets.  It does so by introducing a new
"default" setting for the address size in the DWARF assembler.

Built and regtested on x86-64 Fedora 18.
I also ran the gdb.dwarf2 tests on an x86 machine (gcc45).

	* lib/dwarf.exp (cu, tu): Handle addr_size of "default".  Change
	default addr_size.
	* lib/gdb.exp (is_64_target): New gdb_caching_proc.
2013-08-22 14:01:04 +00:00
Tom Tromey f3a764545a convert one more caching proc
I noticed that skip_btrace_tests is a classic "caching proc" that I
missed when I added gdb_caching_proc.  This patch converts it.

Built and regtested on x86-64 Fedora 18.

	* lib/gdb.exp (skip_btrace_tests): Use gdb_caching_proc and
	standard_temp_file.
2013-08-22 13:59:55 +00:00
Tom Tromey de5f37e1db fix gdb.arch to be parallel-safe
This fixes parts of gdb.arch to be parallel-safe.
I only changed the bits I could test on this machine.

I don't have access to many of the machines needed to fully switch
gdb.arch; but I am happy to provide advice to others attempting this.
Or, I can send an untested patch to convert it all.

Tested on x86-64 Fedora 18.

	* gdb.arch/amd64-byte.exp: Use standard_testfile,
	clean_restart.
	* gdb.arch/amd64-disp-step.exp: Use standard_testfile.
	* gdb.arch/amd64-dword.exp: Use standard_testfile,
	clean_restart.
	* gdb.arch/amd64-entry-value-param.exp: Use standard_testfile.
	* gdb.arch/amd64-entry-value.exp: Use standard_testfile.
	* gdb.arch/amd64-prologue-xmm.exp: Use standard_testfile.
	* gdb.arch/amd64-word.exp: Use standard_testfile,
	clean_restart.
	* gdb.arch/i386-avx.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-byte.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-disp-step.exp: Use standard_testfile.
	* gdb.arch/i386-dr3-watch.exp: Use standard_testfile.
	* gdb.arch/i386-permbkpt.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-signal.exp: Use standard_testfile.
	* gdb.arch/i386-size-overlap.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-sse.exp: Use standard_testfile, clean_restart.
	* gdb.arch/i386-unwind.exp: Use standard_testfile.
	* gdb.arch/i386-word.exp: Use standard_testfile, clean_restart.
2013-08-22 13:54:15 +00:00
Tom Tromey 8448e842cd fix gdb.python to be parallel-safe
This fixes gdb.python to be parallel-safe, mostly by changing it to
use gdb_remote_download.

Tested on x86-64 Fedora 18.

	* gdb.python/py-error.exp: Use gdb_remote_download.
	* gdb.python/py-mi.exp: Use gdb_remote_download.
	* gdb.python/py-objfile-script.exp: Use standard_output_file.
	* gdb.python/py-prettyprint.exp: Use gdb_remote_download.
	(run_lang_tests): Likewise.
	* gdb.python/py-section-script.c: Use SCRIPT_FILE rather than
	filename.
	* gdb.python/py-section-script.exp: Set SCRIPT_FILE when
	compiling.  Use gdb_remote_download.  Update some tests.
	* gdb.python/py-strfns.exp (test_strfns_core_file): Use
	standard_output_file.
	* gdb.python/py-typeprint.exp: Use gdb_remote_download.
	* gdb.python/py-frame-args.exp: Use gdb_remote_download.
	* gdb.python/py-framefilter-mi.exp: Use gdb_remote_download.
	* gdb.python/py-framefilter.exp: Use gdb_remote_download,
	standard_output_file.
2013-08-22 13:51:08 +00:00
Tom Tromey 16cfcbc202 use standard_temp_file in another caching proc
In an earlier patch I forgot to change the caching proc in cell.exp to
use standard_temp_file.  This fixes the oversight.

Tested on x86-64 Fedora 18.

       * lib/cell.exp (skip_cell_tests): Use standard_temp_file.
2013-08-22 13:46:21 +00:00
Tom Tromey 44ee81740e introduce gdb_remote_download and finish parallel fixes in gdb.dwarf2
This finishes making gdb.dwarf2 parallel-safe.

To do this, this patch introduces a new gdb_remote_download proc, that
works somewhat differently in the one specific case where it matters:
for a copy to "host", if no destination was given, and the host is not
actually remote, then standard_output_file is used.  In parallel mode
this guarantees that the resulting file will end up in a parallel-safe
location.

Tested on x86-64 Fedora 18.

	* gdb.dwarf2/dw2-basic.exp: Use gdb_remote_download.
	* gdb.dwarf2/dw2-compressed.exp: Use gdb_remote_download.
	* gdb.dwarf2/dw2-intercu.exp: Use gdb_remote_download.
	* gdb.dwarf2/dw2-intermix.exp: Use gdb_remote_download.
	* gdb.dwarf2/dw2-producer.exp: Use gdb_remote_download.
	* gdb.dwarf2/mac-fileno.exp: Use gdb_remote_download.
	* lib/gdb.exp (gdb_remote_download): New proc.
2013-08-22 13:44:16 +00:00
Tom Tromey 7a218f8865 fix some gdb.dwarf2 tests for parallel safety
This fixes a few gdb.dwarf2 tests to be more parallel-safe.  This
mostly amounts to changing them to write their files into the
directory designated by standard_output_file.

Built and regtested on x86-64 Fedora 18.

	* gdb.dwarf2/clztest.exp: Use standard_testfile.
	* gdb.dwarf2/dw2-minsym-in-cu.exp: Use standard_testfile.
	* gdb.dwarf2/fission-base.S: Remove directory from
	DW_AT_GNU_dwo_name.
	* gdb.dwarf2/fission-base.exp: Use build_executable.  Set
	debug-file-directory.
	* gdb.dwarf2/fission-reread.S: Remove directory from
	DW_AT_GNU_dwo_name.
	* gdb.dwarf2/fission-reread.exp: Use build_executable.  Set
	debug-file-directory.
2013-08-22 13:39:13 +00:00
Pedro Alves 6be7b56e00 PR gdb/15871: Unavailable entry value is not shown correctly
In entry-values.exp, we have a test where the entry value of 'j' is
unavailable, so it is expected that printing j@entry yields
"<unavailable>".  However, the actual output is:

 (gdb) frame
 #0  0x0000000000400540 in foo (i=0, i@entry=2, j=2, j@entry=<error reading variable: Cannot access memory at address 0x6009e8>)

The error is thrown here:

#0  throw_it (reason=RETURN_ERROR, error=MEMORY_ERROR, fmt=0x8cd550 "Cannot access memory at address %s", ap=0x7fffffffc8e8) at ../../src/gdb/exceptions.c:373
#1  0x00000000005e2f9c in throw_error (error=MEMORY_ERROR, fmt=0x8cd550 "Cannot access memory at address %s") at ../../src/gdb/exceptions.c:422
#2  0x0000000000673a5f in memory_error (status=5, memaddr=6293992) at ../../src/gdb/corefile.c:204
#3  0x0000000000673aea in read_memory (memaddr=6293992, myaddr=0x7fffffffca60 "\200\316\377\377\377\177", len=4) at ../../src/gdb/corefile.c:223
#4  0x00000000006784d1 in dwarf_expr_read_mem (baton=0x7fffffffcd50, buf=0x7fffffffca60 "\200\316\377\377\377\177", addr=6293992, len=4) at ../../src/gdb/dwarf2loc.c:334
#5  0x000000000067645e in execute_stack_op (ctx=0x1409480, op_ptr=0x7fffffffce87 "\237<\005@", op_end=0x7fffffffce88 "<\005@") at ../../src/gdb/dwarf2expr.c:1045
#6  0x0000000000674e29 in dwarf_expr_eval (ctx=0x1409480, addr=0x7fffffffce80 "\003\350\t`", len=8) at ../../src/gdb/dwarf2expr.c:364
#7  0x000000000067c5b2 in dwarf2_evaluate_loc_desc_full (type=0x10876d0, frame=0xd8ecc0, data=0x7fffffffce80 "\003\350\t`", size=8, per_cu=0xf24c40, byte_offset=0)
    at ../../src/gdb/dwarf2loc.c:2236
#8  0x000000000067cc65 in dwarf2_evaluate_loc_desc (type=0x10876d0, frame=0xd8ecc0, data=0x7fffffffce80 "\003\350\t`", size=8, per_cu=0xf24c40)
    at ../../src/gdb/dwarf2loc.c:2407
#9  0x000000000067a5d4 in dwarf_entry_parameter_to_value (parameter=0x13a7960, deref_size=18446744073709551615, type=0x10876d0, caller_frame=0xd8ecc0, per_cu=0xf24c40)
    at ../../src/gdb/dwarf2loc.c:1160
#10 0x000000000067a962 in value_of_dwarf_reg_entry (type=0x10876d0, frame=0xd8de70, kind=CALL_SITE_PARAMETER_DWARF_REG, kind_u=...) at ../../src/gdb/dwarf2loc.c:1310
#11 0x000000000067aaca in value_of_dwarf_block_entry (type=0x10876d0, frame=0xd8de70, block=0xf1c2d4 "Q", block_len=1) at ../../src/gdb/dwarf2loc.c:1363
#12 0x000000000067e7c9 in locexpr_read_variable_at_entry (symbol=0x13a7540, frame=0xd8de70) at ../../src/gdb/dwarf2loc.c:3326
#13 0x00000000005daab6 in read_frame_arg (sym=0x13a7540, frame=0xd8de70, argp=0x7fffffffd0e0, entryargp=0x7fffffffd100) at ../../src/gdb/stack.c:362
#14 0x00000000005db384 in print_frame_args (func=0x13a7470, frame=0xd8de70, num=-1, stream=0xea3890) at ../../src/gdb/stack.c:669
#15 0x00000000005dc338 in print_frame (frame=0xd8de70, print_level=1, print_what=SRC_AND_LOC, print_args=1, sal=...) at ../../src/gdb/stack.c:1199
#16 0x00000000005db8ee in print_frame_info (frame=0xd8de70, print_level=1, print_what=SRC_AND_LOC, print_args=1) at ../../src/gdb/stack.c:851
#17 0x00000000005da2bb in print_stack_frame (frame=0xd8de70, print_level=1, print_what=SRC_AND_LOC) at ../../src/gdb/stack.c:169
#18 0x00000000005de236 in frame_command (level_exp=0x0, from_tty=1) at ../../src/gdb/stack.c:2265

dwarf2_evaluate_loc_desc_full (frame #7) knows to handle
NOT_AVAILABLE_ERROR errors, but read_memory always throws
a generic error.

Presently, only the value machinery knows to handle unavailable
memory.  We need to push the awareness down to the target_xfer layer,
making it return a finer grained error indication.  We can only return
a generic -1 nowadays, which leaves the upper layers with no clue on
why the xfer failed.  Use target_xfer_partial directly, rather than
propagating the error through target_read_memory so as to get a better
address to display in the error message.

(target_read_memory & friends build on top of target_read (thus the
target_xfer machinery), but turn all errors to EIO, an errno value.  I
think this is a mistake, and we'd better convert all these to return a
target_xfer_error too, but that can be done separately.  I looked
around a bit over memory_error calls, and the need to handle random
errno values, other than the EIOs gdb itself hardcodes, probably comes
(only) from deprecated_xfer_memory, which uses errno for error
indication, but I didn't look exhaustively.  We should really get rid
of deprecated_xfer_memory and of passing down errno values as error
indication in target_read & friends methods).

Tested on x86_64 Fedora 17, native and gdbserver.  Fixes the test in
the PR, which will be added to the testsuite later.

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

	PR gdb/15871
	* corefile.c (target_xfer_memory_error): New function.
	(memory_error): Defer EIO to target_memory_error.
	(read_memory): Use target_xfer_partial, and handle finer-grained
	target xfer errors.
	* target.c (target_xfer_error_to_string): New function.
	(memory_xfer_partial_1): If memory is known to be
	unavailable, return TARGET_XFER_E_UNAVAILABLE instead of -1.
	(target_xfer_partial): Make extern.
	* target.h (enum target_xfer_error): New enum.
	(target_xfer_error_to_string): Declare function.
	(target_xfer_partial): Declare function.
	(struct target_ops) <xfer_partial>: Adjust describing comment.
2013-08-22 10:00:05 +00:00
Alan Modra bcbec14ee2 * configure.host: Support powerpc64le-linux and powerpcle-linux hosts.
* configure.tgt: Likewise as targets.
2013-08-22 01:01:32 +00:00
Pedro Alves 329400732e Renegerate gdbserver/config.in.
In:
    gdb/gdbserver/
    2013-07-03  Pedro Alves  <palves@redhat.com>

        * Makefile.in (config.status): Depend on development.sh.
        * acinclude.m4: Include libmcheck.m4.
        * configure: Regenerate.

I missed regenerating config.in...

Tested on x86_64 Fedora 17.

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

	* config.in: Renegerate.
2013-08-21 21:32:42 +00:00
Pedro Alves a261b8f5be Fix whitespace. 2013-08-21 21:31:45 +00:00
Doug Evans fc474241b7 * buildsym.c (subfile_stack): Move here from buildsym.h.
(pending_macros): Ditto.
	(get_macro_table): New function.
	(buildsym_init): Initialize subfile_stack.
	* coffread.c (type_vector,type_vector_length): Moved here from
	buildsym.h.
	(INITIAL_TYPE_VECTOR_LENGTH): Ditto.
	(coff_symtab_read): Use it.
	* dbxread.c (read_ofile_symtab): Delete init of subfile_stack.
	* dwarf2read.c (macro_start_file): Replace uses of pending_macros
	with call to get_macro_table.
	* stabsread.c (type_vector,type_vector_length): Moved here from
	buildsym.h.
	(INITIAL_TYPE_VECTOR_LENGTH): Ditto.
	* buildsym.h (get_macro_table): Declare.
2013-08-20 18:57:00 +00:00
Tom Tromey bec71544ee * dbxread.c (record_minimal_symbol): Make 'name' argument const.
Update.
	(read_dbx_dynamic_symtab): Make 'name' const.  Remove casts.
2013-08-20 18:25:12 +00:00
Doug Evans 0002ad5f45 * blockframe.c: Remove #include "psymtab.h".
* cp-support.c: Ditto.
	* source.c: Ditto.
	* stack.c: Ditto.
2013-08-20 16:30:20 +00:00
Tom Tromey df30244622 fix PR python/15816
This fixes PR python/15816.

The bug here is that python-selftest.exp can fail:

    No symbol "RETURN_MASK_ALL" in current context.

RETURN_MASK_ALL is a macro, so if macros do not end up in the
debuginfo (very typical) then the test fails.

It seemed simplest to me to simply turn the RETURN_MASK_ defines into
enum constants.  This way they end up in the debuginfo and all is
well.

	PR python/15816:
	* exceptions.h (return_mask): Now an enum.
	(RETURN_MASK_QUIT, RETURN_MASK_ERROR, RETURN_MASK_ALL): Now
	enum constants.

Built and regtested on x86-64 Fedora 18.
2013-08-20 15:12:53 +00:00
Tom Tromey df6d544176 move gdbarch object from objfile to per-BFD
This moves the "gdbarch" field from the objfile into the BFD.

This field's value is derived from the BFD and is immutable over the
lifetime of the BFD.  This makes it a reasonable candidate for pushing
into the per-BFD object.

This is part of the long-term objfile splitting project.  In the long
run I think this patch will make it simpler to moves types from the
objfile to the per-BFD object; but the patch makes sense as a minor
cleanup by itself.

Built and regtested on x86-64 Fedora 18.

	* cp-namespace.c (cp_lookup_symbol_imports_or_template): Use
	get_objfile_arch.
	* elfread.c (elf_rel_plt_read, elf_gnu_ifunc_record_cache)
	(elf_gnu_ifunc_resolve_by_got): Use get_objfile_arch.
	* jit.c (jit_object_close_impl): Update.
	* jv-lang.c (get_dynamics_objfile): Update.
	* linespec.c (add_minsym): Use get_dynamics_objfile.
	* objfiles.c (get_objfile_bfd_data): Initialize 'gdbarch' field.
	(allocate_objfile): Don't initialize 'gdbarch' field.
	(get_objfile_arch): Update.
	* objfiles.h (struct objfile_per_bfd_storage) <gdbarch>: New field,
	moved from...
	(struct objfile) <gdbarch>: ... here.  Remove.
	* stap-probe.c (stap_can_evaluate_probe_arguments): Use
	get_objfile_arch.
	* symfile.c (init_entry_point_info): Use get_objfile_arch.
2013-08-20 15:04:51 +00:00
Alan Modra f5aee5eeb8 * doublest.c (convert_floatformat_to_doublest): Use fmt->split_half
for IBM long double nan and inf.
	(floatformat_is_negative, floatformat_classify,
	floatformat_mantissa): Similarly.
	(floatformat_ieee_single, floatformat_ieee_double,
	floatformat_ieee_quad, floatformat_arm_ext,
	floatformat_ia64_spill): Delete unused vars.
	(_initialize_doublest): Delete unused function.
	* gdbtypes.c (floatformats_ibm_long_double): Use new big- and
	little-endian variants of floatformat_ibm_long_double.
2013-08-20 06:42:19 +00:00
Luis Machado 33b60d5831 gdb/
* Makefile.in (SFILES): Remove common/target-common.c and
	add target/waitstatus.c.
	(HFILES_NO_SRCDIR): Remove common/target-common.h and add
	target/resume.h, target/wait.h and target/waitstatus.h.
	(COMMON_OBS): Remove target-common.o and add
	waitstatus.o.
	(target-common.o): Remove.
	(waitstatus.o): New target object file.
	* common/target-common.c: Move contents to
	target/waitstatus.c and remove.
	* common/target-common.h: Move contents to other files and
	remove.
	(enum resume_kind: Move to target/resume.h.
	(TARGET_WNOHANG): Move to target/wait.h.
	(enum target_waitkind): Move to target/waitstatus.h.
	(struct target_waitstatus): Likewise.
	* target.h: Do not include target-common.h and
	include target/resume.h, target/wait.h and
	target/waitstatus.h.
	* target/resume.h: New file.
	* target/wait.h: New file.
	* target/waitstatus.h: New file.
	* target/waitstatus.c: New file.

	gdb/gdbserver/
	* Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
	(SFILES): Remove $(srcdir)/common/target-common.c and
	add $(srcdir)/target/waitstatus.c.
	(OBS): Remove target-common.o and add waitstatus.o.
	(server_h): Remove $(srcdir)/../common/target-common.h and
	add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
	and $(srcdir)/../target/waitstatus.h.
	(target-common.o): Remove.
	(waitstatus.o): New target object file.
	* target.h: Do not include target-common.h and
	include target/resume.h, target/wait.h and
	target/waitstatus.h.
2013-08-19 16:54:11 +00:00
Pedro Alves 12696c1090 linux-nat.c: no need to block child signals so aggressively.
In http://sourceware.org/ml/gdb-patches/2013-08/msg00174.html , the
issue of child signal handling around ptrace option support discovery
being different between GDB and GDBserver came up.

I recalled adding these block_child_signals calls, and the "We don't
want those ptrace calls to be interrupted" comment, but not exactly
why.  So I looked into it.  My first guess is that I got confused.
The patch that added this
<http://sourceware.org/ml/gdb-patches/2009-04/msg00125.html> rewrote
the linux native async support completely, and the old async support
code had the SIGCHLD handler itself do waitpid, so in places that we'd
want a blocking waitpid, we'd have to have the signal handler blocked.
That was probably the mindset I had at the time.  Anyway, whatever the
case, looks like I was wrong on the need for this blocking.
Given GDBserver doesn't block like this, I investigated why this is
currently needed on GDB but not on GDBserver.

I removed the block_child_signals (and restore) calls, and hacked
linux-nat.c to call linux_test_for_tracefork in a loop, like:

 @@ -534,7 +534,10 @@ static int
  linux_supports_tracefork (int pid)
  {
    if (linux_supports_tracefork_flag == -1)
 -    linux_test_for_tracefork (pid);
 +    {
 +      while (1)
 +       linux_test_for_tracefork (pid);
 +    }
    return linux_supports_tracefork_flag;
  }

Running the resulting GDB, I then saw bad things happening.
Specifically, I'd end up with a bunch of zombies, and eventually, the
machine would refuse to spawn new processes, claming insufficient
resources.

The issue is that linux_test_for_tracefork test forks, and has the
child fork again.  If we don't block SIGCHLD on entry to the function,
the children will inherit SIGCHLD's action/disposition (meaning,
SIGCHLD will be unblocked in the child).  When the first child forks
again a second child, and that child exits, the first child gets a
SIGCHLD.  Now, when we try to wrap up for the whole options test, we
kill the first child, and collect the waitstatus.  Here, when SIGCHLD
isn't blocked, GDB will first see the child reporting a stop with
SIGCHLD.  gdbserver's ptrace options test does a PTRACE_KILL loop at
the end, which catches the SIGCHLD, and retries the kill.  The GDB
version did not do that.  So the GDB version would proceed, leaving
the child zombie (until GDB exists), as nothing collected its final
waitstatus.

So this patch makes the GDB version of linux_test_for_tracefork do the
exact same as the GDBserver version, removes all this unnecessary
blocking throughout, and adds a couple comments at places that do need
it -- namely: places where we'll use sleep with sigsuspend; and
linux_async_pipe, as that destroys the pipe the signal handler
touches.

Tested on x86_64 Fedora 17, sync and async.

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

	* linux-nat.c (linux_test_for_tracefork)
	(linux_test_for_tracesysgood, linux_child_follow_fork)
	(lin_lwp_attach_lwp, linux_nat_resume): Don't block child signals.
	(linux_nat_wait_1): Extend comment.
	(linux_async_pipe): Add comment.
2013-08-19 13:44:41 +00:00
Doug Evans 70cc1c235f * lib/prelink-support.exp (prelink_yes): Flag test as unsupported if
prelink complains about an unhandled DWARF version.
2013-08-16 17:44:22 +00:00
Kevin Buettner ba89f962b4 Make RL78_PC_REGNUM a pseudo-register in rl78-tdep.c. 2013-08-16 04:30:23 +00:00
Muhammad Bilal 35ab155d37 2013-08-15 Muhammad Bilal <mbilal@codesourcery.com>
PR cli/15841
	* top.c (quit_force): Skip writing history file
	if input is not from terminal.
2013-08-15 08:18:31 +00:00
Doug Evans 61884d20bc * boards/fission.exp: Add -fdebug-types-section to debug_flags. 2013-08-14 20:39:32 +00:00
Tom Tromey 0d031856d8 move some static thread state into remote_state
This moves a few static variables from thread-info functions into
remote_state.  Pedro said on irc that these functions implement the
ancient thread-discovery method and that he wouldn't be surprised if
they had rotted; nevertheless it seems safer to me to make them
explicitly per-remote.

This necessitated moving a couple of macros and a typedef earlier in
the file.

	* remote.c (struct remote_state) <echo_nextthread, nextthread,
	resultthreadlist>: New fields.
	(OPAQUETHREADBYTES, threadref, MAXTHREADLISTRESULTS): Move earlier.
	(remote_get_threadlist, remote_threadlist_iterator): Use
	new fields.  Remove static variables.
2013-08-14 18:17:50 +00:00
Tom Tromey ee154beebf move remote_stopped_by_watchpoint_p and remote_watch_data_address into remote_state
This moves the globals remote_stopped_by_watchpoint_p and
remote_watch_data_address into remote_state.

	* remote.c (struct remote_state) <remote_stopped_by_watchpoint_p,
	remote_watch_data_address>: New fields.
	(remote_stopped_by_watchpoint_p, remote_watch_data_address): Remove.
	(process_stop_reply, remote_wait_as)
	(remote_check_watch_resources, remote_stopped_data_address): Update.
2013-08-14 18:17:13 +00:00
Tom Tromey 88b496c367 move async_client_callback and async_client_context into remote_state
This moves async_client_callback and async_client_context into
remote_state.

	* remote.c (struct remote_state) <async_client_callback,
	async_client_context>: New fields.
	(async_client_callback, async_client_context): Remove.
	(remote_async_serial_handler, remote_async): Update.
2013-08-14 18:16:30 +00:00
Tom Tromey 2f65bcb75d move sizeof_pkt into remote_trace_find
The global sizeof_pkt is only used in remote_trace_find, like so:

  reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt);

I think in this situation it is more correct to use the recorded size
of the buffer.  Otherwise it seems that some skew could result.

	* remote.c (sizeof_pkt): Remove.
	(remote_trace_find): Use rs->buf_size, not sizeof_pkt.
2013-08-14 18:15:48 +00:00
Tom Tromey b80fafe375 move use_threadinfo_query and use_threadextra_query into struct remote_state
This moves the use_threadextra_query and use_threadinfo_query globals
into remote_state.

	* remote.c (struct remote_state) <use_threadinfo_query,
	use_threadextra_query>: New fields.
	(remote_threads_info, remote_threads_extra_info)
	(remote_open_1): Update.
2013-08-14 18:15:01 +00:00
Tom Tromey 8e88304f57 move some statics from remote_read_qxfer into struct remote_state
This moves a few static variables out of remote_read_qxfer and into
remote_state.

	* remote.c (struct remote_state) <finished_object,
	finished_annex, finished_offset>: New fields.
	(remote_read_qxfer): Use remote_state fields; remove static
	variables.
2013-08-14 18:08:48 +00:00
Tom Tromey 280ceea309 push last_sent_step into struct remote_state
This moves the global last_sent_step into remote_state.

	* remote.c (struct remote_state) <last_sent_step>:
	New field.
	(last_sent_step): Remove.
	(remote_resume, remote_wait_as): Update.
2013-08-14 18:07:45 +00:00
Tom Tromey b73be47123 push last_sent_signal into struct remote_state
This moves the global last_sent_signal into remote_state.

	* remote.c (struct remote_state) <last_sent_signal>:
	New field.
	(last_sent_signal): Remove.
	(new_remote_state, remote_resume, remote_wait_as): Update.
2013-08-14 18:06:49 +00:00
Tom Tromey 5e4a05c431 push last_program_signals_packet into struct remote_state
This moves the global last_program_signals_packet into remote_state.

	* remote.c (struct remote_state) <last_program_signals_packet>:
	New field.
	(last_program_signals_packet): Remove.
	(remote_program_signals, remote_open_1): Update.
2013-08-14 18:05:51 +00:00
Tom Tromey 747dc59d20 push last_pass_packet into struct remote_state
This moves the global last_pass_packet into remote_state.

	* remote.c (struct remote_state) <last_pass_packet>:
	New field.
	(last_pass_packet): Remove.
	(remote_pass_signals, remote_open_1): Update.
2013-08-14 18:04:52 +00:00
Tom Tromey 262e11744a push remote_traceframe_number into struct remote_state
This moves the global remote_traceframe_number into remote_state.

	* remote.c (struct remote_state) <remote_traceframe_number>:
	New field.
	(remote_traceframe_number): Remove.
	(new_remote_state, remote_open_1, set_remote_traceframe)
	(remote_trace_find): Update.
2013-08-14 18:03:50 +00:00