Commit Graph

115840 Commits

Author SHA1 Message Date
Alan Modra
3bab069c29 gas init_stab_section and get_stab_string_offset
get_stab_string_offset currently creates the stabstr section if not
already present, in the process keeping a reference to the malloc'd
section name string.  Really, the name belongs in bfd_alloc'd memory
or some obstack so that it doesn't show as a memory leak on exit.
s_stab_generic at least does allocate the name for the stab section on
an obstack, but doesn't tidy that as well as it could.  Return paths
after issuing a warning don't release the memory, nor the memory for
the "string" copy.

This patch fixes these problems.  s_stab_generic is rearranged so that
creation of the sections occurs earlier, before any potential uses of
the note obstack during expression parsing.  That makes it possible to
always free the section name strings unless used to create new
sections.  I've also avoided get_absolute_expression_and_terminator
as I see that function might skip over end-of-line, and lack of a
--input_line_pointer might have caused the following source line to be
ignored.  (Other uses of this function in gas are OK.)

	* config/obj-coff.c (obj_coff_init_stab_section): Add stabstr
	param.  Pass to get_stab_string_offset rather than name of
	section.
	* config/obj-som.c (obj_som_init_stab_section): Likewise.
	* config/obj-elf.c (obj_elf_init_stab_section): Likewise.
	(elf_init_stab_section): Adjust.
	* config/obj-coff.h (INIT_STAB_SECTION): Update.
	(obj_coff_init_stab_section): Update prototype.
	* config/obj-som.h: Similarly.
	* config/obj-elf.h: Similarly.
	* config/obj-multi.h (INIT_STAB_SECTION): Update.
	* obj.h (struct format_ops <init_stab_section>): Update.
	* read.h (get_stab_string_offset): Update prototype.
	* stabs.c (cached_sec): Delete.
	(stabs_begin): Adjust to suit.
	(get_stab_string_offset): Add stabstr param, delete stabstr_name
	and free_stabstr_secname params.  Don't make stabstr section
	here.
	(eat_comma): New function.
	(s_stab_generic): Replace stab_secname_obstack_end param with
	bool freenames.  Move creation of stab and stabstr sections
	earlier, so the names can be freed earlier before possible use
	of notes obstack during expression parsing.  Tidy error paths
	ensuring "string" is freed.  Use get_absolute_expression in
	place of get_absolute_expression_and_terminator.
	(s_stab): Adjust.
	(s_xstab): Use notes_concat to make stabstr section name.
2023-08-31 21:32:11 +09:30
Alan Modra
5333003969 gas OBJ_PROCESS_STAB
This macro and the supporting functions have an unused "seg" first
argument.  Tidy that.

	* config/obj-aout.c (obj_aout_process_stab): Delete first param.
	* config/obj-ecoff.h (OBJ_PROCESS_STAB): Likewise.
	* config/obj-elf.c (elf_process_stab): Likewise.
	* config/obj-elf.h (OBJ_PROCESS_STAB): Likewise.
	* config/obj-macho.h (OBJ_PROCESS_STAB): Likewise.
	* config/obj-multi.h (OBJ_PROCESS_STAB): Likewise.
	* ecoff.c (ecoff_stab): Likewise.
	* ecoff.h (ecoff_stab): Likewise.
	* obj.h (struct format_ops <process_stab>): Likewise.
	* stabs.c (OBJ_PROCESS_STAB): Likewise.
2023-08-31 18:06:10 +09:30
Tom de Vries
959db21230 [gdb/symtab] Replace TYPE_ALLOC with TYPE_ZALLOC where required
Handle the remaining uses of TYPE_ALLOC, either by:
- replacing with TYPE_ZALLOC, or
- adding a comment explaining why zero-initialization is not necessary.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-31 09:37:44 +02:00
Tom de Vries
6d3c2d749b [gdb/symtab] Replace TYPE_ALLOC + B_CLRALL with TYPE_ZALLOC
I noticed some cases of TYPE_ALLOC followed by B_CLRALL.

Replace these with TYPE_ZALLOC.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-31 09:37:44 +02:00
Tom de Vries
34c9386e21 [gdb/symtab] Replace TYPE_ALLOC + memset with TYPE_ZALLOC
I noticed a case of TYPE_ALLOC followed by memset.

