summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-02-18 01:44:25 +0000
committerGreg Clayton <gclayton@apple.com>2011-02-18 01:44:25 +0000
commitbfe5f3bf068eced49491eeecee1d0fa895d996b1 (patch)
treee347830ecb10ad734ea2543b1b26db5bfafe42b0 /lldb/source/Interpreter/CommandInterpreter.cpp
parent951e22e2c9a73f353c2ce4a246616c06cd5bc58a (diff)
downloadbcm5719-llvm-bfe5f3bf068eced49491eeecee1d0fa895d996b1.tar.gz
bcm5719-llvm-bfe5f3bf068eced49491eeecee1d0fa895d996b1.zip
Added new target instance settings for execution settings:
Targets can now specify some additional parameters for when we debug executables that can help with plug-in selection: target.execution-level = auto | user | kernel target.execution-mode = auto | dynamic | static target.execution-os-type = auto | none | halted | live On some systems, the binaries that are created are the same wether you use them to debug a kernel, or a user space program. Many times inspecting an object file can reveal what an executable should be. For these cases we can now be a little more complete by specifying wether to detect all of these things automatically (inspect the main executable file and select a plug-in accordingly), or manually to force the selection of certain plug-ins. To do this we now allow the specficifation of wether one is debugging a user space program (target.execution-level = user) or a kernel program (target.execution-level = kernel). We can also specify if we want to debug a program where shared libraries are dynamically loaded using a DynamicLoader plug-in (target.execution-mode = dynamic), or wether we will treat all symbol files as already linked at the correct address (target.execution-mode = static). We can also specify if the inferior we are debugging is being debugged on a bare board (target.execution-os-type = none), or debugging an OS where we have a JTAG or other direct connection to the inferior stops the entire OS (target.execution-os-type = halted), or if we are debugging a program on something that has live debug services (target.execution-os-type = live). For the "target.execution-os-type = halted" mode, we will need to create ProcessHelper plug-ins that allow us to extract the process/thread and other OS information by reading/writing memory. This should allow LLDB to be used for a wide variety of debugging tasks and handle them all correctly. llvm-svn: 125815
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 2a84eef91f1..b6cd3c73818 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1687,12 +1687,17 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm,
int indent_size = max_word_len + strlen (separator) + 2;
strm.IndentMore (indent_size);
-
- int len = indent_size + strlen (help_text) + 1;
- char *text = (char *) malloc (len);
- sprintf (text, "%-*s %s %s", max_word_len, word_text, separator, help_text);
+
+ StreamString text_strm;
+ text_strm.Printf ("%-*s %s %s", max_word_len, word_text, separator, help_text);
+
+ size_t len = text_strm.GetSize();
+ const char *text = text_strm.GetData();
if (text[len - 1] == '\n')
- text[--len] = '\0';
+ {
+ text_strm.EOL();
+ len = text_strm.GetSize();
+ }
if (len < max_columns)
{
@@ -1750,7 +1755,6 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm,
}
strm.EOL();
strm.IndentLess(indent_size);
- free (text);
}
void
OpenPOWER on IntegriCloud