Common subdirectories: crash-4.0-2.12/extensions and crash-4.0-2.12-new/extensions Common subdirectories: crash-4.0-2.12/gdb-6.1 and crash-4.0-2.12-new/gdb-6.1 diff -Nau -X ignorepat crash-4.0-2.12/help.c crash-4.0-2.12-new/help.c --- crash-4.0-2.12/help.c 2005-11-15 12:53:06 -08:00 +++ crash-4.0-2.12-new/help.c 2005-11-17 16:13:58 -08:00 @@ -1155,7 +1155,7 @@ "bt", "backtrace", #if defined(GDB_6_0) || defined(GDB_6_1) -"[-a|-r|-t|-T|-l|-e|-E|-f|-o|-O] [-R ref] [ -I ip ] [-S sp] [pid | taskp]", +"[-a|-r|-t|-T|-l|-e|-E|-f|-o|-O [0|1]] [-R ref] [ -I ip ] [-S sp] [pid | taskp]", #else "[-a|-r|-t|-l|-e|-f|-g] [-R ref] [ -I ip ] [-S sp] [pid | taskp]", #endif @@ -1180,9 +1180,9 @@ " on IA64, the argument register contents are dumped.", " -o use old backtrace method, permissable only on kernels that were", " compiled without the -fomit-frame_pointer (x86 only).", -" -O use old backtrace method by default, permissable only on kernels", -" that were compiled without the -fomit-frame_pointer; subsequent", -" usage of this option toggles the backtrace method (x86 only).", +" -O [0|1] select use of old backtrace method, permissable only on kernels", +" that were compiled without the -fomit-frame_pointer; without arguments", +" toggles the option, (default off) (x86 only)", #if !defined(GDB_6_0) && !defined(GDB_6_1) " -g use gdb stack trace code. (alpha only)", #endif diff -Nau -X ignorepat crash-4.0-2.12/kernel.c crash-4.0-2.12-new/kernel.c --- crash-4.0-2.12/kernel.c 2005-11-15 12:53:06 -08:00 +++ crash-4.0-2.12-new/kernel.c 2005-11-17 16:13:54 -08:00 @@ -1133,6 +1133,7 @@ struct bt_info bt_info, bt_setup, *bt; struct reference reference; char *refptr; + int toggle_old_bt = 0; tc = NULL; subsequent = active = count = 0; @@ -1158,13 +1159,28 @@ case 'O': if (!(machine_type("X86"))) { option_not_supported(c); - } else if (kt->flags & USE_OLD_BT) { - kt->flags &= ~USE_OLD_BT; - error(INFO, "use new bt method by default\n"); } else { - kt->flags |= USE_OLD_BT; - error(INFO, "use old bt method by default\n"); - } + if (argcnt > optind) { + switch(args[optind][0]) { + case '0': + kt->flags &= ~USE_OLD_BT; + error(INFO, "use new bt method by default\n"); + break; + case '1': + kt->flags |= USE_OLD_BT; + error(INFO, "use old bt method by default\n"); + break; + default: + option_not_supported(args[optind][0]); + } + } else if (kt->flags & USE_OLD_BT) { + kt->flags &= ~USE_OLD_BT; + error(INFO, "use new bt method by default\n"); + } else { + kt->flags |= USE_OLD_BT; + error(INFO, "use old bt method by default\n"); + } + } return; case 'R':