Commit Graph

2803 Commits

Author SHA1 Message Date
rin 6ca1cfa864 gdb: mknative everyone except for m68000
m68000 is broken due to missing gmp (MKGCCCMDS = no).

clang build for everyone is also broken for the same reason.
We must reconsider to handle gmp in src/lib/Makefile.
2023-08-17 10:21:14 +00:00
rin c84f99d4fb gdb: Remove mknative-generated files for coldfire
toolchain has been broken for a while, and will take time if revive.
2023-08-17 09:03:33 +00:00
rin 38c0925f91 gdb/netbsd: Drop unused functions. NFCI.
Note that these two funcs, nbsd_ilp32_solib_svr4_fetch_link_map_offsets,
and nbsd_lp64_solib_svr4_fetch_link_map_offsets, merely fall back to
default ELF functions.
2023-08-17 07:51:29 +00:00
rin 5b43799d2c gdb/bfd: Drop duplicate entries for source files, lost during merge
No functional changes intended.
2023-08-17 07:47:07 +00:00
rin f5eedda6a9 gdb/vax and ia64: Add missing tdep files for NetBSD
They are also missing for gdb 11.

XXX
For vax, something still wrong. For ia64, compile test only.
2023-08-17 07:45:11 +00:00
rin c1893924c6 gdb/bfd: Disable secure PLT for NetBSD/alpha, lost during merge
Until our ld.elf_so supports it, see PR port-alpha/57511

This does not affect platforms other than alpha.

XXX
mknative later
2023-08-17 07:40:20 +00:00
rin b316a072d2 gdb/bfd: Add initial support to NetBSD-style core file for riscv
Not working yet:
----
Reading symbols from cat...
Reading symbols from /usr/libdata/debug//bin/cat.debug...

warning: Couldn't find general-purpose registers in core file.
Core was generated by `cat'.
Program terminated with signal SIGQUIT, Quit.

warning: Couldn't find general-purpose registers in core file.
#0  <unavailable> in ?? ()
(gdb)
2023-08-17 07:37:36 +00:00
rin 25d89d170e binutils/bfd: Fix target triplets of NetBSD/arm from binutils.old
XXX
mknative later
2023-08-17 07:33:21 +00:00
rin 7b86e0a791 gdb/bfd: Correct default byte-order for armeb, lost during merge
XXX
mknative later
2023-08-17 07:29:22 +00:00
rin 0354cbdac4 gdb/aarch64, ia64: Make constructors called correctly.
For gdb 13, _init_foo_bar functions are registered into init.c by
newly-introduced ``make-init-c'' script. It does not recognize
functions declaration with void argument. As a result, these
constructors are not called for aarch64 and ia64.

XXX
mknative later
2023-08-17 07:25:52 +00:00
rin 83378323c1 gdb/sh: Fix register definitions, lost during merge 2023-08-17 07:16:42 +00:00
rin b7747ad4ee gdb/sh: Stop installing OpenBSD OSABI, lost during merge 2023-08-17 07:09:09 +00:00
rin 3d05278203 gdb: Add support for NetBSD-specific auxv AT_STACKBASE
It was wrongly shown as AT_GID in decimal format.
2023-08-17 06:54:31 +00:00
rin 7b324ce02f binutils/bfd: Correct auxv offset for NetBSD, from gdb/bfd
Fallout not observed yet as far as I can see although...
2023-08-17 06:49:01 +00:00
rin 56b64ad445 gdb/bfd: Fix auxv offset for NetBSD, lost during merge 2023-08-17 06:44:56 +00:00
rin 2448dd4ce0 gdb: Clean up duplicate ATTRIBUTE_NONNULL. No binary changes. 2023-08-17 06:38:08 +00:00
rin 7c758fb6cc gdb/sparc: Sprinkle static to local function, lost during merge 2023-08-17 06:36:43 +00:00
rin 718ce99be8 gdb/hppa: Fix register defs, lost during merge
XXX compile test only
2023-08-17 06:06:09 +00:00
rin b3fed6f2ed gdb/hppa: Reimport non-critical local changes lost during merge
- remove unused variables
- splinkle const
2023-08-17 06:04:09 +00:00
rin 531fa82893 gdb/riscv: Our OSABI is NetBSD, not FreeBSD 2023-08-17 05:55:48 +00:00
rin 5fd0eea9c0 gcc/ppc: Register NetBSD OSABI for rs6000, lost during merge
Otherwise, OSABI is undetermined until executable is loaded.

Add comments also.
2023-08-17 05:53:45 +00:00
rin 86081aae3c gdb: Adjust location of comment for clarity, no binary changes 2023-08-17 05:50:00 +00:00
rin d37bb14df0 gdb/mips: Specify LWP ID for PT_[GS]ET{,FP}REGS, lost during merge 2023-08-17 05:48:09 +00:00
rin 6318e78cc7 gdb/arm: Fix byte-order for trap insns on armv[67]eb, lost during merge
Add comment also.
2023-08-17 05:02:56 +00:00
rin df835a6e50 gdb/arm: Fix PC value for armeb, lost during merge
Extend comments for future references.

XXX
Why uint64_t is unconditionally used as CORE_ADDR even for
LP32 targets? (see gdbsupport/common-types.h)
2023-08-17 04:58:58 +00:00
rin 8780d241a2 gdb/arm: Handle discontinous range of GPR number, lost during merge
Add comment for future references.
2023-08-17 04:54:58 +00:00
rin 9ef1ede90c gdb/arm: Restore upstream comment, accidentally lost during merge
No binary changes.
2023-08-17 04:52:38 +00:00
rin 37d926973c README.gcc12: vax boots into multiuser, but c++ things are broken
- vax builds with lots of newly added -O0 workarounds to avoid
  ICE (not committed yet).
- On simh, it successfully boots into multi-user mode.
- C++ exception handling is broken. For GCC 10.5.0 and priors,
  we have local change for libunwind:

  http://www.execsw.org/netbsd/changeset.cgi?id=20140318T234341Z.c59ac4642e7d4b345f6dc5aa9887e9e1f9aa459a#src/gnu/dist/gcc4/gcc/config/vax/vax.c

  But, mechanically applying it (adjusted-for-GCC-10.5.0 version)
  does not help.
- Native gcc cannot compile hello.c due to ICE, even without
  any optimization.
- Sanitizers do not build yet.
2023-08-17 03:36:25 +00:00
rin 6dfa50a571 README.gcc12: Tiny updates for earm and m68k
evbarmv5-el and mac68k work just fine (no-x11 yet)
2023-08-17 03:14:40 +00:00
rin 49dd50a4ad README.gcc12: riscv64 works just fine without regression for ATF 2023-08-17 03:13:09 +00:00
rin cbb11db8d4 gcc/vax: XXX: Forcibly disable gas(1) directives for CFI table
Otherwise, wired relocation occur for readonly section `.eh_frame',
by which libc.so cannot link:

----
warning: dynamic relocation to `?' in readonly section `.eh_frame'
warning: creating DT_TEXTREL in a shared object
.eh_frame_hdr refers to overlapping FDEs
final link failed: bad value
----

This workaround has been introduced by vax.c, v1.15:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/vax/Attic/vax.c#rev1.15

but accidentally lost during GCC 12.3.0 merge.
2023-08-17 03:08:15 +00:00
rin b3db5323b4 gcc/vax: Restore NetBSD-specific extra specs, lost during merge 2023-08-17 02:55:25 +00:00
rin bc51d17a83 gdb: mknative again for aarch64{,eb} for s/nbsd/netbsd/ changes
Also for ia64, riscv64, sh3e{bl}, and sparc for sure, but
nothing changed.

XXX
mknative adds something like

	-I/usr/src/tools/gdb/obj.machine-arch/.native/include

to include path. This should be dropped...
2023-08-15 09:44:14 +00:00
rin dfe60b963c README.gcc12: Update for earmv5{,eb}, m68k, sh3el
earmv5{,eb}:
- No new regression for full ATF.

m68k:
- blake2_prov.c needs -fno-stack-protector.
- No new regression for full ATF on amiga.

sh3el:
- In addition to kernel, userland is completely broken.
- No interesting diff with upstream in gcc/config/sh.
- Probably, we need bisectioning for GCC...
2023-08-15 04:11:53 +00:00
christos 1da411237a fix cross-build host amd64, target ppc 2023-08-14 22:42:02 +00:00
christos f5a9565a97 - fix the remaining bsd-kvm targets
- remove nbsdelf, everything uses nbsd now
- add missing files
- regen
2023-08-14 20:42:27 +00:00
christos 255a2f50b8 put back the frame unwinder code lost in the merge (J. Hannken-Illjes) 2023-08-14 15:20:37 +00:00
rin 68587ab30c gcc: Host tool gengtype requires version.h
Should fix random failure for parallel build.
2023-08-14 02:21:22 +00:00
christos 9f4404cfb9 regen 2023-08-13 21:29:15 +00:00
christos 3750b21626 put back the kvm code that was lost between 11.0 and 13.2 2023-08-13 21:28:22 +00:00
christos 8604679352 centralize handling of kvm on NetBSD 2023-08-13 21:28:04 +00:00
riastradh eb494815f1 gdb/doc/GDBvn.texi: Omit spurious trailing blank line.
Reduces diff from upstream.
2023-08-13 21:25:55 +00:00
christos fd4c26cb57 restore original contents that got overwriten by the build. 2023-08-13 12:17:17 +00:00
christos e9656f8156 remove building GDBvn.text, it comes with gdb-13.2 2023-08-13 12:16:14 +00:00
christos 4407f5a64c add mipsel 2023-08-13 12:04:11 +00:00
christos 901e7e8475 Add arm, vax 2023-08-11 20:28:31 +00:00
christos 865c57e009 add sparc 2023-08-11 19:44:40 +00:00
christos 2dd295436a add riskv 2023-08-11 18:55:07 +00:00
christos dd40c8a51a fix ia64 2023-08-11 18:25:27 +00:00
christos a45db23f65 Add sh3eb/mipseb 2023-08-11 18:17:52 +00:00
christos ae87de8892 Add powerpc/ia64 2023-08-11 17:46:00 +00:00
christos d16b7486a5 fix i386/hppa 2023-08-11 16:12:58 +00:00
christos fa0e1baf69 fix ppc/psim 2023-08-11 15:18:29 +00:00
christos 8dbf56fefd regen m68k ppc64 2023-08-11 11:28:01 +00:00
mrg b89162e3a3 sh3 releases now build. so did the mips64 ones the other day... 2023-08-11 07:37:48 +00:00
mrg 85f46d0d13 re-enable an sh3 warning that is still needed for GCC 12. 2023-08-11 06:52:45 +00:00
mrg cacddd24c1 make this more like the old lsan_allocator.h change.
adds sh3 and vax build support.
2023-08-11 06:25:17 +00:00
mrg d63739fa12 the sh3 build issue is related to a forced -O0 in strtod.c and PR#55668.
initial tests show it doesn't fail with gcc 10 or 12 (but building with
gcc9 to test there now to be sure.)
2023-08-11 05:34:36 +00:00
christos 15a984a0d9 add mipsn64 2023-08-10 22:45:55 +00:00
christos f187d37a28 add mips64 2023-08-10 21:35:12 +00:00
christos c062eb9437 Add dreamcast 2023-08-10 20:51:04 +00:00
christos 4b00444277 add alpha 2023-08-10 20:41:49 +00:00
christos cb045e26b2 do aarch64eb 2023-08-09 22:14:23 +00:00
christos 972fdaff44 add new files for aarch64 2023-08-09 21:12:50 +00:00
christos a9f1a636ec make aarch64 compile (untested my box is dead) 2023-08-09 21:09:07 +00:00
christos c83e385422 gdb has 3 target.c{,c} now, we need the server version here, not the one
from gdb/target...
2023-08-09 14:56:41 +00:00
riastradh 53924eb523 gcc/README.warnings: Nix trailing whitespace. 2023-08-08 11:50:22 +00:00
mrg a14ca401be update sparc asan issue with details. 2023-08-08 06:42:16 +00:00
mrg 832d47522a introduce new GCC 12 warning disables and use them in a few places
this introduces 4 new warning disable flags:

   CC_WNO_MISSING_TEMPLATE_KEYWORD
   CC_WNO_REGISTER
   CC_WNO_STRINGOP_OVERREAD
   CC_WNO_ARRAY_BOUNDS

