Commit Graph

113280 Commits

Author SHA1 Message Date
Mark Harmstone
48afe8b710 gas/testsuite: Add -gcodeview test for aarch64-w64-mingw32
This is a copy of the x86 gas -gcodeview test, with changes made for the
differing instruction lengths between x86 and aarch64.
2023-01-27 04:03:17 +00:00
Mark Harmstone
c194b6ac48 gas: Add CodeView constant for aarch64
Adds the correct constant to the S_COMPILE3 CodeView record when
assembling aarch64-w64-mingw32 with the -gcodeview flag.
2023-01-27 04:03:15 +00:00
Tom Tromey
c95d486d35 Use clean_restart in gdb.base
Change gdb.base to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
9b2234b063 Use clean_restart in gdb.python
Change gdb.python to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
e125b18278 Use clean_restart in gdb.cp
Change gdb.cp to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
eefe81b523 Use clean_restart in gdb.disasm
Change gdb.disasm to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
396b136e89 Use clean_restart in gdb.perf
Change gdb.perf to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
5ae820f38f Use clean_restart in gdb.go
Change gdb.go to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
c852f1aeca Use clean_restart in gdb.stabs
Change gdb.stabs to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
1d6704e0ce Use clean_restart in gdb.fortran
Change gdb.fortran to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
0ce635282e Use clean_restart in gdb.ada
Change gdb.ada to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
e8d8a0df4b Use clean_restart in gdb.dwarf2
Change gdb.dwarf2 to use clean_restart more consistently.
2023-01-26 18:28:32 -07:00
Tom Tromey
b825d4a3de Use clean_restart in gdb.reverse
Change gdb.reverse to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
6dbbae3b67 Use clean_restart in gdb.arch
Change gdb.arch to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
888438e2b4 Use clean_restart in gdb.guile
Change gdb.guile to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
a30f2b7b7e Use clean_restart in gdb.threads
Change gdb.threads to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
3ae2b57582 Use clean_restart in gdb.objc
Change gdb.objc to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
a7e727aea7 Use clean_restart in gdb.trace
Change gdb.trace to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
49e118b61f Use clean_restart in gdb.opencl
Change gdb.opencl to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
4eed72400b Use clean_restart in gdb.linespec
Change gdb.linespec to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
836b6c10cd Use clean_restart in gdb.pascal
Change gdb.pascal to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
3ad2b4af38 Use mi_clean_restart more
This changes a number of MI tests to use mi_clean_restart rather than
separate calls.  This reduces the number of lines, which is nice, and
also provides a nicer model to copy for future tests.
2023-01-26 18:28:31 -07:00
Tom Tromey
d6acf25c03 Start gdb after building executable in mi-basics.exp
A lot of the MI tests start gdb and only then build the executable.
This just seemed weird to me, so I've fixed this up.  In this patch,
no other cleanups are done, the startup is just moved to a more
logical (to me) spot.
2023-01-26 18:28:31 -07:00
Tom Tromey
306e12673e Remove unnecessary call to standard_testfile
This test does not build a program and does not need to call
standard_testfile.
2023-01-26 18:28:31 -07:00
Tom Tromey
eacd228909 Minor "require" fixups
I found a couple of spots that could use "require", and one spot where
hoisting the "require" closer to the top of the file made it more
clear.
2023-01-26 18:28:31 -07:00
Tom Tromey
e1a772ad89 Remove some dead code in gdb.fortran/info-types.exp
An early "return" in this test case prevents a test from running.
This seems to have been intentional and has been in place since:

commit d57cbee932
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Tue Dec 3 13:18:43 2019 +0000

    gdb/testsuite/fortran: Fix info-modules/info-types for gfortran 8+

This patch removes the dead code.
2023-01-26 18:28:31 -07:00
Tom Tromey
879ebc5300 Eliminate spurious returns from the test suite
A number of tests end with "return".  However, this is unnecessary.
This patch removes all of these.
2023-01-26 18:28:31 -07:00
Tom Tromey
9b21b701bb Use clean_restart in gdb.dlang
Change gdb.dlang to use clean_restart more consistently.
2023-01-26 18:28:31 -07:00
Tom Tromey
6b9276b7e6 Use ordinary calling convention for clean_restart
clean_restart accepts a single optional argument.  Rather than using
{args} and handling the argument by hand, change it to use Tcl's own
argument-checking.
2023-01-26 18:28:31 -07:00
GDB Administrator
3efac389d8 Automatic date update in version.in 2023-01-27 00:00:10 +00:00
Alan Modra
d437724a56 Free gas/dwarf2dbg.c dirs
Entries are allocated with xmemdup0.

	* dwarf2dbg.c (dwarf2_cleanup): Free dirs entries.
