Commit Graph

110228 Commits

Author SHA1 Message Date
Andrew Burgess
ad8f56a737 gdb/doc: use @value{GDBP} in 'info pretty-printer' example
Update the 'info pretty-printer' example in the manual to make use of
@value{GDBP} instead of hard-coding '(gdb)'.
2022-05-19 15:22:04 +01:00
Andrew Burgess
62ec8e6dad gdb/doc: make use of group/end group in 'info pretty-printers' example
The 'info pretty-printers' example is pretty long and consists of many
commands and their output.

Currently, when the pdf manual is generated this example spans a
page-break, with the page-break falling part way through some example
output from GDB.

This commit breaks up the example using @group .... @end group, within
each group is a single GDB command and all its output.

Now, when the pdf manual is created, the page-break is placed after
the output of one GDB command, and before the subsequent command, this
looks much nicer.
2022-05-19 15:22:04 +01:00
Nikolaos Chatzikonstantinou
8ea87c7296 gdb/doc: fix inconsistent info pretty-printer example
The example for 'info pretty-printer' in the manual passes an
object-regexp in some cases, but presents output as though no
object-regexp was passed.

This commit fixes the two mistakes, in one case, fixing the output to
filter based on object-regexp, and in the other, to remove the
object-regexp from the command and leave all the output.
2022-05-19 15:22:03 +01:00
Nick Clifton
95086e1e54 Fix potentially uninitialised variables in the Windows tools 2022-05-19 15:05:12 +01:00
Tiezhu Yang
18bd474461 gdb: testsuite: Support displaced stepping on LoongArch
When execute the following command on LoongArch:

  make check-gdb TESTS="gdb.base/async-shell.exp"

we can see the following message in gdb/testsuite/gdb.sum:

  UNSUPPORTED: gdb.base/async-shell.exp: displaced stepping

modify support_displaced_stepping to support displaced stepping
on LoongArch.

With this patch:

  PASS: gdb.base/async-shell.exp: run &
  PASS: gdb.base/async-shell.exp: shell echo foo
  PASS: gdb.base/async-shell.exp: interrupt
  PASS: gdb.base/async-shell.exp: process stopped

I did the following tests that use support_displaced_stepping
with this patch on LoongArch, there is no failed testcases.

