Commit Graph

83410 Commits

Author SHA1 Message Date
GDB Administrator dc081549e7 Automatic date update in version.in 2015-04-07 00:00:10 +00:00
Rafael Ávila de Espíndola 7fa5525f8e Fix the signature of a virtual method to match the one in the parent class. 2015-04-06 15:49:50 -04:00
Rafael Ávila de Espíndola 5368dcf2ba Avoid a call to find by using the return value of insert. 2015-04-06 15:46:30 -04:00
Rafael Ávila de Espíndola 9dbb4b021d Avoid a copy constructor call. 2015-04-06 15:39:42 -04:00
H.J. Lu dae148f3b9 Remove is_zlib_supported
Since zlib is always supported, there is no need for is_zlib_supported.

binutils/testsuite/

	* binutils-all/compress.exp: Remove is_zlib_supported check.
	* binutils-all/objdump.exp: Likewise.
	* binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise.
	* lib/utils-lib.exp (run_dump_test): Likewise.
	* lib/binutils-common.exp (is_zlib_supported): Removed.

gas/testsuite/

	* lib/gas-defs.exp (run_dump_test): Remove is_zlib_supported check.

ld/testsuite/

	* ld-elf/compress.exp: Remove is_zlib_supported check.
	Fail if --compress-debug-sections doesn't work.
	* lib/ld-lib.exp (run_dump_test): Remove is_zlib_supported check.
