Build the test objects with the in-tree assembler. Also fix some cascading
error messages caused by not resetting the skip_call_tls_get_addr_ flag
after printing the error.
gold/
* i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing
error message.
* testsuite/Makefile.am (pr20216a): Add missing dependencies.
(pr20308a): Add -Bgcctestdir/ to compile rules.
* testsuite/Makefile.in: Regenerate.
The common sim tracing code already handles loading and tracking of
symbols from the target program so that it can show symbol info in
trace/disassembly calls. Once we touch up the trace code and add a
few API callbacks, ports don't need to do loading and searching of
symbol tables themselves anymore.
GLIBC BZ#20311 introduced a change to install proc_service.h so that gdb
didn't have to use the version it embeds in gdb_proc_service.h. The
embedded version is guarded by HAVE_PROC_SERVICE_H and
gdb_proc_service.h has a number other of includes and definitions, all
of which are uncondional except for an include for gregset.h. This is
only included if HAVE_PROC_SERIVCE_H is not defined.
This causes a build failure when cross compiling gdb with the latest
glibc because type definitions in gregset are used independently of
HAVE_PROC_SERIVCE_H. In particular, they are used in gdb_proc_service.h
when PRFPREGSET_T_BROKEN is set.
The error messages on the failure are
----
binutils-gdb/gdb/gdb_proc_service.h:173:9: error: ‘gdb_fpregset_t’ does
not name a type; did you mean ‘elf_fpregset_t’?
typedef gdb_fpregset_t gdb_prfpregset_t;
^~~~~~~~~~~~~~
elf_fpregset_t
binutils-gdb/gdb/gdb_proc_service.h:173:9: error: ‘gdb_fpregset_t’ does
not name a type; did you mean ‘elf_fpregset_t’?
typedef gdb_fpregset_t gdb_prfpregset_t;
^~~~~~~~~~~~~~
elf_fpregset_t
binutils-gdb/gdb/proc-service.c:218:15: error: ‘gdb_prfpregset_t’ does
not name a type; did you mean ‘gdb_fpregset_t’?
const gdb_prfpregset_t *fpregset)
^~~~~~~~~~~~~~~~
gdb_fpregset_t
----
This patch moves the include for gregset.h to before the code guarded by
HAVE_PROC_SERIVCE_H, so that it is always included. This is enough to
fix the build.
2016-08-15 Matthew Wahab <matthew.wahab@arm.com>
PR gdb/20457
* gdb_proc_service.h: Add an include of gregset.h
[!HAVE_PROC_SERVICE_H]: Remove the include of gregset.h.
I build GDB with -fsanitize=address, and see the error in tests,
(gdb) PASS: gdb.linespec/ls-errs.exp: lang=C++: break 3 foo
break -line 3 foo^M
=================================================================^M
==4401==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000047487 at pc 0x819d8e bp 0x7fff4e4e6bb0 sp 0x7fff4e4e6ba8^M
READ of size 1 at 0x603000047487 thread T0^[[1m^[[0m^M
#0 0x819d8d in explicit_location_lex_one /home/yao/SourceCode/gnu/gdb/git/gdb/location.c:502^M
#1 0x81a185 in string_to_explicit_location(char const**, language_defn const*, int) /home/yao/SourceCode/gnu/gdb/git/gdb/location.c:556^M
#2 0x81ac10 in string_to_event_location(char**, language_defn const*) /home/yao/SourceCode/gnu/gdb/git/gdb/location.c:687^
the code in question is:
> /* Special case: C++ operator,. */
> if (language->la_language == language_cplus
> && strncmp (*inp, "operator", 8) <--- [1]
> && (*inp)[9] == ',')
> (*inp) += 9;
> ++(*inp);
The error is caused by the access to (*inp)[9] if 9 is out of its bounds.
However [1] looks odd to me, because if strncmp returns true (non-zero),
the following check "(*inp)[9] == ','" makes no sense any more. I
suspect it was a typo in the code we meant to "strncmp () == 0". Another
problem in the code above is that if *inp is "operator,", we first
increment *inp by 9, and then increment it by one again, which is wrong
to me. We should only increment *inp by 8 to skip "operator", and go
back to the loop header to decide where we stop.
gdb:
2016-08-15 Yao Qi <yao.qi@linaro.org>
* location.c (explicit_location_lex_one): Compare the return
value of strncmp with zero. Don't check (*inp)[9]. Increment
*inp by 8.
A few funcs are only used locally, so mark them static to avoid warnings
due to -Wmissing-prototypes.
Some funcs cast the return value wrong, so drop them (and let void * just
work by default).
Update some prototypes to be new style.
The current machs.h mixes common enums with Blackfin-specific defines.
This causes us troubles with header inclusion order such that we can't
drop the old SIM_CPU typedef (which is duplicated in common code). By
splitting the two up, we can unwind this dependency chain, and drop the
old typedef. It also fixes building with older gcc versions.
* readelf.c (process_symbol_table): Generate a warning if a local
symbol is found at and offste greater than or equal to the sh_info
field of it's section header.
* simulator.c (aarch64_step): Revert pervious delta.
(aarch64_run): Call sim_events_tick after each
instruction is simulated, and if necessary call
sim_events_process.
* simulator.h: Revert previous delta.
I see the following warning when running signals-state-child.exp.
gdb/testsuite/gdb.base/signals-state-child.c:77:4: warning: too many arguments for format [-Wformat-extra-args]
fprintf (out, "sigaction={sa_handler=", i);
^
this patch is to remove the argument from fprintf.
gdb/testsuite:
2016-08-12 Yao Qi <yao.qi@linaro.org>
* gdb.base/signals-state-child.c (main): Remove "i" from fprintf's
argument list.
* testsuite/ld-undefined/weak-fundef.s: New.
* testsuite/ld-undefined/weak-undef.t: Don't specify filename.
* testsuite/ld-undefined/weak-undef.exp: Run new tests. Rearrange
much of old code. Use is_elf_format to select targets.
* interp.c (sim_create_inferior): Allow for being called with a
NULL abfd parameter. If a bfd is provided, initialise the sim
with that start address.
* simulator.c (HALT_NYI): Just print out the numeric value of the
instruction when not tracing.
(aarch64_step): Change from static to global.
* simulator.h: Add a prototype for aarch64_step().
Fixes, on NIOS GNU/Linux:
In file included from
/scratch/mbilal/nois-lite/src/gdb-trunk/gdb/gdbserver/../nat/linux-ptrace.c:26:0:
/scratch/mbilal/nois-lite/src/gdb-trunk/gdb/gdbserver/../gregset.h:27:23:
error: unknown type name 'gregset_t'
#define GDB_GREGSET_T gregset_t
^
Fix this by including sys/procfs.h directly. We shouldn't really be
including a gdb-only header in a gdb/nat/ file, anyway. Whoops.
gdb/ChangeLog:
2016-08-11 Pedro Alves <palves@redhat.com>
PR gdb/20413
* nat/linux-ptrace.c: Include <sys/procfs.h> instead of
"gregset.h".
PR ld/20436
* testsuite/lib/ld-lib.exp (check_gcc_plugin_enabled): When not
testing remotely, check to see if target compiler is installed
before trying to run it.
parse_aarch64_imm_float was accepting -0.0 even though that's not
a valid immediate for any instruction. The FPIMM0 caller rejected
it, but the FPIMM one would silently treat it as -2.0.
This patch rejects -0.0 and adds testcases to illegal.[sd].
Before the patch, the final error emitted for illegal.s was:
Error: cannot do 16-byte relocation
which was matched by:
[^:]*:569: Error: .*
The error was reported against the last line of the file rather than
the instruction that required the reloc. Adding more instructions
meant that the line number also changed.
Reporting against the wrong line isn't good from a QoI perspective
but isn't what I'm trying to fix here. Until it's fixed, I thought
it would be better to adjust the match to be against an end-of-file
comment rather than against whatever the last instruction happens to be.
gas/
* config/tc-aarch64.c (parse_aarch64_imm_float): Reject -0.0.
* testsuite/gas/aarch64/illegal.s, testsuite/gas/aarch64/illegal.l:
Add tests for -0.0. Add an end-of-file comment.
Undefined weak functions, like __gmon_start__, were not being made
dynamic or emitting plt call code. While the behaviour of undefined
weak symbols is not defined in the ELF standard, the intention on
powerpc64 was to make it possible to link without a definition of such
symbols and at run time behave the same as if a definition was found
at link time in a shared library.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't exit with
non_got_ref true in any case where we could have generated dynbss
copies but decide not to do so.
Complement commit b75d42bce5 ("Fix mips segfault on GOT access of
absolute symbol") and unmark the `__ehdr_start' test 2 as known to fail
for the n32 and n64 ABIs, as with the change referred in place the
causing issue has been properly addressed and consequently the tests do
not fail anymore and neither are supposed to.
ld/
PR ld/15428
* testsuite/ld-mips-elf/mips-elf.exp: Un-KFAIL `__ehdr_start'
test 2.
Right after a fork is detected, we detach breakpoints from the child
(detach_breakpoints), which calls into target_remove_breakpoint with
inferior_ptid pointing at the child process, but leaves the breakpoint
marked inserted (in the parent).
The problem is that record-full.c always deletes all knowledge of the
breakpoint. Then when we later really delete the breakpoint from the
parent, we fail the assertion, since the breakpoint is unexpectedly
not found in the record-full.c breakpoint table.
The fix is simply to not forget about the breakpoint if we're
detaching it from a fork child.
gdb/ChangeLog:
2016-08-10 Pedro Alves <palves@redhat.com>
PR gdb/19187
* record-full.c (record_full_remove_breakpoint): Don't remove the
breakpoint from the record_full_breakpoints VEC if we're detaching
the breakpoint from a fork child.
gdb/testsuite/ChangeLog:
2016-08-10 Pedro Alves <palves@redhat.com>
PR gdb/19187
* gdb.reverse/waitpid-reverse.exp: Add comment and remove
setup_kfails.
Makes the code more obvious.
gdb/ChangeLog:
2016-08-10 Pedro Alves <palves@redhat.com>
PR gdb/19187
* breakpoint.c (insertion_state_t): Delete.
(enum remove_bp_reason): New.
(detach_breakpoints, remove_breakpoint_1, remove_breakpoint):
Adjust to use enum remove_bp_reason instead of insertion_state_t.
All callers pass mark_uninserted, so there's no need for the 'is'
parameter.
gdb/ChangeLog:
2016-08-10 Pedro Alves <palves@redhat.com>
PR gdb/19187
* breakpoint.c (remove_breakpoint): Remove 'is' parameter and
always pass mark_uninserted to remove_breakpoint_1.
(insert_breakpoint_locations, remove_breakpoints)
(remove_breakpoints_pid, update_global_location_list): Update
callers.
Repeat `PIC and non-PIC test 1' checks for microMIPS LA25 stubs,
covering code generation and stub symbol annotation.
ld/
* testsuite/ld-mips-elf/pic-and-nonpic-1-micromips-rel.dd: New
test.
* testsuite/ld-mips-elf/pic-and-nonpic-1-micromips-rel.nd: New
test.
* testsuite/ld-mips-elf/pic-and-nonpic-1-micromips.dd: New test.
* testsuite/ld-mips-elf/pic-and-nonpic-1-micromips.nd: New test.
* testsuite/ld-mips-elf/pic-and-nonpic-1a-micromips.s: New test
source.
* testsuite/ld-mips-elf/pic-and-nonpic-1b-micromips.s: New test
source.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
For the case where a function which requires an LA25 stub is at the
beginning of a section we use a short sequence comprised of a LUI/ADDIU
instruction pair only and prepended to the associated function rather
than using a trailing jump to reach the function. This works by
checking for the offset into section of the function symbol being 0.
This is however never the case for microMIPS function symbols, which
have the ISA bit set. Consequently the short LA25 sequence is never
produced for microMIPS functions, like with the following example:
$ cat la25a.s
.abicalls
.global f1
.ent f1
f1:
.set noreorder
.cpload $25
.set reorder
.option pic0
jal f2
.option pic2
jr $31
.end f1
.global f2
.ent f2
f2:
jr $31
.end f2
$ cat la25b.s
.abicalls
.option pic0
.global __start
.ent __start
__start:
jal f1
jal f2
.end __start
$ as -mmicromips -32 -EB -o la25a.o la25a.s
$ as -mmicromips -32 -EB -o la25b.o la25b.s
$ ld -melf32btsmip -o la25 la25a.o la25b.o
$ objdump -d la25
la25: file format elf32-tradbigmips
Disassembly of section .text:
004000d0 <.pic.f2>:
4000d0: 41b9 0040 lui t9,0x40
4000d4: d420 0083 j 400106 <f2>
4000d8: 3339 0107 addiu t9,t9,263
4000dc: 0000 0000 nop
004000e0 <.pic.f1>:
4000e0: 41b9 0040 lui t9,0x40
4000e4: d420 0078 j 4000f0 <f1>
4000e8: 3339 00f1 addiu t9,t9,241
4000ec: 0000 0000 nop
004000f0 <f1>:
4000f0: 41bc 0002 lui gp,0x2
4000f4: 339c 801f addiu gp,gp,-32737
4000f8: 033c e150 addu gp,gp,t9
4000fc: f420 0083 jal 400106 <f2>
400100: 0000 0000 nop
400104: 45bf jrc ra
00400106 <f2>:
400106: 45bf jrc ra
...
00400110 <__start>:
400110: f420 0070 jal 4000e0 <.pic.f1>
400114: 0000 0000 nop
400118: f420 0068 jal 4000d0 <.pic.f2>
40011c: 0000 0000 nop
$
where `.pic.f1' could omit the trailing jump and the filler NOP and just
fall through to `f1'.
Correct the problem by masking out the ISA bit from microMIPS functions,
which fixes the earlier example:
$ objdump -d la25
la25: file format elf32-tradbigmips
Disassembly of section .text:
004000d0 <.pic.f2>:
4000d0: 41b9 0040 lui t9,0x40
4000d4: d420 0083 j 400106 <f2>
4000d8: 3339 0107 addiu t9,t9,263
...
004000e8 <.pic.f1>:
4000e8: 41b9 0040 lui t9,0x40
4000ec: 3339 00f1 addiu t9,t9,241
004000f0 <f1>:
4000f0: 41bc 0002 lui gp,0x2
4000f4: 339c 801f addiu gp,gp,-32737
4000f8: 033c e150 addu gp,gp,t9
4000fc: f420 0083 jal 400106 <f2>
400100: 0000 0000 nop
400104: 45bf jrc ra
00400106 <f2>:
400106: 45bf jrc ra
...
00400110 <__start>:
400110: f420 0074 jal 4000e8 <.pic.f1>
400114: 0000 0000 nop
400118: f420 0068 jal 4000d0 <.pic.f2>
40011c: 0000 0000 nop
$
There is no need to do anything for MIPS16 functions, because if any
LA25 stub has been generated for such a function, then it is only
required for an associated call thunk only, which is regular MIPS code
and the address of which, with the ISA bit clear, is returned by
`mips_elf_get_la25_target'.
This problem has been there since the beginning of microMIPS support:
commit df58fc944d
Author: Richard Sandiford <rdsandiford@googlemail.com>
Date: Sun Jul 24 14:20:15 2011 +0000
<https://sourceware.org/ml/binutils/2011-07/msg00198.html>, ("MIPS:
microMIPS ASE support").
bfd/
* elfxx-mips.c (mips_elf_add_la25_stub): Clear the ISA bit of
the stub address retrieved if associated with a microMIPS
function.
Fix a problem with missing microMIPS symbol annotation with microMIPS
LA25 stub symbols. The consequence of the issue is these symbols appear
in the symbol table as regular MIPS symbols with the ISA bit set, as
shown with the example below:
$ cat la25a.s
.abicalls
.global f1
.ent f1
f1:
.set noreorder
.cpload $25
.set reorder
.option pic0
jal f2
.option pic2
jr $31
.end f1
.global f2
.ent f2
f2:
jr $31
.end f2
$ cat la25b.s
.abicalls
.option pic0
.global __start
.ent __start
__start:
jal f1
jal f2
.end __start
$ as -mmicromips -32 -EB -o la25a.o la25a.s
$ as -mmicromips -32 -EB -o la25b.o la25b.s
$ ld -melf32btsmip -o la25 la25a.o la25b.o
$ readelf -s la25
Symbol table '.symtab' contains 18 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00400098 0 SECTION LOCAL DEFAULT 1
2: 004000b0 0 SECTION LOCAL DEFAULT 2
3: 004000d0 0 SECTION LOCAL DEFAULT 3
4: 00000000 0 SECTION LOCAL DEFAULT 4
5: 00000000 0 SECTION LOCAL DEFAULT 5
6: 00418110 0 NOTYPE LOCAL DEFAULT 3 _gp
7: 004000e1 16 FUNC LOCAL DEFAULT 3 .pic.f1
8: 004000d1 16 FUNC LOCAL DEFAULT 3 .pic.f2
9: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _fdata
10: 00400110 16 FUNC GLOBAL DEFAULT [MICROMIPS] 3 __start
11: 00400106 2 FUNC GLOBAL DEFAULT [MICROMIPS] 3 f2
12: 004000d0 0 NOTYPE GLOBAL DEFAULT 3 _ftext
13: 00410120 0 NOTYPE GLOBAL DEFAULT 3 __bss_start
14: 004000f0 22 FUNC GLOBAL DEFAULT [MICROMIPS] 3 f1
15: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _edata
16: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _end
17: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _fbss
$
where microMIPS annotation is missing for `.pic.f1' and `.pic.f2' even
though these stubs are associated with microMIPS functions `f1' and `f2'
respectively.
Add the missing annotation then, by copying it from the function symbol
an LA25 stub is associated with, correcting the example above:
$ readelf -s la25
Symbol table '.symtab' contains 18 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00400098 0 SECTION LOCAL DEFAULT 1
2: 004000b0 0 SECTION LOCAL DEFAULT 2
3: 004000d0 0 SECTION LOCAL DEFAULT 3
4: 00000000 0 SECTION LOCAL DEFAULT 4
5: 00000000 0 SECTION LOCAL DEFAULT 5
6: 00418110 0 NOTYPE LOCAL DEFAULT 3 _gp
7: 004000e0 16 FUNC LOCAL DEFAULT [MICROMIPS] 3 .pic.f1
8: 004000d0 16 FUNC LOCAL DEFAULT [MICROMIPS] 3 .pic.f2
9: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _fdata
10: 00400110 16 FUNC GLOBAL DEFAULT [MICROMIPS] 3 __start
11: 00400106 2 FUNC GLOBAL DEFAULT [MICROMIPS] 3 f2
12: 004000d0 0 NOTYPE GLOBAL DEFAULT 3 _ftext
13: 00410120 0 NOTYPE GLOBAL DEFAULT 3 __bss_start
14: 004000f0 22 FUNC GLOBAL DEFAULT [MICROMIPS] 3 f1
15: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _edata
16: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _end
17: 00410120 0 NOTYPE GLOBAL DEFAULT 3 _fbss
$
This problem has been there since the beginning of microMIPS support:
commit df58fc944d
Author: Richard Sandiford <rdsandiford@googlemail.com>
Date: Sun Jul 24 14:20:15 2011 +0000
<https://sourceware.org/ml/binutils/2011-07/msg00198.html>, ("MIPS:
microMIPS ASE support").
bfd/
* elfxx-mips.c (mips_elf_create_stub_symbol): For a microMIPS
stub also add STO_MICROMIPS annotation.
Fix a linker regression introduced with commit 9d862524f6 ("MIPS:
Verify the ISA mode and alignment of branch and jump targets") causing a
build failure in microMIPS glibc where the `zdump' tool fails to link:
.../timezone/zdump.o: In function `yeartot':
.../timezone/zdump.c:758:(.text+0x62): Jump to a non-instruction-aligned address
.../timezone/zdump.c:758:(.text+0x76): Jump to a non-instruction-aligned address
.../timezone/zdump.c:768:(.text+0x112): Jump to a non-instruction-aligned address
.../timezone/zdump.c:774:(.text+0x1b8): Jump to a non-instruction-aligned address
.../timezone/zdump.c:774:(.text+0x1cc): Jump to a non-instruction-aligned address
collect2: error: ld returned 1 exit status
make[2]: *** [.../timezone/zdump] Error 1
The cause of the failure is the stricter check introduced with the said
change for jump and branch targets tripping on the address of microMIPS
LA25 stubs. Despite being microMIPS code these stubs do not have the
ISA bit set throughout the relocation calculation process, because they
have their address set to the memory offset into the stub section they
are placed in.
The `mips_elf_la25_stub' structure does not carry ISA mode information,
but there is no need to extend it, because the ISA mode can be inferred
from the original symbol, which will have STO_MICROMIPS annotation, so
use that instead to set the ISA bit appropriately. Also only LA25 stubs
associated with microMIPS symbols need to have the ISA bit set, because
other LA25 stubs are made with regular MIPS code, even if associated
with a MIPS16 symbol (in which case they are needed by a call thunk only
rather than the MIPS16 function proper).
bfd/
* elfxx-mips.c (mips_elf_calculate_relocation): Set the ISA bit
in microMIPS LA25 stub references.
This is done by catching an exception number 0x406d1388 (it has no
documented name, though MSDN dubs it "MS_VC_EXCEPTION" in one code
example), which is thrown by the program. The exception record
contains an ID of a thread and a name to give it.
This requires rolling back some changes in handle_exception(), which
now again returns more than two distinct values. The new
HANDLE_EXCEPTION_IGNORED value means that gdb should just continue,
without returning the thread ID up the stack (which would result in
further handling of the exception, which is not what we want).
gdb/ChangeLog:
2016-08-10 Руслан Ижбулатов <lrn1986@gmail.com>
Pedro Alves <palves@redhat.com>
* windows-nat.c (MS_VC_EXCEPTION): New define.
(handle_exception_result): New enum.
(windows_delete_thread): Free the thread's name.
(handle_exception): Handle MS_VC_EXCEPTION.
(get_windows_debug_event): Handle HANDLE_EXCEPTION_IGNORED.
(windows_thread_name): New function.
(windows_target): Install it as to_thread_name method.
* NEWS: Mention the thread naming support on MS-Windows.
With some versions of gas, the call to tls_get_addr uses a GOTPCREL
relocation instead of a GOTPCRELX relocation. We should allow for that
when skip_call_tls_get_addr_ is true. We should also build the test
objects with the in-tree assembler.
This patch also fixes some cascading error messages caused by not
resetting the skip_call_tls_get_addr_ flag after printing the error.
gold/
PR gold/20216
* x86_64.cc (Target_x86_64::Relocate::relocate): Add check for
R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing
error message.
* testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/.
(pr20216_ld.o): Likewise.
* testsuite/Makefile.in: Regenerate.
2016-08-10 James Clarke <jrtc27@jrtc27.com>
gold/
PR gold/20443
* symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols,
which will be present for STT_SPARC_REGISTER.
(Symbol_table::add_from_pluginobj): Likewise.
(Symbol_table::add_from_dynobj): Likewise.
(Symbol_table::add_from_incrobj): Removed dead code.
The fall-through in Target_sparc::Relocate::relocate for
R_SPARC_GOTDATA_OP_LOX10 is currently R_SPARC_GOT13, but should
clearly be R_SPARC_GOT10. GCC has been seen to emit a sethi/xor
rather than a sethi/or sequence to load a 32-bit immediate, but
if R_SPARC_GOT13 is used then bits 10-12 get zeroed out as both
the sethi and xor immediates contain them.
gold/
PR gold/20442
* sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10
should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
The ARI complains about this new file:
common/signals-state-save-restore.c:46: warning: gettext: All messages should be marked up with _.
common/signals-state-save-restore.c:59: warning: gettext: All messages should be marked up with _.
common/signals-state-save-restore.c:87: warning: gettext: All messages should be marked up with _.
common/signals-state-save-restore.c:92: warning: gettext: All messages should be marked up with _.
Since these are untranslatable strings, use () instead of _().
gdb/ChangeLog:
2016-08-10 Pedro Alves <palves@redhat.com>
* common/signals-state-save-restore.c
(save_original_signals_state, restore_original_signals_state):
Wrap perror_with_name arguments with '()'.
Don't run LTO tests if compiler is configured with --disable-plugin.
PR ld/20436
* testsuite/lib/ld-lib.exp (check_gcc_plugin_enabled): New
proc.
(check_lto_available): Return 0 if check_gcc_plugin_enabled
returns 0.
(check_lto_fat_available): Likewise.
(check_lto_shared_available): Likewise.
When executing commands on a secondary UI running the MI interpreter,
some commands that should be synchronous are not. MI incorrectly
continues processing input right after the synchronous command is
sent, before the target stops.
The problem happens when we emit MI async events (=library-loaded,
etc.), and we go about restoring the previous terminal state, we end
up calling target_terminal_ours, which incorrectly always installs the
current UI's input_fd in the event loop... That is, code like this:
old_chain = make_cleanup_restore_target_terminal ();
target_terminal_ours_for_output ();
fprintf_unfiltered (mi->event_channel, "library-loaded");
...
do_cleanups (old_chain);
The fix is to move the add_file_handler/delete_file_handler calls out
of target_terminal_$foo, making these completely no-ops unless called
with the main UI as current UI.
gdb/ChangeLog:
2016-08-09 Pedro Alves <palves@redhat.com>
PR gdb/20418
* event-top.c (ui_register_input_event_handler)
(ui_unregister_input_event_handler): New functions.
(async_enable_stdin): Register input in the event loop.
(async_disable_stdin): Unregister input from the event loop.
(gdb_setup_readline): Register input in the event loop.
* infrun.c (check_curr_ui_sync_execution_done): Register input in
the event loop.
* target.c (target_terminal_inferior): Don't unregister input from
the event loop.
(target_terminal_ours): Don't register input in the event loop.
* target.h (target_terminal_inferior)
(target_terminal_ours_for_output, target_terminal_ours): Update
comments.
* top.h (ui_register_input_event_handler)
(ui_unregister_input_event_handler): New declarations.
* utils.c (ui_unregister_input_event_handler_cleanup)
(prepare_to_handle_input): New functions.
(defaulted_query, prompt_for_continue): Use
prepare_to_handle_input.
gdb/testsuite/ChangeLog:
2016-08-09 Pedro Alves <palves@redhat.com>
Simon Marchi <simon.marchi@ericsson.com>
PR gdb/20418
* gdb.mi/new-ui-mi-sync.c, gdb.mi/new-ui-mi-sync.exp: New files.
* lib/mi-support.exp (mi_expect_interrupt): Remove anchors.
gdb 7.11 introduced an MI regression: a failing MI sync execution
command misses printing the MI prompt, and then all subsequent command
miss it too:
$ gdb-7.11.1 -i=mi
[...]
p 1
&"p 1\n"
~"$1 = 1"
~"\n"
^done
(gdb) <<< prompted ok
-exec-continue
^error,msg="The program is not being run." <<< missing prompt after this
print 1
&"print 1\n"
~"$2 = 1"
~"\n"
^done <<< missing prompt after this
gdb 7.10.1 behaved correctly, even with "set mi-async on":
-exec-continue
^error,msg="The program is not being run."
(gdb) <<< prompted ok
etc.
Bisecting points at:
commit 0b333c5e7d
Author: Pedro Alves <palves@redhat.com>
Date: Wed Sep 9 18:23:23 2015 +0100
Merge async and sync code paths some more
[...]
The problem is that when an exception is thrown, we leave the prompt
state set to PROMPT_BLOCKED, and then mi_execute_command_input_handler
doesn't print the prompt. It used to work because before that patch,
we happened to skip disabling stdin if the current target didn't do
async (which it never does before execution).
I was surprised to find that this bug isn't caught by the testsuite,
so I made a thorough test that tests all combinations of pairs of:
- a failing synchronous execution command
- a failing non-execution command
- a non-failing command
gdb/ChangeLog:
2016-08-09 Pedro Alves <palves@redhat.com>
PR mi/20431
* mi/mi-main.c (mi_execute_command): Enable input and set prompt
state to PROMPT_NEEDED.
gdb/testsuite/ChangeLog:
2016-08-09 Pedro Alves <palves@redhat.com>
PR mi/20431
* gdb.mi/mi-cmd-error.exp: New file.