Commit Graph

96084 Commits

Author SHA1 Message Date
GDB Administrator 1b288e9bbf Automatic date update in version.in 2018-11-21 00:00:26 +00:00
Andrew Burgess d63095c426 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.
2018-11-20 23:01:42 +00:00
Andrew Burgess 1871a62daf 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.
2018-11-20 23:01:42 +00:00
Philippe Waroquiers 604c4ca9f3 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'.
2018-11-20 22:44:50 +01:00
Philippe Waroquiers 20813a0b7b 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.
2018-11-20 22:44:02 +01:00
Philippe Waroquiers fb5e1ed910 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.
2018-11-20 22:42:31 +01:00
Philippe Waroquiers 43d397ca8f 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.
2018-11-20 22:41:08 +01:00
Philippe Waroquiers 9e6a1ab665 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.
2018-11-20 22:39:08 +01:00
Philippe Waroquiers beddd67132 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.
2018-11-20 21:56:06 +01:00
Philippe Waroquiers a8462bbf0b Fix regression 'info variables' does not show minimal symbols.
12615cba84 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.
2018-11-20 21:54:39 +01:00
Pedro Alves 4399bce99b Fix gdb/ChangeLog formatting and date 2018-11-20 19:04:14 +00:00
John Darrington c3247a98cd 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.
2018-11-20 18:55:02 +01:00
Eli Zaretskii 2fa1b3191e Fix previous change in filestuff.c
gdb/ChangeLog:

	* common/filestuff.c (O_NOINHERIT): Define if not defined.
2018-11-20 19:23:51 +02:00
Eli Zaretskii 970d89d8fd 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.
2018-11-20 18:49:43 +02:00
H.J. Lu f92f9e8780 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.
2018-11-20 06:46:03 -08:00
John Darrington 7b5227d132 GDB: S12Z: Add assertion
gdb/ChangeLog:

	* s12z-tdep.c (s12z_frame_cache): Add an assertion.
2018-11-20 07:36:24 +01:00
Simon Marchi dbe4e6545e Remove displaced_step_inferior_state::next
Commit

  39a36629f6 ("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.
2018-11-19 22:35:19 -05:00
GDB Administrator 85a2ae1134 Automatic date update in version.in 2018-11-20 00:00:36 +00:00
Tom Tromey 0614ef69be 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.
2018-11-19 15:45:28 -07:00
Simon Marchi 261f6f7962 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.
2018-11-19 17:27:13 -05:00
Tom Tromey 73fc52c4cc 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.
2018-11-19 11:19:01 -07:00
Tom Tromey 994b876a51 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 098b2108a2, 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.
2018-11-19 11:07:07 -07:00
Simon Marchi 39a36629f6 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.
2018-11-19 11:57:38 -05:00
John Darrington 32641fa925 GDB: Add ChangeLog entry inadvertently omitted from commit. 2018-11-19 17:36:42 +01:00
Pedro Alves 6769f2765d 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.
2018-11-19 15:08:46 +00:00
GDB Administrator 4f323b7277 Automatic date update in version.in 2018-11-19 00:00:29 +00:00
Tom Tromey c2a6c5da37 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.
2018-11-18 09:30:55 -07:00
GDB Administrator ad6d89178d Automatic date update in version.in 2018-11-18 00:01:35 +00:00
GDB Administrator b1406c0b98 Automatic date update in version.in 2018-11-17 00:00:40 +00:00
Alan Hayward 38a72da0f1 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.
2018-11-16 13:45:38 +00:00
Alan Hayward cf84fa6bcf 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.
2018-11-16 13:45:38 +00:00
Alan Hayward c5ac5cbb5b 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.
2018-11-16 13:45:38 +00:00
Nick Clifton 81c688d54f (Another) Updated Spanish translation for the ld subdirectory.
* po/es.po: Updated Spanish translation.
2018-11-16 11:36:08 +00:00
GDB Administrator 2a2c6f530d Automatic date update in version.in 2018-11-16 00:01:06 +00:00
Joel Brobecker f9db0c4c6c 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.
2018-11-15 10:53:57 -05:00
Nick Clifton 92b3642af0 Updated Spanish translation for the ld subdirectory.
ld	* po/es.po: Updated Spanish translation.
2018-11-15 11:55:24 +00:00
GDB Administrator a0cd42fcd1 Automatic date update in version.in 2018-11-15 00:00:41 +00:00
Joel Brobecker a99bc3d23c 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.
2018-11-14 18:18:49 -05:00
Jim Wilson 8b2d40cbba 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.
2018-11-14 14:54:10 -08:00
Jim Wilson ef2de9e7eb 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.
2018-11-14 14:52:34 -08:00
Jim Wilson 174f8ac8d4 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.
2018-11-14 14:51:40 -08:00
GDB Administrator dd9168931f Automatic date update in version.in 2018-11-14 00:01:05 +00:00
Jim Wilson 0242af4010 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.
2018-11-13 15:56:29 -08:00
Francois H. Theron 97b3f39201 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>
2018-11-13 15:33:21 +02:00
Thomas Preud'homme 497d849d28 [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_F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CH_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.
2018-11-13 12:19:28 +00:00
GDB Administrator 7322dd1f69 Automatic date update in version.in 2018-11-13 00:00:40 +00:00
H.J. Lu f77984e974 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.
2018-11-12 09:29:49 -08:00
Simon Marchi 53a89d6e58 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.
2018-11-12 10:38:44 -05:00
Nick Clifton 8a758655b3 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.
2018-11-12 15:12:15 +00:00
Sudakshina Das 3a0f69be55 [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.
2018-11-12 13:29:38 +00:00