diff -Nru gdb-7.11.90.20161005/debian/changelog gdb-7.11.90.20161005/debian/changelog --- gdb-7.11.90.20161005/debian/changelog 2016-10-05 14:55:15.000000000 -0700 +++ gdb-7.11.90.20161005/debian/changelog 2016-11-30 11:11:16.000000000 -0800 @@ -1,3 +1,9 @@ +gdb (7.11.90.20161005-0ubuntu1.1) yakkety-proposed; urgency=medium + + * Add debian/patches/armhf-fpregset.patch. LP: #1645501. + + -- Kees Cook Wed, 30 Nov 2016 11:10:40 -0800 + gdb (7.11.90.20161005-0ubuntu1) yakkety; urgency=medium * Snapshot, taken from the gdb-7.12 branch. diff -Nru gdb-7.11.90.20161005/debian/patches/armhf-fpregset.patch gdb-7.11.90.20161005/debian/patches/armhf-fpregset.patch --- gdb-7.11.90.20161005/debian/patches/armhf-fpregset.patch 1969-12-31 16:00:00.000000000 -0800 +++ gdb-7.11.90.20161005/debian/patches/armhf-fpregset.patch 2016-11-30 11:10:15.000000000 -0800 @@ -0,0 +1,55 @@ +Description: if an inferior has VFP registers, it is not using soft FP + registers. On armhf, there is never soft FP, and when running under an + arm64 host, there is no support in the kernel to fetch soft FP registers + since they do not exist. Without this fix, "generate-core-file" will fail. +Author: Kees Cook + +Index: gdb-7.12/gdb/arm-linux-nat.c +=================================================================== +--- gdb-7.12.orig/gdb/arm-linux-nat.c 2016-11-30 11:02:51.689688769 -0800 ++++ gdb-7.12/gdb/arm-linux-nat.c 2016-11-30 11:03:17.438108023 -0800 +@@ -384,17 +384,19 @@ + if (-1 == regno) + { + fetch_regs (regcache); +- fetch_fpregs (regcache); + if (tdep->have_wmmx_registers) + fetch_wmmx_regs (regcache); + if (tdep->vfp_register_count > 0) + fetch_vfp_regs (regcache); ++ else ++ fetch_fpregs (regcache); + } +- else ++ else + { + if (regno < ARM_F0_REGNUM || regno == ARM_PS_REGNUM) + fetch_regs (regcache); +- else if (regno >= ARM_F0_REGNUM && regno <= ARM_FPS_REGNUM) ++ else if (tdep->vfp_register_count == 0 ++ && regno >= ARM_F0_REGNUM && regno <= ARM_FPS_REGNUM) + fetch_fpregs (regcache); + else if (tdep->have_wmmx_registers + && regno >= ARM_WR0_REGNUM && regno <= ARM_WCGR7_REGNUM) +@@ -420,17 +422,19 @@ + if (-1 == regno) + { + store_regs (regcache); +- store_fpregs (regcache); + if (tdep->have_wmmx_registers) + store_wmmx_regs (regcache); + if (tdep->vfp_register_count > 0) + store_vfp_regs (regcache); ++ else ++ store_fpregs (regcache); + } + else + { + if (regno < ARM_F0_REGNUM || regno == ARM_PS_REGNUM) + store_regs (regcache); +- else if ((regno >= ARM_F0_REGNUM) && (regno <= ARM_FPS_REGNUM)) ++ else if (tdep->vfp_register_count == 0 ++ && (regno >= ARM_F0_REGNUM) && (regno <= ARM_FPS_REGNUM)) + store_fpregs (regcache); + else if (tdep->have_wmmx_registers + && regno >= ARM_WR0_REGNUM && regno <= ARM_WCGR7_REGNUM) diff -Nru gdb-7.11.90.20161005/debian/patches/series gdb-7.11.90.20161005/debian/patches/series --- gdb-7.11.90.20161005/debian/patches/series 2016-02-20 09:33:34.000000000 -0800 +++ gdb-7.11.90.20161005/debian/patches/series 2016-11-30 11:10:31.000000000 -0800 @@ -11,3 +11,4 @@ ptrace-error-verbosity.patch #elf-auxv-diff fix-backtrace.diff +armhf-fpregset.patch