summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-10-04 01:05:56 +0000
committerGreg Clayton <gclayton@apple.com>2010-10-04 01:05:56 +0000
commit0603aa9dc8434e15ef4d49e6e3dbcb2666aae6b6 (patch)
treee0d1095dd78d5224a856ab01bbab0ca341949029 /lldb/source/Commands
parent120804afae5bdad47e058b9a9f09e04ef7b9ac78 (diff)
downloadbcm5719-llvm-0603aa9dc8434e15ef4d49e6e3dbcb2666aae6b6.tar.gz
bcm5719-llvm-0603aa9dc8434e15ef4d49e6e3dbcb2666aae6b6.zip
There are now to new "settings set" variables that live in each debugger
instance: settings set frame-format <string> settings set thread-format <string> This allows users to control the information that is seen when dumping threads and frames. The default values are set such that they do what they used to do prior to changing over the the user defined formats. This allows users with terminals that can display color to make different items different colors using the escape control codes. A few alias examples that will colorize your thread and frame prompts are: settings set frame-format 'frame #${frame.index}: \033[0;33m${frame.pc}\033[0m{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{ \033[0;35mat \033[1;35m${line.file.basename}:${line.number}}\033[0m\n' settings set thread-format 'thread #${thread.index}: \033[1;33mtid\033[0;33m = ${thread.id}\033[0m{, \033[0;33m${frame.pc}\033[0m}{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{, \033[1;35mstop reason\033[0;35m = ${thread.stop-reason}\033[0m}{, \033[1;36mname = \033[0;36m${thread.name}\033[0m}{, \033[1;32mqueue = \033[0;32m${thread.queue}}\033[0m\n' A quick web search for "colorize terminal output" should allow you to see what you can do to make your output look like you want it. The "settings set" commands above can of course be added to your ~/.lldbinit file for permanent use. Changed the pure virtual void ExecutionContextScope::Calculate (ExecutionContext&); To: void ExecutionContextScope::CalculateExecutionContext (ExecutionContext&); I did this because this is a class that anything in the execution context heirarchy inherits from and "target->Calculate (exe_ctx)" didn't always tell you what it was really trying to do unless you look at the parameter. llvm-svn: 115485
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp10
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp18
3 files changed, 7 insertions, 23 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 913577b087b..f21938f5fe2 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -70,14 +70,10 @@ public:
// char '#'
while (pos != commands.end())
{
- bool remove_string = false;
size_t non_space = pos->find_first_not_of (k_space_characters);
- if (non_space == std::string::npos)
- remove_string = true; // Empty line
- else if ((*pos)[non_space] == '#')
- remove_string = true; // Comment line that starts with '#'
-
- if (remove_string)
+ // Check for empty line or comment line (lines whose first
+ // non-space character is a '#')
+ if (non_space == std::string::npos || (*pos)[non_space] == '#')
pos = commands.erase(pos);
else
++pos;
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 0ff7e673cf9..7f4f66efabe 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -71,7 +71,7 @@ public:
ExecutionContext exe_ctx(m_interpreter.GetDebugger().GetExecutionContext());
if (exe_ctx.frame)
{
- exe_ctx.frame->Dump (&result.GetOutputStream(), true, false);
+ exe_ctx.frame->DumpUsingSettingsFormat (&result.GetOutputStream());
result.GetOutputStream().EOL();
result.SetStatus (eReturnStatusSuccessFinishResult);
}
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 9d42b47ca13..f1b528d5856 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -80,13 +80,7 @@ lldb_private::DisplayThreadInfo
}
else
{
- thread->DumpInfo (strm,
- true, // Dump the stop reason?
- true, // Dump the thread name?
- true, // Dump the queue name?
- 0); // Display context info for stack frame zero
-
- strm.EOL();
+ thread->DumpUsingSettingsFormat (strm, 0);
}
return true;
@@ -164,12 +158,7 @@ lldb_private::DisplayFramesForExecutionContext
if (num_frames == 0)
return 0;
- thread->DumpInfo (strm,
- true, // Dump the stop reason?
- true, // Dump the thread name?
- true, // Dump the queue name?
- num_frames > 1 ? UINT32_MAX : first_frame); // Dump info for the first stack frame if we are showing only on frame
- strm.EOL();
+ thread->DumpUsingSettingsFormat (strm, num_frames > 1 ? UINT32_MAX : first_frame);
strm.IndentMore();
StackFrameSP frame_sp;
@@ -224,8 +213,7 @@ lldb_private::DisplayFrameForExecutionContext
if (show_frame_info)
{
strm.Indent();
- frame->Dump (&strm, true, false);
- strm.EOL();
+ frame->DumpUsingSettingsFormat (&strm);
}
SymbolContext sc (frame->GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry));
OpenPOWER on IntegriCloud