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
6262 /*
6363 * Kernel debugger state flags
6464 */
65−int kdb_flags;
65+unsigned int kdb_flags;
6666
6767 /*
6868 * 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
418418 argv[2]);
419419 return 0;
420420 }
421− kdb_flags = (kdb_flags &
422− ~(KDB_DEBUG_FLAG_MASK << KDB_DEBUG_FLAG_SHIFT))
421+ kdb_flags = (kdb_flags & ~KDB_DEBUG(MASK))
423422 | (debugflags << KDB_DEBUG_FLAG_SHIFT);
424423
425424 return 0;
@@ -2082,7 +2081,8 @@ static int kdb_env(int argc, const char **argv) · 1656 unmodified lines
20822081 }
20832082
20842083 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);
20862086
20872087 return 0;
20882088 }