Commit Graph

108850 Commits

Author SHA1 Message Date
Andrew Burgess
8af9b8009b gdb/doc: Remove (...) around guile procedure names in @deffn lines
Most guile procedures in the guile.texi file are defined like:

  @deffn {Scheme Procedure} name arg1 arg2 arg3

But there are two places where we do this:

  @deffn {Scheme Procedure} (name arg1 arg2 arg3)

Notice the added (...).  Though this does represent how a procedure
call is written in scheme, it's not the normal style throughout the
manual.  I also checked the 'info guile' info page to see how they
wrote there declarations, and they use the first style too.

The second style also has the drawback that index entries are added as
'(name', and so they are grouped in the '(' section of the index,
which is not very user friendly.

In this commit I've changed the definitions of make-command and
make-parameter to use the first style.

The procedure declaration lines can get pretty long with all of the
arguments, and this was true for both of the procedures I am changing
in this commit.  I have made use of a trailing '@' to split the deffn
lines, and keep them under 80 characters in the texi source.  This
makes no difference to how the final document looks.

Finally, our current style for keyword arguments, appears to be:

  [#:keyword-name argument-name]

I don't really understand the reason for this, 'info guile' just seems
to use:

  [#:keyword-name]

which seems just as good to me.  But I don't propose to change
that just now.  What I do notice though, is that sometimes, texinfo
will place a line break between the keyword-name and the
argument-name, for example, the pdf of make-command is:

  make-command name [#:invoke invoke] [#:command-class
    command-class] [#:completer-class completer] [#:prefix? prefix] [#:doc
    doc-string]

Notice the line break after '#:command-class' and after '#:doc',
neither of which are ideal.  And so, for the two commands I am
changing in this commit, I have made use of @w{...} to prevent line
breaks between the keyword-name and the argument-name.  Now the pdf
looks like this:

  make-command name [#:invoke invoke]
    [#:command-class command-class] [#:completer-class completer]
    [#:prefix? prefix] [#:doc doc-string]

Which seems much better.  I'll probably update the other deffn lines
at some point.
2022-01-07 14:38:39 +00:00
Pavel Mayorov
0e9f1c04b9 Revert previous delta to debug.c. Replace with patch to reject indirect types that point to indirect types.
PR 28718
	* dwarf.c: Revert previous delta.
	(debug_get_real_type): Reject indirect types that point to
	indirect types.
	(debug_get_type_name, debug_get_type_size, debug_write_type):
	Likewise.
2022-01-07 12:34:37 +00:00
Nelson Chu
aed44286ef RISC-V: Updated the default ISA spec to 20191213.
Update the default ISA spec from 2.2 to 20191213 will change the default
version of i from 2.0 to 2.1.  Since zicsr and zifencei are separated
from i 2.1, users need to add them in the architecture string if they need
fence.i and csr instructions.  Besides, we also allow old ISA spec can
recognize zicsr and zifencei, but we won't output them since they are
already included in the i extension when i's version is less than 2.1.

bfd/
	* elfxx-riscv.c (riscv_parse_add_subset): Allow old ISA spec can
	recognize zicsr and zifencei.
gas/
	* config/tc-riscv.c (DEFAULT_RISCV_ISA_SPEC): Updated to 20191213.
	* testsuite/gas/riscv/csr-version-1p10.d: Added zicsr to -march since
	the default version of i is 2.1.
	* testsuite/gas/riscv/csr-version-1p11.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p12.d: Likewise.
	* testsuite/gas/riscv/csr-version-1p9p1.d: Likewise.
	* testsuite/gas/riscv/option-arch-03.d: Updated i's version to 2.1.
	* testsuite/gas/riscv/option-arch-03.s: Likewise.
ld/
	* testsuite/ld-riscv-elf/call-relax.d: Added zicsr to -march since
	the default version of i is 2.1.
	* testsuite/ld-riscv-elf/attr-merge-arch-01.d: Updated i's version to 2.1.
	* testsuite/ld-riscv-elf/attr-merge-arch-01a.s: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-01b.: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-02a.s: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-02b.s: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-03a.s: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-03b.s: Likewise.
	* testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Added zifencei
	into Tag_RISCV_arch since it is added implied when i's version is
	larger than 2.1.
2022-01-07 18:48:29 +08:00
Alan Modra
6540edd52c Move elf_backend_always_size_sections earlier
* elflink.c (bfd_elf_size_dynamic_sections): Move plt/got init
	earlier and call elf_backend_always_size_sections at the start
	of this function.
2022-01-07 13:46:01 +10:30
GDB Administrator
d794dc3eb4 Automatic date update in version.in 2022-01-07 00:00:18 +00:00
H.J. Lu
ea93a607c6 ldelfgen.c: Add missing newlines when calling einfo
* ldelfgen.c (ldelf_map_segments): Add the missing newline to
	einfo.
2022-01-06 14:52:11 -08:00
Nick Clifton
af4004d1da Fix a stack exhaustion bug parsing malicious STABS format debug information.
PR 28718
	* debug.c (debug_write_type): Allow for malicious recursion via
	indirect debug types.
2022-01-06 16:37:26 +00:00
Richard Sandiford
27297937e0 aarch64: Add support for new SME instructions
This patch adds support for three new SME instructions: ADDSPL,
ADDSVL and RDSVL.  They behave like ADDPL, ADDVL and RDVL, but read
the streaming vector length instead of the current vector length.

opcodes/
	* aarch64-tbl.h (aarch64_opcode_table): Add ADDSPL, ADDSVL and RDSVL.
	* aarch64-dis-2.c: Regenerate.

gas/
	* testsuite/gas/aarch64/sme.s, testsuite/gas/aarch64/sme.d: Add tests
	for ADDSPL, ADDSVL and RDSVL.
2022-01-06 16:22:54 +00:00
Tom Tromey
41e321a897 Use target_announce_detach in more targets
target_announce_detach was added in commit 0f48b757 ("Factor out
"Detaching from program" message printing").  There, Pedro wrote:

    (For now, I left the couple targets that print this a bit differently
    alone.  Maybe this could be further pulled out into infcmd.c.  If we
    did that, and those targets want to continue printing differently,
    this new function could be converted to a target method.)

It seems to me that the differences aren't very big, and in some cases
other targets handled the output a bit more nicely.  In particular,
some targets will print a different message when exec_file==NULL,
rather than printing the same output with an empty string as
exec_file.

This patch incorporates the nicer output into target_announce_detach,
then changes the remaining ports to use this function.
2022-01-06 08:56:20 -07:00
Tom Tromey
bc521517b7 Introduce target_announce_attach
This introduces target_announce_attach, by analog with
target_announce_detach.  Then it converts existing targets to use
this, rather than emitting their own output by hand.
2022-01-06 08:56:20 -07:00
Andrew Burgess
10a85f29c7 gdb: make use add_setshow_prefix_cmd in gnu-nat.c
In gnu-nat.c we currently implement some set/show prefix commands
"manually", that is, we call add_prefix_cmd, and assign a set and show
function to each prefix command.

These set/show functions print an error indicating that the user
didn't type a complete command.

If we instead switch to using add_setshow_prefix_cmd then we can
delete the set/show functions, GDB provides some default functions,
which give a nice help style summary that lists all of the available
sub-commands, along with a one line summary of what each does.

Though this clearly changes the existing behaviour, I think this
change is acceptable as the new behaviour is more inline with other
set/show prefix commands, and the new behaviour is more informative.

This change will conflict with Tom's change here:

  https://sourceware.org/pipermail/gdb-patches/2022-January/184724.html

Where Tom changes the set/show functions that I delete.  My suggestion
is that the set/show functions still be deleted even after Tom's
patch (or instead of Tom's patch).

For testing I've build GDB on GNU/Hurd, and manually tested these
functions.  I did a grep over the testsuite, and don't believe the
existing error messages are being checked for in any tests.
2022-01-06 15:44:50 +00:00
Tom Tromey
390abcd903 Use warning in windows-nat error messages
A warning in windows-nat.c can be converted to use the warning
function.  As a side effect, this arranges for the output to be sent
to gdb_stderr.
2022-01-06 08:37:19 -07:00
Tom Tromey
5bd1d4c158 Clean up some dead code in windows-tdep.c
windows-tdep.c checks the result of xmalloc, which isn't necessary.  I
initially removed this dead check, but then went a bit further and
modified the code so that some "goto"s and explicit memory management
could be removed.  Then, I added a couple of missing bounds checks.

I believe this also fixes a possible bug with a missing 0-termination
of a string.  I am not certain, but that is why I think the existing
code allocates a buffer that is 1 byte too long -- but then it fails
to set this byte to 0.
2022-01-06 08:37:19 -07:00
Tom Tromey
5220f61a22 Avoid crash in language_info
language_info calls:

  show_language_command (NULL, 1, NULL, NULL);

... "knowing" that show_language_command does not use its ui_file
parameter.  However, this was changed in commit 7514a661
("Consistently Use ui_file parameter to show callbacks").

This patch changes language_info to pass a ui_file.

It took a while to write the test -- this function is only called when
'verbose' is on and when switching the "expected" language in auto
mode.
2022-01-06 07:54:30 -07:00
Tom Tromey
d8504344d4 Fix some failures in langs.exp
langs.exp currently has some fails for me because the stack trace
includes full paths to the source files.

    FAIL: gdb.base/langs.exp: up to foo in langs.exp
    FAIL: gdb.base/langs.exp: up to cppsub_ in langs.exp
    FAIL: gdb.base/langs.exp: up to fsub in langs.exp

This fixes the failures by making the filename regexps a bit more lax.
2022-01-06 07:54:30 -07:00
Jan Beulich
ffb864501e x86: drop NoAVX insn attribute
To avoid issues like that addressed by 6e3e5c9e41 ("x86: extend SSE
check to PCLMULQDQ, AES, and GFNI insns"), base the check on opcode
attributes and operand types.
2022-01-06 14:19:56 +01:00
Jan Beulich
f0db6fb6d9 x86: drop NoAVX from POPCNT
With the introduction of CpuPOPCNT the NoAVX attribute has become
meaningless for POPCNT.
2022-01-06 14:19:20 +01:00
Jan Beulich
274be12a22 x86: drop some "comm" template parameters
As already indicated in a remark when introducing these templates, the
"commutative" attribute is ignored for legacy encoding templates. Hence
it is possible to shorten a number of templates by specifying C directly
rather than through a template parameter. I think this helps readability
a bit.
2022-01-06 14:18:54 +01:00
Jan Beulich
edb7c8ec7e x86: templatize FMA insn templates
The operand ordering portion of the mnemonics repeats, causing a flurry
of almost identical templates. Abstract this out.
2022-01-06 14:18:23 +01:00
Jan Beulich
1ef3994a37 x86-64: restrict PC32 -> PLT32 conversion
Neither non-64-bit code nor uses with a non-zero offset from a symbol
should be converted to PLT32, as an eventual PLT entry would not express
what was requested.
2022-01-06 14:17:40 +01:00
Lancelot SIX
1f927a4a28 gdb: Fix copyright year in gdb/testsuite/gdb.base/inferior-clone.exp
I just realized that I forgot to update the year before pushing the
patch that created this file.  Since it landed after the global
copyright year update have been done, this file’s copyright year is
updated.

This patch fixes that.

Change-Id: I280f7d86e02d38425f7afdcf19a1c3500d51c23f
2022-01-06 06:59:25 -05:00
Mike Frysinger
95e40d770e sim: ppc: migrate to standard uintXX_t types
Drop the sim-specific unsignedXX types and move to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:39 -05:00
Mike Frysinger
e4c803f5bb sim: common: migrate to standard uintXX_t types
Drop the sim-specific unsignedXX types and move to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:39 -05:00
Mike Frysinger
9850d2d83e sim: igen: migrate to standard uintXX_t types
Move off the custom local 64-bit types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
b331e677d7 sim: mips: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
2875d098a5 sim: cris: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
1e1e987aed sim: iq2000: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
c50b7c1b74 sim: synacor: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
868b6a9d3b sim: msp430: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
5a33ead2d3 sim: riscv: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
4650ee9378 sim: bfin: migrate to standard uintXX_t types
Move off the sim-specific unsignedXX types and to the standard uintXX_t
types that C11 provides.
2022-01-06 01:17:38 -05:00
Mike Frysinger
39a5fdbc65 sim: testsuite: migrate to standard uintXX_t types
This old code setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.
2022-01-06 01:17:38 -05:00
Mike Frysinger
4a92dedc59 sim: erc32: migrate to standard uintXX_t types
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.
2022-01-06 01:17:38 -05:00
Mike Frysinger
74ccc97820 sim: mn10300: migrate to standard uintXX_t types
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.
2022-01-06 01:17:37 -05:00
Mike Frysinger
436c3d9d7b sim: v850: migrate to standard uintXX_t types
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.
2022-01-06 01:17:37 -05:00
Mike Frysinger
7606e1a390 sim: m68hc11: migrate to standard uintXX_t types
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.

Also migrate off the sim-specific unsignedXX types.
2022-01-06 01:17:37 -05:00
Mike Frysinger
eae126cb7e sim: d10v: migrate to standard uintXX_t types
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.

Also migrate off the sim-specific unsignedXX types.
2022-01-06 01:17:37 -05:00
Mike Frysinger
32267d593a sim: cr16: migrate to standard uintXX_t types
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.

Also migrate off the sim-specific unsignedXX types.
2022-01-06 01:17:37 -05:00
GDB Administrator
f9f4242296 Automatic date update in version.in 2022-01-06 00:00:14 +00:00
H.J. Lu
bbdeb108d8 x86: Add elf_x86_allocate_local_got_info
Add elf_x86_allocate_local_got_info to allocate x86 GOT info for local
symbols.

	* elf32-i386.c (elf_i386_check_relocs): Call
	elf_x86_allocate_local_got_info.
	* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
	* elfxx-x86.h (elf_x86_allocate_local_got_info): New.
2022-01-05 13:22:31 -08:00
Vladimir Mezentsev
39fb369834 opcodes: Make i386-dis.c thread-safe
Improve thread safety in print_insn_i386_att, print_insn_i386_intel and
print_insn_i386 by removing the use of static variables.

Tested on x86_64-pc-linux-gnu.

2022-01-04 Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* i386-dis.c: Make print_insn_i386_att, print_insn_i386_intel
	and print_insn_i386 thread-safe
2022-01-05 12:12:40 -08:00
H.J. Lu
8acecab0b0 doc: Replace =frame-interp with =frames-interp
The actual objdump and readelf option name is =frames-interp, not
=frames-interp.

	PR binutils/28747
	* doc/debug.options.texi: Replace =frame-interp with
	=frames-interp.
2022-01-05 11:51:40 -08:00
Tom Tromey
d4be21dce7 Change riscv_return_value to use RETURN_VALUE_ABI_PRESERVES_ADDRESS
Internally, AdaCore has a test that is equivalent to (really a direct
translation of) gdb.base/gnu_vector.exp.  On 32-bit RISC-V, the
"return" part of this test fails.

Joel tracked this down to riscv_return_value returning
RETURN_VALUE_ABI_RETURNS_ADDRESS.  Using
RETURN_VALUE_ABI_PRESERVES_ADDRESS is more correct here, and fixes the
bug.

I tested this for both 32- and 64-bit RISC-V using the AdaCore
internal test suite, and Andrew Burgess tested it using
gnu_vector.exp.
2022-01-05 12:35:42 -07:00
Tom Tromey
729a211143 Filtered output cleanup in expression dumping
Most of the expression-dumping code uses filtered output, but a few
functions did not.  This patch cleans up these instance.

Note that this won't cause any behavior change, because the only calls
to dump_prefix_expression pass in gdb_stdlog.  However, in the long
run it's easier to audit the code if the number of uses of _unfiltered
is reduced.
2022-01-05 11:36:33 -07:00
Tom Tromey
50f5d5c34d Use filtered output in terminal_info implementations
This changes one terminal_info implementation, and
default_terminal_info, to use filtered output.  Other implementations
of this method already use filtered output.

I can't compile go32-nat.c, so this is a 'best effort' patch.
2022-01-05 11:36:33 -07:00
Tom Tromey
d487ae28ce Use filtered output in gnu-nat.c commands
gnu-nat.c has a number of ordinary commands that should use filtered
output.  In a few cases, I changed the output to use gdb_stderr as
well.  I can't compile this file, so this patch is split out as a
"best effort".
2022-01-05 11:36:33 -07:00
Tom Tromey
56c5b29b61 Use filtered output in *-tdep commands
Various targets introduce their own commands, which then use
unfiltered output.  It's better to use filtered output by default, so
this patch fixes the instances I found.
2022-01-05 11:36:33 -07:00
Tom Tromey
7f762abff6 Use filtered output in btrace-related commands
This changes btrace.c and record-btrace.c to use filtered output in
the commands implemented there.
2022-01-05 11:36:33 -07:00
Tom Tromey
7befbbd4c3 Use filtered output in some dumping commands
There are several commands that may optionally send their output to a
file -- they take an optional filename argument and open a file.  This
patch changes these commands to use filtered output.  The rationale
here is that, when printing to gdb_stdout, filtering is appropriate --
it is, and should be, the default for all commands.  And, when writing
to a file, paging will not happen anyway (it only happens when the
stream==gdb_stdout), so using the _filtered form will not change
anything.
2022-01-05 11:36:33 -07:00
Tom Tromey
34fda50bee Use filtered output in kill command
This changes the kill command to use filtered output.  I split this
one into its own patch because, out of an abundance of caution, I
changed the function to call bfd_cache_close_all a bit earlier, in
case pagination caused an exception.
2022-01-05 11:36:33 -07:00