loongson@linux:~/gdb.git$ grep -r support_displaced_stepping gdb/testsuite/gdb.*
gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.base/step-over-no-symbols.exp:    if { $displaced != "off" && ![support_displaced_stepping] } {
gdb/testsuite/gdb.base/moribund-step.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.base/async-shell.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.base/inferior-died.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.base/step-over-syscall.exp:        if {$displaced == "on" && ![support_displaced_stepping]} {
gdb/testsuite/gdb.mi/mi-watch-nonstop.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.mi/mi-nonstop.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.mi/mi-nsmoribund.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.mi/mi-nsintrall.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.mi/mi-nsthrexec.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.mi/mi-nonstop-exit.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.multi/watchpoint-multi.exp:if [support_displaced_stepping] {
gdb/testsuite/gdb.python/py-evthreads.exp:if { ![support_displaced_stepping] } {
gdb/testsuite/gdb.threads/step-over-lands-on-breakpoint.exp:    if { $displaced != "off" && ![support_displaced_stepping] } {
gdb/testsuite/gdb.threads/interrupt-while-step-over.exp:    if { ${displaced-stepping} != "off" && ![support_displaced_stepping] } {
gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp:    if { $displaced != "off" && ![support_displaced_stepping] } {

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2022-05-19 21:56:53 +08:00
Simon Marchi
02646f1960 gdbsupport: fix path_join crash with -std=c++17 and -D_GLIBCXX_DEBUG
When building GDB with -std=c++17 and -D_GLIBCXX_DEBUG=1, I get:

  $ ./gdb -nx --data-directory=data-directory -q -ex "maint selftest path_join"
  /usr/include/c++/11.2.0/string_view:233: constexpr const value_type& std::basic_string_view<_CharT, _Traits>::operator[](std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; std::basic_string_view<_CharT, _Traits>::const_reference = const char&; std::basic_string_view<_CharT, _Traits>::size_type = long unsigned int]: Assertion  '__pos < this->_M_len' failed.

The problem is that we're passing an empty string_view to
IS_ABSOLUTE_PATH.  IS_ABSOLUTE_PATH accesses [0] on that string_view,
which is out-of-bounds.

The reason this is not seen with -std less than c++17 is that our local
copy of string_view (used with C++ < 17) does not have the assert in
operator[], as that wouldn't work in a constexpr method:

  5890af36e5/gdbsupport/gdb_string_view.h (L180)

IS_ABSOLUTE_PATH is normally used with null-terminated string.  It's
fine to pass an empty null-terminated string to IS_ABSOLUTE_PATH,
because index 0 in such a string is valid.  But not with an empty
string_view.

Fix that by avoiding the "call" to IS_ABSOLUTE_PATH if the string_view
is empty.

Change-Id: Idf4df961b63f513b3389235e93814c02b89ea32e
2022-05-19 08:04:13 -04:00
Jan Beulich
15b7af6c87 Arm64: force emission of ILP32-dependent relocs
Like the placeholder types added in 04dfe7aa52 ("Arm64: follow-on to
PR gas/27217 fix"), these are also placeholders which are subsequently
resolved (albeit later, hence this being a separate issue). As for the
resolved types 1 is returned, these pseudo-relocs should also have 1
returned to force retaining of the [eventual] relocations. This is also
spelled out individually for each of them in md_apply_fix().
2022-05-19 12:46:21 +02:00
Jan Beulich
20bed3bb35 COFF: use hash for string table also when copying / stripping
Otherwise the string table may grow and hence e.g. change a final binary
(observed with PE/COFF ones) even if really there's no change. Doing so
in fact reduces the overall amount of code, and in particular the number
of places which need to remain in sync.

Afaics there's no real equivalent to the "traditional_format" field used
when linking, so hashing is always enabled when copying / stripping.
2022-05-19 12:45:55 +02:00
Jan Beulich
f0a53c9c89 COFF/PE: keep linker version during objcopy / strip
Neither of the tools is really a linker, so whatever was originally
recorded should be retained rather than being overwritten by these
tools' versions.
2022-05-19 12:44:56 +02:00
Jan Beulich
6db1e45d7b COFF/PE: don't leave zero timestamp after objcopy / strip
Fill the timestamp field suitably for _bfd_XXi_only_swap_filehdr_out().
Instead of re-arranging the present if(), fold this logic with that of
copying the optional header.
2022-05-19 12:44:32 +02:00
Jan Beulich
ce462d0435 COFF: make objcopy / strip honor --keep-file-symbols
So far this option had no effect when used together with e.g.
--strip-debug. Set BSF_FILE on these symbols to change that.

While altering this also join two adjacent blocks of case labeled
statements with identical code.
2022-05-19 12:44:08 +02:00
Jan Beulich
bc5baa9f13 don't over-align file positions of PE executable sections
When a sufficiently small alignment was specified via --file-alignment,
individual section alignment shouldn't affect placement within the file.
This involves first of all clearing D_PAGED for images when section and
file alignment together don't permit paging of the image. The involved
comparison against COFF_PAGE_SIZE in turn helped point out (through a
compiler warning) that 'page_size' should be of unsigned type (as in
particular FileAlignment is). This yet in turn pointed out a dubious
error condition (which is being deleted).

For the D_PAGED case I think the enforced file alignment may still be
too high, but I'm wary of changing that logic without knowing of
possible corner cases.

Furthermore file positions in PE should be independent of the alignment
recorded in section headers anyway. Otherwise there are e.g. anomalies
following commit 6f8f6017a0 ("PR27567, Linking PE files adds alignment
section flags to executables") in that linking would use information a
subsequent processing step (e.g. stripping) wouldn't have available
anymore, and hence a binary could change in that 2nd step for no actual
reason. (Similarly stripping a binary linked with a linker pre-dating
that commit would change the binary again when stripping it a 2nd time.)
2022-05-19 12:43:10 +02:00
Yvan Roux
5f3fc928df _bfd_real_fopen should not use ccs parameter on Windows
PR 25713
	* bfdio.c (_bfd_real_fopen): Delete ccs string.
2022-05-19 10:58:13 +01:00
Tsukasa OI
c4dd8eb523 RISC-V: Fix canonical extension order (K and J)
This commit fixes canonical extension order to follow the RISC-V ISA
Manual draft-20210402-1271737 or later.

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_recognized_prefixed_ext): Fix "K" extension
	prefix to be placed before "J".
2022-05-19 11:31:31 +08:00
GDB Administrator
4f02f4d802 Automatic date update in version.in 2022-05-19 00:00:25 +00:00
John Baldwin
0ee6b1c511 Use aarch64_features to describe register features in target descriptions.
Replace the sve bool member of aarch64_features with a vq member that
holds the vector quotient.  It is zero if SVE is not present.

Add std::hash<> specialization and operator== so that aarch64_features
can be used as a key with std::unordered_map<>.

Change the various functions that create or lookup aarch64 target
descriptions to accept a const aarch64_features object rather than a
growing number of arguments.

Replace the multi-dimension tdesc_aarch64_list arrays used to cache
target descriptions with unordered_maps indexed by aarch64_feature.
2022-05-18 13:32:04 -07:00
Jan Beulich
04dfe7aa52 Arm64: follow-on to PR gas/27217 fix
PR gas/27217

Prior to trying to address PR gas/28888 I noticed anomalies in how
certain insns would / wouldn't be affected in similar ways.

Commit eac4eb8ecb ("Fix a problem assembling AArch64 sources when a
relocation is generated against a symbol that has a defined value") had
two copy-and-paste mistakes, passing the wrong type to
aarch64_force_reloc().

It further failed to add placeholder relocation types to that function's
block of case labels leading to a return of 1. While not of interest for
aarch64_force_relocation() (these placeholders are resolved right in
parse_operands()), calls to aarch64_force_reloc() happen before that
resolution would take place.
2022-05-18 17:55:55 +02:00
Nick Clifton
2a89fa9613 Fix compile time warning building gold with Clang-14.
* int_encoding.cc (get_length_as_unsigned_LEB_128): Remove
	current_length variable.
2022-05-18 16:29:57 +01:00
Victor Do Nascimento
320f42099a oops - forgot changelog entry for the previous delta. 2022-05-18 16:26:21 +01:00
Victor Do Nascimento
3363d8560f arm: Add unwind support for mixed register lists
* config/tc-arm.c (parse_reg_list): Add handling of mixed register
	types.
	(reg_names): Enumerate pseudoregister according to mapped physical
	register number.
	(s_arm_unwind_save_pseudo): Modify function signature.
	(s_arm_unwind_save_core): Likewise.
	(s_arm_unwind_save_mixed): New function.
	(s_arm_unwind_save): Generate register list mask to pass to nested
	functions.
	* testsuite/gas/arm/unwind-pacbti-m.s: Expand test for mixed
 	register type lists.
 	* testsuite/gas/arm/unwind-pacbti-m.d: Likewise.
	* testsuite/gas/arm/unwind-pacbti-m-readelf.d: Likewise.
2022-05-18 16:25:12 +01:00
Carl Love
301fe55e9c PowerPC: bp-permanent.exp, kill-after-signal fix
Fix changes that didn't make it into commit:
dd9cd55e99.

Fix missing -wrap on gdb_test_multiple in gdb.base/kill-after-signal.exp
that is causing regression test on x86_64-linux with taskset -c 0.
2022-05-18 15:11:42 +00:00
Yichao Yu
1fe8486103 [AArch64] Return the regnum for PC (32) on aarch64
This will allow the unwind info to explicitly specify a different value
for the return address from the link register.
Such usage, although uncommon, is valid and useful for signal frames.
It is also supported by aadwarf64 from ARM (Note 9 in [1]).

Ref https://sourceware.org/pipermail/gdb/2022-May/050091.html

[1] https://github.com/ARM-software/abi-aa/blob/2022Q1/aadwarf64/aadwarf64.rst#dwarf-register-names

Signed-off-by: Luis Machado <luis.machado@arm.com>
2022-05-18 15:42:23 +01:00
Jan Beulich
4bb8b8e938 x86: shrink op_riprel
It is only ever initialized from a boolean, so it as well as related
variables' types can simply be bool and there's no masking to 32 bits
needed in set_op().
2022-05-18 14:39:58 +02:00
Nick Clifton
2c3cc81e06 Add a --no-weak option to nm.
PR 29135
	* nm.c (non_weak): New variable.
	(filter_symbols): When non-weak is true, ignore weak symbols.
	(long_options): Add --no-weak.
	(usage): Mention --no-weak.
	(main): Handle -W/--no-weak.
	* doc/binutils.texi: Document new feature.
	* NEWS: Mention the new feature.
	* testsuite/binutils-all/nm.exp: Add test of new feature.
	* testsuite/binutils-all/no-weak.s: New test source file.
2022-05-18 13:15:22 +01:00
Pedro Alves
c76d61da4a Support -prompt and -lbl in gdb_test
This teaches gdb_test to forward the -prompt and -lbl options to
gdb_test_multiple.

The option parsing is done with parse_args.

As a cleanup, instead of using llength and lindex to get at the
positional arguments, use lassign, and check whether the corresponding
variable is empty.

Convert gdb.base/ui-redirect.exp and gdb.xml/tdesc-reload.exp to use
gdb_test -prompt/-lbl instead of gdb_test_multiple as examples.

Change-Id: I243e1296d32c05a421ccef30b63d43a89eaeb4a0
2022-05-18 11:59:37 +01:00
Luis Machado
44b6e80160 Remove unused DWARF PAUTH registers
The AARCH64_DWARF_PAUTH_DMASK and AARCH64_DWARF_PAUTH_CMASK DWARF registers
never made their way into the aadwarf64. The following patch removes these
constants and their use.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26295
2022-05-18 11:24:55 +01:00
Luis Machado
c9cd8ca465 Rename PAUTH_RA_STATE to RA_SIGN_STATE
The aadwarf64 [1] names this register RA_SIGN_STATE, so update the code to use
the same name.

[1] https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst
2022-05-18 11:24:45 +01:00
Tom de Vries
a2ff75485c [gdb/testsuite] Simplify unknown lang testing in gdb.base/parse_number.exp
Move testing of language unknown out of the $supported_archs loop in
gdb.base/parse_number.exp.  This reduces total amount of tests from 18466 to
17744.

Tested on x86_64-linux.
2022-05-18 12:12:29 +02:00
Tom de Vries
71630188ad [gdb/testsuite] Use hex_for_lang in gdb.base/parse_number.exp
In gdb.base/parse_number.exp, add a new proc hex_for_lang that formats a hex
number appropriately for a given language.

Tested on x86_64-linux.
2022-05-18 12:12:29 +02:00
Tom de Vries
192257c998 [gdb/tdep] Add gdb/syscalls/update-linux-from-src.sh
Add a new script gdb/syscalls/update-linux-from-src.sh, that can be used to
generate *-linux.xml.in files from linux kernel sources, like so:
...
$ ./update-linux-from-src.sh ~/upstream/linux-stable.git
Skipping aarch64-linux.xml.in, no syscall.tbl
Generating amd64-linux.xml.in
Skipping arm-linux.xml.in, use arm-linux.py instead
Skipping bfin-linux.xml.in, no longer supported
Generating i386-linux.xml.in
Generating mips-n32-linux.xml.in
Generating mips-n64-linux.xml.in
Generating mips-o32-linux.xml.in
Generating ppc64-linux.xml.in
Generating ppc-linux.xml.in
Generating s390-linux.xml.in
Generating s390x-linux.xml.in
Generating sparc64-linux.xml.in
Generating sparc-linux.xml.in
...

Update *-linux.xml.in and *-linux.xml using linux kernel tag v5.18-rc6.
2022-05-18 11:56:32 +02:00
Tamar Christina
e1e1528448 AArch64: Enable FP16 by default for Armv9-A.
In Armv9-A SVE is mandatory, and for SVE FP16 is mandatory.  This fixes a disconnect
between GCC and binutils where GCC has FP16 on by default and gas doesn't.

include/ChangeLog:

2022-05-16  Tamar Christina  <tamar.christina@arm.com>

	* opcode/aarch64.h (AARCH64_ARCH_V9_FEATURES): Add AARCH64_FEATURE_F16.
2022-05-18 10:37:10 +01:00
Jan Beulich
85aaf32e61 gas: avoid octal numbers being accepted when processing .linefile
Compilers would put decimal numbers there, so I think we should treat
finding octal numbers the same as finding bignums - ignore them as
actually being comments of some very specific form.
2022-05-18 09:38:40 +02:00
Jan Beulich
9c70556165 gas: avoid bignum related errors when processing .linefile
Any construct which to the scrubber looks like a C preprocessor
line/file "directive" is converted to .linefile, but the amount of
checking the scrubber does is minimal (albeit it does let through only
decimal digits for the line part of the contruct). Since the scrubber
conversion is further tied to # being a line comment character, anything
which upon closer inspection turns out not to be a line/file "directive"
is supposed to be treated as a comment, i.e. ignored. Therefore we
cannot use get_absolute_expression(), as this may raise errors. Open-
code the function instead, treating everything not resulting in
O_constant as a comment as well.

Furthermore also bounds-check the parsed value. This bounds check tries
to avoid implementation defined behavior (which may be the raising of an
implementation defined signal), but for now makes the assumption that
int has less than 64 bits. The way bfd_signed_vma (which is what offsetT
aliases) is defined in bfd.h for the BFD64 case I cannot really see a
clean way of avoiding this assumption. Omitting the #ifdef, otoh, would
risk "condition is always false" warnings by compilers.

Convert get_linefile_number() to return bool at this occasion as well.
2022-05-18 09:38:18 +02:00
Jan Beulich
7e6d6b62d8 gas: fold do_repeat{,_with_expander}()
do_repeat_with_expander() already deals with the "no expander" case
quite fine, so there's really little point having two functions. What it
lacks compared with do_repeat() is a call to sb_build(), which can
simply be moved (and the then redundant sb_new() be avoided). Along with
this moving also flip if the main if()'s condition such that the "no
expander" case is handled first.
2022-05-18 09:37:34 +02:00
Jan Beulich
43fe575c32 gas: don't ignore .linefile inside false conditionals
When assembling code previously pre-processed by a C compiler, long
enough comments may have been collapsed into "# <line> <file>"
constructs. If we skip these, line numbers (and possibly even file
names) will be off / wrong in both diagnostics and debug info.
2022-05-18 09:37:00 +02:00
Jan Beulich
2e55c34282 gas: simplify ignore_input()
First of all convert to switch(), in preparation of adding another
directive here which may not be ignored. While doing so drop dead code:
A string the first two characters of which do not match "if" also wont
match "ifdef" or "ifndef".
2022-05-18 09:36:00 +02:00
Jan Beulich
818432e841 gas: tweak .irp and alike file/line handling for M68K/MRI
In commit 2ee1792bec ("gas: further adjust file/line handling for .irp
and alike") I neglected the need to omit the leading . in M68K/MRI mode.
2022-05-18 09:35:29 +02:00
Xi Ruoyao
01ae03b5b9 gold: don't invoke IA32 syscall in x86_64 assembly testcase
pr17704a_test.s is a x86_64 assembly file, but it invokes IA32 exit
syscall with "int 0x80".  This causes a segfault on kernels with
CONFIG_IA32_EMULATION disabled.

gold/

	* testsuite/pr17704a_test.s (_start): Invoke x86_64 exit syscall
	instead of its IA32 counterpart.
2022-05-18 09:34:31 +02:00
GDB Administrator
ed11f0543e Automatic date update in version.in 2022-05-18 00:00:31 +00:00
Nikolaos Chatzikonstantinou
e84412c6a3 Fix typo in info page 2022-05-17 09:00:05 -06:00
Pedro Alves
a1f2ddd383 Fix gdb.python/py-connection.exp with remote targets
After the patch to make gdb_test's question non-optional when
specified, gdb.python/py-connection.exp started failing like so:

  $ make check TESTS="gdb.python/py-connection.exp" RUNTESTFLAGS="--target_board=native-gdbserver"
  (gdb) PASS: gdb.python/py-connection.exp: info connections while the connection is still around
  disconnect^M
  Ending remote debugging.^M
  (gdb) FAIL: gdb.python/py-connection.exp: kill the inferior

The problem is that "disconnect" when debugging with the native target
asks the user whether to kill the program, while with remote targets,
it doesn't.

Fix it by explicitly killing before disconnecting.

Tested with --target_board unix, native-gdbserver, and native-extended-gdbserver.

Change-Id: Icd85015c76deb84b71894715d43853c1087eba0b
2022-05-17 13:03:07 +01:00
Felix Willgerodt
49a73ab9d3 gdb, btrace: Throw an error for empty recordings when replaying starts.
This makes record_btrace_start_replaying() more consistent, as it already
errors out e.g. on a recording with only gaps.
2022-05-17 12:41:13 +02:00
Pedro Alves
ed01945057 Make gdb_test's question non-optional if specified
gdb_test supports handling scenarios where GDB asks a question before
finishing handling some command.  The full prototype of gdb_test is:

  # gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE

However, QUESTION is a question that GDB _may_ ask, not one that GDB
_must_ ask:

 # QUESTION is a question GDB may ask in response to COMMAND, like
 #   "are you sure?"
 # RESPONSE is the response to send if QUESTION appears.

If GDB doesn't raise the question, the test still passes.

I think that this is a misfeature.  If GDB regresses and stops asking
a question, the testsuite won't notice.  So I think that if a QUESTION
is specified, gdb_test should ensure it comes out of GDB.

Running the testsuite exposed a number of tests that pass
QUESTION/RESPONSE to GDB, but no question comes out.  The previous
commits fixed them all, so this commit changes gdb_test's behavior.

A related issue is that gdb_test doesn't enforce that if you specify
QUESTION, that you also specify RESPONSE.  I.e., you should pass 1, 2,
3, or 5 arguments to gdb_test, but never 4, or more than 5.  Making
gdb_test detect bogus arguments actually regressed some testcases,
also all fixed in previous commits.

Change-Id: I47c39c9034e6a6841129312037a5ca4c5811f0db
2022-05-17 11:13:39 +01:00
Pedro Alves
d7440bee9f gdb.base/skip.exp: Don't abuse gdb_test's question support
gdb.base/skip.exp abuses gdb_test's support for answering a GDB
question to do this:

    # With gcc 9.2.0 we jump once back to main before entering foo here.
    # If that happens try to step a second time.
    gdb_test "step" "foo \\(\\) at.*" "step 3" \
	"main \\(\\) at .*\r\n$gdb_prompt " "step"

After a patch later in this series, gdb_test will FAIL if GDB does NOT
issue the question, so this test would start failing on older GCCs.

Switch to using gdb_test_multiple instead.  There are three spots in
the file that have the same pattern, and they're actually in a
sequence of commands that is repeated those 3 times.  Factor all that
out to a procedure.

I don't have gcc 9.2 handy, but I do have gcc 6.5, and that one is
affected as well, so update the comment.

Change-Id: If0a7e3cdf5191b4eec95ce0c8845c3a4d801c39e
2022-05-17 11:08:22 +01:00
Pedro Alves
8d08cccb01 Avoid having to unload file in gdb.server/connect-with-no-symbol-file.exp
gdb.server/connect-with-no-symbol-file.exp's connect_no_symbol_file
does:

	gdb_test "file" ".*" "discard symbol table" \
	    {Discard symbol table from `.*'\? \(y or n\) } "y"

A following patch will make gdb_test expect the question out of GDB if
one is passed down as argument to gdb_test.  With that, this test
starts failing.  This is because connect_no_symbol_file is called in a
loop, and the first time around, there's a loaded file, so "file" asks
the "Discard symbol table ... ?" question, while in the following
iterations there's no file, so there's no question.

Fix this by not loading a file into GDB in the first place.

Change-Id: I810c036b57842c4c5b47faf340466b0d446d1abc
2022-05-17 10:31:36 +01:00
Pedro Alves
1fe69430d1 Fix bogus gdb_test invocations
A following patch will make gdb_test error out if bogus arguments are
passed, which exposed bugs in a few testcases:

 - gdb.python/py-parameter.exp, passing a spurious "1" as extra
   parameter, resulting in:

   ERROR: Unexpected arguments: {set test-file-param bar.txt} {The name of the file has been changed to bar.txt} {set new file parameter} 1

 - gdb.python/py-xmethods.exp, a missing test message, resulting in
   the next gdb_test being interpreted as message, question and
   response!  With the enforcing patch, this was caught with:

   ERROR: Unexpected arguments: {p g.mul<char>('a')} {From Python G<>::mul.*} gdb_test {p g_ptr->mul<char>('a')} {From Python G<>::mul.*} {after: g_ptr->mul<char>('a')}

 - gdb.base/pointers.exp, missing a quote.

Change-Id: I66f2db4412025a64121db7347dfb0b48240d46d4
2022-05-17 10:31:36 +01:00
Pedro Alves
35b72e4e5b gdb.base/scope.exp: Remove bogus gdb_test questions
This test is abusing the QUESTION/RESPONSE feature to send an
alternative command to GDB if the first command fails.  Like so:

   gdb_test "print 'scope0.c'::filelocal" \
	    "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" \
	    "No symbol \"scope0.c\" in current context.*" \
	    "print '$srcdir/$subdir/scope0.c'::filelocal"

So if 'scope0.c' doesn't work, we try again with
'$srcdir/$subdir/scope0.c'.  I strongly suspect this is really an
obsolete test.  I think that if '$srcdir/$subdir/scope0.c' works, then
'scope0.c' should have worked too, thus I'd think that if we pass due
to the question path, then it's a bug.  So just remove the question
part passed to gdb_test.

Change-Id: I2acc99285f1d519284051b49693b5441fbdfe3cd
2022-05-17 10:31:36 +01:00
Pedro Alves
bc6004dfd2 Remove gdb_test questions that GDB doesn't ask
Change-Id: Ib2616dc883e9dc9ee100f6c86d83a921a0113c16
2022-05-17 10:31:35 +01:00
Nelson Chu
035784e345 RISC-V: Added half-precision floating-point v1.0 instructions.
bfd/
	* elfxx-riscv.c (riscv_implicit_subsets): Added implicit f
	and zicsr for zfh.
	(riscv_supported_std_z_ext): Added default v1.0 version for zfh.
	(riscv_multi_subset_supports): Handle INSN_CLASS_ZFH,
	INSN_CLASS_D_AND_ZFH and INSN_CLASS_Q_AND_ZFH.
gas/
	* config/tc-riscv.c (FLT_CHARS): Added "hH".
	(macro): Expand Pseudo M_FLH and M_FSH.
	(riscv_pseudo_table): Added .float16 directive.
	* testsuite/gas/riscv/float16-be.d: New testcase for .float16.
	* testsuite/gas/riscv/float16-le.d: Likewise.
	* testsuite/gas/riscv/float16.s: Likewise.
	* testsuite/gas/riscv/fp-zfh-insns.d: New testcase for zfh.
	* testsuite/gas/riscv/fp-zfh-insns.s: Likewise.
include/
	* opcode/riscv-opc.h: Added MASK and MATCH encodings for zfh.
	* opcode/riscv.h: Added INSN_CLASS and pseudo macros for zfh.
opcodes/
	* riscv-opc.c (riscv_opcodes): Added zfh instructions.
2022-05-17 13:31:38 +08:00
GDB Administrator
626d0e40e5 Automatic date update in version.in 2022-05-17 00:00:35 +00:00