Commit Graph

100171 Commits

Author SHA1 Message Date
Nick Clifton 533da48302 Update libiberty sources with changes in the gcc mainline.
+2020-01-01  Jakub Jelinek  <jakub@redhat.com>
+
+	Update copyright years.
+
+2019-12-06  Tim Ruehsen  <tim.ruehsen@gmx.de>
+
+	* make-relative-prefix.c (split_directories):
+	Return early on empty 'name'
+
+2019-11-16  Tim Ruehsen  <tim.ruehsen@gmx.de>
+
+	* cp-demangle.c (d_print_init): Remove const from 4th param.
+	(cplus_demangle_fill_name): Initialize d->d_counting.
+	(cplus_demangle_fill_extended_operator): Likewise.
+	(cplus_demangle_fill_ctor): Likewise.
+	(cplus_demangle_fill_dtor): Likewise.
+	(d_make_empty): Likewise.
+	(d_count_templates_scopes): Remobe const from 3rd param,
+	Return on dc->d_counting > 1,
+	Increment dc->d_counting.
+        * cp-demint.c (cplus_demangle_fill_component): Initialize d->d_counting.
+	(cplus_demangle_fill_builtin_type): Likewise.
+	(cplus_demangle_fill_operator): Likewise.
+
+2019-11-16  Eduard-Mihai Burtescu  <eddyb@lyken.rs>
+
+	* cplus-dem.c (cplus_demangle): Use rust_demangle directly.
+	(rust_demangle): Remove.
+	* rust-demangle.c (is_prefixed_hash): Rename to is_legacy_prefixed_hash.
+	(parse_lower_hex_nibble): Rename to decode_lower_hex_nibble.
+	(parse_legacy_escape): Rename to decode_legacy_escape.
+	(rust_is_mangled): Remove.
+	(struct rust_demangler): Add.
+	(peek): Add.
+	(next): Add.
+	(struct rust_mangled_ident): Add.
+	(parse_ident): Add.
+	(rust_demangle_sym): Remove.
+	(print_str): Add.
+	(PRINT): Add.
+	(print_ident): Add.
+	(rust_demangle_callback): Add.
+	(struct str_buf): Add.
+	(str_buf_reserve): Add.
+	(str_buf_append): Add.
+	(str_buf_demangle_callback): Add.
+	(rust_demangle): Add.
+	* rust-demangle.h: Remove.
+
+2019-11-15  Miguel Saldivar  <saldivarcher@gmail.com>
+
+	* testsuite/demangle-expected: Fix test.
+
+2019-11-04  Kamlesh Kumar  <kamleshbhalui@gmail.com>
+
+	* cp-demangle.c (d_expr_primary): Handle
+	nullptr demangling.
+	* testsuite/demangle-expected: Added test.
+
+2019-10-29 Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	* cp-demangle.c (d_number): Avoid signed int overflow.
+
+2019-10-28  Miguel Saldivar  <saldivarcher@gmail.com>
+
+	* cp-demangle.c (d_print_mod): Add a space before printing `complex`
+	and `imaginary`, as opposed to after.
+	* testsuite/demangle-expected: Adjust test.
+
+2019-10-03  Eduard-Mihai Burtescu  <eddyb@lyken.rs>
+
+	* rust-demangle.c (looks_like_rust): Remove.
+	(rust_is_mangled): Don't check escapes.
+	(is_prefixed_hash): Allow 0-9a-f permutations.
+	(rust_demangle_sym): Don't bail on unknown escapes.
+	* testsuite/rust-demangle-expected: Update 'main::$99$' test.
+
+2019-09-03  Eduard-Mihai Burtescu  <eddyb@lyken.rs>
+
+	* rust-demangle.c (unescape): Remove.
+	(parse_lower_hex_nibble): New function.
+	(parse_legacy_escape): New function.
+	(is_prefixed_hash): Use parse_lower_hex_nibble.
+	(looks_like_rust): Use parse_legacy_escape.
+	(rust_demangle_sym): Use parse_legacy_escape.
+	* testsuite/rust-demangle-expected: Add 'llv$u6d$' test.
+
+2019-08-27  Martin Liska  <mliska@suse.cz>
+
+	PR lto/91478
+	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
+	First find a WEAK HIDDEN symbol in symbol table that will be
+	preserved.  Later, use the symbol name for all removed symbols.
+
+2019-08-12  Martin Liska  <mliska@suse.cz>
+
+	* Makefile.in: Add filedescriptor.c.
+	* filedescriptor.c: New file.
+	* lrealpath.c (is_valid_fd): Remove.

diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 0be45b4ae8..fe738d0db4 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -1,7 +1,7 @@
 # Makefile for the libiberty library.
 # Originally written by K. Richard Pixley <rich@cygnus.com>.
 #
-# Copyright (C) 1990-2019 Free Software Foundation, Inc.
+# Copyright (C) 1990-2020 Free Software Foundation, Inc.
 #
 # This file is part of the libiberty library.
 # Libiberty is free software; you can redistribute it and/or
@@ -127,7 +127,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c				\
 	calloc.c choose-temp.c clock.c concat.c cp-demangle.c		\
 	 cp-demint.c cplus-dem.c crc32.c				\
 	d-demangle.c dwarfnames.c dyn-string.c				\
-	fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c		\
+	fdmatch.c ffs.c fibheap.c filedescriptor.c filename_cmp.c floatformat.c		\
 	fnmatch.c fopen_unlocked.c					\
 	getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c	\
          gettimeofday.c                                                 \
@@ -171,6 +171,7 @@ REQUIRED_OFILES =							\
 	./cp-demint.$(objext) ./crc32.$(objext) ./d-demangle.$(objext)	\
 	./dwarfnames.$(objext) ./dyn-string.$(objext)			\
 	./fdmatch.$(objext) ./fibheap.$(objext)				\
+	./filedescriptor.$(objext)	\
 	./filename_cmp.$(objext) ./floatformat.$(objext)		\
 	./fnmatch.$(objext) ./fopen_unlocked.$(objext)			\
 	./getopt.$(objext) ./getopt1.$(objext) ./getpwd.$(objext)	\
