[Lldb-commits] [lldb] r129695 - in /lldb/trunk: include/lldb/Interpreter/ include/lldb/Target/ lldb.xcodeproj/ source/Commands/ source/Core/ source/Interpreter/ source/Plugins/Disassembler/llvm/ source/Plugins/Platform/MacOSX/ source/Symbol/ source/Target/ test/abbreviation_tests/ test/array_types/ test/bitfields/ test/breakpoint_command/ test/class_static/ test/class_types/ test/conditional_break/ test/dead-strip/ test/enum_types/ test/forward/ test/function_types/ test/global_variables/ test/inferior-crashing/ test/i...

Greg Clayton gclayton at apple.com
Mon Apr 18 01:33:37 PDT 2011


Author: gclayton
Date: Mon Apr 18 03:33:37 2011
New Revision: 129695

URL: http://llvm.org/viewvc/llvm-project?rev=129695&view=rev
Log:
Centralized a lot of the status information for processes,
threads, and stack frame down in the lldb_private::Process,
lldb_private::Thread, lldb_private::StackFrameList and the 
lldb_private::StackFrame classes. We had some command line
commands that had duplicate versions of the process status
output ("thread list" and "process status" for example). 

Removed the "file" command and placed it where it should
have been: "target create". Made an alias for "file" to
"target create" so we stay compatible with GDB commands.

We can now have multple usable targets in lldb at the
same time. This is nice for comparing two runs of a program
or debugging more than one binary at the same time. The
new command is "target select <target-idx>" and also to see
a list of the current targets you can use the new "target list"
command. The flow in a debug session can be:

(lldb) target create /path/to/exe/a.out
(lldb) breakpoint set --name main
(lldb) run
... hit breakpoint
(lldb) target create /bin/ls
(lldb) run /tmp
Process 36001 exited with status = 0 (0x00000000) 
(lldb) target list
Current targets:
  target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
* target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) target select 0
Current targets:
* target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
  target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) bt
* thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1
  frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16
  frame #1: 0x0000000100000b64 a.out`start + 52

Above we created a target for "a.out" and ran and hit a
breakpoint at "main". Then we created a new target for /bin/ls
and ran it. Then we listed the targest and selected our original
"a.out" program, so we showed two concurent debug sessions
going on at the same time.



Added:
    lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h
    lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp
    lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp
Removed:
    lldb/trunk/source/Commands/CommandObjectFile.cpp
    lldb/trunk/source/Commands/CommandObjectFile.h
Modified:
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/include/lldb/Target/StackFrame.h
    lldb/trunk/include/lldb/Target/StackFrameList.h
    lldb/trunk/include/lldb/Target/TargetList.h
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Commands/CommandObjectExpression.cpp
    lldb/trunk/source/Commands/CommandObjectFrame.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.h
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Commands/CommandObjectTarget.cpp
    lldb/trunk/source/Commands/CommandObjectThread.cpp
    lldb/trunk/source/Commands/CommandObjectThread.h
    lldb/trunk/source/Core/PluginManager.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/StackFrame.cpp
    lldb/trunk/source/Target/StackFrameList.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/test/abbreviation_tests/TestAbbreviations.py
    lldb/trunk/test/array_types/TestArrayTypes.py
    lldb/trunk/test/bitfields/TestBitfields.py
    lldb/trunk/test/breakpoint_command/TestBreakpointCommand.py
    lldb/trunk/test/class_static/TestStaticVariables.py
    lldb/trunk/test/class_types/TestClassTypes.py
    lldb/trunk/test/class_types/TestClassTypesDisassembly.py
    lldb/trunk/test/conditional_break/TestConditionalBreak.py
    lldb/trunk/test/dead-strip/TestDeadStrip.py
    lldb/trunk/test/enum_types/TestEnumTypes.py
    lldb/trunk/test/forward/TestForwardDeclaration.py
    lldb/trunk/test/function_types/TestFunctionTypes.py
    lldb/trunk/test/global_variables/TestGlobalVariables.py
    lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
    lldb/trunk/test/inlined_breakpoints/TestInlinedBreakpoints.py
    lldb/trunk/test/load_unload/TestLoadUnload.py
    lldb/trunk/test/namespace/TestNamespace.py
    lldb/trunk/test/set_values/TestSetValues.py
    lldb/trunk/test/signal/TestSendSignal.py
    lldb/trunk/test/signed_types/TestSignedTypes.py
    lldb/trunk/test/source-manager/TestSourceManager.py
    lldb/trunk/test/unique-types/TestUniqueTypes.py
    lldb/trunk/test/unsigned_types/TestUnsignedTypes.py
    lldb/trunk/tools/driver/Driver.cpp

Added: lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h?rev=129695&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h Mon Apr 18 03:33:37 2011
@@ -0,0 +1,73 @@
+//===-- OptionGroupArchitecture.h -------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupArchitecture_h_
+#define liblldb_OptionGroupArchitecture_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/Options.h"
+#include "lldb/Core/ArchSpec.h"
+
+namespace lldb_private {
+
+//-------------------------------------------------------------------------
+// OptionGroupArchitecture
+//-------------------------------------------------------------------------
+
+class OptionGroupArchitecture : public OptionGroup
+{
+public:
+    
+    OptionGroupArchitecture ();
+    
+    virtual
+    ~OptionGroupArchitecture ();
+
+    
+    virtual uint32_t
+    GetNumDefinitions ();
+    
+    virtual const OptionDefinition*
+    GetDefinitions ();
+    
+    virtual Error
+    SetOptionValue (CommandInterpreter &interpreter,
+                    uint32_t option_idx,
+                    const char *option_value);
+    
+    virtual void
+    OptionParsingStarting (CommandInterpreter &interpreter);
+    
+    bool
+    GetArchitecture (Platform *platform, ArchSpec &arch);
+
+    bool
+    ArchitectureWasSpecified () const
+    {
+        return !m_arch_str.empty();
+    }
+    const char *
+    GetArchitectureName ()
+    {
+        if (m_arch_str.empty())
+            return NULL;
+        return m_arch_str.c_str();
+    }
+
+protected:
+
+    std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionGroupArchitecture_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h?rev=129695&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h Mon Apr 18 03:33:37 2011
@@ -0,0 +1,89 @@
+//===-- OptionGroupPlatform.h -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionGroupPlatform_h_
+#define liblldb_OptionGroupPlatform_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/Options.h"
+
+namespace lldb_private {
+
+//-------------------------------------------------------------------------
+// PlatformOptionGroup
+//
+// Make platform options available to any commands that need the settings.
+//-------------------------------------------------------------------------
+class OptionGroupPlatform : public OptionGroup
+{
+public:
+    
+    OptionGroupPlatform (bool include_platform_option) :
+        OptionGroup(),
+        m_platform_name (),
+        m_os_version_major (UINT32_MAX),
+        m_os_version_minor (UINT32_MAX),
+        m_os_version_update (UINT32_MAX),
+        m_include_platform_option (include_platform_option)
+    {
+    }
+
+    virtual
+    ~OptionGroupPlatform ()
+    {
+    }
+    
+    virtual uint32_t
+    GetNumDefinitions ();
+    
+    virtual const OptionDefinition*
+    GetDefinitions ();
+    
+    virtual Error
+    SetOptionValue (CommandInterpreter &interpreter,
+                    uint32_t option_idx,
+                    const char *option_value);
+    
+    virtual void
+    OptionParsingStarting (CommandInterpreter &interpreter);
+    
+    lldb::PlatformSP 
+    CreatePlatformWithOptions (CommandInterpreter &interpreter, 
+                               bool make_selected, 
+                               Error& error);
+
+    bool
+    PlatformWasSpecified () const
+    {
+        return !m_platform_name.empty();
+    }
+    
+    void
+    SetPlatformName (const char *platform_name)
+    {
+        if (platform_name && platform_name[0])
+            m_platform_name.assign (platform_name);
+        else
+            m_platform_name.clear();
+    }
+
+protected:
+    std::string m_platform_name;
+    uint32_t m_os_version_major;
+    uint32_t m_os_version_minor;
+    uint32_t m_os_version_update;
+    bool m_include_platform_option;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionGroupPlatform_h_

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Mon Apr 18 03:33:37 2011
@@ -1896,6 +1896,16 @@
     static const char *
     ExecutionResultAsCString (ExecutionResults result);
 
+    void
+    GetStatus (Stream &ostrm);
+
+    size_t
+    GetThreadStatus (Stream &ostrm, 
+                     bool only_threads_with_stop_reason,
+                     uint32_t start_frame, 
+                     uint32_t num_frames, 
+                     uint32_t num_frames_with_source);
+
 protected:
     friend class CommandObjectProcessLaunch;
     friend class ProcessEventData;

Modified: lldb/trunk/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrame.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrame.h Mon Apr 18 03:33:37 2011
@@ -160,6 +160,13 @@
     lldb::StackFrameSP
     GetSP ();
 
+    bool
+    GetStatus (Stream &strm,
+               bool show_frame_info,
+               bool show_source,
+               uint32_t source_lines_before,
+               uint32_t source_lines_after);
+    
 protected:
     friend class StackFrameList;
 

Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Mon Apr 18 03:33:37 2011
@@ -68,6 +68,15 @@
     lldb::StackFrameSP
     GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
 
+    size_t
+    GetStatus (Stream &strm,
+               uint32_t first_frame,
+               uint32_t num_frames,
+               bool show_frame_info,
+               uint32_t num_frames_with_source,
+               uint32_t source_lines_before,
+               uint32_t source_lines_after);
+    
 protected:
 
     friend class Thread;

Modified: lldb/trunk/include/lldb/Target/TargetList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/TargetList.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/TargetList.h (original)
+++ lldb/trunk/include/lldb/Target/TargetList.h Mon Apr 18 03:33:37 2011
@@ -182,9 +182,6 @@
     uint32_t
     SetSelectedTarget (Target *target);
 
-    void
-    SetSelectedTargetWithIndex (uint32_t idx);
-
     lldb::TargetSP
     GetSelectedTarget ();
 

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Mon Apr 18 03:33:37 2011
@@ -703,6 +703,21 @@
     
     lldb::StackFrameSP
     GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
+    
+    size_t
+    GetStatus (Stream &strm, 
+               uint32_t start_frame, 
+               uint32_t num_frames,
+               uint32_t num_frames_with_source);
+
+    size_t
+    GetStackFrameStatus (Stream& strm,
+                         uint32_t first_frame,
+                         uint32_t num_frames,
+                         bool show_frame_info,
+                         uint32_t num_frames_with_source,
+                         uint32_t source_lines_before,
+                         uint32_t source_lines_after);
 
 protected:
 

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Apr 18 03:33:37 2011
@@ -94,7 +94,6 @@
 		2689001613353DDE00698AC0 /* CommandObjectCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C5DBBC611E3FEC60035160F /* CommandObjectCommands.cpp */; };
 		2689001713353DDE00698AC0 /* CommandObjectDisassemble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */; };
 		2689001813353DDE00698AC0 /* CommandObjectExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */; };
-		2689001913353DDE00698AC0 /* CommandObjectFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3210F1B84700F91463 /* CommandObjectFile.cpp */; };
 		2689001A13353DDE00698AC0 /* CommandObjectFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672D8461189055500FF4019 /* CommandObjectFrame.cpp */; };
 		2689001B13353DDE00698AC0 /* CommandObjectHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3310F1B84700F91463 /* CommandObjectHelp.cpp */; };
 		2689001C13353DDE00698AC0 /* CommandObjectImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3410F1B84700F91463 /* CommandObjectImage.cpp */; };
@@ -380,6 +379,8 @@
 		26B42C4D1187ABA50079C8C8 /* LLDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B42C4C1187ABA50079C8C8 /* LLDB.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		26C72C94124322890068DC16 /* SBStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C72C93124322890068DC16 /* SBStream.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		26C72C961243229A0068DC16 /* SBStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C72C951243229A0068DC16 /* SBStream.cpp */; };
