Alan Modra [Sun, 27 Jan 2019 23:29:29 +0000 (09:59 +1030)]
PR24008, Wrong value of ternary expression in map file
PR 24008
* ldexp.h (lang_phase_type): Add lang_fixed_phase_enum.
* ldexp.c (fold_name): Move expld.assign_name check later to
avoid an extra lookup.
(exp_fold_tree_1): When lang_fixed_phase_enum, don't change symbol
values, and don't clear expld.assign_name.
* ldlang.c (lang_map): Set expld.phase to lang_fixed_phase_enum.
(print_assignment): Resolve entire assignment expression.
Don't access symbol u.def unless symbol is defined.
Alan Modra [Sun, 27 Jan 2019 23:03:28 +0000 (09:33 +1030)]
Control gas enable-checking default by bfd/development.sh
* configure.ac (ac_checking): Set from bfd/development.sh
development variable.
* configure: Regenerate.
Tom Tromey [Sun, 27 Jan 2019 21:51:03 +0000 (14:51 -0700)]
Remove duplicate skip_python_tests invocation
I noticed that py-finish-breakpoint.exp had two calls to
skip_python_tests, in quick succession. This patch removes the second
one.
gdb/testsuite/ChangeLog
2019-01-27 Tom Tromey <tom@tromey.com>
* gdb.python/py-finish-breakpoint.exp: Remove duplicate call to
skip_python_tests.
GDB Administrator [Sun, 27 Jan 2019 00:01:24 +0000 (00:01 +0000)]
Automatic date update in version.in
Tom Tromey [Sat, 26 Jan 2019 15:51:57 +0000 (08:51 -0700)]
Fix the sim build
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.
GDB Administrator [Sat, 26 Jan 2019 00:00:52 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Tue, 22 Jan 2019 07:26:45 +0000 (00:26 -0700)]
Don't use -I for common subdirectory
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.
Tom Tromey [Wed, 23 Jan 2019 17:21:39 +0000 (10:21 -0700)]
Normalize includes to use common/
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.
Tom Tromey [Tue, 22 Jan 2019 06:03:23 +0000 (23:03 -0700)]
Update create-version.sh to use common/version.h
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.
Tamar Christina [Fri, 25 Jan 2019 15:50:01 +0000 (15:50 +0000)]
AArch64: Add missing changelog for Update encodings for stg, st2g, stzg and st2zg
Sudi Das [Fri, 25 Jan 2019 14:28:07 +0000 (14:28 +0000)]
AArch64: Update encodings for stg, st2g, stzg and st2zg.
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.
Sudi Das [Fri, 25 Jan 2019 14:15:45 +0000 (14:15 +0000)]
AArch64: Add new STZGM instruction for Armv8.5-A Memory Tagging Extension.
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.
Sudi Das [Fri, 25 Jan 2019 13:57:14 +0000 (13:57 +0000)]
AArch64: Remove ldgv and stgv instructions from Armv8.5-A Memory Tagging Extension.
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.
Nick Clifton [Fri, 25 Jan 2019 13:16:06 +0000 (13:16 +0000)]
Prevent a potential illegal memory access in readelf when parsing a note with a zero name size.
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.
Nick Clifton [Fri, 25 Jan 2019 11:48:55 +0000 (11:48 +0000)]
Updated Bulgarian and Russian translations for some of the binutils sub-directories
Wu Heng [Fri, 25 Jan 2019 03:11:47 +0000 (13:41 +1030)]
PR23940, check bounds before using
PR gas/23940
* macro.c (getstring): Check array bound before accessing.
GDB Administrator [Fri, 25 Jan 2019 00:00:37 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Thu, 24 Jan 2019 23:04:14 +0000 (09:34 +1030)]
PR24125, Assertion failure with embedded NULs in string
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.
Pedro Alves [Thu, 24 Jan 2019 18:25:06 +0000 (18:25 +0000)]
target_pass_signals/target_program_signals: Use gdb::array_view
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.
Pedro Alves [Thu, 24 Jan 2019 18:01:49 +0000 (18:01 +0000)]
Fix clang/libc++ build
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.
Alan Hayward [Thu, 24 Jan 2019 08:17:39 +0000 (08:17 +0000)]
AArch64 AAPCS: Ignore static members
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.
GDB Administrator [Thu, 24 Jan 2019 00:00:48 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Wed, 23 Jan 2019 18:58:37 +0000 (18:58 +0000)]
Use scope_exit in regcache.c
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:36 +0000 (18:58 +0000)]
Update cleanup comment in ui-out.h
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:36 +0000 (18:58 +0000)]
Update an obsolete cleanup comment
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:35 +0000 (18:58 +0000)]
Remove remaining cleanup from fetch_inferior_event
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:35 +0000 (18:58 +0000)]
Remove cleanup from stop_all_threads
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:34 +0000 (18:58 +0000)]
Remove clear_symtab_users_cleanup
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:34 +0000 (18:58 +0000)]
Remove cleanup from linux-nat.c
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:33 +0000 (18:58 +0000)]
Remove cleanup_delete_std_terminate_breakpoint
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:33 +0000 (18:58 +0000)]
Remove make_bpstat_clear_actions_cleanup
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:32 +0000 (18:58 +0000)]
Remove delete_just_stopped_threads_infrun_breakpoints_cleanup
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:31 +0000 (18:58 +0000)]
Remove remaining cleanup from gdb/breakpoint.c
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.
Tom Tromey [Wed, 23 Jan 2019 18:58:31 +0000 (18:58 +0000)]
Replace delete_longjmp_breakpoint_cleanup with a forward_scope_exit type
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.
Pedro Alves [Wed, 23 Jan 2019 18:58:30 +0000 (18:58 +0000)]
Use SCOPE_EXIT in gdbarch-selftest.c
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.
Pedro Alves [Wed, 23 Jan 2019 18:58:30 +0000 (18:58 +0000)]
Use forward_scope_exit for scoped_finish_thread_state
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.
Pedro Alves [Wed, 23 Jan 2019 18:58:29 +0000 (18:58 +0000)]
Introduce forward_scope_exit
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.
Pedro Alves [Wed, 23 Jan 2019 18:58:29 +0000 (18:58 +0000)]
Introduce scope_exit
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.
Pedro Alves [Wed, 23 Jan 2019 18:58:28 +0000 (18:58 +0000)]
Rename ESC -> ESC_PARENS
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.
Tom Tromey [Fri, 18 Jan 2019 14:45:01 +0000 (07:45 -0700)]
Remove a warning from symtab.c
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.
Alan Hayward [Wed, 23 Jan 2019 11:31:40 +0000 (11:31 +0000)]
AArch64: Ensure lwp info is created zeroed
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.
Nick Clifton [Wed, 23 Jan 2019 10:26:54 +0000 (10:26 +0000)]
Updated translations for some of the binutils subdirectory.
Sebastian Huber [Mon, 14 Jan 2019 07:30:19 +0000 (08:30 +0100)]
ld: Add LTO warning to --wrap documentation
ld/
* ld.texi (--wrap): Add warning that LTO may make this feature
ineffective.
Tom Tromey [Mon, 21 Jan 2019 22:18:50 +0000 (15:18 -0700)]
corelow.c does not need sys/file.h
I did not see any reason that corelow.c should include <sys/file.h>.
The provided explanatory comment seems to be wrong. This patch
removes the include.
2019-01-22 Tom Tromey <tom@tromey.com>
* corelow.c: Do not include sys/file.h.
Tom Tromey [Mon, 21 Jan 2019 21:50:24 +0000 (14:50 -0700)]
Include coff/sym.h from coff/ecoff.h
coff/ecoff.h refers to some names defined in coff/sym.h. Include the
latter from the former, so that users of the header don't need to know
this detail.
2019-01-22 Tom Tromey <tom@tromey.com>
* coff/ecoff.h: Include coff/sym.h.
Tom Tromey [Mon, 21 Jan 2019 21:18:25 +0000 (14:18 -0700)]
Include gdb_curses.h in tui-wingeneral.h
tui-wingeneral.h uses WINDOW, which is defined by curses. So, include
gdb_curses.h from tui-wingeneral.h.
2019-01-22 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h: Include gdb_curses.h.
Tom Tromey [Mon, 21 Jan 2019 21:17:32 +0000 (14:17 -0700)]
Rename "lines" parameter in source-cache.h
A compile in the TUI somehow had "lines" defined as a macro. This
caused a compile error when including source-cache.h after whatever
header did that. I tracked this down to a #define in
/usr/include/term.h, so I just changed source-cache.h to avoid the
clash.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* source-cache.h (class source_cache) <get_source_lines,
get_plain_source_lines, extract_lines>: Rename "lines" parameter.
Tom Tromey [Mon, 21 Jan 2019 21:08:59 +0000 (14:08 -0700)]
Declare remote_target in remote-fileio.h
remote-fileio.h refers to remote_target, so forward-declare it.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* remote-fileio.h (struct remote_target): Declare.
Tom Tromey [Mon, 21 Jan 2019 20:49:06 +0000 (13:49 -0700)]
Do not include py-ref.h in most files
py-ref.h can really only be included from a specific spot in
python-internal.h. The other includes are not useful, and cause
compilation errors if the includes are ever sorted. So, remove these
includes.
Arguably, py-ref.h should simply not be a separate header.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* python/py-arch.c: Do not include py-ref.h.
* python/py-bpevent.c: Do not include py-ref.h.
* python/py-cmd.c: Do not include py-ref.h.
* python/py-continueevent.c: Do not include py-ref.h.
* python/py-event.h: Do not include py-ref.h.
* python/py-evtregistry.c: Do not include py-ref.h.
* python/py-finishbreakpoint.c: Do not include py-ref.h.
* python/py-frame.c: Do not include py-ref.h.
* python/py-framefilter.c: Do not include py-ref.h.
* python/py-function.c: Do not include py-ref.h.
* python/py-infevents.c: Do not include py-ref.h.
* python/py-linetable.c: Do not include py-ref.h.
* python/py-objfile.c: Do not include py-ref.h.
* python/py-param.c: Do not include py-ref.h.
* python/py-prettyprint.c: Do not include py-ref.h.
* python/py-progspace.c: Do not include py-ref.h.
* python/py-symbol.c: Do not include py-ref.h.
* python/py-symtab.c: Do not include py-ref.h.
* python/py-type.c: Do not include py-ref.h.
* python/py-unwind.c: Do not include py-ref.h.
* python/py-utils.c: Do not include py-ref.h.
* python/py-value.c: Do not include py-ref.h.
* python/py-varobj.c: Do not include py-ref.h.
* python/py-xmethods.c: Do not include py-ref.h.
* python/python.c: Do not include py-ref.h.
* varobj.c: Do not include py-ref.h.
Tom Tromey [Mon, 21 Jan 2019 20:45:00 +0000 (13:45 -0700)]
Use "struct bcache" in objfiles.h
If objfiles.h is included after bcache.h, then the "bcache" function
will cause a compiler error because "bcache" will be seen as a
function, not a type. Fix this error by using the "struct" keyword.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage): Use "struct"
keyword for bcache.
Tom Tromey [Mon, 21 Jan 2019 20:43:16 +0000 (13:43 -0700)]
Remove a comment in compile/compile-cplus-types.c
The include sorter can't handle multi-line comments on the same line
as a #include. This patch removes the only such comment.
In general I think these sorts of comments do not provide much value:
more often than not, I find that the comment is obsolete in one way or
another, and so the include sorter removes them in most cases.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* compile/compile-cplus-types.c: Remove a comment by #include.
Tom Tromey [Mon, 21 Jan 2019 20:42:36 +0000 (13:42 -0700)]
Include compile-internal.h in gcc-c-plugin.h
gcc-c-plugin.h refers to some types defined in compile-internal.h.
This patch changes the former to include the latter.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* compile/gcc-c-plugin.h: Include compile-internal.h.
GDB Administrator [Wed, 23 Jan 2019 00:00:31 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Tue, 22 Jan 2019 08:58:59 +0000 (01:58 -0700)]
Remove the EXTERN define from stabsread.h
This removes the EXTERN define from stabsread.h. This is the only
spot that still uses this approach, and it interfered with sorting the
includes in stabsread.c.
Tested by rebuilding.
gdb/ChangeLog
2019-01-22 Tom Tromey <tom@tromey.com>
* stabsread.c (EXTERN): Do not define.
(symnum, next_symbol_text_func, processing_gcc_compilation)
(within_function, global_sym_chain, global_stabs)
(previous_stab_code, this_object_header_files)
(n_this_object_header_files)
(n_allocated_this_object_header_files): Define.
* stabsread.h (EXTERN): Never define. Use "extern".
GDB Administrator [Tue, 22 Jan 2019 00:00:30 +0000 (00:00 +0000)]
Automatic date update in version.in
Philippe Waroquiers [Sun, 20 Jan 2019 15:59:00 +0000 (16:59 +0100)]
Fix leak in event-top.c history expansion
E.g. in gdb.base/default.exp, valgrind detects leaks such as
==17663== 1,438 bytes in 101 blocks are definitely lost in loss record 2,804 of 2,884
==17663== at 0x4C2BE6D: malloc (vg_replace_malloc.c:309)
==17663== by 0x418A17: xmalloc (common-utils.c:44)
==17663== by 0x4E6F19C: history_expand (histexpand.c:1061)
==17663== by 0x4B4490: handle_line_of_input(buffer*, char const*, int, char const*) (event-top.c:685)
==17663== by 0x4B4562: command_line_handler(std::unique_ptr<char, gdb::xfree_deleter<char> >&&) (event-top.c:753)
...
Fix the leak by using an unique_xmalloc_ptr for history_value.
gdb/ChangeLog
2019-01-22 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* event-top.c (handle_line_of_input): use unique_xmalloc_ptr for
history_value.
Tom Tromey [Sat, 19 Jan 2019 21:08:48 +0000 (14:08 -0700)]
Remove duplicate or commented-out #includes
I wrote a little script to detect duplicate or commented-out #includes
and ran it on gdb. This patch is the result. Tested by rebuilding.
gdb/ChangeLog
2019-01-21 Tom Tromey <tom@tromey.com>
* ui-out.c: Fix includes.
* tui/tui-source.c: Fix includes.
* target.c: Fix includes.
* remote.c: Fix includes.
* regcache.c: Fix includes.
* python/py-block.c: Fix includes.
* printcmd.c: Fix includes.
* or1k-tdep.c: Fix includes.
* mi/mi-main.c: Fix includes.
* m32r-tdep.c: Fix includes.
* csky-tdep.c: Fix includes.
* compile/compile-cplus-types.c: Fix includes.
* cli/cli-interp.c: Fix includes.
gdb/gdbserver/ChangeLog
2019-01-21 Tom Tromey <tom@tromey.com>
* tracepoint.c: Fix includes.
* remote-utils.c: Fix includes.
* linux-x86-low.c: Fix includes.
gdb/stubs/ChangeLog
2019-01-21 Tom Tromey <tom@tromey.com>
* ia64vms-stub.c: Fix includes.
Tom Tromey [Mon, 21 Jan 2019 15:41:28 +0000 (08:41 -0700)]
Fix leak in splay-tree
Philippe Waroquiers noticed a memory leak in gdb, which he tracked
down to a bug in splay-tree. splay_tree_remove does not call the
`delete_key' function when it removes the old node; but it should.
I looked at every splay tree in GCC and there is only one that passes
a non-NULL delete function -- the one in lto.c. That file does not
call splay_tree_remove. So, I think this is safe to check in.
I re-ran the LTO tests to double check.
libiberty/
* splay-tree.c (splay_tree_remove): Delete the key if necessary.
Alan Hayward [Mon, 21 Jan 2019 15:51:49 +0000 (15:51 +0000)]
AArch64 AAPCS: Empty structs have non zero size in C++
When gdb.base/infcall-nested-structs.c is complied as C++, the compiler
will not pass structs containing empty structs via float arguments.
This is because structs in C++ have a minimum size of 1, causing padding
in the struct once compiled. The AAPCS does not allow structs with
padding to be passed in float arguments.
Add padding checks to AArch64 and add C++ compile variant to the test.
Some of the tests fail on X86_64. This has been raised as bug gdb/24104.
gdb/ChangeLog:
* aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check
for padding.
gdb/testsuite/ChangeLog:
* gdb.base/infcall-nested-structs.exp: Test C++ in addition to C.
Nick Clifton [Mon, 21 Jan 2019 13:05:44 +0000 (13:05 +0000)]
Updated Brazilian Portuguese translation for the ld/ subdirectory.
Nick Clifton [Mon, 21 Jan 2019 12:59:20 +0000 (12:59 +0000)]
Updated translations for various binutils subdirectories.
Yuri Chornoivan [Mon, 21 Jan 2019 12:39:24 +0000 (12:39 +0000)]
Fix spelling mistakes in BFD library.
PR 24108
bfd * elf32-nds32.c (nds32_relocate_section): Add space between words
in error message.
* elfnn-riscv.c (riscv_version_mismatch): Fix spelling mistake in
error message.
(riscv_i_or_e_p): Likewise.
(riscv_merge_arch_attr_info): Likewise.
ld * testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Update
expected error message.
Alan Hayward [Mon, 21 Jan 2019 10:43:53 +0000 (10:43 +0000)]
Testsuite: Ensure stack protection is off for GCC
Using -fstack-protector-strong will cause GDB to break on the wrong line
when placing a breakpoint on a function. This is due to inadequate dwarf
line numbering, and is being tracked by the GCC bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88432
GCC (and Clang) provided by Debian/Ubuntu default to stack protector
being enabled.
Ensure that when running the GDB testsuite, stack protector is always
turned off for GCC 4.1.0 (when stack protector was added) and above.
Ensure that this does not cause infinite recursion due to
test_compiler_info having to compile a file itself.
Add a test to explicitly test breakpoints with various levels of stack
protection on both GCC and Clang, with xfail for the known errors.
Restore change in ovldbreak.exp which worked around the issue.
gdb/testsuite/ChangeLog:
2019-01-18 Alan Hayward <alan.hayward@arm.com>
* gdb.base/stack-protector.c: New test.
* gdb.base/stack-protector.exp: New file.
* gdb.cp/ovldbreak.exp: Only allow a single break line.
* lib/gdb.exp (get_compiler_info): Use getting_compiler_info
option.
(gdb_compile): Remove stack protector for GCC and prevent
recursion.
GDB Administrator [Mon, 21 Jan 2019 00:00:29 +0000 (00:00 +0000)]
Automatic date update in version.in
Chenghua Xu [Sun, 20 Jan 2019 01:51:30 +0000 (01:51 +0000)]
[MIPS] fix typo in mips_arch_choices.
opcodes/
* mips-dis.c (mips_arch_choices): Fix typo in
gs464, gs464e and gs264e descriptors.
GDB Administrator [Sun, 20 Jan 2019 00:01:16 +0000 (00:01 +0000)]
Automatic date update in version.in
Nick Clifton [Sat, 19 Jan 2019 16:51:42 +0000 (16:51 +0000)]
Change version to 2.32.51 and regenerate configure and pot files.
Nick Clifton [Sat, 19 Jan 2019 15:55:50 +0000 (15:55 +0000)]
Add markers for 2.32 branch to NEWS and ChangeLog files.
GDB Administrator [Sat, 19 Jan 2019 00:00:46 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Fri, 18 Jan 2019 00:00:50 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Wed, 16 Jan 2019 14:18:58 +0000 (07:18 -0700)]
Make minimal symbol range adapter a method on objfile
This removes class objfile_msymbols in favor of a method on the
objfile.
2019-01-16 Tom Tromey <tom@tromey.com>
* objfiles.h (struct minimal_symbol_iterator): Rename. Move
earlier.
(struct objfile) <msymbols_range>: Move from top level.
<msymbols>: New method.
(class objfile_msymbols): Remove.
* symtab.c (default_collect_symbol_completion_matches_break_on):
Update.
* symmisc.c (dump_msymbols): Update.
* stabsread.c (scan_file_globals): Update.
* objc-lang.c (info_selectors_command, info_classes_command)
(find_methods): Update.
* minsyms.c (find_solib_trampoline_target): Update.
* hppa-tdep.c (hppa_lookup_stub_minimal_symbol): Update.
* coffread.c (coff_symfile_read): Update.
* ada-lang.c (ada_lookup_simple_minsym)
(ada_collect_symbol_completion_matches): Update.
Tom Tromey [Wed, 16 Jan 2019 14:09:55 +0000 (07:09 -0700)]
Simplify minsym iteration
This simplifies the minimal symbol iterator, by using
minimal_symbol_count and just doing a somewhat ordinary array-like
iteration. array_view is nearly usable, except that it is more
convenient for this iterator to return pointers rather than
references.
gdb/ChangeLog
2019-01-16 Tom Tromey <tom@tromey.com>
* objfiles.h (class objfile_msymbols) <iterator>: Change argument
type. Remove no-argument constructor.
<iterator::operator++>: Simplify.
<begin>: Update.
<end>: Use minimal_symbol_count.
Tom Tromey [Wed, 16 Jan 2019 13:37:15 +0000 (06:37 -0700)]
Make psymtab range adapter a method on objfile
This removes the objfile_psymtabs class in favor of a method on
objfile and on psymtab_storage.
2019-01-16 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile) <psymtabs>: New method.
(class objfile_psymtabs): Remove.
* psymtab.h (class psymtab_storage) <partial_symtab_range>: New
typedef.
<range>: New method.
(require_partial_symbols): Change return type.
* psymtab.c (require_partial_symbols)
(psym_expand_symtabs_matching): Update.
* mdebugread.c (parse_partial_symbols): Update.
* dbxread.c (dbx_end_psymtab): Update.
Tom Tromey [Wed, 16 Jan 2019 03:06:48 +0000 (20:06 -0700)]
Add compunits range adapter to objfile
This removes the objfile_compunits range adapter in favor of using a
method on objfile.
2019-01-15 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_objfile_from_block)
(lookup_symbol_in_objfile_symtabs)
(basic_lookup_transparent_type_1, find_pc_sect_compunit_symtab)
(find_line_symtab, info_sources_command)
(default_collect_symbol_completion_matches_break_on)
(make_source_files_completion_list): Update.
* symmisc.c (print_objfile_statistics, dump_objfile)
(maintenance_print_symbols, maintenance_info_symtabs)
(maintenance_check_symtabs, maintenance_info_line_tables):
Update.
* source.c (select_source_symtab)
(forget_cached_source_info_for_objfile): Update.
* objfiles.h (class objfile_compunits): Remove.
(struct objfile) <compunits_range>: New typedef.
(compunits): New method.
* objfiles.c (objfile_relocate1): Update.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update.
* maint.c (count_symtabs_and_blocks): Update.
* linespec.c (iterate_over_all_matching_symtabs): Update.
* cp-support.c (add_symbol_overload_list_qualified): Update.
* coffread.c (coff_symtab_read): Update.
* ada-lang.c (add_nonlocal_symbols)
(ada_collect_symbol_completion_matches)
(ada_add_global_exceptions): Update.
Tom Tromey [Wed, 16 Jan 2019 00:06:38 +0000 (17:06 -0700)]
Change all_objfiles_safe adapter to be a method on program_space
This changes the all_objfiles_safe range adapter to be a method on the
program space, and fixes up all the users.
gdb/ChangeLog
2019-01-15 Tom Tromey <tom@tromey.com>
* progspace.h (program_space) <objfiles_safe_range>: New
typedef.
<objfiles_safe>: New method.
* objfiles.h (class all_objfiles_safe): Remove.
* objfiles.c (free_all_objfiles, objfile_purge_solibs): Update.
* jit.c (jit_inferior_exit_hook): Update.
Tom Tromey [Tue, 15 Jan 2019 23:55:05 +0000 (16:55 -0700)]
Change all_objfiles adapter to be a method on program_space
This changes the all_objfiles range adapter to be a method on the
program space, and fixes up all the users.
gdb/ChangeLog
2019-01-17 Tom Tromey <tom@tromey.com>
* progspace.h (program_space) <objfiles_range>: New typedef.
<objfiles>: New method.
<objfiles_head>: Rename from objfiles.
(object_files): Update.
* guile/scm-progspace.c (gdbscm_progspace_objfiles): Update.
* guile/scm-pretty-print.c
(ppscm_find_pretty_printer_from_objfiles): Update.
* guile/scm-objfile.c (gdbscm_objfiles): Update.
* python/py-xmethods.c (gdbpy_get_matching_xmethod_workers):
Update.
* python/py-progspace.c (pspy_get_objfiles): Update.
* python/py-prettyprint.c (find_pretty_printer_from_objfiles):
Update.
* python/py-objfile.c (objfpy_lookup_objfile_by_name)
(objfpy_lookup_objfile_by_build_id): Update.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update.
* windows-tdep.c (windows_iterate_over_objfiles_in_search_order):
Update.
* symtab.c (iterate_over_symtabs, matching_obj_sections)
(expand_symtab_containing_pc, lookup_objfile_from_block)
(lookup_static_symbol, basic_lookup_transparent_type)
(find_pc_sect_compunit_symtab, find_symbol_at_address)
(find_line_symtab, info_sources_command)
(default_collect_symbol_completion_matches_break_on)
(make_source_files_completion_list, find_main_name): Update.
* symmisc.c (print_symbol_bcache_statistics)
(print_objfile_statistics, maintenance_print_symbols)
(maintenance_print_msymbols, maintenance_print_objfiles)
(maintenance_info_symtabs, maintenance_check_symtabs)
(maintenance_expand_symtabs, maintenance_info_line_tables):
Update.
* symfile.c (remove_symbol_file_command, overlay_invalidate_all)
(find_pc_overlay, find_pc_mapped_section, list_overlays_command)
(map_overlay_command, unmap_overlay_command)
(simple_overlay_update, expand_symtabs_matching)
(map_symbol_filenames): Update.
* symfile-debug.c (set_debug_symfile): Update.
* spu-tdep.c (spu_overlay_update, spu_objfile_from_frame):
Update.
* source.c (select_source_symtab, forget_cached_source_info):
Update.
* solib.c (solib_read_symbols): Update.
* solib-spu.c (append_ocl_sos): Update.
* psymtab.c (maintenance_print_psymbols)
(maintenance_info_psymtabs, maintenance_check_psymtabs): Update.
* probe.c (parse_probes_in_pspace, find_probe_by_pc): Update.
* printcmd.c (info_symbol_command): Update.
* ppc-linux-tdep.c (ppc_linux_spe_context_inferior_created):
Update.
* objfiles.h (class all_objfiles): Remove.
* objfiles.c (have_partial_symbols, have_full_symbols)
(have_minimal_symbols, qsort_cmp, update_section_map)
(shared_objfile_contains_address_p)
(default_iterate_over_objfiles_in_search_order): Update.
* objc-lang.c (info_selectors_command, info_classes_command)
(find_methods): Update.
* minsyms.c (find_solib_trampoline_target): Update.
* maint.c (maintenance_info_sections)
(maintenance_translate_address, count_symtabs_and_blocks):
Update.
* main.c (captured_main_1): Update.
* linux-thread-db.c (try_thread_db_load_from_pdir)
(has_libpthread): Update.
* linespec.c (iterate_over_all_matching_symtabs)
(search_minsyms_for_name): Update.
* jit.c (jit_find_objf_with_entry_addr): Update.
* hppa-tdep.c (find_unwind_entry)
(hppa_lookup_stub_minimal_symbol): Update.
* gcore.c (gcore_create_callback, objfile_find_memory_regions):
Update.
* elfread.c (elf_gnu_ifunc_resolve_by_cache)
(elf_gnu_ifunc_resolve_by_got): Update.
* dwarf2-frame.c (dwarf2_frame_find_fde): Update.
* dwarf-index-write.c (save_gdb_index_command): Update.
* cp-support.c (add_symbol_overload_list_qualified): Update.
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint): Update.
* blockframe.c (find_pc_partial_function): Update.
* ada-lang.c (ada_lookup_simple_minsym, add_nonlocal_symbols)
(ada_collect_symbol_completion_matches)
(ada_add_global_exceptions): Update.
Tom Tromey [Thu, 17 Jan 2019 04:46:00 +0000 (21:46 -0700)]
Remove cleanups from solib-target.c
This removes the remaining cleanups from solib-target.c, plus a VEC,
by using std::vector and std::unique_ptr.
Tested by the buildbot.
gdb/ChangeLog
2019-01-17 Tom Tromey <tom@tromey.com>
* solib-target.c (lm_info_target_p): Remove typedef. Don't
declare VEC.
(solib_target_parse_libraries): Change return type.
(library_list_start_segment, library_list_start_section)
(library_list_end_library, library_list_start_library); Update.
(solib_target_free_library_list): Remove.
(solib_target_parse_libraries): Remove cleanup. Change return
type.
(solib_target_current_sos): Update.
Tom Tromey [Thu, 17 Jan 2019 17:19:44 +0000 (10:19 -0700)]
Replace "the the" with "the"
This replaces "the the" with "the" in various comments.
Tested by rebuilding. This didn't test the solib-dsbt.c change, but
it looks harmless.
gdb/ChangeLog
2019-01-17 Tom Tromey <tromey@bapiya>
* valprint.c: Replace "the the" with "the".
* symtab.c: Replace "the the" with "the".
* solib.c: Replace "the the" with "the".
* solib-dsbt.c: Replace "the the" with "the".
* linespec.c: Replace "the the" with "the".
* dwarf2loc.h: Replace "the the" with "the".
* amd64-windows-tdep.c: Replace "the the" with "the".
* aarch64-tdep.c: Replace "the the" with "the".
Tamar Christina [Thu, 17 Jan 2019 16:05:37 +0000 (16:05 +0000)]
Arm: Clean up PE GAS testsuite correct THUMB tests.
The PE targets don't support mapping symbols and so the disassembler is unable
to correctly output thumb instructions when the input was thumb.
So for testcases that only have thumb output, I have copied them and skipped the
ones for which auto-detection is supposed to work on PE, and added a new one
that will force thumb output. This so that the tests still check the mapping
symbols.
For the tests that switch between thumb and arm in one file I just skip them
entirely on PE targets.
This cleans up the PE GAS testsuite.
gas/
* testsuite/gas/arm/archv6t2-1-pe.d: New test.
* testsuite/gas/arm/archv6t2-1.d: Skip pe.
* testsuite/gas/arm/csdb.d: Skip pe.
* testsuite/gas/arm/sb-thumb1-pe.d: New test.
* testsuite/gas/arm/sb-thumb1.d: Skip pe.
* testsuite/gas/arm/sb-thumb2-pe.d: New test.
* testsuite/gas/arm/sb-thumb2.d: Skip pe.
* testsuite/gas/arm/udf.d: Skip pe.
Nick Clifton [Thu, 17 Jan 2019 15:29:43 +0000 (15:29 +0000)]
Update objdump's --disassemble=<symbol> feature so that if <symbol> is a function, the entire function will be disassembled, regardless of the presence of interveening symbols.
* objdump.c (disassemble_section): When disassembling from a
symbol only stop at the next symbol if the original symbol was not
a function symbol. Otherwise continue disassembling until a new
function is reached.
* testsuite/binutils-all/objdump.exp: Add tests of extended
functionality.
* testsuite/binutils-all/disasm.s: New test source file.
GDB Administrator [Thu, 17 Jan 2019 00:00:51 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Wed, 16 Jan 2019 22:01:42 +0000 (17:01 -0500)]
Actually remove definitions of DEFINE_NON_INLINE_P and DEFINE_INLINE_P
I applied the patch "Do not expand macros to 'defined'" by hand because
I couldn't apply it with git-am, and of course forgot to remove the
macro definitions. This patch fixes it, and also makes the ChangeLog
entry a bit cleaner.
Jim Wilson [Wed, 16 Jan 2019 21:37:35 +0000 (13:37 -0800)]
Don't emit vendor attribute section if there is no attribute to emit.
2019-01-16 Kito Cheng <kito@andestech.com>
bfd/
* elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even
for OBJ_ATTR_PROC.
gas/
* testsuite/gas/riscv/attribute-empty.d: New.
Jim Wilson [Wed, 16 Jan 2019 21:28:35 +0000 (13:28 -0800)]
RISC-V: Merge ELF attribute for ld.
2019-01-16 Kito Cheng <kito@andestech.com>
Nelson Chu <nelson@andestech.com>
bfd/
* elfnn-riscv.c (in_subsets): New.
(out_subsets): Likewise.
(merged_subsets): Likewise.
(riscv_std_ext_p): Likewise.
(riscv_non_std_ext_p): Likewise.
(riscv_std_sv_ext_p): Likewise.
(riscv_non_std_sv_ext_p): Likewise.
(riscv_version_mismatch): Likewise.
(riscv_i_or_e_p): Likewise.
(riscv_merge_std_ext): Likewise.
(riscv_merge_non_std_and_sv_ext): Likewise.
(riscv_merge_arch_attr_info): Likewise.
(riscv_merge_attributes): Likewise.
(_bfd_riscv_elf_merge_private_bfd_data): Merge attribute.
ld/
* testsuite/ld-elf/orphan-region.d: XFAIL for RISC-V, because add new
section.
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Add new tests.
* testsuite/ld-riscv-elf/attr-merge-arch-01.d: New test.
* testsuite/ld-riscv-elf/attr-merge-arch-01a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-01b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-02a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-02b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-03a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-03b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-stack-align-a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-stack-align-b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-stack-align-failed-a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-stack-align-failed-b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-stack-align-failed.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-stack-align.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-01.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-01a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-01b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-02.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-02a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-02b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-03.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-03a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-03b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-04.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-04a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-04b.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-05.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-05a.s: Likewise.
* testsuite/ld-riscv-elf/attr-merge-strict-align-05b.s: Likewise.
Jim Wilson [Wed, 16 Jan 2019 21:14:59 +0000 (13:14 -0800)]
RISC-V: Support ELF attribute for gas and readelf.
2019-01-16 Kito Cheng <kito@andestech.com>
Nelson Chu <nelson@andestech.com>
bfd/
* elfnn-riscv.c (riscv_elf_obj_attrs_arg_type): New.
(elf_backend_obj_attrs_vendor): Define.
(elf_backend_obj_attrs_section_type): Likewise.
(elf_backend_obj_attrs_section): Likewise.
(elf_backend_obj_attrs_arg_type): Define as
riscv_elf_obj_attrs_arg_type.
* elfxx-riscv.c (riscv_estimate_digit): New.
(riscv_estimate_arch_strlen1): Likewise.
(riscv_estimate_arch_strlen): Likewise.
(riscv_arch_str1): Likewise.
(riscv_arch_str): Likewise.
* elfxx-riscv.h (riscv_arch_str): Declare.
binutils/
* readelf.c (get_riscv_section_type_name): New function.
(get_section_type_name): Add handler for RISC-V.
(riscv_attr_tag_t): Declare.
(riscv_attr_tag): New.
(display_riscv_attribute): New function.
(process_attributes): Add handler for RISC-V.
* testsuite/binutils-all/strip-3.d: Remove .riscv.attribute
section.
gas/
* config/tc-riscv.c (DEFAULT_RISCV_ATTR): Define to 0 if not defined.
(riscv_set_options): Add `arch_attr` field.
(riscv_opts): Set default value for arch_attr.
(riscv_write_out_arch_attr): New.
(riscv_set_public_attributes): Likewise.
(riscv_md_end): Likewise.
(riscv_convert_symbolic_attribute): Likewise.
(s_riscv_attribute): Likewise.
(explicit_arch_attr): Likewise.
(riscv_pseudo_table): Add .attribute to the table.
(options): Add OPTION_ARCH_ATTR and OPTION_NO_ARCH_ATTR
enumeration constants.
(md_longopts): Add `march-attr' and `mno-arch-attr' options.
(md_parse_option): Handle the new options.
(md_show_usage): Document the `march-attr' option.
* config/tc-riscv.h (md_end): Define as riscv_md_end
(riscv_md_end): Declare.
(CONVERT_SYMBOLIC_ATTRIBUTE): Define as
riscv_convert_symbolic_attribute.
(riscv_convert_symbolic_attribute): Declare.
(start_assemble): Declare.
* testsuite/gas/elf/elf.exp: Adjust test case for section2.e.
* testsuite/gas/elf/section2.e-riscv: New.
* testsuite/gas/riscv/attribute-01.d: New test
* testsuite/gas/riscv/attribute-02.d: Likewise.
* testsuite/gas/riscv/attribute-03.d: Likewise.
* testsuite/gas/riscv/attribute-04.d: Likewise.
* testsuite/gas/riscv/attribute-04.s: Likewise.
* testsuite/gas/riscv/attribute-05.d: Likewise.
* testsuite/gas/riscv/attribute-05.s: Likewise.
* testsuite/gas/riscv/attribute-06.d: Likewise.
* testsuite/gas/riscv/attribute-06.s: Likewise.
* testsuite/gas/riscv/attribute-07.d: Likewise.
* testsuite/gas/riscv/attribute-07.s: Likewise.
* testsuite/gas/riscv/attribute-08.d: Likewise.
* testsuite/gas/riscv/attribute-08.s: Likewise.
* testsuite/gas/riscv/attribute-unknown.d: Likewise.
* testsuite/gas/riscv/attribute-unknown.s: Likewise.
* testsuite/gas/riscv/empty.l: Likewise.
* doc/c-riscv.texi (.attribute): Add documentation.
* configure.ac (--enable-default-riscv-attribute): New options.
* configure: Re-generate.
* config.in: Re-generate.
include/
* elf/riscv.h (SHT_RISCV_ATTRIBUTES): Define.
(Tag_RISCV_arch): Likewise.
(Tag_RISCV_priv_spec): Likewise.
(Tag_RISCV_priv_spec_minor): Likewise.
(Tag_RISCV_priv_spec_revision): Likewise.
(Tag_RISCV_unaligned_access): Likewise.
(Tag_RISCV_stack_align): Likewise.
Pavel I. Kryukov [Wed, 16 Jan 2019 21:04:34 +0000 (16:04 -0500)]
Do not expand macros to 'defined'
Expanding a macro which contains 'defined' PP keyword is UB. It causes
a compilation failure when -Wexpansion-to-defined is used.
sim/common/Changelog:
2019-01-16 Pavel I. Kryukov <kryukov@frtk.ru>
* sim-arange.c: eliminate DEFINE_NON_INLINE_P
Keith Seitz [Wed, 16 Jan 2019 19:38:06 +0000 (11:38 -0800)]
Introduce dwarf2_cu::get_builder
This patch is an attempt to deal with a variety of bugs reported where
GDB segfaults attempting to access a dwarf2_cu's builder. In certain
circumstances, this builder can be NULL. This is especially common
when inheriting DIEs via inlined subroutines in other CUs. The test
case demonstrates one such situation reported by users. See gdb/23773,
rhbz1638798, and dups for other concrete examples.
The approach taken here is to save the ancestor CU into the dwarf2_cu of
all CUs with DIEs that are "imported." This can happen whenever
follow_die_offset and friends are called. This essentially introduces a
chain of CUs that caused the importation of a DIE from a CU. Whenever
a builder is requested of a CU that has none, the ancestors are searched
for the first one with a builder.
A design side effect of this is that the builder can now only be
accessed by getter and setter methods because the builder itself
is private.
The bulk of the patch is relatively mindless text conversion from
"cu->builder" to "cu->get_builder ()". I've included one test which
was derived from one (of the many) bugs reported on the issue in both
sourceware and Fedora bugzillas.
gdb/ChangeLog:
PR gdb/23773
* dwarf2read.c (dwarf2_cu) <ancestor>: New field.
<builder>: Rename to ..
<m_builder>: ... this and make private.
(dwarf2_cu::get_builder): New method. Change all users of
`builder' to use this method.
(dwarf2_start_symtab): Move to ...
(dwarf2_cu::start_symtab): ... here. Update all callers
(setup_type_unit_groups): Move to ...
(dwarf2_cu::setup_type_unit_groups): ... here. Update all
callers.
(dwarf2_cu::reset_builder): New method.
(process_full_compunit, process_full_type_unit): Use
dwarf2_cu::reset_builder.
(follow_die_offset): Record the ancestor CU if it is different
from the followed DIE's CU.
(follow_die_sig_1): Likewise.
gdb/testsuite/ChangeLog:
PR gdb/23773
* gdb.dwarf2/inlined_subroutine-inheritance.exp: New file.
Simon Marchi [Wed, 16 Jan 2019 19:32:13 +0000 (14:32 -0500)]
doc: Add table of MI versions
This patch adds a table summarizing the history or MI versions:
- The version number
- Which GDB version introduced it
- Breaking changes compared to the previous version
The goal of the table is to help writers of front ends know which
version of MI they can use with a given GDB version. It will also help
them update their code to work against a newer MI version.
Right now, we just have 1 and 2, but we expect to add an entry for 3
soon. I did a bit of archelogy and reverse engineering of the code to
come up with the breaking changes for MI 2.
I did some changes to the text around it, some things that I thought
needed to be clarified, seemed a bit dated or seemed just wrong
(especially "Apart from mi0, new versions of @value{GDBN} will not
support old versions of MI").
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Development and Front Ends): Add table of
MI versions. Update text around it.
John Darrington [Mon, 14 Jan 2019 15:55:17 +0000 (16:55 +0100)]
S12Z: gas: Fix bug when a symbol name was the single letter 'c'.
The assembler incorrectly recognised "c" as a register name, and
refused to allow it where it expected a symbol/label.
gas/
* config/tc-s12z.c (lex_reg_name): Compare the length of the strings
before the contents.
* testsuite/gas/s12z/labels.d: New file.
* testsuite/gas/s12z/labels.s: New file.
* testsuite/gas/s12z/s12z.exp: Add them.
John Darrington [Wed, 16 Jan 2019 13:34:50 +0000 (14:34 +0100)]
S12Z: gas: Permit "extend" instructions which don't actually extend.
Other assemblers permit "extending" a register into a register of a
smaller size or the same size. It doesn't make much sense to do this
but would appear to be a valid instruction. So change the error to a
warning.
gas/
* config/tc-s12z.c (tfr): Change as_bad to as_warn.
Also fix message typo and semantics.
John Darrington [Wed, 16 Jan 2019 13:34:50 +0000 (14:34 +0100)]
S12Z: Emit RELOC_S12Z_OPR instead of RELOC_EXT24 where appropriate.
When assembling instructions which involve OPR references, emit
RELOC_S12Z_OPR instead of RELOC_EXT24.
bfd/
* bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc.
* libbfd.h: regen.
* elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero
source field. (md_apply_fix): Apply final fix
to BFD_RELOC_S12Z_OPR.
* reloc.c[BFD_RELOC_S12Z_OPR]: New reloc.
gas/
* config/tc-s12z.c (emit_opr): Emit BFD_RELOC_S12Z_OPR instead of
BFD_RELOC_24.
* testsuite/gas/s12z/opr-indirect-expr.d: Expect R_S12Z_OPR instead
of R_S12Z_EXT24.
GDB Administrator [Wed, 16 Jan 2019 00:00:34 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Tue, 15 Jan 2019 22:45:39 +0000 (17:45 -0500)]
sim: Fix definition of SIM_ARANGE_INLINE
If HAVE_INLINE is false, SIM_ARANGE_INLINE is currently defined as
#define SIM_ARANGE_INLINE EXTERN
However, EXTERN is not defined anywhere, leading to errors such as:
In file included from
/mipt-mips/simulator/../../sim/common/sim-basics.h:147:0,
from /mipt-mips/simulator/export/gdb/sim-main.h:13,
from /mipt-mips/simulator/export/gdb/gdb_interface.cpp:7:
/mipt-mips/simulator/../../sim/common/sim-arange.h:71:27: error: ‘EXTERN’
does not name a type; did you mean ‘EUSERS’?
#define SIM_ARANGE_INLINE EXTERN
^
/mipt-mips/simulator/../../sim/common/sim-arange.h:76:1: note: in expansion
of macro ‘SIM_ARANGE_INLINE’
SIM_ARANGE_INLINE int
^~~~~~~~~~~~~~~~~
I (Simon) have reproduced the problem by simply removing the HAVE_INLINE
definition. This was originally reported by Pavel I. Kryukov
<kryukov@frtk.ru>.
sim/common/ChangeLog:
* sim-arange.h (SIM_ARANGE_INLINE): Change EXTERN to extern.
Tom Tromey [Sun, 6 Jan 2019 18:15:05 +0000 (11:15 -0700)]
Remove cleanup from remote.c
This removes the remaining cleanup from remote.c, by changing
remote_state::buf to be a gdb::char_vector, and then fixing up all the
fallout. The resulting patch is somewhat ugly, but on the other hand,
it eliminates some possibilities for mistakes.
Regression tested using the
Fedora-x86_64-native-extended-gdbserver-m64 builder on the buildbot.
gdb/ChangeLog
2019-01-15 Tom Tromey <tom@tromey.com>
* remote.c (class remote_state) <buf>: Now a char_vector.
<buf_size>: Remove.
(remote_target::getpkt): Change type of buf. Remove sizeof_buf
parameter.
(remote_target::getpkt_or_notif_sane_1)
(remote_target::getpkt_sane)
(remote_target::getpkt_or_notif_sane): Likewise.
(class remote_target) <putpkt>: New overload.
(remote_target::read_frame): Change type of "buf_p". Remove
sizeof_p parameter.
(packet_ok): New overload.
(packet_check_result): New overload.
Update all uses.
Tom Tromey [Sun, 6 Jan 2019 20:30:00 +0000 (13:30 -0700)]
Constify some remote-notif functions
This constifies the "buf" arguments to various remote-notif functions
and updates the users.
gdb/ChangeLog
2019-01-14 Tom Tromey <tom@tromey.com>
* remote-notif.c (handle_notification, remote_notif_ack)
(remote_notif_parse): Make "buf" const.
* remote-notif.h (struct notif_client) <parse, ack>: Make "buf"
const.
(remote_notif_parse, remote_notif_ack, handle_notification):
Likewise.
* remote.c (remote_notif_stop_parse): Make "buf" const.
(remote_target::remote_parse_stop_reply): Make "buf" const.
(remote_notif_stop_ack): Make "buf" const.
Tom Tromey [Sun, 6 Jan 2019 20:26:22 +0000 (13:26 -0700)]
Constify remote_console_output
This constifies the parameter to remote_console_output.
gdb/ChangeLog
2019-01-14 Tom Tromey <tom@tromey.com>
* remote.c (remote_console_output): Make parameter const.
Tom Tromey [Sun, 6 Jan 2019 20:24:11 +0000 (13:24 -0700)]
Constify target_pass_signals and target_program_signals
This constifies the final parameter to target_pass_signals and
target_program_signals and updates the rest of gdb.
Note that I have no way to test the nto-procfs.c change.
gdb/ChangeLog
2019-01-14 Tom Tromey <tom@tromey.com>
* target-debug.h (target_debug_print_signals): Constify.
* nto-procfs.c (nto_procfs_target::pass_signals): Update.
* procfs.c (procfs_target::pass_signals): Update.
* linux-nat.c (linux_nat_target::pass_signals): Update.
* linux-nat.h (class linux_nat_target) <pass_signals>: Update.
* target-delegates.c: Rebuild.
* remote.c (remote_target::program_signals): Update.
(remote_target::pass_signals): Update.
* target.c (target_pass_signals): Constify argument.
(target_program_signals): Likewise.
* target.h (struct target_ops) <pass_signals, program_signals>:
Constify argument.
(target_pass_signals, target_program_signals): Constify argument.
GDB Administrator [Tue, 15 Jan 2019 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Sat, 12 Jan 2019 20:35:06 +0000 (13:35 -0700)]
Fix placement of output in TUI mode
The fix for PR tui/28819 regressed gdb command output a bit. In
"nonl" mode, pressing the Enter key will result in a newline not being
echoed properly, so that gdb output for the command will begin on the
same line as the input.
This patch changes gdb_wgetch to echo the newline. I have only tested
this interactively, as the TUI doesn't have automated tests in
general.
gdb/ChangeLog
2019-01-14 Tom Tromey <tom@tromey.com>
PR tui/28819:
* tui/tui-io.c (gdb_wgetch): Print \r when needed.
Павел Крюков [Fri, 11 Jan 2019 09:47:42 +0000 (12:47 +0300)]
Include <string.h> to dis-asm.h to get strchr declaration
Include <string.h> to dis-asm.h to get strchr declaration
include/Changelog:
2019-01-11 Pavel I. Kryukov <kryukov@frtk.ru>
* dis-asm.h: include <string.h>