Florian Delizy wrote:
Hi,

I am trying to make kgdb work on x86_64 with the 2.6.17 kernel version.
I took the last cvs version as it seemed in the cvs tree comments that
patches had been moved to 2.6.17, but when I try to start a kernel with
kgdbwait I get the following message :

Kernel command line: root=/dev/sda1 ro mouse=imps2 vga=791 console=tty0
gdbttys=0 console=ttyS1 kgdbwait
KGDB cannot initialize I/O yet.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
time.c: Using 3.579545 MHz WALL PM GTOD PIT/TSC timer.
time.c: Detected 1995.046 MHz processor.
Console: colour dummy device 80x25
Waiting for connection from remote gdb...
int3: 0000 [1]
CPU 0
Modules linked in:
Pid: 0, comm: swapper Not tainted 2.6.17 #4
RIP: 0010:[<ffffffff80248d38>] <ffffffff80248d38>{breakpoint+167}
RSP: 0018:ffffffff8063eee8  EFLAGS: 00000292
RAX: 000000000000002d RBX: 0000000000000000 RCX: 0000000000000d35
RDX: 0000000000000d35 RSI: 0000000000000d35 RDI: ffffffff8058b3d0
RBP: ffffffff8063eee8 R08: 0000000000000002 R09: ffff81000c008000
R10: ffffffff8063eca8 R11: 00000000000000a8 R12: ffffffff806630f0
R13: 000000000000000a R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffffffff806b8000(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 0000000000201000 CR4: 00000000000006a0
Process swapper (pid: 0, threadinfo ffffffff806be000, task ffffffff80583360) Stack: ffffffff8063eef8 ffffffff80248d70 ffffffff8063ef18 ffffffff8022ce7d


(complete output is attached -- eikichi.log --, as well as .config)

At this point I did not even try to connect with kgdb, I just had a
console listening on ttyS1 (from where I get this listing). It's already
been some time I try to make it work ...

Can anyone point at me what I did wrong or give me a start point ?


OK, after spending a whole nite on the problem I finally found the bug.
It is a gcc 4.1 bug !! (problem with weak symbols) and it was already
reported on the list, but I only understood after tracking it down....

Anyway, here is a workaround patch, but only use it with gcc < 4.1.2
(September 01 pre release). I just upgraded my gcc from the debian
testing distribution, and it works fine for me now :)

Happy hacking !

Florian

Index: linux/kernel/kgdb.c
===================================================================
--- linux.orig/kernel/kgdb.c	2006-09-08 02:51:43.000000000 +0200
+++ linux/kernel/kgdb.c	2006-09-08 02:55:21.000000000 +0200
@@ -142,7 +142,9 @@
  */
 int __attribute__ ((weak))
     kgdb_arch_init(void)
-{
+{	
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 	return 0;
 }
 
@@ -157,6 +159,8 @@
 void __attribute__ ((weak))
     kgdb_disable_hw_debug(struct pt_regs *regs)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 }
 
 /*
@@ -167,6 +171,8 @@
 int __attribute__ ((weak))
 	kgdb_skipexception(int exception, struct pt_regs *regs)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 	return 0;
 }
 
@@ -177,6 +183,8 @@
 int __attribute__ ((weak))
     kgdb_set_hw_break(unsigned long addr)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 	return 0;
 }
 
@@ -187,6 +195,8 @@
 int __attribute__ ((weak))
     kgdb_remove_hw_break(unsigned long addr)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 	return 0;
 }
 
@@ -196,6 +206,8 @@
 void __attribute__ ((weak))
     kgdb_remove_all_hw_break(void)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 }
 
 /**
@@ -215,6 +227,8 @@
 void __attribute__ ((weak))
     kgdb_correct_hw_break(void)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 }
 
 /**
@@ -231,6 +245,8 @@
 void __attribute__ ((weak))
     kgdb_post_master_code(struct pt_regs *regs, int e_vector, int err_code)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 }
 
 /**
@@ -250,6 +266,8 @@
 void __attribute__ ((weak))
     kgdb_roundup_cpus(unsigned long flags)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 }
 
 /**
@@ -261,6 +279,8 @@
 void __attribute__ ((weak))
     kgdb_shadowinfo(struct pt_regs *regs, char *buffer, unsigned threadid)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 }
 
 /**
@@ -275,6 +295,8 @@
 struct task_struct __attribute__ ((weak))
     * kgdb_get_shadow_thread(struct pt_regs *regs, int threadid)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 	return NULL;
 }
 
@@ -289,6 +311,8 @@
 struct pt_regs __attribute__ ((weak))
     * kgdb_shadow_regs(struct pt_regs *regs, int threadid)
 {
+	printk( KERN_INFO "KGDB %s:%d default %s called ... doing nothing\n"
+	      , __FILE__, __LINE__, __FUNCTION__);
 	return NULL;
 }
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to