Commit Graph

79395 Commits

Author SHA1 Message Date
Nick Clifton 0a9c7b2bf1 When parsing a DW_FORM_ref_addr attribute the CU containing the
abbreviation may not be the current CU.  Thus we need to make sure
that when we read the abbreviation we use the correct CU.

	* dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr
	attributes select the CU containing the abbreviation, which may not
	be the current CU.
2014-01-28 13:43:35 +00:00
Nick Clifton 342df9df24 A recent change to the BFD library has meant that the osabi field in
ELF headers will be copied from input files.  This in turn has broken
the strip-10 test in the binutils testsuite, so this patch updates the
expected output.

	PR binutils/16318
	* binutils-all/strip-10.d: Allow "System V" in the osabi field.
2014-01-28 13:33:29 +00:00
Nick Clifton 1ade065130 The MSP430 linker contains emulations for old and obsolete MCU types.
Since all MCUs now have their own specific linker script (courtesy of
TI) there is no need for these emulations and so this patch removes
them.

	* Makefile.am: Remove obsolete MSP430 emulations.
	* configure.tgt: Likewise.
	* emulparams/msp430all.sh: Likewise.
	* Makefile.in: Regenerate.
2014-01-28 12:25:48 +00:00
Nick Clifton d82ba9f90a A recent update to the binutils means that RELA sections now have the
SHF_INFO_LINK bit set, which shows up in readelf section dumps.  This
has broken a couple of IA64 testcases in the gas testsuite, which are
fixed by this patch.

	PR binutils/16317
	* gas/ia64/group-2.d: Expect I attribute with RELA sections.
	* gas/ia64/xdata.d: Likewise.
2014-01-28 12:18:01 +00:00
Nick Clifton bcf1df010c Update the tic6x linker tests to match the current behaviour of the linker and readelf.
PR binutils/16317
	* ld-tic6x/shlib-1.rd: Expect I attribute with RELA sections.
	* ld-tic6x/shlib-1b.rd: Likewise.
	* ld-tic6x/shlib-1r.rd: Likewise.
	* ld-tic6x/shlib-1rb.rd: Likewise.
	* ld-tic6x/shlib-app-1rd: 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.
	* ld-tic6x/static-app-1.rd: Likewise.
	* ld-tic6x/static-app-1b.rd: Likewise.
	* ld-tic6x/static-app-1r.rd: Likewise.
	* ld-tic6x/static-app-1rb.rd: Likewise.

	PR binutils/16318
	* ld-tic6x/tic6x.exp: Expect C6000 osabi value in relocatable
	objects.
2014-01-28 11:56:13 +00:00
Joel Brobecker c6044dd124 New Ada maintenance command to ignore descriptive types (DWARF).
Currently, Ada debugging requires the use of certain GNAT-specific
encodings, which are generated by the compiler. These encodings
were created a long time ago to work around the fairly limited
capabilities of the stabs debugging format. With DWARF, the vast
majority of the encodings could be abandoned in favor of a pure
DWARF approach.

In order to make it easier to evaluate the quality of the DWARF
debugging information generated by the compiler, and how the debugger
handles it, we are introducing a small Ada-specific maintenance
setting which changes the debugger's behavior to ignore descriptive
types. Descriptive types are artificial types generated by the
compiler purely to give the debugger hints as to how to properly
decode certain properties of a type.  For instance, for array
types, it generates a parallel type whose name is the name of
the array suffixed with ___XA, whose contents tells us what
the array's index type is, and possibly its bounds. See GCC's
gcc/ada/exp_dbug.ads for the full description of all encodings.

This is only a first step, as this setting does not deactivate
all encodings; More settings dedicated to each type of encoding
will likely be implemented in the future, as we make progress.

