Commit Graph

117277 Commits

Author SHA1 Message Date
Mike Frysinger
0c53b9d697 sim: ppc: switch to AS_HELP_STRING for automatic formatting 2024-01-02 01:41:55 -05:00
Mike Frysinger
5b6d72c9a5 sim: ppc: drop now unused config.in 2024-01-02 01:41:55 -05:00
Mike Frysinger
93c0f1cf94 sim: ppc: move defines.h generation to the top-level
Since we rely on the top-level config.h now, the defines.h generation
step should live here too.
2024-01-02 00:35:59 -05:00
Mike Frysinger
82931068f4 sim: ppc: drop configure compiler checks
Now that the ppc script only checks configure options and sets up
variables in the Makefile from those, delete all the compile related
logic to greatly simplify the configure script.
2024-01-02 00:35:45 -05:00
Mike Frysinger
2c7cc02f96 sim: ppc: drop custom config.h header
Now that everything has moved to the top-level, we can drop the
custom ppc config.h and reuse the common one.
2024-01-02 00:34:55 -05:00
Mike Frysinger
0b5415c13c sim: ppc: stop including headers from gdb/
The common sim code doesn't snoop in gdb/, and the ppc code doesn't
need to either.  Any common code we pull from gnulib/ now only.
2024-01-02 00:34:34 -05:00
Mike Frysinger
6bf212a8ac sim: ppc: move termios probes to top-level
This is the last compile-time logic in the ppc subdir.
2024-01-02 00:34:15 -05:00
Mike Frysinger
0168f1aedf sim: ppc: switch to AC_CACHE_CHECK
This macro replaces the AC_MSG_CHECKING+AC_CACHE_VAL+AC_MSG_RESULT
which reduces the boilerplate in here a little bit.
2024-01-02 00:32:48 -05:00
Mike Frysinger
1a9f6039fb sim: ppc: switch struct member checks to AC_CHECK_MEMBER
This covers a lot of the AC_MSG_CHECKING+AC_TRY_COMPILE+AC_MSG_RESULT
boilerplate and matches what we do in the top-level platform checks.
2024-01-02 00:32:29 -05:00
Mike Frysinger
e04ab9b01a sim: ppc: move termio defines to config.h
Move the defines from explicit -D options to config.h defines to simplify
the build and make it easier to move to the top-level configure.
2024-01-02 00:31:55 -05:00
Mike Frysinger
d43207b057 sim: ppc: move struct statfs to top-level 2024-01-02 00:31:40 -05:00
Mike Frysinger
568432432a sim: ppc: move long long test to top-level
While the sim code doesn't utilize HAVE_LONG_LONG itself, other code
(like libiberty) seem to, so check for it in the top-level for all
ports to leverage.
2024-01-02 00:31:08 -05:00
Mike Frysinger
d472066471 sim: ppc: hoist sysv tests to top-level
Now that the sysv tests turn into config.h defines and everything
checks that, we can move the tests to the top-level and out of the
ppc subdir.
2024-01-02 00:29:29 -05:00
Mike Frysinger
bc756034ee sim: ppc: always compile in the sysv sem & shm device files
Move the stub logic to the device files themselves.  This makes the
configure & build logic more static which will make it easier to move
to the top-level build, and matches what we did with the common/ hw
tree already.

This also decouples the logic from the two -- in the past, you needed
both sem & shm in order to enable the device models, but now each one
is tied to its own independent knob.  Practically speaking, this will
probably not make a difference, but it simplifies the build a bit.
2024-01-02 00:29:28 -05:00
Mike Frysinger
d961049a26 sim: ppc: change SysV sem & shm tests to compile-time
Instead of executing code to see if SysV semaphores & shared memory
are available, switch to just a compile-time test.  The system used
to compile might not match the system used to run the code wrt the
current kernel & OS settings, but the library APIs should.  So move
the failures from compile-time to runtime so the program is more
portable, and works correctly even when cross-compiling.
2024-01-02 00:29:28 -05:00
Mike Frysinger
d237a93af3 sim: ppc: merge System V semaphores checks
Compile tests can use earlier defines, so hoist the HAVE_UNION_SEMUN
define to before the semaphore check, and use it in the test so that
we can merge the 2 versions into one.

