Commit Graph

94944 Commits

Author SHA1 Message Date
GDB Administrator 5fbad1b909 Automatic date update in version.in 2018-07-25 00:00:36 +00:00
Keith Seitz 380618d68a Set CU language before processing any DIEs (symtab/23010 et al)
This patch is another attempt at really fixing the multitude of assertions
being seen where symbols of one language are being added to symbol lists of
another language.

In this specific case, the backtrace command (thread apply all bt full) that
is looking for the compunit containing the PC of the thread. That calls
get_prev_frame several times. This function calls (eventually)
dwarf2_frame_prev_register. That eventually ends up calling
find_pc_compunit_symtab.

In this function (find_pc_sect_compunit_symtab actually), we loop over all
compunits, calling the "quick" function dw2_find_pc_sect_compunit_symtab.
That function calls dw2_instantiate_symtab to read in all the CU's symbols.
Now the fun begins.

dw2_do_instantiate_symtab queues the per_cu for reading, using a default
"pretend" language of language_minimal with the expectation that this will
be set later.

The DIEs of this (only queued) CU are then processed.

The first DIE is DW_TAG_compile_unit. That's handled by read_file_scope.

(Nearly) The first thing read_file_scope does is:

  get_scope_pc_bounds (die, &lowpc, &highpc, cu);

This function loops over the children of the current DIE (a compile_unit),
looking for bounds. The first such child is a subprogram, and we attempt to
get its bounds. We use dwarf2_attr to get at DW_AT_high_pc.

This subprogram has DW_AT_specification set, so dwarf_attr (via
follow_die_ref/follow_die_offset) will follow that, but follow_die_offset
*also* attempts to load the containing CU for the spec DIE. That spec DIE
lives inside a CU that is a partial_unit and has no language attribute. So
it simply inherits the language from the CU that elicited the read. [That
all happens in follow_die_offset.]

The original CU's language is still language_minimal -- we haven't gotten to
the line in read_file_scope that actually sets the language yet!

And that is the cause of these problems. The call to prepare_one_comp_unit
needs to be the *first* thing that is done when reading a CU so that the
CU's language can be recorded (and inherited by any referenced
partial_units).

Since a test reproducer for this has been so elusive, this patch also adds a
wrapper function around add_symbol_to_list which asserts when adding a
symbol of one language to a list containing symbols of a different language.

gdb/ChangeLog:
2017-07-24  Keith Seitz  <keiths@redhat.com>

        PR symtab/23010
        * dwarf2read.c (dw2_add_symbol_to_list): New function.
        (fixup_go_packaging, new_symbol): Use dw2_add_symbol_to_list
        instead of add_symbol_to_list.
        (read_file_scope): Call prepare_one_comp_unit before reading
        any other DIEs.
2018-07-24 12:48:58 -07:00
Simon Marchi 4b17aefe75 Fix indentation in scoped_mmap.h
gdb/ChangeLog:

	* common/scoped_mmap.h (class scoped_mmap): Fix indentation.
2018-07-24 14:14:17 -04:00
Tom Tromey 29d17e4773 Remove some unnecessary declarations and configury
configure checks for declarations of free, malloc, and realloc; but
the results are only used in a single spot: utils.c.  I think these
checks are long since obsolete, so this patch removes them.

Grepping the entire tree for these HAVE_DECL_ symbols, the only uses
of possible interest to gdb come from bfd/sysdep.h; but this is not
(nor should be) included by gdb.  (And furthermore I think the code
there is probably also obsolete.)

gdb/ChangeLog
2018-07-24  Tom Tromey  <tom@tromey.com>

	* utils.c (malloc, realloc, free): Don't declare.
	* configure, config.in: Rebuild.
	* configure.ac: Don't check for declarations of free, malloc, or
	realloc.
2018-07-24 11:12:04 -06:00
H.J. Lu 56522fc5af x86: Use unsigned int to iterate through vector operands
Use unsigned int to iterate through multi-length vector operands to avoid
sign-extension.

	* config/tc-i386.c (build_vex_prefix): Use unsigned int to
	iterate through multi-length vector operands.
	(build_evex_prefix): Likewise.
