diff options
author | Greg Clayton <gclayton@apple.com> | 2011-02-18 01:44:25 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-02-18 01:44:25 +0000 |
commit | bfe5f3bf068eced49491eeecee1d0fa895d996b1 (patch) | |
tree | e347830ecb10ad734ea2543b1b26db5bfafe42b0 /lldb/source/Target/Process.cpp | |
parent | 951e22e2c9a73f353c2ce4a246616c06cd5bc58a (diff) | |
download | bcm5719-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/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 8968c755bc4..7a0de0b03ef 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2644,10 +2644,39 @@ Process::PopProcessInputReader () m_target.GetDebugger().PopInputReader (m_process_input_reader); } - +// The process needs to know about installed plug-ins void -Process::Initialize () +Process::DidInitialize () { + static std::vector<lldb::OptionEnumValueElement> g_plugins; + + int i=0; + const char *name; + OptionEnumValueElement option_enum; + while ((name = PluginManager::GetProcessPluginNameAtIndex (i)) != NULL) + { + if (name) + { + option_enum.value = i; + option_enum.string_value = name; + option_enum.usage = PluginManager::GetProcessPluginDescriptionAtIndex (i); + g_plugins.push_back (option_enum); + } + ++i; + } + option_enum.value = 0; + option_enum.string_value = NULL; + option_enum.usage = NULL; + g_plugins.push_back (option_enum); + + for (i=0; (name = SettingsController::instance_settings_table[i].var_name); ++i) + { + if (::strcmp (name, "plugin") == 0) + { + SettingsController::instance_settings_table[i].enum_values = &g_plugins[0]; + break; + } + } UserSettingsControllerSP &usc = GetSettingsController(); usc.reset (new SettingsController); UserSettingsController::InitializeSettingsController (usc, @@ -2656,6 +2685,11 @@ Process::Initialize () } void +Process::Initialize () +{ +} + +void Process::Terminate () { UserSettingsControllerSP &usc = GetSettingsController(); @@ -3550,14 +3584,6 @@ Process::SettingsController::global_settings_table[] = }; -lldb::OptionEnumValueElement -Process::SettingsController::g_plugins[] = -{ - { eMacosx, "process.macosx", "Use the native MacOSX debugger plugin" }, - { eRemoteDebugger, "process.gdb-remote" , "Use the GDB Remote protocol based debugger plugin" }, - { 0, NULL, NULL } -}; - SettingEntry Process::SettingsController::instance_settings_table[] = { @@ -3568,7 +3594,7 @@ Process::SettingsController::instance_settings_table[] = { "input-path", eSetVarTypeString, NULL, NULL, false, false, "The file/path to be used by the executable program for reading its input." }, { "output-path", eSetVarTypeString, NULL, NULL, false, false, "The file/path to be used by the executable program for writing its output." }, { "error-path", eSetVarTypeString, NULL, NULL, false, false, "The file/path to be used by the executable program for writings its error messages." }, - { "plugin", eSetVarTypeEnum, NULL, g_plugins, false, false, "The plugin to be used to run the process." }, + { "plugin", eSetVarTypeEnum, NULL, NULL, false, false, "The plugin to be used to run the process." }, { "disable-aslr", eSetVarTypeBoolean, "true", NULL, false, false, "Disable Address Space Layout Randomization (ASLR)" }, { "disable-stdio", eSetVarTypeBoolean, "false", NULL, false, false, "Disable stdin/stdout for process (e.g. for a GUI application)" }, { NULL, eSetVarTypeNone, NULL, NULL, false, false, NULL } |