gdb: 11.2 -> 12.1
Added trivial updater script. Refreshed nix-specific patch with path to debug symbols. Dropped upstreamed patches for gcc-12 support and musl support. Changes: https://www.sourceware.org/gdb/download/ANNOUNCEMENT
This commit is contained in:
@@ -1,24 +1,17 @@
|
||||
diff -ur a/gdb/main.c b/gdb/main.c
|
||||
--- a/gdb/main.c 2020-02-08 13:50:14.000000000 +0100
|
||||
+++ b/gdb/main.c 2020-02-24 10:02:07.731806739 +0100
|
||||
@@ -567,9 +567,17 @@
|
||||
gdb_sysroot = xstrdup (TARGET_SYSROOT_PREFIX);
|
||||
}
|
||||
--- a/gdb/main.c
|
||||
+++ b/gdb/main.c
|
||||
@@ -708,8 +708,12 @@ captured_main_1 (struct captured_main_args *context)
|
||||
if (gdb_sysroot.empty ())
|
||||
gdb_sysroot = TARGET_SYSROOT_PREFIX;
|
||||
|
||||
- debug_file_directory
|
||||
- = xstrdup (relocate_gdb_directory (DEBUGDIR,
|
||||
- DEBUGDIR_RELOCATABLE).c_str ());
|
||||
+ debug_file_directory = getenv ("NIX_DEBUG_INFO_DIRS");
|
||||
+ if (debug_file_directory != NULL)
|
||||
+ // This might be updated later using
|
||||
+ // $ set debug-file-directory /to/some/path
|
||||
+ // which will use xfree. We must then have a xmallocated
|
||||
+ // copy of the string that can be xfeed later.
|
||||
+ debug_file_directory = xstrdup (debug_file_directory);
|
||||
- = relocate_gdb_directory (DEBUGDIR, DEBUGDIR_RELOCATABLE);
|
||||
+ const char * nix_debug = getenv ("NIX_DEBUG_INFO_DIRS");
|
||||
+ if (nix_debug != NULL)
|
||||
+ debug_file_directory = nix_debug;
|
||||
+ else
|
||||
+ debug_file_directory
|
||||
+ = xstrdup (relocate_gdb_directory (DEBUGDIR,
|
||||
+ DEBUGDIR_RELOCATABLE).c_str ());
|
||||
+ = relocate_gdb_directory (DEBUGDIR, DEBUGDIR_RELOCATABLE);
|
||||
|
||||
gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
|
||||
GDB_DATADIR_RELOCATABLE);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, stdenv, targetPackages
|
||||
|
||||
# Build time
|
||||
, fetchurl, fetchpatch, pkg-config, perl, texinfo, setupDebugInfoDirs, buildPackages
|
||||
, fetchurl, pkg-config, perl, texinfo, setupDebugInfoDirs, buildPackages
|
||||
|
||||
# Run time
|
||||
, ncurses, readline, gmp, mpfr, expat, libipt, zlib, dejagnu, sourceHighlight
|
||||
@@ -15,6 +15,7 @@
|
||||
# targetPackages so we get the right libc when cross-compiling and using buildPackages.gdb
|
||||
targetPackages.stdenv.cc.cc.lib
|
||||
]
|
||||
, writeScript
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -27,11 +28,11 @@ assert pythonSupport -> python3 != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = targetPrefix + basename;
|
||||
version = "11.2";
|
||||
version = "12.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/gdb/${basename}-${version}.tar.xz";
|
||||
hash = "sha256-FJfDanGIG4ZxqahKDuQPqreIyjDXuhnYRjw8x4cVLjI=";
|
||||
hash = "sha256-DheTv48rVNU/Rt6oTM/URvSPgbKXsoxPf8AXuBjWn+0=";
|
||||
};
|
||||
|
||||
postPatch = if stdenv.isDarwin then ''
|
||||
@@ -43,20 +44,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
patches = [
|
||||
./debug-info-from-env.patch
|
||||
|
||||
# Pull upstream fix for gcc-12. Will be included in gdb-12.
|
||||
(fetchpatch {
|
||||
name = "gcc-12.patch";
|
||||
url = "https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=e97436b1b789dcdb6ffb502263f4c86f8bc22996";
|
||||
sha256 = "1mpgw6s9qgnwhwyg3hagc6vhqhvia0l1s8nr22bcahwqxi3wvzcw";
|
||||
})
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
./darwin-target-match.patch
|
||||
] ++ lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
|
||||
name = "musl-fix-pagesize-page_size.patch";
|
||||
url = "https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=fd0975b96b16d96010dce439af9620d3dfb65426";
|
||||
hash = "sha256-M3U7uIIFJnYu0g8/sMLJPhm02q7cGOi6pLjgsUUjeKI=";
|
||||
});
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pkg-config texinfo perl setupDebugInfoDirs ];
|
||||
|
||||
@@ -115,6 +105,20 @@ stdenv.mkDerivation rec {
|
||||
# TODO: Investigate & fix the test failures.
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
updateScript = writeScript "update-gdb" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl pcre common-updater-scripts
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
# Expect the text in format of '<h3>GDB version 12.1</h3>'
|
||||
new_version="$(curl -s https://www.sourceware.org/gdb/ |
|
||||
pcregrep -o1 '<h3>GDB version ([0-9.]+)</h3>')"
|
||||
update-source-version ${pname} "$new_version"
|
||||
'';
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "The GNU Project debugger";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user