Commit graph

114980 commits

Author SHA1 Message Date
Tom de Vries
f4afd6cb1b [gdb] Fix grammar in comments and docs
Fix grammar in some comments and docs:
- machines that doesn't -> machines that don't
- its a -> it's a
- its the -> it's the
- if does its not -> if it does it's not
- one more instructions if doesn't match ->
  one more instruction if it doesn't match
- it's own -> its own
- it's first -> its first
- it's pointer -> its pointer

I also came across "it's performance" in gdb/stubs/*-stub.c in the HP public
domain notice, I've left that alone.

Tested on x86_64-linux.
2023-06-05 12:53:15 +02:00
Tom de Vries
3bfdcabbc2 [gdb] Fix more typos
Fix some more typos:
- distinquish -> distinguish
- actualy -> actually
- singe -> single
- frash -> frame
- chid -> child
- dissassembler -> disassembler
- uninitalized -> uninitialized
- precontidion -> precondition
- regsiters -> registers
- marge -> merge
- sate -> state
- garanteed -> guaranteed
- explictly -> explicitly
- prefices (nonstandard plural) -> prefixes
- bondary -> boundary
- formated -> formatted
- ithe -> the
- arrav -> array
- coresponding -> corresponding
- owend -> owned
- fials -> fails
- diasm -> disasm
- ture -> true
- tpye -> type

There's one code change, the name of macro SIG_CODE_BONDARY_FAULT changed to
SIG_CODE_BOUNDARY_FAULT.

Tested on x86_64-linux.
2023-06-05 12:53:15 +02:00
Alan Modra
fc998e4cb7 bfd_error_on_input messages
bfd_errmsg uses asprintf for bfd_error_on_input, which means we
currently leak memory.  Keep a static pointer to the message and free
it in various places to minimise the leaks.
bfd_set_input_error (NULL, bfd_error_no_error) is a way to free up the
last string if that matters.

	* bfd.c (input_error_msg): New static var.
	(bfd_set_input_error): Free it here..
	(bfd_init): ..and here..
	(bfd_errmsg): ..and here.  Use it for asprintf output.
2023-06-05 16:47:44 +09:30
Alan Modra
6fc018e9e5 Yet another ecoff fuzzed object fix
* ecoff.c (_bfd_ecoff_slurp_symbol_table): Sanity check fdr_ptr
	csym against remaining space for symbols.  Error on out of bounds
	fdr_ptr fields.
2023-06-05 16:47:44 +09:30
YunQiang Su
5b207b9194 MIPS: sync oprand char usage between mips and micromips
We should try our best to make mips32 using the same
oprand char with micromips. So for mips32, we use:

  ^  is added for 5bit sa oprand for some new DSPr2 instructions:
	APPEND, PREPEND, PRECR_SRA[_R].PH.W
	the LSB bit is 11, like RD.
  +t is removed for coprocessor 0 destination register.
	'E' does the samething.
  +t is now used for RX oprand for MFTR/MTTR (MT ASE)
  ?  is added for sel oprand for MFTR/MTTR (MT ASE)
	For mips32, the position of sel in MFTR/MTTR is same with mfc0 etc,
	while for micromips, they are different.

We also add an extesion format of cftc2/cttc2/mftc2/mfthc2/mttc2/mtthc2:
	concatenating rs with rx as the index of control or data.
2023-06-05 11:14:49 +08:00
YunQiang Su
acce83dacf MIPS: add MT ASE support for micromips32
These instructions are descripted in MD00768.

MIPS® Architecture for Programmers
Volume IV-f: The MIPS® MT Module for
the microMIPS32™ Architecture

Document Number: MD00768
Revision 1.12
July 16, 2013

https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00768-1C-microMIPS32MT-AFP-01.12.pdf
2023-06-05 11:14:46 +08:00
YunQiang Su
c0f7927b3d Revert "MIPS: add MT ASE support for micromips32"
This reverts commit 783a5f46b0.
2023-06-05 11:10:23 +08:00
YunQiang Su
783a5f46b0 MIPS: add MT ASE support for micromips32
These instructions are descripted in MD00768.

MIPS® Architecture for Programmers
Volume IV-f: The MIPS® MT Module for
the microMIPS32™ Architecture

Document Number: MD00768
Revision 1.12
July 16, 2013

https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00768-1C-microMIPS32MT-AFP-01.12.pdf
2023-06-05 11:06:10 +08:00
YunQiang Su
a0631c1501 MIPS: fix some ld testcases with compiler
1. config/default.exp:
	use -mabi=32 not for -gnuabi64
	xfail_from_runlist: remove an element and mark it xfail.
2. ld-elf/indirect.exp: xfail
	indirect5a indirect5b indirect6a indirect6b
	indirect5c indirect5d indirect6c indirect6d
3. ld-elf/pr23658-2: mips output is not common
4. ld-elf/shared.exp: non-run on mips: Build libpr16496b.so
5. ld-elfvers/vers.exp:
	xfail vers4, vers4b
	no-run on mips: vers24a, vers24b, vers24c
6. ld-gc/gc.exp: add -KPIC into asflags for pr13683, pr14265, pr19161
7. ld-mips-elf/mips-elf.exp:
	use noarch for mips16-local-stubs-1, since it use -mips4
8. ld-plugin/lto.exp:
	no-run on mips/linux: PR ld/12982
	add -KPIC into asflags for lto-3r, lto-5r, PR ld/19317 (2)
	xfail PR ld/15323 (4), PR ld/19317 (3)
9. ld-plugin/plugin.exp: xfail
	plugin claimfile lost symbol
	plugin claimfile replace symbol
	plugin claimfile replace symbol
	plugin claimfile lost symbol with source
	plugin claimfile replace symbol with source
	plugin claimfile resolve symbol with source
	plugin 2 with source lib
	load plugin 2 with source
	plugin 3 with source lib
	load plugin 3 with source
11. ld-selective/selective.exp: add -fno-PIC, which is needed for -mno-abicalls
12. ld-shared/shared.exp: xfail shared (non PIC), shared (PIC main, non PIC so)
2023-06-05 11:00:15 +08:00
YunQiang Su
cb81e84c72 MIPS: fix -gnuabi64 testsuite
Test on:
	mips64-linux-gnuabi64
	mips64el-linux-gnuabi64
	mipsisa64-linux-gnuabi64
	mipsisa64el-linux-gnuabi64
	mipsisa64r2-linux-gnuabi64
	mipsisa64r2el-linux-gnuabi64
	mipsisa64r6-linux-gnuabi64
	mipsisa64r6el-linux-gnuabi64
2023-06-05 11:00:15 +08:00
YunQiang Su
ffc528aed5 MIPS: fix r6 testsuites
Introduce
	run_dump_test_o32l
	run_dump_test_n32l
	run_dump_test_n64l
Which use `-march=from-abi` for pre-R6 testcases,
like micromips/mips16e etc.

For cases doesn't use run_dump_test_*, we use
	-mips32r2 for micromips32
	-mips1 for mips16-32
	-march=from-abi for testcases to o32/n32/n64 both/all.

Replace `addi` with `addiu` for some cases for both r6 and pre-R6.

Introduce some new testcases for r6 with FPXX/FP64.
Introduce new testcase: comdat-reloc-r6.

Skip `default` in mips_arch_list_matching if triple is mipsisa*, due to:
  1)it will cannot match mipsr6@*.d: since mips32rN/mips64rN
    will always be used, it won't be a problem.
  2)some test think -march=mips64rN will alway true for mipsisa64rN,
    which is not true now.

This patch fix testsuite for all r6-default gnu triples:
  mipsisa32r6-linux-gnu
  mipsisa32r6el-linux-gnu
  mips-img-linux-gnu
  mipsel-img-linux-gnu
  mipsisa64r6-linux-gnu
  mipsisa64r6el-linux-gnu
2023-06-05 11:00:14 +08:00
YunQiang Su
be0d391f22 MIPS: default r6 if vendor is img
This behavior is used by downstream toolchain since 2014.
We also set the default ABI for mips*-img-elf to O32.
The previous value is NO_ABI, which is not good default ABI.

We don't support mips64*-img* due to GCC doesn't support it,
and We believe that the multilib should be used for this case.
2023-06-05 11:00:14 +08:00
YunQiang Su
094025a30b MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit
When configure with triples mipsisa[32,64]rN[el,], the march value
is pinned to a fix value if not given explicitly. for example
   1) mipsisa32r6-linux-gnu -n32 xx.s will complains that:
      -march=mips32r6 is not compatible with the selected ABI
   2) mipsisa64r2el-linux-gnu -o32 generates objects with 64bit CPU:
      ELF 32-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV)
They are not good default behaviors: Let's alter the CPU info

Since we are using these triples as a regular linux distributions,
let's alter march according to ABI.
2023-06-05 11:00:14 +08:00
GDB Administrator
fa1ccf7895 Automatic date update in version.in 2023-06-05 00:00:39 +00:00
GDB Administrator
a366c78c1b Automatic date update in version.in 2023-06-04 00:00:34 +00:00
Tom de Vries
33b5899fc0 [gdb] Fix typos
Fix a few typos:
- implemention -> implementation
- convertion(s) -> conversion(s)
- backlashes -> backslashes
- signoring -> ignoring
- (un)ambigious -> (un)ambiguous
- occured -> occurred
- hidding -> hiding
- temporarilly -> temporarily
- immediatelly -> immediately
- sillyness -> silliness
- similiar -> similar
- porkuser -> pokeuser
- thats -> that
- alway -> always
- supercede -> supersede
- accomodate -> accommodate
- aquire -> acquire
- priveleged -> privileged
- priviliged -> privileged
- priviledges -> privileges
- privilige -> privilege
- recieve -> receive
- (p)refered -> (p)referred
- succesfully -> successfully
- successfuly -> successfully
- responsability -> responsibility
- wether -> whether
- wich -> which
- disasbleable -> disableable
- descriminant -> discriminant
- construcstor -> constructor
- underlaying -> underlying
- underyling -> underlying
- structureal -> structural
- appearences -> appearances
- terciarily -> tertiarily
- resgisters -> registers
- reacheable -> reachable
- likelyhood -> likelihood
- intepreter -> interpreter
- disassemly -> disassembly
- covnersion -> conversion
- conviently -> conveniently
- atttribute -> attribute
- struction -> struct
- resonable -> reasonable
- popupated -> populated
- namespaxe -> namespace
- intialize -> initialize
- identifer(s) -> identifier(s)
- expection -> exception
- exectuted -> executed
- dungerous -> dangerous
- dissapear -> disappear
- completly -> completely
- (inter)changable -> (inter)changeable
- beakpoint -> breakpoint
- automativ -> automatic
- alocating -> allocating
- agressive -> aggressive
- writting -> writing
- reguires -> requires
- registed -> registered
- recuding -> reducing
- opeartor -> operator
- ommitted -> omitted
- modifing -> modifying
- intances -> instances
- imbedded -> embedded
- gdbaarch -> gdbarch
- exection -> execution
- direcive -> directive
- demanged -> demangled
- decidely -> decidedly
- argments -> arguments
- agrument -> argument
- amespace -> namespace
- targtet -> target
- supress(ed) -> suppress(ed)
- startum -> stratum
- squence -> sequence
- prompty -> prompt
- overlow -> overflow
- memember -> member
- languge -> language
- geneate -> generate
- funcion -> function
- exising -> existing
- dinking -> syncing
- destroh -> destroy
- clenaed -> cleaned
- changep -> changedp (name of variable)
- arround -> around
- aproach -> approach
- whould -> would
- symobl -> symbol
- recuse -> recurse
- outter -> outer
- freeds -> frees
- contex -> context

Tested on x86_64-linux.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
343704a6d7 [gdb/tdep] Fix typo in debug message
In microblaze_analyze_prologue in gdb/microblaze-tdep.c I came across:
...
	  microblaze_debug ("got addi r1,r1,%d; contnuing\n", imm);
...

Fix this by using "continuing".

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
2242afe896 [gdb/python] Fix doc string of valpy_const_value
In gdb/python/py-value.c, in the value_object_methods array I noticed:
...
  { "const_value", valpy_const_value, METH_NOARGS,
    "Return a 'const' qualied version of the same value." },
...

Fix the qualied -> qualified typo.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
26236df340 [gdb/guile] Fix doc string for value-optimized-out?
In gdb/guile/scm-value.c, I noticed in the value_functions array initializer:
...
  { "value-optimized-out?", 1, 0, 0,
    as_a_scm_t_subr (gdbscm_value_optimized_out_p),
    "\
Return #t if the value has been optimizd out." },
...
There's a typo in the doc string.

Fix this by using "optimized".

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
2829d6da38 [gdb/tui] Fix help text of show tui tab-width
I noticed:
...
(gdb) help show tui tab-width
Show the tab witdh, in characters, for the TUI.
This variable controls how many spaces are used to display a tab character.
...
a typo: "witdh".

Fix this by using "width" instead.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
8def33e68c [gdb/cli] Fix help text of maint info target-sections
I noticed a typo:
...
(gdb) help maint info target-sections
List GDB's internal section table.

Print the current targets section list.  This is a sub-set of all
sections, from all objects currently loaded.  Usually the ALLOC
sectoins.
...

Fix this by using "sections".

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
a383ee4099 [gdb/cli] Fix help text of maint set ignore-prologue-end-flag
I noticed here:
...
(gdb) help maint set ignore-prologue-end-flag
Set if the PROLOGUE-END flag is ignored.
The PROLOGUE-END flag from the line-table entries is used to place \
  breakpoints past the prologue of functions.  Disabeling its use use forces \
  the use of prologue scanners.
...
a typo in "Disabeling" and accidental word repetition "use use".

Fix by replacing with "Disabling" and "use".

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
2595faaa1c [gdb/compile] Fix typo in debug message
In compile_object_load in gdb/compile/compile-object-load.c I came across:
...
			"Connectiong ELF symbol \"%s\" to the .toc section (%s)\n",
...

Fix this typo by using "Connecting" instead.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
9e92dbaa0c [gdbserver] Fix typo in debug message
I noticed in emit_ops_insns in gdbserver/linux-aarch64-low.cc:
...
  threads_debug_printf ("Adding %d instrucions at %s",
...

Fix the typo by using "instructions" instead.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom de Vries
6d280fed3d [gdb/ada] Fix argument name misspelling
Two functions use the argument name bounds_prefered_p.

This misspells "preferred".

Fix this by using bounds_preferred_p instead.

Tested on x86_64-linux.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Alan Modra
89c70cd358 Re: loongarch readelf support
Another segfault.

	* readelf.c (target_specific_reloc_handling): Sanity check
	loongarch reloc r_offset.
2023-06-03 17:17:57 +09:30
Alan Modra
c6e6e3ab2b Re: More ecoff sanity checks
Yet another fuzzer fix.

	* ecoff.c (ecoff_slurp_symbolic_header <FIX>): Zero counts when
	associated pointer is zero.
	(_bfd_ecoff_slurp_symbolic_info): Remove now unnecessary check.
2023-06-03 17:17:37 +09:30
GDB Administrator
26cc2053e2 Automatic date update in version.in 2023-06-03 00:00:39 +00:00
Luis Machado
21b9239b70 [AArch64] Fix architecture debug version constant thinkos
Caught this during emulator testing.

Fix the constants. They should be 0xa and 0xb as opposed to 0x10 and
0x11.  There was a thinko while defining them.

Obvious enough.

Tested on aarch64-linux Ubuntu 20.04/22.04.
2023-06-02 06:46:25 +01:00
Alan Modra
63188cb5c3 Re: bfd_close and target free_cached_memory
_bfd_delete_bfd can be called early, before the target xvec is set up.

	* opncls.c (_bfd_delete_bfd): Don't segfault on NULL xvec.
2023-06-02 09:41:49 +09:30
Alan Modra
e0ce6dde97 Re: More ecoff sanity checks
Another fix for fuzzed object files, exhibiting as a segfault in
nm.c filter_symbols when accessing a symbol name.

	* ecoff.c (_bfd_ecoff_slurp_symbol_table): Sanity check
	fdr_ptr->issBase, and tighten sym.iss check.
2023-06-02 09:41:49 +09:30
Alan Modra
74a965d8e0 loongarch readelf support
This fixes two buffer overflows found by fuzzers.

	* readelf.c (target_specific_reloc_handling): Sanity check
	loongarch reloc symbol index.  Don't apply reloc after errors.
	Reduce translation work of "invalid symbol index" error message.
2023-06-02 09:41:49 +09:30
Alan Modra
56e4ccc924 Minor objcopy optimisation for copy_relocations_in_section
* objcopy (copy_relocations_in_section): Don't read the relocs
	for STRIP_ALL if keep_specific_htab is empty.
2023-06-02 09:41:49 +09:30
GDB Administrator
cf6522cb2f Automatic date update in version.in 2023-06-02 00:01:12 +00:00
Indu Bhagat
d987df5c95 libsframe: avoid using magic number
Define a new constant for the maximum number of stack offsets handled in
libsframe, and use it.  Note that the SFrame format does not define such
a constant (limit).  This is an implmentation-defined constant in
libsframe.

include/
	* sframe-api.h (MAX_NUM_STACK_OFFSETS): New definition.
libsframe/
	* sframe.c (sframe_fre_sanity_check_p): Use it.
2023-06-01 09:41:04 -07:00
Indu Bhagat
a5ffdcafc7 libsframe: minor fixups in flip_fre related functions
libsframe/
	* sframe.c (flip_fre_start_address): Remove unnecessary type
	cast.  Use uint16_t instead of unsigned short.
	(flip_fre_stack_offsets): Likewise.
2023-05-31 22:55:41 -07:00
Jim Wilson
ec2260af61 RISC-V: PR30449, Add lga assembler macro support.
Originally discussion, https://github.com/riscv/riscv-isa-manual/pull/539

Added new load address pseudo instruction which is always expanded to GOT
access, no matter the .option rvc is set or not.

gas/
	PR 30449
	* config/tc-riscv.c (macro): Add M_LGA support.
	* testsuite/gas/riscv/la-variants.d: New.
	* testsuite/gas/riscv/la-variants.s: New.
include/
	PR 30449
	* opcode/riscv.h (M_LGA): New.
opcodes/
	PR 30449
	* riscv-opc.c (riscv_opcodes): Add lga support.
2023-06-01 12:25:08 +08:00
Nelson Chu
20ef84ed2a [PR ld/22263][PR ld/24676] RISC-V: Avoid spurious R_RISCV_NONE for TLS GD/IE.
For TLS GD/IE, add the same condition with the relocate_section in the
allocate_dynrelocs, to make sure we won't reserve redundant spaces
for dynamic relocations since the conservative estimatation.

After applying this patch, ld seems no longer generate the spurious
R_RISCV_NONE for pr22263-1 test, and the test in pr24676.

bfd/
	PR ld/22263
	PR ld/24676
	* elfnn-riscv.c (RISCV_TLS_GD_IE_NEED_DYN_RELOC): New defined.
	Set NEED_RELOC to true if TLS GD/IE needs dynamic relocations,
	and INDX will be the dynamic index.
	(allocate_dynrelocs): Don't reserve extra spaces in the rela.got
	if RISCV_TLS_GD_IE_NEED_DYN_RELOC set need_reloc to false.  This
	condition needs to be same as relocate_section.
	(relocate_section): Likewise, use the same condition as
	allocate_dynrelocs.
2023-06-01 12:23:49 +08:00
Alan Modra
6313825cbf Harden PowerPC64 OPD handling against fuzzers
PowerPC64 ELFv1 object files should have at most one .opd section, and
OPD handling in elf64-ppc.c makes use of this fact by caching some
.opd section info in the per-object bfd.tdata.  This was done to avoid
another word in the target specific section data.  Of course, fuzzers
don't respect the ABI, and even non-malicious users can accidentally
create multiple .opd sections.  So it is better to avoid possible
buffer overflows and other confusion when OPD handling for a second
.opd section references data for the first .opd section, by keeping
the data per-section.

The patch also fixes a memory leak, and a corner case where I think we
could hit an assertion in opd_entry_value or read out of bounds in
ppc64_elf_branch_reloc doing a final link producing non-ppc64 output.
(It's a really rare corner case because not only would you need to be
linking ppc64 objects to non-ppc64 output, you'd also need a branch
reloc symbol to be defined in a .opd section of a non-ppc64 input.)

	* elf64-ppc.c (is_ppc64_elf): Move earlier in file.
	(ppc64_elf_branch_reloc): Check symbol bfd before accessing
	ppc64 elf specific data structures.
	(struct ppc64_elf_obj_tdata): Move opd union..
	(struct _ppc64_elf_section_data): ..to here.
	(ppc64_elf_before_check_relocs): Allow for opd sec_type
	already set to sec_opd.
	(ppc64_elf_check_relocs): Only set sec_type to sec_toc when
	unset.  Error for unexpected toc relocs.
	(opd_entry_value): Return -1 when non-ppc64 rather than
	asserting.  Check and set sec_type too.  Adjust for changed
	location of contents and relocs.
	(ppc64_elf_relocate_section): Adjust for changed location of
	cached .opd relocs.
	(ppc64_elf_free_cached_info): New function.
	(bfd_elf64_bfd_free_cached_info): Define.
2023-06-01 09:52:07 +09:30
Alan Modra
8261abd513 bfd_close and target free_cached_memory
bfd_free_cached_info is used in just one place in archive.c, which
means most times we reach bfd_close the function isn't called.  On the
other hand, if bfd_free_cached_info is called we can't do much on the
bfd since it loses all its obj_alloc memory.  This restricts what can
be done in a target _close_and_cleanup.  In particular you can't look
at sections, which leads to duplication of code in target
close_and_cleanup and free_cached_info, eg. elfnn-aarch64.c.

	* opncls.c (_bfd_delete_bfd): Call bfd_free_cached_info.
	* elfnn-aarch64.c (elfNN_aarch64_close_and_cleanup): Delete.
	(bfd_elfNN_close_and_cleanup): Don't define.
	* som.c (som_bfd_free_cached_info): Don't call
	_bfd_generic_close_and_cleanup here.
	(som_close_and_cleanup): Define as _bfd_generic_close_and_cleanup.
2023-06-01 09:51:59 +09:30
Alan Modra
90fd5049bd section_by_target_index memory leak
The rs6000 backend can call coff_section_from_bfd_index from its
object_p function via coff_set_alignment_hook.  If the object doesn't
match, or another target matches too, then the hash table needs to be
freed via a cleanup.

	* coffgen.c (coff_object_cleanup): New function.
	(coff_real_object_p): Return coff_object_cleanup, and call on
	failure path.  Move declaration to..
	* libcoff-in.h: ..here.
	(coff_object_cleanup): Declare.
	* coff-stgo32.c (go32exe_cleanup): Call coff_object_cleanup.
	(go32exe_check_format): Adjust assertion.
	* libcoff.h: Regenerate.
2023-06-01 09:51:59 +09:30
Alan Modra
d18f60c747 Remove BFD_FAIL in cpu-sh.c
The assertions in cpu-sh.c can be triggered by passing bogus values
in disassemble_info.mach.  This doesn't cause any bfd misbehaviour.

	* cpu-sh.c (sh_get_arch_from_bfd_mach): Remove BFD_FAIL.
	(sh_get_arch_up_from_bfd_mach): Likewise.
2023-06-01 09:51:59 +09:30
GDB Administrator
f38f7ef965 Automatic date update in version.in 2023-06-01 00:00:39 +00:00
Vladimir Mezentsev
dd8a4e320b gprofng: Fix -Wsign-compare warning
gprofng/ChangeLog
2023-05-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30490
	* src/LoadObject.cc: Fix -Wsign-compare warning.
2023-05-31 11:46:22 -07:00
Vladimir Mezentsev
defb734195 gprofng: 29470 The test suite should be made more flexible
I add two new targets (check-extra, check-install) for gprofng testing:
  `make check` runs sanity testing for gprofng and takes ~30 secunds.
  `make check-extra` runs all gprofng tests and takes ~20 minutus.
  `make check-install` runs all gprofng tests and uses gprofng installation.

On aarch64, there are unwind problems in libgp-collector.so.
I set ACCT_FILTER to temporarily ignore problematic functions.

gprofng/ChangeLog
2023-05-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/29470
	* Makefile.am: Add check-extra, check-install.
	* Makefile.in: Rebuild
	* testsuite/config/default.exp: Set the GPROFNG variable.
	* testsuite/gprofng.display/display.exp: Updated the test list.
	* testsuite/gprofng.display/jsynprog/Intface.java: Correct copyright.
	* testsuite/gprofng.display/jsynprog/Launcher.java: Likewise.
	* testsuite/gprofng.display/jsynprog/Makefile: Likewise.
	* testsuite/gprofng.display/jsynprog/Routine.java: Likewise.
	* testsuite/gprofng.display/jsynprog/Sub_Routine.java: Likewise.
	* testsuite/gprofng.display/jsynprog/cloop.cc: Likewise.
	* testsuite/gprofng.display/jsynprog/jsynprog.h: Likewise.
	* testsuite/gprofng.display/jsynprog/jsynprog.java: Correct copyright.
	Add the -j option to run the selected functions.
	* testsuite/gprofng.display/synprog/check_results.pl:
	Remove unused environment variable.
	* testsuite/gprofng.display/synprog/synprog.c: Updated DEFAULT_COMMAND.
	* testsuite/lib/Makefile.skel: Apply $(ACCT_FILTER).
	* testsuite/lib/acct.pm: Ignore errors when $(ACCT_FILTER) is set.
	* testsuite/lib/display-lib.exp: Add TARGET_FLAGS in make_args.
2023-05-31 11:46:21 -07:00
Tom Tromey
739f67599a Improve MI -dprintf-insert documentation
I found the documentation for -dprintf-insert a bit unclear.  It
didn't mention the possibility of multiple arguments, and I also
noticed that it implied that the format parameter is optional, which
it is not.

While looking into this I also noticed a few comments in the
implementation that could also be improved.

Then, I noticed a repeated call to strlen in a loop condition, so I
fixed this up as well.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-05-31 12:00:09 -06:00
Tom Tromey
20fcd17479 Pass correct name to @value in gdb.texinfo
I noticed a couple instance of this warning when rebuilding the gdb
info files:

    warning: undefined flag: GDB

The problem is that the wrong argument was passed to @value.  This
patch fixes the problem.
2023-05-31 08:28:01 -06:00
Tom de Vries
0b1cae3530 [gdb/testsuite] Fix gdb.tui/wrap-line.exp with --disable-tui
When running the test-case gdb.tui/wrap-line.exp with a build configured with
--disable-tui, we run into:
...
(gdb) PASS: gdb.tui/wrap-line.exp: width-hard-coded: set width 50
tui new-layout command-layout cmd 1^M
Undefined command: "tui".  Try "help".^M
(gdb) ERROR: Undefined command "tui new-layout command-layout cmd 1".
...

Fix this by guarding the command with allow_tui_tests.

Tested on x86_64-linux.
2023-05-31 15:31:15 +02:00
Tom de Vries
6e9bcaad3f [gdb/testsuite] Fix gdb.tui/pr30056.exp for native-extended-gdbserver
When running test-case gdb.tui/pr30056.exp with target board
native-extended-gdbserver, I run into:
...
Quit^[[K^M^[[B(gdb) PASS: gdb.tui/pr30056.exp: Control-C
Remote debugging from host ::1, port 38810^M
^M(failed reverse-i-search)`xyz': ^M(gdb) target extended-remote \
  localhost:2346^[[7GWARNING: Timed out waiting for EOF in server after \
  monitor exit
...

This is due to the fact that ^C doesn't abort the reverse-i-search.  This
appears to be due to a readline problem.  A PR is open about this: PR
cli/30498.

Add a KFAIL for the PR, and ensure that the isearch is aborted by using ^G,
such that we have a responsive prompt to handle the "monitor exit" command
that native-extended-gdbserver issues.

Tested on x86_64-linux.
2023-05-31 15:06:40 +02:00
Tristan Gingold
768d1d879b pe/coff - add support for base64 encoded long section names
PR 30444
  * coffcode.h (coff_write_object_contents): Handle base64 encoding on PE.  Also check for too large string table.
  * coffgen.c (extract_long_section_name): New function extracted from ... (make_a_section_from_file): ... here.  Add support for base64 long section names. (decode_base64): New function.
2023-05-31 11:20:55 +01:00