+		26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */; };
+		26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */; };
 		26DC6A171337FE8000FF7998 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
 		26DC6A1D1337FECA00FF7998 /* lldb-platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */; };
 		26DE1E6B11616C2E00A093E2 /* lldb-forward-rtti.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE1E6911616C2E00A093E2 /* lldb-forward-rtti.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -756,7 +757,6 @@
 		26BC7D1410F1B76300F91463 /* CommandObjectBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectBreakpoint.h; path = source/Commands/CommandObjectBreakpoint.h; sourceTree = "<group>"; };
 		26BC7D1710F1B76300F91463 /* CommandObjectDisassemble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectDisassemble.h; path = source/Commands/CommandObjectDisassemble.h; sourceTree = "<group>"; };
 		26BC7D1810F1B76300F91463 /* CommandObjectExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectExpression.h; path = source/Commands/CommandObjectExpression.h; sourceTree = "<group>"; };
-		26BC7D1910F1B76300F91463 /* CommandObjectFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectFile.h; path = source/Commands/CommandObjectFile.h; sourceTree = "<group>"; };
 		26BC7D1A10F1B76300F91463 /* CommandObjectHelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectHelp.h; path = source/Commands/CommandObjectHelp.h; sourceTree = "<group>"; };
 		26BC7D1B10F1B76300F91463 /* CommandObjectImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectImage.h; path = source/Commands/CommandObjectImage.h; sourceTree = "<group>"; };
 		26BC7D1D10F1B76300F91463 /* CommandObjectMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMemory.h; path = source/Commands/CommandObjectMemory.h; sourceTree = "<group>"; };
@@ -861,7 +861,6 @@
 		26BC7E2D10F1B84700F91463 /* CommandObjectBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBreakpoint.cpp; path = source/Commands/CommandObjectBreakpoint.cpp; sourceTree = "<group>"; };
 		26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectDisassemble.cpp; path = source/Commands/CommandObjectDisassemble.cpp; sourceTree = "<group>"; };
 		26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectExpression.cpp; path = source/Commands/CommandObjectExpression.cpp; sourceTree = "<group>"; };
-		26BC7E3210F1B84700F91463 /* CommandObjectFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectFile.cpp; path = source/Commands/CommandObjectFile.cpp; sourceTree = "<group>"; };
 		26BC7E3310F1B84700F91463 /* CommandObjectHelp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectHelp.cpp; path = source/Commands/CommandObjectHelp.cpp; sourceTree = "<group>"; };
 		26BC7E3410F1B84700F91463 /* CommandObjectImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectImage.cpp; path = source/Commands/CommandObjectImage.cpp; sourceTree = "<group>"; };
 		26BC7E3610F1B84700F91463 /* CommandObjectMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMemory.cpp; path = source/Commands/CommandObjectMemory.cpp; sourceTree = "<group>"; };
@@ -980,6 +979,10 @@
 		26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverName.cpp; path = source/Breakpoint/BreakpointResolverName.cpp; sourceTree = "<group>"; };
 		26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ELFHeader.cpp; sourceTree = "<group>"; };
 		26D27C9E11ED3A4E0024D721 /* ELFHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFHeader.h; sourceTree = "<group>"; };
+		26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupArchitecture.cpp; path = source/Interpreter/OptionGroupArchitecture.cpp; sourceTree = "<group>"; };
+		26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupArchitecture.h; path = include/lldb/Interpreter/OptionGroupArchitecture.h; sourceTree = "<group>"; };
+		26D5E161135BB040006EA0A7 /* OptionGroupPlatform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupPlatform.h; path = include/lldb/Interpreter/OptionGroupPlatform.h; sourceTree = "<group>"; };
+		26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupPlatform.cpp; path = source/Interpreter/OptionGroupPlatform.cpp; sourceTree = "<group>"; };
 		26D9FDC612F784E60003F2EE /* EmulateInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstruction.h; path = include/lldb/Core/EmulateInstruction.h; sourceTree = "<group>"; };
 		26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstruction.cpp; path = source/Core/EmulateInstruction.cpp; sourceTree = "<group>"; };
 		26D9FDCC12F7853F0003F2EE /* EmulateInstructionARM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstructionARM.cpp; path = Instruction/ARM/EmulateInstructionARM.cpp; sourceTree = "<group>"; };
@@ -2044,8 +2047,6 @@
 				26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */,
 				26BC7D1810F1B76300F91463 /* CommandObjectExpression.h */,
 				26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */,
-				26BC7D1910F1B76300F91463 /* CommandObjectFile.h */,
-				26BC7E3210F1B84700F91463 /* CommandObjectFile.cpp */,
 				2672D8471189055500FF4019 /* CommandObjectFrame.h */,
 				2672D8461189055500FF4019 /* CommandObjectFrame.cpp */,
 				26BC7D1A10F1B76300F91463 /* CommandObjectHelp.h */,
@@ -2164,6 +2165,10 @@
 				26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */,
 				26BC7D6D10F1B77400F91463 /* Options.h */,
 				26BC7E8610F1B85900F91463 /* Options.cpp */,
+				26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */,
+				26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */,
+				26D5E161135BB040006EA0A7 /* OptionGroupPlatform.h */,
+				26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */,
 				26BC7DE510F1B7F900F91463 /* ScriptInterpreter.h */,
 				9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */,
 				9A2771FB1135A35C00E6ADB6 /* ScriptInterpreterNone.h */,
@@ -2870,7 +2875,6 @@
 				2689001613353DDE00698AC0 /* CommandObjectCommands.cpp in Sources */,
 				2689001713353DDE00698AC0 /* CommandObjectDisassemble.cpp in Sources */,
 				2689001813353DDE00698AC0 /* CommandObjectExpression.cpp in Sources */,
-				2689001913353DDE00698AC0 /* CommandObjectFile.cpp in Sources */,
 				2689001A13353DDE00698AC0 /* CommandObjectFrame.cpp in Sources */,
 				2689001B13353DDE00698AC0 /* CommandObjectHelp.cpp in Sources */,
 				2689001C13353DDE00698AC0 /* CommandObjectImage.cpp in Sources */,
@@ -3130,6 +3134,8 @@
 				2671A0D013482601003A87BB /* ConnectionMachPort.cpp in Sources */,
 				4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */,
 				4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */,
+				26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */,
+				26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Mon Apr 18 03:33:37 2011
@@ -13,7 +13,6 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "CommandObjectThread.h" // For DisplayThreadInfo.
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Value.h"
 #include "lldb/Core/InputReader.h"
@@ -32,6 +31,7 @@
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Target/Thread.h"
 #include "llvm/ADT/StringRef.h"
 
 using namespace lldb;
@@ -281,10 +281,25 @@
         
         if (exe_results == eExecutionInterrupted && !m_options.unwind_on_error)
         {
+            uint32_t start_frame = 0;
+            uint32_t num_frames = 1;
+            uint32_t num_frames_with_source = 0;
             if (m_exe_ctx.thread)
-                lldb_private::DisplayThreadInfo (m_interpreter, result->GetOutputStream(), m_exe_ctx.thread, false, true);
-            else
-                lldb_private::DisplayThreadsInfo (m_interpreter, &m_exe_ctx, *result, true, true); 
+            {
+                m_exe_ctx.thread->GetStatus (result->GetOutputStream(), 
+                                             start_frame, 
+                                             num_frames, 
+                                             num_frames_with_source);
+            }
+            else if (m_exe_ctx.process)
+            {
+                bool only_threads_with_stop_reason = true;
+                m_exe_ctx.process->GetThreadStatus (result->GetOutputStream(), 
+                                                    only_threads_with_stop_reason, 
+                                                    start_frame, 
+                                                    num_frames, 
+                                                    num_frames_with_source);
+            }
         }
 
         if (result_valobj_sp)

