Carsten Grzemba
2023-01-24 a5facfe6aaa2becfc29207e713d5b09fe4bd2ae5
gdb: update  12.1

11 files deleted
9 files added
4 files modified
3579 ■■■■ changed files
components/developer/gdb/Makefile 28 ●●●● patch | view | raw | blame | history
components/developer/gdb/Solaris/gen_syscall_table.sh 56 ●●●●● patch | view | raw | blame | history
components/developer/gdb/Solaris/offsets.in 28 ●●●●● patch | view | raw | blame | history
components/developer/gdb/gdb.p5m 23 ●●●● patch | view | raw | blame | history
components/developer/gdb/manifests/sample-manifest.p5m 25 ●●●● patch | view | raw | blame | history
components/developer/gdb/patches/001-fix-proc-name-size.patch 28 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/002-Makefile_in.patch 40 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/003-remove-core-warning.patch 23 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/004-elf-core.patch 427 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/005-regcache-core.patch 337 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/006-features-i386.patch 916 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/007-solib-svr4.patch 19 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/008-syscalls.patch 1095 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/021-python-37.patch 86 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/30-python-3.9.patch 162 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/31-prompt-SyntaxWarning.patch 20 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/features-i386.patch 160 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/fix-attach.patch 19 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/fix-null-ptr.patch 12 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/force-bash.patch 23 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/remove-core-warning.patch 24 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/series 7 ●●●●● patch | view | raw | blame | history
components/developer/gdb/patches/syscalls.patch 17 ●●●●● patch | view | raw | blame | history
components/developer/gdb/pkg5 4 ●●●● patch | view | raw | blame | history
components/developer/gdb/Makefile
@@ -23,6 +23,7 @@
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright 2017, 2021 Gary Mills
# Copyright 2019 Andreas Wacknitz
# Copyright 2023 Carsten Grzemba
#
BUILD_BITS= 64
@@ -34,16 +35,17 @@
include ../../../make-rules/shared-macros.mk
COMPONENT_NAME=         gdb
COMPONENT_VERSION=      8.0
COMPONENT_REVISION=     2
COMPONENT_VERSION=      12.1
COMPONENT_REVISION=     0
COMPONENT_SUMMARY=      GDB: The GNU Project Debugger
COMPONENT_CLASSIFICATION=Development/System
COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH= \
    sha256:8968a19e14e176ee026f0ca777657c43456514ad41bb2bc7273e8c4219555ac9
    sha256:87296a3a9727356b56712c793704082d5df0ff36a34ca9ec9734fc9a8bdfdaab
COMPONENT_ARCHIVE_URL=  https://ftp.gnu.org/gnu/gdb/$(COMPONENT_ARCHIVE)
COMPONENT_PROJECT_URL=  https://www.gnu.org/software/gdb/
COMPONENT_FMRI= developer/debug/gdb
CONFIGURE_DEFAULT_DIRS=no
@@ -128,9 +130,16 @@
# pod2man perl script, used to create manpages
COMPONENT_BUILD_ENV += PATH=$(PATH)
# Generate illumos data files describing system calls and structures
# found in core files.
COMPONENT_POST_UNPACK_ACTION = \
    GCC_VERSION=$(GCC_VERSION) COMPONENT_DIR=$(COMPONENT_DIR) \
    SOURCE_DIR=$(SOURCE_DIR) \
    $(COMPONENT_DIR)/Solaris/gen_syscall_table.sh
# Generate the newly added Solaris instruction and
# register tables which weren't there by default.
COMPONENT_PRE_CONFIGURE_ACTION = \
COMPONENT_PRE_CONFIGURE_ACTION += \
  +( cd  $(SOURCE_DIR)/gdb/features ; \
    $(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) all; )
@@ -178,14 +187,13 @@
    $(PROTOUSRSHAREDIR)/info/ ; \
      $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-7  \
    $(PROTOUSRSHAREDIR)/info/ ; \
      $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-8  \
    $(PROTOUSRSHAREDIR)/info/ ; \
      $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/annotate.info  \
    $(PROTOUSRSHAREDIR)/info/ ; \
      $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/stabs.info  \
    $(PROTOUSRSHAREDIR)/info/ ; \
      $(MKDIR) $(PROTOGNUSHAREMAN1) ; \
      $(MKDIR) $(PROTOUSRSHAREMAN1DIR) ; \
      $(INSTALL) -m 0444 $(BUILD_DIR_64)/gdb/doc/gdb.1 \
    $(PROTOUSRSHAREMAN1DIR) )
     )
