diff -Nru gdb-7.12/debian/changelog gdb-7.12/debian/changelog --- gdb-7.12/debian/changelog 2016-11-16 10:58:53.000000000 -0800 +++ gdb-7.12/debian/changelog 2016-11-29 15:31:03.000000000 -0800 @@ -1,3 +1,9 @@ +gdb (7.12-0ubuntu3) zesty; urgency=medium + + * Add debian/patches/armhf-fpregset.patch. LP: #1645501. + + -- Kees Cook Tue, 29 Nov 2016 15:30:20 -0800 + gdb (7.12-0ubuntu2) zesty; urgency=medium * Add Power ISA 3.0/POWER9 instructions record support. LP: #1642304. diff -Nru gdb-7.12/debian/patches/armhf-fpregset.patch gdb-7.12/debian/patches/armhf-fpregset.patch --- gdb-7.12/debian/patches/armhf-fpregset.patch 1969-12-31 16:00:00.000000000 -0800 +++ gdb-7.12/debian/patches/armhf-fpregset.patch 2016-11-30 11:03:19.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.12/debian/patches/series gdb-7.12/debian/patches/series --- gdb-7.12/debian/patches/series 2016-11-16 10:58:53.000000000 -0800 +++ gdb-7.12/debian/patches/series 2016-11-29 15:24:29.000000000 -0800 @@ -13,3 +13,4 @@ fix-backtrace.diff isa3.0-power9-01.diff isa3.0-power9-02.diff +armhf-fpregset.patch