This also defines HAVE_UNION_SEMUN even when ac_cv_sysv_sem is not
set, but that's OK as this define is only about a type existing, not
about whether the overall code is usable.
2024-01-02 00:29:28 -05:00
Mike Frysinger
4d4952a63d sim: ppc: fix bad AC_CACHE_CHECK call with semun
The first arg is the cache var name, and this one was typoed relative
to what the call actually set.  We also don't need the manual call to
AC_MSG_RESULT as the AC_CACHE_CHECK takes care of it for us.
2024-01-02 00:29:28 -05:00
Mike Frysinger
d264d78607 sim: ppc: delete unused build compile & link settings
These should have been removed as part of the ppc/igen merging into the
top-level, but they were missed.  Clean up now.
2024-01-02 00:27:12 -05:00
GDB Administrator
f5efa6046b Automatic date update in version.in 2024-01-02 00:00:57 +00:00
Mike Frysinger
1b89e2b720 sim: ppc: merge misc igen APIs
The common igen code provides the same misc APIs as the ppc version,
so delete the ppc code and pull in the common one.  There is one
minor difference: the ppc code has a unique dumpf function.  The
common code switched to lf_printf for the same functionality, but
since that requires changes throughout the igen codebase, delay that
cleanup for now so we can merge the rest.
2024-01-01 18:16:38 -05:00
Mike Frysinger
9ddac092a8 sim: ppc: rework igen error to match common
Switch to an ERROR macro and tweak the error signature to match the
common igen version in preparation for merging the two implementations.
2024-01-01 17:39:09 -05:00
Mike Frysinger
ef993dfa05 sim: igen: extend error to take arguments
The ppc igen error helper allows arbitrary printf calls, so extend
the common one to do the same.
2024-01-01 17:31:12 -05:00
Mike Frysinger
9b6e0cb3ba sim: ppc: rename igen max_insn_bit_size
We want to avoid conflicts with the common igen enums.  This should
get migrated over to the common parsing logic, but for now, switch
the name to avoid redefinition.
2024-01-01 17:30:53 -05:00
Mike Frysinger
fd520e1af1 sim: igen: minor constify logic
Copy some improvements from the ppc igen code.
2024-01-01 17:09:02 -05:00
Mike Frysinger
0a4d338dd0 sim: ppc: unify igen filter_filename implementations
Now that both igen implementations are in the top-level, we can unify
the filter_filename implementation between them since they're the same
(literally the same code).
2024-01-01 17:06:50 -05:00
Mike Frysinger
a243f0a5a1 sim: ppc: replace filter_filename with lbasename
The lbasename function from libiberty provides the same API as this
custom function.  The common/ code already made the switch, so make
the same change to the ppc code to avoid target duplication.
2024-01-01 16:32:48 -05:00
Mike Frysinger
5817b1f52f sim: ppc: hoist igen compilation into top-level
This simplifies the build a bit (especially for deps in port subdirs),
and avoids recursive make.  This in turn speeds up the build, and lets
us reuse existing build-time vs host-time logic from Makefile.am.
2024-01-01 16:12:16 -05:00
Mike Frysinger
179bd7a89d sim: ppc: drop build-config.h usage
This header is only used by the igen tool, and none of the igen code
depends on the configure-time checks.  Delete the logic to simplify
to prepare for moving it to the local.mk code.
2024-01-01 15:59:11 -05:00
Mike Frysinger
a295b6b0cd sim: ppc: simplify filter_host.c logic
Switch this from a build-time generation to a static include.  This
makes the build rules a bit simpler, especially as we move them to
Automake from hand-written makefiles.
2024-01-01 15:59:06 -05:00
Mike Frysinger
2363ba65d7 sim: igen: remove libigen.a when cleaning 2024-01-01 15:51:25 -05:00
Mike Frysinger
22a09a1a33 sim: ppc: drop unused host bitsize settings
This is never set anywhere, so it's always empty.  Scrub it.
2024-01-01 14:52:16 -05:00
Mike Frysinger
f793be444c sim: frv: fix cmpb uninitialized variable usage
This code sets up the cc variable based on the comparison of other
registers, but it does so incrementally with bit operations, and it
never initializes the cc variable.  Initialize it to 0 which the
cmpba insn is already doing.
2024-01-01 10:56:08 -05:00
Mike Frysinger
361a6d49c6 sim: arm: mark local read-only arrays as static const
Move it into read-only data sections to avoid constructing them on the
stack at runtime.
2024-01-01 10:53:15 -05:00
Mike Frysinger
58d38850b6 sim: warnings: enable -Wunused-variable 2024-01-01 10:51:50 -05:00
Mike Frysinger
fa99355b56 cpu: or1k: drop unused l.swa flag
The "flag" argument isn't set/used in this insn, so drop it.
This fixes an unused variable warning in the generated sim.
2024-01-01 10:51:23 -05:00
Tom Tromey
cbbb73f4f9 sim: fix pervasive typo
I noticed a typo in a sim constant.  This patch fixes it.
	permenant -> permanent