and documents them in README.warnings.  of these, the string op
and array bounds are both problematic (real bugs) and also spurious
(not real bugs), and the other 2 are mostly temporary for older
3rd party code.

add some new uses of CC_WNO_STRINGOP_OVERFLOW.

fix m68k build for gallium and GCC 12.
2023-08-08 06:27:31 +00:00
christos f99432b4ef Prevent us from using the phony_iconv_open(). Our iconv_open does not take
"wchar_t" as an argument, so define __STDC_ISO_10646__
2023-08-07 16:52:52 +00:00
christos 0edf003bcd regen 2023-08-07 16:51:40 +00:00
christos 10be27f7df Add missing i386 tdeps 2023-08-07 16:51:24 +00:00
christos f085e02e4c fix config.h confusion 2023-08-07 14:30:48 +00:00
rin 27209b9d10 README.gcc12: Updated aarch64, arm, i386, m68k, powerpc, and sh3
aarch64{,eb}:
- Everything (without x11 yet) works just fine, except for libtsan
  (not a regression, this is newly introduced to aarch64 for GCC12).

earmv5{,eb}:
- As far as I can see, everything (nox11) seems OK.
- Full ATF is on-going.

earmv[67]hf{,eb}:
- Everything (nox11) works just fine.

i386:
- lib*san requires 64-bit atomic ops. If they are built with -march=i586,
  all tests in ATF pass. Alternatively, we can probably use 32-bit atomic
  variables instead, with some restrictions (now examining).
- New kernel freeze observed during full ATF run.

m68k:
- Another -fstack-protector breakage.
- Full ATF is on-going for amiga.

powerpc:
- Kernel is just working for all subarchs: oea, booke, ibm4xx (405 and
  strictly-alignment 403).

sh3el:
- Kernel is broken [20]. Seems like regressions for function inlining;
  see also [8] for userland. But, -fno-inline does not work unfortunately...
2023-08-07 00:35:49 +00:00
christos 28326c6660 reorder 2023-08-06 20:39:07 +00:00
christos 9cca771fda delete the texinfo parts 2023-08-06 20:33:39 +00:00
christos acfb7ec24b copy the Makefile from gdb. 2023-08-06 20:32:41 +00:00
christos 9ec383ded7 Make this build 2023-08-06 20:28:26 +00:00
christos 4d596ef418 regen 2023-08-06 20:27:14 +00:00
christos e60f5624d7 Don't try to switch to thread on signals generated by the shell. 2023-08-06 20:26:26 +00:00
christos 07dc233297 put back libkvm for amd64. 2023-08-06 20:25:30 +00:00
christos 2461adb407 - simplify by using PROGDPLIBS
- need --Whole-archive for libgdb to attach modula2, otherwise the file
  does not end up in the list of dependencies from .a archive.
2023-08-06 20:24:54 +00:00
mrg 7dcb2534d3 note sparc & sparc64 seem to work fine except for sanitizers. 2023-08-05 23:52:43 +00:00
mrg a75c489b08 allow this to build on powerpc*. 2023-08-04 19:25:06 +00:00
rin 2ba9592098 gcc/usr.bin: Sprinkle -fno-jump-tables more for m68k and friends
Now, gcc builds for m68k native.
2023-08-04 17:17:06 +00:00
rin 06e960236e README.gcc12: Updated m68000 and m68k
- Kernel works just fine for sun2. Once-observed error was due to
  misc/57562.
- Kernel and bootloader work just fine for amiga.
- Userland needs COPTS.strsuftoll.c+=-fno-stack-protector.
- For amiga, no regression for tests/lib/libc/{sys,gen}.
2023-08-04 14:54:40 +00:00
mrg f7db730398 make this build on m68k (fails on m68000.) 2023-08-04 08:58:42 +00:00
mrg 8a7ff30b28 make sanitizers build for some more platforms
m68k (but not m68000), riscv{32,64}, and arm32.
2023-08-04 07:40:04 +00:00
rin 2651287768 README.gcc12: alpha works just fine (incl. boot loaders)
Clean up outdated/duplicate notes also.
2023-08-04 03:39:22 +00:00
mrg cedbc051d1 many fixes for native GCC 12 builds
- default to dwarf4 since out ctf tools fail with dwarf5.  i tried to
  do this via subtarget options as other ports do, but this would
  require adjusting several of the targets non-netbsd code, and ideally
  we'll fix our tools sooner than later, so just hack it here for now.
- catch up config/rs6000/netbsd64.h (mostly delete things)
- remove some more upstream diffs in config/vax, though it does not work
  currently - libc.so link fails due to weird relocations.
- include some headers to ensure types are available
- add missing sanitizer netbsd files to the 'dist' tree
- remove no longer present TIOCRCVFRAME and TIOCXMTFRAME interceptors
- expanding the sanitizer OS/cpu defs to cover more netbsd platforms
- copy across a few minor changes from gcc.old's sanitizer's (eg,
  disabling linux-specific code, adding netbsd specific code.)
- add (untested, but building) tsan support for arm64
- re-enable the sanitzers, at least simple -fsanitize=address builds a
  working application on amd64 now