Removed: lldb/trunk/source/Commands/CommandObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFile.cpp?rev=129694&view=auto
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFile.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFile.cpp (removed)
@@ -1,235 +0,0 @@
-//===-- CommandObjectFile.cpp -----------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CommandObjectFile.h"
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Timer.h"
-#include "lldb/Core/Debugger.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Interpreter/CommandCompletions.h"
-#include "lldb/Target/Process.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-FileOptionGroup::FileOptionGroup() :
-    m_arch_str ()
-{
-}
-
-FileOptionGroup::~FileOptionGroup ()
-{
-}
-
-OptionDefinition g_file_option_table[] =
-{
-    { LLDB_OPT_SET_1 , false, "arch"    , 'a', required_argument, NULL, 0, eArgTypeArchitecture , "Specify the architecture for the target."},
-};
-const uint32_t k_num_file_options = sizeof(g_file_option_table)/sizeof(OptionDefinition);
-
-uint32_t
-FileOptionGroup::GetNumDefinitions ()
-{
-    return k_num_file_options;
-}
-
-const OptionDefinition *
-FileOptionGroup::GetDefinitions ()
-{
-    return g_file_option_table;
-}
-
-bool
-FileOptionGroup::GetArchitecture (Platform *platform, ArchSpec &arch)
-{
-    if (m_arch_str.empty())
-        arch.Clear();
-    else
-        arch.SetTriple(m_arch_str.c_str(), platform);
-    return arch.IsValid();
-}
-
-
-Error
-FileOptionGroup::SetOptionValue (CommandInterpreter &interpreter,
-                                 uint32_t option_idx,
-                                 const char *option_arg)
-{
-    Error error;
-    char short_option = (char) g_file_option_table[option_idx].short_option;
-
-    switch (short_option)
-    {
-        case 'a':
-            m_arch_str.assign (option_arg);
-            break;
-
-        default:
-            error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
-            break;
-    }
-
-    return error;
-}
-
-void
-FileOptionGroup::OptionParsingStarting (CommandInterpreter &interpreter)
-{
-    m_arch_str.clear();
-}
-
-//-------------------------------------------------------------------------
-// CommandObjectFile
-//-------------------------------------------------------------------------
-
-CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
-    CommandObject (interpreter,
-                   "file",
-                   "Set the file to be used as the main executable by the debugger.",
-                   NULL),
-    m_option_group (interpreter),
-    m_file_options (),
-    m_platform_options(true) // Do include the "--platform" option in the platform settings by passing true
-{
-    CommandArgumentEntry arg;
-    CommandArgumentData file_arg;
-
-    // Define the first (and only) variant of this arg.
-    file_arg.arg_type = eArgTypeFilename;
-    file_arg.arg_repetition = eArgRepeatPlain;
-
-    // There is only one variant this argument could be; put it into the argument entry.
-    arg.push_back (file_arg);
-
-    // Push the data for the first argument into the m_arguments vector.
-    m_arguments.push_back (arg);
-    
-    m_option_group.Append (&m_file_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
-    m_option_group.Append (&m_platform_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
-    m_option_group.Finalize();
-}
-
-CommandObjectFile::~CommandObjectFile ()
-{
-}
-
-Options *
-CommandObjectFile::GetOptions ()
-{
-    return &m_option_group;
-}
-
-bool
-CommandObjectFile::Execute
-(
-    Args& command,
-    CommandReturnObject &result
-)
-{
-    const char *file_path = command.GetArgumentAtIndex(0);
-    Timer scoped_timer(__PRETTY_FUNCTION__, "(lldb) file '%s'", file_path);
-    const int argc = command.GetArgumentCount();
-    if (argc == 1)
-    {
-        FileSpec file_spec (file_path, true);
-        
-        bool select = true;
-        PlatformSP platform_sp;
-        
-        Error error;
-        
-        if (!m_platform_options.platform_name.empty())
-        {
-            platform_sp = m_platform_options.CreatePlatformWithOptions(m_interpreter, select, error);
-            if (!platform_sp)
-            {
-                result.AppendError(error.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-                return false;
-            }
-        }
-        ArchSpec file_arch;
-        
-        if (!m_file_options.m_arch_str.empty())
-        {        
-            if (!platform_sp)
-                platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
-            if (!m_file_options.GetArchitecture(platform_sp.get(), file_arch))
-            {
-                result.AppendErrorWithFormat("invalid architecture '%s'", m_file_options.m_arch_str.c_str());
-                result.SetStatus (eReturnStatusFailed);
-                return false;
-            }
-        }
-
-        if (! file_spec.Exists() && !file_spec.ResolveExecutableLocation())
-        {
-            result.AppendErrorWithFormat ("File '%s' does not exist.\n", file_path);
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
-
-        TargetSP target_sp;
-        Debugger &debugger = m_interpreter.GetDebugger();
-        error = debugger.GetTargetList().CreateTarget (debugger, file_spec, file_arch, true, target_sp);
-
-        if (target_sp)
-        {
-            debugger.GetTargetList().SetSelectedTarget(target_sp.get());
-            result.AppendMessageWithFormat ("Current executable set to '%s' (%s).\n", file_path, target_sp->GetArchitecture().GetArchitectureName());
-            result.SetStatus (eReturnStatusSuccessFinishNoResult);
-        }
-        else
-        {
-            result.AppendError(error.AsCString());
-            result.SetStatus (eReturnStatusFailed);
-        }
-    }
-    else
-    {
-        result.AppendErrorWithFormat("'%s' takes exactly one executable path argument.\n", m_cmd_name.c_str());
-        result.SetStatus (eReturnStatusFailed);
-    }
-    return result.Succeeded();
-
-}
-
-int
-CommandObjectFile::HandleArgumentCompletion 
-(
-    Args &input,
-    int &cursor_index,
-    int &cursor_char_position,
-    OptionElementVector &opt_element_vector,
-    int match_start_point,
-    int max_return_elements,
-    bool &word_complete,
-    StringList &matches
-)
-{
-    std::string completion_str (input.GetArgumentAtIndex(cursor_index));
-    completion_str.erase (cursor_char_position);
-
-    CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, 
-                                                         CommandCompletions::eDiskFileCompletion,
-                                                         completion_str.c_str(),
-                                                         match_start_point,
-                                                         max_return_elements,
-                                                         NULL,
-                                                         word_complete,
-                                                         matches);
-    return matches.GetSize();
-}

Removed: lldb/trunk/source/Commands/CommandObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFile.h?rev=129694&view=auto
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFile.h (original)
+++ lldb/trunk/source/Commands/CommandObjectFile.h (removed)
@@ -1,95 +0,0 @@
-//===-- CommandObjectFile.h -------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_CommandObjectFile_h_
-#define liblldb_CommandObjectFile_h_
-
-// C Includes
-// C++ Includes
-#include <vector>
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Interpreter/Options.h"
-#include "lldb/Core/ArchSpec.h"
-#include "lldb/Interpreter/CommandObject.h"
-#include "CommandObjectPlatform.h"
-
-namespace lldb_private {
-
-//-------------------------------------------------------------------------
-// CommandObjectFile
-//-------------------------------------------------------------------------
-
-class FileOptionGroup : public OptionGroup
-{
-public:
-    
-    FileOptionGroup ();
-    
-    virtual
-    ~FileOptionGroup ();
-
-    
-    virtual uint32_t
-    GetNumDefinitions ();
-    
-    virtual const OptionDefinition*
-    GetDefinitions ();
-    
-    virtual Error
-    SetOptionValue (CommandInterpreter &interpreter,
-                    uint32_t option_idx,
-                    const char *option_value);
-    
-    virtual void
-    OptionParsingStarting (CommandInterpreter &interpreter);
-    
-    bool
-    GetArchitecture (Platform *platform, ArchSpec &arch);
-
-    std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
-};
-
-class CommandObjectFile : public CommandObject
-{
-public:
-
-    CommandObjectFile (CommandInterpreter &interpreter);
-
-    virtual
-    ~CommandObjectFile ();
-
-    virtual bool
-    Execute (Args& command,
-             CommandReturnObject &result);
-
-    virtual Options *
-    GetOptions ();
-
-    
-    virtual int
-    HandleArgumentCompletion (Args &input,
-                              int &cursor_index,
-                              int &cursor_char_position,
-                              OptionElementVector &opt_element_vector,
-                              int match_start_point,
-                              int max_return_elements,
-                              bool &word_complete,
-                              StringList &matches);
-    
-
-private:
-    OptionGroupOptions m_option_group;
-    FileOptionGroup m_file_options;
-    PlatformOptionGroup m_platform_options;
-};
-
-} // namespace lldb_private
-
-#endif  // liblldb_CommandObjectFile_h_

Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Mon Apr 18 03:33:37 2011
@@ -37,8 +37,6 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/Target.h"
 
-#include "CommandObjectThread.h"
-
 using namespace lldb;
 using namespace lldb_private;
 
@@ -243,14 +241,15 @@
                         already_shown = Host::OpenFileInExternalEditor (frame_sc.line_entry.file, frame_sc.line_entry.line);
                     }
 
-                    if (DisplayFrameForExecutionContext (exe_ctx.thread,
-                                                         exe_ctx.frame,
-                                                         m_interpreter,
-                                                         result.GetOutputStream(),
-                                                         true,
-                                                         !already_shown,
-                                                         3,
-                                                         3))
+                    bool show_frame_info = true;
+                    bool show_source = !already_shown;
+                    uint32_t source_lines_before = 3;
+                    uint32_t source_lines_after = 3;
+                    if (exe_ctx.frame->GetStatus(result.GetOutputStream(),
+                                                 show_frame_info,
+                                                 show_source,
+                                                 source_lines_before,
+                                                 source_lines_after))
                     {
                         result.SetStatus (eReturnStatusSuccessFinishResult);
                         return result.Succeeded();

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Mon Apr 18 03:33:37 2011
@@ -19,7 +19,7 @@
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Interpreter/Options.h"
+#include "lldb/Interpreter/OptionGroupPlatform.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
@@ -28,94 +28,8 @@
 using namespace lldb_private;
 
 
-PlatformSP 
-PlatformOptionGroup::CreatePlatformWithOptions (CommandInterpreter &interpreter, bool select, Error& error)
-{
-    PlatformSP platform_sp;
-    if (!platform_name.empty())
-    {
-        platform_sp = Platform::Create (platform_name.c_str(), error);
-
-        if (platform_sp)
-        {
-            interpreter.GetDebugger().GetPlatformList().Append (platform_sp, select);
-            if (os_version_major != UINT32_MAX)
-            {
-                platform_sp->SetOSVersion (os_version_major,
-                                           os_version_minor,
-                                           os_version_update);
-            }
-        }
-    }
-    return platform_sp;
-}
-
-void
-PlatformOptionGroup::OptionParsingStarting (CommandInterpreter &interpreter)
-{
-    platform_name.clear();
-    os_version_major = UINT32_MAX;
-    os_version_minor = UINT32_MAX;
-    os_version_update = UINT32_MAX;
-}
-
-static OptionDefinition
-g_option_table[] =
-{
-    { LLDB_OPT_SET_ALL, false, "platform"   , 'p', required_argument, NULL, 0, eArgTypePlatform, "Specify name of the platform to use for this target, creating the platform if necessary."},
-    { LLDB_OPT_SET_ALL, false, "sdk-version", 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." }
-};
-
-static const uint32_t k_option_table_size = sizeof(g_option_table)/sizeof (OptionDefinition);
-
-const OptionDefinition*
-PlatformOptionGroup::GetDefinitions ()
-{
-    if (m_include_platform_option)
-        return g_option_table;
-    return g_option_table + 1;
-}
-
-uint32_t
-PlatformOptionGroup::GetNumDefinitions ()
-{
-    if (m_include_platform_option)
-        return k_option_table_size;
-    return k_option_table_size - 1;
-}
-
-
-Error
-PlatformOptionGroup::SetOptionValue (CommandInterpreter &interpreter,
-                                     uint32_t option_idx,
-                                     const char *option_arg)
-{
-    Error error;
-    if (!m_include_platform_option)
-        --option_idx;
-        
-    char short_option = (char) g_option_table[option_idx].short_option;
-    
-    switch (short_option)
-    {
-    case 'p':
-        platform_name.assign (option_arg);
-        break;
-
-    case 'v':
-        if (Args::StringToVersion (option_arg, os_version_major, os_version_minor, os_version_update) == option_arg)
-            error.SetErrorStringWithFormat ("invalid version string '%s'", option_arg);
-        break;
-        
-    default:
-        error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
-        break;
-    }
-    return error;
-}
-
 //----------------------------------------------------------------------
-// "platform create <platform-name>"
+// "platform select <platform-name>"
 //----------------------------------------------------------------------
 class CommandObjectPlatformSelect : public CommandObject
 {
@@ -147,7 +61,7 @@
             if (platform_name && platform_name[0])
             {
                 const bool select = true;
-                m_platform_options.platform_name.assign (platform_name);
+                m_platform_options.SetPlatformName (platform_name);
                 Error error;
                 PlatformSP platform_sp (m_platform_options.CreatePlatformWithOptions (m_interpreter, select, error));
                 if (platform_sp)
@@ -175,6 +89,29 @@
         return result.Succeeded();
     }
     
+    
+    virtual int
+    HandleCompletion (Args &input,
+                      int &cursor_index,
+                      int &cursor_char_position,
+                      int match_start_point,
+                      int max_return_elements,
+                      bool &word_complete,
+                      StringList &matches)
+    {
+        std::string completion_str (input.GetArgumentAtIndex(cursor_index));
+        completion_str.erase (cursor_char_position);
+        
+        CommandCompletions::PlatformPluginNames (m_interpreter, 
+                                                 completion_str.c_str(),
+                                                 match_start_point,
+                                                 max_return_elements,
+                                                 NULL,
+                                                 word_complete,
+                                                 matches);
+        return matches.GetSize();
+    }
+
     virtual Options *
     GetOptions ()
     {
@@ -183,7 +120,7 @@
 
 protected:
     OptionGroupOptions m_option_group;
-    PlatformOptionGroup m_platform_options;
+    OptionGroupPlatform m_platform_options;
 };
 
 //----------------------------------------------------------------------

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.h (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.h Mon Apr 18 03:33:37 2011
@@ -35,64 +35,6 @@
     DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatform);
 };
 
-    
-//-------------------------------------------------------------------------
-// PlatformOptionGroup
-//
-// Make platform options available to to any other command in case they 
-// need them. The "file" command needs them, and by exposing them we can
-// reuse the platform command options for any command, we can keep things
-// consistent.
-//-------------------------------------------------------------------------
-class PlatformOptionGroup : public OptionGroup
-{
-public:
-    
-    PlatformOptionGroup (bool include_platform_option) :
-        platform_name (),
-        os_version_major (UINT32_MAX),
-        os_version_minor (UINT32_MAX),
-        os_version_update (UINT32_MAX),
-        m_include_platform_option (include_platform_option)
-    {
-    }
-    
-    virtual
-    ~PlatformOptionGroup ()
-    {
-    }
-    
-    virtual uint32_t
-    GetNumDefinitions ();
-    
-    virtual const OptionDefinition*
-    GetDefinitions ();
-    
-    virtual Error
-    SetOptionValue (CommandInterpreter &interpreter,
-                    uint32_t option_idx,
-                    const char *option_value);
-    
-    lldb::PlatformSP 
-    CreatePlatformWithOptions (CommandInterpreter &interpreter, 
-                               bool select,
-                               Error &error);
-
-    virtual void
-    OptionParsingStarting (CommandInterpreter &interpreter);
-        
-    // Instance variables to hold the values for command options.
-    
-    std::string platform_name;
-    uint32_t os_version_major;
-    uint32_t os_version_minor;
-    uint32_t os_version_update;
-protected:
-    bool m_include_platform_option;
-};
-
-    
-    
 } // namespace lldb_private
 
 #endif  // liblldb_CommandObjectPlatform_h_

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Mon Apr 18 03:33:37 2011
@@ -16,10 +16,9 @@
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/Options.h"
 #include "lldb/Core/State.h"
+#include "lldb/Host/Host.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
-#include "CommandObjectThread.h"
-#include "lldb/Host/Host.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
@@ -1491,52 +1490,26 @@
         CommandReturnObject &result
     )
     {
-        Stream &output_stream = result.GetOutputStream();
+        Stream &strm = result.GetOutputStream();
         result.SetStatus (eReturnStatusSuccessFinishNoResult);
         ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
         if (exe_ctx.process)
         {
-            const StateType state = exe_ctx.process->GetState();
-            if (StateIsStoppedState(state))
-            {
-                if (state == eStateExited)
-                {
-                    int exit_status = exe_ctx.process->GetExitStatus();
-                    const char *exit_description = exe_ctx.process->GetExitDescription();
-                    output_stream.Printf ("Process %d exited with status = %i (0x%8.8x) %s\n",
-                                          exe_ctx.process->GetID(),
-                                          exit_status,
-                                          exit_status,
-                                          exit_description ? exit_description : "");
-                }
-                else
-                {
-                    if (state == eStateConnected)
-                        output_stream.Printf ("Connected to remote target.\n");
-                    else
-                        output_stream.Printf ("Process %d %s\n", exe_ctx.process->GetID(), StateAsCString (state));
-                    if (exe_ctx.thread == NULL)
-                        exe_ctx.thread = exe_ctx.process->GetThreadList().GetThreadAtIndex(0).get();
-                    if (exe_ctx.thread != NULL)
-                    {
-                        DisplayThreadsInfo (m_interpreter, &exe_ctx, result, true, true);
-                    }
-                    else
-                    {
-                        result.AppendError ("No valid thread found in current process.");
-                        result.SetStatus (eReturnStatusFailed);
-                    }
-                }
-            }
-            else
-            {
-                output_stream.Printf ("Process %d is running.\n", 
-                                          exe_ctx.process->GetID());
-            }
+            const bool only_threads_with_stop_reason = true;
+            const uint32_t start_frame = 0;
+            const uint32_t num_frames = 1;
+            const uint32_t num_frames_with_source = 1;
+            exe_ctx.process->GetStatus(strm);
+            exe_ctx.process->GetThreadStatus (strm, 
+                                              only_threads_with_stop_reason, 
+                                              start_frame,
+                                              num_frames,
+                                              num_frames_with_source);
+            
         }
         else
         {
-            result.AppendError ("No current location or status available.");
+            result.AppendError ("No process.");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Apr 18 03:33:37 2011
@@ -18,9 +18,12 @@
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/InputReader.h"
+#include "lldb/Core/State.h"
 #include "lldb/Core/Timer.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionGroupArchitecture.h"
+#include "lldb/Interpreter/OptionGroupPlatform.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Thread.h"
@@ -29,6 +32,360 @@
 using namespace lldb;
 using namespace lldb_private;
 
+
+
+static void
+DumpTargetInfo (uint32_t target_idx, Target *target, const char *prefix_cstr, bool show_stopped_process_status, Stream &strm)
+{
+    ArchSpec &target_arch = target->GetArchitecture();
+    
+    ModuleSP exe_module_sp (target->GetExecutableModule ());
+    char exe_path[PATH_MAX];
+    bool exe_valid = false;
+    if (exe_module_sp)
+        exe_valid = exe_module_sp->GetFileSpec().GetPath (exe_path, sizeof(exe_path));
+    
+    if (!exe_valid)
+        ::strcpy (exe_path, "<none>");
+    
+    strm.Printf ("%starget #%u: %s", prefix_cstr ? prefix_cstr : "", target_idx, exe_path);
+    
+    uint32_t properties = 0;
+    if (target_arch.IsValid())
+    {
+        strm.Printf ("%sarch=%s", properties++ > 0 ? ", " : " ( ", target_arch.GetTriple().str().c_str());
+        properties++;
+    }
+    PlatformSP platform_sp (target->GetPlatform());
+    if (platform_sp)
+        strm.Printf ("%splatform=%s", properties++ > 0 ? ", " : " ( ", platform_sp->GetName());
+    
+    ProcessSP process_sp (target->GetProcessSP());
+    bool show_process_status = false;
+    if (process_sp)
+    {
+        lldb::pid_t pid = process_sp->GetID();
+        StateType state = process_sp->GetState();
+        if (show_stopped_process_status)
+            show_process_status = StateIsStoppedState(state);
+        const char *state_cstr = StateAsCString (state);
+        if (pid != LLDB_INVALID_PROCESS_ID)
+            strm.Printf ("%spid=%i", properties++ > 0 ? ", " : " ( ", pid);
+        strm.Printf ("%sstate=%s", properties++ > 0 ? ", " : " ( ", state_cstr);
+    }
+    if (properties > 0)
+        strm.PutCString (" )\n");
+    else
+        strm.EOL();
+    if (show_process_status)
+    {
+        const bool only_threads_with_stop_reason = true;
+        const uint32_t start_frame = 0;
+        const uint32_t num_frames = 1;
+        const uint32_t num_frames_with_source = 1;
+        process_sp->GetStatus (strm);
+        process_sp->GetThreadStatus (strm, 
+                                     only_threads_with_stop_reason, 
+                                     start_frame,
+                                     num_frames,
+                                     num_frames_with_source);
+
+    }
+}
+
+static uint32_t
+DumpTargetList (TargetList &target_list, bool show_stopped_process_status, Stream &strm)
+{
+    const uint32_t num_targets = target_list.GetNumTargets();
+    if (num_targets)
+    {        
+        TargetSP selected_target_sp (target_list.GetSelectedTarget());
+        strm.PutCString ("Current targets:\n");
+        for (uint32_t i=0; i<num_targets; ++i)
+        {
+            TargetSP target_sp (target_list.GetTargetAtIndex (i));
+            if (target_sp)
+            {
+                bool is_selected = target_sp.get() == selected_target_sp.get();
+                DumpTargetInfo (i, 
+                                target_sp.get(), 
+                                is_selected ? "* " : "  ", 
+                                show_stopped_process_status,
+                                strm);
+            }
+        }
+    }
+    return num_targets;
+}
+#pragma mark CommandObjectTargetCreate
+
+//-------------------------------------------------------------------------
+// "target create"
+//-------------------------------------------------------------------------
+
+class CommandObjectTargetCreate : public CommandObject
+{
+public:
+    CommandObjectTargetCreate(CommandInterpreter &interpreter) :
+        CommandObject (interpreter,
+                       "target create",
+                       "Create a target using the argument as the main executable.",
+                       NULL),
+        m_option_group (interpreter),
+        m_file_options (),
+        m_platform_options(true) // Do include the "--platform" option in the platform settings by passing true
+    {
+        CommandArgumentEntry arg;
+        CommandArgumentData file_arg;
+    
+        // Define the first (and only) variant of this arg.
+            file_arg.arg_type = eArgTypeFilename;
+        file_arg.arg_repetition = eArgRepeatPlain;
+        
+        // There is only one variant this argument could be; put it into the argument entry.
+        arg.push_back (file_arg);
+        
+        // Push the data for the first argument into the m_arguments vector.
+        m_arguments.push_back (arg);
+        
+        m_option_group.Append (&m_file_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+        m_option_group.Append (&m_platform_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+        m_option_group.Finalize();
+    }
+
+    ~CommandObjectTargetCreate ()
+    {
+    }
+
+    Options *
+    GetOptions ()
+    {
+        return &m_option_group;
+    }
+
+    bool
+    Execute (Args& command, CommandReturnObject &result)
+    {
+        const int argc = command.GetArgumentCount();
+        if (argc == 1)
+        {
+            const char *file_path = command.GetArgumentAtIndex(0);
+            Timer scoped_timer(__PRETTY_FUNCTION__, "(lldb) target create '%s'", file_path);
+            FileSpec file_spec (file_path, true);
+            
+            bool select = true;
+            PlatformSP platform_sp;
+            
+            Error error;
+            
+            if (m_platform_options.PlatformWasSpecified ())
+            {
+                platform_sp = m_platform_options.CreatePlatformWithOptions(m_interpreter, select, error);
+                if (!platform_sp)
+                {
+                    result.AppendError(error.AsCString());
+                    result.SetStatus (eReturnStatusFailed);
+                    return false;
+                }
+            }
+            ArchSpec file_arch;
+            
+            const char *arch_cstr = m_file_options.GetArchitectureName();
+            if (arch_cstr)
+            {        
+                if (!platform_sp)
+                    platform_sp = m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform();
+                if (!m_file_options.GetArchitecture(platform_sp.get(), file_arch))
+                {
+                    result.AppendErrorWithFormat("invalid architecture '%s'\n", arch_cstr);
+                    result.SetStatus (eReturnStatusFailed);
+                    return false;
+                }
+            }
+            
+            if (! file_spec.Exists() && !file_spec.ResolveExecutableLocation())
+            {
+                result.AppendErrorWithFormat ("File '%s' does not exist.\n", file_path);
+                result.SetStatus (eReturnStatusFailed);
+                return false;
+            }
+            
+            TargetSP target_sp;
+            Debugger &debugger = m_interpreter.GetDebugger();
+            error = debugger.GetTargetList().CreateTarget (debugger, file_spec, file_arch, true, target_sp);
+            
+            if (target_sp)
+            {
+                debugger.GetTargetList().SetSelectedTarget(target_sp.get());
+                result.AppendMessageWithFormat ("Current executable set to '%s' (%s).\n", file_path, target_sp->GetArchitecture().GetArchitectureName());
+                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            }
+            else
+            {
+                result.AppendError(error.AsCString());
+                result.SetStatus (eReturnStatusFailed);
+            }
+        }
+        else
+        {
+            result.AppendErrorWithFormat("'%s' takes exactly one executable path argument.\n", m_cmd_name.c_str());
+            result.SetStatus (eReturnStatusFailed);
+        }
+        return result.Succeeded();
+        
+    }
+
+    int
+    HandleArgumentCompletion (Args &input,
+                              int &cursor_index,
+                              int &cursor_char_position,
+                              OptionElementVector &opt_element_vector,
+                              int match_start_point,
+                              int max_return_elements,
+                              bool &word_complete,
+                              StringList &matches)
+    {
+        std::string completion_str (input.GetArgumentAtIndex(cursor_index));
+        completion_str.erase (cursor_char_position);
+        
+        CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, 
+                                                             CommandCompletions::eDiskFileCompletion,
+                                                             completion_str.c_str(),
+                                                             match_start_point,
+                                                             max_return_elements,
+                                                             NULL,
+                                                             word_complete,
+                                                             matches);
+        return matches.GetSize();
+    }
+private:
+    OptionGroupOptions m_option_group;
+    OptionGroupArchitecture m_file_options;
+    OptionGroupPlatform m_platform_options;
+
+};
+
+#pragma mark CommandObjectTargetList
+
+//----------------------------------------------------------------------
+// "target list"
+//----------------------------------------------------------------------
+
+class CommandObjectTargetList : public CommandObject
+{
+public:
+    CommandObjectTargetList (CommandInterpreter &interpreter) :
+        CommandObject (interpreter,
+                       "target list",
+                       "List all current targets in the current debug session.",
+                       NULL,
+                       0)
+    {
+    }
+    
+    virtual
+    ~CommandObjectTargetList ()
+    {
+    }
+    
+    virtual bool
+    Execute (Args& args, CommandReturnObject &result)
+    {
+        if (args.GetArgumentCount() == 0)
+        {
+            Stream &strm = result.GetOutputStream();
+            
+            bool show_stopped_process_status = false;
+            if (DumpTargetList (m_interpreter.GetDebugger().GetTargetList(), show_stopped_process_status, strm) == 0)
+            {
+                strm.PutCString ("No targets.\n");
+            }
+        }
+        else
+        {
+            result.AppendError ("the 'target list' command takes no arguments\n");
+            result.SetStatus (eReturnStatusFailed);
+        }
+        return result.Succeeded();
+    }
+};
+
+
+#pragma mark CommandObjectTargetSelect
+
+//----------------------------------------------------------------------
+// "target select"
+//----------------------------------------------------------------------
+
+class CommandObjectTargetSelect : public CommandObject
+{
+public:
+    CommandObjectTargetSelect (CommandInterpreter &interpreter) :
+        CommandObject (interpreter,
+                       "target select",
+                       "Select a target as the current target by target index.",
+                       NULL,
+                       0)
+    {
+    }
+    
+    virtual
+    ~CommandObjectTargetSelect ()
+    {
+    }
+    
+    virtual bool
+    Execute (Args& args, CommandReturnObject &result)
+    {
+        if (args.GetArgumentCount() == 1)
+        {
+            bool success = false;
+            const char *target_idx_arg = args.GetArgumentAtIndex(0);
+            uint32_t target_idx = Args::StringToUInt32 (target_idx_arg, UINT32_MAX, 0, &success);
+            if (success)
+            {
+                TargetList &target_list = m_interpreter.GetDebugger().GetTargetList();
+                const uint32_t num_targets = target_list.GetNumTargets();
+                if (target_idx < num_targets)
+                {        
+                    TargetSP target_sp (target_list.GetTargetAtIndex (target_idx));
+                    if (target_sp)
+                    {
+                        Stream &strm = result.GetOutputStream();
+                        target_list.SetSelectedTarget (target_sp.get());
+                        bool show_stopped_process_status = false;
+                        DumpTargetList (target_list, show_stopped_process_status, strm);
+                    }
+                    else
+                    {
+                        result.AppendErrorWithFormat ("target #%u is NULL in target list\n", target_idx);
+                        result.SetStatus (eReturnStatusFailed);
+                    }
+                }
+                else
+                {
+                    result.AppendErrorWithFormat ("index %u is out of range, valid target indexes are 0 - %u\n", 
+                                                  target_idx,
+                                                  num_targets - 1);
+                    result.SetStatus (eReturnStatusFailed);
+                }
+            }
+            else
+            {
+                result.AppendErrorWithFormat("invalid index string value '%s'\n", target_idx_arg);
+                result.SetStatus (eReturnStatusFailed);
+            }
+        }
+        else
+        {
+            result.AppendError ("'target select' takes a single argument: a target index\n");
+            result.SetStatus (eReturnStatusFailed);
+        }
+        return result.Succeeded();
+    }
+};
+
+
 #pragma mark CommandObjectTargetImageSearchPaths
 
 class CommandObjectTargetImageSearchPathsAdd : public CommandObject
@@ -77,7 +434,7 @@
             uint32_t argc = command.GetArgumentCount();
             if (argc & 1)
             {
-                result.AppendError ("add requires an even number of arguments");
+                result.AppendError ("add requires an even number of arguments\n");
                 result.SetStatus (eReturnStatusFailed);
             }
             else
@@ -98,9 +455,9 @@
                     else
                     {
                         if (from[0])
-                            result.AppendError ("<path-prefix> can't be empty");
+                            result.AppendError ("<path-prefix> can't be empty\n");
                         else
-                            result.AppendError ("<new-path-prefix> can't be empty");
+                            result.AppendError ("<new-path-prefix> can't be empty\n");
                         result.SetStatus (eReturnStatusFailed);
                     }
                 }
@@ -108,7 +465,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();
@@ -144,7 +501,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();
@@ -241,9 +598,9 @@
                     else
                     {
                         if (from[0])
-                            result.AppendError ("<path-prefix> can't be empty");
+                            result.AppendError ("<path-prefix> can't be empty\n");
                         else
-                            result.AppendError ("<new-path-prefix> can't be empty");
+                            result.AppendError ("<new-path-prefix> can't be empty\n");
                         result.SetStatus (eReturnStatusFailed);
                         return false;
                     }
@@ -251,7 +608,7 @@
             }
             else
             {
-                result.AppendError ("insert requires at least three arguments");
+                result.AppendError ("insert requires at least three arguments\n");
                 result.SetStatus (eReturnStatusFailed);
                 return result.Succeeded();
             }
@@ -259,7 +616,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();
@@ -291,7 +648,7 @@
         {
             if (command.GetArgumentCount() != 0)
             {
-                result.AppendError ("list takes no arguments");
+                result.AppendError ("list takes no arguments\n");
                 result.SetStatus (eReturnStatusFailed);
                 return result.Succeeded();
             }
@@ -301,7 +658,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();
@@ -345,7 +702,7 @@
         {
             if (command.GetArgumentCount() != 1)
             {
-                result.AppendError ("query requires one argument");
+                result.AppendError ("query requires one argument\n");
                 result.SetStatus (eReturnStatusFailed);
                 return result.Succeeded();
             }
@@ -361,7 +718,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();
@@ -790,7 +1147,7 @@
             InputReaderSP reader_sp (new InputReader(m_interpreter.GetDebugger()));
             if (!reader_sp)
             {
-                result.AppendError("out of memory");
+                result.AppendError("out of memory\n");
                 result.SetStatus (eReturnStatusFailed);
                 target->RemoveStopHookByID (new_hook_sp->GetID());
                 return false;
@@ -815,7 +1172,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         
@@ -902,14 +1259,14 @@
                     lldb::user_id_t user_id = Args::StringToUInt32 (command.GetArgumentAtIndex(i), 0, 0, &success);
                     if (!success)
                     {
-                        result.AppendErrorWithFormat ("invalid stop hook id: \"%s\".", command.GetArgumentAtIndex(i));
+                        result.AppendErrorWithFormat ("invalid stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i));
                         result.SetStatus(eReturnStatusFailed);
                         return false;
                     }
                     success = target->RemoveStopHookByID (user_id);
                     if (!success)
                     {
-                        result.AppendErrorWithFormat ("unknown stop hook id: \"%s\".", command.GetArgumentAtIndex(i));
+                        result.AppendErrorWithFormat ("unknown stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i));
                         result.SetStatus(eReturnStatusFailed);
                         return false;
                     }
@@ -919,7 +1276,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         
@@ -971,14 +1328,14 @@
                     lldb::user_id_t user_id = Args::StringToUInt32 (command.GetArgumentAtIndex(i), 0, 0, &success);
                     if (!success)
                     {
-                        result.AppendErrorWithFormat ("invalid stop hook id: \"%s\".", command.GetArgumentAtIndex(i));
+                        result.AppendErrorWithFormat ("invalid stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i));
                         result.SetStatus(eReturnStatusFailed);
                         return false;
                     }
                     success = target->SetStopHookActiveStateByID (user_id, m_enable);
                     if (!success)
                     {
-                        result.AppendErrorWithFormat ("unknown stop hook id: \"%s\".", command.GetArgumentAtIndex(i));
+                        result.AppendErrorWithFormat ("unknown stop hook id: \"%s\".\n", command.GetArgumentAtIndex(i));
                         result.SetStatus(eReturnStatusFailed);
                         return false;
                     }
@@ -988,7 +1345,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         return result.Succeeded();
@@ -1032,7 +1389,7 @@
         }
         else
         {
-            result.AppendError ("invalid target");
+            result.AppendError ("invalid target\n");
             result.SetStatus (eReturnStatusFailed);
         }
         
@@ -1104,11 +1461,16 @@
                             "A set of commands for operating on debugger targets.",
                             "target <subcommand> [<subcommand-options>]")
 {
-    LoadSubCommand ("image-search-paths", CommandObjectSP (new CommandObjectMultiwordImageSearchPaths (interpreter)));
+    
+    LoadSubCommand ("create",    CommandObjectSP (new CommandObjectTargetCreate (interpreter)));
+    LoadSubCommand ("list",      CommandObjectSP (new CommandObjectTargetList   (interpreter)));
+    LoadSubCommand ("select",    CommandObjectSP (new CommandObjectTargetSelect (interpreter)));
     LoadSubCommand ("stop-hook", CommandObjectSP (new CommandObjectMultiwordTargetStopHooks (interpreter)));
+    LoadSubCommand ("image-search-paths", CommandObjectSP (new CommandObjectMultiwordImageSearchPaths (interpreter)));
 }
 
 CommandObjectMultiwordTarget::~CommandObjectMultiwordTarget ()
 {
 }
 
+

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Mon Apr 18 03:33:37 2011
@@ -38,205 +38,6 @@
 using namespace lldb_private;
 
 
-bool
-lldb_private::DisplayThreadInfo
-(
-    CommandInterpreter &interpreter,
-    Stream &strm,
-    Thread *thread,
-    bool only_threads_with_stop_reason,
-    bool show_source
-)
-{
-    if (thread)
-    {
-        if (only_threads_with_stop_reason)
-        {
-            if (thread->GetStopInfo() == NULL)
-                return false;
-        }
-
-        strm.Indent();
-        strm.Printf("%c ", thread->GetProcess().GetThreadList().GetSelectedThread().get() == thread ? '*' : ' ');
-
-        // Show one frame with only the first showing source
-        if (show_source)
-        {
-            bool already_shown = false;
-            StackFrameSP frame_sp = thread->GetStackFrameAtIndex(0);
-            SymbolContext frame_sc(frame_sp->GetSymbolContext (eSymbolContextLineEntry));
-            if (interpreter.GetDebugger().GetUseExternalEditor() && frame_sc.line_entry.file && frame_sc.line_entry.line != 0)
-            {
-                already_shown = Host::OpenFileInExternalEditor (frame_sc.line_entry.file, frame_sc.line_entry.line);
-            }
-            
-            DisplayFramesForExecutionContext (thread,
-                                              interpreter,
-                                              strm,
-                                              0,    // Start at first frame
-                                              1,    // Number of frames to show
-                                              false,// Don't show the frame info since we already displayed most of it above...
-                                              !already_shown,    // Show source for the first frame
-                                              3,    // lines of source context before
-                                              3);   // lines of source context after
-        }
-        else
-        {
-            thread->DumpUsingSettingsFormat (strm, 0);
-        }
-
-        return true;
-    }
-    return false;
-}
-
-size_t
-lldb_private::DisplayThreadsInfo
-(
-    CommandInterpreter &interpreter,
-    ExecutionContext *exe_ctx,
-    CommandReturnObject &result,
-    bool only_threads_with_stop_reason,
-    bool show_source
-)
-{
-    StreamString strm;
-
-    size_t num_thread_infos_dumped = 0;
-
-    if (!exe_ctx->process)
-        return 0;
-
-    const size_t num_threads = exe_ctx->process->GetThreadList().GetSize();
-    if (num_threads > 0)
-    {
-
-        for (uint32_t i = 0; i < num_threads; i++)
-        {
-            Thread *thread = exe_ctx->process->GetThreadList().GetThreadAtIndex(i).get();
-            if (thread)
-            {
-                if (DisplayThreadInfo (interpreter,
-                                       strm,
-                                       thread,
-                                       only_threads_with_stop_reason,
-                                       show_source))
-                    ++num_thread_infos_dumped;
-            }
-        }
-    }
-
-    if (num_thread_infos_dumped > 0)
-    {
-        if (num_thread_infos_dumped < num_threads)
-            result.GetOutputStream().Printf("%u of %u threads stopped with reasons:\n", num_thread_infos_dumped, num_threads);
-
-        result.AppendMessage (strm.GetString().c_str());
-        result.SetStatus (eReturnStatusSuccessFinishNoResult);
-    }
-    return num_thread_infos_dumped;
-}
-
-
-size_t
-lldb_private::DisplayFramesForExecutionContext
-(
-    Thread *thread,
-    CommandInterpreter &interpreter,
-    Stream& strm,
-    uint32_t first_frame,
-    uint32_t num_frames,
-    bool show_frame_info,
-    uint32_t num_frames_with_source,
-    uint32_t source_lines_before,
-    uint32_t source_lines_after
-)
-{
-    if (thread == NULL)
-        return 0;
-
-    size_t num_frames_displayed = 0;
-
-    if (num_frames == 0)
-        return 0;
-    
-    thread->DumpUsingSettingsFormat (strm, num_frames > 1 ? UINT32_MAX : first_frame);
-    strm.IndentMore();
-
-    StackFrameSP frame_sp;
-    uint32_t frame_idx = 0;
-    uint32_t last_frame;
-    
-    // Don't let the last frame wrap around...
-    if (num_frames == UINT32_MAX)
-        last_frame = UINT32_MAX;
-    else
-        last_frame = first_frame + num_frames;
-    
-    for (frame_idx = first_frame; frame_idx < last_frame; ++frame_idx)
-    {
-        frame_sp = thread->GetStackFrameAtIndex (frame_idx);
-        if (frame_sp.get() == NULL)
-            break;
-
-        if (DisplayFrameForExecutionContext (thread,
-                                             frame_sp.get(),
-                                             interpreter,
-                                             strm,
-                                             show_frame_info,
-                                             num_frames_with_source > first_frame - frame_idx,
-                                             source_lines_before,
-                                             source_lines_after) == false)
-            break;
-
-        ++num_frames_displayed;
-    }
-
-    strm.IndentLess();
-    return num_frames_displayed;
-}
-
-bool
-lldb_private::DisplayFrameForExecutionContext
-(
-    Thread *thread,
-    StackFrame *frame,
-    CommandInterpreter &interpreter,
-    Stream& strm,
-    bool show_frame_info,
-    bool show_source,
-    uint32_t source_lines_before,
-    uint32_t source_lines_after
-)
-{
-    // thread and frame must be filled in prior to calling this function
-    if (thread && frame)
-    {
-        if (show_frame_info)
-        {
-            strm.Indent();
-            frame->DumpUsingSettingsFormat (&strm);
-        }
-
-        SymbolContext sc (frame->GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry));
-
-        if (show_source && sc.comp_unit && sc.line_entry.IsValid())
-        {
-            interpreter.GetDebugger().GetSourceManager().DisplaySourceLinesWithLineNumbers (
-                    sc.line_entry.file,
-                    sc.line_entry.line,
-                    3,
-                    3,
-                    "->",
-                    &strm);
-
-        }
-        return true;
-    }
-    return false;
-}
-
-
 //-------------------------------------------------------------------------
 // CommandObjectThreadBacktrace
 //-------------------------------------------------------------------------
@@ -300,7 +101,7 @@
         void
         OptionParsingStarting ()
         {
-            m_count = -1;
+            m_count = UINT32_MAX;
             m_start = 0;
         }
 
@@ -353,27 +154,21 @@
 
     virtual bool
     Execute (Args& command, CommandReturnObject &result)
-    {
-
-        bool show_frame_info = true;
-        uint32_t num_frames_with_source = 0; // Don't show any frames with source when backtracing
-        
+    {        
         result.SetStatus (eReturnStatusSuccessFinishResult);
-        
+        Stream &strm = result.GetOutputStream();
+
+        // Don't show source context when doing backtraces.
+        const uint32_t num_frames_with_source = 0;
         if (command.GetArgumentCount() == 0)
         {
             ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
             if (exe_ctx.thread)
             {
-                if (DisplayFramesForExecutionContext (exe_ctx.thread,
-                                                      m_interpreter,
-                                                      result.GetOutputStream(),
-                                                      m_options.m_start,
-                                                      m_options.m_count,
-                                                      show_frame_info,
-                                                      num_frames_with_source,
-                                                      3,
-                                                      3))
+                if (exe_ctx.thread->GetStatus (strm,
+                                               m_options.m_start,
+                                               m_options.m_count,
+                                               num_frames_with_source))
                 {
                     result.SetStatus (eReturnStatusSuccessFinishResult);
                 }
@@ -391,22 +186,15 @@
             for (uint32_t i = 0; i < num_threads; i++)
             {
                 ThreadSP thread_sp = process->GetThreadList().GetThreadAtIndex(i);
-                if (!DisplayFramesForExecutionContext (thread_sp.get(),
-                                                      m_interpreter,
-                                                      result.GetOutputStream(),
-                                                      m_options.m_start,
-                                                      m_options.m_count,
-                                                      show_frame_info,
-                                                      num_frames_with_source,
-                                                      3,
-                                                      3))
+                if (thread_sp->GetStatus (strm,
+                                          m_options.m_start,
+                                          m_options.m_count,
+                                          num_frames_with_source))
                 {
                     result.AppendErrorWithFormat ("error displaying backtrace for thread: \"0x%4.4x\"\n", i);
                     result.SetStatus (eReturnStatusFailed);
                     return false;
                 }
-                if (i < num_threads - 1)
-                    result.AppendMessage("");
             }
         }
         else
@@ -440,15 +228,10 @@
             
             for (uint32_t i = 0; i < num_args; i++)
             {
-                if (!DisplayFramesForExecutionContext (thread_sps[i].get(),
-                                                      m_interpreter,
-                                                      result.GetOutputStream(),
-                                                      m_options.m_start,
-                                                      m_options.m_count,
-                                                      show_frame_info,
-                                                      num_frames_with_source,
-                                                      3,
-                                                      3))
+                if (!thread_sps[i]->GetStatus (strm,
+                                               m_options.m_start,
+                                               m_options.m_count,
+                                               num_frames_with_source))
                 {
                     result.AppendErrorWithFormat ("error displaying backtrace for thread: \"%s\"\n", command.GetArgumentAtIndex(i));
                     result.SetStatus (eReturnStatusFailed);
@@ -1335,11 +1118,13 @@
         process->GetThreadList().SetSelectedThreadByID(new_thread->GetID());
         result.SetStatus (eReturnStatusSuccessFinishNoResult);
         
-        DisplayThreadInfo (m_interpreter,
-                           result.GetOutputStream(),
-                           new_thread,
-                           false,
-                           true);
+        const uint32_t start_frame = 0;
+        const uint32_t num_frames = 1;
+        const uint32_t num_frames_with_source = 1;
+        new_thread->GetStatus (result.GetOutputStream(), 
+                               start_frame,
+                               num_frames,
+                               num_frames_with_source);
 
         return result.Succeeded();
     }
@@ -1381,41 +1166,16 @@
         ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
         if (exe_ctx.process)
         {
-            const StateType state = exe_ctx.process->GetState();
-
-            if (StateIsStoppedState(state))
-            {
-                if (state == eStateExited)
-                {
-                    int exit_status = exe_ctx.process->GetExitStatus();
-                    const char *exit_description = exe_ctx.process->GetExitDescription();
-                    strm.Printf ("Process %d exited with status = %i (0x%8.8x) %s\n",
-                                          exe_ctx.process->GetID(),
-                                          exit_status,
-                                          exit_status,
-                                          exit_description ? exit_description : "");
-                }
-                else
-                {
-                    strm.Printf ("Process %d state is %s\n", exe_ctx.process->GetID(), StateAsCString (state));
-                    if (exe_ctx.thread == NULL)
-                        exe_ctx.thread = exe_ctx.process->GetThreadList().GetThreadAtIndex(0).get();
-                    if (exe_ctx.thread != NULL)
-                    {
-                        DisplayThreadsInfo (m_interpreter, &exe_ctx, result, false, false);
-                    }
-                    else
-                    {
-                        result.AppendError ("no valid thread found in current process");
-                        result.SetStatus (eReturnStatusFailed);
-                    }
-                }
-            }
-            else
-            {
-                result.AppendError ("process is currently running");
-                result.SetStatus (eReturnStatusFailed);
-            }
+            const bool only_threads_with_stop_reason = false;
+            const uint32_t start_frame = 0;
+            const uint32_t num_frames = 0;
+            const uint32_t num_frames_with_source = 0;
+            exe_ctx.process->GetStatus(strm);
+            exe_ctx.process->GetThreadStatus (strm, 
+                                              only_threads_with_stop_reason, 
+                                              start_frame,
+                                              num_frames,
+                                              num_frames_with_source);            
         }
         else
         {

Modified: lldb/trunk/source/Commands/CommandObjectThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.h (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.h Mon Apr 18 03:33:37 2011
@@ -29,42 +29,6 @@
 
 };
 
-
-bool
-DisplayThreadInfo (CommandInterpreter &interpreter,
-                   Stream &strm,
-                   Thread *thread,
-                   bool only_threads_with_stop_reason,
-                   bool show_source);
-
-size_t
-DisplayThreadsInfo (CommandInterpreter &interpreter,
-                    ExecutionContext *exe_ctx,
-                    CommandReturnObject &result,
-                    bool only_threads_with_stop_reason,
-                    bool show_source);
-
-size_t
-DisplayFramesForExecutionContext (Thread *thread,
-                                  CommandInterpreter &interpreter,
-                                  Stream& strm,
-                                  uint32_t first_frame,
-                                  uint32_t num_frames,
-                                  bool show_frame_info,
-                                  uint32_t num_frames_with_source,
-                                  uint32_t source_lines_before,
-                                  uint32_t source_lines_after);
-
-bool
-DisplayFrameForExecutionContext (Thread *thread,
-                                 StackFrame *frame,
-                                 CommandInterpreter &interpreter,
-                                 Stream& strm,
-                                 bool show_frame_info,
-                                 bool show_source,
-                                 uint32_t source_lines_before,
-                                 uint32_t source_lines_after);
-
 } // namespace lldb_private
 
 #endif  // liblldb_CommandObjectThread_h_

Modified: lldb/trunk/source/Core/PluginManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Core/PluginManager.cpp (original)
+++ lldb/trunk/source/Core/PluginManager.cpp Mon Apr 18 03:33:37 2011
@@ -1192,7 +1192,7 @@
         PlatformInstances::iterator pos, end = instances.end();
         for (pos = instances.begin(); pos != end; ++ pos)
         {
-            if (name_sref.equals (name))
+            if (name_sref.equals (pos->name))
                 return pos->create_callback;
         }
     }
@@ -1211,9 +1211,9 @@
         PlatformInstances::iterator pos, end = instances.end();
         for (pos = instances.begin(); pos != end; ++ pos)
         {
-            const char *plugin_name = pos->name.c_str();
-            if (name_sref.startswith(plugin_name))
-                matches.AppendString (plugin_name);
+            llvm::StringRef plugin_name (pos->name);
+            if (plugin_name.startswith(name_sref))
+                matches.AppendString (plugin_name.data());
         }
     }
     return matches.GetSize();

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Apr 18 03:33:37 2011
@@ -19,7 +19,7 @@
 //#include "../Commands/CommandObjectCall.h"
 #include "../Commands/CommandObjectDisassemble.h"
 #include "../Commands/CommandObjectExpression.h"
-#include "../Commands/CommandObjectFile.h"
+//#include "../Commands/CommandObjectFile.h"
 #include "../Commands/CommandObjectFrame.h"
 #include "../Commands/CommandObjectHelp.h"
 #include "../Commands/CommandObjectImage.h"
@@ -117,6 +117,7 @@
     HandleCommand ("command alias po       expression -o --", false, result);
     HandleCommand ("command alias up       _regexp-up", false, result);
     HandleCommand ("command alias down     _regexp-down", false, result);
+    HandleCommand ("command alias file     target create", false, result);
     
 }
 
@@ -165,7 +166,7 @@
     m_command_dict["commands"]  = CommandObjectSP (new CommandObjectMultiwordCommands (*this));
     m_command_dict["disassemble"] = CommandObjectSP (new CommandObjectDisassemble (*this));
     m_command_dict["expression"]= CommandObjectSP (new CommandObjectExpression (*this));
-    m_command_dict["file"]      = CommandObjectSP (new CommandObjectFile (*this));
+//    m_command_dict["file"]      = CommandObjectSP (new CommandObjectFile (*this));
     m_command_dict["frame"]     = CommandObjectSP (new CommandObjectMultiwordFrame (*this));
     m_command_dict["help"]      = CommandObjectSP (new CommandObjectHelp (*this));
     m_command_dict["image"]     = CommandObjectSP (new CommandObjectImage (*this));

Added: lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp?rev=129695&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp Mon Apr 18 03:33:37 2011
@@ -0,0 +1,85 @@
+//===-- OptionGroupArchitecture.cpp -----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "OptionGroupArchitecture.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+
+using namespace lldb;
+using namespace lldb_private;
+
+OptionGroupArchitecture::OptionGroupArchitecture() :
+    m_arch_str ()
+{
+}
+
+OptionGroupArchitecture::~OptionGroupArchitecture ()
+{
+}
+
+OptionDefinition g_file_option_table[] =
+{
+    { LLDB_OPT_SET_1 , false, "arch"    , 'a', required_argument, NULL, 0, eArgTypeArchitecture , "Specify the architecture for the target."},
+};
+const uint32_t k_num_file_options = sizeof(g_file_option_table)/sizeof(OptionDefinition);
+
+uint32_t
+OptionGroupArchitecture::GetNumDefinitions ()
+{
+    return k_num_file_options;
+}
+
+const OptionDefinition *
+OptionGroupArchitecture::GetDefinitions ()
+{
+    return g_file_option_table;
+}
+
+bool
+OptionGroupArchitecture::GetArchitecture (Platform *platform, ArchSpec &arch)
+{
+    if (m_arch_str.empty())
+        arch.Clear();
+    else
+        arch.SetTriple(m_arch_str.c_str(), platform);
+    return arch.IsValid();
+}
+
+
+Error
+OptionGroupArchitecture::SetOptionValue (CommandInterpreter &interpreter,
+                                 uint32_t option_idx,
+                                 const char *option_arg)
+{
+    Error error;
+    char short_option = (char) g_file_option_table[option_idx].short_option;
+
+    switch (short_option)
+    {
+        case 'a':
+            m_arch_str.assign (option_arg);
+            break;
+
+        default:
+            error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
+            break;
+    }
+
+    return error;
+}
+
+void
+OptionGroupArchitecture::OptionParsingStarting (CommandInterpreter &interpreter)
+{
+    m_arch_str.clear();
+}
+

Added: lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp?rev=129695&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp Mon Apr 18 03:33:37 2011
@@ -0,0 +1,109 @@
+//===-- OptionGroupPlatform.cpp ---------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionGroupPlatform.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Target/Platform.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+PlatformSP 
+OptionGroupPlatform::CreatePlatformWithOptions (CommandInterpreter &interpreter, bool make_selected, Error& error)
+{
+    PlatformSP platform_sp;
+    if (!m_platform_name.empty())
+    {
+        platform_sp = Platform::Create (m_platform_name.c_str(), error);
+        
+        if (platform_sp)
+        {
+            interpreter.GetDebugger().GetPlatformList().Append (platform_sp, make_selected);
+            if (m_os_version_major != UINT32_MAX)
+            {
+                platform_sp->SetOSVersion (m_os_version_major,
+                                           m_os_version_minor,
+                                           m_os_version_update);
+            }
+        }
+    }
+    return platform_sp;
+}
+
+void
+OptionGroupPlatform::OptionParsingStarting (CommandInterpreter &interpreter)
+{
+    m_platform_name.clear();
+    m_os_version_major = UINT32_MAX;
+    m_os_version_minor = UINT32_MAX;
+    m_os_version_update = UINT32_MAX;
+}
+
+static OptionDefinition
+g_option_table[] =
+{
+    { LLDB_OPT_SET_ALL, false, "platform"   , 'p', required_argument, NULL, 0, eArgTypePlatform, "Specify name of the platform to use for this target, creating the platform if necessary."},
+    { LLDB_OPT_SET_ALL, false, "sdk-version", 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." }
+};
+
+static const uint32_t k_option_table_size = sizeof(g_option_table)/sizeof (OptionDefinition);
+
+const OptionDefinition*
+OptionGroupPlatform::GetDefinitions ()
+{
+    if (m_include_platform_option)
+        return g_option_table;
+    return g_option_table + 1;
+}
+
+uint32_t
+OptionGroupPlatform::GetNumDefinitions ()
+{
+    if (m_include_platform_option)
+        return k_option_table_size;
+    return k_option_table_size - 1;
+}
+
+
+Error
+OptionGroupPlatform::SetOptionValue (CommandInterpreter &interpreter,
+                                     uint32_t option_idx,
+                                     const char *option_arg)
+{
+    Error error;
+    if (!m_include_platform_option)
+        --option_idx;
+    
+    char short_option = (char) g_option_table[option_idx].short_option;
+    
+    switch (short_option)
+    {
+        case 'p':
+            m_platform_name.assign (option_arg);
+            break;
+            
+        case 'v':
+            if (Args::StringToVersion (option_arg, 
+                                       m_os_version_major, 
+                                       m_os_version_minor, 
+                                       m_os_version_update) == option_arg)
+                error.SetErrorStringWithFormat ("invalid version string '%s'", option_arg);
+            break;
+            
+        default:
+            error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
+            break;
+    }
+    return error;
+}

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Mon Apr 18 03:33:37 2011
@@ -76,9 +76,11 @@
 
 InstructionLLVM::InstructionLLVM (const Address &addr, 
                                   AddressClass addr_class,
-                                  EDDisassemblerRef disassembler) :
+                                  EDDisassemblerRef disassembler,
+                                  bool force_raw) :
     Instruction (addr, addr_class),
-    m_disassembler (disassembler)
+    m_disassembler (disassembler),
+    m_force_raw (force_raw)
 {
 }
 
@@ -153,6 +155,9 @@
     int numTokens = -1;
     
     if (!raw)
+        raw = m_force_raw;
+
+    if (!raw)
         numTokens = EDNumTokens(m_inst);
 
     int currentOpIndex = -1;
@@ -471,9 +476,20 @@
             if (inst_address_class == eAddressClassCodeAlternateISA)
                 use_thumb = true;
         }
+        bool force_raw = false;
+        switch (m_arch.GetMachine())
+        {
+            case llvm::Triple::arm:
+            case llvm::Triple::thumb:
+                force_raw = true;
+                break;
+            default:
+                break;
+        }
         InstructionSP inst_sp (new InstructionLLVM (inst_addr, 
                                                     inst_address_class,
-                                                    use_thumb ? m_disassembler_thumb : m_disassembler));
+                                                    use_thumb ? m_disassembler_thumb : m_disassembler,
+                                                    force_raw));
 
         size_t inst_byte_size = inst_sp->Decode (*this, data, data_offset);
 

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h Mon Apr 18 03:33:37 2011
@@ -21,7 +21,8 @@
 public:
     InstructionLLVM (const lldb_private::Address &addr,
                      lldb_private::AddressClass addr_class,
-                     EDDisassemblerRef disassembler);
+                     EDDisassemblerRef disassembler,
+                     bool force_raw);
     
     virtual
     ~InstructionLLVM();
@@ -45,6 +46,7 @@
 protected:
     EDDisassemblerRef m_disassembler;
     EDInstRef m_inst;
+    bool m_force_raw;
 };
 
 

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Mon Apr 18 03:33:37 2011
@@ -156,13 +156,6 @@
             }
         }
     }
-    else
-    {
-        error.SetErrorStringWithFormat ("'%s%s%s' does not exist",
-                                        exe_file.GetDirectory().AsCString(""),
-                                        exe_file.GetDirectory() ? "/" : "",
-                                        exe_file.GetFilename().AsCString(""));
-    }
 
     return error;
 }

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Mon Apr 18 03:33:37 2011
@@ -112,9 +112,9 @@
     Platform::GetStatus (strm);
     const char *sdk_directory = GetDeviceSupportDirectoryForOSVersion();
     if (sdk_directory)
-        strm.Printf ("SDKROOT: \"%s\"\n", sdk_directory);
+        strm.Printf ("  SDK Path: \"%s\"\n", sdk_directory);
     else
-        strm.PutCString ("SDKROOT: error: unable to locate SDK\n");
+        strm.PutCString ("  SDK Path: error: unable to locate SDK\n");
 }
 
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Apr 18 03:33:37 2011
@@ -2318,6 +2318,7 @@
     case clang::Type::Builtin:                  
         switch (cast<clang::BuiltinType>(qual_type)->getKind())
         {
+        case clang::BuiltinType::UnknownAny:
         case clang::BuiltinType::Void:
         case clang::BuiltinType::NullPtr:  
             return 0;

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Mon Apr 18 03:33:37 2011
@@ -260,6 +260,7 @@
         switch (cast<clang::BuiltinType>(qual_type)->getKind())
         {
         //default: assert(0 && "Unknown builtin type!");
+        case clang::BuiltinType::UnknownAny:
         case clang::BuiltinType::Void:
             break;
 

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Mon Apr 18 03:33:37 2011
@@ -3867,6 +3867,66 @@
     return result_name;
 }
 
+void
+Process::GetStatus (Stream &strm)
+{
+    const StateType state = GetState();
+    if (StateIsStoppedState(state))
+    {
+        if (state == eStateExited)
+        {
+            int exit_status = GetExitStatus();
+            const char *exit_description = GetExitDescription();
+            strm.Printf ("Process %d exited with status = %i (0x%8.8x) %s\n",
+                          GetID(),
+                          exit_status,
+                          exit_status,
+                          exit_description ? exit_description : "");
+        }
+        else
+        {
+            if (state == eStateConnected)
+                strm.Printf ("Connected to remote target.\n");
+            else
+                strm.Printf ("Process %d %s\n", GetID(), StateAsCString (state));
+        }
+    }
+    else
+    {
+        strm.Printf ("Process %d is running.\n", GetID());
+    }
+}
+
+size_t
+Process::GetThreadStatus (Stream &strm, 
+                          bool only_threads_with_stop_reason,
+                          uint32_t start_frame, 
+                          uint32_t num_frames, 
+                          uint32_t num_frames_with_source)
+{
+    size_t num_thread_infos_dumped = 0;
+    
+    const size_t num_threads = GetThreadList().GetSize();
+    for (uint32_t i = 0; i < num_threads; i++)
+    {
+        Thread *thread = GetThreadList().GetThreadAtIndex(i).get();
+        if (thread)
+        {
+            if (only_threads_with_stop_reason)
+            {
+                if (thread->GetStopInfo().get() == NULL)
+                    continue;
+            }
+            thread->GetStatus (strm, 
+                               start_frame, 
+                               num_frames, 
+                               num_frames_with_source);
+            ++num_thread_infos_dumped;
+        }
+    }
+    return num_thread_infos_dumped;
+}
+
 //--------------------------------------------------------------
 // class Process::SettingsController
 //--------------------------------------------------------------

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Mon Apr 18 03:33:37 2011
@@ -991,3 +991,38 @@
 {
     return m_thread.GetStackFrameSPForStackFramePtr (this);
 }
+
+
+
+bool
+StackFrame::GetStatus (Stream& strm,
+                       bool show_frame_info,
+                       bool show_source,
+                       uint32_t source_lines_before,
+                       uint32_t source_lines_after)
+{
+    if (show_frame_info)
+    {
+        strm.Indent();
+        DumpUsingSettingsFormat (&strm);
+    }
+    
+    if (show_source)
+    {
+        GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry);
+    
+        if (m_sc.comp_unit && m_sc.line_entry.IsValid())
+        {
+            GetThread().GetProcess().GetTarget().GetDebugger().GetSourceManager().DisplaySourceLinesWithLineNumbers (
+                m_sc.line_entry.file,
+                m_sc.line_entry.line,
+                3,
+                3,
+                "->",
+                &strm);
+        
+        }
+    }
+    return true;
+}
+

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Mon Apr 18 03:33:37 2011
@@ -569,3 +569,46 @@
     return ret_sp;
 }
 