2023-01-27 08:18:46 +10:30
Alan Modra
dd61b2d1ac Sanity check dwarf5 form of .file
There's a comment a few lines earlier saying that demand_copy_C_string
has already reported an error if it returns NULL.  Given the proximity
I decided not to duplicate the comment.

	* dwarf2dbg.c (dwarf2_directive_filename): Check return of
	demand_copy_C_string for file.
2023-01-27 08:18:46 +10:30
Alan Modra
44a178cc69 resolve gas shift expressions with large exponents to zero
* expr.c (resolve_expression <O_left_shift, O_right_shift>): Resolve
	shifts exceeding bits in a valueT to zero.
2023-01-27 08:18:46 +10:30
Alan Modra
c37de29815 segv in coff_aarch64_addr32nb_reloc
* coff-aarch64.c (coff_aarch64_addr32nb_reloc): When output_bfd
	is NULL (which it is for objdump -W) get the output bfd via the
	input section.
2023-01-27 08:18:45 +10:30
Simon Marchi
4707199bd7 gdb/testsuite: initialize "correct" variable in gdb.cp/cpexprs.exp.tcl
Due to a GDB bug (visible when building with -D_GLIBCXX_DEBUG), GDB
crashes somewhere in the middle of gdb.cp/cpexprs.exp, and thus fails to
read the string, at gdb.cp/cpexprs.exp.tcl:725.  The "correct" variable
doesn't get set, and I then see this TCL error:

  ERROR: can't read "correct": no such variable

Avoid the TCL error by initializing the "correct" variable to a dummy
value.

Change-Id: I828968d9b2d105ef47f8da2ef598aa16a518c059
2023-01-26 15:53:50 -05:00
Simon Marchi
d4c4ea7583 gdb/testsuite/dap: fix gdb.dap/basic-dap.exp disassembly test for PIE
Prior to this patch, I get:

    >>> {"seq": 17, "type": "request", "command": "disassemble", "arguments": {"memoryReference": "0x115d", "instructionCount": 1}}
    Content-Length: 147

    {"request_seq": 17, "type": "response", "command": "disassemble", "success": false, "message": "Cannot access memory at address 0x115d", "seq": 41}FAIL: gdb.dap/basic-dap.exp: disassemble one instruction success
    FAIL: gdb.dap/basic-dap.exp: instructions in disassemble output

The problem is that the PC to disassemble is taken from the breakpoint
insertion response, which happens before running.  With a PIE
executable, that PC is unrelocated, but the disassembly request happens
after relocation.

I chose to fix this by watching for a breakpoint changed event giving
the new breakpoint address, and recording the address from there.  I
think this is an interesting way to fix it, because it adds a bit of
test coverage, I don't think these events are checked right now.

Other ways to fix it would be:

 - Get the address by doing a breakpoint insertion after the program is
   started, or some other way.
 - Do the disassembly by symbol instead of by address.
 - Do the disassembly before running the program.

Change-Id: I3c396f796ac4c8b22e7dfd2fa1c5467f7a47e84e
2023-01-26 14:31:33 -05:00
Simon Marchi
8abd06e066 gdb/testsuite/dap: make dap_wait_for_event_and_check return preceding messages
In the following patch, I change gdb.dap/basic-dap.exp such that after
waiting for some event, it checks if it received another event
meanwhile.  To help with this, make dap_wait_for_event_and_check and
_dap_dap_wait_for_event return a list with everything received before
the event of interest.  This is similar to what
dap_check_request_and_response returns.

Change-Id: I85c8980203a2dec833937e7552c2196bc137935d
2023-01-26 14:31:33 -05:00
Simon Marchi
59db4c934f gdb/testsuite/dap: rename dap_read_event to dap_wait_for_event_and_check
I think that name describes a bit better what the proc does, it is
similar to "wait_for" in tuiterm.exp.

Change-Id: Ie55aa011e6595dd1b5a874db13881ba572ace419
2023-01-26 14:31:33 -05:00
Simon Marchi
faee137249 gdb/testsuite/dap: pass around dicts instead of TON objects
The DAP helper functions generally return TON objects.  However, callers
almost all immediately use ton::2dict to convert them to dicts, to
access their contents.  This commits makes things a bit simpler for them
by having function return dicts directly instead.

The downside is that the TON objects contain type information.  For
instance, a "2" in a TCL dict could have been the integer 2 or the
string "2" in JSON.  By converting to TCL dicts, we lose that
information.  If some tests specifically want to check the types of some
fields, I think we can add intermediary functions that return TON
objects, without having to complicate other callers who don't care.

