Commit Graph

108830 Commits

Author SHA1 Message Date
Nick Clifton
5fe73d4624 Update Bulgarian, French, Romaniam and Ukranian translation for some of the sub-directories 2022-01-24 14:22:49 +00:00
GDB Administrator
2b1ca85cf8 Automatic date update in version.in 2022-01-24 00:00:15 +00:00
Tom Tromey
f10522c0e7 Simplify some Rust expression-evaluation code
A few Rust operations do a bit of work in their 'evaluate' functions
and then call another function -- but are also the only caller.  This
patch simplifies this code by removing the extra layer.

Tested on x86-64 Fedora 34.  I'm checking this in.
2022-01-23 12:52:44 -07:00
H.J. Lu
451c003d5f bfd: Partially revert commit 0e3839bde6
Partially revert

commit 0e3839bde6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jan 23 07:29:27 2022 -0800

    bfd: Properly install library and header files

	PR binutils/28807
	* Makefile.am: Revert bfdlib_LTLIBRARIES and bfdinclude_HEADERS
	changes.
	* Makefile.in: Regenerate.
2022-01-23 10:40:46 -08:00
H.J. Lu
0e3839bde6 bfd: Properly install library and header files
Rename bfdlib_LTLIBRARIES and bfdinclude_HEADERS to lib_LTLIBRARIES and
include_HEADERS to fix the missing installed library and header files in
bfd caused by

commit bd32be01c9
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Fri Dec 3 00:23:20 2021 -0500

    bfd: merge doc subdir up a level

	PR binutils/28807
	* Makefile.am (bfdlib_LTLIBRARIES): Renamed to ...
	(lib_LTLIBRARIES): This.
	(bfdinclude_HEADERS): Renamed to ...
	(include_HEADERS): This.
	* Makefile.in: Regenerate.
	* doc/local.mk (install): Removed.
2022-01-23 07:29:27 -08:00
H.J. Lu
ad69b6b861 Regenerate Makefile.in files with automake 1.15.1
Regenerate Makefile.in files with the unmodified automake 1.15.1 to
remove

runstatedir = @runstatedir@

bfd/

	* Makefile.in: Regenerate.

binutils/

	* Makefile.in: Regenerate.

gas/

	* Makefile.in: Regenerate.

gold/

	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Likewise.

gprof/

	* Makefile.in: Regenerate.

ld/

	* Makefile.in: Regenerate.

opcodes/

	* Makefile.in: Regenerate.
2022-01-23 06:59:20 -08:00
H.J. Lu
31b0378d53 Regenerate configure files with autoconf 2.69
Regenerate configure files with the unmodified autoconf 2.69 to remove

  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]

bfd/

	* configure: Regenerate.

binutils/

	* configure: Regenerate.

gas/

	* configure: Regenerate.

gold/

	* configure: Regenerate.

gprof/

	* configure: Regenerate.

ld/

	* configure: Regenerate.

opcodes/

	* configure: Regenerate.
2022-01-23 05:27:01 -08:00
GDB Administrator
35638469cb Automatic date update in version.in 2022-01-23 00:00:12 +00:00
Mike Frysinger
bd32be01c9 bfd: merge doc subdir up a level
This avoids a recursive make into the doc subdir and speeds up the
build slightly.  It also allows for more parallelism.
2022-01-22 16:47:35 -05:00
Mike Frysinger
cb803d3749 bfd: rename core.texi to corefile.texi
This is a generated file name from a correspondingly named C file.
Rename it to avoid unique build rules since there's no difference
to the generated manual.
2022-01-22 16:07:16 -05:00
Mike Frysinger
3dd8e5b615 bfd: replace doc header generation with pattern rules
This unifies boilerplate rules for most files with pattern rules.
2022-01-22 16:06:53 -05:00
Martin Storsj?
58de646be2 Allow inferring tmp_prefix from the dll name from a def file. 2022-01-22 14:31:22 +00:00
Alexander von Gluck IV
cc5e40736d Adjust default page sizes for haiku arm.
* configure.tgt (arm-haiku): Fix typo.
	* emulparams/armelf_haiku.su (MAXPAGESIZE): Use the default value.
	(COMMONPAGESIZE): Likewise.
2022-01-22 14:18:34 +00:00
Nick Clifton
5f7a57f131 Update release makeing script with new release numbers 2022-01-22 13:26:54 +00:00
Nick Clifton
f908e960c5 Change version number to 2.38.50 and regenerate files 2022-01-22 12:39:28 +00:00
Nick Clifton
a74e1cb344 Add markers for 2.38 branch 2022-01-22 12:08:55 +00:00
Lifang Xia
cb2562f553 RISC-V: create new frag after alignment.
PR 28793:

