head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC7:1.1.1.1 netbsd-11-0-RC6:1.1.1.1 netbsd-11-0-RC5:1.1.1.1 netbsd-11-0-RC4:1.1.1.1 netbsd-11-0-RC3:1.1.1.1 gdb-17-1:1.1.1.2 netbsd-11-0-RC2:1.1.1.1 netbsd-11-0-RC1:1.1.1.1 gdb-16-3:1.1.1.1 perseant-exfatfs-base-20250801:1.1.1.1 netbsd-11:1.1.1.1.0.30 netbsd-11-base:1.1.1.1 netbsd-10-1-RELEASE:1.1.1.1 gdb-15-1:1.1.1.1 perseant-exfatfs-base-20240630:1.1.1.1 perseant-exfatfs:1.1.1.1.0.28 perseant-exfatfs-base:1.1.1.1 netbsd-8-3-RELEASE:1.1.1.1 netbsd-9-4-RELEASE:1.1.1.1 netbsd-10-0-RELEASE:1.1.1.1 netbsd-10-0-RC6:1.1.1.1 netbsd-10-0-RC5:1.1.1.1 netbsd-10-0-RC4:1.1.1.1 netbsd-10-0-RC3:1.1.1.1 netbsd-10-0-RC2:1.1.1.1 netbsd-10-0-RC1:1.1.1.1 gdb-13-2:1.1.1.1 netbsd-10:1.1.1.1.0.26 netbsd-10-base:1.1.1.1 netbsd-9-3-RELEASE:1.1.1.1 cjep_sun2x-base1:1.1.1.1 cjep_sun2x:1.1.1.1.0.24 cjep_sun2x-base:1.1.1.1 cjep_staticlib_x-base1:1.1.1.1 netbsd-9-2-RELEASE:1.1.1.1 cjep_staticlib_x:1.1.1.1.0.22 cjep_staticlib_x-base:1.1.1.1 netbsd-9-1-RELEASE:1.1.1.1 GDB-11-0-50-20200914-git:1.1.1.1 phil-wifi-20200421:1.1.1.1 phil-wifi-20200411:1.1.1.1 is-mlppp:1.1.1.1.0.20 is-mlppp-base:1.1.1.1 phil-wifi-20200406:1.1.1.1 netbsd-8-2-RELEASE:1.1.1.1 netbsd-9-0-RELEASE:1.1.1.1 netbsd-9-0-RC2:1.1.1.1 netbsd-9-0-RC1:1.1.1.1 phil-wifi-20191119:1.1.1.1 netbsd-9:1.1.1.1.0.18 netbsd-9-base:1.1.1.1 phil-wifi-20190609:1.1.1.1 netbsd-8-1-RELEASE:1.1.1.1 gdb-8-3:1.1.1.1 netbsd-8-1-RC1:1.1.1.1 pgoyette-compat-merge-20190127:1.1.1.1 pgoyette-compat-20190127:1.1.1.1 pgoyette-compat-20190118:1.1.1.1 pgoyette-compat-1226:1.1.1.1 pgoyette-compat-1126:1.1.1.1 pgoyette-compat-1020:1.1.1.1 pgoyette-compat-0930:1.1.1.1 pgoyette-compat-0906:1.1.1.1 pgoyette-compat-0728:1.1.1.1 netbsd-8-0-RELEASE:1.1.1.1 phil-wifi:1.1.1.1.0.16 phil-wifi-base:1.1.1.1 pgoyette-compat-0625:1.1.1.1 netbsd-8-0-RC2:1.1.1.1 pgoyette-compat-0521:1.1.1.1 pgoyette-compat-0502:1.1.1.1 pgoyette-compat-0422:1.1.1.1 netbsd-8-0-RC1:1.1.1.1 pgoyette-compat-0415:1.1.1.1 pgoyette-compat-0407:1.1.1.1 pgoyette-compat-0330:1.1.1.1 pgoyette-compat-0322:1.1.1.1 pgoyette-compat-0315:1.1.1.1 pgoyette-compat:1.1.1.1.0.14 pgoyette-compat-base:1.1.1.1 gdb-8-0-1:1.1.1.1 matt-nb8-mediatek:1.1.1.1.0.12 matt-nb8-mediatek-base:1.1.1.1 perseant-stdc-iso10646:1.1.1.1.0.10 perseant-stdc-iso10646-base:1.1.1.1 netbsd-8:1.1.1.1.0.8 netbsd-8-base:1.1.1.1 prg-localcount2-base3:1.1.1.1 prg-localcount2-base2:1.1.1.1 prg-localcount2-base1:1.1.1.1 prg-localcount2:1.1.1.1.0.6 prg-localcount2-base:1.1.1.1 pgoyette-localcount-20170426:1.1.1.1 bouyer-socketcan-base1:1.1.1.1 pgoyette-localcount-20170320:1.1.1.1 bouyer-socketcan:1.1.1.1.0.4 bouyer-socketcan-base:1.1.1.1 pgoyette-localcount-20170107:1.1.1.1 pgoyette-localcount-20161104:1.1.1.1 gdb-7-12:1.1.1.1 localcount-20160914:1.1.1.1 pgoyette-localcount-20160806:1.1.1.1 pgoyette-localcount-20160726:1.1.1.1 pgoyette-localcount:1.1.1.1.0.2 pgoyette-localcount-base:1.1.1.1 gdb-7-10-1:1.1.1.1 FSF:1.1.1; locks; strict; comment @# @; 1.1 date 2016.02.03.03.00.20; author christos; state Exp; branches 1.1.1.1; next ; commitid uy8uLhh4ZQtrSpTy; 1.1.1.1 date 2016.02.03.03.00.20; author christos; state Exp; branches; next 1.1.1.2; commitid uy8uLhh4ZQtrSpTy; 1.1.1.2 date 2026.03.14.20.45.21; author christos; state Exp; branches; next ; commitid FYd84EijbJAv3ZxG; desc @@ 1.1 log @Initial revision @ text @Puff -- A Simple Inflate 3 Mar 2003 Mark Adler madler@@alumni.caltech.edu What this is -- puff.c provides the routine puff() to decompress the deflate data format. It does so more slowly than zlib, but the code is about one-fifth the size of the inflate code in zlib, and written to be very easy to read. Why I wrote this -- puff.c was written to document the deflate format unambiguously, by virtue of being working C code. It is meant to supplement RFC 1951, which formally describes the deflate format. I have received many questions on details of the deflate format, and I hope that reading this code will answer those questions. puff.c is heavily commented with details of the deflate format, especially those little nooks and cranies of the format that might not be obvious from a specification. puff.c may also be useful in applications where code size or memory usage is a very limited resource, and speed is not as important. How to use it -- Well, most likely you should just be reading puff.c and using zlib for actual applications, but if you must ... Include puff.h in your code, which provides this prototype: int puff(unsigned char *dest, /* pointer to destination pointer */ unsigned long *destlen, /* amount of output space */ unsigned char *source, /* pointer to source data pointer */ unsigned long *sourcelen); /* amount of input available */ Then you can call puff() to decompress a deflate stream that is in memory in its entirety at source, to a sufficiently sized block of memory for the decompressed data at dest. puff() is the only external symbol in puff.c The only C library functions that puff.c needs are setjmp() and longjmp(), which are used to simplify error checking in the code to improve readabilty. puff.c does no memory allocation, and uses less than 2K bytes off of the stack. If destlen is not enough space for the uncompressed data, then inflate will return an error without writing more than destlen bytes. Note that this means that in order to decompress the deflate data successfully, you need to know the size of the uncompressed data ahead of time. If needed, puff() can determine the size of the uncompressed data with no output space. This is done by passing dest equal to (unsigned char *)0. Then the initial value of *destlen is ignored and *destlen is set to the length of the uncompressed data. So if the size of the uncompressed data is not known, then two passes of puff() can be used--first to determine the size, and second to do the actual inflation after allocating the appropriate memory. Not pretty, but it works. (This is one of the reasons you should be using zlib.) The deflate format is self-terminating. If the deflate stream does not end in *sourcelen bytes, puff() will return an error without reading at or past endsource. On return, *sourcelen is updated to the amount of input data consumed, and *destlen is updated to the size of the uncompressed data. See the comments in puff.c for the possible return codes for puff(). @ 1.1.1.1 log @Import gdb-7.10.1: 2015-06-30 H.J. Lu * configure.ac (ospace_frag): Enable for i?86*-*-elfiamcu target. * configure: Regenerate. 2015-05-13 John David Anglin * configure.ac: Disable configuration of GDB for HPUX targets. * configure: Regenerate. 2015-05-01 H.J. Lu PR ld/18355 * Makefile.def: Add extra_configure_flags to host zlib. * configure.ac (extra_host_zlib_configure_flags): New. Set to --enable-host-shared When bfd is to be built as shared library. AC_SUBST. * Makefile.in: Regenerated. 2015-04-15 Mike Frysinger Hans-Peter Nilsson Adjust src-release.sh for sim using the gdb create-version.sh. * src-release.sh (tar_compress): If there's a fifth parameter, use that in the getver call instead of $tool. (sim_release): Pass gdb as fifth parameter to tar_compress. (SIM_SUPPORT_DIRS): Add gdb/common/create-version.sh. 2015-04-14 Max Ostapenko * Makefile.tpl (EXTRA_HOST_EXPORTS): New variables. (EXTRA_BOOTSTRAP_FLAGS): Likewise. (check-[+module+]): Add EXTRA_HOST_EXPORTS and EXTRA_BOOTSTRAP_FLAGS. * Makefile.in: Regenerate. 2015-04-01 H.J. Lu * configure.ac: Add --with-system-zlib. * configure: Regenerated. 2015-03-31 H.J. Lu * src-release.sh: Don't configure with --with-target-subdir=. --disable-multilib. 2015-03-31 H.J. Lu * src-release.sh (DEVO_SUPPORT): Replace src-release with src-release.sh. 2015-03-30 Ed Schouten * config.sub: Update from upstream, to 2015-03-04 version. * config.guess: Likewise. 2015-03-30 H.J. Lu * Makefile.def (dependencies): Add all-zlib to all-bfd. * Makefile.in: Regenerated. 2015-03-28 H.J. Lu * src-release.sh (do_proto_toplev): Configure with --target --with-target-subdir and --disable-multilib. (BINUTILS_SUPPORT_DIRS): Add zlib. (GAS_SUPPORT_DIRS): Likewise. (GDB_SUPPORT_DIRS): Likewise. (SIM_SUPPORT_DIRS): Likewise. 2015-03-17 H.J. Lu * configure.ac (target_configdirs): Exclude target-zlib if target-libjava isn't built. * configure: Regenerated. 2015-03-17 H.J. Lu Sync with GCC 2014-06-13 Thomas Schwinge * config-ml.in: Robustify ac_configure_args parsing. 2015-03-16 H.J. Lu * Makefile.def: Updated from GCC trunk. * Makefile.tpl: Likewise. * configure.ac: Likewise. * Makefile.in: Regenerated. * configure: Likewise. 2015-01-28 James Bowman * configure.ac: Add FT32 support. * configure: Regenerate. 2015-01-12 Anthony Green * configure.ac: Don't disable gprof for moxie. * configure: Rebuild. @ text @@ 1.1.1.2 log @Import gdb-17.1, previous was 16.3 This version of GDB includes the following changes and enhancements: * x86-64 CET shadow stack support * Debugging Linux programs that use AArch64 Guarded Control Stacks * GDB record feature now supports rv64gc architectures * 'info threads' command support for two new options '-stopped' and '-running' to limit the list of displayed threads. * On Linux and FreeBSD, the addresses shown by the 'info sharedlibrary' command are now for the full memory range allocated to the shared library. * Linux checkpoints now work with multiple inferiors * Improved linker namespace support * Warnings and error messages now start with an emoji (warning sign, or cross mark) if supported by the host charset. Configurable. * Built-in support for TLS on Linux as backup when libthread_db is not available. Supported on the x86_64, aarch64, ppc64, s390x, and riscv architectures, when compiled with GLIBC or MUSL. * New command "set riscv numeric-register-names" to display risc-v registers using their numeric names instead of their ABI names. * The Alpha target now supports target descriptions. Python API enhancements: * New class gdb.Color for dealing with colors, and new constant gdb.PARAM_COLOR * New gdb.ParameterPrefix class, to create new 'set/show' command prefixes. * New attribute gdb.Value.is_unavailable, this checks for unavailability like gdb.Value.is_optimized_out checks for optimized out values. * New gdb.warning() function to print a warning message, with GDB's standard 'warning' prefix (see emoji support entry below) * gdb.execute has an additional 'styling' argument. * Prefix commands (gdb.Command sub-classes) that don't have an invoke method now behave like builtin prefix commands when invoked without a sub-command name. * Setting the documentation string (__doc__) of a gdb.Parameter sub-class to the empty string, means GDB will only display the set_doc or show_doc strings in the set/show help output. Guile API enhancements: * New type for dealing with colors and constant PARAM_COLOR * Prefix commands (using make-command) that don't have a #:invoke property will now behave like builtin prefix commands when invoked without a sub-command name. * Eliding the #:doc string from make-parameter now means that GDB will use a default documentation string. * Setting #:doc to the empty string for make-parameter means GDB will only display the #:set_doc or #:show_doc strings in the set/show help output. Debugger Adapter Protocol changes: * GDB now supports the "completions" request. * New "--binary-output" command line option to disable LF translations (Windows only) New convenience variables: * $_colorsupport providing a comma-separated list of color space names supported by the terminal. * $linker_namespace_count and $_linker_namespace provide the list of active linker namespaces. Remote package additions and changes: * New 'binary-upload+' value in qSupported reply * The 'vFile:stat' command implementation has been corrected to use stat rather than lstat. * New vFile:lstat packet, useful for handling symbolic links * Support for the "id_str" attribute in 'qXfer:threads:read' XML answer. GDB/MI changes: * The =library-unloaded event now includes the 'ranges' field and the 'still-in-use' field. Configure changes: * Ability to select which file formats to include support for * New option --disable-gdb-compile to disable support for the compile subsystem. * New option --disable-gdb-dwarf-support to disable support for DWARF debug information in GDB. * New option --disable-gdb-mdebug-support to disable support for mdebug/ecoff debug information. Incompatible changes: * Support for Python versions older than 3.4 has been removed * Support for stabs debugging format and the a.out/dbx object format is deprecated, and will be removed in GDB 18. * UST (static tracepoint) gdbserver support has been removed @ text @d41 1 a41 1 are used to simplify error checking in the code to improve readability. puff.c @