- fix the source lists (mostly .cc -> .cpp rename here)
- add some missing new defines, -f*, and -W*
- bump sanitizer shlib version
- apply -fno-jump-tables in some more places on m68k
- update the list in README.gcc12 to note many things now work or a few
  things to do not work (although there are many uncommited changes at
  this point across the rest of 'src' and 'xsrc'.)  main points are that
  vax, hppa, ppc, and sh3 don't build yet, but most other things are
  either testing and working or at least building.
2023-08-03 01:36:53 +00:00
mrg b6fd2da273 mknative-gcc for GCC 12.3.0 on earmv4*, and powerpc64. 2023-08-02 23:03:37 +00:00
christos d7e6a4c28a Forgot to commit the rest of the renames. 2023-08-02 10:30:34 +00:00
mrg d8449c8720 update status for various ports
- arm64 mostly works with some uncommited patches
- arm might work, but my testbox seems unstable
- most ports have basically working native-gcc now
- mipsel builds (pmax)
2023-08-01 07:09:38 +00:00
mrg e3a61bbad6 fix merge botch. 2023-08-01 06:05:13 +00:00
mrg c68d837bea rename our local .c that is c++ to .cc like upstream has. 2023-08-01 06:04:42 +00:00
mrg 45fa5e923b various updates to build native GCC 12.
- for usr.bin, build libcody and link it into cc1*plus
- move makefile code for auto-build.h and version.h (was gcov-iov.h)
  into makefile fragment to share them.  (XXX probably best to only do
  this in one place, but that's a future step.)
- many updates to handle the .c -> .cc renames
- build some x86 files with -msse2
- bump shlib versions for libgomp and libstdc++v3
- fix MKGCCCMDS=no builds
- updates for new rtl-ssa subdir
- use -std=gnu++11 for various places
- define TARGET_MACHINE and HOST_MACHINE for some places
- avoid a .BEGIN rule that writes to missing obj (ie src) sometimes

cleanups still needed:
- remove a bunch of commented -Wno* that don't seem to be needed anymore
- leave or remove various vax-specific -O0s that should no longer be
  necessary for the vax-gcc port
- some "XXXGCC12" that should be may be fixable or converted to using our
  standard ${CC_...} warnings (but may need to remain, in which case the
  XXXGCC12 marker will be removed.)

with these, and a few other changes around the tree, i've able to build
gcc12 releases for several ports that seem to work (arm64, sparc, amd64,
i386 at least so far, have run, several others have built.)
2023-08-01 05:57:53 +00:00
christos a8714c4b7d Don't call versioned stuff "old". Follow the naming convention for versioning
and name them after the last version of the OS they appeared on.
2023-07-31 17:41:17 +00:00
christos 924795e69c Merge gdb-13.2; last was 11.0.50. Builds but does not run. 2023-07-31 16:59:49 +00:00
mrg 47d0cb2df1 some updates:
- most platforms native-gcc works
- some platforms libgcc works
- amd64 kernels work
- i386 kernels build
- add info about libsanitizer re-port (all no.)
2023-07-31 10:09:44 +00:00
mrg cf89d143dd mknative-gcc for GCC 12.3.0 on arm64*, arm* besides armv4, ppc, alpha,
sh, sparc*, mips*, riscv*, vax, hppa, ia64, and m68*.

earmv4 didn't start properly, and powerpc64 failed to build, but all
the rest seem to be OK now.
2023-07-31 10:07:09 +00:00
mrg 6970bd1b90 mknative-gcc for GCC 12.3.0 on amd64 and i386. part 2. 2023-07-31 04:46:22 +00:00
mrg e3f649229b mknative-gcc for GCC 12.3.0 on amd64 and i386. 2023-07-31 02:06:09 +00:00
mrg 4309203d47 add missing void to function prototype (not C++ here.) 2023-07-31 01:46:58 +00:00
mrg d6c5c8ba23 compiler include dir is gcc-12 here. 2023-07-31 01:46:31 +00:00
mrg 691142bb3d catch up two places with our local s/__is_signed/__is_signed_val/ change. 2023-07-31 01:46:04 +00:00
mrg ff6d591ca3 make this actually be GCC 12.3.0's libsanitizer.
the libsanitizer we used with GCC 9 and GCC 10 was significantly
ahead of the GCC 9 and GCC 10 provided versions.
2023-07-31 01:44:53 +00:00
christos 4b169a6ba5 Import gdb-13.2 over gdb-11.0.50
May 27th, 2023: GDB 13.2 Released!
The latest version of GDB, version 13.2, is available for download.

This is a minor corrective release over GDB 13.1, fixing the following issues:

PR testsuite/30158 (rustc testsuite fails with 13.1, apparently
		    worked before with trunk 20230114 on i686-linux-gnu and
		    powerpc64le-linux-gnu)
PR gdb/30214 (GDB 13.1 does not compile on FreeBSD 13.1)
PR gdb/30240 ((linux/aarch) thread.c:86: internal-error: inferior_thread:
              Assertion `current_thread_ != nullptr' failed)
PR gdb/30249 ([13 regression] hookpost-extended-remote will not work)
PR exp/30271 (Addresses of static thread_local fields are badly
              calculated sometimes)
PR symtab/30357 (Segmentation fault for the 'start' command)
PR symtab/30369 ([gdb/symtab] False match issue in
skip_prologue_using_linetable)

PR gdb/30423 (Build failures with clang 16)
PR build/30450 (Build failure (linux-low.cc:5393:45: error: expected
		':' before ')' token) with musl-1.2.4)

See the NEWS file for a more complete and detailed list of what this release
 includes.

Feb 19th, 2023: GDB 13.1 Released!

The latest version of GDB, version 13.1, is available for download.
This version of GDB includes the following changes and enhancements:
Support for the following new targets has been added in both GDB and GDBserver:
GNU/Linux/LoongArch (gdbserver) loongarch*-*-linux*
GNU/Linux/CSKY (gdbserver) csky*-*linux*
The Windows native target now supports target async.
FreeBSD:
Arm and AArch64: Support for Thread Local Storage (TLS) variables
Hardware watchpoint support on AArch64 FreeBSD
Floating-point support has now been added on LoongArch GNU/Linux.
New commands:
set print nibbles [on|off]
show print nibbles

This controls whether the 'print/t' command will display binary
values in groups of four bits, known as "nibbles". The default is
'off'.

Various styling-related commands. See the gdb/NEWS file for more details.
Various maintenance commands. These are normally aimed at GDB
experts or developers. See the gdb/NEWS file for more details.

Python API improvements:
New Python API for instruction disassembly.

The new attribute 'locations' of gdb.Breakpoint returns a list of
gdb.BreakpointLocation objects specifying the locations where the
breakpoint is inserted into the debuggee.
New Python type gdb.BreakpointLocation.
New function gdb.format_address(ADDRESS, PROGSPACE, ARCHITECTURE)
that formats ADDRESS as 'address '
New function gdb.current_language that returns the name of the
current language. Unlike gdb.parameter('language'), this will never
return 'auto'.
New function gdb.print_options that returns a dictionary of the
prevailing print options, in the form accepted by gdb.Value.format_string.
New method gdb.Frame.language that returns the name of the frame's language.
gdb.Value.format_string now uses the format provided by 'print',
if it is called during a 'print' or other similar operation.
gdb.Value.format_string now accepts the 'summary' keyword. This
can be used to request a shorter representation of a value, the
way that 'set print frame-arguments scalars' does.
The gdb.register_window_type method now restricts the set of
acceptable window names. The first character of a window's name
must start with a character in the set [a-zA-Z], every subsequent
character of a window's name must be in the set [-_.a-zA-Z0-9].
` GDB/MI changes:  MI version 1 is deprecated, and will be removed
in GDB 14.  The async record stating the stopped reason 'breakpoint-hit'
now contains an optional field locno.

Miscellaneous improvements:
gdb now supports zstd compressed debug sections (ELFCOMPRESS_ZSTD) for ELF.
New convenience variable $_inferior_thread_count contains the number
of live threads in the current inferior.
New convenience variables $_hit_bpnum and $_hit_locno, set to the
breakpoint number and the breakpoint location number of the breakpoint
last hit.
The "info breakpoints" now displays enabled breakpoint locations
of disabled breakpoints as in the "y-" state.
The format of 'disassemble /r' and 'record instruction-history /r'
has changed to match the layout of GNU objdump when disassembling.

A new format "/b" has been introduce to provide the old behavior of "/r".
The TUI no longer styles the source and assembly code highlighted
by the current position indicator by default. You can however
re-enable styling using the new "set style tui-current-position"
command.
It is now possible to use the "document" command to document
user-defined commands.
Support for memory tag data for AArch64 MTE.
Support Removal notices:
DBX mode has been removed.
Support for building against Python version 2 has been removed. It
is now only possible to build GDB against Python 3.
Support for the following commands has been removed:

set debug aix-solib on|off
show debug aix-solib
set debug solib-frv on|off
show debug solib-frv

Use the "set/show debug solib" commands instead.
See the NEWS file for a more complete and detailed list of what
this release includes.

Dec 18th, 2022: GDB 13 branch created
The GDB 13 branch (gdb-13-branch) has been created. To check out
a copy of the branch use:

git clone --branch gdb-13-branch https://sourceware.org/git/binutils-gdb.git
May 1st, 2022: GDB 12.1 Released!
The latest version of GDB, version 12.1, is available for download.

This version of GDB includes the following changes and enhancements:

New support for the following native configuration:
GNU/Linux/OpenRISC or1k*-*-linux*
New support for the following targets:
GNU/Linux/LoongArch loongarch*-*-linux*
New GDBserver support on the following configuration:
GNU/Linux/OpenRISC or1k*-*-linux*
Support for the following target has been removed:
S+core score-*-*
Multithreaded symbol loading is now enabled by default

Deprecation Notices:
GDB 12 is the last release of GDB that will support building against Python 2
DBX mode is deprecated, and will be removed in GDB 13
GDB/MI changes:
The '-add-inferior' with no option flags now inherits the connection
of the current inferior, this restores the behaviour of GDB as it
was prior to GDB 10.
The '-add-inferior' command now accepts a '--no-connection' option,
which causes the new inferior to start without a connection.

Python API enhancements:
It is now possible to add GDB/MI commands implemented in Python
New function gdb.Architecture.integer_type()
New gdb.events.gdb_exiting event
New 'gdb.events.connection_removed' event registry
New gdb.TargetConnection object
New gdb.Inferior.connection property
New read-only attribute gdb.InferiorThread.details
New gdb.RemoteTargetConnection.send_packet method
New read-only attributes gdb.Type.is_scalar and gdb.Type.is_signed
The gdb.Value.format_string method now takes a 'styling' argument
Various new function in the "gdb" module
Miscellaneous:
The FreeBSD native target now supports async mode

Improved C++ template support
Support for disabling source highlighting through GNU of the Pygments
library instead.
The "print" command has been changed so as to print floating-point
values with a base-modifying formats such as "/x" to display the
underlying bytes of the value in the desired base.
The "clone-inferior" command now ensures that the TTY, CMD and ARGS
settings are copied from the original inferior to the new one. All
modifications to the environment variables done using the 'set
environment' or 'unset environment' commands are also copied to
the new inferior.
Various new commands have been introduced
See the NEWS file for a more complete and detailed list of what
this release includes.

Mar 20th, 2022: GDB 12 branch created
The GDB 12 branch (gdb-12-branch) has been created. To check out a copy of the branch use:

git clone --branch gdb-12-branch https://sourceware.org/git/binutils-gdb.git
January 16th, 2022: GDB 11.2 Released!
The latest version of GDB, version 11.2, is available for download.

This is a minor corrective release over GDB 11.1, fixing the following issues:

PR sim/28302 (gdb fails to build with glibc 2.34)
PR build/28318 (std::thread support configure check does not use CXX_DIALECT)
PR gdb/28405 (arm-none-eabi: internal-error: ptid_t
	      remote_target::select_thread_for_ambiguous_stop_reply(const
	      target_waitstatus*): Assertion `first_resumed_thread != nullptr'
	      failed)
PR tui/28483 ([gdb/tui] breakpoint creation not displayed)
PR build/28555 (uclibc compile failure since commit
		4655f8509fd44e6efabefa373650d9982ff37fd6)
PR rust/28637 (Rust characters will be encoded using DW_ATE_UTF)
PR gdb/28758 (GDB 11 doesn't work correctly on binaries with a
              SHT_RELR (.relr.dyn) section)
PR gdb/28785 (Support SHT_RELR (.relr.dyn) section)
See the NEWS file for a more complete and detailed list of what
this release includes.

September 13th, 2021: GDB 11.1 Released!
The latest version of GDB, version 11.1, is available for download.

This version of GDB includes the following changes and enhancements:

Support for ARM Symbian (arm*-*-symbianelf*) has been removed.
Building GDB now requires GMP (The GNU Multiple Precision Arithmetic Library).
New command-line options "--early-init-command" (or "-eix") and
"--early-init-eval-command" (or "-eiex")

GDB/MI Changes:
New --qualified option for the '-break-insert' and '-dprintf-insert' commands.
New --force-condition option for the '-break-insert' and
'-dprintf-insert' commands.
New --force option for the '-break-condition' command.
The '-file-list-exec-source-files' now accepts an optional regular
expression to filter the source files included in the result.
The results from '-file-list-exec-source-files' now include a
'debug-fully-read' field to indicate if the corresponding source's
debugging information has been partially read (false) or has been
fully read (true).

TUI Improvements:
Mouse actions are now supported. The mouse wheel scrolls the
appropriate window.  Key combinations that do not have a specific
action on the focused window are now passed to GDB.

Python enhancements:
Inferior objects now contain a read-only 'connection_num' attribute
that gives the connection number as seen in 'info connections' and
'info inferiors'.
New method gdb.Frame.level() which returns the stack level of the frame object.
New method gdb.PendingFrame.level() which returns the stack level
of the frame object.
When hitting a catchpoint, the Python API will now emit a
gdb.BreakpointEvent rather than a gdb.StopEvent. The gdb.Breakpoint
attached to the event will have type BP_CATCHPOINT.
Python TUI windows can now receive mouse click events. If the Window
object implements the click method, it is called for each mouse
click event in this window.  New setting "python ignore-environment
on|off"; if "on", causes GDB's builtin Python to ignore any
environment variable that would otherwise affect how Python behaves
(needs to be set during "early initialization" (see above).  New
setting "python dont-write-bytecode auto|on|off".

Guile API enhancements:
Improved support for rvalue reference values.
New procedures for obtaining value variants: value-reference-value,
value-rvalue-reference-value and value-const-value.
New "qMemTags" and "QMemTags" remote protocol packets (associated
with Memory Tagging).
GDB will now look for the .gdbinit file in a config directory before
looking for ~/.gdbinit. The file is searched for in the following
locations: $XDG_CONFIG_HOME/gdb/gdbinit, $HOME/.config/gdb/gdbinit,
$HOME/.gdbinit. On Apple hosts the search order is instead:
$HOME/Library/Preferences/gdb/gdbinit, $HOME/.gdbinit.  The "break
[...] if CONDITION" command no longer returns an error when the
condition is invalid at one or more locations. Instead, if the
condition is valid at one or more locations, the locations where
the condition is not valid are disabled.
The behavior of the "condition" command is changed to match the
new behavior of the "break" command.

Support for general memory tagging functionality (currently limited
to AArch64 MTE)

Core file debugging now supported for x86_64 Cygwin programs.
New "org.gnu.gdb.riscv.vector" feature for RISC-V targets.
GDB now supports fixed point types which are described in DWARF as
base types with a fixed-point encoding. Additionally, support for
the DW_AT_GNU_numerator and DW_AT_GNU_denominator has also been
added.

Miscellaneous:
New "startup-quietly on|off" setting; when "on", behaves the same
as passing the "-silent" option on the command line.
New "print type hex on|off" setting; when 'on', the 'ptype' command
uses hexadecimal notation to print sizes and offsets of struct
members. When 'off', decimal notation is used.
The "inferior" command, when run without argument, prints information
about the current inferior.
The "ptype" command now supports "/x" and "/d", affecting the base
used to print sizes and offsets.
The output of the "info source" has been restructured.
New "style version foreground | background | intensity" commands
to control the styling of the GDB version number.
Various debug and maintenance commands (mostly useful for the GDB
developers) See the NEWS file for a more complete and detailed list
of what this release includes.
2023-07-30 22:44:03 +00:00
mrg 4e7128a203 update for GCC 12.
amd64 tools already work.  everything else is unknown.
2023-07-30 06:37:23 +00:00
mrg 67391a8b21 fix merge botch. 2023-07-30 06:24:25 +00:00
mrg 2683f5b185 GCC 12.3.0: merge our old changes into the renamed .cc files. 2023-07-30 06:15:16 +00:00
mrg e9e6e0f6fb initial merge of GCC 12.3.0.
this doesn't include any of the changes to the .c -> .cc files renamed,
and reverts our local changes to the vax port and libsanitizer subdir.
vax GCC was rewritten and our local fixes no longer are relevant, and
the new libsanitizer is more updated than our old one, and merging via
gcc10->gcc12 is not really possible.

unfortunately, our local changes to libsanitizer that aren't related
to the general update of those sources (ie, the netbsd code) will need
to be re-checked and perhaps re-ported.
2023-07-30 05:51:09 +00:00
mrg b1e838363e initial import of GCC 12.3.0.
major changes in GCC 11 included:

- The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14.
- When building GCC itself, the host compiler must now support C++11,
  rather than C++98.
- Some short options of the gcov tool have been renamed: -i to -j and
  -j to -H.
- ThreadSanitizer improvements.
- Introduce Hardware-assisted AddressSanitizer support.
- For targets that produce DWARF debugging information GCC now defaults
  to DWARF version 5. This can produce up to 25% more compact debug
  information compared to earlier versions.
- Many optimisations.
- The existing malloc attribute has been extended so that it can be
  used to identify allocator/deallocator API pairs. A pair of new
  -Wmismatched-dealloc and -Wmismatched-new-delete warnings are added.
- Other new warnings:
  -Wsizeof-array-div, enabled by -Wall, warns about divisions of two
    sizeof operators when the first one is applied to an array and the
    divisor does not equal the size of the array element.
  -Wstringop-overread, enabled by default, warns about calls to string
    functions reading past the end of the arrays passed to them as
    arguments.
  -Wtsan, enabled by default, warns about unsupported features in
    ThreadSanitizer (currently std::atomic_thread_fence).
- Enchanced warnings:
  -Wfree-nonheap-object detects many more instances of calls to
    deallocation functions with pointers not returned from a dynamic
    memory allocation function.
  -Wmaybe-uninitialized diagnoses passing pointers or references to
    uninitialized memory to functions taking const-qualified arguments.
  -Wuninitialized detects reads from uninitialized dynamically
    allocated memory.
  -Warray-parameter warns about functions with inconsistent array forms.
  -Wvla-parameter warns about functions with inconsistent VLA forms.
- Several new features from the upcoming C2X revision of the ISO C
  standard are supported with -std=c2x and -std=gnu2x.
- Several C++20 features have been implemented.
- The C++ front end has experimental support for some of the upcoming
  C++23 draft.
- Several new C++ warnings.
- Enhanced Arm, AArch64, x86, and RISC-V CPU support.
- The implementation of how program state is tracked within
  -fanalyzer has been completely rewritten with many enhancements.

see https://gcc.gnu.org/gcc-11/changes.html for a full list.

major changes in GCC 12 include:

- An ABI incompatibility between C and C++ when passing or returning
  by value certain aggregates containing zero width bit-fields has
  been discovered on various targets. x86-64, ARM and AArch64
  will always ignore them (so there is a C ABI incompatibility
  between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2
  always take them into account (so there is a C++ ABI
  incompatibility, GCC 4.4 and earlier compatible with GCC 12 or
  later, incompatible with GCC 4.5 through GCC 11). RISC-V has
  changed the handling of these already starting with GCC 10. As
  the ABI requires, MIPS takes them into account handling function
  return values so there is a C++ ABI incompatibility with GCC 4.5
  through 11.
- STABS: Support for emitting the STABS debugging format is
  deprecated and will be removed in the next release. All ports now
  default to emit DWARF (version 2 or later) debugging info or are
  obsoleted.
- Vectorization is enabled at -O2 which is now equivalent to the
  original -O2 -ftree-vectorize -fvect-cost-model=very-cheap.
- GCC now supports the ShadowCallStack sanitizer.
- Support for __builtin_shufflevector compatible with the clang
  language extension was added.
- Support for attribute unavailable was added.
- Support for __builtin_dynamic_object_size compatible with the
  clang language extension was added.
- New warnings:
  -Wbidi-chars warns about potentially misleading UTF-8
    bidirectional control characters.
  -Warray-compare warns about comparisons between two operands of
    array type.
- Some new features from the upcoming C2X revision of the ISO C
  standard are supported with -std=c2x and -std=gnu2x.
- Several C++23 features have been implemented.
- Many C++ enhancements across warnings and -f options.

see https://gcc.gnu.org/gcc-12/changes.html for a full list.
2023-07-30 05:20:36 +00:00
christos 61f2f2abd6 add m5407 2023-07-27 21:59:55 +00:00
mrg 9805684c44 actually re-gen with GCC 10.5 in gcc.old and earmv4*.
fixes armv4* builds.
2023-07-21 10:24:55 +00:00
mrg b82bc0398d regen for earmv4/earmv4eb. 2023-07-20 04:30:39 +00:00
mrg ad3db949b1 mknative-gcc for earmv4*.
delete obsolete or1k and coldfire configurations.
2023-07-19 19:23:25 +00:00
rin 40faff9771 Sync with external/gpl3/gcc:
https://mail-index.netbsd.org/source-changes/2023/07/18/msg146078.html
----
gcc: Fix peephole optimization bug for sh3 (PR port-sh3/56311)

Cherry-picked from upstream:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4dbb3af1efe55174a714d15c2994cf2842ef8c28
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101469

Now, the PR confirmed fixed. No regression observed for full ATF run on
landisk (compared with GCC built with this peephole optimization being
removed by hand).

We thank Oleg Endo, the author of the upstream commit.

Also thanks hgutch@ and uwe@ for analysis.
2023-07-18 02:58:38 +00:00
rin 81c70943e9 gcc: Fix peephole optimization bug for sh3 (PR port-sh3/56311)
Cherry-picked from upstream:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4dbb3af1efe55174a714d15c2994cf2842ef8c28
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101469

Now, the PR confirmed fixed. No regression observed for full ATF run on
landisk (compared with GCC built with this peephole optimization being
removed by hand).

We thank Oleg Endo, the author of the upstream commit.

Also thanks hgutch@ and uwe@ for analysis.
2023-07-18 02:50:18 +00:00
mrg 67b20d37e8 delete accidental copy of gcc.old. 2023-07-17 04:05:41 +00:00
mrg 23f5f46327 merge GCC 10.5.0 in gcc.old 2023-07-14 19:46:25 +00:00
mrg 4ac76180e9 import GCC 10.5.0 into gcc.old (this time properly.) 2023-07-14 19:35:59 +00:00
mrg c668843f2c import GCC 10.5.0 into gcc.old. 2023-07-14 06:33:43 +00:00
mrg 84b8145c41 don't force gnu++98 here.
fixes build issues seen with GCC 10.5, as well as hopefully ones reported
by Andrew Cagney on current-users.
2023-07-12 07:35:15 +00:00
mrg ebba80dab5 mknative-gcc for GCC 10.5.0. 2023-07-11 06:05:43 +00:00
mrg a0414be6db merge GCC 10.5.0. 2023-07-11 00:40:40 +00:00
mrg 7d4dc15be1 initial import of GCC 10.5.0.
(we plan to import 12.3 soon as well, this is mostly so it can be pulled up
to netbsd-10 branch more easily.)

the list of PR's fixed since 10.4.0 can be found here:

https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=10.5

which includes 3 C, 25 C++, 4 debug, 17 libstdc++, and many others for the
internals.
2023-07-11 00:32:05 +00:00
rin 4516a07eeb PR port-alpha/57511 Temporally disable secure PLT for alpha
until support is added to ld.elf_so(1).
2023-07-07 08:33:25 +00:00
lukem 58beaa2b43 adapt to ${CC_WNO_MAYBE_UNINITIALIZED}
Use ${CC_WNO_MAYBE_UNINITIALIZED} instead of
the older style more complex expressions.

Remove workarounds if they were for a specific
version of gcc < 10.
2023-06-03 21:31:45 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
lukem f937c412f3 bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 08:52:53 +00:00
lukem f1834a6f03 revert previous: autoconf doesn't use EREs
autoconf relies upon GNU m4 emacs-style regexs, which
don't support intervals so don't escape these.
A fix to usr.bin/m4 -g (GNU m4 emulation) is incoming.
2023-05-24 21:49:38 +00:00
christos a9e41cffe3 quote { to make regcomp happy 2023-05-24 14:34:16 +00:00
lukem 4080c3a3f0 autoconf: AC_FUNC_ALLOCA(): add local fix for BSD support
Add local fix to AC_FUNC_ALLOCA() to include <stdlib.h> on BSD:
 # elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
 #   include <stdlib.h>

This change avoids regen losing this change in tools/compat/configure
that was added in rev 1.75 on 2013-03-05 of tools/compat/configure,
and subsequent commits that keep re-adding these lines back
manually (e.g., rev 1.97 on 2019-06-22 of tools/compat/configure)

XXX: Arguably this could be fixed in a separate way to allow us to
use an unmodified modern autoconf in the future ?
2023-05-23 20:15:58 +00:00
lukem 0ab65e79ce gcc: fix build with clang++ HOST_CXX
Define HOSTPROG_CXX before .include anything that brings in bsd.own.mk.
This ensures that HOST_DBG (etc) gets assigned before HOST_CFLAGS
and HOST_CXXFLAGS is created.

backend: .include <bsd.init.mk> much earlier, as per the other directories.
Fixes backend build when using clang++ as the host compiler (e.g., macOS),
because backend host tools are now built with -O.
Inspired by https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255760

Note that gcc.old/Makefile.prog may be mis-used because it defines HOSTPROG_CXX
and this Makefile fragment is included after bsd.*.mk in other Makefiles,
but they seem to build ok so leaving it alone for now.

Fixes PR toolchain/57014
2023-05-19 23:28:20 +00:00
lukem cf4db277d4 Fix passing -j NNN to gmake
Use a more restrictive pattern to extract -j NNN from MAKEFLAGS
into GMAKE_J_ARGS, to avoid false positives when the source directory
has "-j" in the path (e.g "amd64-job-000012" or "src-j9999").
Previously this could pass either -"-j" or "-j BIGNUM" to gmake
and result in "vfork: Resource temporarily unavailable" failures.

PR misc/54456
2023-05-19 10:42:34 +00:00
skrll be56099062 RISC-V mknative and build support for gdb.old 2023-05-08 20:57:34 +00:00
skrll 06dfa8449c RISC-V mknative and build support. 2023-05-08 20:56:19 +00:00
skrll 528da60089 Missed a file in the RISC-V support commit 2023-05-08 07:38:48 +00:00
skrll 75b842b847 RISC-V support that works on QEMU with a single hart.
Thanks for Simon Burge for plic(4).
2023-05-07 12:41:45 +00:00
hgutch 6d7231e655 Unbreak creation of i386 PIEs on amd64.
Functional patch by RVP;  set lists updated accordingly.

This fixes PR toolchain/57380.
2023-04-27 20:55:27 +00:00
hannken 7b41b3a3a7 Fix StaticSpinMutex::CheckLocked() on sparc32.
The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green
2023-04-06 09:49:12 +00:00
hannken cdfeb388f7 Fix StaticSpinMutex::CheckLocked() on sparc32.
The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green
2023-04-05 07:41:38 +00:00
christos 82650ea596 Merge between
src-external-gpl3-gdb-20200913-1743: 1.1.1.1
and
        src-external-gpl3-gdb-20230321-1235: 1.1.1.1
2023-03-21 16:54:43 +00:00
christos 7d62b00eb9 import latest gdb from our tree into gdb.old 2023-03-21 16:37:18 +00:00
christos 7f2d4a670e Disable completely mips ifunc test to make cross-compilation on other OSs work.
(Jan-Benedict Glaw)
2023-02-27 17:38:18 +00:00
mrg 65ea62a9f4 merge GCC 10.4 son more. 2023-02-20 05:38:30 +00:00
mrg 8feb0f0b7e merge GCC 10.4 into gcc.old. 2023-02-20 02:11:03 +00:00
mrg 4c3eb207d3 initial import of GCC 10 sources into "gcc.old". 2023-02-20 02:00:19 +00:00
mrg debfb98ae2 add author info to this file. 2023-02-20 01:16:38 +00:00
mrg 543db4848b apply -g1 to the gdb build as well.
reduces the size of gdb.debug and gdbtui.debug by 100MB each on amd64,
and about 70MB total in the debug set.  (across all builds, this may
be in the order of 3-4GB in releasedir output.)
2023-02-10 18:51:32 +00:00