On 06/29/2011 07:30 PM, Tim Bird wrote: > Hi all, > > I'm new to KDB, but I've been looking at the code and trying > to document a few things. I couldn't find any documentation on a few > kdb features (initialization commands, defcmd, supported environment vars, > etc.) > I wrote some up at: > http://elinux.org/KDB > > If people could take a look and let me know if I got anything wrong, > I would appreciate it
Sure. I'll take a look. > . > > Here's my question. The following environment variables > appear to be unimplemented or unused by KDB: > > BTARGS > BTSYMARG > Hey thanks for pointing this out. Previously before the unified kdb/kgdb was created, kdb used its own disassembler which supported decoding function arguments and printing the variable from registers and then the stack. >From the old kdb manual (pre-merge days) --- The BTARGS environment variable governs the maximum number of arguments that are printed for any single function. On IA64 hardware, there is no difference between input and local registers, the first BTARGS registers are printed, up to the total limit of input plus local registers. Use a large value for BTARGS if you want to see the local registers on IA64. --- Another clip from the old manual --- If the BTSYMARG environment variable is non-zero then any arguments that fall within the kernel or modules are converted to symbols. --- So it was never intended that either of these variables get brought forward. I'll include a patch to wipe them out in the next merge window. Jason. Note white space is mangled for now and fixed later in a real patch at merge window time diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c index 2f62fe8..7179eac 100644 --- a/kernel/debug/kdb/kdb_bt.c +++ b/kernel/debug/kdb/kdb_bt.c @@ -112,9 +112,8 @@ kdb_bt(int argc, const char **argv) unsigned long addr; long offset; - kdbgetintenv("BTARGS", &argcount); /* Arguments to print */ - kdbgetintenv("BTAPROMPT", &btaprompt); /* Prompt after each - * proc in bta */ + /* Prompt after each proc in bta */ + kdbgetintenv("BTAPROMPT", &btaprompt); if (strcmp(argv[0], "bta") == 0) { struct task_struct *g, *p; diff --git a/kernel/debug/kdb/kdb_cmds b/kernel/debug/kdb/kdb_cmds index 56c88e4..9834ad3 100644 --- a/kernel/debug/kdb/kdb_cmds +++ b/kernel/debug/kdb/kdb_cmds @@ -18,16 +18,12 @@ defcmd dumpcommon "" "Common kdb debugging" endefcmd defcmd dumpall "" "First line debugging" - set BTSYMARG 1 - set BTARGS 9 pid R -dumpcommon -bta endefcmd defcmd dumpcpu "" "Same as dumpall but only tasks on cpus" - set BTSYMARG 1 - set BTARGS 9 pid R -dumpcommon -btc diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index be14779..b33116e 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -145,7 +145,6 @@ static char *__env[] = { #endif "RADIX=16", "MDCOUNT=8", /* lines of md output */ - "BTARGS=9", /* 9 possible args in bt */ KDB_PLATFORM_ENV, "DTABCOUNT=30", "NOSECT=1", @@ -172,6 +171,7 @@ static char *__env[] = { (char *)0, (char *)0, (char *)0, + (char *)0, }; ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Kgdb-bugreport mailing list Kgdb-bugreport@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport