kgdb(1): Fix finding the right kernel for symbols when using -n.
authorSascha Wildner <saw@online.de>
Tue, 21 Dec 2010 16:36:34 +0000 (17:36 +0100)
committerSascha Wildner <saw@online.de>
Tue, 21 Dec 2010 16:37:05 +0000 (17:37 +0100)
Due to a change of kernel names in /var/crash (kernel.xx -> kern.xx)
kgdb(1) wasn't finding the kernel anymore and resorted to the one in
/usr/obj.

gnu/usr.bin/gdb/kgdb/kgdb.c

index 77ad5c5..4c4eb4b 100644 (file)
@@ -103,14 +103,14 @@ kernel_from_dumpnr(int nr)
         * subdirectory kernel.<nr> and called kernel.  The latter allows us
         * to collect the modules in the same place.
         */
-       snprintf(path, sizeof(path), "%s/kernel.%d", crashdir, nr);
+       snprintf(path, sizeof(path), "%s/kern.%d", crashdir, nr);
        if (stat(path, &st) == 0) {
                if (S_ISREG(st.st_mode)) {
                        kernel = strdup(path);
                        return;
                }
                if (S_ISDIR(st.st_mode)) {
-                       snprintf(path, sizeof(path), "%s/kernel.%d/kernel",
+                       snprintf(path, sizeof(path), "%s/kern.%d/kernel",
                            crashdir, nr);
                        if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
                                kernel = strdup(path);