2018-07-24 09:51:08 -07:00
Nick Clifton 1d97232ae3 Updated French translation for ld/ and Swedish translation for binutils/
bin	* po/sv.po: Updated Swedish translation.

ld	* po/fr.po: Updated French translation.
2018-07-24 14:07:54 +01:00
Alan Modra 7b8d9e8cec PR23431, Messages composed from pieces can't be properly translated
PR 23431
	* dwarf.c (display_formatted_table): Replace "what" parameter
	with "is_dir".  Expand messages.  Fix capitalisation.
	* testsuite/binutils-all/dw5.W: Update expected output.
2018-07-24 19:59:11 +09:30
Alan Modra 67ce483baa PR23430, Indices misspelled
PR 23430
include/
	* elf/common.h (SHT_SYMTAB_SHNDX): Fix comment typo.
bfd/
	* dwarf2.c (dwarf_debug_section_enum): Fix comment typo.
	* elf.c (bfd_section_from_shdr, elf_sort_sections): Likewise.
binutils/
	* elfcomm.h (struct archive_info): Rename uses_64bit_indicies
	to uses_64bit_indices.
	* elfcomm.c (setup_archive): Update uses of above.
	* readelf.c (process_archive): Likewise.
	(get_section_type_name): Rename indicies to indices.
	(get_32bit_elf_symbols, get_64bit_elf_symbols): Likewise.
	(process_section_groups): Likewise.
cpu/
	* or1kcommon.cpu (spr-reg-indices): Fix description typo.
opcodes/
	* or1k-desc.h: Regenerate.
2018-07-24 19:58:12 +09:30
Jan Beulich 4174bfff8a x86-64: correct AVX512F vcvtsi2s{d,s} handling
Just like for their AVX counterparts and CVTSI2S{D,S}, a memory source
here is ambiguous and hence
- in source files should be qualified with a suitable suffix or operand
  size specifier (not doing so is an error in Intel mode, and will gain
  a diagnostic in AT&T mode in the future),
- in disassembly should be properly suffixed (the Intel operand size
  specifiers were emitted correctly already).
2018-07-24 09:46:27 +02:00
GDB Administrator f47194a9cd Automatic date update in version.in 2018-07-24 00:00:43 +00:00
Max Filippov 2ae0bdddef xtensa: ld: convert tests to run_dump_test
Three tests with individual .exp files can be implemented in less
verbose way with run_dump_test infrastructure. Convert them.

ld/
2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>

	* testsuite/ld-xtensa/coalesce.d: New file.
	* testsuite/ld-xtensa/coalesce.exp: Remove file.
	* testsuite/ld-xtensa/diff_overflow.d: New file.
	* testsuite/ld-xtensa/diff_overflow.exp: Remove file.
	* testsuite/ld-xtensa/lcall.d: New file.
	* testsuite/ld-xtensa/lcall.exp: Remove file.
	* testsuite/ld-xtensa/xtensa.exp (coalesce, diff_overflow)
	(lcall): New tests.
2018-07-23 12:06:40 -07:00
Max Filippov f5e263426f xtensa: ld: add tests for static linkage relaxation
ld/
2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>

	* testsuite/ld-xtensa/relax-static-defs.s: New file.
	* testsuite/ld-xtensa/relax-static-local-pie.d: New file.
	* testsuite/ld-xtensa/relax-static-local-shared.d: New file.
	* testsuite/ld-xtensa/relax-static-local.s: New file.
	* testsuite/ld-xtensa/relax-static-pie.d: New file.
	* testsuite/ld-xtensa/relax-static-shared.d: New file.
	* testsuite/ld-xtensa/relax-static.s: New file.
	* testsuite/ld-xtensa/relax-undef-weak-local-pie.d: New file.
	* testsuite/ld-xtensa/relax-undef-weak-local-shared.d: New file.
	* testsuite/ld-xtensa/relax-undef-weak-local.s: New file.
	* testsuite/ld-xtensa/relax-undef-weak-pie.d: New file.
	* testsuite/ld-xtensa/relax-undef-weak-shared.d: New file.
	* testsuite/ld-xtensa/relax-undef-weak.s: New file.
	* testsuite/ld-xtensa/xtensa.exp: New file.
