History

kdb: Remove the misfeature 'KDBFLAGS'

Currently, 'KDBFLAGS' is an internal variable of kdb, it is combined by 'KDBDEBUG' and state flags. It will be shown only when 'KDBDEBUG' is set, and the user can define an environment variable named 'KDBFLAGS' too. These are puzzling indeed. After communication with Daniel, it seems that 'KDBFLAGS' is a misfeature. So let's replace 'KDBFLAGS' with 'KDBDEBUG' to just show the value we wrote into. After this modification, we can use `md4c1 kdb_flags` instead, to observe the state flags.

Wei Li committed 6 years ago

Commit c893de11 parent 1b310032 files · +5 −5Browse files

Showing the changes to kernel/debug (1 of 2 files). Show all

Unified · Split

kernel/debug/kdb/kdb_main.c+4−4
@@ -62,7 +62,7 @@ int kdb_grep_trailing; · 61 unmodified lines
62/*62/*
63 * Kernel debugger state flags63 * Kernel debugger state flags
64 */64 */
65int kdb_flags;65unsigned int kdb_flags;
66 66
67/*67/*
68 * kdb_lock protects updates to kdb_initial_cpu. Used to68 * kdb_lock protects updates to kdb_initial_cpu. Used to
@@ -418,8 +418,7 @@ int kdb_set(int argc, const char **argv) · 349 unmodified lines
418 argv[2]);418 argv[2]);
419 return 0;419 return 0;
420 }420 }
421 kdb_flags = (kdb_flags &421 kdb_flags = (kdb_flags & ~KDB_DEBUG(MASK))
422 ~(KDB_DEBUG_FLAG_MASK << KDB_DEBUG_FLAG_SHIFT))
423 | (debugflags << KDB_DEBUG_FLAG_SHIFT);422 | (debugflags << KDB_DEBUG_FLAG_SHIFT);
424 423
425 return 0;424 return 0;
@@ -2082,7 +2081,8 @@ static int kdb_env(int argc, const char **argv) · 1656 unmodified lines
2082 }2081 }
2083 2082
2084 if (KDB_DEBUG(MASK))2083 if (KDB_DEBUG(MASK))
2085 kdb_printf("KDBFLAGS=0x%x\n", kdb_flags);2084 kdb_printf("KDBDEBUG=0x%x\n",
2085 (kdb_flags & KDB_DEBUG(MASK)) >> KDB_DEBUG_FLAG_SHIFT);
2086 2086
2087 return 0;2087 return 0;
2088}2088}