From 5fa74667c5bdb8262d3b13cb4e07c71a95cc0db0 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 21 Jan 2008 17:59:19 +0000 Subject: [PATCH] Changed semantics of "traced" invocation without arguments. Instead of printing the last 30 entries, it continues the last iteration, thus making the more common use case more comfortable. The old functionality is still available via "traced 0". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23689 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/tracing.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/debug/tracing.cpp b/src/system/kernel/debug/tracing.cpp index 7f43e761f8..6fde0c27f2 100644 --- a/src/system/kernel/debug/tracing.cpp +++ b/src/system/kernel/debug/tracing.cpp @@ -700,6 +700,7 @@ dump_tracing(int argc, char** argv) static int32 _previousMaxToCheck = 0; static int32 _previousFirstChecked = 1; static int32 _previousLastChecked = -1; + static int32 _previousDirection = 1; static uint32 _previousWritten = 0; static uint32 _previousEntries = 0; static TraceEntryIterator iterator; @@ -729,7 +730,8 @@ dump_tracing(int argc, char** argv) cont = -1; argi++; } - } + } else + cont = _previousDirection; if (cont != 0) { if (argi < argc) { @@ -915,6 +917,7 @@ dump_tracing(int argc, char** argv) _previousHasFilter = hasFilter; _previousFirstChecked = firstToCheck; _previousLastChecked = lastToCheck; + _previousDirection = direction; _previousWritten = sWritten; _previousEntries = sEntries; @@ -1017,6 +1020,8 @@ tracing_init(void) "off, i.e. printing the previous respectively next entries (as many\n" "as printed before). In this case the command is continuable, that is\n" "afterwards entering an empty line in the debugger will reinvoke it.\n" + "If no arguments are given, the command continues in the direction\n" + "of the last invocation.\n" "\"printteam\" enables printing the items' team ID.\n" " - The base index of the entries to print. Depending on\n" " whether the iteration direction is forward or\n"