NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/53893: Can't build amd64 or i386 kernel with (defined KGDB && !defined DDB)



>Number:         53893
>Category:       kern
>Synopsis:       Can't build amd64 or i386 kernel with (defined KGDB && !defined DDB)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 19 07:55:00 +0000 2019
>Originator:     yarl
>Release:        CURRENT 20190119
>Organization:
none
>Environment:
Irrelevant
>Description:
GENERIC kernel with DDB disabled and KGDB enabled cannot be build. Here's the tail of build.sh's output:
/home/builder/git/netbsd-current/obj-amd64-debug/tooldir.NetBSD-8.0_STABLE-amd64/bin/x86_64--ne
tbsd-ld: db_memrw.o: in function `db_read_bytes':                                              
/mnt/stripped/builder/git/netbsd-current/src/sys/arch/x86/x86/db_memrw.c:114: undefined referen
ce to `db_printf'                                                                              
/home/builder/git/netbsd-current/obj-amd64-debug/tooldir.NetBSD-8.0_STABLE-amd64/bin/x86_64--n$tbsd-ld: db_memrw.o: in function `db_write_text':
/mnt/stripped/builder/git/netbsd-current/src/sys/arch/x86/x86/db_memrw.c:147: undefined refere$ce to `db_printf'
*** [netbsd] Error code 1
>How-To-Repeat:
Disable DDB and enable KGDB in either amd64 or i386 generic and try to build the kernel.
>Fix:
diff --git a/sys/arch/x86/x86/db_memrw.c b/sys/arch/x86/x86/db_memrw.c
index 22c5d32436bb..df3283bfede1 100644
--- a/sys/arch/x86/x86/db_memrw.c
+++ b/sys/arch/x86/x86/db_memrw.c
@@ -90,7 +90,9 @@ db_read_bytes(vaddr_t addr, size_t size, char *data)
 	src = (char *)addr;
 
 	if (db_validate_address((vaddr_t)src)) {
+#ifdef DDB
 		db_printf("address %p is invalid\n", src);
+#endif
 		return;
 	}
 
@@ -111,7 +113,9 @@ db_read_bytes(vaddr_t addr, size_t size, char *data)
 
 	while (size-- > 0) {
 		if (db_validate_address((vaddr_t)src)) {
+#ifdef DDB
 			db_printf("address %p is invalid\n", src);
+#endif
 			return;
 		}
 
@@ -144,7 +148,9 @@ db_write_text(vaddr_t addr, size_t size, const char *data)
 		pte = *ppte;
 
 		if ((pte & PG_V) == 0) {
+#ifdef DDB
 			db_printf(" address %p not a valid page\n", dst);
+#endif
 			return;
 		}
 



Home | Main Index | Thread Index | Old Index