gdb/ChangeLog:

        * ada-lang.c (maint_set_ada_cmdlist, maint_show_ada_cmdlist):
        New static globals.
        (maint_set_ada_cmd, maint_show_ada_cmd): New functions.
        (ada_ignore_descriptive_types_p): New static global.
        (find_parallel_type_by_descriptive_type): Return immediately
        if ada_ignore_descriptive_types_p is set.
        (_initialize_ada_language): Register new commands "maintenance
        set ada", "maintenance show ada", "maintenance set ada
        ignore-descriptive-types" and "maintenance show ada
        ignore-descriptive-types".
        * NEWS: Add entry for new "maint ada set/show
        ignore-descriptive-types" commands.

gdb/doc/ChangeLog:

        * gdb.texinfo (Ada Glitches): Document the new "maint ada set/show
        ignore-descriptive-types". commands.
2014-01-28 07:01:48 +04:00
Alan Modra a83c8245aa daily update 2014-01-28 09:30:42 +10:30
Markus Metzger 568e808b7d btrace: initiate teardown when closing record btrace target
The to_teardown_btrace target method is used to free btrace resources
during shutdown when target record has already been unpushed and we
can't reliably talk to a remote target to disable branch tracing.

Tracing resources are freed for each thread when the thread is removed;
both on the GDB side and on the gdbserver side.

In the remote case, the remote target that provides to_teardown_btrace
to free the GDB side resources has already been unpushed when threads
are destroyed.  This results in a complaint "You can't do this ..." and
in a few bytes of memory leaked for each thread.

Initiate btrace teardown in record_btrace_close, so the remote target is
still in place.

2014-01-27  Markus Metzger  <markus.t.metzger@intel.com>

	* record-btrace.c (record_btrace_close): Call btrace_teardown
	for all threads.
2014-01-27 08:56:16 +01:00
Joel Brobecker 467d141bf5 ada-lang.c: Really include "ui-out.h".
Currently, ada-lang.c pretends to include "ui-out.h" as follow:

    #ifdef UI_OUT
    #include "ui-out.h"
    #endif

However, UI_OUT is never defined as far as I can tell. This is confirmed
by rebuilding with a #error pragma inside the #ifdef UI_OUT block,
which never triggers.

Since this unit makes references to declarations from ui-out.h,
this patch simply removes the #ifdef/#endif condition.  This has not
been an error so far because "ui-out.h" indirectly gets included,
via one of the other .h files being included.

gdb/ChangeLog:

        * ada-lang.c: Remove "#ifdef UI_OUT" condition for including
        "ui-out.h".
2014-01-27 08:29:47 +04:00
Joel Brobecker fb15121096 Try printing array range using the name of its index type
type Char_Table is array (Character range Character'First .. Character'Last)
     of Natural;

Trying to print the type description of this type currently yields:

   (gdb) ptype char_table
   type = array ('["00"]' .. '["ff"]') of natural

Although technically correct, it seemed more useful to print the array
range as:

   (gdb) ptype char_table
   type = array (character) of natural

This patch implements this suggestion.

gdb/ChangeLog:

        * ada-typeprint (type_is_full_subrange_of_target_type):
        New function.
        (print_range): Add parameter bounds_prefered_p.  If not set,
        try printing range types using the name of their base type.
        (print_range_type): Add parameter bounds_prefered_p.
        Use it in call to print_range.
        (print_array_type, ada_print_type): Update calls to print_range
        and print_range_type.

gdb/testsuite/ChangeLog:

        * gdb.ada/array_char_idx: New testcase.
2014-01-27 08:27:21 +04:00
Joel Brobecker aba0210970 Remove unncessary function declarations in ada-typeprint.c.
These declarations are unncessary, and make it extra work when trying
to change the profile of one of these functions. This patch just
removes them.

Note that one of them (print_dynamic_range_bound), was improperly
indented.

gdb/ChangeLog:

        * ada-typeprint.c (print_array_type, print_choices, print_range)
        (print_range_bound, print_dynamic_range_bound, print_range_type):
        Remove declaration.
2014-01-27 08:21:36 +04:00
Joel Brobecker e62e21fd47 Add missing empty line after declaration in ada-typeprint.c:print_range.
gdb/ChangeLog:

        * ada-typeprint.c (print_range): Add missing empty line
        after local declaration.