2018-07-23 12:05:43 -07:00
Max Filippov da90fdf993 xtensa: ld: rename xtensa.exp to xtensa-linux.exp
xtensa.exp in fact only checks xtensa*-*-linux* configurations, rename
it to xtensa-linux.exp to allow xtensa.exp to check xtensa*-*-*.

ld/
2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>

	* testsuite/ld-xtensa/xtensa.exp: Rename to xtensa-linux.exp.
2018-07-23 12:04:45 -07:00
Max Filippov f82863d797 xtensa: move dynamic relocations sections consistency check
The function elf_xtensa_finish_dynamic_sections checks that sizes of
sections .rela.dyn and .rela.plt match number of corresponding relocation
records, but the check is only done when .rela.plt is non-empty, so, e.g.
it is never run for the static PIE.
Rearrange the test so that .rela.dyn and .rela.plt are checked always.

bfd/
2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>

	* elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
	relocation sections consistency check to always check both
	.rela.dyn and .rela.plt when they exist. Rearrange variable
	definition and assignment places.
2018-07-23 12:03:56 -07:00
Max Filippov 5d3a462f05 xtensa: fix relaxation of undefined weak references in shared objects
The change c451bb34ae ("xtensa: don't emit dynamic relocation for weak
undefined symbol") didn't properly handle shrinking of relocation
sections due to coalescing of references to a dynamic undefined weak
symbol in a shared object, which resulted in the following assertion
failure in ld when linking uClibc-ng libthread_db for xtensa:

  BFD (GNU Binutils) 2.31 internal error, aborting at elf32-xtensa.c:3269
  in elf_xtensa_finish_dynamic_sections

Shrink dynamic relocations section for dynamic undefined weak symbols
when linking a shared object.

bfd/
2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>

	* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
	relocations section for dynamic undefined weak symbols when
	linking a shared object.
2018-07-23 12:02:53 -07:00
Tom Tromey 01bcaf636a Avoid ubsan complaint in BFD
I built gdb with ubsan and ran the test suite.

One complaint was due to bfd_get_elf_phdrs passing NULL to memcpy.
This patch avoids the complaint.

bfd/ChangeLog
2018-07-23  Tom Tromey  <tom@tromey.com>

	* elf.c (bfd_get_elf_phdrs): Don't call memcpy with size 0.
2018-07-23 08:14:00 -06:00
H.J. Lu e2b7fbc46d x86: Add a test for missing broadcast
For

	.intel_syntax noprefix
	vcvtps2qq xmm0, DWORD PTR [rax]

we should get

Error: broadcast is needed for operand of such type for `vcvtps2qq'

	* testsuite/gas/i386/inval-avx512f.s: Add a test for missing
	broadcast.
	* testsuite/gas/i386/x86-64-inval-avx512f.s: Likewise.
	* testsuite/gas/i386/inval-avx512f.l: Updated.
	* testsuite/gas/i386/x86-64-inval-avx512f.l: Likewise.
2018-07-23 06:32:20 -07:00
H.J. Lu c265869848 x86: Remove broadcast_not_on_src_operand
Remove broadcast_not_on_src_operand since it is unused.

	* config/tc-i386.c (i386_error): Remove
	broadcast_not_on_src_operand.
	(match_template): Likewse.
2018-07-23 05:43:43 -07:00
Claudiu Zissulescu 04e65276fa [ARC] Fix decoding of w6 signed short immediate.
gas/
  Claudiu Zissulescu  <claziss@synopsys.com>

        * testsuite/gas/arc/st.d: Fix test.

opcodes/
  Claudiu Zissulescu  <claziss@synopsys.com>

        * arc-opc.c (extract_w6): Fix extending the sign.
2018-07-23 11:09:43 +02:00
Claudiu Zissulescu 47e6f81c7c [ARC] Allow vewt instruction for ARC EM family.
opcode/
  Claudiu Zissulescu  <claziss@synopsys.com>

	* arc-tbl.h (vewt): Allow it for ARC EM family.
2018-07-23 11:09:43 +02:00
claziss f02806be1f [ARC] Fix case-sensitivity for extension instructions.
In ARC assembler, we accept case insensitive mnemonics, but this was
not the case for extension instruction, fix it and add a test.

gas/
Claudiu Zissulescu <claziss@synopsys.com>

	* config/tc-arc.c (tokenize_extinsn): Convert to lower case the
	name of extension instructions.
	* testsuite/gas/arc/textinsn_case.d: New file.
	* testsuite/gas/arc/textinsn_case.s: Likewise.
2018-07-23 11:09:43 +02:00
Andreas Krebbel 898ade12ee S/390: Suppress string diagnostics for pre-release GCC
Building for S/390 currently fails when using a GCC 8.1 pre-release
version like 8.0.1 (as it is used by F28).  Fixed with the attached patch.

bfd/ChangeLog:

2018-07-23  Andreas Krebbel  <krebbel@linux.ibm.com>

	* elf32-s390.c (elf_s390_write_core_note): Make GCC version 8.0 to
	be covered by the check as well.
	* elf64-s390.c (elf_s390_write_core_note): Likewise.
2018-07-23 10:33:29 +02:00
Alan Modra 49ddb0fbda PowerPC64 fails reloc-discard test
PowerPC64 fails here due to emitting a warning about discarded dynamic
relocations.  That's a good thing, since accidentally discarding
dynamic relocations will likely result in a non-working binary.

	* testsuite/ld-elf/reloc-discard-warn.d: New.
	* testsuite/ld-elf/reloc-discard.d: Skip test on PowerPC64.
2018-07-23 13:06:33 +09:30
Alan Modra bb71536f28 power9 mfupmc/mtupmc
PR 23419
	* ppc-opc.c (powerpc_opcodes): Add mtupmc/mfupmc/mfpmc extended
	opcode variants for mtspr/mfspr encodings.
2018-07-23 13:06:32 +09:30
Simon Marchi cf4088a92f Remove some unused variables
Found using the newly-enabled -Wunused-variable.

gdb/ChangeLog:

	* aarch64-linux-nat.c
	(aarch64_linux_nat_target::stopped_data_address): Remove unused
	variable.
	* arm-linux-nat.c (fetch_regs): Likewise.
	(store_regs): Likewise.
	(fetch_vfp_regs): Likewise.
	(store_vfp_regs): Likewise.
	(arm_linux_nat_target::insert_hw_breakpoint): Likewise.
	(arm_linux_nat_target::remove_hw_breakpoint): Likewise.
	(arm_linux_nat_target::insert_watchpoint): Likewise.
	(arm_linux_nat_target::remove_watchpoint): Likewise.
	* mips-linux-nat.c (mips_linux_nat_target::insert_watchpoint):
	Likewise.
	* nat/aarch64-sve-linux-ptrace.c (aarch64_sve_get_sveregs):
	Likewise.
	* ppc-linux-nat.c (fetch_register): Likewise.
	(fetch_all_gp_regs): Likewise.
	(fetch_ppc_registers): Likewise.
	(store_all_gp_regs): Likewise.
	(store_ppc_registers): Likewise.
	(hwdebug_insert_point): Likewise.
	(can_use_watchpoint_cond_accel): Likewise.
	* remote-sim.c (gdb_os_write_stdout): Likewise.

gdb/gdbserver/ChangeLog:

	* linux-mips-low.c (mips_collect_ptrace_register): Remove unused
	variable.
	(mips_supply_ptrace_register): Likewise.
2018-07-22 23:23:11 -04:00
GDB Administrator 6018c5acdf Automatic date update in version.in 2018-07-23 00:01:17 +00:00
Tom Tromey a0de763e32 Add -Wunused-variable to warnings.m4
This adds -Wunused-variable to the build.  This required a special
check in configure in order to work around a bug in GCC 4.9.  Simon
ound the correct test to use, so I've added him to the ChangeLog.

gdb/ChangeLog
2018-07-22  Simon Marchi  <simon.marchi@polymtl.ca>
	    Tom Tromey  <tom@tromey.com>

	* warning.m4 (AM_GDB_WARNINGS): Add -Wunused-variable and special
	test for it.
	* configure: Rebuild.

gdb/gdbserver/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
2018-07-22 13:20:07 -06:00
Tom Tromey 3b20124b3d Conditionally define xmltarget_${name} variable in regdat.sh
This changes regdat.sh to emit the xmltarget_${name} variable inside
the #ifndef IN_PROCESS_AGENT block.  This avoids a -Wunused-variable
warning for some builds.  Thanks to Pedro for investigating this one.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* regformats/regdat.sh: Define xmltarget_${name} inside
	#ifndef IN_PROCESS_AGENT.
2018-07-22 13:20:07 -06:00
Tom Tromey b0a7723d29 Remove unused variables from gdbserver
This removes a few unused variables from gdbserver.

The x86-tdesc.h change is a bit unusual for this series.  This file
was not defining the multiple-include guard symbol, so I've added that
here.  Also, it is hard to determine when i386_expedite_regs will be
needed, so this patch simply marks it ATTRIBUTE_UNUSED.

gdb/gdbserver/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* win32-low.c (win32_create_inferior): Remove unused variables.
	* gdbreplay.c (remote_open): Remove unused variable.
	* remote-utils.c (remote_prepare): Remove unused variable.
	* x86-tdesc.h (X86_TDESC_H): Define.
	(amd64_expedite_regs): Define conditionally.
	(i386_expedite_regs): Mark ATTRIBUTE_UNUSED.
	* linux-x86-tdesc.c (i386_tdescs): Move inside #if.
	* remote-utils.c (readchar): Remove unused variable.
2018-07-22 13:20:06 -06:00
Tom Tromey 8c8807f439 Remove unused declaration from value.c
This removes an unused declaration from value_fetch_lazy_bitfield.
Because it is not completely clear if the check_typedef call is needed
somewhere beneath this function, this is broken out into a separate
patch.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* value.c (value_fetch_lazy_bitfield): Remove unused variable.
2018-07-22 13:20:05 -06:00
Tom Tromey c486b6106a Pass the correct argument to the observer in reread_symbols
This is actually a patch I found via another route.  Joel had asked me
to write a test, but I still have not found the time to do this.
Meanwhile, -Wunused-variable also found this error.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* symfile.c (reread_symbols): Notify iter, not objfile.
2018-07-22 13:20:05 -06:00
Tom Tromey 494f80a932 Fix ravenscar-thread.c to use arch_ops
The change to turn target ops into methods accidentally introduced a
bug in ravenscar-thread.c, changing some calls that were using
"arch_ops" to use the target beneath.

This patch changes ravenscar-thread.c to use these variables where
appropriate.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* ravenscar-thread.c (ravenscar_thread_target::store_registers):
	Use arch_ops.
	(ravenscar_thread_target::prepare_to_store): Likewise.
2018-07-22 13:20:04 -06:00
Tom Tromey c51f6a54c2 Call value_fetch_lazy when needed in pretty-printers
This removes some unused variables, and replaces the calls to
value_contents_for_printing with a call to value_fetch_lazy, when
needed.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Remove
	unused variable.  Call value_fetch_lazy when needed.
	* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer):
	Remove unused variable.  Call value_fetch_lazy when needed.
2018-07-22 13:20:04 -06:00
Tom Tromey 374fd1fd7b Remove declarations from m32c-tdep.c
This removes some unused declarations from m32c-tdep.c.  Initially I
had thought that this entire code block was dead, but Simon pointed
out that it is not; so this patch simply removes some declarations.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* m32c-tdep.c (mark_dma): Return void.
	(make_regs): Remove unused declarations.
2018-07-22 13:20:03 -06:00
Tom Tromey d5e9a511c4 Call some functions in guile/ for effect
This changes a couple of spots in guile/ to remove a variable
declaration but to still call a function for effect.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* guile/scm-cmd.c (gdbscm_dont_repeat): Call
	cmdscm_get_valid_command_smob_arg_unsafe for effect.
	* guile/scm-block.c (gdbscm_make_block_syms_iter): Call
	bkscm_get_valid_block_smob_arg_unsafe for effect.
2018-07-22 13:20:03 -06:00
Tom Tromey 996d693a07 Use a previously unused variable in bfin-tdep.c
This changes bfin_push_dummy_call to use the result of check_typedef.
Calling check_typedef for effect was probably ok as well, but this
seemed a little nicer.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* bfin-tdep.c (bfin_push_dummy_call): Use arg_type, not
	value_type.
2018-07-22 13:20:02 -06:00
Tom Tromey 1576637036 Unused variable fixes related to conditional compilation
This patch fixes various unused variable warnings that are related to
conditional compilation.  In these cases, either the variable is now
protected by the same #if as its uses, or the declaration is simply
lowered into the conditionally-compiled block.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* windows-nat.c (saved_context): Conditionally define.
	* remote.c (remote_target::remote_btrace_maybe_reopen):
	Conditionally declare "warned".
	* inflow.c (sigquit_ours): Conditionally define.
	(new_tty): Move "tty" declaration inside #if.
	* guile/guile.c (guile_datadir): Conditionally define.
	* charset.c (set_be_le_names): Move some declarations inside #if.
	* btrace.c (parse_xml_btrace): Move "errcode" declaration inside
	#if.
	(parse_xml_btrace_conf): Likewise.
2018-07-22 13:20:02 -06:00
Tom Tromey f4e80e1301 Remove an unused variable from spu_get_overlay_table
This removes an unused variable from spu_get_overlay_table, replacing
it with an explanatory comment.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* spu-tdep.c (spu_get_overlay_table): Remove unused variable.
2018-07-22 13:20:01 -06:00
Tom Tromey 8d49165d83 Simple unused variable removals
This patch holds all the straightforward unused variable deletions.

gdb/ChangeLog
2018-07-22  Tom Tromey  <tom@tromey.com>

	* guile/scm-value.c (gdbscm_value_call): Remove unused variables.
	* guile/scm-math.c (vlscm_unop_gdbthrow, vlscm_binop_gdbthrow)
	(vlscm_convert_typed_value_from_scheme): Remove unused variable.
	* buildsym-legacy.c (get_macro_table): Remove unused variable.
	* stack.c (frame_apply_level_command): Remove unused variable.
	* tic6x-tdep.c (tic6x_push_dummy_call): Remove unused variable.
	* sparc64-tdep.c (adi_examine_command): Remove unused variable.
	* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Remove
	unused variable.
	* nios2-tdep.c (nios2_push_dummy_call): Remove unused variable.
	* mep-tdep.c (mep_push_dummy_call): Remove unused variable.
	* ada-lang.c (ada_lookup_symbol_list_worker): Remove unused
	variable.
	* amd64-tdep.c (amd64_supply_xsave): Remove unused variable.
	* arm-tdep.c (arm_record_data_proc_misc_ld_str): Remove unused
	variable.
	* breakpoint.c (check_no_tracepoint_commands, update_watchpoint):
	Remove unused variable.
	* cli/cli-script.c (recurse_read_control_structure): Remove unused
	variable.
	* common/tdesc.c (print_xml_feature::visit): Remove unused
	variable.
	* compile/compile-object-load.c (store_regs): Remove unused
	variables.
	* complaints.c (clear_complaints): Remove unused variable.
	* corelow.c (core_target_open): Remove unused variable.
	* fbsd-tdep.c (fbsd_core_info_proc_status): Remove unused
	variable.
	* guile/scm-frame.c (gdbscm_frame_read_var): Remove unused
	variable.
	* guile/scm-symtab.c (stscm_print_sal_smob): Remove unused
	variable.
	* guile/scm-type.c (gdbscm_field_baseclass_p): Remove unused
	variable.
	* guile/scm-utils.c (gdbscm_parse_function_args): Remove unused
	variable.
	* hppa-tdep.c (hppa_stub_frame_unwind_cache): Remove unused
	variable.
	* ia64-tdep.c (examine_prologue): Remove unused variable.
	* infcall.c (run_inferior_call): Remove unused variable.
	* inferior.c (exit_inferior): Remove unused variable.
	* infrun.c (infrun_thread_ptid_changed): Remove unused variable.
	* linespec.c (decode_line_2): Remove unused variable.
	* linux-nat.c (super_close): Remove.
	* linux-tdep.c (linux_info_proc): Remove unused variable.
	* mi/mi-main.c (mi_execute_command): Remove unused variable.
	* microblaze-linux-tdep.c (microblaze_linux_sigtramp_cache):
	Remove unused variable.
	* parse.c (find_minsym_type_and_address): Remove unused variable.
	* printcmd.c (info_symbol_command, printf_floating): Remove unused
	variable.
	* python/py-breakpoint.c (bppy_set_commands): Remove unused
	variable.
	* python/py-unwind.c (unwind_infopy_dealloc): Remove unused
	variables.
	* record-btrace.c (record_btrace_target::store_registers): Remove
	unused variable.
	(cmd_show_record_btrace_cpu): Remove unused variable.
	* riscv-tdep.c (riscv_register_reggroup_p)
	(riscv_push_dummy_call, riscv_return_value): Remove unused
	variable.
	* rust-exp.y (literal): Remove unused variable.
	* rust-lang.c (rust_evaluate_subexp) <OP_RUST_ARARAY>: Remove
	unused variable.
	<STRUCTOP_ANONYMOUS>: Likewise.
	* s390-linux-tdep.c (s390_linux_init_abi_31)
	(s390_linux_init_abi_64): Remove unused variable.
	* ser-ming2.c (ser_windows_read_prim, pipe_select_thread)
	(file_select_thread, net_windows_open, _initialize_ser_windows):
	Remove unused variables.
	* symtab.c (find_pc_sect_line): Remove unused variable.
	* target-memory.c (compute_garbled_blocks): Remove unused
	variable.
	(target_write_memory_blocks): Remove unused variable.
	* target.c (target_stack::unpush): Remove unused variables.
	* tracepoint.c (start_tracing, all_tracepoint_actions)
	(merge_uploaded_trace_state_variables)
	(print_one_static_tracepoint_marker): Remove unused variable.
	* unittests/basic_string_view/element_access/char/1.cc (test01):
	Remove unused variable.
	* windows-nat.c (windows_continue, windows_add_all_dlls)
	(do_initial_windows_stuff, windows_nat_target::create_inferior):
	Remove unused variables.
2018-07-22 13:20:01 -06:00
H.J. Lu c7213af9b3 x86: Determine vector length from the last vector operand
Determine VEX/EVEXE vector length from the last multi-length vector
operand.

	* config/tc-i386.c (build_vex_prefix): Determine vector
	length from the last multi-length vector operand.
	(build_evex_prefix): Likewise.
2018-07-22 12:00:39 -07:00
Simon Marchi 17cbafdbbe Fix -Wunused-variable warnings related to conditional compilation
Some variables are not used when !HAVE_ELF, so avoid declaring them in
that case.

gdb/ChangeLog:

	* arm-tdep.c (arm_gdbarch_init): Declare attr_arch and
	attr_profile in HAVE_ELF.
	* rs6000-tdep.c (bfd_uses_spe_extensions): Declare vector_abi in
	HAVE_ELF.
2018-07-21 22:23:33 -04:00
GDB Administrator dcc0660f04 Automatic date update in version.in 2018-07-22 00:01:12 +00:00
H.J. Lu dd40ce22d0 gas/config/tc-i386.c: Break long line
* config/tc-i386.c (match_simd_size): Break long line.
	(match_mem_size): Likewise.
2018-07-21 10:57:54 -07:00
Eric Botcazou 2376f038d1 Initialize GOT slot for local symbol in non-PIC link.
On ARM/VxWorks 7, the R_ARM_TARGET2 relocation used for exception handling
is R_ARM_GOT_PREL; moreover in Ada you can define local exceptions. In this
case, you may end up with a GOT relocation against a local symbol in a
non-PIC link and the ARM linker leaves the GOT slot uninitialized, unlike
for example the i386 or the SPARC linkers in the same situation.

bfd/
	* elf32-arm.c (elf32_arm_final_link_relocate) <R_ARM_GOT32>: Small
	cleanup for the case of a global symbol that binds locally.  Also
	install a value in the GOT slot in the case of a local symbol in
	a non-PIC link.
2018-07-21 15:00:40 +02:00
Simon Marchi 0ee6c332f3 Rename some frame unwind function parameters
I am currently working with these functions, and though this renaming
could help to reason about the code.  Some functions take a frame and
will return the value associated to that frame, others will return the
value associated to the previous frame.  Those usually conveniently
contain "unwind" in their name, but naming the variable next_frame
instead of frame helps remembering which frame we are dealing with.

I also included a little typo fix at the top of frame.h.

gdb/ChangeLog:

	* frame.c (frame_register_unwind): Change parameter name.
	(frame_unwind_register): Likewise.
	(frame_unwind_register_value): Likewise.
	(frame_unwind_register_signed): Likewise.
	(frame_unwind_register_unsigned): Likewise.
	* frame.h (frame_register_unwind): Likewise.
	(frame_unwind_register): Likewise.
	(frame_unwind_register_value): Likewise.
	(frame_unwind_register_signed): Likewise.
	(frame_unwind_register_unsigned): Likewise.
	(frame_unwind_arch): Likewise.
2018-07-20 22:19:51 -04:00
GDB Administrator bef891d212 Automatic date update in version.in 2018-07-21 00:00:33 +00:00
Maciej W. Rozycki e2e31f1039 Update my e-mail address, limit maintenance to MIPS I-IV ISAs
binutils/
	* MAINTAINERS: Update my e-mail address, downgrade to MIPS I-IV
	ISA maintenance.

	gdb/
	* MAINTAINERS: Update my e-mail address, downgrade to MIPS I-IV
	ISA maintenance.

	sim/
	* MAINTAINERS: Update my e-mail address, downgrade to MIPS I-IV
	ISA maintenance.
2018-07-21 00:14:01 +01:00
H.J. Lu 7a54636a02 x86: Rename match_reg_size to match_operand_size
match_reg_size checks size for both memory and register operands.  This
patch renamed match_reg_size to match_operand_size and updated comments
for

commit 3ac21baa84
Author: Jan Beulich <jbeulich@novell.com>
Date:   Mon Jul 16 08:19:21 2018 +0200

    x86: fix operand size checking

which added one argument to match_reg_size, match_simd_size and
match_mem_size.

	* config/tc-i386.c (match_reg_size): Renamed to ...
	(match_operand_size): This.  Update comments.
	(match_simd_size): Update comments.  Replace match_reg_size
	with match_operand_size.
	(match_mem_size): Likewise.
	(operand_size_match): Replace match_reg_size with
	match_operand_size.
2018-07-20 12:55:14 -07:00
H.J. Lu d5f4da5e33 ld: Discard .rel.* and .rela.* sections
On many targets, like x86, .rel.dyn/.rela.dyn section is combined from
different .rel/.rela sections by -z combreloc.  To discard dynamic
relocation section, we need to discard .rel.* and .rela.* sections
instead of .rel.dyn and .rela.dyn sections.

Note: This test fails for targets which issue a warning when dynamic
section is discarded.

	* testsuite/ld-elf/reloc-discard.ld: Discard .rel.* and .rela.*
	sections instead of .rel.dyn and .rela.dyn sections.
2018-07-20 09:58:45 -07:00
Maciej W. Rozycki 2d38991535 MIPS/Linux/native: Convert to `get_ptrace_pid' for PID extraction
Use `get_ptrace_pid' to get the ptrace PID from `inferior_ptid' rather
than extracting it by hand.

	gdb/
	* mips-linux-nat.c (mips_linux_nat_target::read_description):
	Call `get_ptrace_pid' rather than extracting the ptrace PID by
	hand.
2018-07-20 17:28:08 +01:00