The alignment may be removed in linker. We need to create new frag after
alignment to prevent the assembler from computing static offsets.

gas/
	* config/tc-riscv.c (riscv_frag_align_code): Create new frag.
2022-01-22 17:20:18 +08:00
GDB Administrator
5b4ea8a740 Automatic date update in version.in 2022-01-22 00:00:12 +00:00
Simon Marchi
ed09c325ec gdb: include gdbsupport/buildargv.h in ser-mingw.c
Fixes:

      CXX    ser-mingw.o
    /home/simark/src/binutils-gdb/gdb/ser-mingw.c: In function ‘int pipe_windows_open(serial*, const char*)’:
    /home/simark/src/binutils-gdb/gdb/ser-mingw.c:870:3: error: ‘gdb_argv’ was not declared in this scope
      870 |   gdb_argv argv (name);
          |   ^~~~~~~~

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28802
Change-Id: I7f3e8ec5f9ca8582d587545fdf6b69901259f199
2022-01-21 11:34:30 -05:00
Nick Clifton
e901223d53 Updated Serbian translation for the ld sub-directory 2022-01-21 15:42:18 +00:00
Andrew Burgess
b13d7831eb gdb/doc: fill in two missing @r
I noticed two places in the docs where we appear to be missing @r.
makeinfo seems to do the correct things despite these being
missing (at least, I couldn't see any difference in the pdf or info
output), but it doesn't hurt to have the @r in place.
2022-01-21 12:49:48 +00:00
Mike Frysinger
ec7194506d drop old unused stamp-h.in file
This was needed by ancient versions of automake, but that hasn't been
the case since at least automake-1.5, so punt this from the tree.
2022-01-21 03:11:47 -05:00
Simon Marchi
7bf5587873 gdbsupport/gdb_regex.cc: replace defs.h include with common-defs.h
This was forgotten when gdb_regex was moved from gdb to gdbsupport.

Change-Id: I73b446f71861cabbf7afdb7408ef9d59fa64b804
2022-01-20 22:58:21 -05:00
GDB Administrator
df9d50bb22 Automatic date update in version.in 2022-01-21 00:00:15 +00:00
Tom Tromey
6d263fe46e Avoid bad breakpoints with --gc-sections
We found a case where --gc-sections can cause gdb to set an invalid
breakpoint.  In the included test case, gdb will set a breakpoint with
two locations, one of which is 0x0.

The code in lnp_state_machine::check_line_address is intended to
filter out this sort of problem, but in this case, the entire CU is
empty, causing unrelocated_lowpc==0x0 -- which circumvents the check.

It seems to me that if a CU is empty like this, then it is ok to
simply ignore the line table, as there won't be any locations anyway.
2022-01-20 07:22:23 -07:00
GDB Administrator
dd8a5a84a7 Automatic date update in version.in 2022-01-20 00:00:18 +00:00
Maciej W. Rozycki
101d68a9fa Add `set print array-indexes' tests for C/C++ arrays
Add `set print array-indexes' tests for C/C++ arrays, complementing one
for Fortran arrays.
2022-01-19 21:55:10 +00:00
Maciej W. Rozycki
5d4c63a635 Respect `set print array-indexes' with Fortran arrays
Add `set print array-indexes' handling for Fortran arrays.  Currently
the setting is ignored and indices are never shown.

Keep track of the most recent index handled so that any outstanding
repeated elements printed when the limit set by `set print elements' is
hit have the correct index shown.

Output now looks like:

(gdb) set print array-indexes on
(gdb) print array_1d
$1 = ((-2) = 1, (-1) = 1, (0) = 1, (1) = 1, (2) = 1)
(gdb) set print repeats 4
(gdb) set print elements 12
(gdb) print array_2d
$2 = ((-2) = ((-2) = 2, <repeats 5 times>) (-1) = ((-2) = 2, <repeats 5 times>) (0) = ((-2) = 2, (-1) = 2, ...) ...)
(gdb)

for a 5-element vector and a 5 by 5 array filled with the value of 2.
2022-01-19 21:55:10 +00:00
Maciej W. Rozycki
6b4338c868 Add `set print repeats' tests for C/C++ arrays
Add `set print repeats' tests for C/C++ arrays, complementing one for
Fortran arrays and covering the different interpretation of the `set
print elements' setting in particular where the per-dimension count of
the elements handled is matched against the trigger rather than the
total element count as with Fortran arrays.
2022-01-19 21:55:10 +00:00
Maciej W. Rozycki
476f77a94c Respect `set print repeats' with Fortran arrays
Implement `set print repeats' handling for Fortran arrays.  Currently
the setting is ignored and always treated as if no limit was set.