+size_t
+StackFrameList::GetStatus (Stream& strm,
+                           uint32_t first_frame,
+                           uint32_t num_frames,
+                           bool show_frame_info,
+                           uint32_t num_frames_with_source,
+                           uint32_t source_lines_before,
+                           uint32_t source_lines_after)
+{
+    size_t num_frames_displayed = 0;
+    
+    if (num_frames == 0)
+        return 0;
+    
+    StackFrameSP frame_sp;
+    uint32_t frame_idx = 0;
+    uint32_t last_frame;
+    
+    // Don't let the last frame wrap around...
+    if (num_frames == UINT32_MAX)
+        last_frame = UINT32_MAX;
+    else
+        last_frame = first_frame + num_frames;
+    
+    for (frame_idx = first_frame; frame_idx < last_frame; ++frame_idx)
+    {
+        frame_sp = GetFrameAtIndex(frame_idx);
+        if (frame_sp.get() == NULL)
+            break;
+        
+        if (!frame_sp->GetStatus (strm,
+                                  show_frame_info,
+                                  num_frames_with_source > first_frame - frame_idx,
+                                  source_lines_before,
+                                  source_lines_after))
+            break;
+        ++num_frames_displayed;
+    }
+    
+    strm.IndentLess();
+    return num_frames_displayed;
+}
+

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Mon Apr 18 03:33:37 2011
@@ -14,6 +14,7 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/RegularExpression.h"
+#include "lldb/Host/Host.h"
 #include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
