Mike Frysinger [Sat, 9 Jan 2016 01:23:37 +0000 (20:23 -0500)]
sim: drop common/cconfig.h in favor of a single config.h
The common subdir sets up a cconfig.h file to hold checks for the common
code. In practice, most files still end up using config.h instead which
just leads to confusion.
Merge all the configure checks that went into cconfig.h into SIM_AC_COMMON
so we can drop the cconfig.h file altogether. Now there is only a single
config.h file like normal.
GDB Administrator [Sat, 9 Jan 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Jan Kratochvil [Fri, 8 Jan 2016 19:07:02 +0000 (20:07 +0100)]
Fix gdb.multi/base.exp testsuite regression
Regressed by:
commit
762f774785f4ef878ac4c831e1f4733dc957234d
Author: Pedro Alves <palves@redhat.com>
Date: Thu Dec 10 16:21:06 2015 +0000
Stop using nowarnings in gdb/testsuite/gdb.multi/
+gdb compile failed, gdb/testsuite/gdb.multi/hello.c: In function 'commonfun':
+gdb/testsuite/gdb.multi/hello.c:24:19: warning: implicit declaration of function 'bar' [-Wimplicit-function-declaration]
+ int commonfun() { bar(); } /* from hello */
+ ^
+gdb/testsuite/gdb.multi/hello.c: At top level:
+gdb/testsuite/gdb.multi/hello.c:26:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ bar()
+ ^
+gdb/testsuite/gdb.multi/hello.c:32:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ hello(int x)
+ ^
+gdb/testsuite/gdb.multi/hello.c:38:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ main()
+ ^
+UNTESTED: gdb.multi/base.exp: base.exp
gdb/testsuite/ChangeLog
2016-01-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.multi/goodbye.c: Fix compilation warnings by adding return types
and reordering the functions.
* gdb.multi/hangout.c: Likewise.
* gdb.multi/hello.c: Likewise.
Simon Marchi [Fri, 8 Jan 2016 15:22:17 +0000 (10:22 -0500)]
perf testsuite: python 3 fixes
There are a few errors when trying to run the performance testsuite with
Python 3. This commit fixes them.
In Python 2, it was possible to use relative imports (importing a module
relative to the current one). In Python 3 it isn't. So I use
absolute_import from the __future__ module, which allows Python 2 to
behave like Python 3, and use the Python 3 syntax.
In Python 3, dict.iterkeys doesn't exist anymore. Using dict.keys is a
good compromise in this case.
gdb/testsuite/ChangeLog:
* gdb.perf/lib/perftest/perftest.py: Change relative imports to
absolute.
(SingleStatisticTestResult.report): Use dict.keys instead of
dict.iterkeys.
Yao Qi [Fri, 8 Jan 2016 11:06:00 +0000 (11:06 +0000)]
Change SIGINT handler for extension languages only when target terminal is ours
I see a timeout in gdb.base/random-signal.exp,
Continuing.^M
PASS: gdb.base/random-signal.exp: continue
^CPython Exception <type 'exceptions.KeyboardInterrupt'> <type
exceptions.KeyboardInterrupt'>: ^M
FAIL: gdb.base/random-signal.exp: stop with control-c (timeout)
it can be reproduced by running random-signal.exp with native-gdbserver
in a loop, like this, and the fail will be shown in about 20 runs,
$ (set -e; while true; do make check RUNTESTFLAGS="--target_board=native-gdbserver random-signal.exp"; done)
In the test, the program is being single-stepped for software watchpoint,
and in each internal stop, python unwinder sniffer is used,
#0 pyuw_sniffer (self=<optimised out>, this_frame=<optimised out>, cache_ptr=0xd554f8) at /home/yao/SourceCode/gnu/gdb/git/gdb/python/py-unwind.c:608
#1 0x00000000006a10ae in frame_unwind_try_unwinder (this_frame=this_frame@entry=0xd554e0, this_cache=this_cache@entry=0xd554f8, unwinder=0xecd540)
at /home/yao/SourceCode/gnu/gdb/git/gdb/frame-unwind.c:107
#2 0x00000000006a143f in frame_unwind_find_by_frame (this_frame=this_frame@entry=0xd554e0, this_cache=this_cache@entry=0xd554f8)
at /home/yao/SourceCode/gnu/gdb/git/gdb/frame-unwind.c:163
#3 0x000000000069dc6b in compute_frame_id (fi=0xd554e0) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:454
#4 get_prev_frame_if_no_cycle (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1781
#5 0x000000000069fdb9 in get_prev_frame_always_1 (this_frame=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1955
#6 get_prev_frame_always (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1971
#7 0x00000000006a04b1 in get_prev_frame (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:2213
when GDB goes to python extension, or other language extension, the
SIGINT handler is changed, and is restored when GDB leaves extension
language. GDB only stays in extension language for a very short period
in this case, but if ctrl-c is pressed at that moment, python extension
will handle the SIGINT, and exceptions.KeyboardInterrupt is shown.
Language extension is used in GDB side rather than inferior side,
so GDB should only change SIGINT handler for extension language when
the terminal is ours (not inferior's). This is what this patch does.
With this patch applied, I run random-signal.exp in a loop for 18
hours, and no fail is shown.
gdb:
2016-01-08 Yao Qi <yao.qi@linaro.org>
* extension.c: Include target.h.
(set_active_ext_lang): Only call install_gdb_sigint_handler,
check_quit_flag, and set_quit_flag if target_terminal_is_ours
returns false.
(restore_active_ext_lang): Likewise.
* target.c (target_terminal_is_ours): New function.
* target.h (target_terminal_is_ours): Declare.
Yao Qi [Fri, 8 Jan 2016 11:06:00 +0000 (11:06 +0000)]
Check input interrupt first when reading packet
Hi,
I see timeout in one of several runs of random-signal.exp like this,
$ (set -e; while true; do make check RUNTESTFLAGS="--target_board=native-gdbserver random-signal.exp"; done)
In about every five runs, we can see a fail,
PASS: gdb.base/random-signal.exp: continue
^CFAIL: gdb.base/random-signal.exp: stop with control-c (timeout)
after some investigation, I find '\003' may be discarded by GDBserver when
it is expecting '$'. In GDB side, both normal packets and '\003' are sent
via function send, but GDBserver may receive them at any time, that is to
say, in the receive buffer in GDBserver, '\003' may appear before or after
normal packet. However, current GDBserver doesn't handle this case.
With this patch applied, I don't see this fail in multiple runs.
Although there is still timeout fail, that is a different problem, the
next patch will fix it.
gdb/gdbserver:
2016-01-08 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (getpkt): If c is '\003', call target hook
request_interrupt.
Andreas Schwab [Fri, 8 Jan 2016 10:38:00 +0000 (11:38 +0100)]
m68k: fix constraints of move.[bw] for ISA_B/C
For ISA_B/C only the combination #,d(An) is allowed in addition to the
ISA_A combinations for move.b and move.w (and pc-relative is never
allowed as destination).
opcodes/
PR gas/13050
* m68k-opc.c (moveb, movew): For ISA_B/C only allow #,d(An) in
addition to ISA_A.
gas/
PR gas/13050
* testsuite/gas/m68k/all.exp: Add tests p13050-1 and p13050-2.
* testsuite/gas/m68k/p13050-1.s: New file.
* testsuite/gas/m68k/p13050-2.d: New file.
* testsuite/gas/m68k/p13050-2.s: New file.
Jiong Wang [Fri, 8 Jan 2016 09:47:24 +0000 (09:47 +0000)]
[ARM] PR ld/19368: Add missing relocation type class for R_ARM_IRELATIVE
2016-01-08 Richard Sandiford <richard.sandiford@arm.com>
Jiong Wang <jiong.wang@arm.com>
PR ld/19368
bfd/
* elf32-arm.c (elf32_arm_reloc_type_class): Map R_ARM_IRELATIVE to
reloc_class_ifunc.
ld/
* testsuite/ld-arm/ifunc-3.rd: Update expected result.
* testsuite/ld-arm/ifunc-4.rd: Likewise.
* testsuite/ld-arm/ifunc-9.rd: Likewise.
* testsuite/ld-arm/ifunc-10.rd: Likewise.
* testsuite/ld-arm/ifunc-12.rd: Likewise.
* testsuite/ld-arm/ifunc-13.rd: Likewise.
GDB Administrator [Fri, 8 Jan 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Thu, 7 Jan 2016 19:12:44 +0000 (19:12 +0000)]
MIPS: Complete `status' to `err' renaming in `mips_breakpoint_from_pc'
Complement commit
d09f2c3f [target_read_memory&co: no longer return
target_xfer_status] and apply the same change made to the big-endian leg
of the function to the little-endian leg as well.
gdb/
* mips-tdep.c (mips_breakpoint_from_pc): Rename local `status'
to `err' in the little-endian leg.
Mike Frysinger [Mon, 4 Jan 2016 00:11:58 +0000 (19:11 -0500)]
sim: config: drop use of __DATE__/__TIME__
These don't add a whole lot of useful info, and people don't like them as
it makes builds unreproducible, so just drop them.
Mike Frysinger [Sun, 3 Jan 2016 06:51:44 +0000 (01:51 -0500)]
sim: sim_{create_inferior,open,parse_args}: constify argv/env slightly
2016-01-03 Mike Frysinger <vapier@gentoo.org>
* sim-options.c (sim_parse_args): Mark argv array const.
* sim-options.h (sim_parse_args): Likewise.
GDB Administrator [Thu, 7 Jan 2016 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Wed, 6 Jan 2016 18:31:23 +0000 (18:31 +0000)]
MIPS/include: opcode/mips.h: Add a summary of MIPS16 operand codes
include/
* opcode/mips.h: Add a summary of MIPS16 operand codes.
Yao Qi [Wed, 6 Jan 2016 15:03:41 +0000 (15:03 +0000)]
Make {arm,thumb}_get_next_pcs_raw static
This patch makes arm_get_next_pcs_raw and thumb_get_next_pcs_raw
static.
gdb:
2016-01-06 Yao Qi <yao.qi@linaro.org>
* arch/arm-get-next-pcs.c (arm_get_next_pcs): Move it to some
lines below.
(thumb_get_next_pcs_raw): Make it static.
(arm_get_next_pcs_raw): Likewise.
* arch/arm-get-next-pcs.h (thumb_get_next_pcs_raw): Remove the
declaration.
(arm_get_next_pcs_raw): Likewise.
Yao Qi [Wed, 6 Jan 2016 12:11:41 +0000 (12:11 +0000)]
[ARM/AArch64] Fix -Werror=unused-const-variable warnings in GDBserver
This patch fixes gcc warning when build ARM GDBserver and AArch64
GDBserver,
AArch64 GDBserver:
gdb/gdbserver/linux-aarch32-low.h:36:29: error: 'thumb2_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 };
^
gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned short thumb_breakpoint = 0xde01;
^
gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned long arm_breakpoint = arm_eabi_breakpoint;
^
cc1: all warnings being treated as errors
ARM GDBserver:
gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned short thumb_breakpoint = 0xde01;
^~~~~~~~~~~~~~~~
gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned long arm_breakpoint = arm_eabi_breakpoint;
^~~~~~~~~~~~~~
by simply moving these macros and variables to
linux-aarch32-low.c and only declare thumb2_breakpoint in
linux-aarch32-low.h, which is not perfect, and reveals some issues
in recent arm GDBserver software single step changes. I'll post
follow-up patches.
gdb/gdbserver:
2016-01-06 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.h (arm_abi_breakpoint): Move to
linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
(thumb2_breakpoint): Declare.
* linux-aarch32-low.c (arm_abi_breakpoint): Moved from
linux-aarch32-low.h.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
Andrew Burgess [Tue, 5 Jan 2016 14:46:39 +0000 (14:46 +0000)]
bfd/arc: Add R_ prefix to all relocation names
The convention within for relocation names is that they start with the
string "R_", however, this is not so for ARC for the display names of
relocations, however, internally, the names for the relocations types do
have the 'R_' prefix. I suspect that the missing 'R_' on the output
strings was an oversight, as I can't see any comment to the contrary.
To bring ARC into line with other targets, this commit adds the 'R_'
prefix to the output strings used for relocation names, and updates all
of the assembler tests where this was exposed.
bfd/ChangeLog:
* elf32-arc.c (reloc_type_to_name): Change ARC_RELOC_HOWTO to
place 'R_' before the reloc name returned.
(elf_arc_howto_table): Change ARC_RELOC_HOWTO to place 'R_' before
the relocation string.
gas/ChangeLog:
* testsuite/gas/arc/adc.d: Add 'R_' prefix to relocation names.
* testsuite/gas/arc/add.d: Likewise.
* testsuite/gas/arc/and.d: Likewise.
* testsuite/gas/arc/asl.d: Likewise.
* testsuite/gas/arc/asr.d: Likewise.
* testsuite/gas/arc/bic.d: Likewise.
* testsuite/gas/arc/extb.d: Likewise.
* testsuite/gas/arc/extw.d: Likewise.
* testsuite/gas/arc/j.d: Likewise.
* testsuite/gas/arc/jl.d: Likewise.
* testsuite/gas/arc/ld2.d: Likewise.
* testsuite/gas/arc/lsr.d: Likewise.
* testsuite/gas/arc/mov.d: Likewise.
* testsuite/gas/arc/or.d: Likewise.
* testsuite/gas/arc/pcl-relocs.d: Likewise.
* testsuite/gas/arc/pcrel-relocs.d: Likewise.
* testsuite/gas/arc/pic-relocs.d: Likewise.
* testsuite/gas/arc/plt-relocs.d: Likewise.
* testsuite/gas/arc/rlc.d: Likewise.
* testsuite/gas/arc/ror.d: Likewise.
* testsuite/gas/arc/rrc.d: Likewise.
* testsuite/gas/arc/sbc.d: Likewise.
* testsuite/gas/arc/sda-relocs.d: Likewise.
* testsuite/gas/arc/sda-relocs2.d: Likewise.
* testsuite/gas/arc/sexb.d: Likewise.
* testsuite/gas/arc/sexw.d: Likewise.
* testsuite/gas/arc/st.d: Likewise.
* testsuite/gas/arc/sub.d: Likewise.
* testsuite/gas/arc/tls-relocs.d: Likewise.
* testsuite/gas/arc/xor.d: Likewise.
Pedro Alves [Wed, 6 Jan 2016 11:31:52 +0000 (11:31 +0000)]
Fix gdb.python/py-infthread.exp test message typo
gdb/testsuite/ChangeLog:
2016-01-06 Pedro Alves <palves@redhat.com>
* gdb.python/py-infthread.exp: Fix typo. Expect t0.num to be 1.
Joel Brobecker [Wed, 6 Jan 2016 05:38:21 +0000 (09:38 +0400)]
Change copyright owner to FSF in sim/testsuite/sim/mips/hilo-hazard-4.s
sim/testsuite/sim/mips/ChangeLog:
* hilo-hazard-4.s: Change copyright ownder to FSF.
Mike Frysinger [Wed, 6 Jan 2016 04:23:52 +0000 (23:23 -0500)]
gdb: change version stamp to git
GDB Administrator [Wed, 6 Jan 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Mike Frysinger [Sun, 3 Jan 2016 06:30:32 +0000 (01:30 -0500)]
libiberty: {count,dup,write}argv: constify argv input slightly
Would be more useful if we could use "const char * const *", but there's
a long standing bug where gcc warns about incompatible pointers when you
try to pass in "char **". We can at least constify the array itself as
gcc will not warn in that case.
Mike Frysinger [Sun, 3 Jan 2016 06:29:03 +0000 (01:29 -0500)]
libiberty: dupargv: rewrite to use xstrdup
This func is basically open coding the xstrdup function, so gut it
and use it directly.
Patrick Palka [Mon, 28 Dec 2015 22:00:14 +0000 (22:00 +0000)]
libiberty: Tweak the documentation of libiberty's xcrc32 function
In some places the xcrc32 documentation refers to GDB's own crc32
implementation, but GDB no longer has its own crc32 implementation.
It now uses libiberty's xcrc32 throughout. So this patch removes
these references to GDB's now-nonexistent crc32 implementation.
Also, there appears to be a bug in the table-generation program embedded
within the documentation. When the variable "int i" is >= 128, the
computation "i << 24" shifts a one bit into the sign bit (assuming a
32-bit int), which is UB. To avoid this UB, I think it is sufficient to
make the induction variables i and j have type unsigned int. This bug
seems latent, however. I ran the program before and after this change
and the table output is the same.
Nick Clifton [Mon, 21 Dec 2015 08:23:35 +0000 (08:23 +0000)]
libiberty: fix warnings about left shifting a negative value.
GCC PR 66827 reports some problems with left shifting a negative
value:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66827
Of the problems reported only two remain - in libiberty/regex.c:
libiberty/regex.c:6970:11: runtime error: left shift of negative value -1
libiberty/regex.c:7165:4: runtime error: left shift of negative value -1
The patch below fixes these errors by casting the value to be shifted
to unsigned before the shift occurs.
No regressions were found in the libiberty testsuite or bootstrapping
gcc (on an x86_64 target).
Mike Frysinger [Sat, 2 Jan 2016 08:11:44 +0000 (03:11 -0500)]
gdb: score: drop sim file check
There has never been a GNU/sim port for the S+Core architecture.
It was added to support private code that has (and most likely
never will) see the light of day [1]. Punt this as we don't do
this for other people. If you want to maintain a proprietary
internal build, then that's not really our problem.
[1] https://sourceware.org/ml/gdb-patches/2009-03/msg00390.html
Mike Frysinger [Mon, 4 Jan 2016 05:25:46 +0000 (00:25 -0500)]
sim: msp430: drop duplicate sim_load_file call
There's no need, or desire, to call sim_load_file from sim_open. The
higher levels (gdb/run) take care of calling sim_load for us already.
Mike Frysinger [Thu, 31 Dec 2015 04:26:05 +0000 (23:26 -0500)]
sim: aarch64: switch to common disassembler tracing
The output should largely be the same.
Mike Frysinger [Thu, 31 Dec 2015 04:20:23 +0000 (23:20 -0500)]
sim: bfin: add support disasm tracing
Mike Frysinger [Thu, 31 Dec 2015 04:19:01 +0000 (23:19 -0500)]
sim: msp430: switch to common disassembler tracing
The output format is a bit different, but the new form matches all the
other trace lines. Otherwise, it should be functionally equivalent.
Mike Frysinger [Thu, 31 Dec 2015 04:17:58 +0000 (23:17 -0500)]
sim: trace: add support for disassembling
Some targets have started to add support for calling the disassembler
automatically when executing code. Add support for that directly into
the trace core.
Nick Clifton [Tue, 5 Jan 2016 16:49:26 +0000 (16:49 +0000)]
Add myself as the maintainer for the AArch64.
Nick Clifton [Tue, 5 Jan 2016 16:43:58 +0000 (16:43 +0000)]
Fix the execution of the MSP430 simulator testsuite.
ld * emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the
MSP430 hardware multiply address range.
* scripttempl/elf32msp430.sc (__romdatastart): Define.
(__romdatacopysize): Define.
* scripttempl/elf32msp430_3.sc: Likewise.
tests * testutils.inc (__pass): Use the LMA addresses of the _passmsg
symbol.
(__fail): Likewise.
Pedro Alves [Tue, 5 Jan 2016 11:12:31 +0000 (11:12 +0000)]
Add missing ChangeLog entry bit
gdb/ChangeLog:
PR sim/13418
* rs6000-tdep.c (init_sim_regno_table): Check WITH_PPC_SIM instead
of WITH_SIM.
Pedro Alves [Tue, 5 Jan 2016 11:03:40 +0000 (11:03 +0000)]
Fix PR sim/13418: building with --enable-targets=all fails
Multitarget builds currently fail when:
(1) simulator support is enabled (the main --target supports target sim)
(2) powerpc is included in the --enable-targets list
(3) powerpc is not the main/default target (--target)
This is because the powerpc sim provides a non-standard API function
sim_spr_register_name which gdb/rs6000-tdep.c utilizes. Since the sim
does not yet support multitarget, only the sim (if one exists) for the
main target is built. When that target isn't powerpc, this function
is not available leading to linking errors:
rs6000-tdep.c:(.text+0x1e34d): undefined reference to
`sim_spr_register_name'
Fix this by only using that API if the sim linked in is the powerpc
sim.
gdb/ChangeLog:
2016-01-05 Pedro Alves <palves@redhat.com>
PR sim/13418
* configure.ac: Define WITH_PPC_SIM when linking in the sim and
the target is powerpc*.
* configure: Regenerate.
* config.in: Regenerate.
Mike Frysinger [Tue, 5 Jan 2016 03:32:49 +0000 (22:32 -0500)]
sim: use STATE_MAGIC helper
Mike Frysinger [Tue, 5 Jan 2016 03:24:03 +0000 (22:24 -0500)]
sim: unify min/max macros
Import defines from gdb/defs.h to the sim core so we can delete the
various copies that already exist.
Tristan Gingold [Wed, 9 Dec 2015 11:34:45 +0000 (12:34 +0100)]
sim: aarch64: drop syscall.h include to fix build
The simulator is including syscall.h which is not standard and apparently
not required (builds correctly without it on my machine).
GDB Administrator [Tue, 5 Jan 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Mon, 4 Jan 2016 23:35:03 +0000 (23:35 +0000)]
MIPS/LD: Convert ELF linker emulation option macros to an enum
ld/
* emultempl/mipself.em (PARSE_AND_LIST_PROLOGUE): Convert
OPTION_INSN32 and OPTION_NO_INSN32 macros to an enum.
Maciej W. Rozycki [Mon, 4 Jan 2016 23:32:34 +0000 (23:32 +0000)]
MIPS/BFD: Factor out ABI flag merging
Factor out the parts of `_bfd_mips_elf_merge_private_bfd_data'
responsible for ABI flag merging to `mips_elf_merge_obj_abiflags'. No
functional change.
bfd/
* elfxx-mips.c (mips_elf_merge_obj_abiflags): New function,
factored out from...
(_bfd_mips_elf_merge_private_bfd_data): ... here.
Maciej W. Rozycki [Mon, 4 Jan 2016 23:30:00 +0000 (23:30 +0000)]
MIPS/BFD: Move attribute check after ELF file header flag check
We have a problem in that in making compatibility checks while merging
private BFD data on the MIPS target we give priority to the attribute
check, which may fail and cause the function to abort early on. The
problem with this is the ABI compatibility aspect recorded in the
attributes is relatively minor compared to aspects recorded in the ELF
file header. However the premature exit causes any more important
compatibility aspect violated to be masked and not reported to the user
once a problem with attributes has been noticed.
So move the attribute check after the ELF file header flag check in
`_bfd_mips_elf_merge_private_bfd_data', and do not return prematurely
there. Take advantage of the resulting grouping of ELF file header
handling together and remove the premature success return point for the
first input object being handled, letting the code later on figure out
output ABI flags even for this object.
Update LD test cases according to messages from ELF file header checks
now preceding ones from attribute checks.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Move
attribute check after ELF file header flag check.
ld/
* testsuite/ld-mips-elf/attr-gnu-4-14.d: Update the order of
messages expected according to MIPS BFD private data merge
changes.
* testsuite/ld-mips-elf/attr-gnu-4-24.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-34.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-41.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-42.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-43.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-45.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-46.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-47.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-48.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-49.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-54.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-64.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-74.d: Likewise.
Maciej W. Rozycki [Mon, 4 Jan 2016 23:16:45 +0000 (23:16 +0000)]
MIPS/BFD: Propagate the return status in attribute merging
Fix the issue of any failure from `_bfd_elf_merge_object_attributes' not
being propagated by `mips_elf_merge_obj_attributes'.
bfd/
* elfxx-mips.c (mips_elf_merge_obj_attributes): Propagate the
return status from `_bfd_elf_merge_object_attributes'.
Maciej W. Rozycki [Mon, 4 Jan 2016 23:15:03 +0000 (23:15 +0000)]
MIPS/BFD: Factor out ELF file header flag checks
Factor out the parts of `_bfd_mips_elf_merge_private_bfd_data'
responsible for ELF file header flag compatibility checks to
`mips_elf_merge_obj_e_flags'. As a side effect remove a premature
return point from `_bfd_mips_elf_merge_private_bfd_data'. No functional
change otherwise.
bfd/
* elfxx-mips.c (mips_elf_merge_obj_e_flags): New function,
factored out from...
(_bfd_mips_elf_merge_private_bfd_data): ... here.
Maciej W. Rozycki [Mon, 4 Jan 2016 23:13:10 +0000 (23:13 +0000)]
MIPS/BFD: Fold the handling of input MIPS ABI flags together
Fold the handling of input MIPS ABI flags in private BFD data merging
together, moving the attribute check afterwards, and consequently making
input vs output compatibility checks only start once all input ABI flag
data has been gathered, checked for inconsistencies and put in order.
Consequently also address the issue of input ABI flag inconsistencies
being masked by a failing attribute check, which currently makes
`_bfd_mips_elf_merge_private_bfd_data' exit prematurely and therefore
prevent input ABI flag inconsistencies from being reported. Such
inconsistencies need to be reported as they may be the very cause of an
attribute check failure.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Fold the
handling of input MIPS ABI flags together.
Maciej W. Rozycki [Mon, 4 Jan 2016 23:00:24 +0000 (23:00 +0000)]
MIPS/BFD: Suppress attribute checks for null input
We currently special-case the handling of attribute checks on input
objects and make them even before we check a given input object actually
contains any sections. This does not add value as empty objects do not
cause a compatibility concern and we already make this observation for
other properties such as ELF file header flags. Moreover the attributes
themselves are stored in a `.gnu.attributes' section so the absence of
any section (except from a few special cases) implies there have been no
attributes provided either. Therefore it is safe to move the attribute
checks later on, after the null-section check has been made.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Suppress
attribute checks for null input.
Maciej W. Rozycki [Mon, 4 Jan 2016 22:49:59 +0000 (22:49 +0000)]
MIPS/BFD: Use local pointers to target data in private data merge
Use local pointers to target data to reduce the amount of indirection
and improve the readability of `_bfd_mips_elf_merge_private_bfd_data'.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Use local
pointers to target data.
Maciej W. Rozycki [Mon, 4 Jan 2016 22:46:40 +0000 (22:46 +0000)]
MIPS/BFD: Correct an FP ABI warning
Correct a warning produced on any FP ABI mismatch observed. Unlike the
other settings, which in the presence of `.MIPS.abiflags' are duplicated
in the `e_flags' member of the ELF file header, information on the FP
ABI in use is duplicated in `.gnu.attributes' rather than in the former
place. Update the warning message accordingly.
bfd/
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
an FP ABI warning.
Mike Frysinger [Mon, 4 Jan 2016 10:08:26 +0000 (05:08 -0500)]
sim: parse_args: polish getopt error message
The cris sim hit a few failures after the recent getopt logic, and the
expected output showed a few ways we can improve things to better match
other utils.
Mike Frysinger [Mon, 4 Jan 2016 09:06:01 +0000 (04:06 -0500)]
sim: punt x86-specific bswap logic
The compiler/C library should produce reasonable code for htonl/ntohl,
and at least glibc tries pretty hard to always produce good code for
them. This logic only had support for 32-bit x86 systems anymore, and
it's unlikely people were even opting into this, so drop it all.
Mike Frysinger [Mon, 4 Jan 2016 08:58:09 +0000 (03:58 -0500)]
sim: d10v: gut endian logic
The compiler should produce reasonable code here in general, so punt the
various arch checks and bswap defines. This code will eventually go away
entirely when we convert it to the common memory code.
Markus Metzger [Wed, 23 Dec 2015 12:53:53 +0000 (13:53 +0100)]
btrace: do not return out of TRY/CATCH
In btrace_pt_readmem_callback, we read memory inside TRY/CATCH and return in
case of an error return value. This corrupts the cleanup chain, which
eventually results in a SEGV when doing or discarding cleanups later on.
gdb/
* btrace.c (btrace_pt_readmem_callback): Do not return in TRY/CATCH.
testsuite/
* gdb.btrace/dlopen.exp: New.
* gdb.btrace/dlopen.c: New.
* gdb.btrace/dlopen-dso.c: New.
Mike Frysinger [Mon, 4 Jan 2016 02:40:34 +0000 (21:40 -0500)]
sim: parse_args: display getopt error ourselves
Fix a long standing todo where we let getopt write directly to stderr
when an invalid option is passed. Use the sim io funcs instead as they
go through the filtered callbacks that gdb wants.
Mike Frysinger [Mon, 4 Jan 2016 00:54:25 +0000 (19:54 -0500)]
sim: TODO: move to wiki
We're maintaining development docs in the wiki now:
https://sourceware.org/gdb/wiki/Sim/TODO
GDB Administrator [Mon, 4 Jan 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Mike Frysinger [Sun, 3 Jan 2016 08:44:02 +0000 (03:44 -0500)]
sim: clean up some more device detritus
Clean up some more remains of WITH_DEVICES that escaped notice.
We also clean up GETTWI/SETTWI defines in a few ports where they
were copied & pasted and are unused as they happen to be near the
device code.
Mike Frysinger [Sun, 3 Jan 2016 06:40:46 +0000 (01:40 -0500)]
sim: use libiberty countargv in more places
A bunch of places open code the countargv implementation, or outright
duplicate it (as count_argc). Replace all of those w/countargv.
Mike Frysinger [Sun, 3 Jan 2016 06:44:44 +0000 (01:44 -0500)]
sim: nrun: use lbasename
Mike Frysinger [Sun, 3 Jan 2016 05:36:13 +0000 (00:36 -0500)]
sim: drop host endian configure option
The --enable-sim-hostendian flag was purely so people had an escape route
for when cross-compiling. This is because historically, AC_C_BIGENDIAN
did not work in those cases. That was fixed a while ago though, so we can
require that macro everywhere now and simplify a good bit of code.
Mike Frysinger [Sat, 2 Jan 2016 22:46:16 +0000 (17:46 -0500)]
sim: convert to bfd_endian
Rather than re-invent endian defines, as well as maintain our own list
of OS & arch-specific includes, punt all that logic in favor of the bfd
ones already set up and maintained elsewhere. We already rely on the
bfd library, so leveraging the endian aspect should be fine.
GDB Administrator [Sun, 3 Jan 2016 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in
Mike Frysinger [Sat, 2 Jan 2016 16:11:09 +0000 (11:11 -0500)]
sim: cris: use standard output helpers
The sim-io module provides output helpers, so no need to define local
ones anymore.
Mike Frysinger [Sat, 2 Jan 2016 15:29:51 +0000 (10:29 -0500)]
sim: iq2000/m32r/lm32/sh64: delete dead option code
The iq2000/m32r/sh64 option parsing logic appears to have always been
dead. At least iq2000/sh64 are simply copy & paste rot from m32r.
The lm32 option parsing hack here hasn't been needed for a while -- this
was fixed back in commit
11409fac6b95d71a92848a4499b02d60a4f4c5bb in the
common code.
Mike Frysinger [Sat, 2 Jan 2016 14:23:06 +0000 (09:23 -0500)]
sim: delete dead current_state globals
The global current_state handle to the current simulator state is a
design idea that was half implemented, but never really cleaned up.
The point was to have a global variable pointing to the state so that
funcs could more quickly & easily access the state anywhere. We've
instead moved in the direction of passing state around everywhere and
don't have any intention of moving back.
I also can't find any references to gdb using this variable, or to
cgen related "dump_regs" functions, both of which were used in the
comments related to this code.
Mike Frysinger [Sat, 2 Jan 2016 08:10:57 +0000 (03:10 -0500)]
gdb: ppc: drop unnecessary sim file check
We don't do this for other ppc targets in this file (we assume the sim
subdir exists), and it has existed for over a decade at this point.
Mike Frysinger [Sat, 2 Jan 2016 07:34:05 +0000 (02:34 -0500)]
sim: ppc: do not exit when parsing args w/gdb
When connecting to the simulator in gdb, we don't want it to exit on
us when we pass down unknown/invalid/help/etc... options. Plumb down
the kind argument so we can handle both gdb & psim interfaces.
GDB Administrator [Sat, 2 Jan 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Fri, 1 Jan 2016 11:25:12 +0000 (21:55 +1030)]
Copyright update for binutils
Alan Modra [Fri, 1 Jan 2016 10:44:31 +0000 (21:14 +1030)]
New 2016 binutils ChangeLog files
Note that this does not create bfd/doc/ChangeLog, */testsuite/ChangeLog
and include/*/ChangeLog files.
Alan Modra [Fri, 1 Jan 2016 10:42:53 +0000 (21:12 +1030)]
binutils ChangeLog rotation
Joel Brobecker [Fri, 1 Jan 2016 04:33:14 +0000 (08:33 +0400)]
GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:
Update year range in copyright notice of all files.
Joel Brobecker [Fri, 1 Jan 2016 04:22:36 +0000 (08:22 +0400)]
update copyright year printed by GDB, GDBserver and gdbreplay.
gdb/ChangeLog:
* top.c (print_gdb_version): Change copyright year in version
message.
gdb/gdbserver/ChangeLog:
* gdbreplay.c (gdbreplay_version): Change copyright year in
version message.
* server.c (gdbserver_version): Likewise.
Joel Brobecker [Fri, 1 Jan 2016 04:19:16 +0000 (08:19 +0400)]
Rotate the GDB ChangeLog
Per GDB the "Start of New Year Procedure", this patch
- renames the current ChangeLog into ChangeLog-2015;
- starts a new ChangeLog file.
gdb/ChangeLog:
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2015.
GDB Administrator [Fri, 1 Jan 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Andrew Burgess [Wed, 16 Dec 2015 13:57:44 +0000 (13:57 +0000)]
opcodes/arc: Support dmb instruction with no operands
In this GCC commit:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00735.html
GCC started emitting dmb instructions with no operands. The intention
was that dmb with no operands should be an alias for 'dmb 0'.
The following patch extends the arc opcodes library to support dmb with
no operands.
opcodes/ChangeLog:
* arc-tbl.h (dmb): Add a no operand version of dmb.
Mike Frysinger [Thu, 31 Dec 2015 04:47:35 +0000 (23:47 -0500)]
sim: m68hc11: fix default endian
The previous commit here set the default to little instead of big.
A typo lost when reviewing the different targets in parallel.
Mike Frysinger [Thu, 31 Dec 2015 02:01:58 +0000 (21:01 -0500)]
sim: cris/m68hc11: move default endian/alignment to configure
GDB Administrator [Thu, 31 Dec 2015 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in
Mike Frysinger [Wed, 30 Dec 2015 11:03:31 +0000 (06:03 -0500)]
sim: h8300: inline sim_state_initialize
All the state is handled already by the common cpu allocation which
zeros out the entire state.
Mike Frysinger [Wed, 30 Dec 2015 10:58:12 +0000 (05:58 -0500)]
sim: h8300: simplify h8300_reg_{fetch,store} funcs
We can leverage the cpu->regs array rather than going through the
function helpers to get nice compact code.
Further, fix up the return values: return -1 when we can't find a
register (and let the caller write out warnings), return 2/4 when
we actually write out that amount, and handle the zero reg.
Mike Frysinger [Wed, 30 Dec 2015 09:28:10 +0000 (04:28 -0500)]
sim: h8300: switch to common sim-resume
Mike Frysinger [Wed, 30 Dec 2015 10:19:40 +0000 (05:19 -0500)]
sim: h8300: move default endian/alignment to configure
Mike Frysinger [Wed, 30 Dec 2015 04:54:12 +0000 (23:54 -0500)]
sim: simplify STATE_MY_NAME setup
No point in writing basename ourselves when libiberty provides one.
Mike Frysinger [Wed, 30 Dec 2015 08:28:45 +0000 (03:28 -0500)]
sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert to common sim_{fetch,store}_register
Mike Frysinger [Wed, 30 Dec 2015 06:49:53 +0000 (01:49 -0500)]
sim: h8300: move unused/buggy lregs array
This array isn't used anywhere, and the init phase actually corrupts
some memory because the array has 18 elements but tries to set the
19th (ZERO) position.
Mike Frysinger [Wed, 30 Dec 2015 06:26:08 +0000 (01:26 -0500)]
sim: h8300: drop unused inst.h
We can also drop the compile.o rule since the common dep generation
logic takes care of this for us.
Alan Modra [Tue, 29 Dec 2015 22:50:20 +0000 (09:20 +1030)]
Fix assorted ChangeLog errors
Kevin Buettner [Mon, 16 Nov 2015 21:58:07 +0000 (14:58 -0700)]
sim: ppc: track closed state of file descriptors 0, 1, and 2.
This change tracks the "closed" state of file descriptors 0, 1, and 2,
introducing the function fdbad() to emul_netbsd.c and emul_unix.c.
Note that a function of the same name and purpose exists in
sim/common/callback.c.
This patch eliminates all of the "unresolved testcases" when testing
GDB against the powerpc simulator.
This occurs because the powerpc simulator closes, on behalf of the
testcase, the file descriptors associated with stdin, stdout, and
stderr. GDB still needs these descriptors to communicate with the
user or, in this case, with the testing framework.
GDB Administrator [Wed, 30 Dec 2015 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Tue, 29 Dec 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Patrick Palka [Mon, 2 Nov 2015 18:21:44 +0000 (13:21 -0500)]
Use libiberty's crc32 implementation in gdbserver
Tested on x86_64-pc-linux-gnu native-gdbserver, no new regressions.
gdb/gdbserver/ChangeLog:
* server.c (crc32_table): Delete.
(crc32): Use libiberty's xcrc32 function.
GDB Administrator [Mon, 28 Dec 2015 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in
Sandra Loosemore [Sun, 27 Dec 2015 20:30:26 +0000 (12:30 -0800)]
Correct nios2 _gp address computation.
2015-12-27 Sandra Loosemore <sandra@codesourcery.com>
bfd/
* elf32-nios2.c (nios2_elf_assign_gp): Correct computation of _gp
address.
(nios2_elf32_relocate_section): Tidy code for R_NIOS2_GPREL error
messages.
Mike Frysinger [Sun, 27 Dec 2015 06:41:27 +0000 (01:41 -0500)]
sim: aarch64/msp430: fix disassembler usage
The disasm framework reserves the private_data field for the disassemblers
themselves, not for people who use the disassembler. Instead, there is an
application_data field for callers such as the sim. Switch to it to avoid
random corruption/crashes when the disassemblers use private_data.
Mike Frysinger [Fri, 10 Apr 2015 23:40:34 +0000 (19:40 -0400)]
sim: unify sim-hload
Pretty much all targets are using this module already, so add it to the
common list of objects. The only oddball out here is cris and that's
because it supports loading via an offset for all the phdrs. We drop
support for that.
Mike Frysinger [Sun, 27 Dec 2015 01:20:23 +0000 (20:20 -0500)]
sim: punt WITH_DEVICES & tconfig.h support
No arch is using this anymore, and we want all new ports using the
hardware framework instead. Punt WITH_DEVICES and the two callbacks
device_io_{read,write}_buffer.
We can also punt the tconfig.h file as no port is using it anymore.
This fixes in-tree builds that get confused by picking up the wrong
one (common/ vs <port>/) caused by commit
ae7d0cac8ce971f7108d270c.
Any port that needs to set up a global define can use their own
sim-main.h file that they must provide regardless.
Mike Frysinger [Sun, 27 Dec 2015 00:02:07 +0000 (19:02 -0500)]
sim: bfin: push down mmr address/size checks
The bfin port is using the WITH_DEVICES framework for two reasons:
- get access to the cpu making the request (if available)
- check the alignment & size for core & system MMRs
We addressed the first part with commit
dea10706e9159ba6e94eab4c25010f3,
and we handle the second part with this commit. Arguably this is more
correct too because trying to do bad reads/writes directly (when devices
support is disabled) often results in bad memory accesses.
As part of this clean up, we also adjust all of the existing logic that
would reject invalid accesses: the code was relying on the checks never
returning, but that's not the case when things like gdb (via the user's
commands) are making the requests. Thus we'd still end up with bad mem
accesses, or sometimes gdb being hung due to while(1) loops.
Now we can connect (most of) these models into any address and have them
work correctly.
GDB Administrator [Sun, 27 Dec 2015 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in
Mike Frysinger [Sat, 26 Dec 2015 23:22:37 +0000 (18:22 -0500)]
sim: bfin: avoid stack error under asan
We set up an array of 3 elements and then index into it with a 2bit
value. We check the range before we actually use the pointer, but
the indexing is enough to make asan upset, so just stuff a fourth
value in there to keep things simple.
Mike Frysinger [Sat, 26 Dec 2015 19:16:51 +0000 (14:16 -0500)]
sim: sim-core: pass down cpu to hw accesses when available
The bfin port has been using the device callback largely so it could be
passed the cpu when available. Add this logic to the common core code
so all ports get access to the active cpu.
The semantics of these buffer functions are changed slightly in that
errors halt the engine synchronously rather than returning the length
to the caller. We'll probably adjust this in a follow up commit.
The bfin code isn't updated just yet as it has a bit more logic in the
device layer that needs to be unwound at which point we can delete it
entirely.