and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  1. 27 Jan, 2014 11 commits
    • H.J. Lu's avatar
      Update release note for 2.24.51.0.3 · 7908ae0a
      H.J. Lu authored
      7908ae0a
    • H.J. Lu's avatar
      Merge remote-tracking branch 'origin/hjl/linux/master' into hjl/linux/applied · d34dd120
      H.J. Lu authored
      Remove binutils-pr16322.patch and binutils-pr16317.patch, which have
      been upstreamed.  Apply binutils-pr16496.patch.  Update
      binutils-lto-mixed.patch.
      d34dd120
    • H.J. Lu's avatar
    • H.J. Lu's avatar
      Add and apply binutils-pr16496.patch · 6d48a0ee
      H.J. Lu authored
      6d48a0ee
    • Markus Metzger's avatar
      btrace: initiate teardown when closing record btrace target · 568e808b
      Markus Metzger authored
      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.
      568e808b
    • Joel Brobecker's avatar
      ada-lang.c: Really include "ui-out.h". · 467d141b
      Joel Brobecker authored
      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".
      467d141b
    • Joel Brobecker's avatar
      Try printing array range using the name of its index type · fb151210
      Joel Brobecker authored
         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.
      fb151210
    • Joel Brobecker's avatar
      Remove unncessary function declarations in ada-typeprint.c. · aba02109
      Joel Brobecker authored
      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.
      aba02109
    • Joel Brobecker's avatar
      Add missing empty line after declaration in ada-typeprint.c:print_range. · e62e21fd
      Joel Brobecker authored
      gdb/ChangeLog:
      
              * ada-typeprint.c (print_range): Add missing empty line
              after local declaration.
      e62e21fd
    • Joel Brobecker's avatar
      [Ada] Array bound incorrectly printed for array indexed by enum subrange · 859cf5d1
      Joel Brobecker authored
      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.
      859cf5d1
    • Joel Brobecker's avatar
      Remove assert in procfs.c::procfs_make_note_section (x86-solaris) · 25790f6f
      Joel Brobecker authored
      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.
      25790f6f
  2. 26 Jan, 2014 2 commits
  3. 25 Jan, 2014 1 commit
  4. 24 Jan, 2014 9 commits
    • Alan Modra's avatar
      daily update · 49a8347d
      Alan Modra authored
      49a8347d
    • DJ Delorie's avatar
      Add .data and .bss refsym symbols · 34b822e3
      DJ Delorie authored
      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.
      34b822e3
    • H.J. Lu's avatar
      Replace .align with .p2align · a5262f83
      H.J. Lu authored
      	* ld-elf/pr16498a.s: Replace .align with .p2align.
      a5262f83
    • H.J. Lu's avatar
      Add another testcase for PR ld/16498 · a78ad74b
      H.J. Lu authored
      	PR ld/16498
      	* ld-elf/pr16498b.d: New file.
      	* ld-elf/pr16498b.t: Likewise.
      a78ad74b
    • H.J. Lu's avatar
      Improve orphaned TLS section handling · d85e71fe
      H.J. Lu authored
      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.
      d85e71fe
    • Yao Qi's avatar
      Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo · 6b6aa828
      Yao Qi authored
      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.
      6b6aa828
    • Yao Qi's avatar
      Change len's type to ULONGEST: remote_write_bytes_aux · 5d6df423
      Yao Qi authored
      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.
      5d6df423
    • Alan Modra's avatar
      TLS orphan section placement · d9d94ac8
      Alan Modra authored
      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.
      d9d94ac8
    • Alan Modra's avatar
      Fixes powerpc64le ld segfaults when --emit-relocs is used. · 3ba720c7
      Alan Modra authored
      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.
      3ba720c7
  5. 23 Jan, 2014 10 commits
    • Alan Modra's avatar
      daily update · 598beeff
      Alan Modra authored
      598beeff
    • Nick Clifton's avatar
      Remove the display of known MCU names from the MSP430 port of GAS. · 8e75a78f
      Nick Clifton authored
      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.
      8e75a78f
    • H.J. Lu's avatar
      Remove binutils-pr16498.patch · 41990941
      H.J. Lu authored
      The bfd change has been upstreamed.
      41990941
    • H.J. Lu's avatar
    • H.J. Lu's avatar
      Issue a linker error if TLS sections are not adjacent · d923cae0
      H.J. Lu authored
      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.
      d923cae0
    • Tom Tromey's avatar
      avoid python exception in FrameDecorator.py · 83b645b8
      Tom Tromey authored
      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.
      83b645b8
    • Tom Tromey's avatar
      fix erroneous error-handling in frame filter code · 0740f8d8
      Tom Tromey authored
      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.
      0740f8d8
    • Tom Tromey's avatar
      fix crash in frame filters · 21909fa1
      Tom Tromey authored
      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.
      21909fa1
    • Yao Qi's avatar
      Use gdb_byte * instead of void * · 17fde6d0
      Yao Qi authored
      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.
      17fde6d0
    • Doug Evans's avatar
      f5a02773
  6. 22 Jan, 2014 7 commits
    • Alan Modra's avatar
      daily update · 3d426a9e
      Alan Modra authored
      3d426a9e
    • H.J. Lu's avatar
      Add and apply binutils-pr16498.patch · 47a49d86
      H.J. Lu authored
      47a49d86
    • H.J. Lu's avatar
      Remove binutils-pr16467.patch · df0d70ed
      H.J. Lu authored
      It has been upstreamed.
      df0d70ed
    • H.J. Lu's avatar
      Update binutils-lto-mixed.patch against master · f21b38aa
      H.J. Lu authored
      f21b38aa
    • Doug Evans's avatar
      New gdbserver option --debug-format=timestamp. · 87ce2a04
      Doug Evans authored
      	* 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".
      87ce2a04
    • H.J. Lu's avatar
    • DJ Delorie's avatar
      Add .refsym to msp430 backend · 96b96102
      DJ Delorie authored
      * 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.
      96b96102