Module Name:    src
Committed By:   christos
Date:           Wed Aug  9 21:12:50 UTC 2023

Added Files:
        src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64:
            backtrace-supported.h config.h defs.mk
        src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import:
            glob-libc.gl.h
        src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/malloc:
            scratch_buffer.gl.h
        src/external/gpl3/gdb/lib/libsframe/arch/aarch64: defs.mk

Log Message:
add new files for aarch64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
    src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/backtrace-supported.h \
    src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/config.h \
    src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/defs.mk
cvs rdiff -u -r0 -r1.1 \
    
src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/glob-libc.gl.h
cvs rdiff -u -r0 -r1.1 \
    
src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/malloc/scratch_buffer.gl.h
cvs rdiff -u -r0 -r1.1 \
    src/external/gpl3/gdb/lib/libsframe/arch/aarch64/defs.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/backtrace-supported.h
diff -u /dev/null src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/backtrace-supported.h:1.1
--- /dev/null	Wed Aug  9 17:12:50 2023
+++ src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/backtrace-supported.h	Wed Aug  9 17:12:50 2023
@@ -0,0 +1,70 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* backtrace-supported.h.in -- Whether stack backtrace is supported.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   Written by Ian Lance Taylor, Google.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    (1) Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+    (2) Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+    (3) The name of the author may not be used to
+    endorse or promote products derived from this software without
+    specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.  */
+
+/* The file backtrace-supported.h.in is used by configure to generate
+   the file backtrace-supported.h.  The file backtrace-supported.h may
+   be #include'd to see whether the backtrace library will be able to
+   get a backtrace and produce symbolic information.  */
+
+
+/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library
+   should work, 0 if it will not.  Libraries may #include this to make
+   other arrangements.  */
+
+#define BACKTRACE_SUPPORTED 1
+
+/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace
+   library will call malloc as it works, 0 if it will call mmap
+   instead.  This may be used to determine whether it is safe to call
+   the backtrace functions from a signal handler.  In general this
+   only applies to calls like backtrace and backtrace_pcinfo.  It does
+   not apply to backtrace_simple, which never calls malloc.  It does
+   not apply to backtrace_print, which always calls fprintf and
+   therefore malloc.  */
+
+#define BACKTRACE_USES_MALLOC 0
+
+/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace
+   library is configured with threading support, 0 if not.  If this is
+   0, the threaded parameter to backtrace_create_state must be passed
+   as 0.  */
+
+#define BACKTRACE_SUPPORTS_THREADS 1
+
+/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo
+   will work for variables.  It will always work for functions.  */
+
+#define BACKTRACE_SUPPORTS_DATA 1
Index: src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/config.h
diff -u /dev/null src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/config.h:1.1
--- /dev/null	Wed Aug  9 17:12:50 2023
+++ src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/config.h	Wed Aug  9 17:12:50 2023
@@ -0,0 +1,189 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* ELF size: 32 or 64 */
+#define BACKTRACE_ELF_SIZE 64
+
+/* XCOFF size: 32 or 64 */
+#define BACKTRACE_XCOFF_SIZE unused
+
+/* Define to 1 if you have the __atomic functions */
+#define HAVE_ATOMIC_FUNCTIONS 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you
+   don't. */
+#define HAVE_DECL_GETPAGESIZE 1
+
+/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
+   don't. */
+#define HAVE_DECL_STRNLEN 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define if dl_iterate_phdr is available. */
+#define HAVE_DL_ITERATE_PHDR 1
+
+/* Define to 1 if you have the fcntl function */
+#define HAVE_FCNTL 1
+
+/* Define if getexecname is available. */
+/* #undef HAVE_GETEXECNAME */
+
+/* Define if _Unwind_GetIPInfo is available. */
+#define HAVE_GETIPINFO 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in <sys/sysctl.h>.
+   */
+#define HAVE_KERN_PROC 1
+
+/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in
+   <sys/sysctl.h>. */
+#define HAVE_KERN_PROC_ARGS 1
+
+/* Define if -llzma is available. */
+#define HAVE_LIBLZMA 1
+
+/* Define to 1 if you have the <link.h> header file. */
+#define HAVE_LINK_H 1
+
+/* Define if AIX loadquery is available. */
+/* #undef HAVE_LOADQUERY */
+
+/* Define to 1 if you have the `lstat' function. */
+#define HAVE_LSTAT 1
+
+/* Define to 1 if you have the <mach-o/dyld.h> header file. */
+/* #undef HAVE_MACH_O_DYLD_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `readlink' function. */
+#define HAVE_READLINK 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the __sync functions */
+#define HAVE_SYNC_FUNCTIONS 1
+
+/* Define to 1 if you have the <sys/ldr.h> header file. */
+/* #undef HAVE_SYS_LDR_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if -lz is available. */
+#define HAVE_ZLIB 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "package-unused"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "package-unused version-unused"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libbacktrace"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "version-unused"
+
+/* The size of `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of `void *', as computed by sizeof. */
+/* #undef SIZEOF_VOID_P */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
Index: src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/defs.mk
diff -u /dev/null src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/defs.mk:1.1
--- /dev/null	Wed Aug  9 17:12:50 2023
+++ src/external/gpl3/gdb/lib/libbacktrace/arch/aarch64/defs.mk	Wed Aug  9 17:12:50 2023
@@ -0,0 +1,6 @@
+# This file is automatically generated.  DO NOT EDIT!
+# Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp 
+# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp 
+#
+G_OBJECTS=atomic.o dwarf.o fileline.o posix.o print.o sort.o state.o
+G_LIBADD=backtrace.o simple.o elf.o mmapio.o mmap.o