@@ -1100,6 +1101,63 @@
     return unknown_state_string;
 }
 
+size_t
+Thread::GetStatus (Stream &strm, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source)
+{
+    size_t num_frames_shown = 0;
+    strm.Indent();
+    strm.Printf("%c ", GetProcess().GetThreadList().GetSelectedThread().get() == this ? '*' : ' ');
+
+    StackFrameSP frame_sp = GetStackFrameAtIndex(start_frame);
+    SymbolContext frame_sc(frame_sp->GetSymbolContext (eSymbolContextLineEntry));
+    if (frame_sc.line_entry.line != 0 &&
+        frame_sc.line_entry.file &&
+        GetProcess().GetTarget().GetDebugger().GetUseExternalEditor())
+    {
+        Host::OpenFileInExternalEditor (frame_sc.line_entry.file, frame_sc.line_entry.line);
+    }
+    
+    DumpUsingSettingsFormat (strm, start_frame);
+    
+    if (num_frames > 0)
+    {
+        strm.IndentMore();
+        
+        const bool show_frame_info = true;
+        const uint32_t source_lines_before = 3;
+        const uint32_t source_lines_after = 3;
+        num_frames_shown = GetStackFrameList ().GetStatus (strm, 
+                                                           start_frame, 
+                                                           num_frames, 
+                                                           show_frame_info, 
+                                                           num_frames_with_source,
+                                                           source_lines_before,
+                                                           source_lines_after);
+        strm.IndentLess();
+    }
+    return num_frames_shown;
+}
+
+size_t
+Thread::GetStackFrameStatus (Stream& strm,
+                             uint32_t first_frame,
+                             uint32_t num_frames,
+                             bool show_frame_info,
+                             uint32_t num_frames_with_source,
+                             uint32_t source_lines_before,
+                             uint32_t source_lines_after)
+{
+    return GetStackFrameList().GetStatus (strm, 
+                                          first_frame,
+                                          num_frames,
+                                          show_frame_info,
+                                          num_frames_with_source,
+                                          source_lines_before,
+                                          source_lines_after);
+}
+
+
+
 #pragma mark "Thread::SettingsController"
 //--------------------------------------------------------------
 // class Thread::SettingsController

