1. 22 Jan, 2018 11 commits
    • Maciej W. Rozycki's avatar
      MAINTAINERS: Update my company e-mail address · d65ce302
      Maciej W. Rozycki authored
      Following my recent transition from Imagination Technologies to the
      reincarnated MIPS company update MAINTAINERS entries accordingly.
      
      	binutils/
      	* MAINTAINERS: Update my company e-mail address.
      
      	gdb/
      	* MAINTAINERS: Update my company e-mail address.
      
      	sim/
      	* MAINTAINERS: Update my company e-mail address.
      d65ce302
    • Oleg Endo's avatar
      Fix the RX assembler so that it can handle escaped double quote characters, ie: \" · 49da480f
      Oleg Endo authored
      	PR 22737
      	* config/tc-rx.c (rx_start_line): Handle escaped double-quote character.
      	* testsuite/gas/rx/pr22737.s: New test.
      	* testsuite/gas/rx/pr22737.d: Likewise.
      	* testsuite/gas/rx/rx.exp: Run the new test.
      49da480f
    • Nick Clifton's avatar
      f433138f
    • Yao Qi's avatar
      regcache::cooked_write test · ec7a5fcb
      Yao Qi authored
      Since my following patches will change how each gdbarch read and write
      pseudo registers, it's better to write a unit test to
      regcache::cooked_write, to make sure my following changes don't cause
      any regressions.  See the comments on cooked_write_test.
      
      gdb:
      
      2018-01-22  Yao Qi  <yao.qi@linaro.org>
      
      	* regcache.c (cooked_write_test): New function.
      	(_initialize_regcache): Register the test.
      ec7a5fcb
    • Yao Qi's avatar
      regcache_cooked_read -> regcache->cooked_read · 11f57cb6
      Yao Qi authored
      Similarly, this patch replaces regcache_cooked_read with
      regcache->cooked_read.
      
      gdb:
      
      2018-01-22  Yao Qi  <yao.qi@linaro.org>
      
      	* ia64-tdep.c (ia64_pseudo_register_read): Call
      	regcache->cooked_read instead of regcache_cooked_read_unsigned.
      	* m32c-tdep.c (m32c_cat_read): Likewise.
      	(m32c_r3r2r1r0_read): Likewise.
      	* m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
      	* xtensa-tdep.c (xtensa_register_read_masked): Likewise.
      11f57cb6
    • Yao Qi's avatar
      Replace regcache_raw_read with regcache->raw_read · 03f50fc8
      Yao Qi authored
      The patch later in this series will move regcache's raw_read and
      cooked_read methods to a new class regcache_read, and regcache is
      dervied from it.  Also pass regcache_read instead of regcache to gdbarch
      methods pseudo_register_read and pseudo_register_read_value.  In order
      to prepare for this change, this patch changes regcache_raw_read to
      regcache->raw_read.  On the other hand, since we are in C++, I prefer
      using class method (regcache->raw_read).
      
      gdb:
      
      2018-01-22  Yao Qi  <yao.qi@linaro.org>
      
      	* aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache
      	method raw_read instead of regcache_raw_read.
      	* amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
      	* arm-tdep.c (arm_neon_quad_read): Likewise.
      	* avr-tdep.c (avr_pseudo_register_read): Likewise.
      	* bfin-tdep.c (bfin_pseudo_register_read): Likewise.
      	* frv-tdep.c (frv_pseudo_register_read): Likewise.
      	* h8300-tdep.c (h8300_pseudo_register_read): Likewise.
      	* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
      	(i386_pseudo_register_read_into_value): Likewise.
      	* mep-tdep.c (mep_pseudo_cr32_read): Likewise.
      	* msp430-tdep.c (msp430_pseudo_register_read): Likewise.
      	* nds32-tdep.c (nds32_pseudo_register_read): Likewise.
      	* rl78-tdep.c (rl78_pseudo_register_read): Likewise.
      	* s390-linux-tdep.c (s390_pseudo_register_read): Likewise.
      	* sparc-tdep.c (sparc32_pseudo_register_read):  Likewise.
      	* sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
      	* spu-tdep.c (spu_pseudo_register_read_spu):  Likewise.
      	* xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.
      03f50fc8
    • Yao Qi's avatar
      Remove mt port · dc711524
      Yao Qi authored
      This patch removes the MT port.  The removal was annoucned
      https://sourceware.org/ml/gdb-announce/2017/msg00006.html
      I'll remove MT from the top-level configure later.
      
      gdb:
      
      2018-01-22  Yao Qi  <yao.qi@linaro.org>
      
      	* Makefile.in (ALL_TARGET_OBS): Remove mt-tdep.o.
      	* configure.tgt: Remove target mt.
      	* mt-tdep.c: Remove.
      	* regcache.c (cooked_read_test): Remove the check for mt.
      dc711524
    • Yao Qi's avatar
      Don't call gdbarch_pseudo_register_read_value in jit.c · 3f5a868b
      Yao Qi authored
      gdbarch_pseudo_register_read_value is not implemented in every gdbarch, so
      the predicate gdbarch_pseudo_register_read_value_p is needed before
      calling it.  However, there is no such guard in jit_frame_prev_register, I
      am wondering how does jit work on the arch without having gdbarch method
      pseudo_register_read_value.
      
      The proper way to get register value is to call cooked_read, and then
      create the value object from the buffer.
      
      gdb:
      
      2018-01-22  Yao Qi  <yao.qi@linaro.org>
      
      	* jit.c (jit_frame_prev_register): Call regcache::cooked_read
      	instead of gdbarch_pseudo_register_read_value.
      3f5a868b
    • Joel Brobecker's avatar
      Ada/DWARF: Assume the Ada compiler produces descriptive type attributes · de4cb04a
      Joel Brobecker authored
      GCC was enhanced in 2011 to generate this attribute, so I think we can
      now assume that it is available when using that compiler. Doing so
      allows us to speed up what we call "parallel type" lookups when
      processing certain types encoded using the GNAT encoding.
      
      This patch changes need_gnat_info to always expect those attributes
      to be generated when the language is Ada. This is an assumption
      that on the surfcace looks like it might be a bit on the edge; but
      in practice, it should be OK because this is only useful in the
      context of handling GNAT-specific encodings. Other Ada compilers
      would presumably produce debugging information using pure DWARF
      constructs, so would not be impacted by this.
      
      gdb/ChangeLog:
      
              * dwarf2read.c (need_gnat_info): Return nonzero if the cu's
              language is Ada.
      
      Tested on x86_64-linux.
      de4cb04a
    • Joel Brobecker's avatar
      wrong line number in breakpoint location · a9e40818
      Joel Brobecker authored
      Consider the following situation, where we have one file containing...
      
          $ cat -n body.inc
               1  i = i + 1;
      
      ... we include that file from some code, like so:
      
          $ cat -n cat -n small.c
              [...]
              17  int
              18  next (int i)
              19  {
              20  #include "body.inc"
              21    return i;
              22  }
      
      When trying to insert a breakpoint on line 18, for instance:
      
          (gdb) b small.c:18
          Breakpoint 1 at 0x40049f: file body.inc, line 18.
                                                        ^^
                                                        ||
      
      Here, the issue is that GDB reports the breakpoint to be in file
      body.inc, which is true, but with the line number that corresponding
      to the user-requested location, which is not correct.
      
      Although the simple reproducer may look slightly artificial,
      the above is simply one way to reproduce the same issue observed
      when trying to insert a breakpoint on a function provided in
      a .h files and then subsequently inlined in a C file.
      
      What happens is the following:
      
        1. We resolve the small.c:18 linespec into a symtab_and_line which
           has "small.c" and 18 as the symtab and line number.
      
        2. Next, we call skip_prologue_sal, which calculates the PC
           past the prologue, and updates the symtab_and_line: PC,
           but also symtab (now body.inc) and the new line (now 1).
      
        3. However, right after that, we do:
      
                  /* Make sure the line matches the request, not what was
                     found.  */
                  intermediate_results.sals[i].line = val.line;
      
      We should either restore both symtab and line, or leave the actual
      line to match the actual symtab.  This patch chose the latter.
      This introduces a few changes in a few tests, which required some
      updates, but looking at those change, I believe them to be expected.
      
      gdb/ChangeLog:
      
              * linespec.c (create_sals_line_offset): Remove code that preserved
              the symtab_and_line's line number.
      
      gdb/testsuite/ChangeLog:
      
              * gdb.base/break-include.c, gdb.base/break-include.inc,
              gdb.base/break-include.exp: New files.
              * gdb.base/ending-run.exp: Minor adaptations due to the breakpoint's
              line number now being the actual line number where the breakpoint
              was inserted.
              * gdb.mi/mi-break.exp: Likewise.
              * gdb.mi/mi-reverse.exp: Likewise.
              * gdb.mi/mi-simplerun.exp: Ditto.
      
      Tested on x86_64-linux.
      a9e40818
    • GDB Administrator's avatar
      Automatic date update in version.in · 3b76a4a0
      GDB Administrator authored
      3b76a4a0
  2. 21 Jan, 2018 7 commits
    • Andrew Burgess's avatar
      gdb: Don't store a thread-id for floating varobj · e707fc44
      Andrew Burgess authored
      When creating a varobj with -var-create a user can create either fixed
      varobj, or floating varobj.
      
      A fixed varobj will always be evaluated within the thread/frame/block in
      which the varobj was created, if that thread/frame/block is no longer
      available then the varobj is considered out of scope.
      
      A floating varobj will always be evaluated within the current
      thread/frame/block.
      
      Despite never using them GDB was storing the thread/frame/block into a
      floating varobj, and the thread-id would then be displayed when GDB
      reported on the state of the varobj, this could confuse a user into
      thinking that the thread-id was relevant.
      
      This commit prevents GDB storing the thread/frame/block onto floating
      varobj, and updates the few tests where this impacts the results.
      
      gdb/ChangeLog:
      
      	* varobj.c (varobj_create): Don't set valid_block when creating a
      	floating varobj.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.python/py-mi.exp: Don't expect a thread-id for floating
      	varobj.
      	* gdb.mi/mi-var-create-rtti.exp: Likewise.
      e707fc44
    • Andrew Burgess's avatar
      gdb: Remove out of date comment · 03d0bf7b
      Andrew Burgess authored
      Comment clean up.
      
      gdb/ChangeLog:
      
      	* varobj.c (varobj_create): Remove out of date comment.
      03d0bf7b
    • Andrew Burgess's avatar
      gdb: PR mi/20395: Fix -var-update for registers in frames 1 and up · ae451627
      Andrew Burgess authored
      This patch fixes a problem with using the MI -var-update command
      to access the values of registers in frames other than the current
      frame.  The patch includes a test that demonstrates the problem:
      
      * run so there are several frames on the stack
      * create a fixed varobj for $pc in each frame, #'s 1 and above
      * step one instruction, to modify the value of $pc
      * call -var-update for each of the previously created varobjs
        to verify that they are not reported as having changed.
      
      Without the patch, the -var-update command reported that $pc for all
      frames 1 and above had changed to the value of $pc in frame 0.
      
      A varobj is created as either fixed, the expression is evaluated within
      the context of a specific frame, or floating, the expression is
      evaluated within the current frame, whatever that may be.
      
      When a varobj is created by -var-create we set two fields of the varobj
      to track the context in which the varobj was created, these two fields
      are varobj->root->frame and var->root->valid_block.
      
      If a varobj is of type fixed, then, when we subsequently try to
      reevaluate the expression associated with the varobj we must determine
      if the original frame (and block) is still available, if it is not then
      the varobj can no longer be evaluated.
      
      The problem is that for register expressions varobj->root->valid_block
      is not set correctly.  This block tracking is done using the global
      'innermost_block' which is set in the various parser files (for example
      c-exp.y).  However, this is not set for register expressions.
      
      The fix then seems like it should be to just update the innermost block
      when parsing register expressions, however, that solution causes several
      test regressions.
      
      The problem is that in some cases we rely on the expression parsing
      code not updating the innermost block for registers, one example is
      when we parse the expression for a 'display' command.  The display
      commands treats registers like floating varobjs, but symbols are
      treated like fixed varobjs.  So 'display $reg_name' will always show
      the value of '$reg_name' even as the user moves from frame to frame,
      while 'display my_variable' will only show 'my_variable' while it is
      in the current frame and/or block, when the user moves to a new frame
      and/or block (even one with a different 'my_variable' in) then the
      display of 'my_variable' stops.  For the case of 'display', without
      the option to force fixed or floating expressions, the current
      behaviour is probably the best choice.  For the varobj system though,
      we can choose between floating and fixed, and we should try to make
      this work for registers.
      
      There's only one existing test case that needs to be updated, in that
      test a fixed varobj is created using a register, the MI output now
      include the thread-id in which the varobj should be evaluated, which I
      believe is correct behaviour.  I also added a new floating test case
      into the same test script, however, right now this also includes the
      thread-id in the expected output, which I believe is an existing gdb
      bug, which I plan to fix next.
      
      Tested on x86_64 Linux native and native-gdbserver, no regressions.
      
      gdb/ChangeLog:
      
      	PR mi/20395
      	* ada-exp.y (write_var_from_sym): Pass extra parameter when
      	updating innermost block.
      	* parse.c (innermost_block_tracker::update): Take extra type
      	parameter, and check types match before updating innermost block.
      	(write_dollar_variable): Update innermost block for registers.
      	* parser-defs.h (enum innermost_block_tracker_type): New enum.
      	(innermost_block_tracker::innermost_block_tracker): Initialise
      	m_types member.
      	(innermost_block_tracker::reset): Take type parameter.
      	(innermost_block_tracker::update): Take type parameter, and pass
      	type through as needed.
      	(innermost_block_tracker::m_types): New member.
      	* varobj.c (varobj_create): Pass type when reseting innermost
      	block.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.mi/basics.c: Add new global.
      	* gdb.mi/mi-frame-regs.exp: New file.
      	* gdb.mi/mi-var-create-rtti.exp: Update expected results, add new
      	case.
      ae451627
    • Andrew Burgess's avatar
      gdb: New API for tracking innermost block · aee1fcdf
      Andrew Burgess authored
      This commit is preparation for a later change, at this point there
      should be no user visible change.
      
      We currently maintain a global innermost_block which tracks the most
      inner block encountered when parsing an expression.
      
      This commit wraps the innermost_block into a new class, and switches all
      direct accesses to the variable to use the class API.
      
      gdb/ChangeLog:
      
      	* ada-exp.y (write_var_from_sym): Switch to innermost_block API.
      	* ada-lang.c (resolve_subexp): Likewise.
      	* breakpoint.c (set_breakpoint_condition) Likewise.
      	(watch_command_1) Likewise.
      	* c-exp.y (variable): Likewise.
      	* d-exp.y (PrimaryExpression): Likewise.
      	* f-exp.y (variable): Likewise.
      	* go-exp.y (variable): Likewise.
      	* m2-exp.y (variable): Likewise.
      	* objfiles.c (objfile::~objfile): Likewise.
      	* p-exp.y (variable): Likewise.
      	* parse.c (innermost_block): Change type.
      	* parser-defs.h (class innermost_block_tracker): New.
      	(innermost_block): Change to innermost_block_tracker.
      	* printcmd.c (display_command): Switch to innermost_block API.
      	(do_one_display): Likewise.
      	* rust-exp.y (do_one_display): Likewise.
      	* symfile.c (clear_symtab_users): Likewise.
      	* varobj.c (varobj_create): Switch to innermost_block API, replace
      	use of innermost_block with block stored on varobj object.
      aee1fcdf
    • Andrew Burgess's avatar
      gdb: Remove duplicate declaration of global innermost_block · 396af9a1
      Andrew Burgess authored
      The global 'innermost_block' is declared in two header files.  Remove
      one of the declarations, and add an include of the other header into
      the one source file that could no longer see a declaration of
      'innermost_block'.
      
      gdb/ChangeLog:
      
      	* expression.h (innermost_block): Remove declaration.
      	* varobj.c: Add 'parser-defs.h' include.
      396af9a1
    • Andrew Burgess's avatar
      gdb: Add test for some error cases of @entry usage · b1b189e0
      Andrew Burgess authored
      Adds a test that using @entry for a non-parameter, or for an unknown
      symbol, both give the expected error.  This error message was
      previously untested.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.arch/amd64-entry-value.exp: Test using @entry on a
      	non-parameter, and on an unknown symbol.
      b1b189e0
    • GDB Administrator's avatar
      Automatic date update in version.in · f49464e4
      GDB Administrator authored
      f49464e4
  3. 20 Jan, 2018 2 commits
    • H.J. Lu's avatar
      x86: Check the versioned __tls_get_addr symbol · 8a1b824a
      H.J. Lu authored
      We need to check the versioned __tls_get_addr symbol when looking up
      "__tls_get_addr".
      
      bfd/
      
      	PR ld/22721
      	* elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
      	versioned __tls_get_addr symbol.
      
      ld/
      
      	PR ld/22721
      	* testsuite/ld-plugin/lto.exp: Run PR ld/22721 tests.
      	* testsuite/ld-plugin/pr22721.t: New file.
      	* testsuite/ld-plugin/pr22721a.s: Likewise.
      	* testsuite/ld-plugin/pr22721b.c: Likewise.
      8a1b824a
    • GDB Administrator's avatar
      Automatic date update in version.in · 44301db1
      GDB Administrator authored
      44301db1
  4. 19 Jan, 2018 17 commits
    • Tom Tromey's avatar
      Fix qualified name lookup for Rust · fcfcc376
      Tom Tromey authored
      In https://github.com/rust-lang/rust/pull/46457, "m4b" pointed out
      that the Rust support in gdb doesn't properly handle the lookup of
      qualified names.
      
      In particular, as shown in the test case in this patch, something like
      "::NAME" should be found in the global scope, but is not.
      
      This turns out to happen because rust_lookup_symbol_nonlocal does not
      search the global scope unless the name in question is unqualified.
      However, lookup_symbol_aux does not search the global scope, and
      appears to search the static scope only as a fallback (I wonder if
      this is needed?).
      
      This patch fixes the problem by changing rust_lookup_symbol_nonlocal
      to search the static and global blocks in more cases.
      
      Regression tested against various versions of the rust compiler on
      Fedora 26 x86-64.  (Note that there are unrelated failures with newer
      versions of rustc; I will be addressing those separately.)
      
      2018-01-19  Tom Tromey  <tom@tromey.com>
      
      	* rust-lang.c (rust_lookup_symbol_nonlocal): Look up qualified
      	symbols in the static and global blocks.
      
      2018-01-19  Tom Tromey  <tom@tromey.com>
      
      	* gdb.rust/modules.rs (TWENTY_THREE): New global.
      	* gdb.rust/modules.exp: Add ::-qualified lookup test.
      fcfcc376
    • Andreas Arnez's avatar
      S390: Fix infcalls in s390-vregs test case · 634c1c31
      Andreas Arnez authored
      GDB used to assume that functions without debug info return int.  It
      accepted an expression containing such a function call and silently
      interpreted the function's return value as int.  But nowadays GDB yields
      an error message instead, see
      
        https://sourceware.org/ml/gdb-patches/2017-07/msg00139.html
      
      This affects the s390-vregs test case, because it contains calls to
      setrlimit64 and chdir.  When no glibc debug info is installed, these lead
      to unnecessary FAILs.  Fix this by adding appropriate casts to the
      inferior function calls.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.arch/s390-vregs.exp: Explicitly cast the return values of
      	setrlimit and chdir to int.
      634c1c31
    • James Clarke's avatar
      gdb: Add missing #ifdef USE_THREAD_DB to gdbserver · a0aad537
      James Clarke authored
      Otherwise, linking fails with:
      
        [...]/linux-low.c:664: undefined reference to `thread_db_notice_clone(thread_info*, ptid_t)'
      
      gdb/gdbserver/ChangeLog:
      
      	* linux-low.c (handle_extended_wait): Surround call to
      	thread_db_notice_clone with #ifdef USE_THREAD_DB.
      a0aad537
    • James Clarke's avatar
      gdb: Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h · 5a6c3296
      James Clarke authored
      On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
      contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
      define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
      earlier; include it from linux-ptrace.h so it can never come afterwards.
      
      gdb/ChangeLog:
      
      	* nat/linux-ptrace.c: Remove unnecessary reinclusion of
      	gdb_ptrace.h, and move including gdb_wait.h ...
      	* nat/linux-ptrace.h: ... to here.
      5a6c3296
    • Simon Marchi's avatar
      Make linux_nat_detach/thread_db_detach use the inferior parameter · bc09b0c1
      Simon Marchi authored
      This patch makes these two functions actually use the inferior parameter
      added by the previous patch, instead of reading inferior_ptid.  I chose
      these two, because they are the one actually used when I detach on my
      GNU/Linux system, so they were easy to test.
      
      I took the opportunity to pass the inferior being detached to
      inf_ptrace_detach_success, so it could use it too.  From there, it made
      sense to add an overload of detach_inferior that takes the inferior
      directly rather than the pid, to avoid having to pass inf->pid only for
      the callee to look up the inferior structure by pid.
      
      gdb/ChangeLog:
      
      	* inf-ptrace.c (inf_ptrace_detach): Adjust call to
      	inf_ptrace_detach_success.
      	(inf_ptrace_detach_success): Add inferior parameter, use it
      	instead of inferior_ptid, pass it to detach_inferior.
      	* inf-ptrace.h (inf_ptrace_detach_success): Add inferior
      	parameter.
      	* inferior.c (detach_inferior): Add overload that takes an
      	inferior object.
      	* inferior.h (detach_inferior): Likewise.
      	* linux-nat.c (linux_nat_detach): Use the inf parameter, don't
      	use inferior_ptid, adjust call to inf_ptrace_detach_success.
      	* linux-thread-db.c (thread_db_detach): Use inf parameter.
      bc09b0c1
    • Simon Marchi's avatar
      Pass inferior down to target_detach and to_detach · 6e1e1966
      Simon Marchi authored
      The to_detach target_ops method implementations are currently expected
      to work on current_inferior/inferior_ptid.  In order to make things more
      explicit, and remove some "shadow" parameter passing through globals,
      this patch adds an "inferior" parameter to to_detach.  Implementations
      will be expected to use this instead of relying on the global.  However,
      to keep things simple, this patch only does the minimum that is
      necessary to add the parameter.  The following patch gives an example of
      how one such implementation would be adapted.  If the approach is deemed
      good, we can then look into adapting more implementations.  Until then,
      they'll continue to work as they do currently.
      
      gdb/ChangeLog:
      
      	* target.h (struct target_ops) <to_detach>: Add inferior
      	parameter.
      	(target_detach): Likewise.
      	* target.c (dispose_inferior): Pass inferior down.
      	(target_detach): Pass inferior down.  Assert that it is equal to
      	the current inferior.
      	* aix-thread.c (aix_thread_detach): Pass inferior down.
      	* corefile.c (core_file_command): Pass current_inferior() down.
      	* corelow.c (core_detach): Add inferior parameter.
      	* darwin-nat.c (darwin_detach): Likewise.
      	* gnu-nat.c (gnu_detach): Likewise.
      	* inf-ptrace.c (inf_ptrace_detach): Likewise.
      	* infcmd.c (detach_command): Pass current_inferior() down to
      	target_detach.
      	* infrun.c (follow_fork_inferior): Pass parent_inf to
      	target_detach.
      	(handle_vfork_child_exec_or_exit): Pass inf->vfork_parent to
      	target_detach.
      	* linux-nat.c (linux_nat_detach): Add inferior parameter.
      	* linux-thread-db.c (thread_db_detach): Likewise.
      	* nto-procfs.c (procfs_detach): Likewise.
      	* procfs.c (procfs_detach): Likewise.
      	* record.c (record_detach): Likewise.
      	* record.h (struct inferior): Forward-declare.
      	(record_detach): Add inferior parameter.
      	* remote-sim.c (gdbsim_detach): Likewise.
      	* remote.c (remote_detach_1): Likewise.
      	(remote_detach): Likewise.
      	(extended_remote_detach): Likewise.
      	* sol-thread.c (sol_thread_detach): Likewise.
      	* target-debug.h (target_debug_print_inferior_p): New macro.
      	* target-delegates.c: Re-generate.
      	* top.c (kill_or_detach): Pass inferior down to target_detach.
      	* windows-nat.c (windows_detach): Add inferior parameter.
      6e1e1966
    • Simon Marchi's avatar
      Remove args from target detach · 6bd6f3b6
      Simon Marchi authored
      I was looking into adding a parameter to target_detach, and was
      wondering what the args parameter was.  It seems like in the distant
      past, it was possible to specify a signal number when detaching.  That
      signal was injected in the process before it was detached.  There is an
      example of code handling this in linux_nat_detach.  With today's GDB, I
      can't get this to work.  Doing "detach 15" (15 == SIGTERM) doesn't work,
      because detach is a prefix command and doesn't recognize the sub-command
      15.  Doing "detach inferiors 15" doesn't work because it expects a list
      of inferior id to detach.  Therefore, I don't think there's a way of
      invoking detach_command with a non-NULL args.  I also didn't find any
      documentation related to this feature.
      
      I assume that this feature stopped working when detach was made a prefix
      command, which is in f73adfeb (sorry,
      there's no commit title) from 2006.  Given that this feature was broken
      for such a long time and we haven't heard anything (AFAIK, I did not
      find any related bug), I think it's safe to remove it, as well as the
      args parameter to target_detach.  If someone wants to re-introduce it, I
      would suggest rethinking the user interface, and in particular would
      suggest using signal name instead of numbers.
      
      I tried to fix all the impacted code, but I might have forgotten some
      spots.  It shouldn't be hard to fix if that's the case.  I also couldn't
      build-test everything I changed, especially the nto and solaris stuff.
      
      gdb/ChangeLog:
      
      	* target.h (struct target_ops) <to_detach>: Remove args
      	parameter.
      	(target_detach): Likewise.
      	* target.c (dispose_inferior): Adjust.
      	(target_detach): Remove args parameter, adjust.
      	* aix-thread.c (aix_thread_detach): Adjust.
      	* corefile.c (core_file_command): Adjust.
      	* corelow.c (core_detach): Adjust.
      	* darwin-nat.c (darwin_detach): Adjust.
      	* gnu-nat.c (gnu_detach): Adjust.
      	* inf-ptrace.c (inf_ptrace_detach): Adjust.
      	* infcmd.c (detach_command): Adjust
      	* infrun.c (follow_fork_inferior): Adjust.
      	(handle_vfork_child_exec_or_exit): Adjust.
      	* linux-fork.c (linux_fork_detach): Remove args parameter.
      	* linux-fork.h (linux_fork_detach): Likewise.
      	* linux-nat.c (linux_nat_detach): Likewise, and adjust.
      	* linux-thread-db.c (thread_db_detach): Likewise.
      	* nto-procfs.c (procfs_detach): Likewise.
      	* procfs.c (procfs_detach): Likewise.
      	(do_detach): Remove signo parameter.
      	* record.c (record_detach): Remove args parameter.
      	* record.h (record_detach): Likewise.
      	* remote-sim.c (gdbsim_detach): Likewise.
      	* remote.c (remote_detach_1): Likewise.
      	(remote_detach): Likewise.
      	(extended_remote_detach): Likewise.
      	* sol-thread.c (sol_thread_detach): Likewise.
      	* target-delegates.c: Re-generate.
      	* top.c (struct qt_args) <args>: Remove field.
      	(kill_or_detach): Don't pass args.
      	(quit_force): Don't set args.
      	* windows-nat.c (windows_detach): Remove args parameter.
      6bd6f3b6
    • Thomas Preud'homme's avatar
      [gas/ARM] Remove spurious comments · a3ab6cb0
      Thomas Preud'homme authored
      Remove spurious comments after the definition of ToC and ToU.
      
      2018-01-19  Thomas Preud'homme  <thomas.preudhomme@arm.com>
      
      gas/
      	* config/tc-arm.c (ToC macro): Remove spurious comment.
      	(ToU macro): Likewise.
      a3ab6cb0
    • Andreas Arnez's avatar
      S390: Improve comments for s390-tdbregs test case · d6ad07fd
      Andreas Arnez authored
      This adds more explanation as to why the test case must be compiled with
      the -msoft-float option.  It also documents the my_tbegin and my_tend
      functions.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.arch/s390-tdbregs.c (my_tbegin): Add comment documenting the
      	function.
      	(my_tend): Likewise.
      	* gdb.arch/s390-tdbregs.exp: Enhance comment; explain the
      	rationale of avoiding FP- and vector instructions.
      d6ad07fd
    • Nick Clifton's avatar
      ee3fbc1e
    • Yao Qi's avatar
      Don't pass -m32 to libcc1 on arm-linux · 88af8ea8
      Yao Qi authored
      When I run gdb.compile/ tests on arm-linux, I get the following fails,
      
      (gdb) compile code -- ;^M
      arm-none-linux-gnueabihf-gcc: error: unrecognized command line option '-m32'; did you mean '-mbe32'?^M
      Compilation failed.^M
      (gdb) compile code (void) param^M
      arm-none-linux-gnueabihf-gcc: error: unrecognized command line option '-m32'; did you mean '-mbe32'?^M
      Compilation failed.^M
      (gdb) FAIL: gdb.compile/compile-ops.exp: compile code (void) param
      
      This patch fixes it by implementing gcc_target_options gdbarch method
      for arm-linux to override option "-m32".
      
      gdb:
      
      2018-01-19  Yao Qi  <yao.qi@linaro.org>
      
      	* arm-linux-tdep.c (arm_linux_gcc_target_options): New function.
      	(arm_linux_init_abi): Install it.
      88af8ea8
    • Yao Qi's avatar
      Find arm-linux-gnueabi(hf)?-gcc in compile · dea445b9
      Yao Qi authored
      GCC for arm-linux has different names on different distros.  It is
      arm-linux-gnu-gcc on fedora.  Debian/Ubuntu has arm-linux-gnueabihf-gcc
      and arm-linux-gnueabi-gcc.  So when I run gdb.compile/ tests on arm-linux,
      I get,
      
      (gdb) compile code -- ;
      Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$"
      
      This patch extend the regexp to match both arm-linux-gnu-gcc and
      arm-linux-gnueabihf-gcc.
      
      gdb:
      
      2018-01-19  Yao Qi  <yao.qi@linaro.org>
      
      	* osabi.c (gdb_osabi_names): Extend the regexp for
      	arm-linux-gnueabihf and arm-linux-gnueabi.
      dea445b9
    • Ruslan Kabatsayev's avatar
      Make tests expect [ \t]+ pattern instead of \t for "info reg" command · adf8243b
      Ruslan Kabatsayev authored
      This will allow to format output of "info reg" command as we wish,
      without breaking the tests. In particular, it'll let us correctly align
      raw and natural values of the registers using spaces instead of current
      badly-working approach with tabs.
      
      This change is forwards- and backwards-compatible, so that the amended
      tests will work in the same way before and after reformatting patches
      (unless the tests check formatting, of course, but I've not come across
      any such tests).
      
      Some tests already used this expected pattern, so they didn't
      even have to be modified. Others are changed by this patch.
      
      I've checked this on a i386 system, with no noticeable differences in
      test results, so at least on i386 nothing seems to be broken by this.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.arch/powerpc-d128-regs.exp: Replace expected "\[\t\]*" from
      	"info reg" with "\[ \t\]*".
      	* gdb.arch/altivec-regs.exp: Replace expected "\t" from "info reg" with
      	"\[ \t\]+".
      	* gdb.arch/s390-multiarch.exp: Ditto.
      	* gdb.base/pc-fp.exp: Ditto.
      	* gdb.reverse/i386-precsave.exp: Ditto.
      	* gdb.reverse/i386-reverse.exp: Ditto.
      	* gdb.reverse/i387-env-reverse.exp: Ditto.
      	* gdb.reverse/i387-stack-reverse.exp: Ditto.
      adf8243b
    • H.J. Lu's avatar
      Also xfail ld-elf/group1.d for Solaris · 1ebfa86a
      H.J. Lu authored
      Also xfail ld-elf/group1.d for Solaris since _GLOBAL_OFFSET_TABLE_ is
      always generated for Solaris as a global symbol after
      
      .*: 0+1000 +0 +(NOTYPE|OBJECT) +WEAK +DEFAULT +. foo
      
      instead of appending "#..." which will weaken the test.
      
      	* testsuite/ld-elf/group1.d: Also xfail Solaris.
      1ebfa86a
    • H.J. Lu's avatar
      x86: Update ld-elf/linkinfo1[ab].d for Solaris/x86 · f7968f08
      H.J. Lu authored
      Update ld-elf/linkinfo1[ab].d to accommodate slightly different PLT/GOT
      order/layout for Solaris/x86 targets.
      
      	* testsuite/ld-elf/linkinfo1a.d: Updated for slightly different
      	PLT/GOT order/layout for Solaris/x86 targets.
      	* testsuite/ld-elf/linkinfo1b.d: Likewise.
      f7968f08
    • H.J. Lu's avatar
      solaris2.em: Fold after_allocation into before_allocation · c5bdb022
      H.J. Lu authored
      Since all ELF linkers call check_relocs after opening all inputs, we
      can fold after_allocation into before_allocation so that local dynamic
      symbols will be placed before global dynamic symbols in .dynsym section.
      This fixed:
      
      FAIL: Common symbol override test (auxiliary shared object build)
      FAIL: ld-elf/pr19617a
      FAIL: ld-elf/pr19698
      
      for i386-solaris2.12 and x86_64-solaris2.12 targets.
      
      	PR ld/22728
      	* emultempl/solaris2.em (elf_solaris2_after_allocation): Fold
      	into ...
      	(elf_solaris2_before_allocation): This.
      	(LDEMUL_AFTER_ALLOCATION): Removed.
      c5bdb022
    • GDB Administrator's avatar
      Automatic date update in version.in · 85ed4f7e
      GDB Administrator authored
      85ed4f7e
  5. 18 Jan, 2018 3 commits
    • Andreas Arnez's avatar
      GDB testsuite: Re-enable -fdiagnostics-color=never · dcc06925
      Andreas Arnez authored
      In August 2017 the GDB test suite was changed to always add the compile
      option "-fdiagnostics-color=never", see:
      
        https://sourceware.org/ml/gdb-patches/2017-08/msg00150.html
      
      Since this option is not understood by rustc, a commit from 09/2017
      dropped its use in that case:
      
        https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5eb5f850
        ("Don't use -fdiagnostics-color=never for rustc")
      
      But that change goes overboard and stops using the option for other
      languages as well.  Thus compiler diagnostics written into gdb.log may
      contain colored output again.  This is fixed.
      
      gdb/testsuite/ChangeLog:
      
      	* lib/gdb.exp (gdb_compile): Re-enable use of
      	universal_compile_options for languages other than Rust.
      dcc06925
    • Andreas Arnez's avatar
      S390: Use soft float in s390-tdbregs test case · 25d4fd80
      Andreas Arnez authored
      The GDB test case s390-tdbregs.exp verifies GDB's handling of the
      "transaction diagnostic block".  For simplicity, the test case uses the
      "transaction begin" (TBEGIN) instruction with the "allow floating-point
      operation" flag set to zero.  But some GCC versions may indeed emit
      floating point or vector instructions for this test case.  If this happens
      in the transaction, it aborts, and an endless loop results.
      
      This change tells the compiler to produce a soft-float binary, so no
      floating-point or vector registers are touched.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.arch/s390-tdbregs.exp: Add the compile option -msoft-float.
      25d4fd80
    • Yao Qi's avatar
      Make abbrev_table::abbrevs private · 4a17f768
      Yao Qi authored
      abbrev_table::abbrevs is only access within abbrev_table's methods, so
      it can be private.  Add "m_" prefix.
      
      gdb:
      
      2018-01-18  Yao Qi  <yao.qi@linaro.org>
      
      	* dwarf2read.c (abbrev_table) <abbrevs>: Rename it to
      	m_abbrevs.
      	(abbrev_table::add_abbrev): Update.
      	(abbrev_table::lookup_abbrev): Update.
      4a17f768