H.J. Lu [Wed, 8 Apr 2015 17:27:55 +0000 (10:27 -0700)]
Add SHF_COMPRESSED and ELFCOMPRESS_XXX to elfcpp.h
* elfcpp.h (SHF): Add SHF_COMPRESSED.
(ELFCOMPRESS_ZLIB): New.
(ELFCOMPRESS_LOOS): Likewise.
(ELFCOMPRESS_HIOS): Likewise.
(ELFCOMPRESS_LOPROC): Likewise.
(ELFCOMPRESS_HIPROC): Likewise.
H.J. Lu [Wed, 8 Apr 2015 16:46:50 +0000 (09:46 -0700)]
Skip empty EMULATION_NAME
* emulparams/elf32bmipn32-defs.sh: Skip empty EMULATION_NAME.
H.J. Lu [Wed, 8 Apr 2015 16:25:08 +0000 (09:25 -0700)]
Work around a GCC uninitialized warning bug
* compress.c (bfd_compress_section_contents): Work around a GCC
uninitialized warning bug fixed in GCC 4.7.
Yao Qi [Wed, 8 Apr 2015 15:04:07 +0000 (16:04 +0100)]
[spu] Don't call set_gdbarch_cannot_step_breakpoint in spu_gdbarch_init
Nowadays, in infrun.c:resume, the setting to 'step' variable is like:
if (use_displaced_stepping (gdbarch)
&& tp->control.trap_expected
&& sig == GDB_SIGNAL_0
&& !current_inferior ()->waiting_for_vfork_done)
{
}
/* Do we need to do it the hard way, w/temp breakpoints? */
else if (step)
step = maybe_software_singlestep (gdbarch, pc); <-- [1]
...
if (execution_direction != EXEC_REVERSE
&& step && breakpoint_inserted_here_p (aspace, pc))
{
...
if (gdbarch_cannot_step_breakpoint (gdbarch)) <-- [2]
step = 0;
}
spu doesn't have displaced stepping and uses software single step,
so 'step' is set to zero in [1], and [2] becomes unreachable as a
result. So don't have to call set_gdbarch_cannot_step_breakpoint
in spu_gdbarch_init.
gdb:
2015-04-08 Yao Qi <yao.qi@linaro.org>
* spu-tdep.c (spu_gdbarch_init): Don't call
set_gdbarch_cannot_step_breakpoint.
H.J. Lu [Wed, 8 Apr 2015 14:53:54 +0000 (07:53 -0700)]
Add SHF_COMPRESSED support to gas and objcopy
This patch adds --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}
options to gas and objcopy for ELF files. They control how DWARF debug
sections are compressed. --compress-debug-sections=none is equivalent to
--nocompress-debug-sections. --compress-debug-sections=zlib and
--compress-debug-sections=zlib-gnu are equivalent to
--compress-debug-sections. --compress-debug-sections=zlib-gabi compresses
DWARF debug sections with SHF_COMPRESSED from the ELF ABI. No linker
changes are required to support SHF_COMPRESSED.
bfd/
* archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
bit.
* bfd.c (bfd::flags): Increase size to 18 bits.
(BFD_COMPRESS_GABI): New.
(BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
(BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
(bfd_update_compression_header): New fuction.
(bfd_check_compression_header): Likewise.
(bfd_get_compression_header_size): Likewise.
(bfd_is_section_compressed_with_header): Likewise.
* compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
(bfd_compress_section_contents): Return the uncompressed size if
the full section contents is compressed successfully. Support
converting from/to .zdebug* sections.
(bfd_get_full_section_contents): Call
bfd_get_compression_header_size to get compression header size.
(bfd_is_section_compressed): Renamed to ...
(bfd_is_section_compressed_with_header): This. Add a pointer
argument to return compression header size.
(bfd_is_section_compressed): Use it.
(bfd_init_section_decompress_status): Call
bfd_get_compression_header_size to get compression header size.
Return FALSE if uncompressed section size is 0.
* elf.c (_bfd_elf_make_section_from_shdr): Support converting
from/to .zdebug* sections.
* bfd-in2.h: Regenerated.
binutils/
* objcopy.c (do_debug_sections): Add compress_zlib,
compress_gnu_zlib and compress_gabi_zlib.
(copy_options): Use optional_argument on compress-debug-sections.
(copy_usage): Update --compress-debug-sections.
(copy_file): Handle compress_zlib, compress_gnu_zlib and
compress_gabi_zlib.
(copy_main): Handle
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* doc/binutils.texi: Document
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
binutils/testsuite/
* compress.exp: Add tests for
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* binutils-all/dw2-3.rS: New file.
* binutils-all/dw2-3.rt: Likewise.
* binutils-all/libdw2-compressedgabi.out: Likewise.
gas/
* as.c (show_usage): Update --compress-debug-sections.
(std_longopts): Use optional_argument on compress-debug-sections.
(parse_args): Handle
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* as.h (compressed_debug_section_type): New.
(flag_compress_debug): Change type to compressed_debug_section_type.
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
* write.c (compress_debug): Set BFD_COMPRESS_GABI for
--compress-debug-sections=zlib-gabi. Call
bfd_get_compression_header_size to get compression header size.
Don't rename section name for --compress-debug-sections=zlib-gabi.
* config/tc-i386.c (compressed_debug_section_type): Set to
COMPRESS_DEBUG_ZLIB.
* doc/as.texinfo: Document
--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
gas/testsuite/
* gas/i386/dw2-compressed-1.d: New file.
* gas/i386/dw2-compressed-2.d: Likewise.
* gas/i386/dw2-compressed-3.d: Likewise.
* gas/i386/x86-64-dw2-compressed-2.d: Likewise.
* gas/i386/i386.exp: Run dw2-compressed-2, dw2-compressed-1,
dw2-compressed-3 and x86-64-dw2-compressed-2.
ld/testsuite/
* ld-elf/compress.exp: Add a test for
--compress-debug-sections=zlib-gabi.
(build_tests): Add 2 tests for --compress-debug-sections=zlib-gabi.
(run_tests): Likewise.
Verify linker output with zlib-gabi compressed debug input.
* ld-elf/compressed1a.d: New file.
* ld-elf/compressed1b.d: Likewise.
* ld-elf/compressed1c.d: Likewise.
H.J. Lu [Wed, 8 Apr 2015 12:04:13 +0000 (05:04 -0700)]
Display --interleave[=<number>]
Optional argument of a command line option must start with "=".
* objcopy.c (copy_usage): Replace "--interleave [<number>]" with
--interleave[=<number>].
H.J. Lu [Wed, 8 Apr 2015 11:55:07 +0000 (04:55 -0700)]
Add ld_list_options
This patch adds ld_list_options for ELF targets to avoid duplicated
outputs from ld --help.
* Makefile.am (ELF_CLFAGS): New.
(AM_CFLAGS): Add $(ELF_CLFAGS).
* configure.ac (elf_list_options): New. AC_SUBST.
(elf_shlib_list_options): Likewise.
(elf_plt_unwind_list_options): Likewise.
* lexsup.c (elf_shlib_list_options): New.
(elf_static_list_options): Likewise.
(elf_plt_unwind_list_options): Likewise.
(ld_list_options): Likewise.
(help): Call ld_list_options.
* Makefile.in: Regenerated.
* configure: Likewise.
* emulparams/plt_unwind.sh (PLT_UNWIND): New.
(PARSE_AND_LIST_OPTIONS): Removed.
* emultempl/elf32.em (gld_list_options): New.
(gld${EMULATION_NAME}_list_options): Define only if BNDPLT or
PARSE_AND_LIST_OPTIONS is defined.
(ld_${EMULATION_NAME}_emulation): Replace
gld${EMULATION_NAME}_list_options with ${gld_list_options.
Pedro Alves [Wed, 8 Apr 2015 09:39:43 +0000 (10:39 +0100)]
Fix gdb.trace/{actions,infotrace,while-stepping}.exp with extended-remote
The recent actions.exp change to check gdb_run_cmd succeeded caught
further problems. The test now fails like this
with --target_board=native-extended-gdbserver:
FAIL: gdb.trace/actions.exp: Can't run to main
gdb.log shows:
(gdb) run
Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.trace/actions
Running the default executable on the remote target failed; try "set remote exec-file"?
(gdb) FAIL: gdb.trace/actions.exp: Can't run to main
The problem is that a gdb_load call is missing.
Grepping around for similar problems in other tests, I found that
infotrace.exp and while-stepping.exp should be likewise affected. And
indeed this is what we get today:
FAIL: gdb.trace/infotrace.exp: tstart
FAIL: gdb.trace/infotrace.exp: continue to end (the program is no longer running)
FAIL: gdb.trace/infotrace.exp: tstop
FAIL: gdb.trace/infotrace.exp: 2.6: info tracepoints (trace buffer usage)
FAIL: gdb.trace/while-stepping.exp: tstart
FAIL: gdb.trace/while-stepping.exp: tstop
FAIL: gdb.trace/while-stepping.exp: tfile: info tracepoints
FAIL: gdb.trace/while-stepping.exp: ctf: info tracepoints
while-stepping.exp even has the same race bug actions.exp had.
After this, {actions,infotrace,while-stepping}.exp all pass cleanly
with the native-extended-gdbserver board.
gdb/testsuite/ChangeLog:
2015-04-08 Pedro Alves <palves@redhat.com>
* gdb.trace/actions.exp: Use gdb_load before gdb_run_cmd.
* gdb.trace/infotrace.exp: Use gdb_load before gdb_run_cmd. Use
gdb_breakpoint instead of gdb_test that doesn't expect anything.
Return early if running to main fails.
* gdb.trace/while-stepping.exp: Likewise.
Han Shen [Wed, 8 Apr 2015 00:20:11 +0000 (17:20 -0700)]
Add AArch32 support for arm gold linker.
GDB Administrator [Wed, 8 Apr 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Sergio Durigan Junior [Tue, 7 Apr 2015 19:19:07 +0000 (15:19 -0400)]
Initialize variable on gdb/linux-tdep.c:decode_vmflags
This obvious commit initializes the 'saveptr' variable on
gdb/linux-tdep.c:decode_vmflags. This was causing a build failure on
Fedora 21 x86_64, caught by the BuildBot here:
<https://sourceware.org/ml/gdb-testers/2015-q2/msg00450.html>
Pedro Alves [Tue, 7 Apr 2015 17:19:31 +0000 (18:19 +0100)]
gdb.base/interrupt.exp: Use send_inferior/$inferior_spawn_id
The gdb.base/interrupt.exp test is important for testing system call
restarting, but because it depends on inferior I/O, it ends up skipped
against gdbserver. This patch adjusts the test to use send_inferior
and $inferior_spawn_id so it works against GDBserver.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* gdb.base/interrupt.exp: Don't skip if $inferior_spawn_id !=
$gdb_spawn_id. Use send_inferior and $inferior_spawn_id to
interact with inferior program.
Pedro Alves [Tue, 7 Apr 2015 17:19:30 +0000 (18:19 +0100)]
testsuite: Introduce $inferior_spawn_id
Some important tests, like gdb.base/interrupt.exp end up skipped
against gdbserver, because they depend on inferior I/O, which
gdbserver doesn't do.
This patch adds a mechanism that makes it possible to make them work.
It adds a new "inferior_spawn_id" global that is the spawn ID used for
I/O interaction with the inferior. By default, for native targets, or
remote targets that can do I/O through GDB (semi-hosting) this will be
the same as the gdb/host spawn ID. Otherwise, the board may set this
to some other spawn ID. When debugging with GDBserver, this will be
set to GDBserver's spawn ID.
Then tests can use send_inferior instead of send_gdb to send input to
the inferior, and use expect's "-i" switch to select which spawn ID to
use for matching input/output. That is, something like this will now
work:
send_inferior "echo me\n"
gdb_test_multiple "continue" "test msg" {
-i "$inferior_spawn_id" -re "echo me\r\necho\r\n" {
...
}
}
Or even:
gdb_test_multiple "continue" "test msg" {
-i "$inferior_spawn_id" -re "hello world" {
...
}
-i "$gdb_spawn_id" -re "error.*$gdb_prompt $" {
...
}
}
Of course, by default, gdb_test_multiple still matches with
$gdb_spawn_id.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (inferior_spawn_id): New global.
(gdb_test_multiple): Handle "-i". Reset the spawn id to GDB's
spawn id after processing the user code.
(default_gdb_start): Set inferior_spawn_id.
(send_inferior): New procedure.
* lib/gdbserver-support.exp (gdbserver_start): Set
inferior_spawn_id.
(close_gdbserver, gdb_exit): Unset inferior_spawn_id.
Pedro Alves [Tue, 7 Apr 2015 17:19:30 +0000 (18:19 +0100)]
testsuite: Don't use expect_background to reap gdbserver
I adjusted a test to do 'expect -i $server_spawn_id -re ...', and saw
really strange behavior. Whether that expect would work, depended on
whether GDB would also send output and the same expect matched it too
(on $gdb_spawn_id). I was perplexed until I noticed that
gdbserver_spawn spawns gdbserver and then uses expect_background to
reap gdbserver. That expect_background conflicts/races with any
"expect -i $server_spawn_id" done anywhere else in parallel...
In order to make it possible for tests to read inferior I/O out of
$server_spawn_id, we to get rid of that expect_background. This patch
makes us instead reap gdbserver's spawn id when GDB exits. If GDB is
still around, this gives a chance for gdbserver to exit cleanly. The
current code in gdb_finish uses "kill", but that doesn't work with
extended-remote (gdbserver doesn't exit). We now use "monitor exit"
instead which works in both remote and extended-remote modes.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_finish): Delete persistent gdbserver handling.
* lib/gdbserver-support.exp (gdbserver_start): Make
$server_spawn_id global.
(gdbserver_start): Don't wait for gdbserver's spawn id with
expect_background.
(close_gdbserver): New procedure.
(gdb_exit): Rename the default version and reimplement.
Pedro Alves [Tue, 7 Apr 2015 17:19:30 +0000 (18:19 +0100)]
gdb_test_multiple: Fix user code argument processing
While teaching gdb_test_multiple to forward "-i" to gdb_expect, I
found that with:
gdb_test_multiple (...) {
-i $some_variable -re "..." {}
}
$some_variable was not getting expanded in the gdb_test_multiple
caller's scope. This is a bug inside gdb_test_multiple. When
processing an argument in passed in user code, it was appending the
original argument literally, instead of appending the uplist'ed
argument.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_test_multiple): When processing an argument,
append the substituted item, not the original item.
Pedro Alves [Tue, 7 Apr 2015 17:19:29 +0000 (18:19 +0100)]
gdb.base/interrupt.exp: Use gdb_test_multiple instead of gdb_expect
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* gdb.base/interrupt.exp: Use gdb_test_multiple instead of
gdb_expect.
Pedro Alves [Tue, 7 Apr 2015 17:19:29 +0000 (18:19 +0100)]
gdb.base/interrupt.exp: Fix race
Working on splitting gdb and inferior output handling in this test, I
noticed a race that happens to be masked out today.
The test sends "a\n" to the inferior, and then inferior echoes back
"a\n".
If expect manages to read only the first "a\r\n" into its buffer, then
this matches:
-re "^a\r\n(|a\r\n)$" {
and leaves the second "a\r\n" in output.
Then the next test that processes inferior I/O sends "data\n", and expects:
-re "^(\r\n|)data\r\n(|data\r\n)$"
which fails given the anchor and given "a\r\n" is still in the buffer.
This is masked today because the test relies on inferior I/O being
done on GDB's terminal, and there are tested GDB commands in between,
which consume the "a\r\n" that was left in the output.
We don't support SunOS4 anymore, so just remove the workaround.
gdb/testsuite/ChangeLog
2015-04-07 Pedro Alves <palves@redhat.com>
* gdb.base/interrupt.exp: Don't handle the case of the inferior
output appearing once only.
Renlin Li [Tue, 7 Apr 2015 17:10:33 +0000 (18:10 +0100)]
[AArch64] use subseg_text_p to check .text
2015-04-07 Renlin Li <renlin.li@arm.com>
gas/
* config/tc-aarch64.c (mapping_state): Use subseg_text_p.
(s_aarch64_inst): Likewise.
(md_assemble): Likewise.
Pedro Alves [Thu, 5 Mar 2015 22:01:06 +0000 (22:01 +0000)]
Fix gdb.trace/actions.exp race
I saw this on PPC64 once:
not installed on target
(gdb) PASS: gdb.trace/actions.exp: 5.10a: verify teval actions set for two tracepoints
break main
Breakpoint 4 at 0x10000c6c: file ../../../src/gdb/testsuite/gdb.trace/actions.c, line 139.
(gdb) PASS: gdb.trace/actions.exp: break main
run
Starting program: /home/palves/gdb/build/gdb/testsuite/outputs/gdb.trace/actions/actions
tstatus
Breakpoint 4, main (argc=1, argv=0x3fffffffebb8, envp=0x3fffffffebc8) at ../../../src/gdb/testsuite/gdb.trace/actions.c:139
139 begin ();
(gdb) tstatus
Trace can not be run on this target.
(gdb) actions 1
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
>collect $regs
>end
(gdb) PASS: gdb.trace/actions.exp: set actions for first tracepoint
tstart
You can't do that when your target is `native'
(gdb) FAIL: gdb.trace/actions.exp: tstart
info tracepoints 1
Num Type Disp Enb Address What
1 tracepoint keep y 0x00000000100007c8 in gdb_c_test at ../../../src/gdb/testsuite/gdb.trace/actions.c:74
collect $regs
not installed on target
...
followed by a cascade of FAILs. The "tstatus" was supposed to detect
that this target (native) can't do tracepoints, but, alas, it didn't.
That detection failed because 'gdb_test "break main"' doesn't expect
anything, and then the output was slow enough that 'gdb_test ""
"Breakpoint .*"' matched the output of "break main"...
The fix is to use gdb_breakpoint instead. Also check the result of
gdb_test while at it.
Tested on x86-64 Fedora 20, native and gdbserver.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* gdb.trace/actions.exp: Use gdb_breakpoint instead of gdb_test
that doesn't expect anything. Return early if running to main
fails.
Nick Clifton [Tue, 7 Apr 2015 15:29:41 +0000 (16:29 +0100)]
Add new linker option: --warn-orphan which generates warning messages when orphan sections are detected.
ld * ld.h (struct ld_config_type): Add new field: warn_orphan.
* ldlex.h (enum option_values): Add OPTION_WARN_ORPHAN and
OPTION_NO_WARN_ORPHAN.
* lexsup.c (ld_options): Add --warn-orphan and --no-warn-orphan.
(parse_args): Handle the new options.
* ldemul.c (ldemul_place_orphan): If requested, generate a warning
message when an orphan section is placed in the output file.
* ld.texinfo: Document the new option.
* NEWS: Mention the new feature.
tests * ld-elf/orphan-5.l: New test - checks the linker's output with
--warn-orphan enabled.
* ld-elf/elf.exp: Run the new test.
Pedro Alves [Tue, 7 Apr 2015 14:47:22 +0000 (15:47 +0100)]
update thread list, delete exited threads
On GNU/Linux, if the running kernel supports clone events, then
linux-thread-db.c defers thread listing to the target beneath:
static void
thread_db_update_thread_list (struct target_ops *ops)
{
...
if (target_has_execution && !thread_db_use_events ())
ops->beneath->to_update_thread_list (ops->beneath);
else
thread_db_update_thread_list_td_ta_thr_iter (ops);
...
}
However, when live debugging, the target beneath, linux-nat.c, does
not implement the to_update_thread_list method. The result is that if
a thread is marked exited (because it can't be deleted right now,
e.g., it was the selected thread), then it won't ever be deleted,
until the process exits or is killed/detached.
A similar thing happens with the remote.c target. Because its
target_update_thread_list implementation skips exited threads when it
walks the current thread list looking for threads that no longer exits
on the target side, using ALL_NON_EXITED_THREADS_SAFE, stale exited
threads are never deleted.
This is not a big deal -- I can't think of any way this might be user
visible, other than gdb's memory growing a tiny bit whenever a thread
gets stuck in exited state. Still, might as well clean things up
properly.
All other targets use prune_threads, so are unaffected.
The fix adds a ALL_THREADS_SAFE macro, that like
ALL_NON_EXITED_THREADS_SAFE, walks the thread list and allows deleting
the iterated thread, and uses that in places that are walking the
thread list in order to delete threads. Actually, after converting
linux-nat.c and remote.c to use this, we find the only other user of
ALL_NON_EXITED_THREADS_SAFE is also walking the list to delete
threads. So we convert that too, and end up deleting
ALL_NON_EXITED_THREADS_SAFE.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog
2015-04-07 Pedro Alves <palves@redhat.com>
* gdbthread.h (ALL_NON_EXITED_THREADS_SAFE): Rename to ...
(ALL_THREADS_SAFE): ... this, and don't skip exited threads.
(delete_exited_threads): New declaration.
* infrun.c (follow_exec): Use ALL_THREADS_SAFE.
* linux-nat.c (linux_nat_update_thread_list): New function.
(linux_nat_add_target): Install it.
* remote.c (remote_update_thread_list): Use ALL_THREADS_SAFE.
* thread.c (prune_threads): Use ALL_THREADS_SAFE.
(delete_exited_threads): New function.
Alan Modra [Tue, 7 Apr 2015 12:53:21 +0000 (22:23 +0930)]
Modify get_reloc_section for targets that map .got.plt to .got
Fixes tic6x testsuite failures due to .rela.plt having a zero sh_info.
I considered passing link_info to get_reloc_section so we could
directly return the .got.plt output section, but we need the fallback
to name lookup anyway for objcopy.
bfd/
* elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
mapped to output .got section.
ld/testsuite/
* ld-arm/tls-gdesc-nlazy.g: Adjust for readelf note.
* ld-tic6x/shlib-1.rd: Expect corrected .rela.plt sh_info.
* ld-tic6x/shlib-1b.rd: Likewise.
* ld-tic6x/shlib-1r.rd: Likewise.
* ld-tic6x/shlib-1rb.rd: Likewise.
* ld-tic6x/shlib-app-1.rd: Likewise.
* ld-tic6x/shlib-app-1b.rd: Likewise.
* ld-tic6x/shlib-app-1r.rd: Likewise.
* ld-tic6x/shlib-app-1rb.rd: Likewise.
* ld-tic6x/shlib-noindex.rd: Likewise.
Alan Modra [Tue, 7 Apr 2015 01:09:59 +0000 (10:39 +0930)]
Cast shift expression
PR ld/18176
* ldlang.c (lang_size_sections): Cast shift expression.
Alan Modra [Tue, 31 Mar 2015 23:29:46 +0000 (09:59 +1030)]
PowerPC non-PIC to PIC editing for protected var access
This is a linker-only solution to the incompatibility between shared
library protected visibility variables and using .dynbss and copy
relocs for non-PIC access to shared library variables.
bfd/
* elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
and has_addr16_lo. Make has_sda_refs a bitfield.
(ppc_elf_check_relocs): Set new flags.
(ppc_elf_link_hash_table_create): Update default_params.
(ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
where we won't be making .dynbss entries or editing code. Set
params->pic_fixup when we'll edit code for protected var access.
(allocate_dynrelocs): Allocate got entry for edited code and
discard dyn_relocs.
(struct ppc_elf_relax_info): Add picfixup_size.
(ppc_elf_relax_section): Rename struct one_fixup to struct
one_branch_fixup. Rename fixups to branch_fixups. Size space for
pic fixups.
(ppc_elf_relocate_section): Edit non-PIC accessing protected
visibility variables to PIC. Don't emit dyn_relocs for code
we've edited.
* elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
ld/
* emultempl/ppc32elf.em: Handle --no-pic-fixup.
(params): Init new field.
(ppc_before_allocation): Enable relaxation for pic_fixup.
Pedro Alves [Tue, 7 Apr 2015 10:42:09 +0000 (11:42 +0100)]
Displaced stepping debug: fetch the right regcache
Although not currently possible in practice when we get here,
'resume_ptid' can also be a wildcard throughout this function. It's
clearer to fetch the regcache using the thread's ptid.
gdb/ChangeLog:
2015-04-07 Pedro Alves <pedro@codesourcery.com>
* infrun.c (resume) <displaced stepping debug output>: Get the
leader thread's regcache, not resume_ptid's.
Yao Qi [Tue, 7 Apr 2015 10:30:07 +0000 (11:30 +0100)]
Properly set alarm value in gdb.threads/non-stop-fair-events.exp
Nowadays, the alarm value is 60, and alarm is generated on some slow
boards. This patch is to pass DejaGNU timeout value to the program,
and move the alarm call before going to infinite loop. If any thread
has activities, the alarm is reset.
gdb/testsuite:
2015-04-07 Yao Qi <yao.qi@linaro.org>
* gdb.threads/non-stop-fair-events.c (SECONDS): New macro.
(child_function): Call alarm.
(main): Move call to alarm into the loop.
* gdb.threads/non-stop-fair-events.exp: Build program with
-DTIMEOUT=$timeout.
Nick Clifton [Tue, 7 Apr 2015 10:22:32 +0000 (11:22 +0100)]
Treat assembler generated local labels as local.
* elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
local labels as local.
Mike Frysinger [Tue, 7 Apr 2015 03:40:00 +0000 (23:40 -0400)]
sim: move sim-engine.o/sim-hrw.o to the common list
This makes these two objects available to all sims by default.
GDB Administrator [Tue, 7 Apr 2015 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in
Rafael Ávila de Espíndola [Mon, 6 Apr 2015 19:49:50 +0000 (15:49 -0400)]
Fix the signature of a virtual method to match the one in the parent class.
Rafael Ávila de Espíndola [Mon, 6 Apr 2015 19:45:37 +0000 (15:45 -0400)]
Avoid a call to find by using the return value of insert.
Rafael Ávila de Espíndola [Mon, 6 Apr 2015 19:39:42 +0000 (15:39 -0400)]
Avoid a copy constructor call.
H.J. Lu [Mon, 6 Apr 2015 19:19:13 +0000 (12:19 -0700)]
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.
Ilya Tocar [Mon, 6 Apr 2015 16:33:01 +0000 (19:33 +0300)]
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.
H.J. Lu [Mon, 6 Apr 2015 16:01:43 +0000 (09:01 -0700)]
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.
H.J. Lu [Mon, 6 Apr 2015 15:59:15 +0000 (08:59 -0700)]
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.
Doug Evans [Mon, 6 Apr 2015 15:59:58 +0000 (08:59 -0700)]
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.
Doug Evans [Mon, 6 Apr 2015 15:45:06 +0000 (08:45 -0700)]
* 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.
Doug Evans [Mon, 6 Apr 2015 15:31:46 +0000 (08:31 -0700)]
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.
Pedro Alves [Mon, 6 Apr 2015 11:35:18 +0000 (12:35 +0100)]
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.
Ilya Tocar [Mon, 6 Apr 2015 09:37:34 +0000 (12:37 +0300)]
[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.
---
GDB Administrator [Mon, 6 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Sun, 5 Apr 2015 16:20:02 +0000 (09:20 -0700)]
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.
H.J. Lu [Sun, 5 Apr 2015 15:11:11 +0000 (08:11 -0700)]
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.
Mike Frysinger [Sun, 5 Apr 2015 08:37:44 +0000 (04:37 -0400)]
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.
Mike Frysinger [Sun, 5 Apr 2015 07:52:08 +0000 (03:52 -0400)]
sim: mn10300: add a basic testsuite
Mike Frysinger [Sun, 5 Apr 2015 07:17:44 +0000 (03:17 -0400)]
sim: m68hc11: add a basic testsuite
Mike Frysinger [Sun, 5 Apr 2015 06:28:44 +0000 (02:28 -0400)]
sim: iq2000: add a basic testsuite
Mike Frysinger [Sun, 5 Apr 2015 05:58:00 +0000 (01:58 -0400)]
sim: lm32: add a basic testsuite
GDB Administrator [Sun, 5 Apr 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Sat, 4 Apr 2015 15:01:54 +0000 (08:01 -0700)]
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.
H.J. Lu [Sat, 4 Apr 2015 14:52:55 +0000 (07:52 -0700)]
Replace uncompressed_size_buffer with compressed_size_buffer
H.J. Lu [Sat, 4 Apr 2015 14:49:35 +0000 (07:49 -0700)]
Extract get_uncompressed_size
* compress.c (get_uncompressed_size): New. Extracted from ...
(bfd_init_section_decompress_status): This. Use it.
H.J. Lu [Sat, 4 Apr 2015 14:18:17 +0000 (07:18 -0700)]
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.
GDB Administrator [Sat, 4 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Fri, 3 Apr 2015 19:49:45 +0000 (12:49 -0700)]
Add Elf_Internal_Chdr and ElfXX_External_Chdr
* external.h (Elf32_External_Chdr): New.
(Elf64_External_Chdr): Likewise.
* internal.h (Elf_Internal_Chdr): Likewise.
Pierre-Marie de Rodat [Fri, 3 Apr 2015 12:53:12 +0000 (14:53 +0200)]
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.
Pierre-Marie de Rodat [Fri, 3 Apr 2015 08:40:52 +0000 (10:40 +0200)]
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.
H.J. Lu [Fri, 3 Apr 2015 11:03:07 +0000 (04:03 -0700)]
Make is_zlib_supported always return 1
* lib/binutils-common.exp (is_zlib_supported): Always return 1.
Mike Frysinger [Fri, 3 Apr 2015 00:15:43 +0000 (20:15 -0400)]
sim: d10v: fix signal updates
Way back in
aba6488e0b73756f31f154d12a228baa82a68d8a, 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.
GDB Administrator [Fri, 3 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Nick Clifton [Thu, 2 Apr 2015 16:13:12 +0000 (17:13 +0100)]
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.
Nick Clifton [Thu, 2 Apr 2015 15:10:06 +0000 (16:10 +0100)]
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.
Nick Clifton [Thu, 2 Apr 2015 14:28:02 +0000 (15:28 +0100)]
Fix the binutils readelf.ss test for the AArch64 target.
* binutils-all/readelf.ss-64: Move possible location of the $d
mapping symbol.
Andrew Turner [Thu, 2 Apr 2015 14:07:27 +0000 (15:07 +0100)]
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.
Renlin Li [Thu, 2 Apr 2015 13:59:45 +0000 (14:59 +0100)]
[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.
Ed Maste [Thu, 2 Apr 2015 13:44:59 +0000 (14:44 +0100)]
Remove unused functions in tc-aarch64.c.
* config/tc-aarch64.c (set_error_kind): Delete.
(set_error_message): Delete.
Yao Qi [Thu, 2 Apr 2015 12:51:31 +0000 (13:51 +0100)]
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.
H.J. Lu [Thu, 2 Apr 2015 12:41:50 +0000 (05:41 -0700)]
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.
H.J. Lu [Thu, 2 Apr 2015 12:38:34 +0000 (05:38 -0700)]
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.
H.J. Lu [Thu, 2 Apr 2015 12:37:09 +0000 (05:37 -0700)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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:".
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)]
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.
Gary Benson [Thu, 2 Apr 2015 12:38:28 +0000 (13:38 +0100)]
Introduce target_filesystem_is_local
This commit introduces a new target method target_filesystem_is_local
which can be used to determine whether or not the filesystem accessed
by the target_fileio_* methods is the local filesystem.
gdb/ChangeLog:
* target.h (struct target_ops) <to_filesystem_is_local>:
New field.
(target_filesystem_is_local): New macro.
* target-delegates.c: Regenerate.
* remote.c (remote_filesystem_is_local): New function.
(init_remote_ops): Initialize to_filesystem_is_local.
Gary Benson [Thu, 2 Apr 2015 12:38:28 +0000 (13:38 +0100)]
Introduce target_fileio_fstat
This commit introduces a new target method target_fileio_fstat
which can be used to retrieve information about files opened with
target_fileio_open.
gdb/ChangeLog:
* target.h (struct target_ops) <to_fileio_fstat>: New field.
(target_fileio_fstat): New declaration.
* target.c (target_fileio_fstat): New function.
* inf-child.c (inf_child_fileio_fstat): Likewise.
(inf_child_target): Initialize to_fileio_fstat.
* remote.c (init_remote_ops): Likewise.
Mike Frysinger [Thu, 2 Apr 2015 04:48:04 +0000 (00:48 -0400)]
binutils: update my e-mail address
Mike Frysinger [Wed, 1 Apr 2015 06:34:00 +0000 (02:34 -0400)]
sim: clean up SIM_EXTRA_OBJS references
This variable was deleted in previous commits and is not used anymore.
Prune any stray references to it.
GDB Administrator [Thu, 2 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Evandro Menezes [Thu, 26 Mar 2015 20:18:08 +0000 (15:18 -0500)]
[AArch64] Add support for the Samsung Exynos M1 processor
2015-03-26 Evandro Menezes <e.menezes@samsung.com>
gas/
* config/tc-aarch64.c: Add support for Samsung Exynos M1.
* doc/c-aarch64.texi (-mcpu=): Add "exynos-m1".
Evandro Menezes [Thu, 26 Mar 2015 20:51:14 +0000 (15:51 -0500)]
[ARM] Add support for the Samsung Exynos M1 processor
2015-03-26 Evandro Menezes <e.menezes@samsung.com>
gas/
* config/tc-arm.c: Add support for Samsung Exynos M1.
* doc/c-arm.texi (-mcpu=): Add "exynos-m1".
Sasha Smundak [Wed, 1 Apr 2015 18:49:12 +0000 (11:49 -0700)]
Add support for writing unwinders in Python.
gdb/ChangeLog:
* Makefile.in (SUBDIR_PYTHON_OBJS): Add py-unwind.o.
(SUBDIR_PYTHON_SRCS): Add py-unwind.c.
(py-unwind.o): New recipe.
* NEWS: mention Python frame unwinding.
* data-directory/Makefile.in (PYTHON_FILE_LIST): Add
gdb/unwinder.py and gdb/command/unwinder.py
* python/lib/gdb/__init__.py (packages): Add frame_unwinders
list.
(execute_unwinders): New function.
* python/lib/gdb/command/unwinders.py: New file.
* python/lib/gdb/unwinder.py: New file.
* python/py-objfile.c (objfile_object): Add frame_unwinders field.
(objfpy_dealloc): Decrement frame_unwinders reference count.
(objfpy_initialize): Create frame_unwinders list.
(objfpy_get_frame_unwinders): New function.
(objfpy_set_frame_unwinders): Ditto.
(objfile_getset): Add frame_unwinders attribute to Objfile.
* python/py-progspace.c (pspace_object): Add frame_unwinders field.
(pspy_dealloc): Decrement frame_unwinders reference count.
(pspy_initialize): Create frame_unwinders list.
(pspy_get_frame_unwinders): New function.
(pspy_set_frame_unwinders): Ditto.
(pspy_getset): Add frame_unwinders attribute to gdb.Progspace.
* python/py-unwind.c: New file.
* python/python-internal.h (pspy_get_name_unwinders): New prototype.
(objpy_get_frame_unwinders): New prototype.
(gdbpy_initialize_unwind): New prototype.
* python/python.c (gdbpy_apply_type_printers): Call
gdbpy_initialize_unwind.
gdb/doc/ChangeLog:
* doc/python.texi (Writing a Frame Unwinder in Python): Add
section.
gdb/testsuite/ChangeLog:
* gdb.python/py-unwind-maint.c: New file.
* gdb.python/py-unwind-maint.exp: New test.
* gdb.python/py-unwind-maint.py: New file.
* gdb.python/py-unwind.c: New file.
* gdb.python/py-unwind.exp: New test.
* gdb.python/py-unwind.py: New test.
H.J. Lu [Wed, 1 Apr 2015 17:27:34 +0000 (10:27 -0700)]
Fix sim build
* common/Make-common.in (CSEARCH): Remove $(ZLIBINC).
(BFD_LIB): Remove $(ZLIB).
(CONFIG_LIBS): Add $(ZLIB).
* ppc/Makefile.in (ZLIBINC): Removed.
(INCLUDES): Remove $(ZLIBINC).
(BFD_LIB): Remove $(ZLIB).
H.J. Lu [Wed, 1 Apr 2015 17:15:13 +0000 (10:15 -0700)]
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.
H.J. Lu [Wed, 1 Apr 2015 15:14:32 +0000 (08:14 -0700)]
Work around a GCC uninitialized warning bug
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Work
around a GCC uninitialized warning bug fixed in GCC 4.6.
Pedro Alves [Mon, 30 Mar 2015 15:39:56 +0000 (16:39 +0100)]
infrun.c:resume: currently_stepping after clearing stepped_breakpoint
My all-stop-on-top-of-non-stop series manages to shows regressions due
to this latent bug. currently_stepping returns true if
stepped_breakpoint is set. Obviously we should clear
it before checking currently_stepping, not after.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* infrun.c (resume): Check currently_stepping after clearing
stepped_breakpoint, not before.
Pedro Alves [Tue, 31 Mar 2015 17:36:51 +0000 (18:36 +0100)]
gdb.threads/manythreads.exp: can't read "test": no such variable
If interrupt_and_wait manages to trigger the FAIL path, we get:
ERROR OCCURED: can't read "test": no such variable
gdb/testsuite/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* gdb.threads/manythreads.exp (interrupt_and_wait): Pass $message
to fail instead of non-existent $test.
Pedro Alves [Mon, 30 Mar 2015 17:00:28 +0000 (18:00 +0100)]
Fix gdb_spawn_with_cmdline_opts with non-empty GDBFLAGS
Running attach.exp with a DejaGnu board that sets GDBFLAGS, like
e.g.,:
set GDBFLAGS "-ex \"set displaced off\""
fails with (line breaks added for clarity):
(gdb) PASS: gdb.base/attach.exp: starting with --pid
Executing on build: kill -9 3537 (timeout = 300)
spawn -ignore SIGHUP kill -9 3537
spawn of build/gdb/gdb -nw -nx \
-data-directory build/gdb/testsuite/../data-directory \
-ex "set displaced off"-iex "set height 0" -iex "set width 0" \
^^^^^^^^
--pid=4468 -ex "start" failed
ERROR: Spawning build/gdb/gdb failed.
UNRESOLVED: gdb.base/attach.exp: cmdline attach run: run to prompt
gdb/testsuite/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_spawn_with_cmdline_opts): Append space to
GDBFLAGS if not empty.
Pedro Alves [Mon, 30 Mar 2015 16:02:01 +0000 (17:02 +0100)]
Make print_target_wait_results print the whole ptid
Makes "set debug infrun 1" a bit clearer. Before:
infrun: target_wait (-1, status) =
infrun: 6299 [Thread 0x7ffff7fc1700 (LWP 6340)],
after:
infrun: target_wait (-1.0.0, status) =
infrun: 7233.7237.0 [Thread 0x7ffff7fc1700 (LWP 7237)],
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* infrun.c (print_target_wait_results): Print all the ptid
elements.
Pedro Alves [Thu, 26 Mar 2015 19:05:40 +0000 (19:05 +0000)]
keep_going: Add missing discard_cleanups call
By inspection, I noticed a path where we return without discarding the
cleanups.
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* infrun.c (keep_going): Also discard cleanups if inserting
breakpoints fails.
Pedro Alves [Wed, 1 Apr 2015 13:58:56 +0000 (14:58 +0100)]
wait_for_inferior and errors thrown from target_wait
Noticed that if an error is thrown out of target_wait, we miss running
finish_thread_state_cleanup.
Tested on x86_64 Fedora 20, with "maint set target-async off".
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* infrun.c (wait_for_inferior): Install the
finish_thread_state_cleanup cleanup across the whole function, not
just around handle_inferior_event.
Ilya Tocar [Wed, 1 Apr 2015 13:48:38 +0000 (16:48 +0300)]
Convert mov foo@GOT(%reg), %reg to lea foo@GOTOFF(%reg), %reg
2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
PR gold/17640
* i386.cc (Target_i386::can_convert_mov_to_lea): New.
(Target_i386::Scan::local): Don't create GOT entry, when we
can convert GOT to GOTOFF.
(Target_i386::Scan::global): Ditto.
(Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
lea foo@GOTOFF(%reg), %reg if possible.
* testsuite/Makefile.am (i386_mov_to_lea): New test.
* testsuite/i386_mov_to_lea1.s: New.
* testsuite/i386_mov_to_lea2.s: Ditto.
* testsuite/i386_mov_to_lea3.s: Ditto.
* testsuite/i386_mov_to_lea4.s: Ditto.
* testsuite/i386_mov_to_lea5.s: Ditto.
* testsuite/i386_mov_to_lea.sh: Ditto.
H.J. Lu [Wed, 1 Apr 2015 13:24:42 +0000 (06:24 -0700)]
Regenerate configure in gold
Regenerate configure for zlib.m4 change, which adds --with-system-zlib and
removes --with-zlib in gold. zlib is enabled unconditionally with builtin
zlib imported from GCC.
* Makefile.am (ZLIB): New.
(ZLIBINC): Likewise.
(AM_CFLAGS): Add $(ZLIBINC).
(AM_CXXFLAGS): Likewise.
(ldadd_varldadd_var): Add $(ZLIB).
(incremental_dump_LDADD): Likewise.
(dwp_LDADD): Likewise.
* compressed_output.cc: Don't check HAVE_ZLIB_H to include
<zlib.h>.
(zlib_compress): Don't check HAVE_ZLIB_H.
(zlib_decompress): Likewise.
* options.h (compress_debug_sections): Likewise.
* configure.ac (AM_CONDITIONAL): Removed.
* testsuite/Makefile.am (ZLIB): New.
(LDADD): Add $(ZLIB).
Don't check HAVE_ZLIB.
* Makefile.in: Regenerated.
* config.in: Likewise.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.
Pedro Alves [Wed, 1 Apr 2015 14:24:54 +0000 (14:24 +0000)]
Use do_target_resume when stepping past permanent breakpoint too
We can use the recently added do_target_resume do simplify the code a
bit here.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* infrun.c (resume) <step past permanent breakpoint>: Use
do_target_resume.
Pedro Alves [Tue, 24 Mar 2015 14:24:53 +0000 (14:24 +0000)]
linux_nat.c: Mark new thread running even if momentarily pausing
My all-stop-on-top-of-non-stop series manages to trip on a bug in the
linux-nat.c backend while running the testsuite. If a thread is
discovered while threads are being momentarily paused (without the
core's intervention), the thread ends up stuck in THREAD_STOPPED
state, even though from the user's perspective, the thread is running
even while it is paused.
From inspection, in the current sources, this can happen if we call
stop_and_resume_callback, though there's no way to test that with
current Linux kernels.
(While trying to come up with test to exercise this, I stumbled on:
https://sourceware.org/ml/gdb-patches/2015-03/msg00850.html
... which does include a non-trivial test, so I think I can still
claim I come out net positive. :-) )
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_handle_extended_wait): Always call set_running.
Pierre-Marie de Rodat [Tue, 10 Mar 2015 08:51:27 +0000 (09:51 +0100)]
Share the "multi_line" helper among all testcases
gdb/testsuite/ChangeLog:
* gdb.ada/complete.exp: Remove "multi_line".
* gdb.ada/info_exc.exp: Remove "multi_line".
* gdb.ada/packed_tagged.exp: Remove "multi_line".
* gdb.ada/ptype_field.exp: Remove "multi_line".
* gdb.ada/sym_print_name.exp: Remove "multi_line".
* gdb.ada/tagged.exp: Remove "multi_line".
* gdb.btrace/buffer-size.exp: Replace [join [list ...]] with
[multi_line ...]
* gdb.btrace/delta.exp: Likewise.
* gdb.btrace/exception.exp: Likewise.
* gdb.btrace/function_call_history.exp: Likewise.
* gdb.btrace/instruction_history.exp: Likewise.
* gdb.btrace/nohist.exp: Likewise.
* gdb.btrace/record_goto.exp: Likewise.
* gdb.btrace/segv.exp: Likewise.
* gdb.btrace/stepi.exp: Likewise.
* gdb.btrace/tailcall.exp: Likewise.
* gdb.btrace/unknown_functions.exp: Likewise.
* gdb.dwarf2/dw2-undefined-ret-addr.exp: Likewise.
* lib/gdb.exp: Add the "multi_line" helper.
This page took 0.048497 seconds and 4 git commands to generate.