Index: src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/glob-libc.gl.h
diff -u /dev/null src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/glob-libc.gl.h:1.1
--- /dev/null	Wed Aug  9 17:12:50 2023
+++ src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/glob-libc.gl.h	Wed Aug  9 17:12:50 2023
@@ -0,0 +1,204 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+/* Copyright (C) 1991-2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GLOB_H
+#define _GLOB_H 1
+
+#ifndef __GLOB_GNULIB
+# include <sys/cdefs.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Bits set in the FLAGS argument to 'glob'.  */
+#define GLOB_ERR        (1 << 0)/* Return on read errors.  */
+#define GLOB_MARK       (1 << 1)/* Append a slash to each name.  */
+#define GLOB_NOSORT     (1 << 2)/* Don't sort the names.  */
+#define GLOB_DOOFFS     (1 << 3)/* Insert PGLOB->gl_offs NULLs.  */
+#define GLOB_NOCHECK    (1 << 4)/* If nothing matches, return the pattern.  */
+#define GLOB_APPEND     (1 << 5)/* Append to results of a previous call.  */
+#define GLOB_NOESCAPE   (1 << 6)/* Backslashes don't quote metacharacters.  */
+#define GLOB_PERIOD     (1 << 7)/* Leading '.' can be matched by metachars.  */
+
+#if !defined __USE_POSIX2 || 1
+# define GLOB_MAGCHAR    (1 << 8)/* Set in gl_flags if any metachars seen.  */
+# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions.  */
+# define GLOB_BRACE      (1 << 10)/* Expand "{a,b}" to "a" "b".  */
+# define GLOB_NOMAGIC    (1 << 11)/* If no magic chars, return the pattern.  */
+# define GLOB_TILDE      (1 << 12)/* Expand ~user and ~ to home directories. */
+# define GLOB_ONLYDIR    (1 << 13)/* Match only directories.  */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+                                      if the user name is not available.  */
+# define __GLOB_FLAGS   (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS  \
+                         |GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND     \
+                         |GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE     \
+                         |GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
+#else
+# define __GLOB_FLAGS   (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS  \
+                         |GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND     \
+                         |GLOB_PERIOD)
+#endif
+
+/* Error returns from 'glob'.  */
+#define GLOB_NOSPACE    1       /* Ran out of memory.  */
+#define GLOB_ABORTED    2       /* Read error.  */
+#define GLOB_NOMATCH    3       /* No matches found.  */
+#define GLOB_NOSYS      4       /* Not implemented.  */
+#if 1
+/* Previous versions of this file defined GLOB_ABEND instead of
+   GLOB_ABORTED.  Provide a compatibility definition here.  */
+# define GLOB_ABEND GLOB_ABORTED
+#endif
+
+/* Structure describing a globbing run.  */
+#if 1
+struct stat;
+#endif
+typedef struct
+  {
+    size_t gl_pathc;          /* Count of paths matched by the pattern.  */
+    char **gl_pathv;            /* List of matched pathnames.  */
+    size_t gl_offs;           /* Slots to reserve in 'gl_pathv'.  */
+    int gl_flags;               /* Set to FLAGS, maybe | GLOB_MAGCHAR.  */
+
+    /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+       are used instead of the normal file access functions.  */
+    void (*gl_closedir) (void *);
+#if 1
+    struct dirent *(*gl_readdir) (void *);
+#else
+    void *(*gl_readdir) (void *);
+#endif
+    void *(*gl_opendir) (const char *);
+#if 1
+    int (*gl_lstat) (const char *restrict, struct stat *restrict);
+    int (*gl_stat) (const char *restrict, struct stat *restrict);
+#else
+    int (*gl_lstat) (const char *restrict, void *restrict);
+    int (*gl_stat) (const char *restrict, void *restrict);
+#endif
+  } glob_t;
+
+#if 0
+# if 1
+struct stat64;
+# endif
+typedef struct
+  {
+    size_t gl_pathc;
+    char **gl_pathv;
+    size_t gl_offs;
+    int gl_flags;
+
+    /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+       are used instead of the normal file access functions.  */
+    void (*gl_closedir) (void *);
+# if 1
+    struct dirent64 *(*gl_readdir) (void *);
+# else
+    void *(*gl_readdir) (void *);
+# endif
+    void *(*gl_opendir) (const char *);
+# if 1
+    int (*gl_lstat) (const char *restrict, struct stat64 *restrict);
+    int (*gl_stat) (const char *restrict, struct stat64 *restrict);
+# else
+    int (*gl_lstat) (const char *restrict, void *restrict);
+    int (*gl_stat) (const char *restrict, void *restrict);
+# endif
+  } glob64_t;
+#endif
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+   The bits defined above may be set in FLAGS.
+   If a directory cannot be opened or read and ERRFUNC is not nil,
+   it is called with the pathname that caused the error, and the
+   'errno' value from the failing call; if it returns non-zero
+   'glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+   If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+   Otherwise, 'glob' returns zero.  */
+#if !defined __USE_FILE_OFFSET64 || defined __GLOB_GNULIB
+extern int glob (const char *restrict __pattern, int __flags,
+                 int (*__errfunc) (const char *, int),
+                 glob_t *restrict __pglob) ;
+
+/* Free storage allocated in PGLOB by a previous 'glob' call.  */
+extern void globfree (glob_t *__pglob) ;
+#else
+# ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTHNL (glob, (const char *restrict __pattern,
+                                   int __flags,
+                                   int (*__errfunc) (const char *, int),
+                                   glob_t *restrict __pglob),
+                            __glob64_time64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob),
+                           __globfree64_time64);
+# else
+extern int __REDIRECT_NTHNL (glob, (const char *restrict __pattern,
+                                    int __flags,
+                                    int (*__errfunc) (const char *, int),
+                                    glob_t *restrict __pglob), glob64);
+
+extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
+# endif
+#endif
+
+#if 0
+# ifdef __USE_TIME_BITS64
+extern int __REDIRECT_NTHNL (glob64, (const char *restrict __pattern,
+                                     int __flags,
+                                     int (*__errfunc) (const char *, int),
+                                     glob64_t *restrict __pglob),
+                            __glob64_time64);
+
+extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob),
+                           __globfree64_time64);
+# else
+extern int glob64 (const char *restrict __pattern, int __flags,
+                   int (*__errfunc) (const char *, int),
+                   glob64_t *restrict __pglob) ;
+
+extern void globfree64 (glob64_t *__pglob) ;
+# endif
+#endif
+
+
+#if 1
+/* Return nonzero if PATTERN contains any metacharacters.
+   Metacharacters can be quoted with backslashes if QUOTE is nonzero.
+
+   This function is not part of the interface specified by POSIX.2
+   but several programs want to use it.  */
+extern int glob_pattern_p (const char *__pattern, int __quote) ;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* glob.h  */