Replace this with TYPE_ZALLOC.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-31 09:37:44 +02:00
Tom de Vries
4b3d893ac8 [gdb/symtab] Do more zero-initialization of type::fields
Now that we've introduced type::{alloc_fields,copy_fields}, the places where
no zero-initialization of allocated fields is done are easy to spot:
...
$ find gdb* -type f | grep -v ChangeLog | xargs grep alloc_fields | grep false
gdb/coffread.c:  type->alloc_fields (nfields, false);
gdb/coffread.c:  type->alloc_fields (nsyms, false);
gdb/stabsread.c:	  ftype->alloc_fields (nsemi, false);
gdb/gdbtypes.c:  resolved_type->alloc_fields (nfields, false);
gdb/gdbtypes.c:  alloc_fields (nfields, false);
gdb/gdbtypes.c:  alloc_fields (nfields, false);
gdb/mdebugread.c:	t->alloc_fields (nfields, false);
gdb/mdebugread.c:		  ftype->alloc_fields (nparams, false);
...

All hits in gdbtypes.c are ok.  There are two hits in the two variants of
copy_fields, and there's already a comment for the third.

AFAICT, the other ones are not ok, so fix those by dropping the "false"
argument.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-31 09:37:44 +02:00
Tom de Vries
2774f2dad5 [gdb/symtab] Factor out type::{alloc_fields,copy_fields}
After finding this code in buildsym_compunit::finish_block_internal:
...
              ftype->set_fields
                ((struct field *)
                 TYPE_ALLOC (ftype, nparams * sizeof (struct field)));
...
and fixing PR30810 by using TYPE_ZALLOC, I wondered if there were more
locations that needed fixing.

I decided to make things easier to spot by factoring out a new function
alloc_fields:
...
 /* Allocate the fields array of this type, with NFIELDS elements.  If INIT,
     zero-initialize the allocated memory.  */
  void
  type::alloc_fields (unsigned int nfields, bool init = true);
...
where:
- a regular use would be "alloc_fields (nfields)", and
- an exceptional use that needed no initialization would be
  "alloc_fields (nfields, false)".

Pretty soon I discovered that most of the latter cases are due to
initialization by memcpy, so I added two variants of copy_fields as well.

