Re: Kernel Debugging

From: Amit S. Kale (akale@veritas.com)
Date: Thu Apr 27 2000 - 06:31:00 EST


The patch you are using has gdbttyS and gdbbaud option parsing bug.

It shows init/main.c:
+#ifdef CONFIG_GDB
+ if (!strcmp(line,"gdb")) {
+ gdb_enter ;
+ continue;
+ }
+ if (!strcmp(line,"gdbttyS")) {
+ gdb_ttyS simple_strtoul(line+8,NULL,10);
+ continue;
+ }
+ if (!strcmp(line,"gdbbaud")) {
+ gdb_baud simple_strtoul(line+8,NULL,10);
+ continue;
+ }
+#endif /* CONFIG_GDB */

Which should really be
                if (!strcmp(line,"gdb")) {
                        gdb_enter ;
                        continue;
                }
                if (!strncmp(line,"gdbttyS",7)) {
                        gdb_ttyS simple_strtoul(line+8,NULL,10);
                        continue;
                }
                if (!strncmp(line,"gdbbaud",7)) {
                        gdb_baud simple_strtoul(line+8,NULL,10);
                        continue;
                }

I corrected this before enhancing kgdb for 2.3 kernels.

You can check whether all options were parsed

After booting find the value of gdb_enter by running gdb on kcore
In my case I get following output
gdb vmlinux /proc/kcore
.......
Core was generated by `auto BOOT_IMAGEv-pre ro root€5 gdb gdbttyS gdbbaud5200'.
#0 0x0 in ?? ()
(gdb) p gdb_enter
$1 ^^^^ gdb_enter should be 1 if gdb option was parsed correctly.

My lilo.conf file contains following:

image/boot/vmlinuz-2.3.99-pre1-vxfs
        labelv-pre
        read-only
        root/dev/sda5
        append"gdb gdbttyS gdbbaud5200"

On Thu, 27 Apr 2000, Mani Manoharan Balaraman wrote:
> Hi Amit / All
>
> Yes we enabled the gdb support option while compiling the kernel.
> Actually the kernel which we using is 2.2.12-20. and the kernel patch which
> we used is for 2.2.12 and was downloaded from oss.sgi.com
>
> The url is ftp://oss.sgi.com/www/projects/kgdb/download/
> It'll be really helpful for us to get the problem solved in this regard as
> we are breaking our heads for 3 days.
>
> Thanks and regards
> Mani

-- 
Amit Kale
Veritas Software ( http://www.veritas.com )

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:12 EST