2015-04-06 12:19:13 -07:00
Ilya Tocar bf890a93a7 x86: Use individual prefix control for each opcode.
2015-04-06  Ilya Tocar  <ilya.tocar@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* i386-dis-evex.h (evex_table): Fill prefix_requirement field.
	* i386-dis.c (PREFIX_MANDATORY_REPZ, PREFIX_MANDATORY_REPNZ,
	PREFIX_MANDATORY_DATA, PREFIX_MANDATORY_ADDR, PREFIX_MANDATORY_LOCK,
	PREFIX_UD_SHIFT, PREFIX_UD_REPZ, REFIX_UD_REPNZ, PREFIX_UD_DATA,
	PREFIX_UD_ADDR, PREFIX_UD_LOCK, PREFIX_OPTIONAL, PREFIX_MANDATORY):
	Define.
	(Bad_Opcode, FLOAT, DIS386, DIS386_PREFIX, THREE_BYTE_TABLE_PREFIX):
	Fill prefix_requirement field.
	(struct dis386): Add prefix_requirement field.
	(dis386): Fill prefix_requirement field.
	(dis386_twobyte): Ditto.
	(twobyte_has_mandatory_prefix_: Remove.
	(reg_table): Fill prefix_requirement field.
	(prefix_table): Ditto.
	(x86_64_table): Ditto.
	(three_byte_table): Ditto.
	(xop_table): Ditto.
	(vex_table): Ditto.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(mod_table): Ditto.
	(bad_opcode): Ditto.
	(print_insn): Use prefix_requirement.
	(FGRPd9_2, FGRPd9_4, FGRPd9_5, FGRPd9_6, FGRPd9_7, FGRPda_5, FGRPdb_4,
	FGRPde_3, FGRPdf_4): Fill prefix_requirement field.
	(float_reg): Ditto.
2015-04-06 19:33:01 +03:00
H.J. Lu 4aa90cc007 Use bfd_putb64/bfd_getb64
bfd/

	* compress.c (get_uncompressed_size): Removed.
	(bfd_compress_section_contents): Use bfd_putb64 to write
	uncompressed section size.
	(bfd_init_section_decompress_status): Replace
	get_uncompressed_size with bfd_getb64.

gas/

	* write.c (compress_debug): Use bfd_putb64 to write uncompressed
	section size.
2015-04-06 09:02:52 -07:00
H.J. Lu fd5136e57c Remove "/dev/null" from remote_exec
We should catch all errors/warnings from cmp.

	* binutils-all/compress.exp (compression_used): Remove "/dev/null"
	from remote_exec.
2015-04-06 09:02:52 -07:00
Doug Evans 85317fbbca Add testcase for stub-method reading in stabs.
This patch is based on the testcase provided here:
https://sourceware.org/ml/gdb-patches/2015-02/msg00181.html

I've verified that it catches the internal error discovered here:
https://sourceware.org/ml/gdb-patches/2015-02/msg00139.html

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (clean_restart): Return result of gdb_load.
	* gdb.pascal/stub-method.exp: New file.
	* gdb.pascal/stub-method.pas: New file.
2015-04-06 08:59:58 -07:00
Doug Evans 01b622d4c7 * lib/pascal.exp (gpc_compile): Rename dest arg to destfile.
The "dest" parameter to fpc_compile/gpc_compile is the name of
compilation destination file, not a board name.

This patch fixes this by using names consistent with
lib/future.exp:gdb_default_target_compile.

gdb/testsuite/ChangeLog:

	* lib/pascal.exp (gpc_compile): Rename dest arg to destfile.
	Fix dest parameter to board_info.
	(fpc_compile): Ditto.
	(gdb_compile_pascal): Rename dest arg to destfile.
2015-04-06 08:45:06 -07:00
Doug Evans 2c26b84f45 symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as VAR_DOMAIN.
gdb/ChangeLog:

	* symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as
	VAR_DOMAIN.
	(symbol_cache_lookup): Clarify use of bsc_ptr, slot_ptr parameters.
	Include symbol domain in debugging output.
2015-04-06 08:31:46 -07:00
Pedro Alves 7a85168daf Fallback to stub-termcap.c on all hosts
Currently building gdb is impossible without an installed termcap or
curses library.  But, GDB already has a very minimal termcap in the
tree to handle this situation for Windows -- gdb/stub-termcap.c.  This
patch makes that the fallback for all hosts.

Testing this on GNU/Linux (by simply hacking away the termcap/curses
detection in gdb/configure.ac), we trip on:

 ../readline/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
 /home/pedro/gdb/mygit/src/readline/terminal.c:527: undefined reference to `PC'
 /home/pedro/gdb/mygit/src/readline/terminal.c:528: undefined reference to `BC'
 /home/pedro/gdb/mygit/src/readline/terminal.c:529: undefined reference to `UP'
 /home/pedro/gdb/mygit/src/readline/terminal.c:538: undefined reference to `PC'
 /home/pedro/gdb/mygit/src/readline/terminal.c:539: undefined reference to `BC'
 /home/pedro/gdb/mygit/src/readline/terminal.c:540: undefined reference to `UP'

These are globals that are normally defined by termcap (or ncurses'
termcap emulation).

Now, we could just define replacements in stub-termcap.c, but
readline/terminal.c (at least the copy in our tree) has this:

 #if !defined (__linux__) && !defined (NCURSES_VERSION)
 #  if defined (__EMX__) || defined (NEED_EXTERN_PC)
 extern
 #  endif /* __EMX__ || NEED_EXTERN_PC */
 char PC, *BC, *UP;
 #endif /* !__linux__ && !NCURSES_VERSION */

which can result in readline defining the globals too.  That will
usually work out in C, given that "-fcommon" is usually the default
for C compilers, but that won't work for C++, or C with -fno-common
(link fails with "multiple definition" errors)...

Mirroring those #ifdef conditions in the stub termcap screams
"brittle" to me -- I can see them changing in latter readline
versions.

Work around that by simply using __attribute__((weak)).
Windows/PE/COFF's do support weak, but not on gcc 3.4 based toolchains
(4.8.x does work).  Given the file never needed the variables while it
was Windows-only, just continue not defining them there.  All other
supported hosts should support this.

gdb/ChangeLog:
2015-04-06  Pedro Alves  <palves@redhat.com>
	    Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* configure.ac: Remove the mingw32-specific stub-termcap.o
	fallback, and instead fallback to the stub termcap on all hosts.
	* configure: Regenerate.
	* stub-termcap.c [!__MINGW32__] (PC, BC, UP): Define as weak
	symbols.
2015-04-06 12:35:18 +01:00
Ilya Tocar 1fa29f1060 [Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg
2015-04-06  Ilya Tocar  <ilya.tocar@intel.com>

	PR gold/17641
	* x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
	(Target_x86_64::Scan::local): Don't create GOT entry, when we
	can convert mov to lea.
	(Target_x86_64::Scan::global): Ditto.
	(Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
	%reg to lea foo(%rip), %reg if possible.
	* testsuite/Makefile.am (x86_64_mov_to_lea): New test.
	* testsuite/x86_64_mov_to_lea1.s: New.
	* testsuite/x86_64_mov_to_lea2.s: Ditto.
	* testsuite/x86_64_mov_to_lea3.s: Ditto.
	* testsuite/x86_64_mov_to_lea4.s: Ditto.
	* testsuite/x86_64_mov_to_lea.sh: Ditto.
---
2015-04-06 12:37:34 +03:00
GDB Administrator cbaa2d7097 Automatic date update in version.in 2015-04-06 00:00:07 +00:00
H.J. Lu 77115a4a15 Add SHF_COMPRESSED support to readelf
This patch updates readelf to dump compression header with

readelf -S -W:

  [ 4] .debug_info PROGBITS  00000000 000038 00007d 00   C 0   0  1

readelf -t -W:

  [ 4] .debug_info
       PROGBITS        00000000 000038 00007d 00   0   0  1
       [00000800]: COMPRESSED
       ZLIB, 0000009d, 1

It also checks the compression header when decompressing the compressed
section.

	* readelf.c (get_elf_section_flags): Support SHF_COMPRESSED.
	(get_compression_header): New.
	(process_section_headers): Dump compression header if needed.
	(uncompress_section_contents): Don't free compressed_buffer here.
	(load_specific_debug_section): Free the compressed buffer, update
	the section buffer and the section size if uncompress is
	successful.
2015-04-05 09:29:57 -07:00
H.J. Lu 317974f683 Xfail the compressed debug sections
There is no need to generate compressed debug section if compressed
section size is the same as before compression.  We should xfail the
compressed debug section test if there are no compressed sections

binutils/testsuite/

	* binutils-all/compress.exp (compression_used): New.
	Xfail test if compression didn't make the section smaller.

gas/

2015-04-05  H.J. Lu  <hongjiu.lu@intel.com>

	* write.c (compress_debug): Don't write the zlib header if
	compressed section size is the same as before compression.
2015-04-05 08:15:35 -07:00
Mike Frysinger 20cc975360 sim: moxie: fix running after nrun conversion
The nrun conversion was slightly incorrect in how it stopped when an
exception occurred.  We still set cpu.asregs.exception, but nothing
was checking it anymore.  Convert all of that to sim_engine_halt.

To keep things from regressing again, add a basic testsuite too.
2015-04-05 04:37:44 -04:00
Mike Frysinger 024305f7f2 sim: mn10300: add a basic testsuite 2015-04-05 03:52:08 -04:00
Mike Frysinger aad84fa6ae sim: m68hc11: add a basic testsuite 2015-04-05 03:17:44 -04:00
Mike Frysinger eed64ce675 sim: iq2000: add a basic testsuite 2015-04-05 02:28:44 -04:00
Mike Frysinger e56dbbb92f sim: lm32: add a basic testsuite 2015-04-05 01:58:00 -04:00
GDB Administrator 1d2d99379e Automatic date update in version.in 2015-04-05 00:00:08 +00:00
H.J. Lu 68f5ff89ed Also preserve the SHF_COMPRESSED bit
For objcopy and relocatable link, we should also preserve the
SHF_COMPRESSED bit if not decompress.

	* elf.c (_bfd_elf_init_private_section_data): Also preserve the
	SHF_COMPRESSED bit if not decompress.
2015-04-04 08:01:54 -07:00
H.J. Lu 906bacc0ea Replace uncompressed_size_buffer with compressed_size_buffer 2015-04-04 07:52:55 -07:00
H.J. Lu 8bed4e0f7b Extract get_uncompressed_size
* compress.c (get_uncompressed_size): New.  Extracted from ...
	(bfd_init_section_decompress_status): This.  Use it.
2015-04-04 07:49:35 -07:00
H.J. Lu e268c0a63c Add a dw2-3.S test
This patch adds a dw2-3.S test for upcoming SHF_COMPRESSED test. The
existing dw2-1.S/dw2-2.S tests generate non-compressed debug sections
for SHF_COMPRESSED since SHF_COMPRESSED compressed debug sections are
bigger.

	* binutils-all/compress.exp (testfile): Remove suffix.
	(compressedfile): Likewise.
	(compressedfile2): Likewise.
	(libfile): Likewise.
	(testfile3): New.
	(compressedfile3): Likewise.
	Updated.
	Add a dw2-3.S test.
	* binutils-all/dw2-3.S: New file.
	* binutils-all/dw2-3.W: Likewise.
2015-04-04 07:34:25 -07:00
GDB Administrator af72fdacfd Automatic date update in version.in 2015-04-04 00:00:07 +00:00
H.J. Lu 6aa7612029 Add Elf_Internal_Chdr and ElfXX_External_Chdr
* external.h (Elf32_External_Chdr): New.
	(Elf64_External_Chdr): Likewise.
	* internal.h (Elf_Internal_Chdr): Likewise.
2015-04-03 12:50:10 -07:00
Pierre-Marie de Rodat 25755e2b85 gdbtypes.c: remove the usuned "top_level" parameter
This paramater is no longer useful after the previous commit, so remove
it as a cleanup.

gdb/ChangeLog:

	* gdbtypes.c (is_dynamic_type_internal): Remove the unused
	"top_level" parameter.
	(resolve_dynamic_type_internal): Remove the unused "top_level"
	parameter.  Update call to is_dynamic_type_internal.
	(is_dynamic_type): Update call to is_dynamic_type_internal.
	(resolve_dynamic_range): Update call to
	resolve_dynamic_type_internal.
	(resolve_dynamic_union): Likewise.
	(resolve_dynamic_struct): Likewise.
	(resolve_dynamic_type): Likewise.
2015-04-03 15:23:49 +02:00
Pierre-Marie de Rodat 961f416025 Do not consider reference types as dynamic
Even when referenced types are dynamic, the corresponding referencing
type should not be considered as dynamic: it's only a pointer.  This
prevents reference type for values not in memory to be resolved.

gdb/ChangeLog:

	* gdbtypes.c (is_dynamic_type_internal): Remove special handling
	of TYPE_CODE_REF types so that they are not considered as
	dynamic depending on the referenced type.
	(resolve_dynamic_type_internal): Likewise.

gdb/testsuite/ChangeLog:

	* gdb.ada/funcall_ref.exp: New file.
	* gdb.ada/funcall_ref/foo.adb: New file.
2015-04-03 15:23:49 +02:00
H.J. Lu cbf0179287 Make is_zlib_supported always return 1
* lib/binutils-common.exp (is_zlib_supported): Always return 1.
2015-04-03 04:03:07 -07:00
Mike Frysinger b366059a5b sim: d10v: fix signal updates
Way back in aba6488e0b, a bunch of signal
defines were changed to TARGET_SIGNAL_xxx.  For d10v, the transition was
incomplete which lead to sim_stop_reason using the new set but sim_resume
still using the old set.  Which meant in some cases, the sim would never
actually stop.

Convert all the remaining SIGxxx defines in here to TARGET_SIGNAL_xxx.
This has the nice side effect of fixing the testsuite.
2015-04-02 20:40:11 -04:00
GDB Administrator ef6f73553e Automatic date update in version.in 2015-04-03 00:00:07 +00:00
Nick Clifton f66adc4ead Second fix for microblaze gas port's ability to parse constants.
PR gas/18189
	* config/tc-microblaze.c (parse_imm): Use offsetT as the type for
	min and max parameters.  Sign extend values before testing.
2015-04-02 17:13:12 +01:00
Nick Clifton 03e080386e Fixes a bug in the microblaze assembler where it would not complain about constants larger than 32-bits.
PR gas/18189
	* config/tc-microblaze.c (parse_imm): Use offsetT as the type for
	min and max parameters.
2015-04-02 16:10:06 +01:00
Nick Clifton 4295609462 Fix the binutils readelf.ss test for the AArch64 target.
* binutils-all/readelf.ss-64: Move possible location of the $d
	mapping symbol.
2015-04-02 15:28:02 +01:00
Andrew Turner 15c7659fd1 Add support for configuring an aarch64-freebsd target.
ld	* Makefile.am: Add FreeBSD aarch64 files.
	* Makefile.in: Regenerate.
	* configure.tgt: Add aarch64-*-freebsd* target triple.
	* emulparams/aarch64fbsd.sh: New file.
	* emulparams/aarch64fbsdb.sh: New file.

bfd	* config.bfd: Add aarch64-*-freebsd* target triple.
2015-04-02 15:07:27 +01:00
Renlin Li c1baaddf88 [AArch64] Emit DATA_MAP in order within text section
2015-03-27  Renlin Li  <renlin.li@arm.com>

gas/
  * config/tc-aarch64.c (mapping_state): Emit MAP_DATA within text section in order.
  (mapping_state_2): Don't emit MAP_DATA here.
  (s_aarch64_inst): Align frag during state transition.
  (md_assemble): Likewise.
2015-04-02 14:59:45 +01:00
Ed Maste 726e626a7b Remove unused functions in tc-aarch64.c.
* config/tc-aarch64.c (set_error_kind): Delete.
	(set_error_message): Delete.
2015-04-02 14:44:59 +01:00
Yao Qi cafda5977a kfail two tests in no-unwaited-for-left.exp for remote target
I see these two fails in no-unwaited-for-left.exp in remote testing
for aarch64-linux target.

...
continue
Continuing.
warning: Remote failure reply: E.No unwaited-for children left.

[Thread 1084] #2 stopped.
(gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when thread 2 exits

....
continue
Continuing.
warning: Remote failure reply: E.No unwaited-for children left.

[Thread 1081] #1 stopped.
(gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when the main thread exits

I checked the gdb.log on buildbot, and find that these two fails also
appear on Debian-i686-native-extended-gdbserver and Fedora-ppc64be-native-gdbserver-m64.
I recall that they are about local/remote parity, and related RSP is missing.
There has been already a PR 14618 about it.  This patch is to kfail them
on remote target.

gdb/testsuite:

2015-04-02  Yao Qi  <yao.qi@linaro.org>

	* gdb.threads/no-unwaited-for-left.exp: Set up kfail if target
	is remote.
2015-04-02 13:51:31 +01:00
H.J. Lu 39f3de7c43 Regenerate configure in bfd/binutils/gas/gdb/gold
bfd/

	* configure: Regenerated.

binutils/

	* configure: Regenerated.

gas/

	* configure: Regenerated.

gdb/

	* Makefile.in (top_srcdir): New.
	* configure: Regenerated.

gold/

	* configure: Regenerated.
2015-04-02 05:45:03 -07:00
H.J. Lu 7fed4b0be6 Regenerate configure in sim
* arm/configure: Regenerated.
	* avr/configure: Likewise.
	* bfin/configure: Likewise.
	* common/configure: Likewise.
	* cr16/configure: Likewise.
	* cris/configure: Likewise.
	* d10v/configure: Likewise.
	* erc32/configure: Likewise.
	* frv/configure: Likewise.
	* ft32/configure: Likewise.
	* h8300/configure: Likewise.
	* igen/configure: Likewise.
	* iq2000/configure: Likewise.
	* lm32/configure: Likewise.
	* m32c/configure: Likewise.
	* m32r/configure: Likewise.
	* m68hc11/configure: Likewise.
	* mcore/configure: Likewise.
	* microblaze/configure: Likewise.
	* mips/configure: Likewise.
	* mn10300/configure: Likewise.
	* moxie/configure: Likewise.
	* msp430/configure: Likewise.
	* ppc/configure: Likewise.
	* rl78/configure: Likewise.
	* rx/configure: Likewise.
	* sh/configure: Likewise.
	* sh64/configure: Likewise.
	* v850/configure: Likewise.
2015-04-02 05:43:07 -07:00
H.J. Lu df7f7547a5 Set zlibdir/zlibinc with top_builddir/top_srcdir
* zlib.m4 (AM_ZLIB): Set zlibdir to -L\$(top_builddir)/../zlib
	and set zlibinc to -I\$(top_srcdir)/../zlib.
2015-04-02 05:43:07 -07:00
Gary Benson 599bd15cda Document "target:" sysroot changes
This commit documents the newly added "target:" sysroot feature.

gdb/ChangeLog:

	* NEWS: Announce the new default sysroot of "target:".

gdb/doc/ChangeLog:

	* gdb.texinfo (set sysroot): Document "target:".
2015-04-02 13:38:29 +01:00
Gary Benson fed040c6a5 Make the default sysroot be "target:"
This commit makes GDB default to a sysroot of "target:".
One testcase needed updating as a result of this change.

gdb/ChangeLog:

	* main.c (captured_main): Set gdb_sysroot to "target:"
	if not otherwise set.

gdb/testsuite/ChangeLog:

	* gdb.base/break-probes.exp: Cope with "target:" sysroot.
2015-04-02 13:38:29 +01:00
Gary Benson 64c0b5de8d Update exec_file_attach to cope with "target:" filenames
This commit adds support for filenames prefixed	with "target:" to
exec_file_attach.  This is required to correctly follow inferior
exec* calls when a gdb_sysroot prefixed with "target:" is set.

gdb/ChangeLog:

	* exec.c (exec_file_attach): Support "target:" filenames.
2015-04-02 13:38:29 +01:00
Gary Benson b57fbfba4b Strip "target:" prefix in solib_find if accessing local files
This commit updates solib_find to strip the "target:" prefix from
gdb_sysroot when accessing local files.  This ensures that the same
search algorithm is used for local files regardless of whether a
"target:" prefix was used or not.  It also avoids cluttering GDB's
output with unnecessary "target:" prefixes on paths.

gdb/ChangeLog:

	* solib.c (solib_find): Strip "target:" prefix from sysroot
	if accessing local files.
2015-04-02 13:38:29 +01:00
Gary Benson 97a41605e2 Rearrange symfile_bfd_open
symfile_bfd_open handled what were remote files as a special case.
Converting from "remote:" files to "target:" made symfile_bfd_open
look like this:

  if remote:
    open bfd, check format, etc
    return
  local-specific stuff
  open bfd, check format, etc
  return

This commit rearranges symfile_bfd_open to remove the duplicated
code, like this:

  if local:
      local-specific stuff
  open bfd, check format, etc
  return

gdb/ChangeLog:

	* symfile.c (symfile_bfd_open): Reorder to remove duplicated
	checks and error messages.
2015-04-02 13:38:29 +01:00
Gary Benson 2938e6cf08 Convert "remote:" sysroots to "target:" and remove "remote:"
The functionality of "target:" sysroots is a superset of the
functionality of "remote:" sysroots.  This commit causes the
"set sysroot" command to rewrite "remote:" sysroots as "target:"
sysroots and replaces "remote:" specific code with "target:"
specific code where still necessary.

gdb/ChangeLog:

	* remote.h (REMOTE_SYSROOT_PREFIX): Remove definition.
	(remote_filename_p): Remove declaration.
	(remote_bfd_open): Likewise.
	* remote.c (remote_bfd_iovec_open): Remove function.
	(remote_bfd_iovec_close): Likewise.
	(remote_bfd_iovec_pread): Likewise.
	(remote_bfd_iovec_stat): Likewise.
	(remote_filename_p): Likewise.
	(remote_bfd_open): Likewise.
	* symfile.h (gdb_bfd_open_maybe_remote): Remove declaration.
	* symfile.c (separate_debug_file_exists): Use gdb_bfd_open.
	(gdb_bfd_open_maybe_remote): Remove function.
	(symfile_bfd_open):  Replace remote filename check with
	target filename check.
	(reread_symbols): Use gdb_bfd_open.
	* build-id.c (gdbcore.h): New include.
	(build_id_to_debug_bfd): Use gdb_bfd_open.
	* infcmd.c (attach_command_post_wait): Remove remote filename
	check.
	* solib.c (solib_find): Replace remote-specific handling with
	target-specific handling.  Update comments where necessary.
	(solib_bfd_open): Replace remote-specific handling with
	target-specific handling.
	(gdb_sysroot_changed): New function.
	(_initialize_solib): Call the above when gdb_sysroot changes.
	* windows-tdep.c (gdbcore.h): New include.
	(windows_xfer_shared_library): Use gdb_bfd_open.
2015-04-02 13:38:29 +01:00
Gary Benson f08e97fed1 Make gdb_bfd_open able to open BFDs using target fileio
This commit updates gdb_bfd_open to access files using target
fileio functions if the supplied path starts with "target:"
and if the local and target filesystems are not the same.
This allows users to specify "set sysroot target:" and have
GDB access files locally or from the remote as appropriate.

The new functions in gdb_bfd.c are copies of functions from
remote.c. This duplication is intentional and will be removed
by the next commit in this series.

gdb/ChangeLog:

	* gdb/gdb_bfd.h (TARGET_SYSROOT_PREFIX): New definition.
	(is_target_filename): New declaration.
	(gdb_bfd_has_target_filename): Likewise.
	(gdb_bfd_open): Update documentation comment.
	* gdb_bfd.c (target.h): New include.
	(gdb/fileio.h): Likewise.
	(is_target_filename): New function.
	(gdb_bfd_has_target_filename): Likewise.
	(fileio_errno_to_host): Likewise.
	(gdb_bfd_iovec_fileio_open): Likewise.
	(gdb_bfd_iovec_fileio_pread): Likewise.
	(gdb_bfd_iovec_fileio_close): Likewise.
	(gdb_bfd_iovec_fileio_fstat): Likewise.
	(gdb_bfd_open): Use target fileio to access paths prefixed
	with "target:" where necessary.
2015-04-02 13:38:29 +01:00