Modified: lldb/trunk/test/abbreviation_tests/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/abbreviation_tests/TestAbbreviations.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/abbreviation_tests/TestAbbreviations.py (original)
+++ lldb/trunk/test/abbreviation_tests/TestAbbreviations.py Mon Apr 18 03:33:37 2011
@@ -23,8 +23,8 @@
 
         self.runCmd("com a alias com al")
         self.runCmd("alias gurp help")
-        self.expect("gurp file",
-                    substrs = ['Syntax: file <cmd-options> <filename>'])
+        self.expect("gurp target create",
+                    substrs = ['Syntax: target create <cmd-options> <filename>'])
         self.runCmd("com u gurp")
         self.expect("gurp",
                     COMMAND_FAILED_AS_EXPECTED, error = True,

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Mon Apr 18 03:33:37 2011
@@ -60,7 +60,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bitfields/TestBitfields.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/bitfields/TestBitfields.py Mon Apr 18 03:33:37 2011
@@ -54,7 +54,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/breakpoint_command/TestBreakpointCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_command/TestBreakpointCommand.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_command/TestBreakpointCommand.py (original)
+++ lldb/trunk/test/breakpoint_command/TestBreakpointCommand.py Mon Apr 18 03:33:37 2011
@@ -126,7 +126,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 2.

Modified: lldb/trunk/test/class_static/TestStaticVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_static/TestStaticVariables.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/class_static/TestStaticVariables.py (original)
+++ lldb/trunk/test/class_static/TestStaticVariables.py Mon Apr 18 03:33:37 2011
@@ -54,7 +54,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # On Mac OS X, gcc 4.2 emits the wrong debug info for A::g_points.

Modified: lldb/trunk/test/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/class_types/TestClassTypes.py Mon Apr 18 03:33:37 2011
@@ -80,7 +80,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.
@@ -168,7 +168,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/class_types/TestClassTypesDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypesDisassembly.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/trunk/test/class_types/TestClassTypesDisassembly.py Mon Apr 18 03:33:37 2011
@@ -56,7 +56,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # We should be stopped on the ctor function of class C.

Modified: lldb/trunk/test/conditional_break/TestConditionalBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/conditional_break/TestConditionalBreak.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/conditional_break/TestConditionalBreak.py (original)
+++ lldb/trunk/test/conditional_break/TestConditionalBreak.py Mon Apr 18 03:33:37 2011
@@ -109,7 +109,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped', 'stop reason = breakpoint'])
+            substrs = ['stopped', 'stop reason = breakpoint'])
 
         # The frame info for frame #0 points to a.out`c and its immediate caller
         # (frame #1) points to a.out`a.

