1. 27 Jan, 2019 3 commits
  2. 26 Jan, 2019 2 commits
    • Tom Tromey's avatar
      Fix the sim build · 67f8b42f
      Tom Tromey authored
      Simon pointed out that the "common/" include change in gdb broke the
      sim build.  The problem was that the sim was using gdb's
      create-version.sh, which changed.
      
      This patch copies create-version.sh to the sim, so that it can
      generate "version.c" in a way that works in the sim build.
      
      Tested by rebuilding.
      
      sim/common/ChangeLog
      2019-01-26  Tom Tromey  <tom@tromey.com>
      
      	* Make-common.in (version.c): Use sim's create-version.sh.
      	* create-version.sh: New file.
      
      sim/ppc/ChangeLog
      2019-01-26  Tom Tromey  <tom@tromey.com>
      
      	* Makefile.in (version.c): Use sim's create-version.sh.
      67f8b42f
    • GDB Administrator's avatar
      Automatic date update in version.in · e5e2bc50
      GDB Administrator authored
      e5e2bc50
  3. 25 Jan, 2019 11 commits
    • Tom Tromey's avatar
      Don't use -I for common subdirectory · a0707f3c
      Tom Tromey authored
      This changes the Makefiles to remove the -I for the common/
      subdirectory.  This will enforce the rule that includes must use the
      'common/filename.h' form.
      
      gdb/ChangeLog
      2019-01-25  Tom Tromey  <tom@tromey.com>
      
      	* Makefile.in (GDB_CFLAGS): Don't add -I for common.
      
      gdb/gdbserver/ChangeLog
      2019-01-25  Tom Tromey  <tom@tromey.com>
      
      	* Makefile.in (INCLUDE_CFLAGS): Don't add -I for common.
      a0707f3c
    • Tom Tromey's avatar
      Normalize includes to use common/ · 0747795c
      Tom Tromey authored
      This changes all includes to use the form "common/filename.h" rather
      than just "filename.h".  This was written by a script.
      
      gdb/ChangeLog
      2019-01-25  Tom Tromey  <tom@tromey.com>
      
      	* xtensa-linux-nat.c: Fix common/ includes.
      	* xml-support.h: Fix common/ includes.
      	* xml-support.c: Fix common/ includes.
      	* x86-linux-nat.c: Fix common/ includes.
      	* windows-nat.c: Fix common/ includes.
      	* varobj.h: Fix common/ includes.
      	* varobj.c: Fix common/ includes.
      	* value.c: Fix common/ includes.
      	* valops.c: Fix common/ includes.
      	* utils.c: Fix common/ includes.
      	* unittests/xml-utils-selftests.c: Fix common/ includes.
      	* unittests/utils-selftests.c: Fix common/ includes.
      	* unittests/unpack-selftests.c: Fix common/ includes.
      	* unittests/tracepoint-selftests.c: Fix common/ includes.
      	* unittests/style-selftests.c: Fix common/ includes.
      	* unittests/string_view-selftests.c: Fix common/ includes.
      	* unittests/scoped_restore-selftests.c: Fix common/ includes.
      	* unittests/scoped_mmap-selftests.c: Fix common/ includes.
      	* unittests/scoped_fd-selftests.c: Fix common/ includes.
      	* unittests/rsp-low-selftests.c: Fix common/ includes.
      	* unittests/parse-connection-spec-selftests.c: Fix common/
      	includes.
      	* unittests/optional-selftests.c: Fix common/ includes.
      	* unittests/offset-type-selftests.c: Fix common/ includes.
      	* unittests/observable-selftests.c: Fix common/ includes.
      	* unittests/mkdir-recursive-selftests.c: Fix common/ includes.
      	* unittests/memrange-selftests.c: Fix common/ includes.
      	* unittests/memory-map-selftests.c: Fix common/ includes.
      	* unittests/lookup_name_info-selftests.c: Fix common/ includes.
      	* unittests/function-view-selftests.c: Fix common/ includes.
      	* unittests/environ-selftests.c: Fix common/ includes.
      	* unittests/copy_bitwise-selftests.c: Fix common/ includes.
      	* unittests/common-utils-selftests.c: Fix common/ includes.
      	* unittests/cli-utils-selftests.c: Fix common/ includes.
      	* unittests/array-view-selftests.c: Fix common/ includes.
      	* ui-file.c: Fix common/ includes.
      	* tui/tui-io.c: Fix common/ includes.
      	* tracepoint.h: Fix common/ includes.
      	* tracepoint.c: Fix common/ includes.
      	* tracefile-tfile.c: Fix common/ includes.
      	* top.h: Fix common/ includes.
      	* top.c: Fix common/ includes.
      	* thread.c: Fix common/ includes.
      	* target/waitstatus.h: Fix common/ includes.
      	* target/waitstatus.c: Fix common/ includes.
      	* target.h: Fix common/ includes.
      	* target.c: Fix common/ includes.
      	* target-memory.c: Fix common/ includes.
      	* target-descriptions.c: Fix common/ includes.
      	* symtab.h: Fix common/ includes.
      	* symfile.c: Fix common/ includes.
      	* stap-probe.c: Fix common/ includes.
      	* spu-linux-nat.c: Fix common/ includes.
      	* sparc-nat.c: Fix common/ includes.
      	* source.c: Fix common/ includes.
      	* solib.c: Fix common/ includes.
      	* solib-target.c: Fix common/ includes.
      	* ser-unix.c: Fix common/ includes.
      	* ser-tcp.c: Fix common/ includes.
      	* ser-pipe.c: Fix common/ includes.
      	* ser-base.c: Fix common/ includes.
      	* selftest-arch.c: Fix common/ includes.
      	* s12z-tdep.c: Fix common/ includes.
      	* rust-exp.y: Fix common/ includes.
      	* rs6000-aix-tdep.c: Fix common/ includes.
      	* riscv-tdep.c: Fix common/ includes.
      	* remote.c: Fix common/ includes.
      	* remote-notif.h: Fix common/ includes.
      	* remote-fileio.h: Fix common/ includes.
      	* remote-fileio.c: Fix common/ includes.
      	* regcache.h: Fix common/ includes.
      	* regcache.c: Fix common/ includes.
      	* record-btrace.c: Fix common/ includes.
      	* python/python.c: Fix common/ includes.
      	* python/py-type.c: Fix common/ includes.
      	* python/py-inferior.c: Fix common/ includes.
      	* progspace.h: Fix common/ includes.
      	* producer.c: Fix common/ includes.
      	* procfs.c: Fix common/ includes.
      	* proc-api.c: Fix common/ includes.
      	* printcmd.c: Fix common/ includes.
      	* ppc-linux-nat.c: Fix common/ includes.
      	* parser-defs.h: Fix common/ includes.
      	* osdata.c: Fix common/ includes.
      	* obsd-nat.c: Fix common/ includes.
      	* nat/x86-linux.c: Fix common/ includes.
      	* nat/x86-linux-dregs.c: Fix common/ includes.
      	* nat/x86-dregs.h: Fix common/ includes.
      	* nat/x86-dregs.c: Fix common/ includes.
      	* nat/ppc-linux.c: Fix common/ includes.
      	* nat/mips-linux-watch.h: Fix common/ includes.
      	* nat/mips-linux-watch.c: Fix common/ includes.
      	* nat/linux-waitpid.c: Fix common/ includes.
      	* nat/linux-ptrace.h: Fix common/ includes.
      	* nat/linux-ptrace.c: Fix common/ includes.
      	* nat/linux-procfs.c: Fix common/ includes.
      	* nat/linux-personality.c: Fix common/ includes.
      	* nat/linux-osdata.c: Fix common/ includes.
      	* nat/linux-namespaces.c: Fix common/ includes.
      	* nat/linux-btrace.h: Fix common/ includes.
      	* nat/linux-btrace.c: Fix common/ includes.
      	* nat/fork-inferior.c: Fix common/ includes.
      	* nat/amd64-linux-siginfo.c: Fix common/ includes.
      	* nat/aarch64-sve-linux-ptrace.c: Fix common/ includes.
      	* nat/aarch64-linux.c: Fix common/ includes.
      	* nat/aarch64-linux-hw-point.h: Fix common/ includes.
      	* nat/aarch64-linux-hw-point.c: Fix common/ includes.
      	* namespace.h: Fix common/ includes.
      	* mips-linux-tdep.c: Fix common/ includes.
      	* minsyms.c: Fix common/ includes.
      	* mi/mi-parse.h: Fix common/ includes.
      	* mi/mi-main.c: Fix common/ includes.
      	* mi/mi-cmd-env.c: Fix common/ includes.
      	* memrange.h: Fix common/ includes.
      	* memattr.c: Fix common/ includes.
      	* maint.h: Fix common/ includes.
      	* maint.c: Fix common/ includes.
      	* main.c: Fix common/ includes.
      	* machoread.c: Fix common/ includes.
      	* location.c: Fix common/ includes.
      	* linux-thread-db.c: Fix common/ includes.
      	* linux-nat.c: Fix common/ includes.
      	* linux-fork.c: Fix common/ includes.
      	* inline-frame.c: Fix common/ includes.
      	* infrun.c: Fix common/ includes.
      	* inflow.c: Fix common/ includes.
      	* inferior.h: Fix common/ includes.
      	* inferior.c: Fix common/ includes.
      	* infcmd.c: Fix common/ includes.
      	* inf-ptrace.c: Fix common/ includes.
      	* inf-child.c: Fix common/ includes.
      	* ia64-linux-nat.c: Fix common/ includes.
      	* i387-tdep.c: Fix common/ includes.
      	* i386-tdep.c: Fix common/ includes.
      	* i386-linux-tdep.c: Fix common/ includes.
      	* i386-linux-nat.c: Fix common/ includes.
      	* i386-go32-tdep.c: Fix common/ includes.
      	* i386-fbsd-tdep.c: Fix common/ includes.
      	* i386-fbsd-nat.c: Fix common/ includes.
      	* guile/scm-type.c: Fix common/ includes.
      	* guile/guile.c: Fix common/ includes.
      	* go32-nat.c: Fix common/ includes.
      	* gnu-nat.c: Fix common/ includes.
      	* gdbthread.h: Fix common/ includes.
      	* gdbarch-selftests.c: Fix common/ includes.
      	* gdb_usleep.c: Fix common/ includes.
      	* gdb_select.h: Fix common/ includes.
      	* gdb_bfd.c: Fix common/ includes.
      	* gcore.c: Fix common/ includes.
      	* fork-child.c: Fix common/ includes.
      	* findvar.c: Fix common/ includes.
      	* fbsd-nat.c: Fix common/ includes.
      	* event-top.c: Fix common/ includes.
      	* event-loop.c: Fix common/ includes.
      	* dwarf2read.c: Fix common/ includes.
      	* dwarf2loc.c: Fix common/ includes.
      	* dwarf2-frame.c: Fix common/ includes.
      	* dwarf-index-cache.c: Fix common/ includes.
      	* dtrace-probe.c: Fix common/ includes.
      	* disasm-selftests.c: Fix common/ includes.
      	* defs.h: Fix common/ includes.
      	* csky-tdep.c: Fix common/ includes.
      	* cp-valprint.c: Fix common/ includes.
      	* cp-support.h: Fix common/ includes.
      	* cp-support.c: Fix common/ includes.
      	* corelow.c: Fix common/ includes.
      	* completer.h: Fix common/ includes.
      	* completer.c: Fix common/ includes.
      	* compile/compile.c: Fix common/ includes.
      	* compile/compile-loc2c.c: Fix common/ includes.
      	* compile/compile-cplus-types.c: Fix common/ includes.
      	* compile/compile-cplus-symbols.c: Fix common/ includes.
      	* command.h: Fix common/ includes.
      	* cli/cli-dump.c: Fix common/ includes.
      	* cli/cli-cmds.c: Fix common/ includes.
      	* charset.c: Fix common/ includes.
      	* build-id.c: Fix common/ includes.
      	* btrace.h: Fix common/ includes.
      	* btrace.c: Fix common/ includes.
      	* breakpoint.h: Fix common/ includes.
      	* breakpoint.c: Fix common/ includes.
      	* ax.h:
      	(enum agent_op): Fix common/ includes.
      	* ax-general.c (struct aop_map): Fix common/ includes.
      	* ax-gdb.c: Fix common/ includes.
      	* auxv.c: Fix common/ includes.
      	* auto-load.c: Fix common/ includes.
      	* arm-tdep.c: Fix common/ includes.
      	* arch/riscv.c: Fix common/ includes.
      	* arch/ppc-linux-common.c: Fix common/ includes.
      	* arch/i386.c: Fix common/ includes.
      	* arch/arm.c: Fix common/ includes.
      	* arch/arm-linux.c: Fix common/ includes.
      	* arch/arm-get-next-pcs.c: Fix common/ includes.
      	* arch/amd64.c: Fix common/ includes.
      	* arch/aarch64.c: Fix common/ includes.
      	* arch/aarch64-insn.c: Fix common/ includes.
      	* arch-utils.c: Fix common/ includes.
      	* amd64-windows-tdep.c: Fix common/ includes.
      	* amd64-tdep.c: Fix common/ includes.
      	* amd64-sol2-tdep.c: Fix common/ includes.
      	* amd64-obsd-tdep.c: Fix common/ includes.
      	* amd64-nbsd-tdep.c: Fix common/ includes.
      	* amd64-linux-tdep.c: Fix common/ includes.
      	* amd64-linux-nat.c: Fix common/ includes.
      	* amd64-fbsd-tdep.c: Fix common/ includes.
      	* amd64-fbsd-nat.c: Fix common/ includes.
      	* amd64-dicos-tdep.c: Fix common/ includes.
      	* amd64-darwin-tdep.c: Fix common/ includes.
      	* agent.c: Fix common/ includes.
      	* ada-lang.h: Fix common/ includes.
      	* ada-lang.c: Fix common/ includes.
      	* aarch64-tdep.c: Fix common/ includes.
      
      gdb/gdbserver/ChangeLog
      2019-01-25  Tom Tromey  <tom@tromey.com>
      
      	* win32-low.c: Fix common/ includes.
      	* win32-i386-low.c: Fix common/ includes.
      	* tracepoint.c: Fix common/ includes.
      	* thread-db.c: Fix common/ includes.
      	* target.h: Fix common/ includes.
      	* symbol.c: Fix common/ includes.
      	* spu-low.c: Fix common/ includes.
      	* server.h: Fix common/ includes.
      	* server.c: Fix common/ includes.
      	* remote-utils.c: Fix common/ includes.
      	* regcache.h: Fix common/ includes.
      	* regcache.c: Fix common/ includes.
      	* nto-x86-low.c: Fix common/ includes.
      	* notif.h: Fix common/ includes.
      	* mem-break.h: Fix common/ includes.
      	* lynx-low.c: Fix common/ includes.
      	* lynx-i386-low.c: Fix common/ includes.
      	* linux-x86-tdesc-selftest.c: Fix common/ includes.
      	* linux-x86-low.c: Fix common/ includes.
      	* linux-low.c: Fix common/ includes.
      	* inferiors.h: Fix common/ includes.
      	* i387-fp.c: Fix common/ includes.
      	* hostio.c: Fix common/ includes.
      	* hostio-errno.c: Fix common/ includes.
      	* gdbthread.h: Fix common/ includes.
      	* gdbreplay.c: Fix common/ includes.
      	* fork-child.c: Fix common/ includes.
      	* event-loop.c: Fix common/ includes.
      	* ax.c:
      	(enum gdb_agent_op): Fix common/ includes.
      0747795c
    • Tom Tromey's avatar
      Update create-version.sh to use common/version.h · 2f5c153e
      Tom Tromey authored
      This changes create-version.sh to have the generated file use
      common/version.h as the file name.
      
      gdb/ChangeLog
      2019-01-25  Tom Tromey  <tom@tromey.com>
      
      	* common/create-version.sh: Use common/version.h.
      2f5c153e
    • Tamar Christina's avatar
    • Sudi Das's avatar
      AArch64: Update encodings for stg, st2g, stzg and st2zg. · 69105ce4
      Sudi Das authored
      This patch is part of a series of patches to introduce a few changes to the
      Armv8.5-A Memory Tagging Extension. This patch updates the st*g instructions
      to use a previously reserved field for a new register operand. Thus the
      new versions of the instructions are as follows:
      
      - STG Xt, [<Xn|SP>, #<simm>]
      - STG Xt, [<Xn|SP>, #<simm>]!
      - STG Xt, [<Xn|SP>], #<simm>
      - STZG Xt, [<Xn|SP>, #<simm>]
      - STZG Xt, [<Xn|SP>, #<simm>]!
      - STZG Xt, [<Xn|SP>], #<simm>
      - ST2G Xt, [<Xn|SP>, #<simm>]
      - ST2G Xt, [<Xn|SP>, #<simm>]!
      - ST2G Xt, [<Xn|SP>], #<simm>
      - STZ2G Xt, [<Xn|SP>, #<simm>]
      - STZ2G Xt, [<Xn|SP>, #<simm>]!
      - STZ2G Xt, [<Xn|SP>], #<simm>
      
      Committed on behalf of Sudakshina Das.
      
      *** gas/ChangeLog ***
      
      	* config/tc-aarch64.c (warn_unpredictable_ldst): Exempt
      	stg, st2g, stzg and stz2g from Xt == Xn with writeback warning.
      	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Change tests for
      	stg, stzg, st2g and stz2g.
      	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Likewise.
      	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
      	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
      
      *** opcodes/ChangeLog ***
      
      	* aarch64-tbl.h (QL_LDST_AT): Update macro.
      	(aarch64_opcode): Change encoding for stg, stzg
      	st2g and st2zg.
      	* aarch64-asm-2.c: Regenerated.
      	* aarch64-dis-2.c: Regenerated.
      	* aarch64-opc-2.c: Regenerated.
      69105ce4
    • Sudi Das's avatar
      AArch64: Add new STZGM instruction for Armv8.5-A Memory Tagging Extension. · 20a4ca55
      Sudi Das authored
      This patch is part of a series of patches to introduce a few changes to the
      Armv8.5-A Memory Tagging Extension. This patch adds the new STZGM instruction.
      
      STGZM Xt, [<Xn|SP>]
      
      Committed on behalf of Sudakshina Das.
      
      *** gas/ChangeLog ***
      
      	* testsuite/gas/aarch64/armv8_5-a-memtag.d: New tests for stzgm.
      	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Likewise.
      	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
      	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
      
      *** opcodes/ChangeLog ***
      
      	* aarch64-asm-2.c: Regenerated.
      	* aarch64-dis-2.c: Likewise.
      	* aarch64-opc-2.c: Likewise.
      	* aarch64-tbl.h (aarch64_opcode): Add new stzgm.
      20a4ca55
    • Sudi Das's avatar
      AArch64: Remove ldgv and stgv instructions from Armv8.5-A Memory Tagging Extension. · 550fd7bf
      Sudi Das authored
      This patch is part of a series of patches to introduce a few changes to the
      Armv8.5-A Memory Tagging Extension. This patch removes the LDGV and STGV
      instructions. These instructions needed special infrastructure to support
      [base]! style for addressing mode. That is also removed now.
      
      Committed on behalf of Sudakshina Das.
      
      *** gas/ChangeLog ***
      
      	* config/tc-aarch64.c (parse_address_main): Remove support for
      	[base]! address expression.
      	(parse_operands): Remove support for AARCH64_OPND_ADDR_SIMPLE_2.
      	(warn_unpredictable_ldst): Remove support for ldstgv_indexed.
      	* testsuite/gas/aarch64/armv8_5-a-memtag.d: Remove tests for ldgv
      	and stgv.
      	* testsuite/gas/aarch64/armv8_5-a-memtag.s: Likewise.
      	* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
      	* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
      
      *** include/ChangeLog ***
      
      	* opcode/aarch64.h (enum aarch64_opnd): Remove
      	AARCH64_OPND_ADDR_SIMPLE_2.
      	(enum aarch64_insn_class): Remove ldstgv_indexed.
      
      *** opcodes/ChangeLog ***
      
      	* aarch64-asm.c (aarch64_ins_addr_simple_2): Remove.
      	* aarch64-asm.h (ins_addr_simple_2): Likeiwse.
      	* aarch64-dis.c (aarch64_ext_addr_simple_2): Likewise.
      	* aarch64-dis.h (ext_addr_simple_2): Likewise.
      	* aarch64-opc.c (operand_general_constraint_met_p): Remove
      	case for ldstgv_indexed.
      	(aarch64_print_operand): Remove case for AARCH64_OPND_ADDR_SIMPLE_2.
      	* aarch64-tbl.h (struct aarch64_opcode): Remove ldgv and stgv.
      	(AARCH64_OPERANDS): Remove ADDR_SIMPLE_2.
      	* aarch64-asm-2.c: Regenerated.
      	* aarch64-dis-2.c: Regenerated.
      	* aarch64-opc-2.c: Regenerated.
      550fd7bf
    • Nick Clifton's avatar
      Prevent a potential illegal memory access in readelf when parsing a note with a zero name size. · 18344509
      Nick Clifton authored
      	PR 24131
      	* readelf.c (process_notes_at): Prevent an illegal memory access
      	when the note's namesize is zero.
      	(decode_tic6x_unwind_bytecode): Add code to handle the case where
      	no registers are specified in a frame pop instruction.
      18344509
    • Nick Clifton's avatar
    • Wu Heng's avatar
      PR23940, check bounds before using · 10c172ba
      Wu Heng authored
      	PR gas/23940
      	* macro.c (getstring): Check array bound before accessing.
      10c172ba
    • GDB Administrator's avatar
      Automatic date update in version.in · 04174263
      GDB Administrator authored
      04174263
  4. 24 Jan, 2019 5 commits
    • Alan Modra's avatar
      PR24125, Assertion failure with embedded NULs in string · 0c56b5cf
      Alan Modra authored
      An assertion that can be triggered by user input is wrong, so remove
      it.  I believe the NUL would have been accepted before the PR20902
      patch.
      
      	PR 20902
      	PR 24125
      	* read.c (stringer): Delete assertion.
      0c56b5cf
    • Pedro Alves's avatar
      target_pass_signals/target_program_signals: Use gdb::array_view · adc6a863
      Pedro Alves authored
      This replaces the pointer and length parameters of target_pass_signals
      and target_program_signals with a gdb::array_view parameter, and fixes
      the fallout.
      
      In infrun.c, the signal_stop, signal_print, signal_program,
      signal_catch, signal_pass globals are currently pointers to
      heap-allocated memory.  I see no point in that, so I converted them to
      arrays.  This allows simplifying the calls to
      target_pass_signals/target_program_signals, since we can pass the
      array directly, which can implicitly convert to gdb::array_view.
      
      gdb/ChangeLog:
      2019-01-24  Pedro Alves  <palves@redhat.com>
      
      	* infrun.c (signal_stop, signal_print, signal_program)
      	(signal_catch, signal_pass): Now arrays instead of pointers.
      	(update_signals_program_target, do_target_resume)
      	(signal_catch_update, handle_command, _initialize_infrun): Adjust.
      	* linux-nat.c (linux_nat_target::pass_signals)
      	(linux_nat_target::create_inferior, linux_nat_target::attach):
      	Adjust.
      	* linux-nat.h (linux_nat_target::pass_signals): Adjust.
      	* nto-procfs.c (nto_procfs_target::pass_signals): Adjust.
      	* procfs.c (procfs_target::pass_signals): Adjust.
      	* record-full.c (record_full_target::resume): Adjust.
      	* remote.c (remote_target::pass_signals)
      	(remote_target::program_signals): Adjust.
      	* target-debug.h (target_debug_print_signals): Now takes a
      	gdb::array_view as parameter.  Adjust.
      	* target.h (target_ops) <pass_signals, program_signals>: Replace
      	pointer and length parameters with gdb::array_view.
      	(target_pass_signals, target_program_signals): Likewise.
      	* target-delegates.c: Regenerate.
      adc6a863
    • Pedro Alves's avatar
      Fix clang/libc++ build · 3046d67a
      Pedro Alves authored
      This fixes the following build error with clang/libc++, reported at
      <https://sourceware.org/ml/gdb-patches/2019-01/msg00537.html>:
      
        (...)
        In file included from breakpoint.c:34:
        In file included from ./inferior.h:54:
        ./common/forward-scope-exit.h:98:7: error: no matching constructor for
        initialization of 'decltype(std::bind(&delete_longjmp_breakpoint,
        std::declval<int>()))' (aka '__bind<void (*)(int), int>')
            : m_bind_function (std::bind (function, args...))
      	^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ./common/gdb_optional.h:155:19: note: in instantiation of member
        function 'detail::forward_scope_exit<void (int),
        &delete_longjmp_breakpoint, void (int)>::forward_scope_exit' requested
        here
            new (&m_item) T (std::forward<Args>(args)...);
      		    ^
        breakpoint.c:11127:18: note: in instantiation of function template
        specialization 'gdb::optional<detail::forward_scope_exit<void (int),
        &delete_longjmp_breakpoint, void (int)> >::emplace<int &>' requested
        here
      	lj_deleter.emplace (thread);
      		   ^
        /Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:2220:7:
        note: candidate constructor (the implicit copy constructor) not
        viable: no known conversion from '__bind<[...], int &>' to 'const
        __bind<[...], int>' for 1st argument
        class __bind
      	^
        (...)
      
      I don't really know why I ended up with a copy here.  We can just pass
      the arguments directly to the being-constructed bind.
      
      gdb/ChangeLog:
      2019-01-24  Pedro Alves  <palves@redhat.com>
      
      	* common/forward-scope-exit.h
      	(forward_scope_exit::forward_scope_exit): Pass arguments to
      	m_bind_function directly, instead of creating a std::bind and
      	copying that.
      3046d67a
    • Alan Hayward's avatar
      AArch64 AAPCS: Ignore static members · 353229bf
      Alan Hayward authored
      Static members in C++ structs are global data and therefore not part of the
      list of struct members considered for passing in registers.
      
      Note the corresponding code in GCC (from which the GDB AAPCS code is based)
      does not have any static member checks due to the static members not being
      part of the struct type at that point.
      
      Extend gdb.base/infcall-nested-structs.exp to test structs with static
      members when compiled for C++.  XFAIL more cases for x86_64 (see gdb/24104).
      For completeness, ensure some test cases have both empty structures and
      static members.
      
      Also fixes gdb.dwarf2/dw2-cp-infcall-ref-static.exp.
      
      gdb/ChangeLog:
      
      	* aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check
      	for static members.
      	(pass_in_v_vfp_candidate): Likewise.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.base/infcall-nested-structs.c (struct struct_static_02_01):
      	New structure.
      	(struct struct_static_02_02): Likewise.
      	(struct struct_static_02_03): Likewise.
      	(struct struct_static_02_04): Likewise.
      	(struct struct_static_04_01): Likewise.
      	(struct struct_static_04_02): Likewise.
      	(struct struct_static_04_03): Likewise.
      	(struct struct_static_04_04): Likewise.
      	(struct struct_static_06_01): Likewise.
      	(struct struct_static_06_02): Likewise.
      	(struct struct_static_06_03): Likewise.
      	(struct struct_static_06_04): Likewise.
      	(cmp_struct_static_02_01): Likewise.
      	(cmp_struct_static_02_02): Likewise.
      	(cmp_struct_static_02_03): Likewise.
      	(cmp_struct_static_02_04): Likewise.
      	(cmp_struct_static_04_01): Likewise.
      	(cmp_struct_static_04_02): Likewise.
      	(cmp_struct_static_04_03): Likewise.
      	(cmp_struct_static_04_04): Likewise.
      	(cmp_struct_static_06_01): Likewise.
      	(cmp_struct_static_06_02): Likewise.
      	(cmp_struct_static_06_03): Likewise.
      	(cmp_struct_static_06_04): Likewise.
      	(call_all): Test new structs.
      	* gdb.base/infcall-nested-structs.exp: Likewise.
      353229bf
    • GDB Administrator's avatar
      Automatic date update in version.in · 388a192d
      GDB Administrator authored
      388a192d
  5. 23 Jan, 2019 19 commits
    • Tom Tromey's avatar
      Use scope_exit in regcache.c · 311dc83a
      Tom Tromey authored
      This removes the regcache_invalidator class in favor of a scope_exit.
      This seems like an improvement (albeit a minor one) because
      regcache_invalidator is only used in a single spot.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* regcache.c (class regcache_invalidator): Remove.
      	(regcache::raw_write): Use make_scope_exit.
      311dc83a
    • Tom Tromey's avatar
      Update cleanup comment in ui-out.h · 296bd123
      Tom Tromey authored
      ui-out.h refers to some cleanup functions that no longer exist.  This
      updates the reference.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      
      	* ui-out.h (class ui_out_emit_type): Update comment.
      296bd123
    • Tom Tromey's avatar
      Update an obsolete cleanup comment · 979a0d13
      Tom Tromey authored
      This updates a comment in fetch_inferior_event.  The comment refers to
      a cleanup that is now a scoped_restore_current_thread.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      
      	* infrun.c (fetch_inferior_event): Update comment.
      979a0d13
    • Tom Tromey's avatar
      Remove remaining cleanup from fetch_inferior_event · d238133d
      Tom Tromey authored
      This removes the remaining cleanup from fetch_inferior_event,
      replacing it with a SCOPE_EXIT.  This required introducing a new scope
      and reindenting.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* infrun.c (reinstall_readline_callback_handler_cleanup): Remove
      	parameter.
      	(fetch_inferior_event): Use SCOPE_EXIT.
      d238133d
    • Tom Tromey's avatar
      Remove cleanup from stop_all_threads · 9885e6bb
      Tom Tromey authored
      This removes the cleanup from stop_all_threads, replacing it with a
      scope_exit.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* infrun.c (disable_thread_events): Delete.
      	(stop_all_threads): Use SCOPE_EXIT.
      9885e6bb
    • Tom Tromey's avatar
      Remove clear_symtab_users_cleanup · 286526c1
      Tom Tromey authored
      This removes clear_symtab_users_cleanup, replacing it with uses of
      forward_scope_exit.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* symfile.c: Include forward-scope-exit.h.
      	(clear_symtab_users_cleanup): Replace forward declaration with
      	a FORWARD_SCOPE_EXIT.
      	(syms_from_objfile_1): Use the forward_scope_exit and
      	gdb::optional instead of cleanup_function.
      	(reread_symbols): Use the forward_scope_exit instead of
      	cleanup_function.
      	(clear_symtab_users_cleanup): Remove function.
      286526c1
    • Tom Tromey's avatar
      Remove cleanup from linux-nat.c · 1db93f14
      Tom Tromey authored
      This removes a cleanup from linux-nat.c, replacing it with a
      scope_exit.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* linux-nat.c: Include scope-exit.h.
      	(cleanup_target_stop): Remove.
      	(linux_nat_target::static_tracepoint_markers_by_strid): Use
      	SCOPE_EXIT.
      1db93f14
    • Tom Tromey's avatar
      Remove cleanup_delete_std_terminate_breakpoint · 2cc83d1e
      Tom Tromey authored
      This removes cleanup_delete_std_terminate_breakpoint, replacing it
      with a use of SCOPE_EXIT.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* infcall.c (cleanup_delete_std_terminate_breakpoint): Remove.
      	(call_function_by_hand_dummy): Use SCOPE_EXIT.
      2cc83d1e
    • Tom Tromey's avatar
      Remove make_bpstat_clear_actions_cleanup · 694c6bf5
      Tom Tromey authored
      This removes make_bpstat_clear_actions_cleanup, replacing it with uses
      of scope_exit.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Andrew Burgess  <andrew.burgess@embecosm.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* infrun.c (fetch_inferior_event): Use scope_exit.
      	* utils.h (make_bpstat_clear_actions_cleanup): Don't declare.
      	* top.c (execute_command): Use scope_exit.
      	* breakpoint.c (bpstat_do_actions): Use scope_exit.
      	* utils.c (do_bpstat_clear_actions_cleanup)
      	(make_bpstat_clear_actions_cleanup): Remove.
      694c6bf5
    • Tom Tromey's avatar
      Remove delete_just_stopped_threads_infrun_breakpoints_cleanup · 4c41382a
      Tom Tromey authored
      v3: sorted earlier in the series, and replaces the cleanup in
      fetch_inferior_event here too instead of in some other patch.
      
      This removes delete_just_stopped_threads_infrun_breakpoints_cleanup,
      replacing it with uses of scope_exit.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* infrun.c: Include "common/scope-exit.h"
      	(delete_just_stopped_threads_infrun_breakpoints_cleanup): Remove.
      	(wait_for_inferior): Use SCOPE_EXIT.
      	(fetch_inferior_event): Use scope_exit.
      4c41382a
    • Tom Tromey's avatar
      Remove remaining cleanup from gdb/breakpoint.c · 89f8fb50
      Tom Tromey authored
      In v3: remove the "have BKPT_CHAIN already discarded" comment too.
      
      The remaining null cleanup in breakpoint.c does not seem to protect
      anything, so remove it.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* breakpoint.c (create_breakpoint): Remove cleanup.
      89f8fb50
    • Tom Tromey's avatar
      Replace delete_longjmp_breakpoint_cleanup with a forward_scope_exit type · 5419bdae
      Tom Tromey authored
      This removes delete_longjmp_breakpoint_cleanup in favor of forward_scope_exit.
      
      gdb/ChangeLog:
      2019-01-23  Tom Tromey  <tom@tromey.com>
      	    Andrew Burgess  <andrew.burgess@embecosm.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* breakpoint.c (until_break_command): Use
      	delete_longjmp_breakpoint_cleanup class.
      	* infcmd.c (delete_longjmp_breakpoint_cleanup): Remove function.
      	(until_next_command): Use delete_longjmp_breakpoint_cleanup class.
      	* inferior.h: Include forward-scope-exit.h.
      	(delete_longjmp_breakpoint_cleanup): Replace function declaration
      	with FORWARD_SCOPE_EXIT type.
      5419bdae
    • Pedro Alves's avatar
      Use SCOPE_EXIT in gdbarch-selftest.c · e587ef42
      Pedro Alves authored
      Replace the custom local class with a SCOPE_EXIT.
      
      gdb/ChangeLog:
      2019-01-23  Pedro Alves  <palves@redhat.com>
      
      	* gdbarch-selftests.c (struct on_exit): Use SCOPE_EXIT.
      e587ef42
    • Pedro Alves's avatar
      Use forward_scope_exit for scoped_finish_thread_state · 77f0e74c
      Pedro Alves authored
      This reimplements the manually-written scoped_finish_thread_state
      class as a forward_scope_exit instantiation.  forward_scope_exit has
      the same interface as scoped_finish_thread_state, so nothing else has
      to change.
      
      A forward_scope_exit is preferred over make_scope_exit here because
      infrun.c:normal_stop needs to wrap scoped_finish_thread_state in a
      gdb::optional.  Since we need the type there, might as well use it
      everywhere.
      
      gdb/ChangeLog:
      2019-01-23  Pedro Alves  <palves@redhat.com>
      	    Andrew Burgess  <andrew.burgess@embecosm.com>
      
      	* gdbthread.h: Include "common/forward-scope-exit.h".
      	(scoped_finish_thread_state): Redefine custom class in terms of
      	forward_scope_exit.
      77f0e74c
    • Pedro Alves's avatar
      Introduce forward_scope_exit · 5b9b3e53
      Pedro Alves authored
      This adds a template that can be used to automatically instantiate
      scope_exit-like types that wrap some cleanup function.  The
      instantiated type has a ctor that has the same interface as the
      wrapped function.  While the "magic" is just straight C++11, the
      intended use is via the FORWARD_SCOPE_EXIT macro, which is a minimal
      macro that avoids spelling out the wrapped function name more than
      once:
      
       void some_function (int foo, object *bar);
       using some_function_fce = FORWARD_SCOPE_EXIT (some_function);
       some_function_fce cleanup (some_int, some_obj_ptr);
      
      The above runs:
        some_function (some_int, some_obj_ptr);
      at scope exit.
      
      This is mainly useful as opposed to a simpler SCOPE_EXIT when you need
      to:
        - cancel the scope_exit, in which case you need the object's name
        - wrap the scope_exit in a gdb::optional, in which case you need the
          scope_exit's type in advance.
      
      More details in the code comments.
      
      gdb/ChangeLog:
      2019-01-23  Pedro Alves  <palves@redhat.com>
      	    Andrew Burgess  <andrew.burgess@embecosm.com>
      
      	* common/forward-scope-exit.h: New file.
      5b9b3e53
    • Pedro Alves's avatar
      Introduce scope_exit · 54b65c9b
      Pedro Alves authored
      This add a new template class scope_exit.  scope_exit is a
      general-purpose scope guard that calls its exit function at the end of
      the current scope.  A scope_exit may be canceled by calling the
      "release" method.  The API is modeled on P0052R5 - Generic Scope Guard
      and RAII Wrapper for the Standard Library, which is itself based on
      Andrej Alexandrescu's ScopeGuard/SCOPE_EXIT.
      
      The main advantage of scope_exit is avoiding writing single-use RAII
      classes and its boilerplate.  Following patches will remove a few of
      such classes.
      
      There are two forms available:
      
       - The "make_scope_exit" form allows canceling the scope guard.  Use
         it like this:
      
           auto cleanup = make_scope_exit ( <function, function object, lambda> );
           ...
           cleanup.release (); // cancel
      
       - If you don't need to cancel the guard, you can use the SCOPE_EXIT
         macro, like this:
      
           SCOPE_EXIT { /* any code you like here. */ }
      
      Note: scope_exit instances do not allocate anything on the heap.
      
      gdb/ChangeLog:
      2019-01-23  Pedro Alves  <palves@redhat.com>
      	    Andrew Burgess  <andrew.burgess@embecosm.com>
      	    Tom Tromey  <tom@tromey.com>
      
      	* common/scope-exit.h: New file.
      54b65c9b
    • Pedro Alves's avatar
      Rename ESC -> ESC_PARENS · cf08fb29
      Pedro Alves authored
      A following patch will include common/preprocessor.h in some .c file
      that also includes readline.h, and that revealed a conflict -- ESC is
      defined by readline.h as well (actually readline's chardefs.h) with a
      completely unrelated meaning:
      
       #define ESC CTRL('[')
      
      Rename our version to avoid the conflict.
      
      gdb/ChangeLog:
      2019-01-23  Pedro Alves  <palves@redhat.com>
      
      	* common/preprocessor.h (ESC): Rename to ...
      	(ESC_PARENS): ... this.
      	* common/valid-expr.h (CHECK_VALID_EXPR_1, CHECK_VALID_EXPR_2)
      	(CHECK_VALID_EXPR_3, CHECK_VALID_EXPR_4): Adjust.
      cf08fb29
    • Tom Tromey's avatar
      Remove a warning from symtab.c · ae73e2e2
      Tom Tromey authored
      When building symtab.c, I get:
      
      ../../binutils-gdb/gdb/language.h: In function ‘void print_symbol_info(search_domain, symbol*, int, const char*)’:
      ../../binutils-gdb/gdb/language.h:738:20: warning: ‘*((void*)& l +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             set_language (m_lang);
             ~~~~~~~~~~~~~^~~~~~~~
      ../../binutils-gdb/gdb/symtab.c:4613:41: note: ‘*((void*)& l +4)’ was declared here
         scoped_switch_to_sym_language_if_auto l (sym);
                                               ^
      
      This is another instance of the std::optional problem, see
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635.
      
      However, it seemed straightforward and inexpensive to me to silence
      this one, which is what this patch does.
      
      gdb/ChangeLog
      2019-01-23  Tom Tromey  <tom@tromey.com>
      
      	* language.h (class scoped_switch_to_sym_language_if_auto):
      	Initialize m_lang in both cases.
      ae73e2e2
    • Alan Hayward's avatar
      AArch64: Ensure lwp info is created zeroed · 6594e122
      Alan Hayward authored
      The code to not set empty hardware BPs/WPs on new threads will only work
      if the newly allocated struct is empty.
      
      Ensure the structure is created zeroed.
      
      This patch removes the remaining racy behaviour on gdb.threads tests
      when run on AArch64 Ubuntu.
      
      gdb/ChangeLog:
      
      	* nat/aarch64-linux.c (aarch64_linux_new_thread): Replace XNEW
      	with XCNEW.
      6594e122