Index: src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/malloc/scratch_buffer.gl.h
diff -u /dev/null src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/malloc/scratch_buffer.gl.h:1.1
--- /dev/null	Wed Aug  9 17:12:50 2023
+++ src/external/gpl3/gdb/lib/libgnulib/arch/aarch64/gnulib/import/malloc/scratch_buffer.gl.h	Wed Aug  9 17:12:50 2023
@@ -0,0 +1,152 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
+
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2022 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SCRATCH_BUFFER_H
+#define _SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+   heap allocation.  It is expected that this function is used in this
+   way:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+	 return -1;
+
+     scratch_buffer_free (&tmpbuf);
+     return 0;
+
+   The allocation functions (scratch_buffer_grow,
+   scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+   sure that the heap allocation, if any, is freed, so that the code
+   above does not have a memory leak.  The buffer still remains in a
+   state that can be deallocated using scratch_buffer_free, so a loop
+   like this is valid as well:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+	 break;
+
+     scratch_buffer_free (&tmpbuf);
+
+   scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+   to grow the buffer by at least 512 bytes.  This means that when
+   using the scratch buffer as a backing store for a non-character
+   array whose element size, in bytes, is 512 or smaller, the scratch
+   buffer only has to grow once to make room for at least one more
+   element.
+*/
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+/* Scratch buffer.  Must be initialized with scratch_buffer_init
+   before its use.  */
+struct scratch_buffer {
+  void *data;    /* Pointer to the beginning of the scratch area.  */
+  size_t length; /* Allocated space at the data pointer, in bytes.  */
+  union { max_align_t __align; char __c[1024]; } __space;
+};
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+   and BUFFER->length reflects the available space.  */
+static inline void
+scratch_buffer_init (struct scratch_buffer *buffer)
+{
+  buffer->data = buffer->__space.__c;
+  buffer->length = sizeof (buffer->__space);
+}
+
+/* Deallocates *BUFFER (if it was heap-allocated).  */
+static inline void
+scratch_buffer_free (struct scratch_buffer *buffer)
+{
+  if (buffer->data != buffer->__space.__c)
+    free (buffer->data);
+}
+
+/* Grow *BUFFER by some arbitrary amount.  The buffer contents is NOT
+   preserved.  Return true on success, false on allocation failure (in
+   which case the old buffer is freed).  On success, the new buffer is
+   larger than the previous size.  On failure, *BUFFER is deallocated,
+   but remains in a free-able state, and errno is set.  */
+bool __libc_scratch_buffer_grow (struct scratch_buffer *buffer);
+
+/* Alias for __libc_scratch_buffer_grow.  */
+static inline _GL_ATTRIBUTE_ALWAYS_INLINE bool
+scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+  return _GL_LIKELY (__libc_scratch_buffer_grow (buffer));
+}
+
+/* Like __libc_scratch_buffer_grow, but preserve the old buffer
+   contents on success, as a prefix of the new buffer.  */
+bool __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+
+/* Alias for __libc_scratch_buffer_grow_preserve.  */
+static inline _GL_ATTRIBUTE_ALWAYS_INLINE bool
+scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+  return _GL_LIKELY (__libc_scratch_buffer_grow_preserve (buffer));
+}
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+   bytes.  The buffer contents are NOT preserved.  Both NELEM and SIZE
+   can be zero.  Return true on success, false on allocation failure
+   (in which case the old buffer is freed, but *BUFFER remains in a
+   free-able state, and errno is set).  It is unspecified whether this
+   function can reduce the array size.  */
+bool __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+					   size_t nelem, size_t size);
+
+/* Alias for __libc_scratch_set_array_size.  */
+static inline _GL_ATTRIBUTE_ALWAYS_INLINE bool
+scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+			       size_t nelem, size_t size)
+{
+  return _GL_LIKELY (__libc_scratch_buffer_set_array_size
+			 (buffer, nelem, size));
+}
+
+/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
+   deallocating *BUFFER if it was heap-allocated.  SIZE must be at
+   most *BUFFER's size.  Return NULL (setting errno) on memory
+   exhaustion.  */
+void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
+                                     size_t size);
+
+/* Alias for __libc_scratch_dupfree.  */
+static inline _GL_ATTRIBUTE_ALWAYS_INLINE void *
+scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+  void *r = __libc_scratch_buffer_dupfree (buffer, size);
+  return _GL_LIKELY (r != NULL) ? r : NULL;
+}
+
+#endif /* _SCRATCH_BUFFER_H */

Index: src/external/gpl3/gdb/lib/libsframe/arch/aarch64/defs.mk
diff -u /dev/null src/external/gpl3/gdb/lib/libsframe/arch/aarch64/defs.mk:1.1
--- /dev/null	Wed Aug  9 17:12:50 2023
+++ src/external/gpl3/gdb/lib/libsframe/arch/aarch64/defs.mk	Wed Aug  9 17:12:50 2023
@@ -0,0 +1,5 @@
+# This file is automatically generated.  DO NOT EDIT!
+# Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp 
+# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp 
+#
+G_OBJECTS=sframe.o sframe-dump.o sframe-error.o

Reply via email to