UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor celias
Visitor
208 Views
Registered: ‎06-06-2018

PetaLinux 2018.3: Zynq target, kgdb related bug

Hi all,

by my observation the standard kernel sources of PetaLinux 2018.3 for a Zynq target (https://github.com/Xilinx/linux-xlnx, branch xlnx_rebase_v4.14) contain a tiny bug in  /arch/arm/include/asm/kgdb.h which prevents that kgdb can be used on Zynq based targets.

In branch 'master' of linux-xlnx this issue is fixed.

The issue has already been described here, including a patch:

https://lore.kernel.org/lkml/20180405200916.27964-1-drivshin@awxrd.com/

If the patch is being put into <petalinux-project-root>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx and added to <petalinux-project-root>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend kgdb should work fine on an arm 32 bit target if the other preconditions for kgdb utilization (related kernel config settings) are met.

For convenience I attach the content of my patch file for this issue (trying to attach it failed with 'The attachment's content type does not match its file extension and has been removed' in several variations):

From 25f8d577a1e48abe988fcdeac91a0b1e5c33eb71 Mon Sep 17 00:00:00 2001
From: cord <embdevac@mail.de>
Date: Tue, 26 Feb 2019 15:50:18 +0100
Subject: [PATCH] kgdb.h-arm-fix

---
arch/arm/include/asm/kgdb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h
index 3b73fdc..8de1100 100644
--- a/arch/arm/include/asm/kgdb.h
+++ b/arch/arm/include/asm/kgdb.h
@@ -77,7 +77,7 @@ static inline void arch_kgdb_breakpoint(void)

#define KGDB_MAX_NO_CPUS 1
#define BUFMAX 400
-#define NUMREGBYTES (DBG_MAX_REG_NUM << 2)
+#define NUMREGBYTES (GDB_MAX_REGS << 2)
#define NUMCRITREGBYTES (32 << 2)

#define _R0 0
--

 

Happy kernel debugging, Cord

 

0 Kudos