Modified: lldb/trunk/test/dead-strip/TestDeadStrip.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dead-strip/TestDeadStrip.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/dead-strip/TestDeadStrip.py (original)
+++ lldb/trunk/test/dead-strip/TestDeadStrip.py Mon Apr 18 03:33:37 2011
@@ -43,7 +43,7 @@
 
         # The stop reason of the thread should be breakpoint (breakpoint #1).
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'a.out`f1',
                        'stop reason = breakpoint'])
 
@@ -55,7 +55,7 @@
 
         # The stop reason of the thread should be breakpoint (breakpoint #3).
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'a.out`f3',
                        'stop reason = breakpoint'])
 

Modified: lldb/trunk/test/enum_types/TestEnumTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/enum_types/TestEnumTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/enum_types/TestEnumTypes.py (original)
+++ lldb/trunk/test/enum_types/TestEnumTypes.py Mon Apr 18 03:33:37 2011
@@ -43,7 +43,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/forward/TestForwardDeclaration.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/forward/TestForwardDeclaration.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/forward/TestForwardDeclaration.py (original)
+++ lldb/trunk/test/forward/TestForwardDeclaration.py Mon Apr 18 03:33:37 2011
@@ -37,7 +37,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/function_types/TestFunctionTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/function_types/TestFunctionTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/function_types/TestFunctionTypes.py (original)
+++ lldb/trunk/test/function_types/TestFunctionTypes.py Mon Apr 18 03:33:37 2011
@@ -41,7 +41,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/global_variables/TestGlobalVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/global_variables/TestGlobalVariables.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/global_variables/TestGlobalVariables.py (original)
+++ lldb/trunk/test/global_variables/TestGlobalVariables.py Mon Apr 18 03:33:37 2011
@@ -41,7 +41,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py Mon Apr 18 03:33:37 2011
@@ -41,7 +41,7 @@
 
         # The stop reason of the thread should be a bad access exception.
         self.expect("thread list", STOPPED_DUE_TO_EXC_BAD_ACCESS,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = EXC_BAD_ACCESS'])
 
         # And it should report the correct line number.

Modified: lldb/trunk/test/inlined_breakpoints/TestInlinedBreakpoints.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/inlined_breakpoints/TestInlinedBreakpoints.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/inlined_breakpoints/TestInlinedBreakpoints.py (original)
+++ lldb/trunk/test/inlined_breakpoints/TestInlinedBreakpoints.py Mon Apr 18 03:33:37 2011
@@ -45,7 +45,7 @@
         # The stop reason of the thread should be breakpoint.
         # And it should break at basic_type.cpp:176.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint',
                        'basic_type.cpp:%d' % self.line])
 

Modified: lldb/trunk/test/load_unload/TestLoadUnload.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/load_unload/TestLoadUnload.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/load_unload/TestLoadUnload.py (original)
+++ lldb/trunk/test/load_unload/TestLoadUnload.py Mon Apr 18 03:33:37 2011
@@ -179,7 +179,7 @@
 
         # The stop reason of the thread should be breakpoint and at a_function.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'a_function',
                        'stop reason = breakpoint'])
 
@@ -194,7 +194,7 @@
         # rdar://problem/8508987
         # The a_function breakpoint should be encountered twice.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'a_function',
                        'stop reason = breakpoint'])
 

Modified: lldb/trunk/test/namespace/TestNamespace.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/namespace/TestNamespace.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/namespace/TestNamespace.py (original)
+++ lldb/trunk/test/namespace/TestNamespace.py Mon Apr 18 03:33:37 2011
@@ -51,7 +51,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # On Mac OS X, gcc 4.2 emits the wrong debug info with respect to types.

Modified: lldb/trunk/test/set_values/TestSetValues.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/set_values/TestSetValues.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/set_values/TestSetValues.py (original)
+++ lldb/trunk/test/set_values/TestSetValues.py Mon Apr 18 03:33:37 2011
@@ -65,7 +65,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/signal/TestSendSignal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/signal/TestSendSignal.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/signal/TestSendSignal.py (original)
+++ lldb/trunk/test/signal/TestSendSignal.py Mon Apr 18 03:33:37 2011
@@ -43,7 +43,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.

Modified: lldb/trunk/test/signed_types/TestSignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/signed_types/TestSignedTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/signed_types/TestSignedTypes.py (original)
+++ lldb/trunk/test/signed_types/TestSignedTypes.py Mon Apr 18 03:33:37 2011
@@ -44,7 +44,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped', 'stop reason = breakpoint'])
+            substrs = ['stopped', 'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.
         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,

Modified: lldb/trunk/test/source-manager/TestSourceManager.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/source-manager/TestSourceManager.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/source-manager/TestSourceManager.py (original)
+++ lldb/trunk/test/source-manager/TestSourceManager.py Mon Apr 18 03:33:37 2011
@@ -85,7 +85,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'main.c',
                        'stop reason = breakpoint'])
 

Modified: lldb/trunk/test/unique-types/TestUniqueTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/unique-types/TestUniqueTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/unique-types/TestUniqueTypes.py (original)
+++ lldb/trunk/test/unique-types/TestUniqueTypes.py Mon Apr 18 03:33:37 2011
@@ -43,7 +43,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped',
+            substrs = ['stopped',
                        'stop reason = breakpoint'])
 
         if self.getCompiler().endswith('clang'):

Modified: lldb/trunk/test/unsigned_types/TestUnsignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/unsigned_types/TestUnsignedTypes.py?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/test/unsigned_types/TestUnsignedTypes.py (original)
+++ lldb/trunk/test/unsigned_types/TestUnsignedTypes.py Mon Apr 18 03:33:37 2011
@@ -44,7 +44,7 @@
 
         # The stop reason of the thread should be breakpoint.
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['state is stopped', 'stop reason = breakpoint'])
+            substrs = ['stopped', 'stop reason = breakpoint'])
 
         # The breakpoint should have a hit count of 1.
         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=129695&r1=129694&r2=129695&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Mon Apr 18 03:33:37 2011
@@ -1121,13 +1121,13 @@
                 if (m_debugger.GetDefaultArchitecture (arch_name, sizeof (arch_name)))
                     ::snprintf (command_string, 
                                 sizeof (command_string), 
-                                "file --arch=%s '%s'", 
+                                "target create --arch=%s '%s'", 
                                 arch_name,
                                 m_option_data.m_args[0].c_str());
                 else
                     ::snprintf (command_string, 
                                 sizeof(command_string), 
-                                "file '%s'", 
+                                "target create '%s'", 
                                 m_option_data.m_args[0].c_str());
 
                 m_debugger.HandleCommand (command_string);





More information about the lldb-commits mailing list