binutils-gdb.git
6 years agoAutomatic date update in version.in
GDB Administrator [Thu, 22 Nov 2018 00:00:17 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoS12Z opcodes: Fix bug disassembling certain shift instructions.
John Darrington [Tue, 20 Nov 2018 17:50:30 +0000 (18:50 +0100)]
S12Z opcodes: Fix bug disassembling certain shift instructions.

Shift and rotate instructions when the number of bit positions
was an immediate value greater than 1 were incorrectly disassembled.
This change fixes that problem and extends the test to check for
it.

gas/ChangeLog:

  testsuite/gas/s12z/shift.s: Add new test case.
  testsuite/gas/s12z/shift.d: Add expected result.

opcodes/ChangeLog:

  s12z-dis.c (print_insn_shift) [SB_REG_REG_N]: Enter special case
  if the postbyte matches the appropriate pattern.

6 years agoS12Z: Add alias instructions BHS and BLO.
John Darrington [Tue, 20 Nov 2018 17:50:30 +0000 (18:50 +0100)]
S12Z: Add alias instructions BHS and BLO.

These are documented by NXP as alternative mnemonics for BCC and BCS
respectively.

gas/ChangeLog:

        * config/tc-s12z.c (opcodes): bhs, blo: New members.
* testsuite/gas/s12z/bra.d: Add tests for aliases.
* testsuite/gas/s12z/bra.s: Add tests for aliases.

6 years agoMake command-repeat work after gdb.execute
Benno Fünfstück [Wed, 21 Nov 2018 17:06:05 +0000 (17:06 +0000)]
Make command-repeat work after gdb.execute

Since commit

  56bcdbea2bed ("Let gdb.execute handle multi-line commands")

command repetition after using the `gdb.execute` Python function
fails (the previous command is not repeated anymore). This happens
because read_command_lines_1 sets dont_repeat, but the call to
prevent_dont_repeat in execute_gdb_command is later.

The fix is to move the call to prevent_dont_repeat to the beginning of
the function.

Tested on my laptop (ArchLinux-x86_64).

gdb/ChangeLog:

PR python/23714
* gdb/python/python.c (execute_gdb_command): Call
prevent_dont_repeat earlier to avoid affecting dont_repeat.

gdb/testuite/ChangeLog:

PR python/23714
* gdb.python/python.exp: Test command repetition after
gdb.execute.

6 years agoFix linking MSP430 files created by gcc's LTO optimizer.
Jozef Lawrynowicz [Wed, 21 Nov 2018 16:21:25 +0000 (16:21 +0000)]
Fix linking MSP430 files created by gcc's LTO optimizer.

When invoking GCC with "-g -flto", the compiler will create LTO objects
with debug information. The objects created are "simple ELF" objects (see
libiberty/simple-object-elf.c) and do not have target-specific sections.

When the MSP430 linker sees one of these objects without a .MSP430.attributes
section it errors:

> error: /tmp/cc4LhbEI.ltrans0.ltrans.o uses MSP430X instructions but /tmp/ccynqIwudebugobj uses unknown
> error: /tmp/cc4LhbEI.ltrans0.ltrans.o uses the small code model whereas /tmp/ccynqIwudebugobj uses the unknown code model
> error: /tmp/cc4LhbEI.ltrans0.ltrans.o uses the small data model whereas /tmp/ccynqIwudebugobj uses the unknown data model
> error: /tmp/cc4LhbEI.ltrans0.ltrans.o uses the small code model but /tmp/ccynqIwudebugobj uses the unknown data model
> failed to merge target specific data of file /tmp/cc4LhbEI.ltrans0.ltrans.o

The following patch allows these debug LTO objects to be linked with other
MSP430 objects even if they do not have a .MSP430.attributes section.

bfd * elf32-msp430.c (elf32_msp430_merge_mspabi_attributes): Do not
error when .MSP430.attributes section is missing from objects
created by LTO.

6 years agogdb/riscv: Add target description support
Andrew Burgess [Mon, 29 Oct 2018 15:10:52 +0000 (15:10 +0000)]
gdb/riscv: Add target description support

This commit adds target description support for riscv.

I've used the split feature approach for specifying the architectural
features, and the CSR feature is auto-generated from the riscv-opc.h
header file.

If the target doesn't provide a suitable target description then GDB
will build one by looking at the bfd headers.

This commit does not implement target description creation for the
Linux or FreeBSD native targets, both of these will need to add
read_description methods into their respective target classes, which
probe the target features, and then call
riscv_create_target_description to build a suitable target
description.  Until this is done Linux and FreeBSD will get the same
default target description based on the bfd that bare-metal targets
get.

I've only added feature descriptions for 32 and 64 bit registers, 128
bit registers (for RISC-V) are not supported in the reset of GDB yet.

This commit removes the special reading of the MISA register in order
to establish the target features, this was only used for figuring out
the f-register size, and even that wasn't done consistently.  We now
rely on the target to tell us what size of registers it has (or look
in the BFD as a last resort).  The result of this is that we should
now support RV64 targets with 32-bit float, though I have not
extensively tested this combination yet.

* Makefile.in (ALL_TARGET_OBS): Add arch/riscv.o.
(HFILES_NO_SRCDIR): Add arch/riscv.h.
* arch/riscv.c: New file.
* arch/riscv.h: New file.
* configure.tgt: Add cpu_obs list of riscv, move riscv-tdep.o into
this list, and add arch/riscv.o.
* features/Makefile: Add riscv features.
* features/riscv/32bit-cpu.c: New file.
* features/riscv/32bit-cpu.xml: New file.
* features/riscv/32bit-csr.c: New file.
* features/riscv/32bit-csr.xml: New file.
* features/riscv/32bit-fpu.c: New file.
* features/riscv/32bit-fpu.xml: New file.
* features/riscv/64bit-cpu.c: New file.
* features/riscv/64bit-cpu.xml: New file.
* features/riscv/64bit-csr.c: New file.
* features/riscv/64bit-csr.xml: New file.
* features/riscv/64bit-fpu.c: New file.
* features/riscv/64bit-fpu.xml: New file.
* features/riscv/rebuild-csr-xml.sh: New file.
* riscv-tdep.c: Add 'arch/riscv.h' include.
(riscv_gdb_reg_names): Delete.
(csr_reggroup): New global.
(struct riscv_register_alias): Delete.
(struct riscv_register_feature): New structure.
(riscv_register_aliases): Delete.
(riscv_xreg_feature): New global.
(riscv_freg_feature): New global.
(riscv_virtual_feature): New global.
(riscv_csr_feature): New global.
(riscv_create_csr_aliases): New function.
(riscv_read_misa_reg): Delete.
(riscv_has_feature): Delete.
(riscv_isa_xlen): Simplify, just return cached xlen.
(riscv_isa_flen): Simplify, just return cached flen.
(riscv_has_fp_abi): Update for changes in struct gdbarch_tdep.
(riscv_register_name): Update to make use of tdesc_register_name.
Look up xreg and freg names in the new globals riscv_xreg_feature
and riscv_freg_feature.  Don't supply csr aliases here.
(riscv_fpreg_q_type): Delete.
(riscv_register_type): Use tdesc_register_type in almost all
cases, override the returned type in a few specific cases only.
(riscv_print_one_register_info): Handle errors reading registers.
(riscv_register_reggroup_p): Use tdesc_register_in_reggroup_p for
registers that are otherwise unknown to GDB.  Also check the
csr_reggroup.
(riscv_print_registers_info): Remove assert about upper register
number, and use gdbarch_register_reggroup_p instead of
short-cutting.
(riscv_find_default_target_description): New function.
(riscv_check_tdesc_feature): New function.
(riscv_add_reggroups): New function.
(riscv_setup_register_aliases): New function.
(riscv_init_reggroups): New function.
(_initialize_riscv_tdep): Add calls to setup CSR aliases, and
setup register groups.  Register new riscv debug variable.
* riscv-tdep.h: Add 'arch/riscv.h' include.
(struct gdbarch_tdep): Remove abi union, and add
riscv_gdbarch_features field.  Remove cached quad floating point
type, and provide initialisation for double type field.
* target-descriptions.c (maint_print_c_tdesc_cmd): Add riscv to
the list of targets using the feature based target descriptions.
* NEWS: Mention target description support.

gdb/doc/ChangeLog:

* gdb.texinfo (Standard Target Features): Add RISC-V Features
sub-section.

6 years agovalops.c: Overload resolution code: Rename parameters/locals
Pedro Alves [Wed, 21 Nov 2018 11:55:15 +0000 (11:55 +0000)]
valops.c: Overload resolution code: Rename parameters/locals

While looking over this code, I thought the names of the parameters to
find_oload_champ and related functions and locals were a bit too
cryptic.  For example, FN_LIST holds methods, not free functions.
Free-functions are in OLOAD_SYMS.

This patch renames parameters/variables to the more obvious
methods/xmethods/functions instead.

gdb/ChangeLog:
2018-11-21  Pedro Alves  <palves@redhat.com>

* valops.c (find_method_list, value_find_oload_method_list)
(find_overload_match, find_oload_champ): Rename parameters and
locals.

6 years agovalops.c: Some more gdb::array_view
Pedro Alves [Wed, 21 Nov 2018 11:55:14 +0000 (11:55 +0000)]
valops.c: Some more gdb::array_view

This commit replaces some more use of pointer+length pairs in the
overload resolution code with gdb::array_view.

find_oload_champ's interface is simplified/normalized: the xmethods
parameter is converted from std::vector to array pointer, and then the
num_fns parameter is always passed in, no matter the array which is
non-NULL.  I tweaked the formatting of callers a little bit here and
there so that the 3 optional parameters are all in the same line.  (I
tried making the 3 optional array parameters be array_views, but the
resulting code didn't look as nice.)

gdb/ChangeLog:
2018-11-21  Pedro Alves  <palves@redhat.com>

* valops.c (find_method_list): Replace pointer and length
parameters with an gdb::array_view.  Adjust.
(value_find_oload_method_list): Likewise.
(find_overload_match): Use gdb::array_view for methods list.
Adjust to find_oload_champ interface change.
(find_oload_champ): 'xm_worker_vec' parameter now a pointer/array.
'num_fns' parameter now a size_t.  Eliminate 'fn_count' local.

6 years agoC++ify badness_vector, fix leaks
Pedro Alves [Wed, 21 Nov 2018 11:55:14 +0000 (11:55 +0000)]
C++ify badness_vector, fix leaks

badness_vector is currently an open coded vector.  This reimplements
it as a std::vector.

This fixes a few leaks as well:

 - find_oload_champ is leaking every badness vector calculated bar the
   one returned.

 - bv->rank is always leaked, since callers of rank_function only
   xfree the badness_vector pointer, not bv->rank.

gdb/ChangeLog:
2018-11-21  Pedro Alves  <palves@redhat.com>

* gdbtypes.c (compare_badness): Change type of parameters to const
reference.  Adjust to badness_vector being a std::vector now.
(rank_function): Adjust to badness_vector being a std::vector now.
* gdbtypes.h (badness_vector): Now a typedef to std::vector.
(LENGTH_MATCH): Delete.
(compare_badness): Change type of parameters to const reference.
(rank_function): Return a badness_vector by value now.
(find_overload_match): Adjust to badness_vector being a
std::vector now.  Remove cleanups.
(find_oload_champ_namespace): 'oload_champ_bv' parameter now a
badness_vector pointer.
(find_oload_champ_namespace_loop): 'oload_champ_bv' parameter now
a badness_vector pointer.  Adjust to badness_vector being a
std::vector now.  Remove cleanups.
(find_oload_champ): 'oload_champ_bv' parameter now
a badness_vector pointer.  Adjust to badness_vector being a
std::vector now.  Remove cleanups.

6 years agoEliminate make_symbol_overload_list-related globals & cleanup
Pedro Alves [Wed, 21 Nov 2018 11:55:13 +0000 (11:55 +0000)]
Eliminate make_symbol_overload_list-related globals & cleanup

This gets rid of a few globals and a cleanup.

make_symbol_overload_list & friends currently maintain a global
open-coded vector.  Reimplement that with a std::vector, trickled down
through the functions.  Rename a few functions from "make_" to "add_"
for clarity.

gdb/ChangeLog:
2018-11-21  Pedro Alves  <palves@redhat.com>

* cp-support.c (sym_return_val_size, sym_return_val_index)
(sym_return_val): Delete.
(overload_list_add_symbol): Add std::vector parameter.  Adjust to
add to the vector.
(make_symbol_overload_list): Adjust to return a std::vector
instead of maintaining a global open coded vector.
(make_symbol_overload_list_block): Add std::vector parameter.
(make_symbol_overload_list_block): Rename to ...
(add_symbol_overload_list_block): ... this and add std::vector
parameter.
(make_symbol_overload_list_namespace): Rename to ...
(add_symbol_overload_list_namespace): ... this and add std::vector
parameter.
(make_symbol_overload_list_adl_namespace): Rename to ...
(add_symbol_overload_list_adl_namespace): ... this and add
std::vector parameter.
(make_symbol_overload_list_adl): Delete.
(add_symbol_overload_list_adl): New.
(make_symbol_overload_list_using): Rename to ...
(add_symbol_overload_list_using): ... this and add std::vector
parameter.
(make_symbol_overload_list_qualified): Rename to ...
(add_symbol_overload_list_qualified): ... this and add std::vector
parameter.
* cp-support.h: Include "common/array-view.h" and <vector>.
(make_symbol_overload_list): Change return type to std::vector.
(make_symbol_overload_list_adl): Delete declaration.
(add_symbol_overload_list_adl): New declaration.
* valops.c (find_overload_match): Local 'oload_syms' now a
std::vector.
(find_oload_champ_namespace): 'oload_syms' parameter now a
std::vector pointer.
(find_oload_champ_namespace_loop): 'oload_syms' parameter now a
std::vector pointer.  Adjust to new make_symbol_overload_list
interface.

6 years agoinvoke_xmethod & array_view
Pedro Alves [Wed, 21 Nov 2018 11:55:12 +0000 (11:55 +0000)]
invoke_xmethod & array_view

This replaces more pointer+length with gdb::array_view.  This time,
around invoke_xmethod, and then propagating the fallout around, which
inevitably leaks to the overload resolution code.

There are several places in the code that want to grab a slice of an
array, by advancing the array pointer, and decreasing the length
pointer.  This patch introduces a pair of new
gdb::array_view::slice(...) methods to make that convenient and clear.
Unit test included.

gdb/ChangeLog:
2018-11-21  Pedro Alves  <palves@redhat.com>

* common/array-view.h (array_view::splice(size_type, size_t)): New.
(array_view::splice(size_type)): New.
* eval.c (eval_call, evaluate_funcall): Adjust to use array_view.
* extension.c (xmethod_worker::get_arg_types): Adjust to return an
std::vector.
(xmethod_worker::get_result_type): Adjust to use gdb::array_view.
* extension.h: Include "common/array-view.h".
(xmethod_worker::invoke): Adjust to use gdb::array_view.
(xmethod_worker::get_arg_types): Adjust to return an std::vector.
(xmethod_worker::get_result_type): Adjust to use gdb::array_view.
(xmethod_worker::do_get_arg_types): Adjust to use std::vector.
(xmethod_worker::do_get_result_type): Adjust to use
gdb::array_view.
* gdbtypes.c (rank_function): Adjust to use gdb::array_view.
* gdbtypes.h: Include "common/array-view.h".
(rank_function): Adjust to use gdb::array_view.
* python/py-xmethods.c (python_xmethod_worker::invoke)
(python_xmethod_worker::do_get_arg_types)
(python_xmethod_worker::do_get_result_type)
(python_xmethod_worker::invoke): Adjust to new interfaces.
* valarith.c (value_user_defined_cpp_op, value_user_defined_op)
(value_x_binop, value_x_unop): Adjust to use gdb::array_view.
* valops.c (find_overload_match, find_oload_champ_namespace)
(find_oload_champ_namespace_loop, find_oload_champ): Adjust to use
gdb:array_view and the new xmethod_worker interfaces.
* value.c (result_type_of_xmethod, call_xmethod): Adjust to use
gdb::array_view.
* value.h (find_overload_match, result_type_of_xmethod)
(call_xmethod): Adjust to use gdb::array_view.
* unittests/array-view-selftests.c: Add slicing tests.

6 years agoUse gdb:array_view in call_function_by_hand & friends
Pedro Alves [Wed, 21 Nov 2018 11:55:11 +0000 (11:55 +0000)]
Use gdb:array_view in call_function_by_hand & friends

This replaces a few uses of pointer+length with gdb::array_view, in
call_function_by_hand and related code.

Unfortunately, due to -Wnarrowing, there are places where we can't
brace-initialize an gdb::array_view without an ugly-ish cast.  To
avoid the cast, this patch introduces a gdb::make_array_view function.
Unit tests included.

This patch in isolation may not look so interesting, due to
gdb::make_array_view uses, but I think it's still worth it.  Some of
the gdb::make_array_view calls disappear down the series, and others
could be eliminated with more (non-trivial) gdb::array_view
detangling/conversion (e.g. code around eval_call).  See this as a "we
have to start somewhere" patch.

gdb/ChangeLog:
2018-11-21  Pedro Alves  <palves@redhat.com>

* ada-lang.c (ada_evaluate_subexp): Adjust to pass an array_view.
* common/array-view.h (make_array_view): New.
* compile/compile-object-run.c (compile_object_run): Adjust to
pass an array_view.
* elfread.c (elf_gnu_ifunc_resolve_addr): Adjust.
* eval.c (eval_call): Adjust to pass an array_view.
(evaluate_subexp_standard): Adjust to pass an array_view.
* gcore.c (call_target_sbrk): Adjust to pass an array_view.
* guile/scm-value.c (gdbscm_value_call): Likewise.
* infcall.c (push_dummy_code): Replace pointer + size parameters
with an array_view parameter.
(call_function_by_hand, call_function_by_hand_dummy): Likewise and
adjust.
* infcall.h: Include "common/array-view.h".
(call_function_by_hand, call_function_by_hand_dummy): Replace
pointer + size parameters with an array_view parameter.
* linux-fork.c (inferior_call_waitpid): Adjust to use array_view.
* linux-tdep.c (linux_infcall_mmap): Likewise.
* objc-lang.c (lookup_objc_class, lookup_child_selector)
(value_nsstring, print_object_command): Likewise.
* python/py-value.c (valpy_call): Likewise.
* rust-lang.c (rust_evaluate_funcall): Likewise.
* spu-tdep.c (flush_ea_cache): Likewise.
* valarith.c (value_x_binop, value_x_unop): Likewise.
* valops.c (value_allocate_space_in_inferior): Likewise.
* unittests/array-view-selftests.c (run_tests): Add
gdb::make_array_view test.

6 years agoAutomatic date update in version.in
GDB Administrator [Wed, 21 Nov 2018 00:00:26 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agogdb: Use string_printf to format int fields instead of a fixed size buffer
Andrew Burgess [Tue, 20 Nov 2018 13:36:49 +0000 (13:36 +0000)]
gdb: Use string_printf to format int fields instead of a fixed size buffer

This patch removes a FIXME comment from cli-out.c, now instead of
formatting integers into a fixed size buffer we build a std::string
and extract the formatted integer from that.

The old code using a fixed size buffer was probably fine (the integer
was not going to overflow it) and probably slightly more efficient
(avoids building a std::string) however, given we already have utility
code in GDB that will allow the 'FIXME' comment to be removed, it
seems like an easy improvement.

gdb/ChangeLog:

* cli-out.c (cli_ui_out::do_field_int): Use string_printf rather
than a fixed size buffer.

6 years agogdb: Respect field width and alignment for 'fmt' fields in CLI output
Andrew Burgess [Tue, 20 Nov 2018 12:59:18 +0000 (12:59 +0000)]
gdb: Respect field width and alignment for 'fmt' fields in CLI output

Currently the method 'cli_ui_out::do_field_fmt' has this comment:

  /* This is the only field function that does not align.  */

The reality is even slightly worse, the 'fmt' field type doesn't
respect either the field alignment or the field width.  In at least
one place in GDB we attempt to work around this lack of respect for
field width by adding additional padding manually.  But, as is often
the case, this is leading to knock on problems.

Conside the output for 'info breakpoints' when a breakpoint has
multiple locations.  This example is taken from the testsuite, from
test gdb.opt/inline-break.exp:

  (gdb) info breakpoints
  Num     Type           Disp Enb Address            What
  1       breakpoint     keep y   <MULTIPLE>
  1.1                     y     0x00000000004004ae in func4b at /src/gdb/testsuite/gdb.opt/inline-break.c:64
  1.2                     y     0x0000000000400682 in func4b at /src/gdb/testsuite/gdb.opt/inline-break.c:64

The miss-alignment of the fields shown here is exactly as GDB
currently produces.

With this patch 'fmt' style fields are now first written into a
temporary buffer, and then written out as a 'string' field.  The
result is that the field width, and alignment should now be respected.
With this patch in place the output from GDB now looks like this:

  (gdb) info breakpoints
  Num     Type           Disp Enb Address            What
  1       breakpoint     keep y   <MULTIPLE>
  1.1                         y   0x00000000004004ae in func4b at /src/gdb/testsuite/gdb.opt/inline-break.c:64
  1.2                         y   0x0000000000400682 in func4b at /src/gdb/testsuite/gdb.opt/inline-break.c:64

This patch has been tested on x86-64/Linux with no regressions,
however, the testsuite doesn't always spot broken output formatting or
alignment.  I have also audited all uses of 'fmt' fields that I could
find, and I don't think there are any other places that specifically
try to work around the lack of width/alignment, however, I could have
missed something.

gdb/ChangeLog:

* breakpoint.c (print_one_breakpoint_location): Reduce whitespace,
and remove insertion of extra spaces in GDB's output.
* cli-out.c (cli_ui_out::do_field_fmt): Update header comment.
Layout field into a temporary buffer, and then output it as a
string field.

gdb/testsuite/ChangeLog:

* gdb.opt/inline-break.exp: Add test that info breakpoint output
is correctly aligned.

6 years agoNEWS: Document the language choice by 'info [types|functions|variables]|rbreak'.
Philippe Waroquiers [Sun, 28 Oct 2018 14:30:45 +0000 (15:30 +0100)]
NEWS: Document the language choice by 'info [types|functions|variables]|rbreak'.

gdb/ChangeLog
2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* NEWS: Document the language choice done by
'info [types|functions|variables]|rbreak'.

6 years agoDocument language choice in 'info [functions|variables|types]|rbreak' commands
Philippe Waroquiers [Sun, 28 Oct 2018 14:11:37 +0000 (15:11 +0100)]
Document language choice in 'info [functions|variables|types]|rbreak' commands

doc/ChangeLog
2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.texinfo (Examining the Symbol Table): Document language choice
for 'info types|functions|variables' commands.
(Setting Breakpoints): Document language choice to print
the functions in which a breakpoint is set.

6 years agoAdd a test to verify info [functions|variables|types]|rbreak respect language_mode.
Philippe Waroquiers [Sun, 28 Oct 2018 13:07:52 +0000 (14:07 +0100)]
Add a test to verify info [functions|variables|types]|rbreak respect language_mode.

2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.ada/info_auto_lang.exp: New testcase.
* gdb.ada/info_auto_lang/global_pack.ads: New file.
* gdb.ada/info_auto_lang/proc_in_ada.adb: New file.
* gdb.ada/info_auto_lang/some_c.c: New file.

6 years agoUse scoped_switch_to_sym_language_if_auto in symtab.c to switch language.
Philippe Waroquiers [Sun, 28 Oct 2018 12:57:51 +0000 (13:57 +0100)]
Use scoped_switch_to_sym_language_if_auto in symtab.c to switch language.

Use scoped_switch_to_sym_language_if_auto in treg_matches_sym_type_name to
replace the local logic that was doing the same as the new class
scoped_switch_to_sym_language_if_auto.

Use scoped_switch_to_sym_language_if_auto inside print_symbol_info, so
that symbol information is printed in the symbol language when
language mode is auto.
This modifies the behaviour of the test dw2-case-insensitive.exp,
as the function FUNC_lang is now printed with the Fortran syntax
(as declared in the .S file).

gdb/ChangeLog
2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* symtab.c (treg_matches_sym_type_name): Use
scoped_switch_to_sym_language_if_auto instead of local logic.
(print_symbol_info): Use scoped_switch_to_sym_language_if_auto
to switch to SYM language when language mode is auto.

gdb/testsuite/ChangeLog
2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.dwarf2/dw2-case-insensitive.exp: Update due to auto switch to
FUNC_lang language syntax.

6 years agoAdd class scoped_switch_to_sym_language_if_auto.
Philippe Waroquiers [Sun, 28 Oct 2018 12:51:32 +0000 (13:51 +0100)]
Add class scoped_switch_to_sym_language_if_auto.

The class scoped_switch_to_sym_language_if_auto allows to switch in a scope
the current language to the language of a symbol when language mode is
set to auto.

2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* language.h (scoped_switch_to_sym_language_if_auto): New class.

6 years agoTest case for 'info variables|functions' with minimal symbols.
Philippe Waroquiers [Tue, 30 Oct 2018 20:56:32 +0000 (21:56 +0100)]
Test case for 'info variables|functions' with minimal symbols.

2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.base/info_minsym.c: New file.
* gdb.base/info_minsym.exp: New file.

6 years agoFix regression 'info variables' does not show minimal symbols.
Philippe Waroquiers [Tue, 30 Oct 2018 20:20:52 +0000 (21:20 +0100)]
Fix regression 'info variables' does not show minimal symbols.

12615cba8411c8 Add [-q] [-t TYPEREGEXP] [NAMEREGEXP] args to info [args|functions|locals|variables]
introduced a regression that minimal symbols were not listed anymore, due to a wrong
condition checking the absence of a type regexp in the loop scanning the minimal symbols.

Instead, before entering the loop scanning the minimal symbols, check that we
do not have a type regexp, as we will never match a minimal symbol with
this type regexp.

With the fix in this patch, for this part of the code, we basically go back
to the GDB 8.2 logic, with just the addition of
  && !treg.has_value ())
to 'enter' in the minsym case.
This should ensure that at least there is no regression compared to 8.2,
when not using the new type matching argument, as there was no treg in 8.2.

2018-11-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* symtab.c (search_symbols): Properly check absence of type regexp
before entering the loop scanning the minimal symbols.

6 years agoFix gdb/ChangeLog formatting and date
Pedro Alves [Tue, 20 Nov 2018 19:04:14 +0000 (19:04 +0000)]
Fix gdb/ChangeLog formatting and date

6 years agoGDB: S12Z: new function s12z_extract_return_value
John Darrington [Tue, 20 Nov 2018 17:50:30 +0000 (18:50 +0100)]
GDB: S12Z: new function s12z_extract_return_value

Make gdb aware of the return values of functions which
return in registers.

gdb/ChangeLog:
* s12z-tdep.c (s12z_extract_return_value): New function.
  (inv_reg_perm) New array.
  (s12z_return_value): Populate readbuf if non-null.

6 years agoFix previous change in filestuff.c
Eli Zaretskii [Tue, 20 Nov 2018 17:23:51 +0000 (19:23 +0200)]
Fix previous change in filestuff.c

gdb/ChangeLog:

* common/filestuff.c (O_NOINHERIT): Define if not defined.

6 years agoAvoid "Invalid parameter passed to C runtime function" warning
Eli Zaretskii [Tue, 20 Nov 2018 16:49:43 +0000 (18:49 +0200)]
Avoid "Invalid parameter passed to C runtime function" warning

This warning was displayed by OutputDebugString on MinGW when
GDB was being debugged natively.

gdb/ChangeLog:

* common/filestuff.c (gdb_fopen_cloexec): Disable use of "e" mode
with 'fopen' also if O_CLOEXEC is equal to O_NOINHERIT, to cater
to MinGW fixed by Gnulib.

6 years agoreadelf: Prune gaps warning in build notes
H.J. Lu [Tue, 20 Nov 2018 14:45:28 +0000 (06:45 -0800)]
readelf: Prune gaps warning in build notes

Since some object files may not have build notes, it is normal to have
gaps in build notes.

PR binutils/23898
* testsuite/lib/binutils-common.exp (prune_warnings_extra):
Prune gaps in build notes.

6 years agoGDB: S12Z: Add assertion
John Darrington [Thu, 8 Nov 2018 16:51:22 +0000 (17:51 +0100)]
GDB: S12Z: Add assertion

gdb/ChangeLog:

* s12z-tdep.c (s12z_frame_cache): Add an assertion.

6 years agoRemove displaced_step_inferior_state::next
Simon Marchi [Tue, 20 Nov 2018 03:35:19 +0000 (22:35 -0500)]
Remove displaced_step_inferior_state::next

Commit

  39a36629f68e ("Use std::forward_list for displaced_step_inferior_states")

missed removing the "next" field, while changing the hand-made linked
list in favor of std::forward_list.  This patch fixes that.

gdb/ChangeLog:

* infrun.c (displaced_step_inferior_state) <next>: Remove.

6 years agoAutomatic date update in version.in
GDB Administrator [Tue, 20 Nov 2018 00:00:36 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoChange get_filename_and_charpos to return void
Tom Tromey [Tue, 9 Oct 2018 20:31:15 +0000 (14:31 -0600)]
Change get_filename_and_charpos to return void

The return value from get_filename_and_charpos is never used, so this
patch changes it to return void.

gdb/ChangeLog
2018-11-19  Tom Tromey  <tom@tromey.com>

* source.c (get_filename_and_charpos): Return void.

6 years agoFix inaccuracies in "info skip" help
Simon Marchi [Mon, 19 Nov 2018 22:27:13 +0000 (17:27 -0500)]
Fix inaccuracies in "info skip" help

"help info skip" uses "skip info" in its examples, which is not the same
(it ends up creating new skips).  Also, the Type column that is referred
to doesn't exist today.

gdb/ChangeLog:

* skip.c (_initialize_step_skip): Fix "info skip" help.

6 years agoHandle TYPE_CODE_PTR when printing Rust types
Tom Tromey [Fri, 16 Nov 2018 22:30:35 +0000 (15:30 -0700)]
Handle TYPE_CODE_PTR when printing Rust types

This changes the Rust type printers to handle TYPE_CODE_PTR.  The
current approach is not ideal, because currently the code can't
distinguish between mut and const, or between pointers and references.
(These are debuginfo deficiencies, for which there are rustc bugs on
file.)

Meanwhile, this at least clears up the case seen in PR rust/23625.

Tested on x86-64 Fedora 28.  The nightly compiler gives the best
results, but I regression-tested with stable and beta as well.

gdb/ChangeLog
2018-11-16  Tom Tromey  <tom@tromey.com>

PR rust/23625:
* rust-lang.c (rust_internal_print_type): Handle TYPE_CODE_PTR.

gdb/testsuite/ChangeLog
2018-11-19  Tom Tromey  <tom@tromey.com>

PR rust/23625:
* gdb.rust/simple.exp: Add ptype test.  Update expected output.
* gdb.rust/expr.exp: Update expected output.  Change one test.

6 years agoFix gdb.rust/simple.rs for more recent compilers
Tom Tromey [Mon, 19 Nov 2018 17:52:32 +0000 (10:52 -0700)]
Fix gdb.rust/simple.rs for more recent compilers

gdb.rust/simple.exp will fail when run with a recent version of rustc.
This patch fixes the test case so that it will continue to run.

Tested on x86-64 Fedora 28.

I also temporarily backed out the rust-lang.c from
commit 098b2108a2b61531c0bc8ea16854f773083a95d7, and verified that
this updated test still would have provoked the original bug.

gdb/testsuite/ChangeLog
2018-11-19  Tom Tromey  <tom@tromey.com>

* gdb.rust/simple.rs: Don't initialize empty_enum_value.

6 years agoUse std::forward_list for displaced_step_inferior_states
Simon Marchi [Mon, 19 Nov 2018 16:05:13 +0000 (11:05 -0500)]
Use std::forward_list for displaced_step_inferior_states

Use std::forward_list instead of manually implemented list.  This
simplifies a bit the code, especially around removal.

Regtested on the buildbot.  There are some failures as always, but I
think they are unrelated.

gdb/ChangeLog:

* infrun.c (displaced_step_inferior_states): Change type to
std::forward_list.
(get_displaced_stepping_state): Adjust.
(displaced_step_in_progress_any_inferior): Adjust.
(add_displaced_stepping_state): Adjust.
(remove_displaced_stepping_state): Adjust.

6 years agoGDB: Add ChangeLog entry inadvertently omitted from commit.
John Darrington [Mon, 19 Nov 2018 16:36:42 +0000 (17:36 +0100)]
GDB: Add ChangeLog entry inadvertently omitted from commit.

6 years agogdb.base/warning.exp tweaks
Pedro Alves [Mon, 19 Nov 2018 15:08:46 +0000 (15:08 +0000)]
gdb.base/warning.exp tweaks

#1- Check that the warning is emitted.

#2- Avoid overriding INTERNAL_GDBFLAGS, as per documentated in
    gdb/testsuite/README:

 ~~~
 The testsuite does not override a value provided by the user.
 ~~~

We don't actually need to tweak INTERNAL_GDBFLAGS, we just need to
append out -data-directory to GDBFLAGS, because each passed
-data-directory option leads to a call to the warning:

 $ ./gdb -data-directory=foo -data-directory=bar
 Warning: foo: No such file or directory.
 Warning: bar: No such file or directory.
 [...]

gdb/ChangeLog
2018-11-19  Pedro Alves  <palves@redhat.com>

* gdb.base/warning.exp: Don't override INTERNAL_FLAGS.  Use
gdb_spawn_with_cmdline_opts instead of gdb_start.  Check that we
see the expected warning.

6 years agoAutomatic date update in version.in
GDB Administrator [Mon, 19 Nov 2018 00:00:29 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoFix ia64-linux-nat.c
Tom Tromey [Wed, 14 Nov 2018 16:29:51 +0000 (09:29 -0700)]
Fix ia64-linux-nat.c

PR build/23814 points out that ia64-linux-nat.c will not compile any
more.  This patch fixes the problem.  Thanks to Andreas Schwab for
trying the patch.

gdb/ChangeLog
2018-11-18  Tom Tromey  <tom@tromey.com>

PR build/23814:
* target-delegates.c: Rebuild.
* ia64-linux-nat.c (class ia64_linux_nat_target)
<have_steppable_watchpoint>: Use override.  Return true, not 1.
(ia64_linux_nat_target::can_use_hw_breakpoint): Rename.  Remove
"self" argument.
(ia64_linux_nat_target::low_new_thread): Rename.
(class ia64_linux_nat_target) <read_description>: Don't declare.
* target.h (struct target_ops) <have_steppable_watchpoint>: Return
bool.

6 years agoAutomatic date update in version.in
GDB Administrator [Sun, 18 Nov 2018 00:01:35 +0000 (00:01 +0000)]
Automatic date update in version.in

6 years agoAutomatic date update in version.in
GDB Administrator [Sat, 17 Nov 2018 00:00:40 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoAarch64: Fix segfault when casting dummy calls
Alan Hayward [Thu, 11 Oct 2018 13:47:30 +0000 (14:47 +0100)]
Aarch64: Fix segfault when casting dummy calls

The following will segfault on aarch64 if foo is in another object,
was compiled as c++ and has no debug symbols:
(gdb) p (int)foo()

This is because aarch64_push_dummy_call determines the return type
of the function and then does not check for null pointer.

A null pointer for the return type means the call has no debug
information.  For the code to get here, then the call must have
been cast, otherwise we'd error out sooner.  In the case of a
no-debug-info call cast, the return type is the type the user
had cast the call to, but we do not have that information
available here.

However, aarch64_push_dummy_call only requires the return type in
order to calculate lang_struct_return. This information is available
in the return_method enum. The fix is to simply use this instead.

Adds testcase to check calls across objects, with all combinations
of c, c++, debug and no debug.

gdb/ChangeLog:

PR gdb/22736:
* aarch64-tdep.c (aarch64_push_dummy_call): Remove
lang_struct_return code.

gdb/testsuite/ChangeLog:

PR gdb/22736:
* gdb.cp/infcall-nodebug-lib.c: New test.
* gdb.cp/infcall-nodebug-main.c: New test.
* gdb.cp/infcall-nodebug.exp: New file.

6 years agoPass return_method to _push_dummy_call
Alan Hayward [Fri, 16 Nov 2018 11:21:04 +0000 (11:21 +0000)]
Pass return_method to _push_dummy_call

gdb/ChangeLog:

* aarch64-tdep.c (aarch64_push_dummy_call): Replace arg with
return_method.
* alpha-tdep.c (alpha_push_dummy_call): Likewise.
* amd64-tdep.c (amd64_push_arguments): Likewise.
(amd64_push_dummy_call): Likewise.
* amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise.
* arc-tdep.c (arc_push_dummy_call): Likewise.
* arm-tdep.c (arm_push_dummy_call): Likewise.
* avr-tdep.c (avr_push_dummy_call): Likewise.
* bfin-tdep.c (bfin_push_dummy_call): Likewise.
* cris-tdep.c (cris_push_dummy_call): Likewise.
* csky-tdep.c (csky_push_dummy_call): Likewise.
* frv-tdep.c (frv_push_dummy_call): Likewise.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh (gdbarch_push_dummy_call): Replace arg with
return_method.
* h8300-tdep.c (h8300_push_dummy_call): Likewise.
* hppa-tdep.c (hppa32_push_dummy_call): Likewise.
(hppa64_push_dummy_call): Likewise.
* i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise.
* i386-tdep.c (i386_push_dummy_call): Likewise.
* ia64-tdep.c (ia64_push_dummy_call): Likewise.
* infcall.c (call_function_by_hand_dummy): Likewise.
* iq2000-tdep.c (iq2000_push_dummy_call): Likewise.
* lm32-tdep.c (lm32_push_dummy_call): Likewise.
* m32c-tdep.c (m32c_push_dummy_call): Likewise.
* m32r-tdep.c (m32r_push_dummy_call): Likewise.
* m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise.
* m68k-tdep.c (m68k_push_dummy_call): Likewise.
* mep-tdep.c (mep_push_dummy_call): Likewise.
* mips-tdep.c (mips_eabi_push_dummy_call): Likewise.
(mips_n32n64_push_dummy_call): Likewise.
(mips_o32_push_dummy_call): Likewise.
(mips_o64_push_dummy_call): Likewise.
* mn10300-tdep.c (mn10300_push_dummy_call): Likewise.
* msp430-tdep.c (msp430_push_dummy_call): Likewise.
* nds32-tdep.c (nds32_push_dummy_call): Likewise.
* nios2-tdep.c (nios2_push_dummy_call): Likewise.
* or1k-tdep.c (or1k_push_dummy_call): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Likewise.
(ppc64_sysv_abi_push_dummy_call): Likewise.
* ppc-tdep.h (ppc_sysv_abi_push_dummy_call): Likewise.
(ppc64_sysv_abi_push_dummy_call): Likewise.
* riscv-tdep.c (riscv_push_dummy_call): Likewise.
* rl78-tdep.c (rl78_push_dummy_call): Likewise.
* rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.
* rx-tdep.c (rx_push_dummy_call): Likewise.
* s390-tdep.c (s390_push_dummy_call): Likewise.
* score-tdep.c (score_push_dummy_call): Likewise.
* sh-tdep.c (sh_push_dummy_call_fpu): Likewise.
(sh_push_dummy_call_nofpu): Likewise.
* sparc-tdep.c (sparc32_store_arguments): Likewise.
(sparc32_push_dummy_call): Likewise.
* sparc64-tdep.c (sparc64_store_arguments): Likewise.
(sparc64_push_dummy_call): Likewise.
* spu-tdep.c (spu_push_dummy_call): Likewise.
* tic6x-tdep.c (tic6x_push_dummy_call): Likewise.
* tilegx-tdep.c (tilegx_push_dummy_call): Likewise.
* v850-tdep.c (v850_push_dummy_call): Likewise.
* vax-tdep.c (vax_push_dummy_call): Likewise.
* xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise.
* xtensa-tdep.c (xtensa_push_dummy_call): Likewise.

6 years agoUse enum for return method for dummy calls
Alan Hayward [Fri, 16 Nov 2018 11:21:00 +0000 (11:21 +0000)]
Use enum for return method for dummy calls

In call_function_by_hand_dummy, struct_return and hidden_first_param_p
are used to represent a single concept. Replace with an enum.

gdb/ChangeLog:

* gdbarch.sh (enum function_call_return_method): Add enum.
* gdbarch.h: Regenerate.
* infcall.c (call_function_by_hand_dummy): Replace vars with enum.

6 years ago(Another) Updated Spanish translation for the ld subdirectory.
Nick Clifton [Fri, 16 Nov 2018 11:35:24 +0000 (11:35 +0000)]
(Another) Updated Spanish translation for the ld subdirectory.

* po/es.po: Updated Spanish translation.

6 years agoAutomatic date update in version.in
GDB Administrator [Fri, 16 Nov 2018 00:01:06 +0000 (00:01 +0000)]
Automatic date update in version.in

6 years agoMove copy_bitwise unittests to own unittest file
Joel Brobecker [Thu, 15 Nov 2018 15:53:57 +0000 (10:53 -0500)]
Move copy_bitwise unittests to own unittest file

Now that copy_bitwise has been made public, and considering that
its implementation could move to a different file again in the future,
this patch moves its unittest to its own file in gdb/unittests.

gdb/ChangeLog:

        * unittests/copy_bitwise-selftests.c: New file.
        * utils.c (selftests::bits_to_str, selftests::check_copy_bitwise)
        (selftests::copy_bitwise_tests): Delete, moving this code to
        unittests/copy_bitwise-selftests.c instead.
        (_initialize_utils): Do not register copy_bitwise tests.
        * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
        unittests/copy_bitwise-selftests.c.

Tested on x86_64-linux using the official testsuite, but also by
verifying that "maintenance selftests" still runs the copy_bitwise
tests.

6 years agoUpdated Spanish translation for the ld subdirectory.
Nick Clifton [Thu, 15 Nov 2018 11:55:24 +0000 (11:55 +0000)]
Updated Spanish translation for the ld subdirectory.

ld * po/es.po: Updated Spanish translation.

6 years agoAutomatic date update in version.in
GDB Administrator [Thu, 15 Nov 2018 00:00:41 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agodelete ada-lang.c::move_bits, sharing and re-using copy_bitwise instead
Joel Brobecker [Wed, 14 Nov 2018 23:18:49 +0000 (18:18 -0500)]
delete ada-lang.c::move_bits, sharing and re-using copy_bitwise instead

This patch deletes ada-lang.c's move_bits function entirely, and
replaces all calls to it by calls to copy_bitwise instead. Because
the latter function was declared locally inside dwarf2loc.c, this
patch also move the function to a common area, and makes it non-static.

gdb/ChangeLog:

        * ada-lang.c (move_bits): Delete. Update all callers to use
        copy_bitwise instead.
        * dwarf2loc.c (copy_bitwise, bits_to_str::bits_to_str)
        (selftests::check_copy_bitwise, selftests::copy_bitwise_tests):
        Move from here to utils.c.
        (_initialize_dwarf2loc): Remove call to register copy_bitwise
        selftests.
        * utils.h (copy_bitwise): Add declaration.
        * utils.c (copy_bitwise, bits_to_str::bits_to_str)
        (selftests::check_copy_bitwise, selftests::copy_bitwise_tests):
        Moved here from dwarf2loc.c.
        (_initialize_utils): Register copy_bitwise selftests.

Tested on x86_64-linux, no regression. Also tested using AdaCore's
testsuite on a collection of small endian and big endian platforms.

6 years agoRISC-V: Fix unnamed arg alignment in registers.
Jim Wilson [Wed, 14 Nov 2018 22:54:10 +0000 (14:54 -0800)]
RISC-V: Fix unnamed arg alignment in registers.

For riscv64-linux target, second half of fix for
FAIL: gdb.base/gnu_vector.exp: call add_various_floatvecs

Unnamed arguments with 2*XLEN alignment are passed in aligned register pairs.

gdb/
* riscv-tdep.c (struct riscv_arg_info): New field is_unnamed.
(riscv_call_arg_scalar_int): If unnamed arg with twice xlen alignment,
then increment next_regnum if odd.
(riscv_arg_location): New arg is_unnamed.  Set ainfo->is_unnamed.
(riscv_push_dummy_call): New local ftype.  Call check_typedef to set
function type.  Pass new arg to riscv_arg_location based on function
type.
(riscv_return_value): Pass new arg to riscv_arg_location.

6 years agoRISC-V: Handle vector type alignment.
Jim Wilson [Wed, 14 Nov 2018 22:52:34 +0000 (14:52 -0800)]
RISC-V: Handle vector type alignment.

For riscv64-linux target, first half of fix for
FAIL: gdb.base/gnu_vector.exp: call add_various_floatvecs

GCC gives vectors natural aligment based on total size, not element size,
bounded by the maximum supported type alignment.

gdb/
* riscv-tdep.c (BIGGEST_ALIGNMENT): New.
(riscv_type_alignment) <TYPE_CODE_ARRAY>: If TYPE_VECTOR, return min
of TYPE_LENGTH and BIGGEST_ALIGNMENT.

6 years agoRISC-V: Give stack slots same align as XLEN.
Jim Wilson [Wed, 14 Nov 2018 22:51:40 +0000 (14:51 -0800)]
RISC-V: Give stack slots same align as XLEN.

For riscv64-linux target, fixes
FAIL: gdb.base/gnu_vector.exp: call add_many_charvecs

Ensure that stack slots are always the same alignment as XLEN by rounding
up arg align to xlen.

gdb/
* riscv-tdep.c (riscv_call_arg_scalar_int): Use std::min when
setting len.  New local align, set to max of arg align and xlen,
and pass to first riscv_assign_stack_location call.

6 years agoAutomatic date update in version.in
GDB Administrator [Wed, 14 Nov 2018 00:01:05 +0000 (00:01 +0000)]
Automatic date update in version.in

6 years agoRISC-V: Improve linker error for FP mismatch.
Jim Wilson [Tue, 13 Nov 2018 23:50:38 +0000 (15:50 -0800)]
RISC-V: Improve linker error for FP mismatch.

bfd/
* elfnn-riscv.c (riscv_float_abi_string): New.
(_bfd_riscv_elf_merge_private_bfd_data): Use it for error message.

6 years agoopcodes/nfp: Fix disassembly of crc[] with swapped operands.
Francois H. Theron [Tue, 13 Nov 2018 10:33:16 +0000 (12:33 +0200)]
opcodes/nfp: Fix disassembly of crc[] with swapped operands.

The decoding of the CRC operation in alu instructions was using bits
from the instruction word directly, instead of srcA which would be
different if the swap bit was set.

Signed-off-by: Francois H. Theron <francois.theron@netronome.com>
6 years ago[ARM] Improve indentation of ARM architecture declarations
Thomas Preud'homme [Tue, 13 Nov 2018 12:19:28 +0000 (12:19 +0000)]
[ARM] Improve indentation of ARM architecture declarations

This commit cleans up indentation of ARM architecture declaration,
namely entries of arm_archs and definition of macros ARM_EXT_*,
ARM_AEXT_*, ARM_AEXT2_*, FPU_EXT_*, FPU_ARCH_* and ARM_ARCH_*. It also
gets rid of unused ARM_ARCH_V6M-ONLY and merge AEM_AEXT_V6M_ONLY in
ARM_AEXT_V6M now sole user.

gas/
2018-11-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>

* config/tc-arm.c (arm_archs): Reindent.

include/
2018-11-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>

* opcode/arm.h (ARM_AEXT_V6M_ONLY): Merge into its use in ARM_AEXT_V6M.
(ARM_ARCH_V6M_ONLY): Remove.
(ARM_EXT_V1, ARM_EXT_V2, ARM_EXT_V2S, ARM_EXT_V3, ARM_EXT_V3M,
ARM_EXT_V4, ARM_EXT_V4T, ARM_EXT_V5, ARM_EXT_V5T, ARM_EXT_V5ExP,
ARM_EXT_V5E, ARM_EXT_V5J, ARM_EXT_V6, ARM_EXT_V6K, ARM_EXT_V8,
ARM_EXT_V6T2, ARM_EXT_DIV, ARM_EXT_V5E_NOTM, ARM_EXT_V6_NOTM,
ARM_EXT_V7, ARM_EXT_V7A, ARM_EXT_V7R, ARM_EXT_V7M, ARM_EXT_V6M,
ARM_EXT_BARRIER, ARM_EXT_THUMB_MSR, ARM_EXT_V6_DSP, ARM_EXT_MP,
ARM_EXT_SEC, ARM_EXT_OS, ARM_EXT_ADIV, ARM_EXT_VIRT, ARM_EXT2_PAN,
ARM_EXT2_V8_2A, ARM_EXT2_V8M, ARM_EXT2_ATOMICS, ARM_EXT2_V6T2_V8M,
ARM_EXT2_FP16_INST, ARM_EXT2_V8M_MAIN, ARM_EXT2_RAS, ARM_EXT2_V8_3A,
ARM_EXT2_V8A, ARM_EXT2_V8_4A, ARM_EXT2_FP16_FML, ARM_EXT2_V8_5A,
ARM_EXT2_SB, ARM_EXT2_PREDRES, ARM_CEXT_XSCALE, ARM_CEXT_MAVERICK,
ARM_CEXT_IWMMXT, ARM_CEXT_IWMMXT2, FPU_ENDIAN_PURE, FPU_ENDIAN_BIG,
FPU_FPA_EXT_V1, FPU_FPA_EXT_V2, FPU_MAVERICK, FPU_VFP_EXT_V1xD,
FPU_VFP_EXT_V1, FPU_VFP_EXT_V2, FPU_VFP_EXT_V3xD, FPU_VFP_EXT_V3,
FPU_NEON_EXT_V1, FPU_VFP_EXT_D32, FPU_VFP_EXT_FP16, FPU_NEON_EXT_FMA,
FPU_VFP_EXT_FMA, FPU_VFP_EXT_ARMV8, FPU_NEON_EXT_ARMV8,
FPU_CRYPTO_EXT_ARMV8, CRC_EXT_ARMV8, FPU_VFP_EXT_ARMV8xD,
FPU_NEON_EXT_RDMA, FPU_NEON_EXT_DOTPROD, ARM_AEXT_V1, ARM_AEXT_V2,
ARM_AEXT_V2S, ARM_AEXT_V3, ARM_AEXT_V3M, ARM_AEXT_V4xM, ARM_AEXT_V4,
ARM_AEXT_V4TxM, ARM_AEXT_V4T, ARM_AEXT_V5xM, ARM_AEXT_V5,
ARM_AEXT_V5TxM, ARM_AEXT_V5T, ARM_AEXT_V5TExP, ARM_AEXT_V5TE,
ARM_AEXT_V5TEJ, ARM_AEXT_V6, ARM_AEXT_V6K, ARM_AEXT_V6Z, ARM_AEXT_V6KZ,
ARM_AEXT_V6T2, ARM_AEXT_V6KT2, ARM_AEXT_V6ZT2, ARM_AEXT_V6KZT2,
ARM_AEXT_V7_ARM, ARM_AEXT_V7A, ARM_AEXT_V7VE, ARM_AEXT_V7R,
ARM_AEXT_NOTM, ARM_AEXT_V6M_ONLY, ARM_AEXT_V6M, ARM_AEXT_V6SM,
ARM_AEXT_V7M, ARM_AEXT_V7, ARM_AEXT_V7EM, ARM_AEXT_V8A, ARM_AEXT2_V8A,
ARM_AEXT2_V8_1A, ARM_AEXT2_V8_2A, ARM_AEXT2_V8_3A, ARM_AEXT2_V8_4A,
ARM_AEXT2_V8_5A, ARM_AEXT_V8M_BASE, ARM_AEXT_V8M_MAIN,
ARM_AEXT_V8M_MAIN_DSP, ARM_AEXT2_V8M, ARM_AEXT2_V8M_BASE,
ARM_AEXT2_V8M_MAIN, ARM_AEXT2_V8M_MAIN_DSP, ARM_AEXT_V8R,
ARM_AEXT2_V8R, FPU_VFP_V1xD, FPU_VFP_V1, FPU_VFP_V2, FPU_VFP_V3D16,
FPU_VFP_V3, FPU_VFP_V3xD, FPU_VFP_V4D16, FPU_VFP_V4, FPU_VFP_V4_SP_D16,
FPU_VFP_V5D16, FPU_VFP_ARMV8, FPU_NEON_ARMV8, FPU_CRYPTO_ARMV8,
FPU_VFP_HARD, FPU_FPA, FPU_ARCH_VFP, FPU_ARCH_FPE, FPU_ARCH_FPA,
FPU_ARCH_VFP_V1xD, FPU_ARCH_VFP_V1, FPU_ARCH_VFP_V2,
FPU_ARCH_VFP_V3D16_FP16, FPU_ARCH_VFP_V3, FPU_ARCH_VFP_V3_FP16,
FPU_ARCH_VFP_V3xD_FP16, FPU_ARCH_NEON_V1, FPU_ARCH_VFP_V3_PLUS_NEON_V1,
FPU_ARCH_NEON_FP16, FPU_ARCH_VFP_HARD, FPU_ARCH_VFP_V4,
FPU_ARCH_VFP_V4D16, FPU_ARCH_VFP_V4_SP_D16, FPU_ARCH_VFP_V5D16,
FPU_ARCH_VFP_V5_SP_D16, FPU_ARCH_NEON_VFP_V4, FPU_ARCH_VFP_ARMV8,
FPU_ARCH_NEON_VFP_ARMV8, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8,
FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_DOTPROD, ARCH_CRC_ARMV8,
FPU_ARCH_NEON_VFP_ARMV8_1, FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1,
FPU_ARCH_DOTPROD_NEON_VFP_ARMV8, ARM_ARCH_V1, ARM_ARCH_V2,
ARM_ARCH_V2S, ARM_ARCH_V3, ARM_ARCH_V3M, ARM_ARCH_V4xM, ARM_ARCH_V4,
ARM_ARCH_V4TxM, ARM_ARCH_V4T, ARM_ARCH_V5xM, ARM_ARCH_V5,
ARM_ARCH_V5TxM, ARM_ARCH_V5T, ARM_ARCH_V5TExP, ARM_ARCH_V5TE,
ARM_ARCH_V5TEJ, ARM_ARCH_V6, ARM_ARCH_V6K, ARM_ARCH_V6Z, ARM_ARCH_V6KZ,
ARM_ARCH_V6T2, ARM_ARCH_V6KT2, ARM_ARCH_V6ZT2, ARM_ARCH_V6KZT2,
ARM_ARCH_V6M, ARM_ARCH_V6SM, ARM_ARCH_V7, ARM_ARCH_V7A, ARM_ARCH_V7VE,
ARM_ARCH_V7R, ARM_ARCH_V7M, ARM_ARCH_V7EM, ARM_ARCH_V8A,
ARM_ARCH_V8A_CRC, ARM_ARCH_V8_1A, ARM_ARCH_V8_2A, ARM_ARCH_V8_3A,
ARM_ARCH_V8_4A, ARM_ARCH_V8_5A, ARM_ARCH_V8M_BASE, ARM_ARCH_V8M_MAIN,
ARM_ARCH_V8M_MAIN_DSP, ARM_ARCH_V8R): Reindent.

6 years agoAutomatic date update in version.in
GDB Administrator [Tue, 13 Nov 2018 00:00:40 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoi386: Accept both .plt.got and .plt.sec sections
H.J. Lu [Mon, 12 Nov 2018 17:29:49 +0000 (09:29 -0800)]
i386: Accept both .plt.got and .plt.sec sections

Glibc commit:

commit a15529fda8d132621328c3fe32997a3d9c55aef4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon May 14 09:23:55 2018 -0700

    i386: Replace PREINIT_FUNCTION@PLT with *%eax in call

    Since we have loaded address of PREINIT_FUNCTION into %eax, we can
    avoid extra branch to PLT slot.

changed __gmon_start__ relocations in crt1.o from

00000015  0000092b R_386_GOT32X           00000000   __gmon_start__
0000001e  00000904 R_386_PLT32            00000000   __gmon_start__

to

00000015  00000a2b R_386_GOT32X           00000000   __gmon_start__

As the result, .plt.sec section may be generated instead of .plt.got
section, depending on __gmon_start__ relocations.

* testsuite/ld-i386/plt-main-ibt.dd: Accept both .plt.got and
.plt.sec sections.

6 years agoAdd completer for skip numbers
Simon Marchi [Mon, 12 Nov 2018 15:38:44 +0000 (10:38 -0500)]
Add completer for skip numbers

Add completer to various commands that accept skip numbers:

  - skip enable
  - skip disable
  - skip delete
  - info skip

These commands also accept ranges, the completer works for that but is
not very smart.  It will suggest invalid ranges, for example when doing
"2-<TAB>" it will suggest "1", which would not result in a valid range.
Also, it will keep suggesting when doing "1-2-<TAB>", even though it's
an invalid syntax.

A future idea would be to make a re-usable and well-tested completer for
numbers and ranges.  I think it could at least be re-used for breakpoint
and thread numbers (for example with the "enable breakpoints" command).

gdb/ChangeLog:

* skip.c (complete_skip_number): New function.
(_initialize_step_skip): Add completers to some skip commands.

gdb/testsuite/ChangeLog:

* gdb.base/skip.exp: Add standard_testfile.  Add "skip delete"
completer tests.

6 years agoUpdate documentation describing how the linker chooses a start address.
Nick Clifton [Mon, 12 Nov 2018 15:12:15 +0000 (15:12 +0000)]
Update documentation describing how the linker chooses a start address.

PR 10865
* ld.texi (Entry Point): Make it clear that the text refers to
PE-based systems rather than just a PE system.

6 years ago[BINUTILS, AARCH64, 8/8] Add data cache instructions for Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 13:29:38 +0000 (13:29 +0000)]
[BINUTILS, AARCH64, 8/8] Add data cache instructions for Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch adds all the data cache instructions that are part of this
extension:
- DC IGVAC, Xt
- DC IGSW, Xt
- DC CGSW, Xt
- DC CIGSW, Xt
- DC CGVAC, Xt
- DC CGVAP, Xt
- DC CGVADP, Xt
- DC CIGVAC, Xt
- DC GVA, Xt
- DC IGDVAC, Xt
- DC IGDSW, Xt
- DC CGDSW, Xt
- DC CIGDSW, Xt
- DC CGDVAC, Xt
- DC CGDVAP, Xt
- DC CGDVADP, Xt
- DC CIGDVAC, Xt
- DC GZVA, Xt

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-opc.c (aarch64_sys_regs_dc): New entries for
IGVAC, IGSW, CGSW, CIGSW, CGVAC, CGVAP, CGVADP, CIGVAC, GVA,
IGDVAC, IGDSW, CGDSW, CIGDSW, CGDVAC, CGDVAP, CGDVADP,
CIGDVAC and GZVA.
(aarch64_sys_ins_reg_supported_p): New check for above.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* testsuite/gas/aarch64/sysreg-4.s: Test IGVAC, IGSW,
CGSW, CIGSW, CGVAC, CGVAP, CGVADP, CIGVAC, GVA,
IGDVAC, IGDSW, CGDSW, CIGDSW, CGDVAC, CGDVAP, CGDVADP,
CIGDVAC and GZVA with DC.
* testsuite/gas/aarch64/sysreg-4.d: Likewise.
* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.

6 years ago[BINUTILS, AARCH64, 7/8] Add system registers for Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 13:26:01 +0000 (13:26 +0000)]
[BINUTILS, AARCH64, 7/8] Add system registers for Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch adds all the system registers that are part of this
extension and are accessible via the MRS/MSR instructions:
- TCO
- TFSRE0_SL1
- TFSR_EL1
- TFSR_EL2
- TFSR_EL3
- TFSR_EL12
- RGSR_EL1
- GCR_EL1
TCO is also accessible with the MSR(immediate) instruction.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-opc.c (aarch64_sys_regs): New entries for TCO,
TFSRE0_SL1, TFSR_EL1, TFSR_EL2, TFSR_EL3, TFSR_EL12,
RGSR_EL1 and GCR_EL1.
(aarch64_sys_reg_supported_p): New check for above.
(aarch64_pstatefields): New entry for TCO.
(aarch64_pstatefield_supported_p): New check for above.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* testsuite/gas/aarch64/sysreg-4.s: Test TCO, TFSRE0_SL1,
TFSR_EL1, TFSR_EL2, TFSR_EL3, TFSR_EL12, RGSR_EL1 and
GCR_EL1 MSR and MRS.
* testsuite/gas/aarch64/sysreg-4.d: Likewise.
* testsuite/gas/aarch64/illegal-sysreg-4.l: Likewise.

6 years ago[BINUTILS, AARCH64, 6/8] Add Tag getting instruction in Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 13:19:12 +0000 (13:19 +0000)]
[BINUTILS, AARCH64, 6/8] Add Tag getting instruction in Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Bulk Allocation Tag instructions from
MTE. These are the following instructions added in this patch:
- LDGV <Xt>, [<Xn|SP>]!
- STGV <Xt>, [<Xn|SP>]!

This needed a new kind of operand for the new addressing [<Xn|SP>]!
since this has no offset and only takes a pre-indexed version.
Hence AARCH64_OPND_ADDR_SIMPLE_2 and ldtdgv_indexed are introduced.
(AARCH64_OPND_ADDR_SIMPLE fulfilled the no offset criteria but does
not allow writeback). We also needed new encoding and decoding
functions to be able to do the same.

where
<Xt> : Is the 64-bit destination GPR.
<Xn|SP> : Is the 64-bit first source GPR or Stack pointer.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* opcode/aarch64.h (aarch64_opnd): Add AARCH64_OPND_ADDR_SIMPLE_2.
(aarch64_insn_class): Add ldstgv_indexed.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-asm.c (aarch64_ins_addr_simple_2): New.
* aarch64-asm.h (ins_addr_simple_2): Declare the above.
* aarch64-dis.c (aarch64_ext_addr_simple_2): New.
* aarch64-dis.h (ext_addr_simple_2): Declare the above.
* aarch64-opc.c (operand_general_constraint_met_p): Add case for
AARCH64_OPND_ADDR_SIMPLE_2 and ldstgv_indexed.
(aarch64_print_operand): Add case for AARCH64_OPND_ADDR_SIMPLE_2.
* aarch64-tbl.h (aarch64_opcode_table): Add stgv and ldgv.
(AARCH64_OPERANDS): Define ADDR_SIMPLE_2.
* aarch64-asm-2.c: Regenerated.
* aarch64-dis-2.c: Regenerated.
* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* config/tc-aarch64.c (parse_operands): Add switch case for
AARCH64_OPND_ADDR_SIMPLE_2 and allow [base]! for it.
(warn_unpredictable_ldst): Exempt ldstgv_indexed for ldgv.
* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for ldgv and stgv.
* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
* testsuite/gas/aarch64/illegal-memtag.l: Likewise.

6 years ago[BINUTILS, AARCH64, 5/8] Add Tag getting instruction in Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 13:14:00 +0000 (13:14 +0000)]
[BINUTILS, AARCH64, 5/8] Add Tag getting instruction in Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Tag Getting instruction from Memory Tagging
Extension.
- LDG <Xt>, [<Xn|SP>, #<simm>]

where
<Xt> : Is the 64-bit destination GPR.
<Xn|SP> : Is the 64-bit first source GPR or Stack pointer.
<simm> : Is the optional signed immediate offset, a multiple of 16
in the range of -4096 and 4080, defaulting to 0.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-tbl.h (QL_LDG): New.
(aarch64_opcode_table): Add ldg.
* aarch64-asm-2.c: Regenerated.
* aarch64-dis-2.c: Regenerated.
* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for ldg.
* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
* testsuite/gas/aarch64/illegal-memtag.l: Likewise.

6 years ago[BINUTILS, AARCH64, 4/8] Add Tag setting instructions in Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 13:09:55 +0000 (13:09 +0000)]
[BINUTILS, AARCH64, 4/8] Add Tag setting instructions in Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Tag setting instructions from
MTE which consists of the following instructions:
- STG [<Xn|SP>, #<simm>]
- STG [<Xn|SP>, #<simm>]!
- STG [<Xn|SP>], #<simm>
- STZG [<Xn|SP>, #<simm>]
- STZG [<Xn|SP>, #<simm>]!
- STZG [<Xn|SP>], #<simm>
- ST2G [<Xn|SP>, #<simm>]
- ST2G [<Xn|SP>, #<simm>]!
- ST2G [<Xn|SP>], #<simm>
- STZ2G [<Xn|SP>, #<simm>]
- STZ2G [<Xn|SP>, #<simm>]!
- STZ2G [<Xn|SP>], #<simm>
- STGP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]
- STGP <Xt>, <Xt2>, [<Xn|SP>, #<imm>]!
- STGP <Xt>, <Xt2>, [<Xn|SP>], #<imm>

where
<Xn|SP> : Is the 64-bit GPR or Stack pointer.
<simm> : Is the optional signed immediate offset, a multiple of 16
in the range -4096 to 4080, defaulting to 0.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* opcode/aarch64.h (aarch64_opnd): Add AARCH64_OPND_ADDR_SIMM11
and AARCH64_OPND_ADDR_SIMM13.
(aarch64_opnd_qualifier): Add new AARCH64_OPND_QLF_imm_tag.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-opc.c (aarch64_opnd_qualifiers): Add new data
for AARCH64_OPND_QLF_imm_tag.
(operand_general_constraint_met_p): Add case for
AARCH64_OPND_ADDR_SIMM11 and AARCH64_OPND_ADDR_SIMM13.
(aarch64_print_operand): Likewise.
* aarch64-tbl.h (QL_LDST_AT, QL_STGP): New.
(aarch64_opcode_table): Add stg, stzg, st2g, stz2g and stgp
for both offset and pre/post indexed versions.
(AARCH64_OPERANDS): Define ADDR_SIMM11 and ADDR_SIMM13.
* aarch64-asm-2.c: Regenerated.
* aarch64-dis-2.c: Regenerated.
* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* config/tc-aarch64.c (parse_operands): Add switch case for
AARCH64_OPND_ADDR_SIMM11 and AARCH64_OPND_ADDR_SIMM13.
(fix_insn): Likewise.
(warn_unpredictable_ldst): Exempt STGP.
* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for stg, st2g,
stzg, stz2g and stgp.
* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
* testsuite/gas/aarch64/illegal-memtag.l: Likewise.

6 years ago[BINUTILS, AARCH64, 3/8] Add Pointer Arithmetic instructions in Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 12:58:26 +0000 (12:58 +0000)]
[BINUTILS, AARCH64, 3/8] Add Pointer Arithmetic instructions in Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Pointer Arithmetic instructions from
MTE. These are the following instructions added in this patch:
- SUBP <Xd>, <Xn|SP>, <Xm|SP>
- SUBPS <Xd>, <Xn|SP>, <Xm|SP>
- CMPP <Xn|SP>, <Xm|SP>
where CMPP is an alias to SUBPS XZR, <Xn|SP>, <Xm|SP>

where
<Xd> : Is the 64-bit destination GPR.
<Xn|SP> : Is the 64-bit first source GPR or Stack pointer.
<Xm|SP> : Is the 64-bit second source GPR or Stack pointer.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-tbl.h (aarch64_opcode_table): Add subp, subps and cmpp.
* aarch64-asm-2.c: Regenerated.
* aarch64-dis-2.c: Regenerated.
* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* testsuite/gas/aarch64/armv8_5-a-memtag.s: Add tests for subp,
subps and cmpp.
* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
* testsuite/gas/aarch64/illegal-memtag.l: Likewise.

6 years ago[BINUTILS, AARCH64, 2/8] Add Tag generation instructions in Memory Tagging Extension
Sudakshina Das [Mon, 12 Nov 2018 12:52:55 +0000 (12:52 +0000)]
[BINUTILS, AARCH64, 2/8] Add Tag generation instructions in Memory Tagging Extension

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions which is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.

This patch add support to the Tag generation instructions from
MTE. These are the following instructions added in this patch:
- IRG <Xd|SP>, <Xn|SP>{, Xm}
- ADDG <Xd|SP>, <Xn|SP>, #<uimm1>. #<uimm2>
- SUBG <Xd|SP>, <Xn|SP>, #<uimm1>. #<uimm2>
- GMI <Xd>, <Xn|SP>, <Xm>

where
<Xd|SP> : Is the 64-bit destination GPR or Stack pointer.
<Xn|SP> : Is the 64-bit source GPR or Stack pointer.
<uimm6> : Is the unsigned immediate, a multiple of 16
in the range 0 to 1008.
<uimm4> : Is the unsigned immediate, in the range 0 to 15.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* opcode/aarch64.h (aarch64_opnd): Add
AARCH64_OPND_UIMM4_ADDG and AARCH64_OPND_UIMM10 as new enums.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-opc.h (aarch64_field_kind): New FLD_imm4_3.
(OPD_F_SHIFT_BY_4, operand_need_shift_by_four): New.
* aarch64-opc.c (fields): Add entry for imm4_3.
(operand_general_constraint_met_p): Add cases for
AARCH64_OPND_UIMM4_ADDG and AARCH64_OPND_UIMM10.
(aarch64_print_operand): Likewise.
* aarch64-tbl.h (QL_ADDG): New.
(aarch64_opcode_table): Add addg, subg, irg and gmi.
(AARCH64_OPERANDS): Define UIMM4_ADDG and UIMM10.
* aarch64-asm.c (aarch64_ins_imm): Add case for
operand_need_shift_by_four.
* aarch64-asm-2.c: Regenerated.
* aarch64-dis-2.c: Regenerated.
* aarch64-opc-2.c: Regenerated.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* config/tc-aarch64.c (parse_operands): Add switch case for
AARCH64_OPND_UIMM4_ADDG and AARCH64_OPND_UIMM10.
* testsuite/gas/aarch64/armv8_5-a-memtag.s: New.
* testsuite/gas/aarch64/armv8_5-a-memtag.d: Likewise.
* testsuite/gas/aarch64/illegal-memtag.s: Likewise.
* testsuite/gas/aarch64/illegal-memtag.l: Likewise.
* testsuite/gas/aarch64/illegal-memtag.d: Likewise.

6 years ago[BINUTILS, AARCH64, 1/8] Add support for Memory Tagging Extension for ARMv8.5-A
Sudakshina Das [Mon, 12 Nov 2018 12:45:30 +0000 (12:45 +0000)]
[BINUTILS, AARCH64, 1/8] Add support for Memory Tagging Extension for ARMv8.5-A

This patch is part of the patch series to add support for ARMv8.5-A
Memory Tagging Extensions. Memory Tagging Extension is an optional extension to
ARMv8.5-A and is enabled using the +memtag command line option.
This patch adds the new command line option and the new feature macros.

*** include/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* opcode/aarch64.h (AARCH64_FEATURE_MEMTAG): New.

*** opcodes/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* aarch64-tbl.h (aarch64_feature_memtag): New.
(MEMTAG, MEMTAG_INSN): New.

*** gas/ChangeLog ***

2018-11-12  Sudakshina Das  <sudi.das@arm.com>

* config/tc-aarch64.c (aarch64_features): Add "memtag"
as a new option.
* doc/c-aarch64.texi: Document the same.

6 years agoUpdated Spanish translation for the ld subdirectory.
Nick Clifton [Mon, 12 Nov 2018 11:24:18 +0000 (11:24 +0000)]
Updated Spanish translation for the ld subdirectory.

ld * po/es.po: Updated Spanish translation.

6 years agoAutomatic date update in version.in
GDB Administrator [Mon, 12 Nov 2018 00:00:26 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoAutomatic date update in version.in
GDB Administrator [Sun, 11 Nov 2018 00:01:25 +0000 (00:01 +0000)]
Automatic date update in version.in

6 years agoAutomatic date update in version.in
GDB Administrator [Sat, 10 Nov 2018 00:00:36 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoRemove a VEC from remote.c
Tom Tromey [Tue, 24 Jul 2018 01:47:39 +0000 (19:47 -0600)]
Remove a VEC from remote.c

This removes the VEC from remote_g_packet_data, replacing it with a
std::vector.  This is a bit odd in that this object is never
destroyed, and is obstack-allocated.  I believe a gdbarch is never
destroyed, so this seemed ok.

Tested by the buildbot.

gdb/ChangeLog
2018-11-09  Tom Tromey  <tom@tromey.com>

* remote.c (remote_g_packet_guess_s): Remove typedef and DEF_VEC.
(struct remote_g_packet_data): Derive from allocate_on_obstack.
<guesses>: Now a std::vector.
(remote_g_packet_data_init, register_remote_g_packet_guess):
Update.
(remote_read_description_p): Update.  Return bool.
(remote_target::read_description): Update.
(struct remote_g_packet_guess): Add constructor.

6 years agoReturn scoped_fd from open_source_file and find_and_open_source
Tom Tromey [Sat, 27 Oct 2018 18:23:44 +0000 (12:23 -0600)]
Return scoped_fd from open_source_file and find_and_open_source

This changes open_source_file and find_and_open_source to return
scoped_fd, then updates the callers as appropriate, including using
scoped_fd::to_file.

Tested by the buildbot.

gdb/ChangeLog
2018-11-09  Tom Tromey  <tom@tromey.com>

* common/scoped_fd.h (class scoped_fd): Add move constructor and
move assignment operator.
* psymtab.c (psymtab_to_fullname): Update.
* source.h (open_source_file): Return scoped_fd.
(find_and_open_source): Likewise.
* source.c (open_source_file): Return scoped_fd.
(get_filename_and_charpos): Update.
(print_source_lines_base): Update.  Use scoped_fd::to_file.
(forward_search_command): Likewise.
(reverse_search_command): Likewise.
(find_and_open_source): Return scoped_fd.
* tui/tui-source.c (tui_set_source_content): Update.  Use
gdb_file_up.

6 years agoFix unsigned overflow in minsyms reader.
John Baldwin [Fri, 9 Nov 2018 19:44:20 +0000 (11:44 -0800)]
Fix unsigned overflow in minsyms reader.

Use a ssize_t helper variable for the number of bytes to shrink the
msymbols obstack rather than relying on unsigned overflow to shrink
the size of the obstack.

gdb/ChangeLog:

* minsyms.c (minimal_symbol_reader::install): Fix unsigned
overflow.

6 years ago[PowerPC] Document requirements for VSX feature
Pedro Franco de Carvalho [Fri, 9 Nov 2018 18:09:03 +0000 (16:09 -0200)]
[PowerPC] Document requirements for VSX feature

As suggested in
https://sourceware.org/ml/gdb-patches/2018-10/msg00510.html, this
patch changes the documentation for the VSX tdesc feature to make it
clear that the altivec and FPU features are requirements.

gdb/doc/ChangeLog:
2018-11-09  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

* gdb.texinfo (PowerPC Features): Document the altivec and fpu
requirements for the org.gnu.gdb.power.vsx feature.

6 years agoFix a typo in iconv.m4.
Hafiz Abid Qadeer [Fri, 9 Nov 2018 16:03:11 +0000 (16:03 +0000)]
Fix a typo in iconv.m4.

config/
2018-11-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

* iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS.
Append $INCICONV to it.

gdb/
2018-11-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

* configure: Regenerate.

binutils/
2018-11-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

* configure: Regenerate.

intl/
2018-11-09  Hafiz Abid Qadeer  <abidh@codesourcery.com>

* configure: Regenerate.

6 years agoCorrect comment concerning PE timestamp insertion.
Bernhard M. Wiedemann [Fri, 9 Nov 2018 16:06:48 +0000 (16:06 +0000)]
Correct comment concerning PE timestamp insertion.

* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Correct comment
concerning timestamp insertion.

6 years agoFixed warning from previous patch. Added Changelog.
Cupertino Miranda [Fri, 9 Nov 2018 15:49:29 +0000 (15:49 +0000)]
Fixed warning from previous patch. Added Changelog.

6 years ago[ARC] More fixes for TLS.
Cupertino Miranda [Thu, 4 Oct 2018 09:17:03 +0000 (10:17 +0100)]
[ARC] More fixes for TLS.

Added warning for static TLS reloc.

Fixed issue related to TLS and partial static linking of libraries:
  This issue was detected when throwing exceptions in C++ while linking with
  -static-libstdc++.
  TLS relocation from the libstdc++ wasn't being patched as local now that it was
  static linked with the executable.

Fix for TLS with static and pie. Problem introduced by earlier patch:
  Fixes the following glibc tests:
   - elf/tst-tls1-static

bfd/
    xxxx-xx-xx  Cupertino Miranda  <cmiranda@synopsys.com>

    * arc-got.h (arc_got_entry_type_for_reloc): Changed to
      correct static TLS relocs.
            * elf32-arc.c (elf_arc_check_relocs): Introduced warning to
      TLS relocs which require -fPIC.
      (arc_create_forced_local_got_entries_for_tls): Created.
      Traverses list of GOT entries to be resolved statically
      when needed.
      (elf_arc_finish_dynamic_sections): Changed. Calls
      arc_create_forced_local_got_entries_for_tls for each known
      possibly GOT symbol.

6 years agoUpdated French translation for the ld subdirectory.
Nick Clifton [Fri, 9 Nov 2018 14:18:02 +0000 (14:18 +0000)]
Updated French translation for the ld subdirectory.

* po/fr.po: Updated French translation.

6 years agoStop corruption of ihex output shen addresses are sign extended.
rhn [Fri, 9 Nov 2018 14:09:44 +0000 (14:09 +0000)]
Stop corruption of ihex output shen addresses are sign extended.

PR 23699
* ihex.c (ihex_write_object_contents): Check for sign extended
addresses that cannot be supported in the ihex format.

6 years agooops - add missing piece of previous delta
Nick Clifton [Fri, 9 Nov 2018 12:51:46 +0000 (12:51 +0000)]
oops - add missing piece of previous delta

6 years agoEnhance the strings program so that it can display multibyte strings.
Nick Clifton [Fri, 9 Nov 2018 12:48:23 +0000 (12:48 +0000)]
Enhance the strings program so that it can display multibyte strings.

* strings.c (print_strings): Check for multibyte encodings.
* binutils-all/strings-1.bin: New file.  Test binary for string decoding.
* testsuite/binutils-all/strings.exp: New file.  Test the strings program.
* testsuite/config/default.exp (STRINGS): Define if not provided
by the environment.
(STRINGSFLAGS): Likewise.

6 years ago[ARC] Update ld tests.
Claudiu Zissulescu [Fri, 9 Nov 2018 11:24:29 +0000 (13:24 +0200)]
[ARC] Update ld tests.

ld/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* testsuite/ld-arc/tls_gd-01.d: Update test.
* testsuite/ld-arc/arclinux-nps.d: Add cpu option.

6 years ago[ARC] Fix local got entry list.
Claudiu Zissulescu [Fri, 9 Nov 2018 11:14:00 +0000 (13:14 +0200)]
[ARC] Fix local got entry list.

Fix a memory leak appearing when the local got entry list was constructed.

bfd/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* arc-got.h (arc_get_local_got_ents): Revamp it; use
elf_local_got_ents to store the local got list.
(get_got_entry_list_for_symbo): Restructure it.
* elf32-arc.c (elf_arc_relocate_section): Correct the call to
get_got_entry_list_for_symbol.

6 years agoAllow for compilers that do not produce aligned .rdat sections in PE format files.
Marc [Fri, 9 Nov 2018 11:13:50 +0000 (11:13 +0000)]
Allow for compilers that do not produce aligned .rdat sections in PE format files.

PR 23872
* scripttempl/pep.sc (pe.sc): Ensure rdata_runtime_pseudo_relocs
are aligned.
* scripttempl/pep.sc (pep.sc): Likewise.

6 years ago[gdb/symtab] Fix language of duplicate static minimal symbol
Tom de Vries [Fri, 9 Nov 2018 10:54:04 +0000 (11:54 +0100)]
[gdb/symtab] Fix language of duplicate static minimal symbol

Consider a test-case with source files msym.c:
...
static int foo (void) { return 1; }
...
and msym_main.c:
...
static int foo (void) { return 2; }
int main (void) { return 0; }
..
compiled as c++ with minimal symbols:
...
$ g++ msym_main.c msym.c
...

With objdump -x we find the two foo symbols prefixed with their corresponding
files in the symbol table:
...
0000000000000000 l    df *ABS*  0000000000000000              msym_main.c
00000000004004c7 l     F .text  000000000000000b              _ZL3foov
0000000000000000 l    df *ABS*  0000000000000000              msym.c
00000000004004dd l     F .text  000000000000000b              _ZL3foov
...

However, when we use gdb to print info on foo, both foos are listed, but we
get one symbol mangled and one symbol demangled:
...
$ gdb ./a.out -batch -ex "info func foo"
All functions matching regular expression "foo":

Non-debugging symbols:
0x00000000004004c7  foo()
0x00000000004004dd  _ZL3foov
...

During minimal symbol reading symbol_set_names is called for each symbol.

First, it's called with foo from msym.c, an entry is created in
per_bfd->demangled_names_hash and symbol_find_demangled_name is called, which
has the side effect of setting the language of the symbol to language_cplus.

Then, it's called with foo from msym_main.c.  Since
per_bfd->demangled_names_hash already has an entry for that name,
symbol_find_demangled_name is not called, and the language of the symbol
remains language_auto.

Fix this by doing the symbol_find_demangled_name call unconditionally.

Build and reg-tested on x86_64-linux.

gdb/ChangeLog:

2018-11-09  Tom de Vries  <tdevries@suse.de>

* symtab.c (symbol_set_names): Call symbol_find_demangled_name
unconditionally, to set the language of the symbol.  Manage freeing
returned pointer using gdb::unique_xmalloc_ptr.

gdb/testsuite/ChangeLog:

2018-11-09  Tom de Vries  <tdevries@suse.de>

* gdb.base/msym-lang.c: New test.
* gdb.base/msym-lang.exp: New file.
* gdb.base/msym-lang-main.c: New test.

6 years agoS/390: Fix optional operand handling after memory addresses
Andreas Krebbel [Fri, 9 Nov 2018 10:00:47 +0000 (11:00 +0100)]
S/390: Fix optional operand handling after memory addresses

Instructions having an optional argument following a memory address
operand were not handled correctly if the optional argument was not
specified.

gas/ChangeLog:

2018-11-09  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/tc-s390.c (skip_optargs_p): New function.
(md_gather_operands): Use skip_optargs_p.
* testsuite/gas/s390/s390.exp: Run the new test.
* testsuite/gas/s390/zarch-optargs.d: New test.
* testsuite/gas/s390/zarch-optargs.s: New test.

6 years agoPowerPC, don't use bfd reloc howto in md_assemble
Alan Modra [Wed, 7 Nov 2018 05:42:36 +0000 (16:12 +1030)]
PowerPC, don't use bfd reloc howto in md_assemble

We support source like the following
 .data
 .quad x-.
 .space 8
x:
where at the time the .quad line is assembled, x is unknown so a fixup
is emitted for later evaluation.  This is supported for data even when
the target may not have relocations for the expression, for example,
32-bit powerpc targets lack a 64-bit reloc.  As long as the fixup
resolves at assembly time, gas is happy.

The idea of this patch is to support fixups that resolve at assembly
time for instructions too, even when the target might lack the
necessary relocations (and thus no howto).

* config/tc-ppc.c (fixup_size): New function.
(md_assemble): Use it to derive size and pcrel directly
from fixup reloc type.

6 years agoAutomatic date update in version.in
GDB Administrator [Fri, 9 Nov 2018 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in

6 years agoCapitalize "<TAB>" in require_record_target error
Tom Tromey [Wed, 7 Nov 2018 03:12:36 +0000 (20:12 -0700)]
Capitalize "<TAB>" in require_record_target error

This changes require_record_target to say "<TAB>" rather than "<tab>".
I think capitalizing here is a bit more GNU-ish, based on Emacs usage
and one other case in gdb.

gdb/ChangeLog
2018-11-08  Tom Tromey  <tom@tromey.com>

* record.c (require_record_target): Upper-case "<TAB>".

6 years agoFix output indentation for "info pretty-printers"
Tom Tromey [Wed, 7 Nov 2018 03:09:20 +0000 (20:09 -0700)]
Fix output indentation for "info pretty-printers"

I noticed that "info pretty-printers" will indent the "objfile" line
like:

    (top-gdb) info pretty-printer
    global pretty-printers:
      builtin
mpx_bound128
      objfile /home/tromey/gdb/build/gdb/gdb pretty-printers:
      type_lookup_function

I think the "objfile" line should be "out-dented", following the same
style as the "global" and "progspace" (not shown) lines.

This patch implements this.

gdb/ChangeLog
2018-11-08  Tom Tromey  <tom@tromey.com>

* python/lib/gdb/command/pretty_printers.py
(InfoPrettyPrinter.invoke): Don't indent "objfile" heading.

6 years agoAvoid crash when calling warning too early
Tom Tromey [Fri, 5 Oct 2018 20:54:35 +0000 (14:54 -0600)]
Avoid crash when calling warning too early

I noticed that if you pass the name of an existing file (not a
directory) as the argument to --data-directory, gdb will crash:

    $ ./gdb -nx  --data-directory  ./gdb
    ../../binutils-gdb/gdb/target.c:590:56: runtime error: member call on null pointer of type 'struct target_ops'

This was later reported as PR gdb/23838.

This happens because warning ends up calling
target_supports_terminal_ours, which calls current_top_target, which
returns nullptr this early.

This fixes the problem by handling this case specially in
target_supports_terminal_ours.  I also changed
target_supports_terminal_ours to return bool.

gdb/ChangeLog
2018-11-08  Tom Tromey  <tom@tromey.com>

PR gdb/23555:
PR gdb/23838:
* target.h (target_supports_terminal_ours): Return bool.
* target.c (target_supports_terminal_ours): Handle case where
current_top_target returns nullptr.  Return bool.

gdb/testsuite/ChangeLog
2018-11-08  Tom Tromey  <tom@tromey.com>

PR gdb/23555:
PR gdb/23838:
* gdb.base/warning.exp: New file.

6 years ago(AArch64) wrong value returned by "finish" for HFA
Joel Brobecker [Thu, 8 Nov 2018 15:27:31 +0000 (10:27 -0500)]
(AArch64) wrong value returned by "finish" for HFA

Consider the gdb.ada/array_return.exp testcase, and in particular,
consider the following code...

   type Small_Float_Vector is array (1 .. 2) of Float;

   function Create_Small_Float_Vector return Small_Float_Vector is
   begin
      return (others => 4.25);
   end Create_Small_Float_Vector;

... which declares a type which is an array with 2 floats in it
(floats are 4 bytes on AArch64), trying to get GDB to print
the return value from that function does not work:

    (gdb) fin
    Run till exit from #0  pck.create_small_float_vector () at /[...]/pck.adb:15
    0x000000000000062c in p () at /[...]/p.adb:11
    11         Vector := Create_Small_Float_Vector;
    Value returned is $1 = (4.25, 0.0)
                                  ^^^
                                  |||

We expected the value shown to be:

    (gdb) fin
    Run till exit from #0  pck.create_small_float_vector () at /[...]/pck.adb:15
    0x000000000000062c in p () at /[...]/p.adb:11
    11         Vector := Create_Small_Float_Vector;
    Value returned is $1 = (4.25, 4.25)

Because the return type is an HFA, it is returned via the first two
SIMD registers. However, what happens is that the current implementation
fails to realize that this is an HFA, and therefore fetches the return
value from the wrong location. And the reason why it fails to realize
this is because it thinks that our array has 8 elements (HFAs have
a maximum of 4). Looking at aapcs_is_vfp_call_or_return_candidate_1,
where this is determined, we can easily see why (looks like a thinko):

        | case TYPE_CODE_ARRAY:
        | [...]
        |         struct type *target_type = TYPE_TARGET_TYPE (type);
        |         int count = aapcs_is_vfp_call_or_return_candidate_1
        |                       (target_type, fundamental_type);
        |
        |         if (count == -1)
        |           return count;
        |
  !! -> |         count *= TYPE_LENGTH (type);
        |           return count;

Here, we first determine the count for one element of our array,
and so we should then be multiplying that count by the number
of elements in our array (2 in our case). But instead, we multiply it
by the total size (8). As a result, we do not classify the return
type as an HFA, and thus pick the wrong location for fetching
the return value.

gdb/ChangeLog:

        * aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1):
        return the correct count for potential HFAs.

Tested on aarch64-linux, fixes:

    array_return.exp: value printed by finish of Create_Small_Float_Vector

6 years agox86-64: fix ZMM register state tracking
Jan Beulich [Thu, 8 Nov 2018 11:12:05 +0000 (12:12 +0100)]
x86-64: fix ZMM register state tracking

The three AVX512 state components are entirely independent - one being
in its "init state" has no implication whatsoever on either of the other
two. Fully separate X86_XSTATE_ZMM_H and X86_XSTATE_ZMM handling, to
prevent upper halves of the upper 16 ZMM registers to display as if they
were zero (when they aren't) after e.g. VZEROALL/VZEROUPPER.

6 years agogdb/riscv: Update test to support targets without FP hardware
Andrew Burgess [Mon, 5 Nov 2018 22:00:31 +0000 (22:00 +0000)]
gdb/riscv: Update test to support targets without FP hardware

Update gdb.arch/riscv-reg-aliases.exp test to support targets without
floating point registers.

gdb/testsuite/ChangeLog:

* gdb.arch/riscv-reg-aliases.exp: Handle targets without floating
point hardware.

6 years agogdb/riscv: Handle errors while setting the frame id
Andrew Burgess [Mon, 29 Oct 2018 15:14:03 +0000 (15:14 +0000)]
gdb/riscv: Handle errors while setting the frame id

When we connect to a remote target one of the first things GDB does is
establish a frame id.  If an error is thrown while building this frame
id then GDB will disconnect from the target.

This can mean that, if the user is attempting to connect to a target
that doesn't yet have a program loaded, or the program the user is
going to load onto the target doesn't match what is already loaded, or
the target is just in some undefined state, then the very first
request for a frame id can fail (for example, by trying to load from
an invalid memory address), and GDB will disconnect.  It is then
impossible for the user to connect to the target and load a new
program at all.

An example of such a session might look like this:

    Reading symbols from ./gdb/testsuite/outputs/gdb.arch/riscv-reg-aliases/riscv-reg-aliases...
    (gdb) target remote :37191
    Remote debugging using :37191
    0x0000000000000100 in ?? ()
    Cannot access memory at address 0x0
    (gdb) load
    You can't do that when your target is `exec'
    (gdb) info frame
    /path/to/gdb/gdb/thread.c:93: internal-error: thread_info* inferior_thread(): Assertion `tp' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

The solution is to handle errors in riscv_frame_this_id, and leave the
this_id variable with its default value, which is the predefined
'outermost' frame.

With this fix in place, connecting to the same target now looks like
this:

    (gdb) target remote :37191
    Remote debugging using :37191
    0x0000000000000100 in ?? ()
    (gdb) info frame
    Stack level 0, frame at 0x0:
     pc = 0x100; saved pc = <not saved>
     Outermost frame: outermost
     Arglist at unknown address.
     Locals at unknown address, Previous frame's sp in sp

gdb/ChangeLog:

* riscv-tdep.c (riscv_insn::decode): Update header comment.
(riscv_frame_this_id): Catch errors thrown while building the
frame cache, leave the frame id as the default, which is the outer
frame id.

6 years agoMake gold testsuite work with CC and CXX specifying -B
Alan Modra [Fri, 2 Nov 2018 10:57:02 +0000 (21:27 +1030)]
Make gold testsuite work with CC and CXX specifying -B

The patch allows the gold testsuite to pass when using something like
the following configure line, which works for the rest of the binutils
testsuite.  At least, it does if you don't configure your gcc with any
of the options that force a particular path to as or ld.

gccdir="/home/alan/build/gcc/prev-"
gccsrc="/home/alan/src/gcc.git"
gcctarg="x86_64-linux"
CC="${gccdir}gcc/xgcc -B${gccdir}gcc/" \
CXX="${gccdir}gcc/xg++ -B${gccdir}gcc/ -I${gccdir}$gcctarg/libstdc++-v3/include -I${gccdir}$gcctarg/libstdc++-v3/include/$gcctarg -I${gccsrc}/libstdc++-v3/libsupc++ -L${gccdir}$gcctarg/libstdc++-v3/src/.libs/" \
~/src/binutils-gdb/configure ...

gold's -Bgcctestdir/ option must come before the -B supplied by $CC
or $CXX, in order to pick up the linker we want to test.  Also when
using a not-yet-installed gcc, it is necessary to provide a collect-ld
in gcctestdir/ as otherwise a collect-ld script in -B${gccdir}gcc/
will be used and the wrong linker tested.

Besides this, the patch fixes some bugs: The $COMPILE -D_FORTIFY_SOURCE
edit was wrong (but worked for usual values), and the $CXXLINK_S edit
unnecessarily but harmlessly used extra backslash quoting.  See
posix shell documentation regarding quoting, or
www.gnu.org/software/bash/manual/bashref.html#Command-Substitution

Also, -Bgcctestdir/ in one place makes it less likely a new test will
be added that accidentally lacks the option.

* Makefile.am (gcctestdir1/ld): Use $@ and absolute paths.
(gcctestdir1/collect-ld): New.
(ld1_DEPENDENCIES): Add gcctestdir1/collect-ld.
(ld1_LDFLAGS): Remove -Bgcctestdir1/.
(editcc1, ld1_LINK): Define.
(gcctestdir2/ld, gcctestdir2/collect-ld, ld2_DEPENDENCIES),
(ld2_LDFLAGS, editcc2, ld2_LINK),
(ld1_r_DEPENDENCIES, ld1_r_LDFLAGS, ld1_r_LINK),
(gcctestdir2-r/ld, gcctestdir2-r/collect-ld, ld2_r_DEPENDENCIES),
(ld2_r_LDFLAGS, editcc2r, ld2_r_LINK),
(gcctestdir3/ld, gcctestdir3/collect-ld, ld3_DEPENDENCIES),
(ld3_LDFLAGS, editcc3, ld3_LINK),
(gcctestdir4/ld, gcctestdir4/collect-ld, ld4_DEPENDENCIES),
(ld4_LDFLAGS, editcc4, ld4_LINK): Similarly.
* Makefile.in: Regenerate.
* testsuite/Makefile.am (editcc): Define sed command to put
our -B option first.  Remove other occurrences of -Bgcctestdir/
throughout file.
(editcc1): Define for -D_FORTIFY_SOURCE stripping.
(editcc2): Define for -static-libgcc/libstdc++ stripping.
(LINK1, CXXLINK1): Don't use CCLD or CXXLD.
(CCLD, CXXLD, COMPILE, LINK, CXXCOMPILE, CXXLINK, CXXLINK_S): Define
using editcc macros.
(gcctestdir/collect-ld): New rule, add as a dependency of..
(gcctestdir/ld): ..this.  Use $@ and abs_top_buildir.
(gcctestdir/as): Use $@.
* testsuite/Makefile.in: Regenerate.
* testsuite/incremental_test.sh (actual): Match collect-ld too.