After this rewrite there are 8 uses of set_fields left:
...
gdb/coffread.c:	  type->set_fields (nullptr);
gdb/coffread.c:	  type->set_fields (nullptr);
gdb/coffread.c:	  type->set_fields (nullptr);
gdb/eval.c:  type->set_fields
gdb/gdbtypes.c:  type->set_fields (args);
gdb/gdbtypes.c:  t->set_fields (XRESIZEVEC (struct field, t->fields (),
gdb/dwarf2/read.c:      type->set_fields (new_fields);
gdb/dwarf2/read.c:	      sub_type->set_fields (sub_type->fields () + 1);
...

These fall into the following categories:
- set to nullptr (coffread.c),
- type not owned by objfile or gdbarch (eval.c), and
- modifying an existing fields array, like adding an element at the end or
  dropping an element at the start (the rest).

Tested on x86_64-linux.
2023-08-31 09:37:44 +02:00
Tom de Vries
0b8b932dce [gdb/symtab] Fix uninitialized memory in buildsym_compunit::finish_block_internal
When running test-case gdb.dwarf2/per-bfd-sharing.exp with target board stabs,
gdb either segfaults or asserts due to reading uninitialized memory, allocated
here in buildsym_compunit::finish_block_internal:
...
	      ftype->set_fields
		((struct field *)
		 TYPE_ALLOC (ftype, nparams * sizeof (struct field)));
...

Fix this by using TYPE_ZALLOC instead.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>

PR symtab/30810
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30810
2023-08-31 09:37:44 +02:00
Claudiu Zissulescu
cd60a3956d arc: Update elfarcv2 script template
Update ARC's elfarcv2 script template with:

- The .ivt section (Interrupt Vector Table) is mapped at the begining
  of STARTUP_MEMORY when ivtbase_addr is not defined. Previously, it
  was pointing to 0x00.

- MEMORY_FILE is a new emulation paramter and sets the name for the
  linker script file which holds the MEMORY commands required by
  arcv2elfx emulation.

- Four new linker variables are introduced available when arcv2elf emulation is used:
  * __TEXT_REGION_ORIGIN__ Once defined it is setting the text region origin. By default it points to zero.
  * __TEXT_REGION_LENGTH__ Once defined it is setting the text region length. By default it is set to 2M.
  * __DATA_REGION_ORIGIN__ Once defined it is setting the data region origin. By default it is set to 0x80000000.
  * __DATA_REGION_LENGTH__ Once defined it is setting the data region length. By default it is set to 2M.

ld/ChangeLog:

	* scripttempl/elfarcv2.sc: Update script template.

Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2023-08-31 08:13:53 +03:00
H.J. Lu
68a2d9bf87 elf: Don't merge sections with different SHF_LINK_ORDER
For relocatable link, don't merge 2 SHF_LINK_ORDER sections if output
sections of their linked to sections are different.

	* ldelf.c (elf_orphan_compatible): Don't merge sections with
	different SHF_LINK_ORDER.
	* testsuite/ld-elf/pr30791a.d: New file.
	* testsuite/ld-elf/pr30791a.s: Likewise.
	* testsuite/ld-elf/pr30791b.d: Likewise.
	* testsuite/ld-elf/pr30791b.s: Likewise.
	* testsuite/ld-elf/pr30791c.s: Likewise.
	* testsuite/ld-elf/pr30791d.s: Likewise.
2023-08-30 17:17:31 -07:00
H.J. Lu
bac5753ca2 elf: Check DT_SYMTAB only on non-IR object
Check DT_SYMTAB only on non-IR object of archive member to avoid crash
on LLVM IR object with NULL elf_tdata.

	PR ld/30811
	* elflink.c (elf_link_is_defined_archive_symbol): Check
	DT_SYMTAB only on non-IR object.
2023-08-30 17:17:31 -07:00
GDB Administrator
48abc08d13 Automatic date update in version.in 2023-08-31 00:00:44 +00:00
Alan Modra
00aea11f40 libbfd.texi zero size
Pattern rules in doc/local.mk exist that specify how to make
libbfd.texi from libfd.h or libbfd.c.  Since both files exist and the
libbfd.h rule is first, libbfd.h is used.  libbfd.h doesn't contain
the documentation..

	* doc/local.mk (doc/%stamp): Put rule making this from %.c
	before %.h rule.
	* Makefile.in: Regenerate.
	* libbfd.c (Byte swapping routines): Don't omit description.
2023-08-31 08:57:31 +09:30
Alan Modra
d7d4e91155 DEFAULT_BUFFERSIZE
There isn't any reason to think that a particular buffer size is
ideal in bfd, so let's just not define it.

	* libbfd-in.h (DEFAULT_BUFFERSIZE): Don't define.
	* libbfd.h: Regenerate.
	* archive.c (AR_WRITE_BUFFERSIZE): Substitute value.
	* vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
	* coff-rs6000.c (do_copy): Likewise, and use sizeof.
2023-08-31 07:48:16 +09:30
Tom de Vries
50e193c186 [gdb/testsuite] Fix gdb.dwarf2/nullptr_t.exp with cc-with-dwz-m
When running test-case gdb.dwarf2/nullptr_t.exp with target board
cc-with-dwz-m, I run into:
...
FAIL: gdb.dwarf2/nullptr_t.exp: decltype(nullptr) symbol
...

The problem is that were looking for "typedef void decltype\\(nullptr\\)"
using "maint print symbols -source $srcfile", but dwz has moved the typedef to
a PU, so it's shown by "maint print symbols -source <unknown>" instead.

Fix this by dropping the "-source $srcfile" bit.

Tested on x86_64-linux, with make-check-all.sh.
2023-08-30 23:33:31 +02:00
Simon Marchi
7c651c5fe6 gdb: simplify vector construction in eval_op_rust_array
Replace the manual fill of the vector with the appropriate std::vector
constructor that makes N copies of the provided value.

Change-Id: I579570748c48f53d35024105269d83c716294746
Approved-By: Tom Tromey <tom@tromey.com>
2023-08-30 14:32:11 -04:00
Maciej W. Rozycki
0c164d29d1 Revert "Gold: Add targ_extra_little_endian to configure.ac"
This reverts commit cf8565fb2e.  It was
applied unapproved.
2023-08-30 18:45:14 +01:00
Maciej W. Rozycki
ddf8117d3c Revert "Gold/MIPS: Use EM_MIPS instead of EM_MIPS_RS3_LE for little endian"
This reverts commit 3983426378.  It was
applied unapproved.
2023-08-30 18:45:14 +01:00
Maciej W. Rozycki
6537f54611 Revert "Gold/MIPS: Drop mips*le/mips*el* triple pattern"
This reverts commit adb3ae2eba.  It was
applied unapproved.
2023-08-30 18:45:14 +01:00
Maciej W. Rozycki
edc9d95966 Revert "Gold/MIPS: Add targ_extra_size=64 for mips32 triples"
This reverts commit d6cdc0af2b.  It was
applied unapproved.
2023-08-30 18:45:14 +01:00
Maciej W. Rozycki
7c9ab4a564 Revert "Gold/MIPS: Add mips64*/mips64*el triple support"
This reverts commit 5c4cdba100.  It was
applied unapproved.
2023-08-30 18:45:14 +01:00
Maciej W. Rozycki
c1a5464809 Revert "MIPS: Use 64-bit a ABI by default for `mipsisa64*-*-linux*' targets"
This reverts commit 025e84f935.  It was
applied unapproved.
2023-08-30 18:45:14 +01:00
Willgerodt, Felix
59487af3c8 gdbserver, linux-low: add a couple of nullptr assertions.
This safeguards a couple of places that may theoretically return NULL but
must not in this specific context.  These were found by a static analysis tool.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-30 06:32:05 +00:00
Tsukasa OI
fe0f44a0ca RISC-V: Make XVentanaCondOps RV64 only
Although XVentanaCondOps instructions are XLEN-agonistic, Ventana's manual
only defines them only for RV64 (because all Ventana's processors implement
RV64).

This commit limits XVentanaCondOps instructions RV64-only to match the
behavior of the manual and LLVM.

Note that this commit alone will not make XVentanaCondOps extension with
RV32 invalid (it just makes XVentanaCondOps on RV32 empty).

opcodes/ChangeLog:

	* riscv-opc.c (riscv_opcodes): Restrict "vt.maskc" and "vt.maskcn"
	to XLEN=64.

gas/ChangeLog:

	* testsuite/gas/riscv/x-ventana-condops-32.d: New failure test.
	* testsuite/gas/riscv/x-ventana-condops-32.l: Likewise.
2023-08-30 04:00:40 +00:00
Alan Modra
aa1e22eb8d objdump: Free sorted_syms on error path
* objdump.c (disassemble_data): Free sorted_syms before returning.
2023-08-30 11:22:23 +09:30
Alan Modra
0283863037 binutils/dwarf.c abbrev list leak
* dwarf.c (process_debug_info): Call free_abrev_list on
	return paths.
2023-08-30 11:22:23 +09:30
Alan Modra
a422bb9db1 Re: readelf/objdump: Handle DWARF info with mixed types of range section
PR 30791
	* dwarf.c (free_debug_information): Free range_versions.
2023-08-30 11:22:23 +09:30
GDB Administrator
0637da3c73 Automatic date update in version.in 2023-08-30 00:00:41 +00:00
Tom de Vries
97319ac805 [gdb/build] Fix C inclusion of nat/x86-cpuid.h
When running test-case gdb.arch/i386-avx512.exp, I run into:
...
 gdb compile failed, In file included from gdb.arch/i386-avx512.c:20:0:
 src/gdb/nat/x86-cpuid.h: In function 'x86_cpuid_count':
 src/gdb/nat/x86-cpuid.h:63:16: error: \
   'nullptr' undeclared (first use in this function)
    if (__eax == nullptr)
                 ^~~~~~~
 src/gdb/nat/x86-cpuid.h:63:16: note: each \
   undeclared identifier is reported only once for each function it appears in

                  === gdb Summary ===

 # of untested testcases         1
...

This is due to commit e85aad4ae7 ("nat/x86-cpuid.h: Add x86_cpuid_count
wrapper around __get_cpuid_count"), which introduced the nullptr check.

The header file gdb/nat/x86-cpuid.h is a file that is included in the build
and compiled as a C++ file, but also in the testsuite and compiled as a C
file.

Fix this by replacing nullptr with (void *)0.

Tested on x86_64-linux.

Co-Authored-By: Kevin Buettner <kevinb@redhat.com>
Approved-by: Kevin Buettner <kevinb@redhat.com>
2023-08-29 22:40:36 +02:00
Tom Tromey
2922821e4f More renames in array_operation::evaluate
array_operation::evaluate has variables named "tem2" and "tem3".  This
patch replaces one with a better name, and entirely removes the other.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Tom Tromey
b47331bf90 Remove "highbound" parameter from value_array
value_array requires the passed-in bounds to match the length of the
array_view it is given.  This patch removes the redundant "highbound"
parameter.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Tom Tromey
8b2ac9b216 Remove another redundant variable from array_operation::evaluate
This removes yet another redundant variable from
array_operation::evaluate -- only one index is needed.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Tom Tromey
21bdf43aa2 Remove redundant variable from array_operation::evaluate
In array_operation::evaluate, 'idx' and 'tem' are redundant in one
branch.  This patch merges them, using the clearer name.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Tom Tromey
9c00ec6fe0 Hoist array bounds check in array_operation::evaluate
This hoists the array bounds check in array_operation::evaluate to
before the loop.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Tom Tromey
0f2d28db8e Declare 'tem' in loop header in array_operation::evaluate
This changes array_operation::evaluate to declare the 'tem' variable
in the loop header, rather than at the top of the function.  This is
cleaner and easier to reason about.  I also changed 'nargs' to be
'const'.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Tom Tromey
c73556cb0e Use gdb::array_view for value_array
This changes value_array to accept an array view.  I also replaced an
alloca with a std::vector in array_operation::evaluate.  This function
can work on any size of array, so it seems bad to use alloca.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29 13:36:55 -06:00
Simon Marchi
4fd1ba162e gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
When running this test on a processor that supports AVX512 (AMD EPYC
9634) on Debian 12 bookwork (system compiler is gcc 12.2.0), I see:

    continue^M
    Continuing.^M
    Process record does not support instruction bound.^M
    Process record does not support instruction 0x62 at address 0x7ffff7f49b40.^M
    Process record: failed to record execution log.^M
    ^M
    Program stopped.^M
    0x00007ffff7f49b40 in ?? () from /lib/x86_64-linux-gnu/libc.so.6^M
    (gdb) FAIL: gdb.reverse/step-precsave.exp: run to end of main

The instruction at this address is:

   0x00007ffff7f49b40:	62 e2 7d 48 7a c6   vpbroadcastb %esi,%zmm16

This seems like an AVX512 instruction (given the use of zmm16).  Match
this byte value in order to produce a KFAIL.

Change-Id: I1d20357fa538ba60b9c537160acf511a37d751ee
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30807
Approved-By: Tom Tromey <tom@tromey.com>
2023-08-29 13:44:01 -04:00
Tom de Vries
8468e03688 [gdb/testsuite] Require have_compile_flag -mavx512f in gdb.arch/i386-avx512.exp
When running test-case gdb.arch/i386-avx512.exp with gcc 4.8.4, I run into:
...
Running gdb.arch/i386-avx512.exp ...
gdb compile failed, gcc: error: unrecognized command line option '-mavx512f'
...

Fix this by requiring have_compile_flag -mavx512f.

Tested on x86_64-linux.
2023-08-29 17:27:19 +02:00
Tom de Vries
8370a35d4b [gdb/testsuite] Require gcc >= 5 in gdb.linespec/cpls-abi-tag.exp
When running test-case gdb.linespec/cpls-abi-tag.exp with gcc 4.8.4, we run
into:
...
cpls-abi-tag.cc:71:26: error: ‘abi_tag’ attribute applied to non-function ‘s’
 ABI3 test_abi_tag_struct s;
                          ^
...

The test-case is supported starting gcc 5.

Fix this by requiring gcc >= 5, if a gcc compiler is used.

Tested on x86_64-linux.
2023-08-29 17:27:19 +02:00
Tom de Vries
62b28bd668 [gdb/testsuite] Handle some test-cases with older compiler
When running test-case gdb.mi/print-simple-values.exp with gcc 4.8.4, I run
into a compilation failure due to the test-case requiring c++11 and the
compiler defaulting to less than that.

Fix this by compiling with -std=c++11.

Likewise in a few other test-cases.

Tested on x86_64-linux.
2023-08-29 17:27:19 +02:00
Tom de Vries
ee12f46f45 [gdb/testsuite] Fix false negative in have_host_locale
In test-case gdb.tui/pr30056.exp we check for:
...
require {have_host_locale C.UTF-8}
...

The "C.UTF-8" is normalized by have_host_locale to "c.utf8", before trying to
find it in the list returned by host_locales.

On my development platform, "locale -a" lists C.utf8, which is normalized to
"c.utf8" by host_locales, so there's a match and have_host_locale returns true.

On another platform however, "locale -a" lists C.UTF-8, which is normalized to
"c.utf-8" by host_locales, so there's no match and have_host_locale returns false.

Fix this by also dropping the dash in host_locales.

Tested on x86_64-linux.
2023-08-29 17:27:19 +02:00
Nicolas Boulenguez
90de8f9c80 readelf: typos in user messages 2023-08-29 16:04:47 +01:00
Tom Tromey
aa7b36b832 Default getpkt 'forever' parameter to 'false'
This patch changes remote.c so that the getpkt 'forever' parameter now
defaults to 'false' and fixes up all the callers.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29 08:14:18 -06:00
Tom Tromey
a60f93c774 Unify getpkt and getpkt_or_notif_sane
getpkt and getpkt_or_notif_sane are just wrappers for
getpkt_or_notif_sane_1.  This patch adds the is_notif parameter to
getpkt, with a suitable default, and removes the wrappers.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29 08:14:18 -06:00
Tom Tromey
8756b726c2 Use bool in getpkt
This changes getpkt and related functions to use bool rather than int.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29 08:14:18 -06:00
Tom Tromey
ef6a984378 Remove expecting_notif parameter from getpkt_or_notif_sane_1
For getpkt_or_notif_sane_1, expecting_notif is redundant, because it
always reflects whether the is_notif parameter is non-NULL.  This
patch removes the redundant parameter.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29 08:14:18 -06:00
Tom Tromey
74b180e0d8 Remove getpkt_sane
I noticed that getpkt is just a wrapper around getpk_sane, so this
patch unifies the two of them.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29 08:14:18 -06:00
Tom de Vries
130e33d861 [gdb/testsuite] Check for sys/random.h in gdb.reverse/getrandom.exp
When running test-case gdb.reverse/getrandom.exp on a system with eglibc 2.19,
we run into:
...
 gdb compile failed, gdb.reverse/getrandom.c:18:24: fatal error: \
   sys/random.h: No such file or directory
  #include <sys/random.h>
                         ^
 compilation terminated.

                 === gdb Summary ===

 # of untested testcases        1
...
and:
...
UNTESTED: gdb.reverse/getrandom.exp: failed to prepare
...

Fix this by testing for the presence of the header, such that we have instead:
...
UNSUPPORTED: gdb.reverse/getrandom.exp: require failed: \
  have_system_header sys/random.h
...

Tested on x86_64-linux and i686-linux.
2023-08-29 11:02:08 +02:00
GDB Administrator
c58d51c612 Automatic date update in version.in 2023-08-29 00:00:37 +00:00
Tom de Vries
0789a13f8a [gdb/testsuite] Improve xfail in gdb.cp/nsusing.exp
In test-case gdb.cp/nsusing.exp I came across these xfails without PRMS
mentioned:
...
XFAIL: gdb.cp/nsusing.exp: print x, before using statement
XFAIL: gdb.cp/nsusing.exp: print x, only using M
...

Add the missing PRMS, such that we have:
...
XFAIL: gdb.cp/nsusing.exp: print x, before using statement (PRMS gcc/108716)
XFAIL: gdb.cp/nsusing.exp: print x, only using M (PRMS gcc/108716)
...
and limit the xfail to unfixed versions.

The PR is fixed starting gcc 13, but it has been backported to release
branches stretching back to gcc 10.  For simplicity we just stick to testing
for the major version and ignore the backported fixes.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-08-28 23:42:11 +02:00