Change-Id: I2ca47bea355bf459090bae8680c6a917350b5c3f
2023-01-26 14:31:33 -05:00
Simon Marchi
4dde3b33e4 gdb/testsuite/dap: remove catch from dap_read_event
This catch didn't cause me any trouble, but for the same reason as the
preceding patch, I think it's a bit better to just let any exception
propagate, to make for easier debugging.

Change-Id: I1779e62c788b77fef2d50434edf4c3d2ec5e1c4c
2023-01-26 14:31:33 -05:00
Simon Marchi
2e9a03fd2e gdb/testsuite/dap: make dap_request_and_response not catch / issue test result
Following some of my changes, dap_request_and_response was failing and I
didn't know why.  I think it's better to make it not catch any
exception, and just make it do a simple "send request, read response".
If an exception is thrown while sending a request or reading a response,
things are going really badly, it's not like we'll want to recover from
that and continue the test.

Change-Id: I27568d3547f753c3a74e3e5a730d38a8caef9356
2023-01-26 14:31:33 -05:00
Simon Marchi
4cdda229da gdb/testsuite/dap: write requests to gdb.log
This helps following what happens when reading gdb.log.  The downside is
that it becomes harder to tell what text is from GDB and what text is
going to GDB, but I think that seeing responses without seeing requests
is even more confusing.  At least, the lines are prefix with >>>, so
when you see this, you know that until the end of the line, it's
something that was sent to GDB, and not GDB output.

Change-Id: I1ba1acd8b16f4e64686c5ad268cc41082951c874
2023-01-26 14:31:33 -05:00
Simon Marchi
48680a5f9d gdb/testsuite/dap: prefix some procs with _
Prefix some procs that are only used internally with an underscore, to
make it clear they are internal.  If they need to be used by some test
later, we can always un-prefix them.

Change-Id: Iacb8e77363b5d1f8b98d9ba5a6d115aee5c8925d
2023-01-26 14:31:32 -05:00
Simon Marchi
5dd4f3585d gdb/testsuite/dap: use gdb_assert in gdb.dap/basic-dap.exp
Use gdb_assert instead of manual pass/fail.

Change-Id: I71fbc4e37a0a1ef4783056c7424e932651fa397f
2023-01-26 14:31:32 -05:00
Vladimir Mezentsev
2b304f501f gprofng: PR30043 libgprofng.so.* are installed to a wrong location
gprofng/ChangeLog
2023-01-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30043
	PR gprofng/28972
	* src/Makefile.am: Use lib_LTLIBRARIES instead of pkglib_LTLIBRARIES.
	* src/Makefile.in: Rebuild.
2023-01-26 11:00:51 -08:00
Tom de Vries
1d98e564c9 [gdb/testsuite] Add gdb.base/unwind-on-each-insn-{amd64,i386}.exp
The gcc 4.4.x (and earlier) compilers had the problem that the unwind info in
the epilogue was inaccurate.

In order to work around this in gdb, epilogue unwinders were added with a
higher priority than the dwarf unwinders in the amd64 and i386 targets:
- amd64_epilogue_frame_unwind, and
- i386_epilogue_frame_unwind.

Subsequently, the epilogue unwind info problem got fixed in gcc 4.5.0.

However, the epilogue unwinders prevented gdb from taking advantage of the
fixed epilogue unwind info, so the scope of the epilogue unwinders was
limited, bailing out for gcc >= 4.5.0.

There was no regression test added for this preference scheme, so if we now
declare epilogue unwind info from all gcc versions as trusted, no test will
start failing.

Fix this by adding an amd64 and i386 regression test for this.

I have no gcc 4.4.x lying around, so I fabricated the assembly files by:
- commenting out some .cfi directives to break the epilogue unwind info, and
- hand-editing the producer info to 4.4.7 to activate the fix.

Tested on x86_64-linux, target boards unix/{-m64,-m32}.
2023-01-26 17:21:01 +01:00
Tom de Vries
4fe960e8f1 [gdb/testsuite] Add and use is_x86_64_m64_target
Add new proc is_x86_64_m64_target and use it where appropriate.

Tested on x86_64-linux.
2023-01-26 10:09:44 +01:00
GDB Administrator
f212f7feec Automatic date update in version.in 2023-01-26 00:00:11 +00:00
Mark Harmstone
0f97abf074 ld/testsuite: Add missing targets to PDB tests 2023-01-25 22:26:37 +00:00
Mark Harmstone
9a02fbd198 ld: Add pdb support to aarch64-w64-mingw32
This extends PDB support to the aarch64 PE targets.

The changes to the test files are just to make it so they can be assembled as
either x86, x86_64, or aarch64, mainly by changing the comment style.
The only actual code change here is in adding the architecture constants
to pdb.c.
2023-01-25 22:26:18 +00:00