Unlike the generic array walker implemented decades ago the Fortran one
is a proper C++ class.  Rather than trying to mimic the old walker then,
which turned out a bit of a challenge where interacting with the `set
print elements' setting, write it entirely from scratch, by adding an
extra specialization handler method for processing dimensions other than
the innermost one and letting the specialization class call the `walk_1'
method from the handler as it sees fit.  This way repeats can be tracked
and the next inner dimension recursed into as a need arises only, or
unconditionally in the base class.

Keep track of the dimension number being handled in the class rather as
a parameter to the walker so that it does not have to be passed across
by the specialization class.

Use per-dimension element count tracking, needed to terminate processing
early when the limit set by `set print elements' is hit.  This requires
extra care too where the limit triggers exactly where another element
that is a subarray begins.  In that case rather than recursing we need
to terminate processing or lone `(...)' would be printed.  Additionally
if the skipped element is the last one in the current dimension we need
to print `...' by hand, because `continue_walking' won't print it at the
upper level, because it can see the last element has already been taken
care of.

Preserve the existing semantics of `set print elements' where the total
count of the elements handled is matched against the trigger level which
is unlike with the C/C++ array printer where the per-dimension element
count is used instead.

Output now looks like:

(gdb) set print repeats 4
(gdb) print array_2d
$1 = ((2, <repeats 5 times>) <repeats 5 times>)
(gdb) set print elements 12
(gdb) print array_2d
$2 = ((2, <repeats 5 times>) (2, <repeats 5 times>) (2, 2, ...) ...)
(gdb)

for a 5 by 5 array filled with the value of 2.

Amend existing test cases accordingly that rely on the current incorrect
behavior and explicitly request that there be no limit for printing
repeated elements there.

Add suitable test cases as well covering sliced arrays in particular.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>
2022-01-19 21:55:10 +00:00
John Baldwin
2ddd4c6082 fbsd-nat: Add include for gdb_argv. 2022-01-19 08:30:38 -08:00
Alan Modra
8ffb6df2aa PowerPC64 DT_RELR ELFv1
More fun with R_PPC64_NONE found in .opd.  Fixed by the
allocate_dynrelocs and ppc64_elf_size_dynamic_sections changes, and
since we are doing ifunc, opd and SYMBOL_REFERENCES_LOCAL tests later,
don't duplicate that work in check_relocs.

	* elf64-ppc.c (ppc64_elf_check_relocs): Remove opd and ifunc
	conditions for rel_count.
	(dec_dynrel_count): Likewise.
	(allocate_dynrelocs): Test for opd and ifunc when allocating
	relative relocs.
	(ppc64_elf_size_dynamic_sections): Likewise.
2022-01-19 16:45:45 +10:30
Alan Modra
edca615ac1 PowerPC64 DT_RELR local PLT
Similarly to the local GOT case.

	* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
	space for PLT relocs against local syms when enable_dt_relr.
2022-01-19 16:45:45 +10:30
Alan Modra
8f22c9532b PowerPC64 DT_RELR local GOT
Fixes another case where we end up with superfluous R_PPC64_NONE.

	* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
	space for GOT relocs against non-TLS local syms when enable_dt_relr.
	(ppc64_elf_layout_multitoc): Likewise.
2022-01-19 16:45:45 +10:30
GDB Administrator
05900cefe2 Automatic date update in version.in 2022-01-19 00:00:10 +00:00
Alan Modra
858b0eff3c Re: PowerPC64 DT_RELR
HJ: "There are 238 R_PPC64_NONEs in libc.so.6 alone."
Indeed, let's make them go away.  I had the SYMBOL_REFERENCES_LOCAL
test in the wrong place.  check_relocs is too early to know whether a
symbol is dynamic in a shared library.  Lots of glibc symbols are made
local by version script, but that doesn't happen until
size_dynamic_sections.

	* elf64-ppc.c (ppc64_elf_check_relocs): Don't count relative relocs
	here depending on SYMBOL_REFERENCES_LOCAL.
	(dec_dynrel_count): Likewise.
	(allocate_dynrelocs): Do so here instead.
2022-01-19 09:44:15 +10:30
Tom Tromey
72a52f2a86 Fix the remote-sim.c build
My earlier patch to move gdb_argv broke the remote-sim.c build.  This
patch fixes the bug.  I'm checking it in.
2022-01-18 14:12:23 -07:00
Simon Marchi
91f94053dd gdbserver: introduce remote_debug_printf
Add remote_debug_printf, and use it for all debug messages controlled by
remote_debug.

Change remote_debug to be a bool, which is trivial in this case.

Change-Id: I90de13cb892faec3830047b571661822b126d6e8
2022-01-18 13:44:38 -05:00
Simon Marchi
c058728c31 gdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXIT
Add the threads_debug_printf and THREADS_SCOPED_DEBUG_ENTER_EXIT, which
use the logging infrastructure from gdbsupport/common-debug.h.  Replace
all debug_print uses that are predicated by debug_threads with
threads_dethreads_debug_printf.  Replace uses of the debug_enter and
debug_exit macros with THREADS_SCOPED_DEBUG_ENTER_EXIT, which serves
essentially the same purpose, but allows showing what comes between the
enter and the exit in an indented form.

Note that "threads" debug is currently used for a bit of everything in
GDBserver, not only threads related stuff.  It should ideally be cleaned
up and separated logically as is done in GDB, but that's out of the
scope of this patch.

Change-Id: I2d4546464462cb4c16f7f1168c5cec5a89f2289a
2022-01-18 13:44:32 -05:00
Simon Marchi
c68665c726 gdbserver: turn debug_threads into a boolean
debug_threads is always used as a boolean.  Except in ax.cc and
tracepoint.cc.  These files have their own macros that use
debug_threads, and have a concept of verbosity level.  But they both
have a single level, so it's just a boolean in the end.

Remove this concept of level.  If we ever want to re-introduce it, I
think it will be better implemented in a more common location.

Change debug_threads to bool and adjust some users that were treating it
as an int.

Change-Id: I137f596eaf763a08c977dd74417969cedfee9ecf
2022-01-18 13:44:32 -05:00
Tom Tromey
d66beefaf6 Simplify Ada catchpoints
All the Ada catchpoints use the same breakpoint_ops contents, because
the catchpoint itself records its kind.  This patch simplifies the
code by removing the redundant ops structures.
2022-01-18 10:34:05 -07:00
Tom Tromey
de8e4cb3af Move "catch exec" to a new file
The "catch exec" code is reasonably self-contained, and so this patch
moves it out of breakpoint.c (the second largest source file in gdb)
and into a new file, break-catch-exec.c.
2022-01-18 10:34:05 -07:00
Tom Tromey
064f3c6a01 Move "catch fork" to a new file
The "catch fork" code is reasonably self-contained, and so this patch
moves it out of breakpoint.c (the second largest source file in gdb)
and into a new file, break-catch-fork.c.
2022-01-18 10:34:05 -07:00
Tom Tromey
59505f2cec Unify "catch fork" and "catch vfork"
I noticed that "catch fork" and "catch vfork" are nearly identical.
This patch simplifies the code by unifying these two cases.
2022-01-18 10:34:05 -07:00
Tom Tromey
d322d6d69d Move gdb_regex to gdbsupport
This moves the gdb_regex convenience class to gdbsupport.
2022-01-18 10:14:43 -07:00
Tom Tromey
0589ca4e7b Introduce gdb-hashtab module in gdbsupport
gdb has some extensions and helpers for working with the libiberty
hash table.  This patch consolidates these and moves them to
gdbsupport.
2022-01-18 10:14:43 -07:00
Tom Tromey
bf31fd38f0 Move gdb obstack code to gdbsupport
This moves the gdb-specific obstack code -- both extensions like
obconcat and obstack_strdup, and things like auto_obstack -- to
gdbsupport.
2022-01-18 10:14:42 -07:00
Tom Tromey
7904e9613e Move gdb_argv to gdbsupport
This moves the gdb_argv class to a new header in gdbsupport.
2022-01-18 10:14:42 -07:00
Tom Tromey
5947982f1d Simplify event_location_probe
event_location_probe currently stores two strings, but really only
needs one.  This patch simplifies it and removes some unnecessary
copies as well.
2022-01-18 10:01:20 -07:00
Tom Tromey
85e428a69f Use std::string in event_location
This changes event_location to use std::string, removing some manual
memory management, and an unnecessary string copy.
2022-01-18 10:01:19 -07:00