Subject: compiling kernel for amd64 w/ ddb defined failed
To: None <current-users@netbsd.org>
From: Kurt Schreiner <ks@ub.uni-mainz.de>
List: current-users
Date: 06/26/2006 15:32:20
Hi,

trying to compile a kernel for amd64 where ddb is defined fails:

    compile  SUNOPTI_ACPI/db_run.o
/u/NetBSD/src/sys/ddb/db_run.c: In function 'db_stop_at_pc':
/u/NetBSD/src/sys/ddb/db_run.c:127: error: invalid lvalue in assignment

*** Failed target:  db_run.o

The problem:

    124 #ifdef PC_ADVANCE
    125                 PC_ADVANCE(regs);
    126 #else
    127                 PC_REGS(regs) += BKPT_SIZE;
    128 #endif


And a possible solution: (put perhaps not The Right Thing ;-)

>-510: diff -u /u/NetBSD/{,l}src/sys/arch/amd64/include/db_machdep.h
--- /u/NetBSD/src/sys/arch/amd64/include/db_machdep.h   2006-04-01 17:54:31.000000000 +0200
+++ /u/NetBSD/lsrc/sys/arch/amd64/include/db_machdep.h  2006-06-07 13:23:17.000000000 +0200
@@ -55,6 +55,7 @@
 #define        PC_REGS(regs)   ((regs)->tf_rip)
 #else
 #define        PC_REGS(regs)   ((db_addr_t)(regs)->tf_rip)
+#define PC_ADVANCE(r)  ((r)->tf_rip += BKPT_SIZE)
 #endif
 
 #define        BKPT_ADDR(addr) (addr)          /* breakpoint address */


At least the kernel compiles fine and I can break into ddb from
serial console...

Kurt