2014-01-27 08:19:54 +04:00
Joel Brobecker 859cf5d1de [Ada] Array bound incorrectly printed for array indexed by enum subrange
Consider the following declarations:

   type Range_Type is (One, Two, Three);
   type Array_Type is array (Range_Type range One .. Two) of Integer;
   A : Array_Type := (1, 2);

Trying to print A can yield:

   (gdb) print a
   $1 = (one => 1, 2)

The bound of the first element should not have been printed, since
"one" is the first enumerate of type Range_Type. Similarly, with
the following declarations:

   type Array2_Type is array (Range_Type range Two .. Three) of Integer;
   A2 : Array2_Type := (2, 3);

GDB is failing to print the bound of the first element of "A2":

   (gdb) print a2
   $2 = (2, 3)

This is because the index type for both types Array_Type and Array2_Type
are subranges (by DWARF definition for arrays), of an anonymous subrange
type. When deciding whether to print the bound of the first element,
we handle subranges, but only up to one level. This patch enhanced
the code to handle any number of subrange levels.

gdb/ChangeLog:

        * ada-valprint.c (print_optional_low_bound): Get index_type's
        target type for as long as it is a TYPE_CODE_RANGE.

No testcase with this patch, but this will be tested via the testcase
of another patch, which uses the DWARF assembler to generate debugging
info for an array indexed by an enum.
2014-01-27 08:13:49 +04:00
Joel Brobecker 25790f6fc1 Remove assert in procfs.c::procfs_make_note_section (x86-solaris)
On x86-solaris, the gcore command sometimes triggers the following
internal error:

    (gdb) gcore
    /[...]/procfs.c:5523: internal-error: procfs_make_note_section: Assertion `thread_args.note_data != note_data' failed.

The problem is extremely elusive, for reasons that will become clearer
as I explain what is going on.

The program used to produce this issue was really simple:

    | void break_me (void) { }
    |
    | int
    | main (void)
    | {
    |   break_me ();
    |   return 0;
    | }

The procfs_make_note_section builds a buffer incrementally with
the contents of the core's notes section.  The interesting bits are:

  char *note_data = NULL;
  [...]
  note_data = (char *) elfcore_write_prpsinfo (obfd,
                                               note_data,
                                               note_size,
                                               fname,
                                               psargs);

This is the first call to bfd's elfcore which initializes note_data.
After that, we have a few more calls, which keep updating notes_data
and note_size, but our interest lies in the following part of
the function:

  thread_args.note_data = note_data;
  [...]
  proc_iterate_over_threads (pi, procfs_corefile_thread_callback,
                             &thread_args);
  /* There should be always at least one thread.  */
  gdb_assert (thread_args.note_data != note_data);

The comment implies that the assert is to verify that our loop
iterated over at least one thread. The check is relying on the
fact that the notes_data returned by the elfcore module changes
at each iteration, via (in procfs_corefile_thread_callback):

      args->note_data = procfs_do_thread_registers (args->obfd, ptid,
                                                    args->note_data,
                                                    args->note_size,
                                                    args->stop_signal);

(which calls elfcore_write_lwpstatus).

But, while it happens most of the time, thanks to a call to realloc
in elfcore_write_note (the function that actually appends the data
at the end of the notes buffer),...

       buf = (char *) realloc (buf, *bufsiz + newspace);

... this is by no means guarantied. In fact, under the right
circumstances, the buffer was grown twice without changing
addresses. Unfortunately, the circumstances are very sensitive,
thus making this bug very elusive.

This patch fixes the problem by simply removing the assert.
This means we're losing the assertion that there is at least one
thread, but I think that's OK. If we still want to keep the
assertion, we have the option of either checking the buffer
size, or else adding a boolean flag in the context structure
that we'd set to true as soon as we have a thread.

gdb/ChangeLog:

        * procfs.c (procfs_make_note_section): Remove assertion and
        associated comment.
2014-01-27 07:01:09 +04:00
Alan Modra cc64f6178e daily update 2014-01-27 09:30:42 +10:30
Alan Modra d3c3a74638 daily update 2014-01-26 09:31:04 +10:30
Alan Modra 49a8347dbf daily update 2014-01-25 09:31:10 +10:30
DJ Delorie 34b822e3bc Add .data and .bss refsym symbols
For each object, if it has a nonempty .data or .bss section,
emit a symbol that could cause the startup code to selectively
link in the code to initialize those sections.

* config/tc-msp430.c (msp430_section): Always flag data sections,
regardless of -md.
(msp430_frob_section): New.  Make sure all sections are noticed if
they have content.
(msp430_lcomm): New.  Flag bss if .lcomm is seen.
(msp430_comm): New.  Likewise.
(md_pseudo_table): Add them.
* config/tc-msp430.h (msp430_frob_section): Declare.
(tc_frob_section): Define.
2014-01-24 14:43:58 -05:00
H.J. Lu a5262f834a Replace .align with .p2align
* ld-elf/pr16498a.s: Replace .align with .p2align.
2014-01-24 10:01:56 -08:00
H.J. Lu a78ad74bbf Add another testcase for PR ld/16498
PR ld/16498
	* ld-elf/pr16498b.d: New file.
	* ld-elf/pr16498b.t: Likewise.
2014-01-24 09:03:21 -08:00
H.J. Lu d85e71fec0 Improve orphaned TLS section handling
ld/

	PR ld/16498
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Improve
	orphaned TLS section handling.

ld/testsuite/

	PR ld/16498
	* ld-elf/pr16498a.d: New file.
	* ld-elf/pr16498a.s: Likewise.
	* ld-elf/pr16498a.t: Likewise.
2014-01-24 08:56:07 -08:00
Yao Qi 6b6aa82881 Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo
Functions remote_read_bytes and get_core_siginfo are the callees of
target to_xfer_partial interface, so argument 'len' should be changed
to type ULONGEST.

gdb:

2014-01-24  Yao Qi  <yao@codesourcery.com>

	* remote.c (remote_read_bytes): Change type of len to ULONGEST.
	* corelow.c (get_core_siginfo): Likewise.
2014-01-24 21:31:30 +08:00
Yao Qi 5d6df42390 Change len's type to ULONGEST: remote_write_bytes_aux
Hi,
This patch changes the type of 'len' from ssize_t to ULONGEST.

At the beginning Siddhesh Poyarekar proposed this patch

  [PATCH] Memory reads and writes should have size_t length
  https://sourceware.org/ml/gdb-patches/2012-05/msg01073.html

to change type of 'len' to size_t.  However, after Jan's review, we
decide to change it to ssize_t, because callers of these functions
may pass signed type to them.

AFAICS, the target layer is a boundary.  In one side, we pass size_t
or ssize_t to target related APIs, and in the other side, the
implementation side, we used LONGEST (ULONGEST in latest code) because
of to_xfer_partial.

Since remote_write_bytes_aux and remote_write_bytes belong to the
implementation of remote target, we should use ULONGEST for len, IMO.

Regression tested on x86_64-linux.  Is it OK?

gdb:

2014-01-24  Yao Qi  <yao@codesourcery.com>

	* remote.c (remote_write_bytes_aux): Change type of 'len' to
	ULONGEST.  Don't check 'len' is negative.
	(remote_write_bytes):  Change type of 'len' to ULONGEST.
2014-01-24 21:31:26 +08:00
Alan Modra d9d94ac86b TLS orphan section placement
Ensures TLS orphans are placed adjacent to existing TLS sections,
and fixes places where the output_section_statement flags (which might
not be set) were tested when bfd_section flags were available.

	* ldlang.c (lang_output_section_find_by_flags): Be careful to
	test look->bfd_section->flags if available rather than
	look->flags.  Separate SEC_THREAD_LOCAL handling from
	SEC_READONLY loop, and rewrite.
2014-01-24 23:17:28 +10:30
Alan Modra 3ba720c788 Fixes powerpc64le ld segfaults when --emit-relocs is used.
ELFv2 needs fewer relocs to annotate plt call stubs.  I correctly
allocated a smaller buffer and wrote the proper relocs, but stupidly
bumped the reloc count as for ELFv1.

	* elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed
	to get_relocs for ELFv2.
2014-01-24 14:26:39 +10:30
Alan Modra 598beeff91 daily update 2014-01-24 09:30:59 +10:30
Nick Clifton 8e75a78f36 Remove the display of known MCU names from the MSP430 port of GAS.
New MSP430 MCU parts are being created by TI all the time and the
list is basically always out of date.  Instead any name will be
accepted by the -mmcu= command line option.  ISA selection is now
based upon the -mcpu= command line option, just as is done for GCC.

gas/ChangeLog
	* config/tc-msp430.c (show_mcu_list): Delete.
	(md_parse_option): Accept any MCU name.  Accept several more
	variants for the -mcpu option.
	(md_show_usage): Do not call show_mcu_list.
2014-01-23 17:08:24 +00:00
H.J. Lu d923cae027 Issue a linker error if TLS sections are not adjacent
Bad linker script may lead to TLS sections separated by non-TLS sections
in output.  This patch changes linker assert to a linker error to
provide better linker diagnosis.

	PR ld/16498
	* elf.c (_bfd_elf_map_sections_to_segments): Issue a linker error
	if TLS sections are not adjacent.
2014-01-23 08:15:17 -08:00
Tom Tromey 83b645b833 avoid python exception in FrameDecorator.py
This fixes a bug in FrameDecorator.py.

FrameVars seems to assume that Frame.block can return None if there is
no block.  However, it actually throws an exception.

I saw this bug while developing a frame filter, but unfortunately I
don't know how to reproduce it.  It seems to me that the SAL tests in
_is_limited_frame should exclude the bad cases; and in my attempts to
write a test they do.

Nevertheless I think the fix is reasonably obvious and ought to go in.

2014-01-23  Tom Tromey  <tromey@redhat.com>

	PR python/16485:
	* python/lib/gdb/FrameDecorator.py: (FrameVars.fetch_frame_args):
	Handle exception from frame.block.
	(FrameVars.fetch_frame_locals): Likewise.
2014-01-23 08:03:52 -07:00
Tom Tromey 0740f8d82d fix erroneous error-handling in frame filter code
This fixes PR python/16487.

The bug here is that the function-name-handling code in py_print_frame
had a small logic error (really a misplaced closing brace).  This
error could lead to a Py_DECREF(NULL), which crashes.

This patch fixes the bug in the obvious way.

Built and regtested on x86-64 Fedora 18.  New test case included.

2014-01-23  Tom Tromey  <tromey@redhat.com>

	PR python/16487:
	* python/py-framefilter.c (py_print_frame): Don't call Py_DECREF
	on a NULL pointer.  Move "goto error" to correct place.

2014-01-23  Tom Tromey  <tromey@redhat.com>

	PR python/16487:
	* gdb.python/py-framefilter.exp: Add test using "Error" filter.
	* gdb.python/py-framefilter.py (ErrorInName, ErrorFilter): New
	classes.
2014-01-23 08:03:51 -07:00
Tom Tromey 21909fa1c6 fix crash in frame filters
apply_frame_filter calls ensure_python_env before computing the
gdbarch to use.  This means that python_gdbarch can be NULL while in
Python code, and if a frame filter depends on this somehow (easy to
do), gdb will crash.

The fix is to compute the gdbarch first.

Built and regtested on x86-64 Fedora 18.
New test case included.

2014-01-23  Tom Tromey  <tromey@redhat.com>

	PR python/16491:
	* python/py-framefilter.c (apply_frame_filter): Call
	ensure_python_env after computing gdbarch.

2014-01-23  Tom Tromey  <tromey@redhat.com>

	PR python/16491:
	* gdb.python/py-framefilter.py (Reverse_Function.function): Read a
	string from an inferior frame.
	* gdb.python/py-framefilter-mi.exp: Update.
2014-01-23 08:03:50 -07:00
Yao Qi 17fde6d091 Use gdb_byte * instead of void *
This patch changes the argument type to gdb_byte * in order to align
with the to_xfer_partial interface.

gdb:

2014-01-23  Yao Qi  <yao@codesourcery.com>

	* target.c (raw_memory_xfer_partial): Change argument type
	from void * to gdb_byte *.
	(memory_xfer_partial_1, memory_xfer_partial): Likewise.
2014-01-23 11:50:29 +08:00
Doug Evans f5a0277332 * gdbthread.h (gdb_id_to_thread): Delete, unused. 2014-01-22 16:42:07 -08:00
Alan Modra 3d426a9e38 daily update 2014-01-23 09:31:08 +10:30
Doug Evans 87ce2a04c5 New gdbserver option --debug-format=timestamp.
* NEWS: Mention it.

	gdbserver/
	* configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
	* configure: Regenerate.
	* config.in: Regenerate.
	* Makefile.in (SFILES): Add debug.c.
	(OBS): Add debug.o.
	* debug.c: New file.
	* debug.h: New file.
	* linux-aarch64-low.c (*): Update all debugging printfs to use
	debug_printf instead of fprintf.
	* linux-arm-low.c (*): Ditto.
	* linux-cris-low.c (*): Ditto.
	* linux-crisv32-low.c (*): Ditto.
	* linux-m32r-low.c (*): Ditto.
	* linux-sparc-low.c (*): Ditto.
	* linux-x86.c (*): Ditto.
	* linux-low.c (*): Ditto.
	(linux_wait_1): Add calls to debug_enter, debug_exit.
	(linux_wait): Remove redundant debugging printf.
	(stop_all_lwps): Add calls to debug_enter, debug_exit.
	(linux_resume, unstop_all_lwps): Ditto.
	* mem-break.c (*): Update all debugging printfs to use
	debug_printf instead of fprintf.
	* remote-utils.c (*): Ditto.
	* thread-db.c (*): Ditto.
	* server.c #include <ctype.h>, "gdb_vecs.h".
	(debug_threads): Moved to debug.c.
	(*): Update all debugging printfs to use debug_printf instead of
	fprintf.
	(start_inferior): Replace call to fflush with call to debug_flush.
	(monitor_show_help): Mention set debug-format.
	(parse_debug_format_options): New function.
	(handle_monitor_command): Handle "monitor set debug-format".
	(gdbserver_usage): Mention --debug-format.
	(main): Parse --debug-format.
	* server.h (debug_threads): Declaration moved to debug.h.
	#include "debug.h".
	* tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
	trace_debug_1 that uses debug_printf.
	(tracepoint_look_up_symbols): Update all debugging printfs to use
	debug_printf instead of fprintf.

	doc/
	* gdb.texinfo (Server): Mention --debug-format=all|none|timestamp.
	(gdbserver man): Ditto.

	testsuite/
	* gdb.server/server-mon.exp: Add tests for "set debug-format".
2014-01-22 14:17:39 -08:00
DJ Delorie 96b961024c Add .refsym to msp430 backend
* config/tc-msp430.c (msp430_refsym): New: ".refsym <symbol>"
* doc/c-msp430.texi (MSP430 Directives): Document it.

The purpose of this patch is to provide a way for one object file
to require the inclusion of another object, without having to
allocate space for a .word address reference.
2014-01-22 16:41:13 -05:00
Michael Zolotukhin 7c84a0ca90 Remove regzmm from AVX2 gather assert
Since regzmm can't be used in AVX2 gather instructions, there is no need
to check regzmm in AVX2 gather assert.

2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	* config/tc-i386.c (check_VecOperands): Remove regzmm from AVX2
	gather assert.
2014-01-22 11:39:02 -08:00
Michael Zolotukhin 8444f82a1d Add check for invalid register in AVX512 gathers
AVX512 gather instructions shouldn't accept the same register for both
destination and index.

gas/

2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	PR gas/16489
	* config/tc-i386.c (check_VecOperands): Add check for invalid
	register set in AVX512 gathers.

gas/testsuite/

2014-01-22  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

	PR gas/16489
	* gas/i386/vgather-check.s: Add tests for AVX512 gathers.
	* gas/i386/x86-64-vgather-check.s: Likewise.
	* gas/i386/vgather-check-error.l: Update correspondingly.
	* gas/i386/vgather-check-none.d: Likewise.
	* gas/i386/vgather-check-warn.d: Likewise.
	* gas/i386/vgather-check-warn.e: Likewise.
	* gas/i386/vgather-check.d: Likewise.
	* gas/i386/x86-64-vgather-check-error.l: Likewise.
	* gas/i386/x86-64-vgather-check-none.d: Likewise.
	* gas/i386/x86-64-vgather-check-warn.d: Likewise.
	* gas/i386/x86-64-vgather-check-warn.e: Likewise.
	* gas/i386/x86-64-vgather-check.d: Likewise.
2014-01-22 10:01:12 -08:00
Andreas Arnez 237b092b9f gdb/ChangeLog:
* syscalls/s390x-linux.xml: New file.
	* syscalls/s390-linux.xml: New file.
	* s390-linux-tdep.c (XML_SYSCALL_FILENAME_S390): New macro.
	(XML_SYSCALL_FILENAME_S390X): Likewise.
	(op_svc): New enum value for SVC opcode.
	(s390_sigtramp_frame_sniffer): Replace literal by 'op_svc'.
	(s390_linux_get_syscall_number): New function.
	(s390_gdbarch_init): Register '*get_syscall_number' and the
	syscall xml file name.
	* data-directory/Makefile.in (SYSCALLS_FILES): Add
	"s390-linux.xml" and "s390x-linux.xml".
	* NEWS: Announce new feature.

gdb/testsuite/ChangeLog:
	* gdb.base/catch-syscall.exp: Activate test on s390*-linux.
2014-01-22 18:54:43 +01:00
Andreas Arnez d674a7090f Fix regression on s390x with entry-values.exp.
The trace-specific test case 'entry-values' concludes fairly late in
the process that this platform doesn't support trace.  Before that,
there are some platform specifics that don't work on s390x.  The fix
addresses two aspects:

(1) Removal of an excess space character in the regex for the
    disassembly.  This is needed when there is a function alignment
    gap, because then the hex address is immediately followed by a
    colon, like in the first 'nopr' line below:

    (gdb) disassemble foo+50,+10
    Dump of assembler code from 0x32 to 0x3c:
       0x0000000000000032 <foo+50>: br      %r4
       0x0000000000000034:  nopr    %r7
       0x0000000000000036:  nopr    %r7
       0x0000000000000038 <bar+0>:  stmg    %r11,%r15,88(%r15)
    End of assembler dump.

(2) Handling for the s390-specific call instruction.

gdb/testsuite/ChangeLog:
	* gdb.trace/entry-values.exp: Remove excess space character from
	regex patterns.  Handle s390 call instruction.
2014-01-22 17:02:13 +01:00
Andreas Arnez 20fa339009 Re-introduce '_start' labels and add alignment in dw2-dir-file-name test case.
On ppc64-linux a function symbol does not point to code, but to the
function descriptor.  Thus the previous change for this test case
broke it:

      https://sourceware.org/ml/gdb-patches/2014-01/msg00275.html

This patch reverts to the original method, re-introducing '_start'
symbols.  In addition, it adds sufficient alignment before the label,
such that the label never points into an alignment gap.

gdb/testsuite/ChangeLog:
	* gdb.dwarf2/dw2-dir-file-name.c (FUNC): Insert alignment and
	define "*_start" label.  Make "name" static.
	* gdb.dwarf2/dw2-dir-file-name.exp: Replace references to
	${name} by references to ${name}_start.
2014-01-22 17:02:13 +01:00
Andreas Arnez 7846671423 Prevent appending "-g" after "-g3" to compile options in info-macros.exp.
When upstream gcc is given a command line with the "-g" option after
"-g3", it doesn't generate a ".debug_macro" section.  This is because
the last option wins, thus downgrading the debug level again.  Without
any macro debug information in the executable, info-macros.exp
obviously produces many failures.

Since the "-g" option is appended by DejaGnu's target_compile whenever
the "debug" option is set, the fix just removes that option.

gdb/testsuite/ChangeLog:
	* gdb.base/info-macros.exp: Remove "debug" from the compile
	options.
2014-01-22 17:02:13 +01:00
Baruch Siach 54bff65084 gdb: xtensa: fix on 64-bit hosts
On 64-bit hosts unsigned long is 64 bit.  Use uint32_t instead.

gdb/
2014-01-22  Baruch Siach  <baruch@tkos.co.il>

	* xtensa-tdep.h (xtensa_elf_greg_t): Change type to uint32_t.
2014-01-22 12:12:24 +00:00
Pedro Alves 14e361d7aa xtensa-config.c: missing defs.h include.
All .c files must start by including defs.h.

2014-01-22  Pedro Alves  <palves@redhat.com>

	* xtensa-config.c: Include defs.h.
2014-01-22 12:03:29 +00:00
Alan Modra 16e4ecc0db Display the reference causing a shared library to be needed
Adds a section for --as-needed libraries to a linker map file, similar
to what we do for archive libraries.

bfd/
	* elflink.c (elf_link_add_object_symbols): Call minfo for --as-needed.
ld/
	* ldlang.c (asneeded_list_head, asneeded_list_tail): New vars.
	(lang_init): Initialise them.
	(lang_print_asneeded): New function.
	(lang_process): Call lang_print_asneeded.
	* ldlang.h (struct asneeded_minfo): New.
	(asneeded_list_tail): Declare.
	* ldmain.c (add_archive_element): Improve archive map heading.
	* ldmisc.c (minfo): Stash --as-needed info.
2014-01-22 16:21:34 +10:30
Alan Modra cda796e168 Fix gas build breakage
* config/tc-tic4x.c (md_shortopts): s/CONST/const/.
2014-01-22 16:21:34 +10:30
Alan Modra eb8d7fda36 Comment typo
* elf64-ppc.c (STK_LINKER): Comment typo fix.
2014-01-22 16:21:33 +10:30
Joel Brobecker 46bbb3edac Add ARI (ok) marker for __func__ reference in common-utils.h
The ARI script flagged the use of the __func__ variable, which
is normally not allowed (not defined in C90). However, this particular
use is OK, as the reference is only made when __STDC_VERSION__ >=
199901L.  So, add an "ARI:" comment to explicitly OK this use.

gdb/ChangeLog:

        * common/common-utils.h: Add "ARI:" comment beside __func__
        reference.
2014-01-22 09:03:31 +04:00
Joel Brobecker 3a80edfc74 Expand documentation of common-utils.h::FUNCTION_NAME
While looking at this macro, I noticed that it wasn't always necessarily
defined. That prompted me to search the current sources to make sure
that all uses were adequately protected, which they were. But to help
prevent future uses to be made unprotected, this patch expands the
current macro documentation a bit.

gdb/ChangeLog:

        * common/common-utils.h (FUNCTION_NAME): Expand the macro's
        documentation a bit.
2014-01-22 09:02:45 +04:00
Alan Modra 7dd9c6eb05 Miscellaneous ld tidies
Localise a struct, prevent an unneeded symbol lookup, and fix a
testcase.

ld/
	* ld.h (struct map_symbol_def): Move to..
	* ldlang.h: ..here.
	* ldlang.c (print_assignment): Don't set expld.assign_name to dot.
ld/testsuite/
	* ld-scripts/pr14962-2.d: Correct target triple.
2014-01-22 12:51:19 +10:30