@@ -756,6 +757,17 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	else true; fi
 	$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)

+./filedescriptor.$(objext): $(srcdir)/filedescriptor.c config.h $(INCDIR)/ansidecl.h \
+	$(INCDIR)/libiberty.h
+	if [ x"$(PICFLAG)" != x ]; then \
+	  $(COMPILE.c) $(PICFLAG) $(srcdir)/filedescriptor.c -o pic/$@; \
+	else true; fi
+	if [ x"$(NOASANFLAG)" != x ]; then \
+	  $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/filedescriptor.c -o noasan/$@; \
+	else true; fi
+	$(COMPILE.c) $(srcdir)/filedescriptor.c $(OUTPUT_OPTION)
+
+
 ./filename_cmp.$(objext): $(srcdir)/filename_cmp.c config.h $(INCDIR)/ansidecl.h \
 	$(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
 	$(INCDIR)/safe-ctype.h
diff --git a/libiberty/_doprnt.c b/libiberty/_doprnt.c
index d44dc415ed..a739f4304f 100644
--- a/libiberty/_doprnt.c
+++ b/libiberty/_doprnt.c
@@ -1,5 +1,5 @@
 /* Provide a version of _doprnt in terms of fprintf.
-   Copyright (C) 1998-2019 Free Software Foundation, Inc.
+   Copyright (C) 1998-2020 Free Software Foundation, Inc.
    Contributed by Kaveh Ghazi  (ghazi@caip.rutgers.edu)  3/29/98

 This program is free software; you can redistribute it and/or modify it
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 6444896f99..8c9794db6a 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -1,5 +1,5 @@
 /* Create and destroy argument vectors (argv's)
-   Copyright (C) 1992-2019 Free Software Foundation, Inc.
+   Copyright (C) 1992-2020 Free Software Foundation, Inc.
    Written by Fred Fish @ Cygnus Support

 This file is part of the libiberty library.
diff --git a/libiberty/asprintf.c b/libiberty/asprintf.c
index 5718682f69..6e38e2234d 100644
--- a/libiberty/asprintf.c
+++ b/libiberty/asprintf.c
@@ -1,6 +1,6 @@
 /* Like sprintf but provides a pointer to malloc'd storage, which must
    be freed by the caller.
-   Copyright (C) 1997-2019 Free Software Foundation, Inc.
+   Copyright (C) 1997-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.

 This file is part of the libiberty library.
diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c
index 72c1b710bd..49a2faaa51 100644
--- a/libiberty/choose-temp.c
+++ b/libiberty/choose-temp.c
@@ -1,5 +1,5 @@
 /* Utility to pick a temporary filename prefix.
-   Copyright (C) 1996-2019 Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 Free Software Foundation, Inc.

 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
diff --git a/libiberty/clock.c b/libiberty/clock.c
index a3730714bd..0de74657d0 100644
--- a/libiberty/clock.c
+++ b/libiberty/clock.c
@@ -1,5 +1,5 @@
 /* ANSI-compatible clock function.
-   Copyright (C) 1994-2019 Free Software Foundation, Inc.
+   Copyright (C) 1994-2020 Free Software Foundation, Inc.

 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
diff --git
2020-01-17 14:13:22 +00:00
GDB Administrator bf8e4b6c81 Automatic date update in version.in 2020-01-17 00:00:32 +00:00
Christian Biesinger 40c9409927 Fix some spelling errors.
I noticed those from a lintian run:
https://salsa.debian.org/cbiesinger-guest/gdb/-/jobs/514119

gdb/ChangeLog:

2020-01-16  Christian Biesinger  <cbiesinger@google.com>

        * btrace.c (btrace_compute_ftrace_1): Fix spelling error (Unkown).
        (btrace_stitch_trace): Likewise.
        * charset.c (intermediate_encoding): Likewise (vaild).
        * nat/linux-btrace.c (linux_read_pt): Likewise (Unkown).
        * python/py-record-btrace.c (struct PyMethodDef): Likewise (occurences).
        * record-btrace.c (record_btrace_print_conf): Likewise (unkown).

gdb/testsuite/ChangeLog:

2020-01-16  Christian Biesinger  <cbiesinger@google.com>

        * lib/gdb.exp: Fix spelling error (seperatelly).

Change-Id: I2a44936bac295020f217fb6c78b99b0a8d09cf9a
2020-01-16 16:46:25 -06:00
Hannes Domani e0cdfe3c14 Add type for $_tlb->process_environment_block->process_parameters
The type then looks like this:

(gdb) pt $_tlb->process_environment_block->process_parameters
type = struct rtl_user_process_parameters {
    DWORD32 maximum_length;
    DWORD32 length;
    DWORD32 flags;
    DWORD32 debug_flags;
    void *console_handle;
    DWORD32 console_flags;
    void *standard_input;
    void *standard_output;
    void *standard_error;
    unicode_string current_directory;
    void *current_directory_handle;
    unicode_string dll_path;
    unicode_string image_path_name;
    unicode_string command_line;
    void *environment;
    DWORD32 starting_x;
    DWORD32 starting_y;
    DWORD32 count_x;
    DWORD32 count_y;
    DWORD32 count_chars_x;
    DWORD32 count_chars_y;
    DWORD32 fill_attribute;
    DWORD32 window_flags;
    DWORD32 show_window_flags;
    unicode_string window_title;
    unicode_string desktop_info;
    unicode_string shell_info;
    unicode_string runtime_data;
} *

It's mainly useful to get the current directory, or the full command line:

(gdb) p $_tlb->process_environment_block->process_parameters->current_directory
$1 = {
  length = 26,
  maximum_length = 520,
  buffer = 0xe36c8 L"C:\\src\\tests\\"
}
(gdb) p $_tlb->process_environment_block->process_parameters->command_line
$2 = {
  length = 94,
  maximum_length = 96,
  buffer = 0xe32aa L"\"C:\\gdb\\build64\\gdb-git\\gdb\\gdb.exe\" access.exe"
}

The type names are all lowercase because the existing types created
by windows_get_tlb_type are also lowercase.

Type unicode_string is documented at [1].
The official documentation [2] for rtl_user_process_parameters is limited,
so I've used this other page [3].

[1] https://docs.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_unicode_string
[2] https://docs.microsoft.com/en-us/windows/win32/api/winternl/ns-winternl-rtl_user_process_parameters
[3] https://www.nirsoft.net/kernel_struct/vista/RTL_USER_PROCESS_PARAMETERS.html

gdb/ChangeLog:

2020-01-16  Hannes Domani  <ssbssa@yahoo.de>

	* windows-tdep.c (windows_get_tlb_type):
	Add rtl_user_process_parameters type.
2020-01-16 21:14:47 +01:00
Pedro Alves 790f17188a Ensure proc-service symbols have default visibility (PR build/24805)
Compiling GDB with '-fvisibility=hidden' removes the symbols that
should be exported.

This patch explicitly marks them as visible.

gdb/ChangeLog:
2020-01-16  Pedro Alves  <palves@redhat.com>
            Norbert Lange  <nolange79@gmail.com>

	PR build/24805
	* gdbsupport/gdb_proc_service.h (PS_EXPORT): New.
	(ps_get_thread_area, ps_getpid, ps_lcontinue, ps_lgetfpregs)
	(ps_lgetregs, ps_lsetfpregs, ps_lsetregs, ps_lstop, ps_pcontinue)
	(ps_pdread, ps_pdwrite, ps_pglobal_lookup, ps_pstop, ps_ptread)
	(ps_ptwrite, ps_lgetxregs, ps_lgetxregsize, ps_lsetxregs)
	(ps_plog): Redeclare exported functions with default visibility.
2020-01-16 19:14:14 +00:00
Pedro Alves 701adfb009 [gdb] Move ChangeLog entries to their right files
I spotted a few misplaced entries in the ChangeLog-2019 entries, and
went on to fix them.

Looking around I saw a good number of other entries in other years.
Then OCD got the best of me and I fixed them all.

Also fixes cases of wrong paths in entries, like "* gdb/foo.c" instead
of "* foo.c".
2020-01-16 18:11:06 +00:00
Nitika Achra 3112ed9799 Support for DWARF5 location lists entries
This patch handles DW_LLE_base_addressx, DW_LLE_startx_length and
DW_LLE_start_length.

Tested by running the testsuite before and after the patch and there is
no increase in the number of test cases that fails. Tested with both
-gdwarf-4 and -gdwarf-5 flags. Also tested -gslit-dwarf along with
-gdwarf-4 as well as -gdwarf5 flags.

This is an effort to support DWARF5 in gdb.

gdb/ChangeLog:

	* dwarf2loc.c (decode_debug_loclists_addresses): Handle
	DW_LLE_base_addressx, DW_LLE_startx_length, DW_LLE_start_length.
2020-01-16 11:51:19 -05:00
Andre Vieira 2da2eaf4ce [binutils][arm] PR25376 Change MVE into a CORE_HIGH feature
This patch moves MVE feature bits into the CORE_HIGH section.  This makes sure
.fpu and -mfpu does not reset the bits set by MVE. This is important because
.fpu has no option to "set" these same bits and thus, mimic'ing GCC, we choose
to define MVE as an architecture extension rather than put it together with
other the legacy fpu features.

This will enable the following behavior:
.arch armv8.1-m.main
.arch mve
.fpu fpv5-sp-d16               #does not disable mve.
vadd.i32 q0, q1, q2

This patch also makes sure MVE is not taken into account during auto-detect.
This was already the case, but because we moved the MVE bits to the
architecture feature space we must make sure ARM_ANY does not include MVE.

gas/ChangeLog:
2020-01-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	PR 25376
	* config/tc-arm.c (mve_ext, mve_fp_ext): Use CORE_HIGH.
	(armv8_1m_main_ext_table): Use CORE_HIGH for mve.
	* testsuite/arm/armv8_1-m-fpu-mve-1.s: New.
	* testsuite/arm/armv8_1-m-fpu-mve-1.d: New.
	* testsuite/arm/armv8_1-m-fpu-mve-2.s: New.
	* testsuite/arm/armv8_1-m-fpu-mve-2.d: New.

include/ChangeLog:
2020-01-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	PR 25376
	* opcodes/arm.h (FPU_MVE, FPU_MVE_FPU): Move these features to...
	(ARM_EXT2_MVE, ARM_EXT2_MVE_FP): ... the CORE_HIGH space.
	(ARM_ANY): Redefine to not include any MVE bits.
	(ARM_FEATURE_ALL): Removed.

opcodes/ChangeLog:
2020-01-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	PR 25376
	* opcodes/arm-dis.c (coprocessor_opcodes): Use CORE_HIGH for MVE bits.
	(neon_opcodes): Likewise.
	(select_arm_features): Make sure we enable MVE bits when selecting
	armv8.1-m.main.  Make sure we do not enable MVE bits when not selecting
	any architecture.
2020-01-16 14:33:01 +00:00
Jozef Lawrynowicz 6d0be74bfa MSP430: Remove unused linker script template elf32msp430_3.sc
ld/ChangeLog:

2020-01-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* scripttempl/elf32msp430_3.sc: Remove.
2020-01-16 13:45:29 +00:00
Jozef Lawrynowicz 0c3d948509 MSP430: Add input section rules for .upper sections to default linker script
ld/ChangeLog:

2020-01-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* scripttempl/elf32msp430.sc: Add input section rules for
	.upper.{text,data,rodata,bss}.
	* testsuite/ld-msp430-elf/msp430-elf.exp: Run new test.
	* testsuite/ld-msp430-elf/upper-input-sections.s: New test.
2020-01-16 13:22:31 +00:00
Jan Beulich 45a4bb2010 x86: drop found_cpu_match local variable
50aecf8c5f could have done so right away; perhaps the variable shouldn't
have been introduced in the first place.
2020-01-16 10:07:36 +01:00
Jan Beulich d0849eed78 x86: drop stale Vec_Imm4 related comment
I overlooked this in commit 9d3bf266fd ("x86: drop Vec_Imm4"), presumably
because of the mis-spelling.
2020-01-16 10:07:05 +01:00
Jan Beulich 9cf70a448b x86: add a few more missing VexWIG
Alternatively it could also be VexW0 (to match other SSE2AVX), but the
VexW attribute shouldn't be left unset.
2020-01-16 10:06:21 +01:00
Jan Beulich 4814632e69 x86: VPEXTRQ/VPINSRQ are unavailable outside of 64-bit mode
The AVX512DQ patterns lacking a Cpu64 attribute made the memory operand
forms accepted even outside of 64-bit mode, and this even without any
{evex} pseudo-prefix (otherwise one could argue that this is an attempt
to follow one possible, albeit somewhat odd, interpretation of the SDM
wording to this effect).

For consistency between the various involved templates drop the
* (now) unnecessary IgnoreSize attributes
* unnecessary (due to VexW1) Size64 attributes from VEX encoded forms
* redundant (with Reg64) Qword operand attributes
uniformly.
2020-01-16 10:05:35 +01:00
GDB Administrator c96d7e0462 Automatic date update in version.in 2020-01-16 00:00:34 +00:00
Simon Marchi c12081a66b texi2pod.pl: import support for @t{...} from gcc
GDB's man page source (in gdb.texinfo) contains:

    @t{++}

The @t{...} part is supposed to display the wrapped text with a
fixed-width font.  The texi2pod.pl script currently doesn't handle
@t{...}, so it appears as-is in the man page:

    You can use GDB to debug programs written in C, C@t{++}, Fortran and Modula-2.

gcc's version of texi2pod.pl (at contrib/texi2pod.pl in gcc's repo)
replaces @t{...} with the wrapped text as-is, which I think is an
acceptable behavior.  The fixed-width font distinction is not really
important for a man page, where the text will be displayed with whatever
font the user is using.

Import the line that does that from gcc's version.

I have verified that there is no other, unwanted change in man pages
generated in binutils' and GDB's doc, with this patch applied.

etc/ChangeLog:

	* texi2pod.pl: Handle @t{...} tags.
2020-01-15 12:58:09 -05:00
Simon Marchi 8dc3273e0c Use get_thread_regcache instead of get_current_regcache in post_create_inferior
In post_create_inferior, we get the current thread using the
inferior_thread function and store it in `thr`.  We then call
get_current_regcache immediately after, which does:

  return get_thread_regcache (inferior_thread ());

This patch makes post_create_inferior use get_thread_regcache, passing
`thr`, saving an unnecessary inferior_thread call.

gdb/ChangeLog:

	* infcmd.c (post_create_inferior): Use get_thread_regcache
	instead of get_current_regcache.
2020-01-15 12:47:44 -05:00
Lars Brinkhoff 0d1cc75df1 Set the default page size of the PDP11 target to 8192 bytes.
PR 20694
bfd	* pdp11.c (TARGET_PAGE_SIZE): Set to 8192.

ld	* temulparams/pdp11.sh (TARGET_PAGE_SIZE): Set to 8192.
2020-01-15 14:18:54 +00:00
Alan Modra aad09917e0 tic4x disassembly static variables
tic4x uses a number of static variables for tables that are generated
depending on the current machine (tic4x vs. tic3x).  However, it is
possible to change the machine from one invocation of print_insn_tic4x
to the next.  This patch throws away the old state if that happens,
and uses a relatively small known size array of register names rather
than a malloc'd table.

	* tic4x-dis.c (tic4x_version): Make unsigned long.
	(optab, optab_special, registernames): New file scope vars.
	(tic4x_print_register): Set up registernames rather than
	malloc'd registertable.
	(tic4x_disassemble): Delete optable and optable_special.  Use
	optab and optab_special instead.  Throw away old optab,
	optab_special and registernames when info->mach changes.
2020-01-16 00:01:13 +10:30
Jozef Lawrynowicz 131cb553d6 MSP430: Fix relocation overflow when using #lo(EXP) macro
gas/ChangeLog:

2020-01-15  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/tc-msp430.c (CHECK_RELOC_MSP430): Always generate 430X
	relocations when the target is 430X, except when extracting part of an
	expression.
	(msp430_srcoperand): Adjust comment.
	Initialize the expp member of the msp430_operand_s struct as
	appropriate.
	(msp430_dstoperand): Likewise.
	* testsuite/gas/msp430/msp430.exp: Run new test.
	* testsuite/gas/msp430/reloc-lo-430x.d: New test.
	* testsuite/gas/msp430/reloc-lo-430x.s: New test.

include/ChangeLog:

2020-01-15  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* opcode/msp430.h (enum msp430_expp_e): New.
	(struct msp430_operand_s): Add expp member to struct.

ld/ChangeLog:

2020-01-15  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* testsuite/ld-msp430-elf/msp430-elf.exp: Run new test.
	* testsuite/ld-msp430-elf/reloc-lo-430x.s: New test.
2020-01-15 13:23:06 +00:00
Alan Modra c24d0e8d48 Reinstate gas em=freebsd for sparc-freebsd
In commit c9098af41e I over-simplified the sparc target decoding,
missing the fact that prior to that patch sparc-*-freebsd fell through
to the generic *-*-freebsd match.

	* configure.tgt: Add sparc-*-freebsd case.
2020-01-15 16:25:10 +10:30
Alan Modra e1c6cf618c PR25384, PowerPC64 ELFv1 copy relocs against function symbols
Function symbols of course don't normally want .dynbss copies but
with some old versions of gcc they are needed to copy the function
descriptor.  This patch restricts the cases where they are useful to
compilers using dot-symbols, and enables the warning regardless of
whether a PLT entry is emitted in the executable.  PLTs in shared
libraries are affected by a .dynbss copy in the executable.

bfd/
	PR 25384
	* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
	(ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
	of function symbols unless dot symbols are present.  Do warn
	whenever one is created, regardles of whether a PLT entry is
	also emitted for the function symbol.
ld/
	* testsuite/ld-powerpc/ambiguousv1b.d: Adjust expected output.
	* testsuite/ld-powerpc/funref.s: Align func_tab.
	* testsuite/ld-powerpc/funref2.s: Likewise.
	* testsuite/ld-powerpc/funv1.s: Add dot symbols.
2020-01-15 12:29:21 +10:30
Tom Tromey ff47f4f06d Fix valgrind error from gdb.decode_line
PR symtab/12535 points out that gdb.decode_line("") will cause a
valgrind report.

I think the empty linespec does not really make sense.  So, this patch
changes gdb.decode_line to treat a whitespace-only linespec the same
as a non-existing argument.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	PR symtab/12535:
	* python/python.c (gdbpy_decode_line): Treat empty string the same
	as no argument.

gdb/testsuite/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	PR symtab/12535:
	* gdb.python/python.exp: Test decode_line with empty string
	argument.

Change-Id: I1d95812b4b7a21d69a3e9afd05b9e3141a931897
2020-01-14 17:57:52 -07:00
GDB Administrator b300843444 Automatic date update in version.in 2020-01-15 00:00:16 +00:00
Tom Tromey 975f45b7e1 Don't link gdb twice against libiberty
I noticed that gdb includes libiberty twice in its link line.  I don't
think there's a need for this, so this patch removes one of the
references.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* Makefile.in (CLIBS): Remove second use of $(LIBIBERTY).

Change-Id: I43bb7100660867081f937c67ea70ff751c62bbfb
2020-01-14 16:25:04 -07:00
Tom Tromey 0454ef42e7 Add gdbsupport check-defines script
This adds a new script that tries to check that none of the support
code uses defines that are not defined by common.m4.  This check is
necessarily inexact, but this script caught all the issues fixed in
the previous patches.

gdbsupport/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Rebuild.
	* Makefile.am (check-defines): New target.
	* check-defines.el: New file.

Change-Id: I59450e91394d5e6a7fa59e9ab53c95843c4bacd9
2020-01-14 16:25:04 -07:00
Tom Tromey 25e5735653 Remove use of <config.h> from gdb/nat/
This removes the use of <config.h> from the files in gdb/nat/.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* nat/linux-btrace.c: Don't include <config.h>.
	* nat/linux-ptrace.c: Don't include <config.h>.
	* nat/x86-linux-dregs.c: Don't include <config.h>.

Change-Id: Ie8c734c54ada848aa020c77ec727704d367eff81
2020-01-14 16:25:04 -07:00
Tom Tromey 05ea2a0510 Move many configure checks to common.m4
This moves many needed configure checks from gdb and gdbserver into
common.m4.  This helps gdbsupport, nat, and target be self-contained.

The result is a bit spaghetti-ish, because gdbsupport uses another m4
file from gdb/.  The resulting code is somewhat non-obvious.  However,
these problems already exist, so it's not really that much worse than
what is already done.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* configure.ac: Move many checks to ../gdbsupport/common.m4.

gdb/gdbserver/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* configure.ac: Remove any checks that were added to common.m4.
	* acinclude.m4: Include lib-ld.m4, lib-prefix.m4, and
	lib-link.m4.

gdbsupport/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* configure, Makefile.in, aclocal.m4, common.m4, config.in:
	Rebuild.
	* common.m4 (GDB_AC_COMMON): Move many checks from
	gdb/configure.ac.
	* acinclude.m4: Include bfd.m4, ptrace.m4.

Change-Id: I931eaa94065df268b30a2f1354390710df89c7f8
2020-01-14 16:25:03 -07:00
Tom Tromey 01027315f5 Move gdbsupport to the top level
This patch moves the gdbsupport directory to the top level.  This is
the next step in the ongoing project to move gdbserver to the top
level.

The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport".

This patch then adds a build system to gdbsupport and wires it into
the top level.  Then it changes gdb to use the top-level build.

gdbserver, on the other hand, is not yet changed.  It still does its
own build of gdbsupport.

ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport.
	* MAINTAINERS: Add gdbsupport.
	* configure: Rebuild.
	* configure.ac (configdirs): Add gdbsupport.
	* gdbsupport: New directory, move from gdb/gdbsupport.
	* Makefile.def (host_modules, dependencies): Add gnulib.
	* Makefile.in: Rebuild.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* nat/x86-linux-dregs.c: Include configh.h.
	* nat/linux-ptrace.c: Include configh.h.
	* nat/linux-btrace.c: Include configh.h.
	* defs.h: Include config.h, bfd.h.
	* configure.ac: Don't source common.host.
	(CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files.
	* configure: Rebuild.
	* acinclude.m4: Update path.
	* Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables.
	(CONFIG_SRC_SUBDIR): Remove gdbsupport.
	(INTERNAL_CFLAGS_BASE): Add INCSUPPORT.
	(CLIBS): Add LIBSUPPORT.
	(CDEPS): Likewise.
	(COMMON_SFILES): Remove gdbsupport files.
	(HFILES_NO_SRCDIR): Likewise.
	(stamp-version): Update path to create-version.sh.
	(ALLDEPFILES): Remove gdbsupport files.

gdb/gdbserver/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* server.h: Include config.h.
	* gdbreplay.c: Include config.h.
	* configure: Rebuild.
	* configure.ac: Don't source common.host.
	* acinclude.m4: Update path.
	* Makefile.in (INCSUPPORT): New variable.
	(INCLUDE_CFLAGS): Add INCSUPPORT.
	(SFILES): Update paths.
	(version-generated.c): Update path to create-version.sh.
	(gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths.

gdbsupport/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* common-defs.h: Add GDBSERVER case.  Update includes.
	* acinclude.m4, aclocal.m4, config.in, configure, configure.ac,
	Makefile.am, Makefile.in, README: New files.
	* Moved from ../gdb/gdbsupport/

Change-Id: I07632e7798635c1bab389bf885971e584fb4bb78
2020-01-14 16:25:02 -07:00
Tom Tromey b2ceabe8f0 Consolidate definition of USE_WIN32API
I noticed that USE_WIN32API is defined separately by gdbserver and
gdb.  However, because it is used by code in gdbsupport, it should be
defined by common.m4.  This approach ensures that the code will
continue to work when it is moved to the top level.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* gdbsupport/common.m4 (GDB_AC_COMMON): Define WIN32APILIBS and
	USE_WIN32API when needed.
	* configure.ac (USE_WIN32API): Don't define.
	(WIN32LIBS): Use WIN32APILIBS.
	* configure: Rebuild.

gdb/gdbserver/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* configure.ac (LIBS): Use WIN32APILIBS.
	(USE_WIN32API): Don't define.
	* configure: Rebuild.

Change-Id: I40d524d5445ebfb452b36f4d0e102f0b1e1089df
2020-01-14 16:25:02 -07:00
Tom Tromey 25c51f71d5 Fix indentation in common.m4
Simon pointed out that the indentation in common.m4 is off.  This
patch fixes the problem.

gdb/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* gdbsupport/common.m4 (GDB_AC_COMMON): Fix indentation.

gdb/gdbserver/ChangeLog
2020-01-14  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

Change-Id: I6a629bd5873cca95ba3e17656f0d0ce583a08361
2020-01-14 16:16:39 -07:00
Bernd Edlinger 717c684dd1 Make skip without argument skip the current inline function
Previously always the outermost function block was used, but
since skip is now able to skip over inline functions it is more
natural to skip the inline function that the program is currently
executing.

gdb:
2020-01-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* skip.c (skip_function_command): Make skip w/o arguments use the
	name of the inlined function if pc is inside any inlined function.

gdb/testsuite:
2020-01-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* gdb.base/skip-inline.exp: Extend test.
2020-01-14 21:20:16 +01:00
Lili Cui e44925ae56 x86: Updated align branch tests for Darwin and i686-pc-elf
1. Update align branch assembler tests to match Darwin disassembler
outputs.
2. Skip unsupported "call *foo" tests in 64-bit mode on Darwin.
3. Update align branch linker test to match any addresses for i686-pc-elf.

gas/

	* testsuite/gas/i386/align-branch-1a.d: Updated for Darwin.
	* testsuite/gas/i386/align-branch-1b.d: Likewise.
	* testsuite/gas/i386/align-branch-1c.d: Likewise.
	* testsuite/gas/i386/align-branch-1d.d: Likewise.
	* testsuite/gas/i386/align-branch-1e.d: Likewise.
	* testsuite/gas/i386/align-branch-1f.d: Likewise.
	* testsuite/gas/i386/align-branch-1g.d: Likewise.
	* testsuite/gas/i386/align-branch-1h.d: Likewise.
	* testsuite/gas/i386/align-branch-1i.d: Likewise.
	* testsuite/gas/i386/align-branch-5.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1a.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1b.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1c.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1d.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1e.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1f.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1g.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1h.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-1i.d: Likewise.
	* testsuite/gas/i386/x86-64-align-branch-5.d: Likewise.
	* testsuite/gas/i386/i386.exp: Skip x86-64-align-branch-2a,
	x86-64-align-branch-2b and x86-64-align-branch-2c on Darwin.

ld/

	* testsuite/ld-i386/align-branch-1.d: Updated for i686-pc-elf.
2020-01-14 08:59:37 -08:00
Luis Machado 7da6a5b938 Fix/Update misc comments
While doing some investigation of mine, i noticed a few typos,
inaccuracies and missing information.

I went ahead and updated/improved those.

gdb/ChangeLog:

2020-01-14  Luis Machado  <luis.machado@linaro.org>

	* inf-ptrace.c (inf_ptrace_target::resume): Update comments.
	* infrun.c (resume_1): Likewise.
	(handle_inferior_event): Remove stale comment.
	* linux-nat.c (linux_nat_target::resume): Update comments.
	(save_stop_reason): Likewise.
	(linux_nat_filter_event): Likewise.
	* linux-nat.h (struct lwp_info) <stop_pc>, <stop_reason>: Likewise.
2020-01-14 11:17:26 -03:00
Sergey Belyashov 7a6bf3becb Fix various assembler testsuite failures for the Z80 target.
PR 25377
gas	* config/tc-z80.c: Add support for half precision, single
	precision and double precision floating point values.
	* config/tc-z80.h b/gas/config/tc-z80.h: Disable string escapes.
	* doc/as.texi: Add new z80 command line options.
	* doc/c-z80.texi: Document new z80 command line options.
	* testsuite/gas/z80/ez80_pref_dis.s: New test.
	* testsuite/gas/z80/ez80_pref_dis.d: New test driver.
	* testsuite/gas/z80/z80.exp: Run the new test.
	* testsuite/gas/z80/fp_math48.d: Use correct command line option.
	* testsuite/gas/z80/fp_zeda32.d: Likewise.
	* testsuite/gas/z80/strings.d: Update expected output.

opcodes	* z80-dis.c (suffix): Use .db instruction to generate double
	prefix.
2020-01-14 13:13:57 +00:00
Alan Modra ef4e5ba50c som: Don't loop forever reading symbol chains
* som.c (som_bfd_count_ar_symbols): Error when file position
	of symbols on chains is not strictly increasing.
2020-01-14 11:02:37 +10:30
Alan Modra 8ab484c23b ubsan: alpha-vms: segv
I thought the fuzzers were really going overboard by defining
VMS_DEBUG but that wasn't the case.  VMS_DEBUG is defined by
default.  Let's not do that, and fix the segv as well.

	* vms.h (VMS_DEBUG): Define as 0.
	* vms-alpha.c (image_write): Move debug output after bounds check.
	Tidy bounds check.
	(_bfd_vms_slurp_eihd): Warning fix.
	(_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2020-01-14 11:02:28 +10:30
Alan Modra ca1eaac0ed ubsan: z8k: left shift cannot be represented in type 'int'
* z8k-dis.c (unpack_instr): Formatting.  Cast unsigned short
	values to unsigned before shifting.
2020-01-14 10:57:52 +10:30
GDB Administrator b959e62a55 Automatic date update in version.in 2020-01-14 00:00:28 +00:00
Andrew Burgess 44e4c7757a gdb: Handle malformed ELF, symbols in non-allocatable sections
I ended up debugging a malformed ELF where a section containing
executable code was not correctly marked as allocatable.  Before
realising the ELF was corrupted I tried to place a breakpoint on a
symbol in the non-allocatable, executable section, and GDB crashed.

Though trying to debug such an ELF clearly isn't going to go well I
would prefer, as far as possible, that any input, no matter how
corrupted, not crash GDB.

The crash occurs when trying to set a breakpoint on the name of a
function from the corrupted section.  GDB converts the symbol to a
symtab_and_line, and looks up a suitable section for this.

The problem is that the section is actually an obj_section, which is
stored in the table within the objfile, and we only initialise this
table for allocatable sections (see add_to_objfile_sections_full in
objfiles.c).  So, if the symbol is in a non-allocatable section then
we end up referencing an uninitialised obj_section.

Later we call get_sal_arch on the symtab_and_line, which calls
get_objfile_arch, which uses the objfile from the uninitialised
obj_section, which will be nullptr, at which point GDB crashes.

The fix I propose here is that when we setup the section references on
msymbols, we should check if the bfd_section being referenced is
allocatable or not.  If it is not then we should set the section
reference back to the default 0 section (see how MSYMBOL_OBJ_SECTION
and SYMBOL_OBJ_SECTION treat the 0 section index).

With this fix in place GDB no longer crashes.  Instead GDB creates the
breakpoint at the non-allocated address, and then fails, with an
error, when it tries to insert the breakpoint.

gdb/ChangeLog:

	* elfread.c (record_minimal_symbol): Set section index to 0 for
	non-allocatable sections.

gdb/testsuite/ChangeLog:

	* gdb.dwarf2/dw2-bad-elf-other.S: New file.
	* gdb.dwarf2/dw2-bad-elf.c: New file.
	* gdb.dwarf2/dw2-bad-elf.exp: New file.

Change-Id: Ie05436ab4c6a71440304d20ee639dfb021223f8b
2020-01-13 23:57:42 +00:00
Andrew Burgess d93c6db74b gdb/testsuite: Allow DWARF assembler to create multiple line tables
Fixes a bug in the DWARF assembler that prevents multiple line tables
from being created in a test.  We currently don't initialise a couple
of flags, as a result we will only ever generate one end of file list,
and one end of header, in the first line table.  Any additional line
tables will be missing these parts, and will therefore be corrupt.

This fix will be required for a later commit.  There should be no
change in the testsuite after this commit.

gdb/testsuite/ChangeLog:

	* lib/dwarf.exp (Dwarf::lines): Reset _line_saw_program and
	_line_saw_file.

Change-Id: Id7123f217a036f26ee32d608db3064dd43164596
2020-01-13 23:56:02 +00:00
Ali Tamur 18a8505e38 Dwarf 5: Handle debug_str_offsets and indexed attributes that have base offsets.
* Process debug_str_offsets section. Handle DW_AT_str_offsets_base attribute and
keep the value in dwarf2_cu.

* Make addr_base field in dwarf2_cu optional to disambiguate 0 value
(absent or present and 0).

* During parsing, there is no guarantee that DW_AT_str_offsets_base and
DW_AT_rnglists_base fields will be processed before the attributes that need
those values for correct computation. So make two passes, on the first one mark
the attributes that depend on *_base attributes and process only the others.
On the second pass, only process the attributes that are marked on the first
pass.

* For string attributes, differentiate between addresses that directly point to
a string and those that point to an offset in debug_str_offsets section.

* There are now two attributes, DW_AT_addr_base and DW_AT_GNU_addr_base to read
address offset base. Likewise, there are two attributes, DW_AT_rnglists_base
and DW_AT_GNU_ranges_base to read ranges base. Since there is no guarantee which
ones the compiler will generate, create helper functions to handle all cases.

Tested with CC=/usr/bin/gcc (version 8.3.0) against master branch (also with
-gsplit-dwarf and -gdwarf-4 flags) and there was no increase in the set of
tests that fails. (gdb still cannot debug a 'hello world' program with DWARF 5,
so for the time being, this is all we care about).

This is part of an effort to support DWARF-5 in gdb.
2020-01-13 15:35:35 -08:00
Simon Marchi 0cac9354bf gdb: use gdb::byte_vector instead of std::vector<char> in core_target::get_core_register_section
Since the data held by the `contents` variable is arbitrary binary data,
it should have gdb_byte elements, not char elements.  Also, using
gdb::byte_vector is preferable, since it doesn't unnecessarily
zero-initialize the values.

Instead of adding a cast in the call to m_core_vec->core_read_registers,
I have changed core_read_registers' argument to be a gdb_byte* instead
of a char*.

gdb/ChangeLog:

	* gdbcore.h (struct core_fns) <core_read_registers>: Change
	core_reg_sect type to gdb_byte *.
	* arm-nbsd-nat.c (fetch_elfcore_registers): Likewise.
	* cris-tdep.c (fetch_core_registers): Likewise.
	* corelow.c (core_target::get_core_register_section): Change
	type of `contents` to gdb::byte_vector.
2020-01-13 18:12:08 -05:00
Andrew Burgess 9a6d629ccf gdb/tui: Place window titles in the center of the border
In tui-wingeneral.c:box_win () a comment suggest we should display
titles like this:

  +-WINDOW TITLE GOES HERE-+

However, we actually display them like this:

  +--WINDOW TITLE GOES HERE+

The former seems nicer to me, so that's what this commit does.  Short
titles will appear as:

  +-SHORT TITLE------------+

We previously didn't test the horizontal windows borders in the test
suite, however, I've updated things so that we do now check for the
'+-' and '-+' on the upper border, this will give us some protection.

gdb/ChangeLog:

	* tui/tui-wingeneral.c (box_win): Position the title in the center
	of the border.

gdb/testsuite/ChangeLog:

	* lib/tuiterm.exp (Term::_check_box): Check some parts of the top
	border.

Change-Id: Iead6910e3b4e68bdf6871f861f23d2efd699faf0
2020-01-13 22:56:48 +00:00
Simon Marchi d8b2f9e333 gdb: use std::vector instead of alloca in core_target::get_core_register_section
As I was trying to compile gdb for an m68k host, I got this error:

  CXX    corelow.o
In file included from /binutils-gdb/gdb/gdbsupport/common-defs.h:120,
                 from /binutils-gdb/gdb/defs.h:28,
                 from /binutils-gdb/gdb/corelow.c:20:
/binutils-gdb/gdb/corelow.c: In member function 'void core_target::get_core_register_section(regcache*, const regset*, const char*, int, int, const char*, bool)':
/binutils-gdb/gdb/../include/libiberty.h:727:36: error: 'alloca' bound is unknown [-Werror=alloca-larger-than=]
  727 | # define alloca(x) __builtin_alloca(x)
      |                    ~~~~~~~~~~~~~~~~^~~
/binutils-gdb/gdb/corelow.c:625:23: note: in expansion of macro 'alloca'
  625 |   contents = (char *) alloca (size);
      |                       ^~~~~~

We are using alloca to hold the contents of a the core register
sections.  These sections are typically fairly small, but there is no
realy guarantee, so I think it would be more reasonable to just use
dynamic allocation here.

gdb/ChangeLog:

	* corelow.c (core_target::get_core_register_section): Use
	  std::vector instead of alloca.
2020-01-13 14:33:19 -05:00
Simon Marchi c0bd321d77 gdbserver: remove rule for files from regformats/i386
The dat files in regformats/i386 were removed a while ago, this rule is
no longer necessary.

gdb/gdbserver/ChangeLog:

	* Makefile.in (%-generated.c): Remove rule for files from
	regformats/i386.
2020-01-13 14:19:05 -05:00
Simon Marchi bb564c588d Enable -Wmissing-declarations diagnostic
Now that most warnings of this kind are fixed, we can enable
-Wmissing-declarations.  I say "most", because it is likely that there
are some more in some configurations I am not able to build, but they
should be pretty easy to fix.

gdb/ChangeLog:

	* warning.m4: Add -Wmissing-declarations to build_warnings.
	* configure: Re-generate.

gdb/gdbserver/ChangeLog:

	* configure: Re-generate.

Change-Id: Iae9b59f22eb5dd1965d09f34c5c9e212cddf67ba
2020-01-13 14:06:09 -05:00
Simon Marchi 6e37c371af gdbserver: set IP_AGENT_EXPORT_FUNC to static when not building IPA, add declarations
Fixing the -Wmissing-declarations errors in gdbserver's tracepoint.c is
a bit tricky, because some functions are compiled for both gdbserver, in
which case they should be static, since they are only used in that file,
and for libinproctrace.so, in which case they should be externally
visible, since they need to be looked up.  In the case where they are
externally visible, -Wmissing-declarations requires that a declaration
exists (that's the point of the warning).

I've reused the IP_AGENT_EXPORT_FUNC macro to mark the functions as
static when compiled for gdbserver.  Some seemingly unnecessary
declarations are added for when compiling libinproctrace.so (thanks to
Tom for the suggestion).

gdb/gdbserver/ChangeLog:

	* tracepoint.h (IP_AGENT_EXPORT_FUNC) [!IN_PROCESS_AGENT]:
	Define to static.
	* tracepoint.c (stop_tracing, flush_trace_buffer,
	about_to_request_buffer_space, get_trace_state_variable_value,
	set_trace_state_variable_value, gdb_collect): Add declaration.

Change-Id: If9c66151bd00c3b9c5caa27a7c21c5a3a952de2a
2020-01-13 14:05:32 -05:00
Simon Marchi df4a0200dc gdbserver: make some functions static in linux-x86-low.c
These functions are only used in this file, so should be static.

gdb/gdbserver/ChangeLog:

	* linux-x86-low.c (x86_linux_regs_info, amd64_emit_eq_goto,
	amd64_emit_ne_goto, amd64_emit_lt_goto, amd64_emit_le_goto,
	amd64_emit_gt_goto, amd64_emit_ge_goto, amd64_emit_ge_goto,
	i386_emit_eq_goto, i386_emit_ne_goto, i386_emit_lt_goto,
	i386_emit_le_goto, i386_emit_gt_goto, i386_emit_ge_goto): Make
	static.

Change-Id: I703da41867735aefadd49140e80cd60f6ab9ad39
2020-01-13 14:04:53 -05:00
Simon Marchi 89e94ec9af gdbserver: include gdbsupport/common-inferior.h in inferiors.c
So that the definitions of get_inferior_cwd/set_inferior_cwd see their
declarations.

      CXX    inferiors.o
    /home/smarchi/src/binutils-gdb/gdb/gdbserver/inferiors.c: In function ‘const char* get_inferior_cwd()’:
    /home/smarchi/src/binutils-gdb/gdb/gdbserver/inferiors.c:228:1: error: no previous declaration for ‘const char* get_inferior_cwd()’ [-Werror=missing-declarations]
     get_inferior_cwd ()
     ^~~~~~~~~~~~~~~~
    /home/smarchi/src/binutils-gdb/gdb/gdbserver/inferiors.c: In function ‘void set_inferior_cwd(const char*)’:
    /home/smarchi/src/binutils-gdb/gdb/gdbserver/inferiors.c:236:1: error: no previous declaration for ‘void set_inferior_cwd(const char*)’ [-Werror=missing-declarations]
     set_inferior_cwd (const char *cwd)
     ^~~~~~~~~~~~~~~~

gdb/gdbserver/ChangeLog:

	* inferiors.c: Include gdbsupport/common-inferior.h.

Change-Id: Iae5ccb3e1dc37ce79f03f08465f603a0411e7af0
2020-01-13 14:03:18 -05:00