2024-01-01 10:44:13 -05:00
GDB Administrator
ee0dbcf99e Automatic date update in version.in 2024-01-01 00:00:49 +00:00
Tom Tromey
6374b0a983 Run 'black' on tui-window.py
Mark pointed out that a recent patch of mine caused the buildbot to
complain about the formatting of some Python test code.  This patch
re-runs 'black' to fix the problem.
2023-12-31 16:36:44 -07:00
Tom de Vries
276e7f5c88 [gdb/testsuite] Fix typo in gdb.base/catch-syscall.exp
On aarch64-linux with a gdb build without libexpat, I run into:
...
(gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \
  catch syscall 59
continue
Continuing.

Catchpoint 5 (call to syscall 59), 0x0000fffff7e04578 in pipe () from \
  /lib64/libc.so.6
(gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: continue
...

In the test-case, this pattern handles either the syscall name or number for
the pipe syscall:
...
  -re -wrap "Catchpoint $decimal \\(call to syscall (pipe|$SYS_pipe)\\).*" {
...
but the pattern for the pipe2 syscall mistakenly uses SYS_pipe instead of
SYS_pipe2:
...
  -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\).*" {
...
and consequently doesn't handle the pipe2 syscall number.

Fix the typo by using SYS_pipe2 instead.

Tested on aarch64-linux.
2023-12-31 09:39:45 +01:00
GDB Administrator
bb5239ce00 Automatic date update in version.in 2023-12-31 00:00:10 +00:00
Tom Tromey
1f1c84ddf7 Add keywords to TuiWindow.write
The gdb docs promise that methods with more than two or more arguments
will accept keywords.  However, I found that TuiWindow.write didn't
allow them.  This patch adds the missing support.
2023-12-30 12:21:44 -07:00
Tom de Vries
11e73fe731 [gdb/testsuite] Fix gdb.base/gdb-index-err.exp for root user
When running test-case gdb.base/gdb-index-err.exp in a container as root user,
I run into:
...
FAIL: gdb.base/gdb-index-err.exp: flag=: \
  try to write index to a non-writable directory
FAIL: gdb.base/gdb-index-err.exp: flag=-dwarf-5: \
  try to write index to a non-writable directory
...

The test-case creates a directory without write permissions:
...
$ ls -ald private
dr-xr-xr-x 2 root root 4096 Dec 29 06:26 private/
...
but apparently the root user is still able to write in it.

Fix this by making the test unsupported for the root user.

Tested on x86_64-linux.

Reviewed-By: Lancelot SIX <lancelot.six@amd.com>

PR testsuite/31197
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31197
2023-12-30 20:04:10 +01:00
Alan Modra
3838f0bc10 LoongArch: Commas inside double quotes
This adds an extra feature: Commas inside double quotes are not an
arg delimiter, and thus can be part of the arg.

	* loongarch-coder.c (loongarch_split_args_by_comma): Commas
	inside quotes are not arg delimiters.
2023-12-30 12:59:23 +10:30
Alan Modra
3957a3fb0e Regen bfd-in2.h
Please DON'T edit this file.  READ THE COMMENT!
2023-12-30 12:59:23 +10:30
Joseph Myers
b383acf248 MAINTAINERS: Update my email address
There will be another update in January.
2023-12-30 00:32:00 +00:00
GDB Administrator
0ede03b519 Automatic date update in version.in 2023-12-30 00:00:23 +00:00
H.J. Lu
302a296de0 x86: Append "#pass" to APX tests
Append "#pass" to APX tests for targets which pad text sections with NOPs.

	* testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Append
	"#pass".
	* testsuite/gas/i386/x86-64-apx-ndd-optimize.d: Likewise.
	* testsuite/gas/i386/x86-64-apx-ndd.d: Likewise.
	* testsuite/gas/i386/x86-64-apx-pushp-popp-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-apx-pushp-popp.d: Likewise.
2023-12-29 15:46:59 -08:00
H.J. Lu
2eda6e3ecd x86: Don't use .insn with '/'
'/' starts a comment for some targets.  Use .byte instead of .insn with
'/'.

	* testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Use .byte
	instead of .insn with '/'.
2023-12-29 15:43:07 -08:00
H.J. Lu
eed38d8a02 Fix x86-64: Add R_X86_64_CODE_4_GOTPCRELX
commit 3d5a60de52
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jun 8 10:01:03 2023 -0700

    x86-64: Add R_X86_64_CODE_4_GOTPCRELX

added a new field, fx_tcbit3, to fix.  But it didn't initialize it.
Fix it by clearing it in fix_new_internal.

	* wrtite.c (fix_new_internal): Clear fx_tcbit3.
2023-12-29 12:44:05 -08:00
Nils-Christian Kempke
3396471b4c dwarf, fortran: add support for DW_TAG_entry_point
Fortran provides additional entry points for subroutines and functions.
These entry points may use only a subset (or a different set) of the
parameters of the original subroutine.  The entry points may be described
via the DWARF tag DW_TAG_entry_point.

This commit adds support for parsing the DW_TAG_entry_point DWARF tag.
Currently, between ifx/ifort/gfortran, only ifort is actually emitting
this tag.  Both, ifx and gfortran use the DW_TAG_subprogram tag as
workaround/alternative.  Thus, this patch really only adds more ifort
support.  Even so, some of the attached tests still fail for ifort, due
to some wrong line info generated for the entry points in ifort.

After this patch it is possible to set a breakpoint in gdb with the
ifort compiled example at the entry points 'foo' and 'foobar', which was not
possible before.

As gcc and ifx do not emit the tag I also added a test to gdb.dwarf2
which uses some underlying c compiled code and adds some Fortran style DWARF
to it emitting the DW_TAG_entry_point.  Before this patch it was not
possible to actually define breakpoint at the entry point tags.

For gfortran there actually exists a bug on bugzilla, asking for the use
of DW_TAG_entry_point over DW_TAG_subprogram:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37134

This patch was originally posted here

https://sourceware.org/legacy-ml/gdb-patches/2017-07/msg00317.html

but its review/pinging got lost after a while.  I reworked it to fit the
current GDB.

Co-authored-by: Bernhard Heckel <bernhard.heckel@intel.com>
Co-authored-by: Tim Wiederhake  <tim.wiederhake@intel.com>
Approved-by: Tom Tromey <tom@tromey.com>
2023-12-29 11:31:10 +01:00