# Disable ASLR: it's a debugger and we do not want to risk
# altering the results of the debugging experiment.
@@ -195,9 +203,13 @@
# Auto-generated dependencies
PYTHON_REQUIRED_PACKAGES += runtime/python
REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
REQUIRED_PACKAGES += compress/xz
REQUIRED_PACKAGES += developer/babeltrace
REQUIRED_PACKAGES += library/expat
REQUIRED_PACKAGES += library/gmp
REQUIRED_PACKAGES += library/mpfr
REQUIRED_PACKAGES += library/ncurses
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += shell/ksh93
components/developer/gdb/Solaris/gen_syscall_table.sh
New file
@@ -0,0 +1,56 @@
# Generate illumos data files describing system calls and structures
# found in core files.
CW=/opt/onbld/bin/i386/cw
GENOFFSETS=/opt/onbld/bin/genoffsets
TMPDIR=/tmp
CTFSTABS=/opt/onbld/bin/i386/ctfstabs
CTFCONVERT=/opt/onbld/bin/i386/ctfconvert
GENOFFSETS_CFLAGS="-gdwarf-2 -_gcc=-fno-eliminate-unused-debug-symbols -_gcc=-fno-eliminate-unused-debug-types"
SRCDIR=.
EGREP=/usr/gnu/bin/egrep
GCC=/usr/gcc/${GCC_VERSION}/bin/gcc
CFLAGS32=-m32
CFLAGS64=-m64
OOCEBIN=/usr/bin
function generate {
    # System call table
    {
        cat << EOM
<?xml version="1.0"?>
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<syscalls_info>
EOM
        $EGREP $'^#define\tSYS_.*[0-9]$' /usr/include/sys/syscall.h \
            | while read _ call num; do
                printf '  <syscall name="%s" number="%d"/>\n' \
                    ${call#SYS_} $num
        done
        echo "</syscalls_info>"
    } > $TMPDIR/syscalls.xml
    echo $TMPDIR/syscalls.xml
    for arch in i386 amd64; do
        cp $TMPDIR/syscalls.xml \
            ${SOURCE_DIR}/gdb/syscalls/$arch-illumos.xml \
            || logerr "Could not install $arch system call table"
    done
    for bits in 32 64; do
        flags=CFLAGS$bits
        $GENOFFSETS -s $CTFSTABS -r $CTFCONVERT \
            $CW --primary gcc,${GCC},gnu --noecho -- \
            $GENOFFSETS_CFLAGS ${!flags} \
            < ${COMPONENTS_DIR}/Solaris/offsets.in > offsets$bits.h
    done
    {
        sed < offsets32.h 's/\t0x/_32&/'
        sed < offsets64.h 's/\t0x/_64&/'
        $EGREP $'define\tPR(FN|ARG)SZ' /usr/include/sys/old_procfs.h
    } | tee illumos-offsets.h > ${SOURCE_DIR}/bfd/illumos-offsets.h
}
env
generate
components/developer/gdb/Solaris/offsets.in
New file
@@ -0,0 +1,28 @@
#include <procfs.h>
#include <sys/old_procfs.h>
psinfo_t        SIZEOF_PSINFO_T
        pr_fname        OFFSET_PSINFO_T_PR_FNAME
        pr_psargs       OFFSET_PSINFO_T_PR_PSARGS
prpsinfo_t      SIZEOF_PRPSINFO_T
        pr_fname        OFFSET_PRPSINFO_T_PR_FNAME
        pr_psargs       OFFSET_PRPSINFO_T_PR_PSARGS
prstatus_t      SIZEOF_PRSTATUS_T
        pr_pid          OFFSET_PRSTATUS_T_PR_PID
        pr_cursig       OFFSET_PRSTATUS_T_PR_CURSIG
        pr_reg          OFFSET_PRSTATUS_T_PR_REG
lwpsinfo_t      SIZEOF_LWPSINFO_T
        pr_lwpid        OFFSET_LWPSINFO_T_PR_LWPID
lwpstatus_t     SIZEOF_LWPSTATUS_T
        pr_lwpid        OFFSET_LWPSTATUS_T_PR_LWPID
        pr_cursig       OFFSET_LWPSTATUS_T_PR_CURSIG
        pr_reg          OFFSET_LWPSTATUS_T_PR_REG
        pr_fpreg        OFFSET_LWPSTATUS_T_PR_FPREG
gregset_t       SIZEOF_PRGREGSET_T
fpregset_t      SIZEOF_PRFPREGSET_T
components/developer/gdb/gdb.p5m
@@ -22,24 +22,31 @@
# Copyright 2019, Andreas Wacknitz
# Copyright 2021 Gary Mills
# Copyright 2022 Till Wegmueller
# Copyright 2023 Carsten Grzemba
#
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
set name=pkg.fmri \
    value=pkg:/developer/debug/gdb@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
    value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.human-version value=$(HUMAN_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
set name=pkg.description \
    value="GDB, the GNU Debugger, is a source-level debugger for Ada, C, C++, Objective-C, Pascal and many other languages.  GDB allows you to see what is going on inside another program while it executes, or what another program was doing at the moment it crashed."
set name=com.oracle.info.description value="GDB, the GNU Debugger"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
file path=usr/bin/gdb
file path=usr/bin/gdb-add-index
file path=usr/bin/gdbtui mode=0555
file path=usr/include/ansidecl.h
file path=usr/include/bfd.h
file path=usr/include/bfdlink.h
file path=usr/include/ctf-api.h
file path=usr/include/ctf.h
file path=usr/include/diagnostics.h
file path=usr/include/dis-asm.h
file path=usr/include/gdb/jit-reader.h
file path=usr/include/plugin-api.h
@@ -64,17 +71,19 @@
file path=usr/share/gdb/python/gdb/printer/bound_registers.py
file path=usr/share/gdb/python/gdb/printing.py
file path=usr/share/gdb/python/gdb/prompt.py
file path=usr/share/gdb/python/gdb/styling.py
file path=usr/share/gdb/python/gdb/types.py
file path=usr/share/gdb/python/gdb/unwinder.py
file path=usr/share/gdb/python/gdb/xmethod.py
file path=usr/share/gdb/syscalls/amd64-solaris.xml variant.arch=i386
file path=usr/share/gdb/syscalls/amd64-illumos.xml variant.arch=i386
file path=usr/share/gdb/syscalls/gdb-syscalls.dtd
file path=usr/share/gdb/syscalls/i386-solaris.xml variant.arch=i386
file path=usr/share/gdb/syscalls/i386-illumos.xml variant.arch=i386
file path=usr/share/gdb/syscalls/sparc-solaris.xml variant.arch=sparc
file path=usr/share/gdb/syscalls/sparc64-solaris.xml variant.arch=sparc
file path=usr/share/gdb/system-gdbinit/elinos.py pkg.tmp.autopyc=false
file path=usr/share/gdb/system-gdbinit/wrs-linux.py pkg.tmp.autopyc=false
file path=usr/share/info/annotate.info
file path=usr/share/info/ctf-spec.info
file path=usr/share/info/gdb.info
file path=usr/share/info/gdb.info-1
file path=usr/share/info/gdb.info-2
@@ -83,6 +92,7 @@
file path=usr/share/info/gdb.info-5
file path=usr/share/info/gdb.info-6
file path=usr/share/info/gdb.info-7
file path=usr/share/info/gdb.info-8
file path=usr/share/info/stabs.info
file path=usr/share/locale/da/LC_MESSAGES/bfd.mo
file path=usr/share/locale/da/LC_MESSAGES/opcodes.mo
@@ -94,11 +104,13 @@
file path=usr/share/locale/fr/LC_MESSAGES/bfd.mo
file path=usr/share/locale/fr/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/ga/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/hr/LC_MESSAGES/bfd.mo
file path=usr/share/locale/id/LC_MESSAGES/bfd.mo
file path=usr/share/locale/id/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/it/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/ja/LC_MESSAGES/bfd.mo
file path=usr/share/locale/nl/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/pt/LC_MESSAGES/bfd.mo
file path=usr/share/locale/pt_BR/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/ro/LC_MESSAGES/bfd.mo
file path=usr/share/locale/ro/LC_MESSAGES/opcodes.mo
@@ -116,8 +128,11 @@
file path=usr/share/locale/vi/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/zh_CN/LC_MESSAGES/bfd.mo
file path=usr/share/locale/zh_CN/LC_MESSAGES/opcodes.mo
file path=usr/share/man/man1/gdb-add-index.1
file path=usr/share/man/man1/gdb.1
link path=usr/share/man/man1/gdbtui.1 target=gdb.1
file path=usr/share/man/man1/gdbserver.1
file path=usr/share/man/man5/gdbinit.5
license gdb.license \
    license="GPLv2, LGPLv2, GPLv3, LGPLv3, FDLv1.1, FDLv1.2, FDLv1.3"
components/developer/gdb/manifests/sample-manifest.p5m
@@ -10,7 +10,7 @@
#
#
# Copyright 2022 <contributor>
# Copyright 2023 <contributor>
#
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
@@ -25,16 +25,21 @@
file path=usr/bin/gcore
file path=usr/bin/gdb
file path=usr/bin/gdb-add-index
file path=usr/bin/gdbtui
file path=usr/include/ansidecl.h
file path=usr/include/bfd.h
file path=usr/include/bfdlink.h
file path=usr/include/ctf-api.h
file path=usr/include/ctf.h
file path=usr/include/diagnostics.h
file path=usr/include/dis-asm.h
file path=usr/include/gdb/jit-reader.h
file path=usr/include/plugin-api.h
file path=usr/include/symcat.h
file path=usr/lib/$(MACH64)/charset.alias
file path=usr/lib/$(MACH64)/libbfd.a
file path=usr/lib/$(MACH64)/libctf-nobfd.a
file path=usr/lib/$(MACH64)/libctf.a
file path=usr/lib/$(MACH64)/libopcodes.a
file path=usr/share/gdb/python/gdb/FrameDecorator.py
file path=usr/share/gdb/python/gdb/FrameIterator.py
@@ -56,32 +61,33 @@
file path=usr/share/gdb/python/gdb/printer/bound_registers.py
file path=usr/share/gdb/python/gdb/printing.py
file path=usr/share/gdb/python/gdb/prompt.py
file path=usr/share/gdb/python/gdb/styling.py
file path=usr/share/gdb/python/gdb/types.py
file path=usr/share/gdb/python/gdb/unwinder.py
file path=usr/share/gdb/python/gdb/xmethod.py
file path=usr/share/gdb/syscalls/aarch64-linux.xml
file path=usr/share/gdb/syscalls/amd64-illumos.xml
file path=usr/share/gdb/syscalls/amd64-linux.xml
file path=usr/share/gdb/syscalls/amd64-solaris.xml
file path=usr/share/gdb/syscalls/arm-linux.xml
file path=usr/share/gdb/syscalls/freebsd.xml
file path=usr/share/gdb/syscalls/gdb-syscalls.dtd
file path=usr/share/gdb/syscalls/i386-illumos.xml
file path=usr/share/gdb/syscalls/i386-linux.xml
file path=usr/share/gdb/syscalls/i386-solaris.xml
file path=usr/share/gdb/syscalls/mips-n32-linux.xml
file path=usr/share/gdb/syscalls/mips-n64-linux.xml
file path=usr/share/gdb/syscalls/mips-o32-linux.xml
file path=usr/share/gdb/syscalls/netbsd.xml
file path=usr/share/gdb/syscalls/ppc-linux.xml
file path=usr/share/gdb/syscalls/ppc64-linux.xml
file path=usr/share/gdb/syscalls/s390-linux.xml
file path=usr/share/gdb/syscalls/s390x-linux.xml
file path=usr/share/gdb/syscalls/sparc-linux.xml
file path=usr/share/gdb/syscalls/sparc-solaris.xml
file path=usr/share/gdb/syscalls/sparc64-linux.xml
file path=usr/share/gdb/syscalls/sparc64-solaris.xml
file path=usr/share/gdb/system-gdbinit/elinos.py
file path=usr/share/gdb/system-gdbinit/wrs-linux.py
file path=usr/share/info/annotate.info
file path=usr/share/info/bfd.info
file path=usr/share/info/ctf-spec.info
file path=usr/share/info/dir
file path=usr/share/info/gdb.info
file path=usr/share/info/gdb.info-1
@@ -91,6 +97,7 @@
file path=usr/share/info/gdb.info-5
file path=usr/share/info/gdb.info-6
file path=usr/share/info/gdb.info-7
file path=usr/share/info/gdb.info-8
file path=usr/share/info/stabs.info
file path=usr/share/locale/da/LC_MESSAGES/bfd.mo
file path=usr/share/locale/da/LC_MESSAGES/opcodes.mo
@@ -102,11 +109,13 @@
file path=usr/share/locale/fr/LC_MESSAGES/bfd.mo
file path=usr/share/locale/fr/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/ga/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/hr/LC_MESSAGES/bfd.mo
file path=usr/share/locale/id/LC_MESSAGES/bfd.mo
file path=usr/share/locale/id/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/it/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/ja/LC_MESSAGES/bfd.mo
file path=usr/share/locale/nl/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/pt/LC_MESSAGES/bfd.mo
file path=usr/share/locale/pt_BR/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/ro/LC_MESSAGES/bfd.mo
file path=usr/share/locale/ro/LC_MESSAGES/opcodes.mo
@@ -124,4 +133,8 @@
file path=usr/share/locale/vi/LC_MESSAGES/opcodes.mo
file path=usr/share/locale/zh_CN/LC_MESSAGES/bfd.mo
file path=usr/share/locale/zh_CN/LC_MESSAGES/opcodes.mo
file path=usr/share/man/man1/gcore.1
file path=usr/share/man/man1/gdb-add-index.1
file path=usr/share/man/man1/gdb.1
file path=usr/share/man/man1/gdbserver.1
file path=usr/share/man/man5/gdbinit.5
components/developer/gdb/patches/001-fix-proc-name-size.patch
File was deleted
components/developer/gdb/patches/002-Makefile_in.patch
File was deleted
components/developer/gdb/patches/003-remove-core-warning.patch
File was deleted
components/developer/gdb/patches/004-elf-core.patch
File was deleted
components/developer/gdb/patches/005-regcache-core.patch
File was deleted
components/developer/gdb/patches/006-features-i386.patch
File was deleted
components/developer/gdb/patches/007-solib-svr4.patch
File was deleted
components/developer/gdb/patches/008-syscalls.patch
File was deleted
components/developer/gdb/patches/021-python-37.patch
File was deleted
components/developer/gdb/patches/30-python-3.9.patch
File was deleted
components/developer/gdb/patches/31-prompt-SyntaxWarning.patch
File was deleted
components/developer/gdb/patches/features-i386.patch
New file
@@ -0,0 +1,160 @@
diff -wpruN '--exclude=*.orig' a~/gdb/features/Makefile a/gdb/features/Makefile
--- a~/gdb/features/Makefile    1970-01-01 00:00:00
+++ a/gdb/features/Makefile    1970-01-01 00:00:00
@@ -99,6 +99,11 @@ OUTPUTS = $(patsubst %,$(outdir)/%.dat,$
 # --enable-targets=all GDB.  You can override this by passing XMLTOC
 # to make on the command line.
 XMLTOC = \
+    i386/amd64-avx-illumos.xml \
+    i386/amd64-illumos.xml \
+    i386/i386-avx-illumos.xml \
+    i386/i386-illumos.xml \
+    i386/i386-mmx-illumos.xml \
     microblaze-with-stack-protect.xml \
     microblaze.xml \
     mips-dsp-linux.xml \
@@ -227,6 +232,8 @@ FEATURE_XMLFILES = aarch64-core.xml \
     i386/64bit-pkeys.xml \
     i386/64bit-sse.xml \
     i386/x32-core.xml \
+    i386/32bit-illumos.xml \
+    i386/64bit-illumos.xml \
     loongarch/base32.xml \
     loongarch/base64.xml \
     riscv/rv32e-xregs.xml \
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/32bit-illumos.xml a/gdb/features/i386/32bit-illumos.xml
--- a~/gdb/features/i386/32bit-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/32bit-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.i386.illumos">
+  <reg name="orig_eax" bitsize="32" type="int" regnum="41"/>
+</feature>
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/64bit-illumos.xml a/gdb/features/i386/64bit-illumos.xml
--- a~/gdb/features/i386/64bit-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/64bit-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.i386.illumos">
+  <reg name="orig_rax" bitsize="64" type="int" regnum="57"/>
+</feature>
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/amd64-avx-illumos.xml a/gdb/features/i386/amd64-avx-illumos.xml
--- a~/gdb/features/i386/amd64-avx-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/amd64-avx-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- AMD64 with AVX - illumos.  -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  <architecture>i386:x86-64</architecture>
+  <osabi>illumos</osabi>
+  <xi:include href="64bit-core.xml"/>
+  <xi:include href="64bit-sse.xml"/>
+  <xi:include href="64bit-illumos.xml"/>
+  <xi:include href="64bit-avx.xml"/>
+</target>
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/amd64-illumos.xml a/gdb/features/i386/amd64-illumos.xml
--- a~/gdb/features/i386/amd64-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/amd64-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- AMD64 - illumos.  -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  <architecture>i386:x86-64</architecture>
+  <osabi>illumos</osabi>
+  <xi:include href="64bit-core.xml"/>
+  <xi:include href="64bit-sse.xml"/>
+  <xi:include href="64bit-illumos.xml"/>
+</target>
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/i386-avx-illumos.xml a/gdb/features/i386/i386-avx-illumos.xml
--- a~/gdb/features/i386/i386-avx-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/i386-avx-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- I386 with AVX - illumos.  -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  <architecture>i386</architecture>
+  <osabi>illumos</osabi>
+  <xi:include href="32bit-core.xml"/>
+  <xi:include href="32bit-sse.xml"/>
+  <xi:include href="32bit-illumos.xml"/>
+  <xi:include href="32bit-avx.xml"/>
+</target>
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/i386-illumos.xml a/gdb/features/i386/i386-illumos.xml
--- a~/gdb/features/i386/i386-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/i386-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- I386 with SSE - illumos.  -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  <architecture>i386</architecture>
+  <osabi>illumos</osabi>
+  <xi:include href="32bit-core.xml"/>
+  <xi:include href="32bit-illumos.xml"/>
+  <xi:include href="32bit-sse.xml"/>
+</target>
diff -wpruN '--exclude=*.orig' a~/gdb/features/i386/i386-mmx-illumos.xml a/gdb/features/i386/i386-mmx-illumos.xml
--- a~/gdb/features/i386/i386-mmx-illumos.xml    1970-01-01 00:00:00
+++ a/gdb/features/i386/i386-mmx-illumos.xml    1970-01-01 00:00:00
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- I386 with MMX - illumos.  -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  <architecture>i386</architecture>
+  <osabi>illumos</osabi>
+  <xi:include href="32bit-core.xml"/>
+  <xi:include href="32bit-illumos.xml"/>
+</target>
components/developer/gdb/patches/fix-attach.patch
New file
@@ -0,0 +1,19 @@
Started with GDB 10.1, the attach to a process was crashing
because the_procfs_target variable had not been initialized
with a valid process_stratum_target structure. To workaround
the issue, we extract a valid stratum from the current inferior.
Will be sent to upstream.
diff -wpruN '--exclude=*.orig' a~/gdb/procfs.c a/gdb/procfs.c
--- a~/gdb/procfs.c    1970-01-01 00:00:00
+++ a/gdb/procfs.c    1970-01-01 00:00:00
@@ -1864,7 +1864,7 @@ do_attach (ptid_t ptid)
   /* Add it to gdb's thread list.  */
   ptid = ptid_t (pi->pid, lwpid, 0);
-  thread_info *thr = add_thread (&the_procfs_target, ptid);
+  thread_info *thr = add_thread (inf->process_target(), ptid);
   switch_to_thread (thr);
 }
components/developer/gdb/patches/fix-null-ptr.patch
New file
@@ -0,0 +1,12 @@
diff -wpruN '--exclude=*.orig' a~/gdb/osabi.c a/gdb/osabi.c
--- a~/gdb/osabi.c    1970-01-01 00:00:00
+++ a/gdb/osabi.c    1970-01-01 00:00:00
@@ -64,7 +64,7 @@ static const struct osabi_names gdb_osab
   { "SVR4", NULL },
   { "GNU/Hurd", NULL },
-  { "Solaris", NULL },
+  { "illumos", "solaris[2-9]\.[0-9][0-9]" },
   { "GNU/Linux", "linux(-gnu[^-]*)?" },
   { "FreeBSD", NULL },
   { "NetBSD", NULL },
components/developer/gdb/patches/force-bash.patch
New file
@@ -0,0 +1,23 @@
GNU debugger does not work well with Korn shell, it
either fails with the fatal assertion or breakpoints
are completely ignored. To workaround Korn shell issues,
we force GDB to internally use well-tested bash shell.
Not suitable for upstream.
diff -wpruN '--exclude=*.orig' a~/gdbsupport/pathstuff.cc a/gdbsupport/pathstuff.cc
--- a~/gdbsupport/pathstuff.cc    1970-01-01 00:00:00
+++ a/gdbsupport/pathstuff.cc    1970-01-01 00:00:00
@@ -358,11 +358,7 @@ find_gdb_home_config_file (const char *n
 const char *
 get_shell ()
 {
-  const char *ret = getenv ("SHELL");
-  if (ret == NULL)
-    ret = "/bin/sh";
-
-  return ret;
+  return "/bin/bash";
 }
 /* See gdbsupport/pathstuff.h.  */
components/developer/gdb/patches/remove-core-warning.patch
New file
@@ -0,0 +1,24 @@
# The warning below appears multiple times for .reg2 when debugging a core
# file on x86.  Can't set REGSET_VARIABLE_SIZE flag, so
# just remove the warning.
# Note: this patch may not be appropriate for upstream;
# it may eventually be removed.
diff -wpruN '--exclude=*.orig' a~/gdb/corelow.c a/gdb/corelow.c
--- a~/gdb/corelow.c    1970-01-01 00:00:00
+++ a/gdb/corelow.c    1970-01-01 00:00:00
@@ -650,11 +650,14 @@ core_target::get_core_register_section (
            section_name.c_str ());
       return;
     }
+#if !defined(__sun) && !defined(__SVR4)
+    /* skip this warning for illumos */
   if (size != section_min_size && !variable_size_section)
     {
       warning (_("Unexpected size of section `%s' in core file."),
            section_name.c_str ());
     }
+#endif
   gdb::byte_vector contents (size);
   if (!bfd_get_section_contents (core_bfd, section, contents.data (),
components/developer/gdb/patches/series
New file
@@ -0,0 +1,7 @@
features-i386.patch
syscalls.patch
#
fix-null-ptr.patch
remove-core-warning.patch
force-bash.patch
fix-attach.patch
components/developer/gdb/patches/syscalls.patch
New file
@@ -0,0 +1,17 @@
The XML representation of the illumos system calls is generated in ../build.sh
diff -wpruN '--exclude=*.orig' a~/gdb/data-directory/Makefile.in a/gdb/data-directory/Makefile.in
--- a~/gdb/data-directory/Makefile.in    1970-01-01 00:00:00
+++ a/gdb/data-directory/Makefile.in    1970-01-01 00:00:00
@@ -51,8 +51,10 @@ SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_D
 GEN_SYSCALLS_FILES = \
     aarch64-linux.xml \
     amd64-linux.xml \
+    amd64-illumos.xml \
     arm-linux.xml \
     i386-linux.xml \
+    i386-illumos.xml \
     mips-n32-linux.xml \
     mips-n64-linux.xml \
     mips-o32-linux.xml \
components/developer/gdb/pkg5
@@ -4,11 +4,15 @@
        "compress/xz",
        "developer/babeltrace",
        "library/expat",
        "library/gmp",
        "library/mpfr",
        "library/ncurses",
        "library/zlib",
        "runtime/python-39",
        "shell/ksh93",
        "system/library",
        "system/library/g++-10-runtime",
        "system/library/gcc-10-runtime",
        "system/library/math"
    ],
    "fmris": [