Commit Graph

86101 Commits

Author SHA1 Message Date
Mike Frysinger 2032176651 libiberty: dupargv: rewrite to use xstrdup
This func is basically open coding the xstrdup function, so gut it
and use it directly.
2016-01-05 15:02:57 -05:00
Patrick Palka 4bec0ef03e 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.
2016-01-05 15:01:28 -05:00
Nick Clifton 13b356b2b5 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).
2016-01-05 14:58:34 -05:00
Mike Frysinger 6675033211 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
2016-01-05 14:46:57 -05:00
Mike Frysinger 402cf05346 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.
2016-01-05 14:37:46 -05:00
Mike Frysinger 1a846c6262 sim: aarch64: switch to common disassembler tracing
The output should largely be the same.
2016-01-05 14:37:46 -05:00
Mike Frysinger 824c862804 sim: bfin: add support disasm tracing 2016-01-05 14:37:45 -05:00
Mike Frysinger 70d3944832 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.
2016-01-05 14:37:33 -05:00
Mike Frysinger bfb2629c16 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.
2016-01-05 14:28:37 -05:00
Nick Clifton 4eb70007f1 Add myself as the maintainer for the AArch64. 2016-01-05 16:49:26 +00:00
Nick Clifton 296ebfbb91 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.
2016-01-05 16:43:58 +00:00
Pedro Alves fa89c1268f 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.
2016-01-05 11:12:31 +00:00
Pedro Alves 976102cd17 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.
2016-01-05 11:03:40 +00:00
Mike Frysinger 44ddb0c66a sim: use STATE_MAGIC helper 2016-01-04 23:01:14 -05:00
Mike Frysinger bc273e1751 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.
2016-01-04 22:24:03 -05:00
Tristan Gingold ac8eefeb24 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).
2016-01-04 20:09:24 -05:00
GDB Administrator 6f9a11d389 Automatic date update in version.in 2016-01-05 00:00:08 +00:00
Maciej W. Rozycki 2f2da8fd3f 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.
2016-01-04 23:35:03 +00:00
Maciej W. Rozycki a3dc0a7f65 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.
2016-01-04 23:32:34 +00:00
Maciej W. Rozycki d537eeb527 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.
2016-01-04 23:30:00 +00:00
Maciej W. Rozycki 43d223b543 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'.
2016-01-04 23:16:45 +00:00
Maciej W. Rozycki b2e9744f80 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.
2016-01-04 23:15:03 +00:00
Maciej W. Rozycki 28d45e28be 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.
2016-01-04 23:13:10 +00:00
Maciej W. Rozycki 23ba6f1807 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.
2016-01-04 23:00:24 +00:00
Maciej W. Rozycki cf8502c131 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.
2016-01-04 22:49:59 +00:00
Maciej W. Rozycki dcb1c79659 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.
2016-01-04 22:48:14 +00:00
Mike Frysinger 8d7d784e23 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.
2016-01-04 05:08:26 -05:00
Mike Frysinger 9bbf6f91c6 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.
2016-01-04 05:04:30 -05:00
Mike Frysinger 13adda68c5 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.
2016-01-04 05:04:04 -05:00
Markus Metzger 43368e1d9a 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.
2016-01-04 09:43:39 +01:00
Mike Frysinger 77cf2ef5dc 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.
2016-01-03 22:07:39 -05:00
Mike Frysinger 3726f72c65 sim: TODO: move to wiki
We're maintaining development docs in the wiki now:
	https://sourceware.org/gdb/wiki/Sim/TODO
2016-01-03 19:54:25 -05:00
GDB Administrator db18b05b4b Automatic date update in version.in 2016-01-04 00:00:08 +00:00
Mike Frysinger 61971b86bb 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.
2016-01-03 04:23:10 -05:00
Mike Frysinger 34fed69938 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.
2016-01-03 04:08:56 -05:00
Mike Frysinger aba6f46b23 sim: nrun: use lbasename 2016-01-03 03:50:08 -05:00
Mike Frysinger 0cb8d8513c 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.
2016-01-03 00:52:51 -05:00
Mike Frysinger 1ac72f0659 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.
2016-01-03 00:18:07 -05:00
GDB Administrator 987f873905 Automatic date update in version.in 2016-01-03 00:00:15 +00:00
Mike Frysinger b3fbb288af sim: cris: use standard output helpers
The sim-io module provides output helpers, so no need to define local
ones anymore.
2016-01-02 14:00:48 -05:00
Mike Frysinger 027e73b217 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 11409fac6b in the
common code.
2016-01-02 10:39:13 -05:00
Mike Frysinger d47f5b30d8 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.
2016-01-02 10:27:56 -05:00
Mike Frysinger 32273fe68f 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.
2016-01-02 03:40:32 -05:00
Mike Frysinger dea827fc5c 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.
2016-01-02 03:38:29 -05:00
GDB Administrator 4a2abdc468 Automatic date update in version.in 2016-01-02 00:00:08 +00:00
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
Alan Modra 3499769a6a New 2016 binutils ChangeLog files
Note that this does not create bfd/doc/ChangeLog, */testsuite/ChangeLog
and include/*/ChangeLog files.
2016-01-01 22:59:42 +10:30
Alan Modra 4120fa118f binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Joel Brobecker edd8878834 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.
2016-01-01 08:26:14 +04:00