From gclayton at apple.com Mon Apr 4 13:18:57 2011 From: gclayton at apple.com (Greg Clayton) Date: Mon, 04 Apr 2011 18:18:57 -0000 Subject: [Lldb-commits] [lldb] r128837 - in /lldb/trunk: include/lldb/Core/ lldb.xcodeproj/ source/Core/ source/Plugins/Platform/gdb-server/ source/Plugins/Process/gdb-remote/ source/Utility/ tools/lldb-platform/ Message-ID: <20110404181857.996392A6C12C@llvm.org> Author: gclayton Date: Mon Apr 4 13:18:57 2011 New Revision: 128837 URL: http://llvm.org/viewvc/llvm-project?rev=128837&view=rev Log: Added a speed test to the GDBRemoteCommunicationClient and GDBRemoteCommunicationServer classes. This involved adding a new packet named "qSpeedTest" which can test the speed of a packet send/response pairs using a wide variety of send/recv packet sizes. Added a few new connection classes: one for shared memory, and one for using mach messages (Apple only). The mach message stuff is experimental and not working yet, but added so I don't lose the code. The shared memory stuff uses pretty standard calls to setup shared memory. Added: lldb/trunk/include/lldb/Core/ConnectionMachPort.h lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h lldb/trunk/source/Core/ConnectionMachPort.cpp lldb/trunk/source/Core/ConnectionSharedMemory.cpp Modified: lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Core/DataBufferMemoryMap.cpp lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp lldb/trunk/source/Utility/StringExtractorGDBRemote.h lldb/trunk/tools/lldb-platform/lldb-platform.cpp Added: lldb/trunk/include/lldb/Core/ConnectionMachPort.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ConnectionMachPort.h?rev=128837&view=auto ============================================================================== --- lldb/trunk/include/lldb/Core/ConnectionMachPort.h (added) +++ lldb/trunk/include/lldb/Core/ConnectionMachPort.h Mon Apr 4 13:18:57 2011 @@ -0,0 +1,91 @@ +//===-- ConnectionMachPort.h --------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#if defined(__APPLE__) + +#ifndef liblldb_ConnectionMachPort_h_ +#define liblldb_ConnectionMachPort_h_ + +// C Includes +#include + +// C++ Includes +#include + +// Other libraries and framework includes +// Project includes +#include "lldb/Core/Connection.h" + +class ConnectionMachPort : + public lldb_private::Connection +{ +public: + ConnectionMachPort (); + + virtual + ~ConnectionMachPort (); + + virtual bool + IsConnected () const; + + virtual lldb::ConnectionStatus + BytesAvailable (uint32_t timeout_usec, lldb_private::Error *error_ptr); + + virtual lldb::ConnectionStatus + Connect (const char *s, lldb_private::Error *error_ptr); + + virtual lldb::ConnectionStatus + Disconnect (lldb_private::Error *error_ptr); + + virtual size_t + Read (void *dst, + size_t dst_len, + lldb::ConnectionStatus &status, + lldb_private::Error *error_ptr); + + virtual size_t + Write (const void *src, + size_t src_len, + lldb::ConnectionStatus &status, + lldb_private::Error *error_ptr); + + lldb::ConnectionStatus + BootstrapCheckIn (const char *port_name, + lldb_private::Error *error_ptr); + + lldb::ConnectionStatus + BootstrapLookup (const char *port_name, + lldb_private::Error *error_ptr); + + struct PayloadType + { + uint32_t command; + uint32_t data_length; + uint8_t data[32]; + }; + + kern_return_t + Send (const PayloadType &payload); + + kern_return_t + Receive (PayloadType &payload); + + +protected: + mach_port_t m_task; + mach_port_t m_port; + +private: + + + DISALLOW_COPY_AND_ASSIGN (ConnectionMachPort); +}; + +#endif // liblldb_ConnectionMachPort_h_ + +#endif // #if defined(__APPLE__) \ No newline at end of file Added: lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h?rev=128837&view=auto ============================================================================== --- lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h (added) +++ lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h Mon Apr 4 13:18:57 2011 @@ -0,0 +1,66 @@ +//===-- ConnectionSharedMemory.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_ConnectionSharedMemory_h_ +#define liblldb_ConnectionSharedMemory_h_ + +// C Includes +// C++ Includes +#include + +// Other libraries and framework includes +// Project includes +#include "lldb/Core/Connection.h" +#include "lldb/Core/DataBufferMemoryMap.h" + +namespace lldb_private { + +class ConnectionSharedMemory : + public Connection +{ +public: + + ConnectionSharedMemory (); + + virtual + ~ConnectionSharedMemory (); + + virtual bool + IsConnected () const; + + virtual lldb::ConnectionStatus + BytesAvailable (uint32_t timeout_usec, Error *error_ptr); + + virtual lldb::ConnectionStatus + Connect (const char *s, Error *error_ptr); + + virtual lldb::ConnectionStatus + Disconnect (Error *error_ptr); + + virtual size_t + Read (void *dst, size_t dst_len, lldb::ConnectionStatus &status, Error *error_ptr); + + virtual size_t + Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, Error *error_ptr); + + lldb::ConnectionStatus + Open (bool create, const char *name, size_t size, Error *error_ptr); + +protected: + + std::string m_name; + int m_fd; // One buffer that contains all we need + DataBufferMemoryMap m_mmap; +private: + DISALLOW_COPY_AND_ASSIGN (ConnectionSharedMemory); +}; + +} // namespace lldb_private + +#endif // liblldb_ConnectionSharedMemory_h_ Modified: lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h (original) +++ lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h Mon Apr 4 13:18:57 2011 @@ -108,7 +108,8 @@ size_t MemoryMapFromFileSpec (const FileSpec* file, off_t offset = 0, - size_t length = SIZE_MAX); + size_t length = SIZE_MAX, + bool writeable = false); //------------------------------------------------------------------ /// Memory map all or part of a file. @@ -134,7 +135,11 @@ /// The number of bytes mapped starting from the \a offset. //------------------------------------------------------------------ size_t - MemoryMapFromFileDescriptor (int fd, off_t offset = 0, size_t length = SIZE_MAX); + MemoryMapFromFileDescriptor (int fd, + off_t offset, + size_t length, + bool write, + bool fd_is_file); protected: //------------------------------------------------------------------ @@ -144,7 +149,6 @@ size_t m_mmap_size; ///< The actual number of bytes that were mapped when \c mmap() was called uint8_t *m_data; ///< The data the user requested somewhere within the memory mapped data. size_t m_size; ///< The size of the data the user got when data was requested - Error m_error; ///< An error object that describes any errors that occurred during the memory mapping process private: DISALLOW_COPY_AND_ASSIGN (DataBufferMemoryMap); Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Apr 4 13:18:57 2011 @@ -18,6 +18,8 @@ 265ABF6310F42EE900531910 /* DebugSymbols.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 265ABF6210F42EE900531910 /* DebugSymbols.framework */; }; 26651A16133BF9CD005B64B7 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 26651A15133BF9CC005B64B7 /* Opcode.h */; }; 26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26651A17133BF9DF005B64B7 /* Opcode.cpp */; }; + 266603CA1345B5A8004DA8B6 /* ConnectionSharedMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */; }; + 266603CD1345B5C0004DA8B6 /* ConnectionSharedMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 266603CC1345B5C0004DA8B6 /* ConnectionSharedMemory.h */; }; 2668020E115FD12C008E1FE4 /* lldb-defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2668020F115FD12C008E1FE4 /* lldb-enumerations.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26680214115FD12C008E1FE4 /* lldb-types.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2910F1B3BC00F91463 /* lldb-types.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -60,6 +62,8 @@ 26680336116005EF008E1FE4 /* SBBreakpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */; }; 26680337116005F1008E1FE4 /* SBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */; }; 2668035C11601108008E1FE4 /* LLDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26680207115FD0ED008E1FE4 /* LLDB.framework */; }; + 2671A0CE134825F6003A87BB /* ConnectionMachPort.h in Headers */ = {isa = PBXBuildFile; fileRef = 2671A0CD134825F6003A87BB /* ConnectionMachPort.h */; }; + 2671A0D013482601003A87BB /* ConnectionMachPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2671A0CF13482601003A87BB /* ConnectionMachPort.cpp */; }; 26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */; }; 26744EF21338317700EF765A /* GDBRemoteCommunicationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 26744EEE1338317700EF765A /* GDBRemoteCommunicationClient.h */; }; 26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */; }; @@ -635,6 +639,8 @@ 26651A14133BEC76005B64B7 /* lldb-public.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-public.h"; path = "include/lldb/lldb-public.h"; sourceTree = ""; }; 26651A15133BF9CC005B64B7 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Opcode.h; path = include/lldb/Core/Opcode.h; sourceTree = ""; }; 26651A17133BF9DF005B64B7 /* Opcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Opcode.cpp; path = source/Core/Opcode.cpp; sourceTree = ""; }; + 266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConnectionSharedMemory.cpp; path = source/Core/ConnectionSharedMemory.cpp; sourceTree = ""; }; + 266603CC1345B5C0004DA8B6 /* ConnectionSharedMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConnectionSharedMemory.h; path = include/lldb/Core/ConnectionSharedMemory.h; sourceTree = ""; }; 26680207115FD0ED008E1FE4 /* LLDB.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LLDB.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 266960591199F4230075C61A /* build-llvm.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "build-llvm.pl"; sourceTree = ""; }; 2669605A1199F4230075C61A /* build-swig-wrapper-classes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-swig-wrapper-classes.sh"; sourceTree = ""; }; @@ -649,6 +655,8 @@ 266A42D5128E3FFB0090CF7C /* ClangNamespaceDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangNamespaceDecl.cpp; path = source/Symbol/ClangNamespaceDecl.cpp; sourceTree = ""; }; 266A42D7128E40040090CF7C /* ClangNamespaceDecl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangNamespaceDecl.h; path = include/lldb/Symbol/ClangNamespaceDecl.h; sourceTree = ""; }; 266F5CBB12FC846200DFCE33 /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/Config.h; sourceTree = ""; }; + 2671A0CD134825F6003A87BB /* ConnectionMachPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConnectionMachPort.h; path = include/lldb/Core/ConnectionMachPort.h; sourceTree = ""; }; + 2671A0CF13482601003A87BB /* ConnectionMachPort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConnectionMachPort.cpp; path = source/Core/ConnectionMachPort.cpp; sourceTree = ""; }; 2672D8461189055500FF4019 /* CommandObjectFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectFrame.cpp; path = source/Commands/CommandObjectFrame.cpp; sourceTree = ""; }; 2672D8471189055500FF4019 /* CommandObjectFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectFrame.h; path = source/Commands/CommandObjectFrame.h; sourceTree = ""; }; 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationClient.cpp; sourceTree = ""; }; @@ -1796,6 +1804,10 @@ 26BC7E6F10F1B85900F91463 /* Connection.cpp */, 26BC7D5810F1B77400F91463 /* ConnectionFileDescriptor.h */, 26BC7E7010F1B85900F91463 /* ConnectionFileDescriptor.cpp */, + 2671A0CD134825F6003A87BB /* ConnectionMachPort.h */, + 2671A0CF13482601003A87BB /* ConnectionMachPort.cpp */, + 266603CC1345B5C0004DA8B6 /* ConnectionSharedMemory.h */, + 266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */, 26BC7D7C10F1B77400F91463 /* ConstString.h */, 26BC7E9410F1B85900F91463 /* ConstString.cpp */, 26BC7D5910F1B77400F91463 /* DataBuffer.h */, @@ -2528,6 +2540,8 @@ 264A97C0133918BC0017F0BE /* PlatformRemoteGDBServer.h in Headers */, 2697A54E133A6305004E4240 /* PlatformDarwin.h in Headers */, 26651A16133BF9CD005B64B7 /* Opcode.h in Headers */, + 266603CD1345B5C0004DA8B6 /* ConnectionSharedMemory.h in Headers */, + 2671A0CE134825F6003A87BB /* ConnectionMachPort.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3088,6 +3102,8 @@ 264A97BF133918BC0017F0BE /* PlatformRemoteGDBServer.cpp in Sources */, 2697A54D133A6305004E4240 /* PlatformDarwin.cpp in Sources */, 26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */, + 266603CA1345B5A8004DA8B6 /* ConnectionSharedMemory.cpp in Sources */, + 2671A0D013482601003A87BB /* ConnectionMachPort.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Added: lldb/trunk/source/Core/ConnectionMachPort.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionMachPort.cpp?rev=128837&view=auto ============================================================================== --- lldb/trunk/source/Core/ConnectionMachPort.cpp (added) +++ lldb/trunk/source/Core/ConnectionMachPort.cpp Mon Apr 4 13:18:57 2011 @@ -0,0 +1,319 @@ +//===-- ConnectionMachPort.cpp ----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#if defined(__APPLE__) + +#include "lldb/Core/ConnectionMachPort.h" + +// C Includes +#include + +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/lldb-private-log.h" +#include "lldb/Core/Communication.h" +#include "lldb/Core/Log.h" + +using namespace lldb; +using namespace lldb_private; + +struct MessageType +{ + mach_msg_header_t head; + ConnectionMachPort::PayloadType payload; +}; + + + +ConnectionMachPort::ConnectionMachPort () : + Connection(), + m_task(mach_task_self()), + m_port(MACH_PORT_TYPE_NONE) +{ +} + +ConnectionMachPort::~ConnectionMachPort () +{ + Disconnect (NULL); +} + +bool +ConnectionMachPort::IsConnected () const +{ + return m_port != MACH_PORT_TYPE_NONE; +} + +ConnectionStatus +ConnectionMachPort::Connect (const char *s, Error *error_ptr) +{ + if (IsConnected()) + { + if (error_ptr) + error_ptr->SetErrorString ("already connected"); + return eConnectionStatusError; + } + + if (s == NULL || s[0] == '\0') + { + if (error_ptr) + error_ptr->SetErrorString ("empty connect URL"); + return eConnectionStatusError; + } + + ConnectionStatus status = eConnectionStatusError; + + if (strncmp (s, "bootstrap-checkin://", strlen("bootstrap-checkin://"))) + { + s += strlen("bootstrap-checkin://"); + + if (*s) + { + status = BootstrapCheckIn (s, error_ptr); + } + else + { + if (error_ptr) + error_ptr->SetErrorString ("bootstrap port name is empty"); + } + } + else if (strncmp (s, "bootstrap-lookup://", strlen("bootstrap-lookup://"))) + { + s += strlen("bootstrap-lookup://"); + if (*s) + { + status = BootstrapLookup (s, error_ptr); + } + else + { + if (error_ptr) + error_ptr->SetErrorString ("bootstrap port name is empty"); + } + } + else + { + if (error_ptr) + error_ptr->SetErrorStringWithFormat ("unsupported connection URL: '%s'", s); + } + + + if (status == eConnectionStatusSuccess) + { + if (error_ptr) + error_ptr->Clear(); + } + else + { + Disconnect(NULL); + } + + return status; +} + +ConnectionStatus +ConnectionMachPort::BootstrapCheckIn (const char *port, Error *error_ptr) +{ + mach_port_t bootstrap_port = MACH_PORT_TYPE_NONE; + + /* Getting bootstrap server port */ + kern_return_t kret = task_get_bootstrap_port(mach_task_self(), &bootstrap_port); + if (kret == KERN_SUCCESS) + { + name_t port_name; + int len = snprintf(port_name, sizeof(port_name), "%s", port); + if (len < sizeof(port_name)) + { + kret = ::bootstrap_check_in (bootstrap_port, + port_name, + &m_port); + } + else + { + Disconnect(NULL); + if (error_ptr) + error_ptr->SetErrorString ("bootstrap is too long"); + return eConnectionStatusError; + } + } + + if (kret != KERN_SUCCESS) + { + Disconnect(NULL); + if (error_ptr) + error_ptr->SetError (kret, eErrorTypeMachKernel); + return eConnectionStatusError; + } + return eConnectionStatusSuccess; +} + +lldb::ConnectionStatus +ConnectionMachPort::BootstrapLookup (const char *port, + Error *error_ptr) +{ + name_t port_name; + + if (port && port[0]) + { + if (::snprintf (port_name, sizeof (port_name), "%s", port) >= sizeof (port_name)) + { + if (error_ptr) + error_ptr->SetErrorString ("port netname is too long"); + return eConnectionStatusError; + } + } + else + { + if (error_ptr) + error_ptr->SetErrorString ("empty port netname"); + return eConnectionStatusError; + } + + mach_port_t bootstrap_port = MACH_PORT_TYPE_NONE; + + /* Getting bootstrap server port */ + kern_return_t kret = task_get_bootstrap_port(mach_task_self(), &bootstrap_port); + if (kret == KERN_SUCCESS) + { + kret = ::bootstrap_look_up (bootstrap_port, + port_name, + &m_port); + } + + if (kret != KERN_SUCCESS) + { + if (error_ptr) + error_ptr->SetError (kret, eErrorTypeMachKernel); + return eConnectionStatusError; + } + + return eConnectionStatusSuccess; +} + +ConnectionStatus +ConnectionMachPort::Disconnect (Error *error_ptr) +{ + kern_return_t kret; + + // TODO: verify if we need to netname_check_out for + // either or both + if (m_port != MACH_PORT_TYPE_NONE) + { + kret = ::mach_port_deallocate (m_task, m_port); + if (error_ptr) + error_ptr->SetError (kret, eErrorTypeMachKernel); + m_port = MACH_PORT_TYPE_NONE; + } + + return eConnectionStatusSuccess; +} + +size_t +ConnectionMachPort::Read (void *dst, size_t dst_len, ConnectionStatus &status, Error *error_ptr) +{ + PayloadType payload; + + kern_return_t kret = Receive (payload); + if (kret == KERN_SUCCESS) + { + memcpy (dst, payload.data, payload.data_length); + status = eConnectionStatusSuccess; + return payload.data_length; + } + + if (error_ptr) + error_ptr->SetError (kret, eErrorTypeMachKernel); + status = eConnectionStatusError; + return 0; +} + +size_t +ConnectionMachPort::Write (const void *src, size_t src_len, ConnectionStatus &status, Error *error_ptr) +{ + PayloadType payload; + payload.command = 0; + payload.data_length = src_len; + const size_t max_payload_size = sizeof(payload.data); + if (src_len > max_payload_size) + payload.data_length = max_payload_size; + memcpy (payload.data, src, payload.data_length); + + if (Send (payload) == KERN_SUCCESS) + { + status = eConnectionStatusSuccess; + return payload.data_length; + } + status = eConnectionStatusError; + return 0; +} + +ConnectionStatus +ConnectionMachPort::BytesAvailable (uint32_t timeout_usec, Error *error_ptr) +{ + return eConnectionStatusLostConnection; +} + +kern_return_t +ConnectionMachPort::Send (const PayloadType &payload) +{ + struct MessageType message; + + /* (i) Form the message : */ + + /* (i.a) Fill the header fields : */ + message.head.msgh_bits = MACH_MSGH_BITS_REMOTE (MACH_MSG_TYPE_MAKE_SEND) | + MACH_MSGH_BITS_OTHER (MACH_MSGH_BITS_COMPLEX); + message.head.msgh_size = sizeof(MessageType); + message.head.msgh_local_port = MACH_PORT_NULL; + message.head.msgh_remote_port = m_port; + + /* (i.b) Explain the message type ( an integer ) */ + // message.type.msgt_name = MACH_MSG_TYPE_INTEGER_32; + // message.type.msgt_size = 32; + // message.type.msgt_number = 1; + // message.type.msgt_inline = TRUE; + // message.type.msgt_longform = FALSE; + // message.type.msgt_deallocate = FALSE; + /* message.type.msgt_unused = 0; */ /* not needed, I think */ + + /* (i.c) Fill the message with the given integer : */ + message.payload = payload; + + /* (ii) Send the message : */ + kern_return_t kret = ::mach_msg (&message.head, + MACH_SEND_MSG, + message.head.msgh_size, + 0, + MACH_PORT_NULL, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL); + + return kret; +} + +kern_return_t +ConnectionMachPort::Receive (PayloadType &payload) +{ + MessageType message; + message.head.msgh_size = sizeof(MessageType); + + kern_return_t kret = ::mach_msg (&message.head, + MACH_RCV_MSG, + 0, + sizeof(MessageType), + m_port, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL); + + if (kret == KERN_SUCCESS) + payload = message.payload; + + return kret; +} + + +#endif // #if defined(__APPLE__) Added: lldb/trunk/source/Core/ConnectionSharedMemory.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionSharedMemory.cpp?rev=128837&view=auto ============================================================================== --- lldb/trunk/source/Core/ConnectionSharedMemory.cpp (added) +++ lldb/trunk/source/Core/ConnectionSharedMemory.cpp Mon Apr 4 13:18:57 2011 @@ -0,0 +1,127 @@ +//===-- ConnectionSharedMemory.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/Core/ConnectionSharedMemory.h" + +// C Includes +#include +#include +#include +#include +#include +#include +#include + +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/lldb-private-log.h" +#include "lldb/Core/Communication.h" +#include "lldb/Core/Log.h" + +using namespace lldb; +using namespace lldb_private; + +ConnectionSharedMemory::ConnectionSharedMemory () : + Connection(), + m_name(), + m_fd (-1), + m_mmap() +{ +} + +ConnectionSharedMemory::~ConnectionSharedMemory () +{ + Disconnect (NULL); +} + +bool +ConnectionSharedMemory::IsConnected () const +{ + return m_fd >= 0; +} + +ConnectionStatus +ConnectionSharedMemory::Connect (const char *s, Error *error_ptr) +{ +// if (s && s[0]) +// { +// if (strstr(s, "shm-create://")) +// { +// } +// else if (strstr(s, "shm-connect://")) +// { +// } +// if (error_ptr) +// error_ptr->SetErrorStringWithFormat ("unsupported connection URL: '%s'", s); +// return eConnectionStatusError; +// } + if (error_ptr) + error_ptr->SetErrorString("invalid connect arguments"); + return eConnectionStatusError; +} + +ConnectionStatus +ConnectionSharedMemory::Disconnect (Error *error_ptr) +{ + m_mmap.Clear(); + if (!m_name.empty()) + { + shm_unlink (m_name.c_str()); + m_name.clear(); + } + return eConnectionStatusSuccess; +} + +size_t +ConnectionSharedMemory::Read (void *dst, size_t dst_len, ConnectionStatus &status, Error *error_ptr) +{ + status = eConnectionStatusSuccess; + return 0; +} + +size_t +ConnectionSharedMemory::Write (const void *src, size_t src_len, ConnectionStatus &status, Error *error_ptr) +{ + status = eConnectionStatusSuccess; + return 0; +} + +ConnectionStatus +ConnectionSharedMemory::BytesAvailable (uint32_t timeout_usec, Error *error_ptr) +{ + return eConnectionStatusLostConnection; +} + +ConnectionStatus +ConnectionSharedMemory::Open (bool create, const char *name, size_t size, Error *error_ptr) +{ + if (m_fd != -1) + { + if (error_ptr) + error_ptr->SetErrorString("already open"); + return eConnectionStatusError; + } + + m_name.assign (name); + int oflag = O_RDWR; + if (create) + oflag |= O_CREAT; + m_fd = ::shm_open (m_name.c_str(), oflag, S_IRUSR|S_IWUSR); + + if (create) + ::ftruncate (m_fd, size); + + if (m_mmap.MemoryMapFromFileDescriptor(m_fd, 0, size, true, false) == size) + return eConnectionStatusSuccess; + + Disconnect(NULL); + return eConnectionStatusError; +} + Modified: lldb/trunk/source/Core/DataBufferMemoryMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferMemoryMap.cpp?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Core/DataBufferMemoryMap.cpp (original) +++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp Mon Apr 4 13:18:57 2011 @@ -27,8 +27,7 @@ m_mmap_addr(NULL), m_mmap_size(0), m_data(NULL), - m_size(0), - m_error() + m_size(0) { } @@ -85,14 +84,6 @@ m_data = NULL; m_size = 0; } - m_error.Clear(); -} - - -const Error & -DataBufferMemoryMap::GetError() const -{ - return m_error; } //---------------------------------------------------------------------- @@ -104,23 +95,33 @@ // offset. //---------------------------------------------------------------------- size_t -DataBufferMemoryMap::MemoryMapFromFileSpec (const FileSpec* file, off_t offset, size_t length) +DataBufferMemoryMap::MemoryMapFromFileSpec (const FileSpec* file, + off_t offset, + size_t length, + bool writeable) { if (file != NULL) { char path[PATH_MAX]; if (file->GetPath(path, sizeof(path))) { - int fd = ::open(path, O_RDONLY, 0); + int oflag = 0; + if (writeable) + oflag = O_RDWR; + else + oflag = O_RDONLY; + + int fd = ::open(path, oflag, 0); if (fd >= 0) { - MemoryMapFromFileDescriptor (fd, offset, length); + const bool fd_is_file = true; + MemoryMapFromFileDescriptor (fd, offset, length, writeable, fd_is_file); ::close(fd); return GetByteSize(); } else { - m_error.SetErrorToErrno(); + //error.SetErrorToErrno(); return 0; } } @@ -144,7 +145,11 @@ // Number of bytes mapped starting from the requested offset. //---------------------------------------------------------------------- size_t -DataBufferMemoryMap::MemoryMapFromFileDescriptor (int fd, off_t offset, size_t length) +DataBufferMemoryMap::MemoryMapFromFileDescriptor (int fd, + off_t offset, + size_t length, + bool writeable, + bool fd_is_file) { Clear(); if (fd >= 0) @@ -167,18 +172,27 @@ if (length > 0) { - m_mmap_addr = (uint8_t *)::mmap(NULL, length, PROT_READ, MAP_FILE | MAP_SHARED, fd, offset); + int prot = PROT_READ; + if (writeable) + prot |= PROT_WRITE; + + int flags = MAP_SHARED; + if (fd_is_file) + flags |= MAP_FILE; + + m_mmap_addr = (uint8_t *)::mmap(NULL, length, prot, flags, fd, offset); if (m_mmap_addr == (void*)-1) { - m_error.SetErrorToErrno (); - if (m_error.GetError() == EINVAL) + Error error; + error.SetErrorToErrno (); + if (error.GetError() == EINVAL) { // We may still have a shot at memory mapping if we align things correctly size_t page_offset = offset % Host::GetPageSize(); if (page_offset != 0) { - m_mmap_addr = (uint8_t *)::mmap(NULL, length + page_offset, PROT_READ, MAP_FILE | MAP_SHARED, fd, offset - page_offset); + m_mmap_addr = (uint8_t *)::mmap(NULL, length + page_offset, prot, flags, fd, offset - page_offset); if (m_mmap_addr == (void*)-1) { // Failed to map file @@ -188,7 +202,6 @@ { // We recovered and were able to memory map // after we aligned things to page boundaries - m_error.Clear (); // Save the actual mmap'ed size m_mmap_size = length + page_offset; Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original) +++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Mon Apr 4 13:18:57 2011 @@ -201,6 +201,9 @@ { m_gdb_client.QueryNoAckModeSupported(); m_gdb_client.GetHostInfo(); +#if 0 + m_gdb_client.TestPacketSpeed(10000); +#endif } else { Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Mon Apr 4 13:18:57 2011 @@ -765,9 +765,9 @@ bool -GDBRemoteCommunicationClient::GetHostInfo () +GDBRemoteCommunicationClient::GetHostInfo (bool force) { - if (m_qHostInfo_is_valid == eLazyBoolCalculate) + if (force || m_qHostInfo_is_valid == eLazyBoolCalculate) { m_qHostInfo_is_valid = eLazyBoolNo; StringExtractorGDBRemote response; @@ -1363,5 +1363,87 @@ } } return false; +} + +void +GDBRemoteCommunicationClient::TestPacketSpeed (const uint32_t num_packets) +{ + uint32_t i; + TimeValue start_time, end_time; + uint64_t total_time_nsec; + float packets_per_second; + if (SendSpeedTestPacket (0, 0)) + { + for (uint32_t send_size = 0; send_size <= 1024; send_size *= 2) + { + for (uint32_t recv_size = 0; recv_size <= 1024; recv_size *= 2) + { + start_time = TimeValue::Now(); + for (i=0; i 0) + { + if (bytes_left >= 26) + { + packet.PutCString("abcdefghijklmnopqrstuvwxyz"); + bytes_left -= 26; + } + else + { + packet.Printf ("%*.*s;", bytes_left, bytes_left, "abcdefghijklmnopqrstuvwxyz"); + bytes_left = 0; + } + } + StringExtractorGDBRemote response; + if (SendPacketAndWaitForResponse (packet.GetData(), packet.GetSize(), response, false)) + { + if (response.IsUnsupportedResponse()) + return false; + return true; + } + return false; } Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Mon Apr 4 13:18:57 2011 @@ -190,7 +190,7 @@ ResetDiscoverableSettings(); bool - GetHostInfo (); + GetHostInfo (bool force = false); bool GetOSVersion (uint32_t &major, @@ -246,6 +246,17 @@ return old_packet_timeout; } + void + TestPacketSpeed (const uint32_t num_packets); + + // This packet is for testing the speed of the interface only. Both + // the client and server need to support it, but this allows us to + // measure the packet speed without any other work being done on the + // other end and avoids any of that work affecting the packet send + // and response times. + bool + SendSpeedTestPacket (uint32_t send_size, + uint32_t recv_size); protected: //------------------------------------------------------------------ Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Mon Apr 4 13:18:57 2011 @@ -117,6 +117,8 @@ case StringExtractorGDBRemote::eServerPacketType_qGroupName: return Handle_qGroupName (packet); + case StringExtractorGDBRemote::eServerPacketType_qSpeedTest: + return Handle_qSpeedTest (packet); case StringExtractorGDBRemote::eServerPacketType_QStartNoAckMode: return Handle_QStartNoAckMode (packet); } @@ -429,6 +431,42 @@ } bool +GDBRemoteCommunicationServer::Handle_qSpeedTest (StringExtractorGDBRemote &packet) +{ + packet.SetFilePos(strlen ("qSpeedTest:")); + + std::string key; + std::string value; + bool success = packet.GetNameColonValue(key, value); + if (success && key.compare("response_size") == 0) + { + uint32_t response_size = Args::StringToUInt32(value.c_str(), 0, 0, &success); + if (success) + { + if (response_size == 0) + return SendOKResponse(); + StreamString response; + uint32_t bytes_left = response_size; + response.PutCString("data:"); + while (bytes_left > 0) + { + if (bytes_left >= 26) + { + response.PutCString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + bytes_left -= 26; + } + else + { + response.Printf ("%*.*s;", bytes_left, bytes_left, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + bytes_left = 0; + } + } + return SendPacket (response); + } + } + return SendErrorResponse (7); +} +bool GDBRemoteCommunicationServer::Handle_QStartNoAckMode (StringExtractorGDBRemote &packet) { // Send response first before changing m_send_acks to we ack this packet Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h Mon Apr 4 13:18:57 2011 @@ -86,6 +86,9 @@ Handle_qGroupName (StringExtractorGDBRemote &packet); bool + Handle_qSpeedTest (StringExtractorGDBRemote &packet); + + bool Handle_QStartNoAckMode (StringExtractorGDBRemote &packet); private: Modified: lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp (original) +++ lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp Mon Apr 4 13:18:57 2011 @@ -81,7 +81,9 @@ break; case 'q': - if (packet_cstr[1] == 'H' && 0 == ::strcmp (packet_cstr, "qHostInfo")) + if (packet_cstr[1] == 'S' && 0 == ::strncmp(packet_cstr, "qSpeedTest:", strlen("qSpeedTest:"))) + return eServerPacketType_qSpeedTest; + else if (packet_cstr[1] == 'H' && 0 == ::strcmp (packet_cstr, "qHostInfo")) return eServerPacketType_qHostInfo; else if (packet_cstr[1] == 'P' && 0 == ::strncmp(packet_cstr, "qProcessInfoPID:", strlen("qProcessInfoPID:"))) return eServerPacketType_qProcessInfoPID; Modified: lldb/trunk/source/Utility/StringExtractorGDBRemote.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractorGDBRemote.h?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/source/Utility/StringExtractorGDBRemote.h (original) +++ lldb/trunk/source/Utility/StringExtractorGDBRemote.h Mon Apr 4 13:18:57 2011 @@ -52,6 +52,7 @@ eServerPacketType_qsProcessInfo, eServerPacketType_qUserName, eServerPacketType_qGroupName, + eServerPacketType_qSpeedTest, eServerPacketType_QStartNoAckMode }; Modified: lldb/trunk/tools/lldb-platform/lldb-platform.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/lldb-platform.cpp?rev=128837&r1=128836&r2=128837&view=diff ============================================================================== --- lldb/trunk/tools/lldb-platform/lldb-platform.cpp (original) +++ lldb/trunk/tools/lldb-platform/lldb-platform.cpp Mon Apr 4 13:18:57 2011 @@ -21,6 +21,7 @@ // Other libraries and framework includes #include "lldb/Core/Error.h" #include "lldb/Core/ConnectionFileDescriptor.h" +#include "lldb/Core/ConnectionMachPort.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/StreamFile.h" #include "GDBRemoteCommunicationServer.h" @@ -70,11 +71,50 @@ int long_option_index = 0; StreamSP log_stream_sp; Args log_args; + Error error; std::string listen_host_post; char ch; Debugger::Initialize(); - +// ConnectionMachPort a; +// ConnectionMachPort b; +// +// lldb::ConnectionStatus status; +// const char *bootstrap_service_name = "HelloWorld"; +// status = a.BootstrapCheckIn(bootstrap_service_name, &error); +// +// if (status != eConnectionStatusSuccess) +// { +// fprintf(stderr, "%s", error.AsCString()); +// return 1; +// } +// status = b.BootstrapLookup (bootstrap_service_name, &error); +// if (status != eConnectionStatusSuccess) +// { +// fprintf(stderr, "%s", error.AsCString()); +// return 2; +// } +// +// if (a.Write ("hello", 5, status, &error) == 5) +// { +// char buf[32]; +// memset(buf, 0, sizeof(buf)); +// if (b.Read (buf, 5, status, &error)) +// { +// printf("read returned bytes: %s", buf); +// } +// else +// { +// fprintf(stderr, "%s", error.AsCString()); +// return 4; +// } +// } +// else +// { +// fprintf(stderr, "%s", error.AsCString()); +// return 3; +// } + while ((ch = getopt_long(argc, argv, "l:f:L:", g_long_options, &long_option_index)) != -1) { // DNBLogDebug("option: ch == %c (0x%2.2x) --%s%c%s\n", @@ -141,7 +181,6 @@ GDBRemoteCommunicationServer gdb_server; - Error error; if (!listen_host_post.empty()) { std::auto_ptr conn_ap(new ConnectionFileDescriptor()); From ctice at apple.com Tue Apr 5 13:46:00 2011 From: ctice at apple.com (Caroline Tice) Date: Tue, 05 Apr 2011 18:46:00 -0000 Subject: [Lldb-commits] [lldb] r128907 - in /lldb/trunk: include/lldb/Core/EmulateInstruction.h source/Core/Disassembler.cpp source/Core/EmulateInstruction.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp source/Plugins/Instruction/ARM/EmulateInstructionARM.h source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp source/lldb.cpp Message-ID: <20110405184600.D47512A6C12C@llvm.org> Author: ctice Date: Tue Apr 5 13:46:00 2011 New Revision: 128907 URL: http://llvm.org/viewvc/llvm-project?rev=128907&view=rev Log: Add the rest of the mechanisms to make ARM instruction emulation usable/possible. Modified: lldb/trunk/include/lldb/Core/EmulateInstruction.h lldb/trunk/source/Core/Disassembler.cpp lldb/trunk/source/Core/EmulateInstruction.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp lldb/trunk/source/lldb.cpp Modified: lldb/trunk/include/lldb/Core/EmulateInstruction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/EmulateInstruction.h?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/EmulateInstruction.h (original) +++ lldb/trunk/include/lldb/Core/EmulateInstruction.h Tue Apr 5 13:46:00 2011 @@ -10,7 +10,10 @@ #ifndef lldb_EmulateInstruction_h_ #define lldb_EmulateInstruction_h_ +#include + #include "lldb/lldb-public.h" +#include "lldb/Core/ArchSpec.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/Opcode.h" @@ -354,6 +357,9 @@ }; + static void + PrintContext (const char *context_type, const Context &context); + typedef size_t (*ReadMemory) (void *baton, const Context &context, lldb::addr_t addr, @@ -379,11 +385,16 @@ EmulateInstruction (lldb::ByteOrder byte_order, uint32_t addr_byte_size, + const ArchSpec &arch, void *baton, ReadMemory read_mem_callback, WriteMemory write_mem_callback, ReadRegister read_reg_callback, WriteRegister write_reg_callback); + + EmulateInstruction (lldb::ByteOrder byte_order, + uint32_t addr_byte_size, + const ArchSpec &arch); virtual ~EmulateInstruction() { @@ -396,8 +407,14 @@ ReadInstruction () = 0; virtual bool + SetInstruction (const Opcode &insn_opcode, const Address &inst_addr) = 0; + + virtual bool EvaluateInstruction () = 0; + static void + TranslateRegister (uint32_t reg_kind, uint32_t reg_num, std::string ®_name); + uint64_t ReadRegisterUnsigned (uint32_t reg_kind, uint32_t reg_num, @@ -441,9 +458,89 @@ return m_opcode; } + + static size_t + ReadMemoryProcess (void *baton, + const Context &context, + lldb::addr_t addr, + void *dst, + size_t length); + + static size_t + WriteMemoryProcess (void *baton, + const Context &context, + lldb::addr_t addr, + const void *dst, + size_t length); + + static bool + ReadRegisterProcess (void *baton, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t ®_value); + + + static bool + WriteRegisterProcess (void *baton, + const Context &context, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t reg_value); + + static size_t + ReadMemoryDefault (void *baton, + const Context &context, + lldb::addr_t addr, + void *dst, + size_t length); + + static size_t + WriteMemoryDefault (void *baton, + const Context &context, + lldb::addr_t addr, + const void *dst, + size_t length); + + static bool + ReadRegisterDefault (void *baton, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t ®_value); + + + static bool + WriteRegisterDefault (void *baton, + const Context &context, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t reg_value); + + void + SetBaton (void *baton); + + void + SetCallbacks (ReadMemory read_mem_callback, + WriteMemory write_mem_callback, + ReadRegister read_reg_callback, + WriteRegister write_reg_callback); + + void + SetReadMemCallback (ReadMemory read_mem_callback); + + void + SetWriteMemCallback (WriteMemory write_mem_callback); + + void + SetReadRegCallback (ReadRegister read_reg_callback); + + void + SetWriteRegCallback (WriteRegister write_reg_callback); + + protected: lldb::ByteOrder m_byte_order; uint32_t m_addr_byte_size; + ArchSpec m_arch; void * m_baton; ReadMemory m_read_mem_callback; WriteMemory m_write_mem_callback; Modified: lldb/trunk/source/Core/Disassembler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/Core/Disassembler.cpp (original) +++ lldb/trunk/source/Core/Disassembler.cpp Tue Apr 5 13:46:00 2011 @@ -18,6 +18,7 @@ #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/EmulateInstruction.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Timer.h" Modified: lldb/trunk/source/Core/EmulateInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/Core/EmulateInstruction.cpp (original) +++ lldb/trunk/source/Core/EmulateInstruction.cpp Tue Apr 5 13:46:00 2011 @@ -9,10 +9,18 @@ #include "lldb/Core/EmulateInstruction.h" +#include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" +#include "lldb/Core/Error.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/StreamString.h" #include "lldb/Host/Endian.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/RegisterContext.h" +#include "lldb/Target/Thread.h" + +#include "Plugins/Instruction/ARM/EmulateInstructionARM.h" + using namespace lldb; using namespace lldb_private; @@ -25,18 +33,18 @@ create_callback = PluginManager::GetEmulateInstructionCreateCallbackForPluginName (plugin_name); if (create_callback) { - std::auto_ptr instance_ap(create_callback(arch)); - if (instance_ap.get()) - return instance_ap.release(); + EmulateInstruction *emulate_insn_ptr = create_callback(arch); + if (emulate_insn_ptr) + return emulate_insn_ptr; } } else { for (uint32_t idx = 0; (create_callback = PluginManager::GetEmulateInstructionCreateCallbackAtIndex(idx)) != NULL; ++idx) { - std::auto_ptr instance_ap(create_callback(arch)); - if (instance_ap.get()) - return instance_ap.release(); + EmulateInstruction *emulate_insn_ptr = create_callback(arch); + if (emulate_insn_ptr) + return emulate_insn_ptr; } } return NULL; @@ -46,6 +54,7 @@ ( lldb::ByteOrder byte_order, uint32_t addr_byte_size, + const ArchSpec &arch, void *baton, ReadMemory read_mem_callback, WriteMemory write_mem_callback, @@ -53,7 +62,8 @@ WriteRegister write_reg_callback ) : m_byte_order (endian::InlHostByteOrder()), - m_addr_byte_size (sizeof (void *)), + m_addr_byte_size (addr_byte_size), + m_arch (arch), m_baton (baton), m_read_mem_callback (read_mem_callback), m_write_mem_callback (write_mem_callback), @@ -64,6 +74,25 @@ { } +EmulateInstruction::EmulateInstruction +( + lldb::ByteOrder byte_order, + uint32_t addr_byte_size, + const ArchSpec &arch +) : + m_byte_order (endian::InlHostByteOrder()), + m_addr_byte_size (addr_byte_size), + m_arch (arch), + m_baton (NULL), + m_read_mem_callback (&ReadMemoryDefault), + m_write_mem_callback (&WriteMemoryDefault), + m_read_reg_callback (&ReadRegisterDefault), + m_write_reg_callback (&WriteRegisterDefault), + m_opcode_pc (LLDB_INVALID_ADDRESS) +{ + ::memset (&m_opcode, 0, sizeof (m_opcode)); +} + uint64_t EmulateInstruction::ReadRegisterUnsigned (uint32_t reg_kind, uint32_t reg_num, uint64_t fail_value, bool *success_ptr) { @@ -123,3 +152,489 @@ return true; return false; } + + +void +EmulateInstruction::SetBaton (void *baton) +{ + m_baton = baton; +} + +void +EmulateInstruction::SetCallbacks (ReadMemory read_mem_callback, + WriteMemory write_mem_callback, + ReadRegister read_reg_callback, + WriteRegister write_reg_callback) +{ + m_read_mem_callback = read_mem_callback; + m_write_mem_callback = write_mem_callback; + m_read_reg_callback = read_reg_callback; + m_write_reg_callback = write_reg_callback; +} + +void +EmulateInstruction::SetReadMemCallback (ReadMemory read_mem_callback) +{ + m_read_mem_callback = read_mem_callback; +} + + +void +EmulateInstruction::SetWriteMemCallback (WriteMemory write_mem_callback) +{ + m_write_mem_callback = write_mem_callback; +} + + +void +EmulateInstruction::SetReadRegCallback (ReadRegister read_reg_callback) +{ + m_read_reg_callback = read_reg_callback; +} + + +void +EmulateInstruction::SetWriteRegCallback (WriteRegister write_reg_callback) +{ + m_write_reg_callback = write_reg_callback; +} + + + +// +// Read & Write Memory and Registers callback functions. +// + +size_t +EmulateInstruction::ReadMemoryProcess (void *baton, + const Context &context, + lldb::addr_t addr, + void *dst, + size_t length) +{ + Process *process = (Process *) baton; + + if (!process) + return 0; + + DataBufferSP data_sp (new DataBufferHeap (length, '\0')); + Error error; + + size_t bytes_read = process->ReadMemory (addr, data_sp->GetBytes(), data_sp->GetByteSize(), error); + + if (bytes_read > 0) + ((DataBufferHeap *) data_sp.get())->CopyData (dst, length); + + return bytes_read; +} + +size_t +EmulateInstruction::WriteMemoryProcess (void *baton, + const Context &context, + lldb::addr_t addr, + const void *dst, + size_t length) +{ + Process *process = (Process *) baton; + + if (!process) + return 0; + + lldb::DataBufferSP data_sp (new DataBufferHeap (dst, length)); + if (data_sp) + { + length = data_sp->GetByteSize(); + if (length > 0) + { + Error error; + size_t bytes_written = process->WriteMemory (addr, data_sp->GetBytes(), length, error); + + return bytes_written; + } + } + + return 0; +} + +bool +EmulateInstruction::ReadRegisterProcess (void *baton, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t ®_value) +{ + Process *process = (Process *) baton; + if (!process) + return false; + + Thread *thread = process->CalculateThread (); + RegisterContext *reg_context = thread->GetRegisterContext().get(); + Scalar value; + + + if (reg_context->ReadRegisterValue (reg_num, value)) + { + reg_value = value.GetRawBits64 (0); + return true; + } + + return false; +} + +bool +EmulateInstruction::WriteRegisterProcess (void *baton, + const Context &context, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t reg_value) +{ + Process *process = (Process *) baton; + Thread *thread = process->CalculateThread (); + RegisterContext *reg_context = thread->GetRegisterContext().get(); + Scalar value (reg_value); + + return reg_context->WriteRegisterValue (reg_num, value); +} + +size_t +EmulateInstruction::ReadMemoryDefault (void *baton, + const Context &context, + lldb::addr_t addr, + void *dst, + size_t length) +{ + PrintContext ("Read from memory", context); + fprintf (stdout, " Read from Memory (address = %p, length = %d)\n",(void *) addr, (uint) length); + + *((uint64_t *) dst) = 0xdeadbeef; + return length; +} + +size_t +EmulateInstruction::WriteMemoryDefault (void *baton, + const Context &context, + lldb::addr_t addr, + const void *dst, + size_t length) +{ + PrintContext ("Write to memory", context); + fprintf (stdout, " Write to Memory (address = %p, length = %d)\n", (void *) addr, (uint) length); + return length; +} + +bool +EmulateInstruction::ReadRegisterDefault (void *baton, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t ®_value) +{ + std::string reg_name; + TranslateRegister (reg_kind, reg_num, reg_name); + fprintf (stdout, " Read Register (%s)\n", reg_name.c_str()); + + reg_value = 24; + return true; +} + +bool +EmulateInstruction::WriteRegisterDefault (void *baton, + const Context &context, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t reg_value) +{ + PrintContext ("Write to register", context); + std::string reg_name; + TranslateRegister (reg_kind, reg_num, reg_name); + fprintf (stdout, " Write to Register (%s), value = 0x%llx\n", reg_name.c_str(), reg_value); + return true; +} + +void +EmulateInstruction::PrintContext (const char *context_type, const Context &context) +{ + switch (context.type) + { + case eContextReadOpcode: + fprintf (stdout, " %s context: Reading an Opcode\n", context_type); + break; + + case eContextImmediate: + fprintf (stdout, " %s context: Immediate\n", context_type); + break; + + case eContextPushRegisterOnStack: + fprintf (stdout, " %s context: Pushing a register onto the stack.\n", context_type); + break; + + case eContextPopRegisterOffStack: + fprintf (stdout, " %s context: Popping a register off the stack.\n", context_type); + break; + + case eContextAdjustStackPointer: + fprintf (stdout, " %s context: Adjusting the stack pointer.\n", context_type); + break; + + case eContextAdjustBaseRegister: + fprintf (stdout, " %s context: Adjusting (writing value back to) a base register.\n", context_type); + break; + + case eContextRegisterPlusOffset: + fprintf (stdout, " %s context: Register plus offset\n", context_type); + break; + + case eContextRegisterStore: + fprintf (stdout, " %s context: Storing a register.\n", context_type); + break; + + case eContextRegisterLoad: + fprintf (stdout, " %s context: Loading a register.\n", context_type); + break; + + case eContextRelativeBranchImmediate: + fprintf (stdout, " %s context: Relative branch immediate\n", context_type); + break; + + case eContextAbsoluteBranchRegister: + fprintf (stdout, " %s context: Absolute branch register\n", context_type); + break; + + case eContextSupervisorCall: + fprintf (stdout, " %s context: Performing a supervisor call.\n", context_type); + break; + + case eContextTableBranchReadMemory: + fprintf (stdout, " %s context: Table branch read memory\n", context_type); + break; + + case eContextWriteRegisterRandomBits: + fprintf (stdout, " %s context: Write random bits to a register\n", context_type); + break; + + case eContextWriteMemoryRandomBits: + fprintf (stdout, " %s context: Write random bits to a memory address\n", context_type); + break; + + case eContextMultiplication: + fprintf (stdout, " %s context: Performing a multiplication\n", context_type); + break; + + case eContextAddition: + fprintf (stdout, " %s context: Performing an addition\n", context_type); + break; + + case eContextReturnFromException: + fprintf (stdout, " %s context: Returning from an exception\n", context_type); + break; + + default: + fprintf (stdout, " %s context: Unrecognized context.\n", context_type); + break; + } + + switch (context.info_type) + { + case eInfoTypeRegisterPlusOffset: + { + std::string reg_name; + TranslateRegister (context.info.RegisterPlusOffset.reg.kind, + context.info.RegisterPlusOffset.reg.num, + reg_name); + fprintf (stdout, " Info type: Register plus offset (%s +/- %lld)\n", reg_name.c_str(), + context.info.RegisterPlusOffset.signed_offset); + } + break; + case eInfoTypeRegisterPlusIndirectOffset: + { + std::string base_reg_name; + std::string offset_reg_name; + TranslateRegister (context.info.RegisterPlusIndirectOffset.base_reg.kind, + context.info.RegisterPlusIndirectOffset.base_reg.num, + base_reg_name); + TranslateRegister (context.info.RegisterPlusIndirectOffset.offset_reg.kind, + context.info.RegisterPlusIndirectOffset.offset_reg.num, + offset_reg_name); + fprintf (stdout, " Info type: Register plus indirect offset (%s +/- %s)\n", + base_reg_name.c_str(), + offset_reg_name.c_str()); + } + break; + case eInfoTypeRegisterToRegisterPlusOffset: + { + std::string base_reg_name; + std::string data_reg_name; + TranslateRegister (context.info.RegisterToRegisterPlusOffset.base_reg.kind, + context.info.RegisterToRegisterPlusOffset.base_reg.num, + base_reg_name); + TranslateRegister (context.info.RegisterToRegisterPlusOffset.data_reg.kind, + context.info.RegisterToRegisterPlusOffset.data_reg.num, + data_reg_name); + fprintf (stdout, " Info type: Register plus offset (%s +/- %lld) and data register (%s)\n", + base_reg_name.c_str(), context.info.RegisterToRegisterPlusOffset.offset, + data_reg_name.c_str()); + } + break; + case eInfoTypeRegisterToRegisterPlusIndirectOffset: + { + std::string base_reg_name; + std::string offset_reg_name; + std::string data_reg_name; + TranslateRegister (context.info.RegisterToRegisterPlusIndirectOffset.base_reg.kind, + context.info.RegisterToRegisterPlusIndirectOffset.base_reg.num, + base_reg_name); + TranslateRegister (context.info.RegisterToRegisterPlusIndirectOffset.offset_reg.kind, + context.info.RegisterToRegisterPlusIndirectOffset.offset_reg.num, + offset_reg_name); + TranslateRegister (context.info.RegisterToRegisterPlusIndirectOffset.data_reg.kind, + context.info.RegisterToRegisterPlusIndirectOffset.data_reg.num, + data_reg_name); + fprintf (stdout, " Info type: Register plus indirect offset (%s +/- %s) and data register (%s)\n", + base_reg_name.c_str(), offset_reg_name.c_str(), data_reg_name.c_str()); + } + break; + + case eInfoTypeRegisterRegisterOperands: + { + std::string op1_reg_name; + std::string op2_reg_name; + TranslateRegister (context.info.RegisterRegisterOperands.operand1.kind, + context.info.RegisterRegisterOperands.operand1.num, + op1_reg_name); + TranslateRegister (context.info.RegisterRegisterOperands.operand2.kind, + context.info.RegisterRegisterOperands.operand2.num, + op2_reg_name); + fprintf (stdout, " Info type: Register operands for binary op (%s, %s)\n", + op1_reg_name.c_str(), + op2_reg_name.c_str()); + } + break; + case eInfoTypeOffset: + fprintf (stdout, " Info type: signed offset (%lld)\n", context.info.signed_offset); + break; + + case eInfoTypeRegister: + { + std::string reg_name; + TranslateRegister (context.info.reg.kind, context.info.reg.num, reg_name); + fprintf (stdout, " Info type: Register (%s)\n", reg_name.c_str()); + } + break; + + case eInfoTypeImmediate: + fprintf (stdout, " Info type: Immediate (%lld)\n", context.info.immediate); + break; + + case eInfoTypeImmediateSigned: + fprintf (stdout, " Info type: Signed immediate (%lld)\n", context.info.signed_immediate); + break; + + case eInfoTypeAddress: + fprintf (stdout, " Info type: Address (%p)\n", (void *) context.info.address); + break; + + case eInfoTypeModeAndImmediate: + { + std::string mode_name; + + if (context.info.ModeAndImmediate.mode == EmulateInstructionARM::eModeARM) + mode_name = "ARM"; + else if (context.info.ModeAndImmediate.mode == EmulateInstructionARM::eModeThumb) + mode_name = "Thumb"; + else + mode_name = "Unknown mode"; + + fprintf (stdout, " Info type: Mode (%s) and immediate (%d)\n", mode_name.c_str(), + context.info.ModeAndImmediate.data_value); + } + break; + + case eInfoTypeModeAndImmediateSigned: + { + std::string mode_name; + + if (context.info.ModeAndImmediateSigned.mode == EmulateInstructionARM::eModeARM) + mode_name = "ARM"; + else if (context.info.ModeAndImmediateSigned.mode == EmulateInstructionARM::eModeThumb) + mode_name = "Thumb"; + else + mode_name = "Unknown mode"; + + fprintf (stdout, " Info type: Mode (%s) and signed immediate (%d)\n", mode_name.c_str(), + context.info.ModeAndImmediateSigned.signed_data_value); + } + break; + + case eInfoTypeMode: + { + std::string mode_name; + + if (context.info.mode == EmulateInstructionARM::eModeARM) + mode_name = "ARM"; + else if (context.info.mode == EmulateInstructionARM::eModeThumb) + mode_name = "Thumb"; + else + mode_name = "Unknown mode"; + + fprintf (stdout, " Info type: Mode (%s)\n", mode_name.c_str()); + } + break; + + case eInfoTypeNoArgs: + fprintf (stdout, " Info type: no arguments\n"); + break; + + default: + break; + } +} + +void +EmulateInstruction::TranslateRegister (uint32_t kind, uint32_t num, std::string &name) +{ + if (kind == eRegisterKindDWARF) + { + if (num == 13) //dwarf_sp NOTE: This is ARM-SPECIFIC + name = "sp"; + else if (num == 14) //dwarf_lr NOTE: This is ARM-SPECIFIC + name = "lr"; + else if (num == 15) //dwarf_pc NOTE: This is ARM-SPECIFIC + name = "pc"; + else if (num == 16) //dwarf_cpsr NOTE: This is ARM-SPECIFIC + name = "cpsr"; + else + { + StreamString sstr; + + sstr.Printf ("r%d", num); + name = sstr.GetData(); + } + + } + else if (kind == eRegisterKindGeneric) + { + if (num == LLDB_REGNUM_GENERIC_SP) + name = "sp"; + else if (num == LLDB_REGNUM_GENERIC_FLAGS) + name = "cpsr"; + else if (num == LLDB_REGNUM_GENERIC_PC) + name = "pc"; + else if (num == LLDB_REGNUM_GENERIC_RA) + name = "lr"; + else + { + StreamString sstr; + + sstr.Printf ("r%d", num); + name = sstr.GetData(); + } + } + else + { + StreamString sstr; + + sstr.Printf ("r%d", num); + name = sstr.GetData(); + } +} + + + 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=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Tue Apr 5 13:46:00 2011 @@ -404,7 +404,7 @@ { std::auto_ptr disasm_ap (new DisassemblerLLVM(arch)); - if (disasm_ap->IsValid()) + if (disasm_ap.get() && disasm_ap->IsValid()) return disasm_ap.release(); return NULL; Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Tue Apr 5 13:46:00 2011 @@ -11,7 +11,9 @@ #include "EmulateInstructionARM.h" #include "lldb/Core/ArchSpec.h" +#include "lldb/Core/Address.h" #include "lldb/Core/ConstString.h" +#include "lldb/Core/PluginManager.h" #include "Plugins/Process/Utility/ARMDefines.h" #include "Plugins/Process/Utility/ARMUtils.h" @@ -153,13 +155,61 @@ void EmulateInstructionARM::Initialize () { + PluginManager::RegisterPlugin (GetPluginNameStatic (), + GetPluginDescriptionStatic (), + CreateInstance); } void EmulateInstructionARM::Terminate () { + PluginManager::UnregisterPlugin (CreateInstance); } +const char * +EmulateInstructionARM::GetPluginNameStatic () +{ + return "lldb.emulate-instruction.arm"; +} + +const char * +EmulateInstructionARM::GetPluginDescriptionStatic () +{ + return "Emulate instructions for the ARM architecture."; +} + +EmulateInstruction * +EmulateInstructionARM::CreateInstance (const ArchSpec &arch) +{ + if (arch.GetTriple().getArch() == llvm::Triple::arm) + { + std::auto_ptr emulate_insn_ap (new EmulateInstructionARM (arch)); + + if (emulate_insn_ap.get()) + return emulate_insn_ap.release(); + } + else if (arch.GetTriple().getArch() == llvm::Triple::thumb) + { + std::auto_ptr emulate_insn_ap (new EmulateInstructionARM (arch)); + + if (emulate_insn_ap.get()) + return emulate_insn_ap.release(); + } + + return NULL; +} + +bool +EmulateInstructionARM::SetTargetTriple (const ArchSpec &arch) +{ + if (arch.GetTriple().getArch () == llvm::Triple::arm) + return true; + else if (arch.GetTriple().getArch () == llvm::Triple::thumb) + return true; + + return false; +} + // Write "bits (32) UNKNOWN" to memory address "address". Helper function for many ARM instructions. bool EmulateInstructionARM::WriteBits32UnknownToMemory (addr_t address) @@ -503,7 +553,7 @@ addr_t addr = sp + sp_offset; // a pointer to the stack area EmulateInstruction::Context context; - context.type = EmulateInstruction::eContextRegisterPlusOffset; + context.type = EmulateInstruction::eContextAdjustStackPointer; Register sp_reg; sp_reg.SetRegister (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP); context.SetRegisterPlusOffset (sp_reg, sp_offset); @@ -1191,7 +1241,9 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextAdjustStackPointer; - context.SetImmediateSigned (sp_offset); + Register sp_reg; + sp_reg.SetRegister (eRegisterKindDWARF, dwarf_sp); + context.SetRegisterPlusOffset (sp_reg, sp_offset); if (d == 15) { @@ -1253,8 +1305,12 @@ addr_t addr = (int32_t)sp + reg_value; // the adjusted stack pointer value EmulateInstruction::Context context; - context.type = EmulateInstruction::eContextAdjustStackPointer; - context.SetImmediateSigned (reg_value); + context.type = EmulateInstruction::eContextAddition; + Register sp_reg; + sp_reg.SetRegister (eRegisterKindDWARF, dwarf_sp); + Register other_reg; + other_reg.SetRegister (eRegisterKindDWARF, dwarf_r0 + Rm); + context.SetRegisterRegisterOperands (sp_reg, other_reg); if (!WriteRegisterUnsigned (context, eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP, addr)) return false; @@ -2431,8 +2487,10 @@ AddWithCarryResult res = AddWithCarry(val1, imm32, 0); EmulateInstruction::Context context; - context.type = EmulateInstruction::eContextImmediate; - context.SetNoArgs (); + context.type = EmulateInstruction::eContextAddition; + Register dwarf_reg; + dwarf_reg.SetRegister (eRegisterKindDWARF, Rn); + context.SetRegisterPlusOffset (dwarf_reg, imm32); if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, res.carry_out, res.overflow)) return false; @@ -12247,7 +12305,16 @@ { 0xffffffc0, 0x00004340, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateMUL, "muls ,," }, // mul { 0xfff0f0f0, 0xfb00f000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateMUL, "mul ,," }, + + + //---------------------------------------------------------------------- + // RFE instructions *** IMPORTANT *** THESE MUST BE LISTED **BEFORE** THE LDM.. Instructions in this table; + // otherwise the wrong instructions will be selected. + //---------------------------------------------------------------------- + { 0xffd0ffff, 0xe810c000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfedb {!}" }, + { 0xffd0ffff, 0xe990c000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfe{ia} {!}" }, + //---------------------------------------------------------------------- // Load instructions //---------------------------------------------------------------------- @@ -12330,9 +12397,6 @@ { 0xfffff080, 0xfa5ff080, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateUXTB, "uxtb.w ,{,}" }, { 0xffffffc0, 0x0000b280, ARMV6_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateUXTH, "uxth ," }, { 0xfffff080, 0xfa1ff080, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateUXTH, "uxth.w ,{,}" }, - { 0xffd00000, 0xe8100000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfedb {!}" }, - { 0xffd00000, 0xe9900000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfe{ia} {!}" } - }; const size_t k_num_thumb_opcodes = sizeof(g_thumb_opcodes)/sizeof(ARMOpcode); @@ -12347,6 +12411,7 @@ bool EmulateInstructionARM::SetArchitecture (const ArchSpec &arch) { + m_arch = arch; m_arm_isa = 0; const char *arch_cstr = arch.GetArchitectureName (); if (arch_cstr) @@ -12365,6 +12430,26 @@ return m_arm_isa != 0; } +bool +EmulateInstructionARM::SetInstruction (const Opcode &insn_opcode, const Address &inst_addr) +{ + m_opcode = insn_opcode; + + if (m_arch.GetTriple().getArch() == llvm::Triple::thumb) + m_opcode_mode = eModeThumb; + else + { + AddressClass addr_class = inst_addr.GetAddressClass(); + + if ((addr_class == eAddressClassCode) || (addr_class == eAddressClassUnknown)) + m_opcode_mode = eModeARM; + else if (addr_class == eAddressClassCodeAlternateISA) + m_opcode_mode = eModeThumb; + else + return false; + } + return true; +} bool EmulateInstructionARM::ReadInstruction () @@ -12421,8 +12506,6 @@ bool EmulateInstructionARM::ConditionPassed (const uint32_t opcode) { - if (m_opcode_cpsr == 0) - return false; const uint32_t cond = CurrentCond (opcode); @@ -12432,20 +12515,46 @@ bool result = false; switch (UnsignedBits(cond, 3, 1)) { - case 0: result = (m_opcode_cpsr & MASK_CPSR_Z) != 0; break; - case 1: result = (m_opcode_cpsr & MASK_CPSR_C) != 0; break; - case 2: result = (m_opcode_cpsr & MASK_CPSR_N) != 0; break; - case 3: result = (m_opcode_cpsr & MASK_CPSR_V) != 0; break; - case 4: result = ((m_opcode_cpsr & MASK_CPSR_C) != 0) && ((m_opcode_cpsr & MASK_CPSR_Z) == 0); break; + case 0: + if (m_opcode_cpsr == 0) + return true; + result = (m_opcode_cpsr & MASK_CPSR_Z) != 0; + break; + case 1: + if (m_opcode_cpsr == 0) + return true; + result = (m_opcode_cpsr & MASK_CPSR_C) != 0; + break; + case 2: + if (m_opcode_cpsr == 0) + return true; + result = (m_opcode_cpsr & MASK_CPSR_N) != 0; + break; + case 3: + if (m_opcode_cpsr == 0) + return true; + result = (m_opcode_cpsr & MASK_CPSR_V) != 0; + break; + case 4: + if (m_opcode_cpsr == 0) + return true; + result = ((m_opcode_cpsr & MASK_CPSR_C) != 0) && ((m_opcode_cpsr & MASK_CPSR_Z) == 0); + break; case 5: - { + if (m_opcode_cpsr == 0) + return true; + else + { bool n = (m_opcode_cpsr & MASK_CPSR_N); bool v = (m_opcode_cpsr & MASK_CPSR_V); result = n == v; } break; case 6: - { + if (m_opcode_cpsr == 0) + return true; + else + { bool n = (m_opcode_cpsr & MASK_CPSR_N); bool v = (m_opcode_cpsr & MASK_CPSR_V); result = n == v && ((m_opcode_cpsr & MASK_CPSR_Z) == 0); @@ -12875,5 +12984,79 @@ if (m_opcode_mode == eModeThumb && m_it_session.InITBlock()) m_it_session.ITAdvance(); - return false; + + ARMOpcode *opcode_data; + + if (m_opcode_mode == eModeThumb) + opcode_data = GetThumbOpcodeForInstruction (m_opcode.GetOpcode32()); + else if (m_opcode_mode == eModeARM) + opcode_data = GetARMOpcodeForInstruction (m_opcode.GetOpcode32()); + else + return false; + + if (!opcode_data) + return false; + // Verify that we're the right arch for this opcode + + switch (m_arm_isa) + { + case ARMv4: + if (opcode_data->variants != ARMvAll) + return false; + break; + + case ARMv4T: + if ((opcode_data->variants!= ARMvAll) + && (opcode_data->variants != ARMV4T_ABOVE)) + return false; + break; + + case ARMv5T: + case ARMv5TE: + if ((opcode_data->variants != ARMvAll) + && (opcode_data->variants != ARMV4T_ABOVE) + && (opcode_data->variants != ARMV5_ABOVE)) + return false; + break; + + case ARMv5TEJ: + if ((opcode_data->variants != ARMvAll) + && (opcode_data->variants != ARMV4T_ABOVE) + && (opcode_data->variants != ARMV5_ABOVE) + && (opcode_data->variants != ARMV5J_ABOVE)) + return false; + break; + + case ARMv6: + case ARMv6K: + if ((opcode_data->variants != ARMvAll) + && (opcode_data->variants != ARMV4T_ABOVE) + && (opcode_data->variants != ARMV5_ABOVE) + && (opcode_data->variants != ARMV5J_ABOVE) + && (opcode_data->variants != ARMV6_ABOVE)) + return false; + break; + + case ARMv6T2: + case ARMv7: + case ARMv8: + if ((opcode_data->variants != ARMvAll) + && (opcode_data->variants != ARMV4T_ABOVE) + && (opcode_data->variants != ARMV5_ABOVE) + && (opcode_data->variants != ARMV5J_ABOVE) + && (opcode_data->variants != ARMV6_ABOVE) + && (opcode_data->variants != ARMV6T2_ABOVE)) + return false; + break; + + default: +// if (opcode_data->variants != ARMvAll) +// return false; + break; + } + + // Just for now, for testing purposes. + //fprintf (stdout, "\nEvaluateInstruction, opcode (0x%x), found = '%s'\n", m_opcode.GetOpcode32(), opcode_data->name); + + return (this->*opcode_data->callback) (m_opcode.GetOpcode32(), opcode_data->encoding); // Call the Emulate... function. } Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h Tue Apr 5 13:46:00 2011 @@ -67,6 +67,15 @@ static void Terminate (); + static const char * + GetPluginNameStatic (); + + static const char * + GetPluginDescriptionStatic (); + + static lldb_private::EmulateInstruction * + CreateInstance (const lldb_private::ArchSpec &arch); + virtual const char * GetPluginName() { @@ -76,7 +85,7 @@ virtual const char * GetShortPluginName() { - return "lldb.emulate-instruction.arm"; + return GetPluginNameStatic(); } virtual uint32_t @@ -85,20 +94,36 @@ return 1; } + bool + SetTargetTriple (const ArchSpec &arch); + enum Mode { eModeInvalid, eModeARM, eModeThumb }; + + EmulateInstructionARM (const ArchSpec &arch) : + EmulateInstruction (lldb::eByteOrderLittle, + 4, + arch), + m_arm_isa (0), + m_opcode_mode (eModeInvalid), + m_opcode_cpsr (0), + m_it_session () + { + } - EmulateInstructionARM (void *baton, + EmulateInstructionARM (const ArchSpec &arch, + void *baton, ReadMemory read_mem_callback, WriteMemory write_mem_callback, ReadRegister read_reg_callback, WriteRegister write_reg_callback) : EmulateInstruction (lldb::eByteOrderLittle, // Byte order for ARM 4, // Address size in byte + arch, baton, read_mem_callback, write_mem_callback, @@ -117,6 +142,9 @@ virtual bool ReadInstruction (); + + virtual bool + SetInstruction (const Opcode &insn_opcode, const Address &inst_addr); virtual bool EvaluateInstruction (); Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp Tue Apr 5 13:46:00 2011 @@ -70,6 +70,8 @@ break; } } + parent_arg_die = parent_arg_die->GetParent(); + parend_pos_die = parend_pos_die->GetParent(); } if (match) Modified: lldb/trunk/source/lldb.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=128907&r1=128906&r2=128907&view=diff ============================================================================== --- lldb/trunk/source/lldb.cpp (original) +++ lldb/trunk/source/lldb.cpp Tue Apr 5 13:46:00 2011 @@ -23,6 +23,7 @@ #include "llvm/ADT/StringRef.h" #include "Plugins/Disassembler/llvm/DisassemblerLLVM.h" +#include "Plugins/Instruction/ARM/EmulateInstructionARM.h" #include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h" #include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h" #include "Plugins/ObjectFile/ELF/ObjectFileELF.h" @@ -85,6 +86,7 @@ ArchDefaultUnwindPlan_x86_64::Initialize(); ArchDefaultUnwindPlan_i386::Initialize(); ArchVolatileRegs_x86::Initialize(); + EmulateInstructionARM::Initialize (); #if defined (__APPLE__) //---------------------------------------------------------------------- @@ -152,6 +154,7 @@ ArchDefaultUnwindPlan_i386::Terminate(); ArchDefaultUnwindPlan_x86_64::Terminate(); ArchVolatileRegs_x86::Terminate(); + EmulateInstructionARM::Terminate (); #if defined (__APPLE__) DynamicLoaderMacOSXDYLD::Terminate(); From ctice at apple.com Tue Apr 5 15:18:48 2011 From: ctice at apple.com (Caroline Tice) Date: Tue, 05 Apr 2011 20:18:48 -0000 Subject: [Lldb-commits] [lldb] r128917 - in /lldb/trunk: include/lldb/Core/EmulateInstruction.h source/Core/EmulateInstruction.cpp Message-ID: <20110405201848.83F7F2A6C12E@llvm.org> Author: ctice Date: Tue Apr 5 15:18:48 2011 New Revision: 128917 URL: http://llvm.org/viewvc/llvm-project?rev=128917&view=rev Log: Convert "process" read/write callback functions to "frame" read/write callback functions. Modified: lldb/trunk/include/lldb/Core/EmulateInstruction.h lldb/trunk/source/Core/EmulateInstruction.cpp Modified: lldb/trunk/include/lldb/Core/EmulateInstruction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/EmulateInstruction.h?rev=128917&r1=128916&r2=128917&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/EmulateInstruction.h (original) +++ lldb/trunk/include/lldb/Core/EmulateInstruction.h Tue Apr 5 15:18:48 2011 @@ -460,32 +460,32 @@ static size_t - ReadMemoryProcess (void *baton, - const Context &context, - lldb::addr_t addr, - void *dst, - size_t length); + ReadMemoryFrame (void *baton, + const Context &context, + lldb::addr_t addr, + void *dst, + size_t length); static size_t - WriteMemoryProcess (void *baton, - const Context &context, - lldb::addr_t addr, - const void *dst, - size_t length); + WriteMemoryFrame (void *baton, + const Context &context, + lldb::addr_t addr, + const void *dst, + size_t length); static bool - ReadRegisterProcess (void *baton, - uint32_t reg_kind, - uint32_t reg_num, - uint64_t ®_value); + ReadRegisterFrame (void *baton, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t ®_value); static bool - WriteRegisterProcess (void *baton, - const Context &context, - uint32_t reg_kind, - uint32_t reg_num, - uint64_t reg_value); + WriteRegisterFrame (void *baton, + const Context &context, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t reg_value); static size_t ReadMemoryDefault (void *baton, Modified: lldb/trunk/source/Core/EmulateInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=128917&r1=128916&r2=128917&view=diff ============================================================================== --- lldb/trunk/source/Core/EmulateInstruction.cpp (original) +++ lldb/trunk/source/Core/EmulateInstruction.cpp Tue Apr 5 15:18:48 2011 @@ -206,21 +206,23 @@ // size_t -EmulateInstruction::ReadMemoryProcess (void *baton, - const Context &context, - lldb::addr_t addr, - void *dst, - size_t length) +EmulateInstruction::ReadMemoryFrame (void *baton, + const Context &context, + lldb::addr_t addr, + void *dst, + size_t length) { - Process *process = (Process *) baton; - - if (!process) + if (!baton) return 0; + + StackFrame *frame = (StackFrame *) baton; + DataBufferSP data_sp (new DataBufferHeap (length, '\0')); Error error; - size_t bytes_read = process->ReadMemory (addr, data_sp->GetBytes(), data_sp->GetByteSize(), error); + size_t bytes_read = frame->GetThread().GetProcess().ReadMemory (addr, data_sp->GetBytes(), data_sp->GetByteSize(), + error); if (bytes_read > 0) ((DataBufferHeap *) data_sp.get())->CopyData (dst, length); @@ -229,17 +231,17 @@ } size_t -EmulateInstruction::WriteMemoryProcess (void *baton, - const Context &context, - lldb::addr_t addr, - const void *dst, - size_t length) +EmulateInstruction::WriteMemoryFrame (void *baton, + const Context &context, + lldb::addr_t addr, + const void *dst, + size_t length) { - Process *process = (Process *) baton; - - if (!process) + if (!baton) return 0; + StackFrame *frame = (StackFrame *) baton; + lldb::DataBufferSP data_sp (new DataBufferHeap (dst, length)); if (data_sp) { @@ -247,7 +249,8 @@ if (length > 0) { Error error; - size_t bytes_written = process->WriteMemory (addr, data_sp->GetBytes(), length, error); + size_t bytes_written = frame->GetThread().GetProcess().WriteMemory (addr, data_sp->GetBytes(), length, + error); return bytes_written; } @@ -257,17 +260,16 @@ } bool -EmulateInstruction::ReadRegisterProcess (void *baton, - uint32_t reg_kind, - uint32_t reg_num, - uint64_t ®_value) +EmulateInstruction::ReadRegisterFrame (void *baton, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t ®_value) { - Process *process = (Process *) baton; - if (!process) + if (!baton) return false; - Thread *thread = process->CalculateThread (); - RegisterContext *reg_context = thread->GetRegisterContext().get(); + StackFrame *frame = (StackFrame *) baton; + RegisterContext *reg_context = frame->GetRegisterContext().get(); Scalar value; @@ -281,15 +283,17 @@ } bool -EmulateInstruction::WriteRegisterProcess (void *baton, - const Context &context, - uint32_t reg_kind, - uint32_t reg_num, - uint64_t reg_value) +EmulateInstruction::WriteRegisterFrame (void *baton, + const Context &context, + uint32_t reg_kind, + uint32_t reg_num, + uint64_t reg_value) { - Process *process = (Process *) baton; - Thread *thread = process->CalculateThread (); - RegisterContext *reg_context = thread->GetRegisterContext().get(); + if (!baton) + return false; + + StackFrame *frame = (StackFrame *) baton; + RegisterContext *reg_context = frame->GetRegisterContext().get(); Scalar value (reg_value); return reg_context->WriteRegisterValue (reg_num, value); From gclayton at apple.com Tue Apr 5 16:40:10 2011 From: gclayton at apple.com (Greg Clayton) Date: Tue, 05 Apr 2011 21:40:10 -0000 Subject: [Lldb-commits] [lldb] r128934 - /lldb/trunk/www/lldb-gdb.html Message-ID: <20110405214010.527802A6C12D@llvm.org> Author: gclayton Date: Tue Apr 5 16:40:10 2011 New Revision: 128934 URL: http://llvm.org/viewvc/llvm-project?rev=128934&view=rev Log: Removed a stray '\' character. Modified: lldb/trunk/www/lldb-gdb.html Modified: lldb/trunk/www/lldb-gdb.html URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/lldb-gdb.html?rev=128934&r1=128933&r2=128934&view=diff ============================================================================== --- lldb/trunk/www/lldb-gdb.html (original) +++ lldb/trunk/www/lldb-gdb.html Tue Apr 5 16:40:10 2011 @@ -244,9 +244,7 @@

Examining Thread State

-

- @@ -351,7 +349,7 @@ -\ +
LLDB
Show mixed source and disassembly for the current function for the current frame.
Show mixed source and disassembly for the current function for the current frame.
(lldb) disassemble --frame --mixed
From gclayton at apple.com Tue Apr 5 16:44:24 2011 From: gclayton at apple.com (Greg Clayton) Date: Tue, 05 Apr 2011 21:44:24 -0000 Subject: [Lldb-commits] [lldb] r128939 - /lldb/trunk/www/style.css Message-ID: <20110405214424.C919C2A6C12D@llvm.org> Author: gclayton Date: Tue Apr 5 16:44:24 2011 New Revision: 128939 URL: http://llvm.org/viewvc/llvm-project?rev=128939&view=rev Log: Use the same colors in the LLDB/GDB table as the sidebar so things look consistent and also to lighten up the page a bit. Modified: lldb/trunk/www/style.css Modified: lldb/trunk/www/style.css URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/style.css?rev=128939&r1=128938&r2=128939&view=diff ============================================================================== --- lldb/trunk/www/style.css (original) +++ lldb/trunk/www/style.css Tue Apr 5 16:44:24 2011 @@ -107,7 +107,7 @@ } td.content { - background-color: #CCC; + background-color: #E9E9E9; color: #000; padding: 4px; text-align: left; From ctice at apple.com Tue Apr 5 18:22:55 2011 From: ctice at apple.com (Caroline Tice) Date: Tue, 05 Apr 2011 23:22:55 -0000 Subject: [Lldb-commits] [lldb] r128956 - in /lldb/trunk: include/lldb/API/SBFrame.h include/lldb/API/SBInstruction.h include/lldb/API/SBInstructionList.h include/lldb/Core/Disassembler.h source/API/SBInstruction.cpp source/API/SBInstructionList.cpp source/Core/Disassembler.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVM.h source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Message-ID: <20110405232255.49DB92A6C12D@llvm.org> Author: ctice Date: Tue Apr 5 18:22:54 2011 New Revision: 128956 URL: http://llvm.org/viewvc/llvm-project?rev=128956&view=rev Log: Add Emulate and DumpEmulation to Instruction class. Move InstructionLLVM out of DisassemblerLLVM class. Add instruction emulation function calls to SBInstruction and SBInstructionList APIs. Modified: lldb/trunk/include/lldb/API/SBFrame.h lldb/trunk/include/lldb/API/SBInstruction.h lldb/trunk/include/lldb/API/SBInstructionList.h lldb/trunk/include/lldb/Core/Disassembler.h lldb/trunk/source/API/SBInstruction.cpp lldb/trunk/source/API/SBInstructionList.cpp lldb/trunk/source/Core/Disassembler.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Modified: lldb/trunk/include/lldb/API/SBFrame.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFrame.h?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBFrame.h (original) +++ lldb/trunk/include/lldb/API/SBFrame.h Tue Apr 5 18:22:54 2011 @@ -137,6 +137,7 @@ private: friend class SBThread; + friend class SBInstruction; friend class lldb_private::ScriptInterpreterPython; #ifndef SWIG Modified: lldb/trunk/include/lldb/API/SBInstruction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBInstruction.h (original) +++ lldb/trunk/include/lldb/API/SBInstruction.h Tue Apr 5 18:22:54 2011 @@ -52,6 +52,12 @@ bool GetDescription (lldb::SBStream &description); + bool + EmulateWithFrame (lldb::SBFrame &frame); + + bool + DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'arm-apple-darwin' + protected: friend class SBInstructionList; Modified: lldb/trunk/include/lldb/API/SBInstructionList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstructionList.h?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBInstructionList.h (original) +++ lldb/trunk/include/lldb/API/SBInstructionList.h Tue Apr 5 18:22:54 2011 @@ -48,6 +48,9 @@ bool GetDescription (lldb::SBStream &description); + + bool + DumpEmulationForAllInstructions (const char *triple); protected: friend class SBFunction; Modified: lldb/trunk/include/lldb/Core/Disassembler.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/Disassembler.h (original) +++ lldb/trunk/include/lldb/Core/Disassembler.h Tue Apr 5 18:22:54 2011 @@ -19,6 +19,7 @@ #include "lldb/lldb-private.h" #include "lldb/Core/Address.h" #include "lldb/Core/ArchSpec.h" +#include "lldb/Core/EmulateInstruction.h" #include "lldb/Core/Opcode.h" #include "lldb/Core/PluginInterface.h" @@ -66,7 +67,18 @@ Decode (const Disassembler &disassembler, const DataExtractor& data, uint32_t data_offset) = 0; - + + bool + DumpEmulation (const ArchSpec &arch); + + bool + Emulate (const ArchSpec &arch, + void *baton, + EmulateInstruction::ReadMemory read_mem_callback, + EmulateInstruction::WriteMemory write_mem_calback, + EmulateInstruction::ReadRegister read_reg_callback, + EmulateInstruction::WriteRegister write_reg_callback); + const Opcode & GetOpcode () const { Modified: lldb/trunk/source/API/SBInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstruction.cpp?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/source/API/SBInstruction.cpp (original) +++ lldb/trunk/source/API/SBInstruction.cpp Tue Apr 5 18:22:54 2011 @@ -10,11 +10,18 @@ #include "lldb/API/SBInstruction.h" #include "lldb/API/SBAddress.h" +#include "lldb/API/SBFrame.h" #include "lldb/API/SBInstruction.h" #include "lldb/API/SBStream.h" +#include "lldb/API/SBTarget.h" +#include "lldb/Core/ArchSpec.h" #include "lldb/Core/Disassembler.h" +#include "lldb/Core/EmulateInstruction.h" #include "lldb/Core/StreamFile.h" +#include "lldb/Target/ExecutionContext.h" +#include "lldb/Target/StackFrame.h" +#include "lldb/Target/Target.h" using namespace lldb; using namespace lldb_private; @@ -107,3 +114,41 @@ m_opaque_sp->Dump (&out_stream, 0, true, false, NULL, false); } } + +bool +SBInstruction::EmulateWithFrame (lldb::SBFrame &frame) +{ + if (m_opaque_sp && frame.get()) + { + lldb_private::ExecutionContext exe_ctx; + frame->CalculateExecutionContext (exe_ctx); + lldb_private::Target *target = exe_ctx.target; + lldb_private::ArchSpec arch = target->GetArchitecture(); + + return m_opaque_sp->Emulate (arch, + (void *) frame.get(), + &lldb_private::EmulateInstruction::ReadMemoryFrame, + &lldb_private::EmulateInstruction::WriteMemoryFrame, + &lldb_private::EmulateInstruction::ReadRegisterFrame, + &lldb_private::EmulateInstruction::WriteRegisterFrame); + } + return false; +} + +bool +SBInstruction::DumpEmulation (const char *triple) +{ + if (m_opaque_sp && triple) + { + lldb_private::ArchSpec arch (triple); + + return m_opaque_sp->Emulate (arch, + NULL, + &lldb_private::EmulateInstruction::ReadMemoryDefault, + &lldb_private::EmulateInstruction::WriteMemoryDefault, + &lldb_private::EmulateInstruction::ReadRegisterDefault, + &lldb_private::EmulateInstruction::WriteRegisterDefault); + } + return false; +} + Modified: lldb/trunk/source/API/SBInstructionList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstructionList.cpp?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/source/API/SBInstructionList.cpp (original) +++ lldb/trunk/source/API/SBInstructionList.cpp Tue Apr 5 18:22:54 2011 @@ -109,3 +109,18 @@ } +bool +SBInstructionList::DumpEmulationForAllInstructions (const char *triple) +{ + if (m_opaque_sp) + { + size_t len = GetSize(); + for (size_t i = 0; i < len; ++i) + { + if (!GetInstructionAtIndex((uint32_t) i).DumpEmulation (triple)) + return false; + } + } + return true; +} + Modified: lldb/trunk/source/Core/Disassembler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/source/Core/Disassembler.cpp (original) +++ lldb/trunk/source/Core/Disassembler.cpp Tue Apr 5 18:22:54 2011 @@ -489,6 +489,39 @@ return m_address_class; } +bool +Instruction::DumpEmulation (const ArchSpec &arch) +{ + std::auto_ptr insn_emulator_ap (EmulateInstruction::FindPlugin (arch, NULL)); + if (insn_emulator_ap.get()) + { + insn_emulator_ap->SetInstruction (GetOpcode(), GetAddress()); + return insn_emulator_ap->EvaluateInstruction (); + } + + return false; +} + +bool +Instruction::Emulate (const ArchSpec &arch, + void *baton, + EmulateInstruction::ReadMemory read_mem_callback, + EmulateInstruction::WriteMemory write_mem_callback, + EmulateInstruction::ReadRegister read_reg_callback, + EmulateInstruction::WriteRegister write_reg_callback) +{ + std::auto_ptr insn_emulator_ap (EmulateInstruction::FindPlugin (arch, NULL)); + if (insn_emulator_ap.get()) + { + insn_emulator_ap->SetBaton (baton); + insn_emulator_ap->SetCallbacks (read_mem_callback, write_mem_callback, read_reg_callback, write_reg_callback); + insn_emulator_ap->SetInstruction (GetOpcode(), GetAddress()); + return insn_emulator_ap->EvaluateInstruction (); + } + + return false; +} + InstructionList::InstructionList() : m_instructions() { 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=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Tue Apr 5 18:22:54 2011 @@ -74,15 +74,15 @@ return -1; } -DisassemblerLLVM::InstructionLLVM::InstructionLLVM (const Address &addr, - AddressClass addr_class, - EDDisassemblerRef disassembler) : +InstructionLLVM::InstructionLLVM (const Address &addr, + AddressClass addr_class, + EDDisassemblerRef disassembler) : Instruction (addr, addr_class), m_disassembler (disassembler) { } -DisassemblerLLVM::InstructionLLVM::~InstructionLLVM() +InstructionLLVM::~InstructionLLVM() { } @@ -98,7 +98,7 @@ } void -DisassemblerLLVM::InstructionLLVM::Dump +InstructionLLVM::Dump ( Stream *s, uint32_t max_opcode_byte_size, @@ -332,15 +332,15 @@ } bool -DisassemblerLLVM::InstructionLLVM::DoesBranch() const +InstructionLLVM::DoesBranch() const { return EDInstIsBranch(m_inst); } size_t -DisassemblerLLVM::InstructionLLVM::Decode (const Disassembler &disassembler, - const lldb_private::DataExtractor &data, - uint32_t data_offset) +InstructionLLVM::Decode (const Disassembler &disassembler, + const lldb_private::DataExtractor &data, + uint32_t data_offset) { if (EDCreateInsts(&m_inst, 1, m_disassembler, DataExtractorByteReader, data_offset, (void*)(&data))) { 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=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h Tue Apr 5 18:22:54 2011 @@ -16,40 +16,41 @@ #include "lldb/Core/Disassembler.h" #include "lldb/Host/Mutex.h" -class DisassemblerLLVM : public lldb_private::Disassembler +class InstructionLLVM : public lldb_private::Instruction { public: - class InstructionLLVM : public lldb_private::Instruction - { - public: - InstructionLLVM (const lldb_private::Address &addr, - lldb_private::AddressClass addr_class, - EDDisassemblerRef disassembler); - - virtual - ~InstructionLLVM(); - - virtual void - Dump (lldb_private::Stream *s, - uint32_t max_opcode_byte_size, - bool show_address, - bool show_bytes, - const lldb_private::ExecutionContext* exe_ctx, - bool raw); - - virtual bool - DoesBranch () const; - - virtual size_t - Decode (const Disassembler &disassembler, - const lldb_private::DataExtractor &data, - uint32_t data_offset); - - protected: - EDDisassemblerRef m_disassembler; - EDInstRef m_inst; - }; + InstructionLLVM (const lldb_private::Address &addr, + lldb_private::AddressClass addr_class, + EDDisassemblerRef disassembler); + + virtual + ~InstructionLLVM(); + + virtual void + Dump (lldb_private::Stream *s, + uint32_t max_opcode_byte_size, + bool show_address, + bool show_bytes, + const lldb_private::ExecutionContext* exe_ctx, + bool raw); + + virtual bool + DoesBranch () const; + + virtual size_t + Decode (const lldb_private::Disassembler &disassembler, + const lldb_private::DataExtractor &data, + uint32_t data_offset); + +protected: + EDDisassemblerRef m_disassembler; + EDInstRef m_inst; +}; + +class DisassemblerLLVM : public lldb_private::Disassembler +{ +public: //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=128956&r1=128955&r2=128956&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Tue Apr 5 18:22:54 2011 @@ -13056,7 +13056,8 @@ } // Just for now, for testing purposes. - //fprintf (stdout, "\nEvaluateInstruction, opcode (0x%x), found = '%s'\n", m_opcode.GetOpcode32(), opcode_data->name); + if (m_baton == NULL) + fprintf (stdout, "\nEvaluateInstruction, opcode (0x%x), found = '%s'\n", m_opcode.GetOpcode32(), opcode_data->name); return (this->*opcode_data->callback) (m_opcode.GetOpcode32(), opcode_data->encoding); // Call the Emulate... function. } From mminutoli at gmail.com Wed Apr 6 10:32:26 2011 From: mminutoli at gmail.com (Marco Minutoli) Date: Wed, 6 Apr 2011 17:32:26 +0200 Subject: [Lldb-commits] [PATCH] Removing FindProcessesByName. Message-ID: <1302103946-7075-1-git-send-email-mminutoli@gmail.com> Hello everybody, at the moment the build on linux is broken by the missing method Host::FindProcessesByName. Stephen told me that it was removed some time ago so I wrote this little patch to remove the method that coused the problem. Best regards, Marco --- source/Plugins/Platform/Linux/PlatformLinux.cpp | 8 -------- source/Plugins/Platform/Linux/PlatformLinux.h | 5 ----- 2 files changed, 0 insertions(+), 13 deletions(-) diff --git a/source/Plugins/Platform/Linux/PlatformLinux.cpp b/source/Plugins/Platform/Linux/PlatformLinux.cpp index c5200d2..379a08e 100644 --- a/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -191,14 +191,6 @@ PlatformLinux::~PlatformLinux() { } -uint32_t -PlatformLinux::FindProcessesByName (const char *name_match, - NameMatchType name_match_type, - ProcessInfoList &process_infos) -{ - return Host::FindProcessesByName (name_match, name_match_type, process_infos); -} - bool PlatformLinux::GetProcessInfo (lldb::pid_t pid, ProcessInfo &process_info) { diff --git a/source/Plugins/Platform/Linux/PlatformLinux.h b/source/Plugins/Platform/Linux/PlatformLinux.h index 395778b..bb9f62c 100644 --- a/source/Plugins/Platform/Linux/PlatformLinux.h +++ b/source/Plugins/Platform/Linux/PlatformLinux.h @@ -84,11 +84,6 @@ namespace lldb_private { GetFile (const FileSpec &platform_file, const UUID* uuid, FileSpec &local_file); - virtual uint32_t - FindProcessesByName (const char *name_match, - NameMatchType name_match_type, - ProcessInfoList &process_infos); - virtual bool GetProcessInfo (lldb::pid_t pid, ProcessInfo &proc_info); -- 1.7.1 From gclayton at apple.com Wed Apr 6 13:50:37 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 06 Apr 2011 18:50:37 -0000 Subject: [Lldb-commits] [lldb] r129018 - in /lldb/trunk/source/Plugins/Platform/Linux: PlatformLinux.cpp PlatformLinux.h Message-ID: <20110406185037.1BFF22A6C12D@llvm.org> Author: gclayton Date: Wed Apr 6 13:50:36 2011 New Revision: 129018 URL: http://llvm.org/viewvc/llvm-project?rev=129018&view=rev Log: Update the linux platform to use the new Host::FindProcesses functionality. Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=129018&r1=129017&r2=129018&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Wed Apr 6 13:50:36 2011 @@ -192,11 +192,10 @@ } uint32_t -PlatformLinux::FindProcessesByName (const char *name_match, - NameMatchType name_match_type, - ProcessInfoList &process_infos) +PlatformLinux:: FindProcesses const ProcessInfoMatch &match_info, + ProcessInfoList &process_infos() { - return Host::FindProcessesByName (name_match, name_match_type, process_infos); + return Host:: FindProcesses (match_info, process_infos); } bool Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=129018&r1=129017&r2=129018&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Wed Apr 6 13:50:36 2011 @@ -85,9 +85,8 @@ const UUID* uuid, FileSpec &local_file); virtual uint32_t - FindProcessesByName (const char *name_match, - NameMatchType name_match_type, - ProcessInfoList &process_infos); + FindProcesseses (const ProcessInfoMatch &match_info, + ProcessInfoList &process_infos); virtual bool GetProcessInfo (lldb::pid_t pid, ProcessInfo &proc_info); From gclayton at apple.com Wed Apr 6 13:55:27 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 06 Apr 2011 11:55:27 -0700 Subject: [Lldb-commits] [PATCH] Removing FindProcessesByName. In-Reply-To: <1302103946-7075-1-git-send-email-mminutoli@gmail.com> References: <1302103946-7075-1-git-send-email-mminutoli@gmail.com> Message-ID: <0B12A63A-B714-4965-ACC5-3F6420B990A3@apple.com> This has been changed to use the new FindProcesses which is in the host layer: static uint32_t FindProcesses (const ProcessInfoMatch &match_info, ProcessInfoList &proc_infos); I have submitted what I think fixes the issue, though I don't have a linux box to test: % svn commit Sending Linux/PlatformLinux.cpp Sending Linux/PlatformLinux.h Transmitting file data .. Committed revision 129018. On Apr 6, 2011, at 8:32 AM, Marco Minutoli wrote: > Hello everybody, > > at the moment the build on linux is broken by the missing method > Host::FindProcessesByName. Stephen told me that it was removed some > time ago so I wrote this little patch to remove the method that coused > the problem. > > Best regards, > Marco > > --- > source/Plugins/Platform/Linux/PlatformLinux.cpp | 8 -------- > source/Plugins/Platform/Linux/PlatformLinux.h | 5 ----- > 2 files changed, 0 insertions(+), 13 deletions(-) > > diff --git a/source/Plugins/Platform/Linux/PlatformLinux.cpp b/source/Plugins/Platform/Linux/PlatformLinux.cpp > index c5200d2..379a08e 100644 > --- a/source/Plugins/Platform/Linux/PlatformLinux.cpp > +++ b/source/Plugins/Platform/Linux/PlatformLinux.cpp > @@ -191,14 +191,6 @@ PlatformLinux::~PlatformLinux() > { > } > > -uint32_t > -PlatformLinux::FindProcessesByName (const char *name_match, > - NameMatchType name_match_type, > - ProcessInfoList &process_infos) > -{ > - return Host::FindProcessesByName (name_match, name_match_type, process_infos); > -} > - > bool > PlatformLinux::GetProcessInfo (lldb::pid_t pid, ProcessInfo &process_info) > { > diff --git a/source/Plugins/Platform/Linux/PlatformLinux.h b/source/Plugins/Platform/Linux/PlatformLinux.h > index 395778b..bb9f62c 100644 > --- a/source/Plugins/Platform/Linux/PlatformLinux.h > +++ b/source/Plugins/Platform/Linux/PlatformLinux.h > @@ -84,11 +84,6 @@ namespace lldb_private { > GetFile (const FileSpec &platform_file, > const UUID* uuid, FileSpec &local_file); > > - virtual uint32_t > - FindProcessesByName (const char *name_match, > - NameMatchType name_match_type, > - ProcessInfoList &process_infos); > - > virtual bool > GetProcessInfo (lldb::pid_t pid, ProcessInfo &proc_info); > > -- > 1.7.1 > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits From mminutoli at gmail.com Wed Apr 6 15:44:13 2011 From: mminutoli at gmail.com (Marco Minutoli) Date: Wed, 6 Apr 2011 22:44:13 +0200 Subject: [Lldb-commits] [PATCH 1/2] Removed use of NSEC_PER_SEC. Message-ID: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> NSEC_PER_SEC is not defined in sys/time.h on Linux. I have replaced that macro with a static constant inside TimeValue. --- include/lldb/Host/TimeValue.h | 2 ++ .../gdb-remote/GDBRemoteCommunicationClient.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/lldb/Host/TimeValue.h b/include/lldb/Host/TimeValue.h index 81d1aed..04b6015 100644 --- a/include/lldb/Host/TimeValue.h +++ b/include/lldb/Host/TimeValue.h @@ -29,6 +29,8 @@ namespace lldb_private { class TimeValue { public: + static const uint32_t NanoSecondPerSecond = 1000000000U; + //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index d0198a0..7ad3d44 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1385,13 +1385,13 @@ GDBRemoteCommunicationClient::TestPacketSpeed (const uint32_t num_packets) } end_time = TimeValue::Now(); total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970(); - packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; + packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecondPerSecond; printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in %llu.%09.9llu sec for %f packets/sec.\n", num_packets, send_size, recv_size, - total_time_nsec / NSEC_PER_SEC, - total_time_nsec % NSEC_PER_SEC, + total_time_nsec / TimeValue::NanoSecondPerSecond, + total_time_nsec % TimeValue::NanoSecondPerSecond, packets_per_second); if (recv_size == 0) recv_size = 32; @@ -1409,11 +1409,11 @@ GDBRemoteCommunicationClient::TestPacketSpeed (const uint32_t num_packets) } end_time = TimeValue::Now(); total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970(); - packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; + packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecondPerSecond; printf ("%u 'qC' packets packets in 0x%llu%09.9llu sec for %f packets/sec.\n", num_packets, - total_time_nsec / NSEC_PER_SEC, - total_time_nsec % NSEC_PER_SEC, + total_time_nsec / TimeValue::NanoSecondPerSecond, + total_time_nsec % TimeValue::NanoSecondPerSecond, packets_per_second); } } -- 1.7.1 From mminutoli at gmail.com Wed Apr 6 15:44:14 2011 From: mminutoli at gmail.com (Marco Minutoli) Date: Wed, 6 Apr 2011 22:44:14 +0200 Subject: [Lldb-commits] [PATCH 2/2] Missing header. In-Reply-To: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> Message-ID: <1302122654-16752-2-git-send-email-mminutoli@gmail.com> strtoul is defined in stdlib.h and the header was missing in StringExtractor.cpp . --- source/Utility/StringExtractor.cpp | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/source/Utility/StringExtractor.cpp b/source/Utility/StringExtractor.cpp index 227b634..176eb89 100644 --- a/source/Utility/StringExtractor.cpp +++ b/source/Utility/StringExtractor.cpp @@ -13,6 +13,8 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include + static inline int xdigit_to_sint (char ch) -- 1.7.1 From gclayton at apple.com Wed Apr 6 17:12:48 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 06 Apr 2011 15:12:48 -0700 Subject: [Lldb-commits] [PATCH 1/2] Removed use of NSEC_PER_SEC. In-Reply-To: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> Message-ID: <7DA43CCF-C873-4C18-90F4-1C2DAA788E02@apple.com> Looks good. Marco, do you have commit access? If so, commit when you get the chance. Else I will do so on your behalf. Greg Clayton On Apr 6, 2011, at 1:44 PM, Marco Minutoli wrote: > NSEC_PER_SEC is not defined in sys/time.h on Linux. I have replaced > that macro with a static constant inside TimeValue. > --- > include/lldb/Host/TimeValue.h | 2 ++ > .../gdb-remote/GDBRemoteCommunicationClient.cpp | 12 ++++++------ > 2 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/include/lldb/Host/TimeValue.h b/include/lldb/Host/TimeValue.h > index 81d1aed..04b6015 100644 > --- a/include/lldb/Host/TimeValue.h > +++ b/include/lldb/Host/TimeValue.h > @@ -29,6 +29,8 @@ namespace lldb_private { > class TimeValue > { > public: > + static const uint32_t NanoSecondPerSecond = 1000000000U; > + > //------------------------------------------------------------------ > // Constructors and Destructors > //------------------------------------------------------------------ > diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > index d0198a0..7ad3d44 100644 > --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > @@ -1385,13 +1385,13 @@ GDBRemoteCommunicationClient::TestPacketSpeed (const uint32_t num_packets) > } > end_time = TimeValue::Now(); > total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970(); > - packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; > + packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecondPerSecond; > printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in %llu.%09.9llu sec for %f packets/sec.\n", > num_packets, > send_size, > recv_size, > - total_time_nsec / NSEC_PER_SEC, > - total_time_nsec % NSEC_PER_SEC, > + total_time_nsec / TimeValue::NanoSecondPerSecond, > + total_time_nsec % TimeValue::NanoSecondPerSecond, > packets_per_second); > if (recv_size == 0) > recv_size = 32; > @@ -1409,11 +1409,11 @@ GDBRemoteCommunicationClient::TestPacketSpeed (const uint32_t num_packets) > } > end_time = TimeValue::Now(); > total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970(); > - packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; > + packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecondPerSecond; > printf ("%u 'qC' packets packets in 0x%llu%09.9llu sec for %f packets/sec.\n", > num_packets, > - total_time_nsec / NSEC_PER_SEC, > - total_time_nsec % NSEC_PER_SEC, > + total_time_nsec / TimeValue::NanoSecondPerSecond, > + total_time_nsec % TimeValue::NanoSecondPerSecond, > packets_per_second); > } > } > -- > 1.7.1 > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits From gclayton at apple.com Wed Apr 6 17:12:53 2011 From: gclayton at apple.com (Greg Clayton) Date: Wed, 06 Apr 2011 15:12:53 -0700 Subject: [Lldb-commits] [PATCH 2/2] Missing header. In-Reply-To: <1302122654-16752-2-git-send-email-mminutoli@gmail.com> References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> <1302122654-16752-2-git-send-email-mminutoli@gmail.com> Message-ID: <52870059-E652-47CE-BAF7-209D8DEFB948@apple.com> Looks good. Marco, do you have commit access? If so, commit when you get the chance. Else I will do so on your behalf. Greg Clayton On Apr 6, 2011, at 1:44 PM, Marco Minutoli wrote: > strtoul is defined in stdlib.h and the header was missing in > StringExtractor.cpp . > --- > source/Utility/StringExtractor.cpp | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/source/Utility/StringExtractor.cpp b/source/Utility/StringExtractor.cpp > index 227b634..176eb89 100644 > --- a/source/Utility/StringExtractor.cpp > +++ b/source/Utility/StringExtractor.cpp > @@ -13,6 +13,8 @@ > // C++ Includes > // Other libraries and framework includes > // Project includes > +#include > + > > static inline int > xdigit_to_sint (char ch) > -- > 1.7.1 > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits From wilsons at start.ca Wed Apr 6 17:34:39 2011 From: wilsons at start.ca (Stephen Wilson) Date: Wed, 6 Apr 2011 18:34:39 -0400 Subject: [Lldb-commits] [lldb] r129018 - in /lldb/trunk/source/Plugins/Platform/Linux: PlatformLinux.cpp PlatformLinux.h In-Reply-To: <20110406185037.1BFF22A6C12D@llvm.org> References: <20110406185037.1BFF22A6C12D@llvm.org> Message-ID: <20110406223439.GB12484@fibrous.localdomain> On Wed, Apr 06, 2011 at 06:50:37PM -0000, Greg Clayton wrote: > +PlatformLinux:: FindProcesses const ProcessInfoMatch &match_info, > + ProcessInfoList &process_infos() > { > - return Host::FindProcessesByName (name_match, name_match_type, process_infos); > + return Host:: FindProcesses (match_info, process_infos); > } Missing parens? However, I think Marco's original patch was the right one (just delete FindProcessesByName, now FindProcesses, from PlatformLinux) since the base class handles the host case. We only need to override when doing remote debugging. No worries though, I can fix this up tonight :) -- steve From ctice at apple.com Wed Apr 6 18:30:18 2011 From: ctice at apple.com (Caroline Tice) Date: Wed, 06 Apr 2011 23:30:18 -0000 Subject: [Lldb-commits] [lldb] r129037 - /lldb/trunk/source/Core/EmulateInstruction.cpp Message-ID: <20110406233018.C71152A6C12D@llvm.org> Author: ctice Date: Wed Apr 6 18:30:18 2011 New Revision: 129037 URL: http://llvm.org/viewvc/llvm-project?rev=129037&view=rev Log: Translate dwarf register numbers to internal register numbers before trying to look them up in register contexts, in the emulation callback functions that read & write the frame registers. Modified: lldb/trunk/source/Core/EmulateInstruction.cpp Modified: lldb/trunk/source/Core/EmulateInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=129037&r1=129036&r2=129037&view=diff ============================================================================== --- lldb/trunk/source/Core/EmulateInstruction.cpp (original) +++ lldb/trunk/source/Core/EmulateInstruction.cpp Wed Apr 6 18:30:18 2011 @@ -272,8 +272,12 @@ RegisterContext *reg_context = frame->GetRegisterContext().get(); Scalar value; + uint32_t internal_reg_num = reg_context->ConvertRegisterKindToRegisterNumber (reg_kind, reg_num); - if (reg_context->ReadRegisterValue (reg_num, value)) + if (internal_reg_num == LLDB_INVALID_REGNUM) + return false; + + if (reg_context->ReadRegisterValue (internal_reg_num, value)) { reg_value = value.GetRawBits64 (0); return true; @@ -296,7 +300,11 @@ RegisterContext *reg_context = frame->GetRegisterContext().get(); Scalar value (reg_value); - return reg_context->WriteRegisterValue (reg_num, value); + uint32_t internal_reg_num = reg_context->ConvertRegisterKindToRegisterNumber (reg_kind, reg_num); + if (internal_reg_num != LLDB_INVALID_REGNUM) + return reg_context->WriteRegisterValue (internal_reg_num, value); + else + return false; } size_t From mminutoli at gmail.com Thu Apr 7 00:55:53 2011 From: mminutoli at gmail.com (Marco Minutoli) Date: Thu, 7 Apr 2011 07:55:53 +0200 Subject: [Lldb-commits] [PATCH 2/2] Missing header. In-Reply-To: <52870059-E652-47CE-BAF7-209D8DEFB948@apple.com> References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> <1302122654-16752-2-git-send-email-mminutoli@gmail.com> <52870059-E652-47CE-BAF7-209D8DEFB948@apple.com> Message-ID: No I don't have commit access. So please do it for me. Thank you. Marco On Thu, Apr 7, 2011 at 12:12 AM, Greg Clayton wrote: > Looks good. Marco, do you have commit access? If so, commit when you get > the chance. Else I will do so on your behalf. > > Greg Clayton > > On Apr 6, 2011, at 1:44 PM, Marco Minutoli wrote: > > > strtoul is defined in stdlib.h and the header was missing in > > StringExtractor.cpp . > > --- > > source/Utility/StringExtractor.cpp | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/source/Utility/StringExtractor.cpp > b/source/Utility/StringExtractor.cpp > > index 227b634..176eb89 100644 > > --- a/source/Utility/StringExtractor.cpp > > +++ b/source/Utility/StringExtractor.cpp > > @@ -13,6 +13,8 @@ > > // C++ Includes > > // Other libraries and framework includes > > // Project includes > > +#include > > + > > > > static inline int > > xdigit_to_sint (char ch) > > -- > > 1.7.1 > > > > _______________________________________________ > > lldb-commits mailing list > > lldb-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits > > -- Marco Minutoli "If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut." --A. Einstein -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/lldb-commits/attachments/20110407/4e68f173/attachment.html From mminutoli at gmail.com Thu Apr 7 00:56:50 2011 From: mminutoli at gmail.com (Marco Minutoli) Date: Thu, 7 Apr 2011 07:56:50 +0200 Subject: [Lldb-commits] [PATCH 1/2] Removed use of NSEC_PER_SEC. In-Reply-To: <7DA43CCF-C873-4C18-90F4-1C2DAA788E02@apple.com> References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> <7DA43CCF-C873-4C18-90F4-1C2DAA788E02@apple.com> Message-ID: No I don't have commit access. So please do it for me. Thank you. Marco On Thu, Apr 7, 2011 at 12:12 AM, Greg Clayton wrote: > Looks good. Marco, do you have commit access? If so, commit when you get > the chance. Else I will do so on your behalf. > > Greg Clayton > > On Apr 6, 2011, at 1:44 PM, Marco Minutoli wrote: > > > NSEC_PER_SEC is not defined in sys/time.h on Linux. I have replaced > > that macro with a static constant inside TimeValue. > > --- > > include/lldb/Host/TimeValue.h | 2 ++ > > .../gdb-remote/GDBRemoteCommunicationClient.cpp | 12 ++++++------ > > 2 files changed, 8 insertions(+), 6 deletions(-) > > > > diff --git a/include/lldb/Host/TimeValue.h > b/include/lldb/Host/TimeValue.h > > index 81d1aed..04b6015 100644 > > --- a/include/lldb/Host/TimeValue.h > > +++ b/include/lldb/Host/TimeValue.h > > @@ -29,6 +29,8 @@ namespace lldb_private { > > class TimeValue > > { > > public: > > + static const uint32_t NanoSecondPerSecond = 1000000000U; > > + > > //------------------------------------------------------------------ > > // Constructors and Destructors > > //------------------------------------------------------------------ > > diff --git > a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > index d0198a0..7ad3d44 100644 > > --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > @@ -1385,13 +1385,13 @@ GDBRemoteCommunicationClient::TestPacketSpeed > (const uint32_t num_packets) > > } > > end_time = TimeValue::Now(); > > total_time_nsec = > end_time.GetAsNanoSecondsSinceJan1_1970() - > start_time.GetAsNanoSecondsSinceJan1_1970(); > > - packets_per_second = > (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; > > + packets_per_second = > (((float)num_packets)/(float)total_time_nsec) * > (float)TimeValue::NanoSecondPerSecond; > > printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in > %llu.%09.9llu sec for %f packets/sec.\n", > > num_packets, > > send_size, > > recv_size, > > - total_time_nsec / NSEC_PER_SEC, > > - total_time_nsec % NSEC_PER_SEC, > > + total_time_nsec / > TimeValue::NanoSecondPerSecond, > > + total_time_nsec % > TimeValue::NanoSecondPerSecond, > > packets_per_second); > > if (recv_size == 0) > > recv_size = 32; > > @@ -1409,11 +1409,11 @@ GDBRemoteCommunicationClient::TestPacketSpeed > (const uint32_t num_packets) > > } > > end_time = TimeValue::Now(); > > total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - > start_time.GetAsNanoSecondsSinceJan1_1970(); > > - packets_per_second = > (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; > > + packets_per_second = > (((float)num_packets)/(float)total_time_nsec) * > (float)TimeValue::NanoSecondPerSecond; > > printf ("%u 'qC' packets packets in 0x%llu%09.9llu sec for %f > packets/sec.\n", > > num_packets, > > - total_time_nsec / NSEC_PER_SEC, > > - total_time_nsec % NSEC_PER_SEC, > > + total_time_nsec / TimeValue::NanoSecondPerSecond, > > + total_time_nsec % TimeValue::NanoSecondPerSecond, > > packets_per_second); > > } > > } > > -- > > 1.7.1 > > > > _______________________________________________ > > lldb-commits mailing list > > lldb-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits > > -- Marco Minutoli "If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut." --A. Einstein -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/lldb-commits/attachments/20110407/ed7cd5d9/attachment.html From wilsons at start.ca Thu Apr 7 05:16:53 2011 From: wilsons at start.ca (Stephen Wilson) Date: Thu, 07 Apr 2011 10:16:53 -0000 Subject: [Lldb-commits] [lldb] r129069 - in /lldb/trunk/source/Plugins/Platform/Linux: PlatformLinux.cpp PlatformLinux.h Message-ID: <20110407101653.6AEE12A6C12D@llvm.org> Author: wilsons Date: Thu Apr 7 05:16:53 2011 New Revision: 129069 URL: http://llvm.org/viewvc/llvm-project?rev=129069&view=rev Log: linux: remove ProcessLinux::FindProcesses This method only needs to be overridden in the remote debugging case, the base class handles the host case. Since we do not do remote debugging on Linux yet and there is a typo that causes a build issue, just remove this method for now. Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=129069&r1=129068&r2=129069&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Thu Apr 7 05:16:53 2011 @@ -191,13 +191,6 @@ { } -uint32_t -PlatformLinux:: FindProcesses const ProcessInfoMatch &match_info, - ProcessInfoList &process_infos() -{ - return Host:: FindProcesses (match_info, process_infos); -} - bool PlatformLinux::GetProcessInfo (lldb::pid_t pid, ProcessInfo &process_info) { Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h?rev=129069&r1=129068&r2=129069&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h Thu Apr 7 05:16:53 2011 @@ -84,10 +84,6 @@ GetFile (const FileSpec &platform_file, const UUID* uuid, FileSpec &local_file); - virtual uint32_t - FindProcesseses (const ProcessInfoMatch &match_info, - ProcessInfoList &process_infos); - virtual bool GetProcessInfo (lldb::pid_t pid, ProcessInfo &proc_info); From wilsons at start.ca Thu Apr 7 05:20:23 2011 From: wilsons at start.ca (Stephen Wilson) Date: Thu, 07 Apr 2011 10:20:23 -0000 Subject: [Lldb-commits] [lldb] r129070 - /lldb/trunk/source/Utility/StringExtractor.cpp Message-ID: <20110407102023.7F3442A6C12D@llvm.org> Author: wilsons Date: Thu Apr 7 05:20:23 2011 New Revision: 129070 URL: http://llvm.org/viewvc/llvm-project?rev=129070&view=rev Log: Add a missing header strtoul() is defined in stdlib.h and the header was missing in StringExtractor.cpp. Patch by Marco Minutoli! Modified: lldb/trunk/source/Utility/StringExtractor.cpp Modified: lldb/trunk/source/Utility/StringExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=129070&r1=129069&r2=129070&view=diff ============================================================================== --- lldb/trunk/source/Utility/StringExtractor.cpp (original) +++ lldb/trunk/source/Utility/StringExtractor.cpp Thu Apr 7 05:20:23 2011 @@ -10,6 +10,8 @@ #include "Utility/StringExtractor.h" // C Includes +#include + // C++ Includes // Other libraries and framework includes // Project includes From wilsons at start.ca Thu Apr 7 05:27:22 2011 From: wilsons at start.ca (Stephen Wilson) Date: Thu, 07 Apr 2011 10:27:22 -0000 Subject: [Lldb-commits] [lldb] r129071 - in /lldb/trunk: include/lldb/Host/TimeValue.h source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Message-ID: <20110407102722.BE6B02A6C12D@llvm.org> Author: wilsons Date: Thu Apr 7 05:27:22 2011 New Revision: 129071 URL: http://llvm.org/viewvc/llvm-project?rev=129071&view=rev Log: Removed use of NSEC_PER_SEC. NSEC_PER_SEC is not defined in sys/time.h on Linux. Replaced that macro with a static constant inside TimeValue. Patch by Marco Minutoli. Modified: lldb/trunk/include/lldb/Host/TimeValue.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Modified: lldb/trunk/include/lldb/Host/TimeValue.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/TimeValue.h?rev=129071&r1=129070&r2=129071&view=diff ============================================================================== --- lldb/trunk/include/lldb/Host/TimeValue.h (original) +++ lldb/trunk/include/lldb/Host/TimeValue.h Thu Apr 7 05:27:22 2011 @@ -29,6 +29,8 @@ class TimeValue { public: + static const uint32_t NanoSecondPerSecond = 1000000000U; + //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=129071&r1=129070&r2=129071&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Apr 7 05:27:22 2011 @@ -1385,13 +1385,13 @@ } end_time = TimeValue::Now(); total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970(); - packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; + packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecondPerSecond; printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in %llu.%09.9llu sec for %f packets/sec.\n", num_packets, send_size, recv_size, - total_time_nsec / NSEC_PER_SEC, - total_time_nsec % NSEC_PER_SEC, + total_time_nsec / TimeValue::NanoSecondPerSecond, + total_time_nsec % TimeValue::NanoSecondPerSecond, packets_per_second); if (recv_size == 0) recv_size = 32; @@ -1409,11 +1409,11 @@ } end_time = TimeValue::Now(); total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970(); - packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; + packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecondPerSecond; printf ("%u 'qC' packets packets in 0x%llu%09.9llu sec for %f packets/sec.\n", num_packets, - total_time_nsec / NSEC_PER_SEC, - total_time_nsec % NSEC_PER_SEC, + total_time_nsec / TimeValue::NanoSecondPerSecond, + total_time_nsec % TimeValue::NanoSecondPerSecond, packets_per_second); } } From wilsons at start.ca Thu Apr 7 05:34:55 2011 From: wilsons at start.ca (Stephen Wilson) Date: Thu, 7 Apr 2011 06:34:55 -0400 Subject: [Lldb-commits] [PATCH 2/2] Missing header. In-Reply-To: References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> <1302122654-16752-2-git-send-email-mminutoli@gmail.com> <52870059-E652-47CE-BAF7-209D8DEFB948@apple.com> Message-ID: <20110407103455.GA20341@fibrous.localdomain> On Thu, Apr 07, 2011 at 07:55:53AM +0200, Marco Minutoli wrote: > No I don't have commit access. So please do it for me. I had some time this morning and commited this for you in r129070. > Thank you. > Marco > > On Thu, Apr 7, 2011 at 12:12 AM, Greg Clayton wrote: > > > Looks good. Marco, do you have commit access? If so, commit when you get > > the chance. Else I will do so on your behalf. -- steve From wilsons at start.ca Thu Apr 7 05:40:05 2011 From: wilsons at start.ca (Stephen Wilson) Date: Thu, 7 Apr 2011 06:40:05 -0400 Subject: [Lldb-commits] [PATCH 1/2] Removed use of NSEC_PER_SEC. In-Reply-To: References: <1302122654-16752-1-git-send-email-mminutoli@gmail.com> <7DA43CCF-C873-4C18-90F4-1C2DAA788E02@apple.com> Message-ID: <20110407104005.GB20341@fibrous.localdomain> On Thu, Apr 07, 2011 at 07:56:50AM +0200, Marco Minutoli wrote: > No I don't have commit access. So please do it for me. Commited in r129071. Marco, there are still a few more build issues but they all look pretty simple at this point. The only thing left is to add makefile support for the ARM emulation plugin. I can find the time to fix up the remaining issues today. Thanks! > > Thank you. > Marco > > On Thu, Apr 7, 2011 at 12:12 AM, Greg Clayton wrote: > > > Looks good. Marco, do you have commit access? If so, commit when you get > > the chance. Else I will do so on your behalf. > > > > Greg Clayton > > > > On Apr 6, 2011, at 1:44 PM, Marco Minutoli wrote: > > > > > NSEC_PER_SEC is not defined in sys/time.h on Linux. I have replaced > > > that macro with a static constant inside TimeValue. > > > --- > > > include/lldb/Host/TimeValue.h | 2 ++ > > > .../gdb-remote/GDBRemoteCommunicationClient.cpp | 12 ++++++------ > > > 2 files changed, 8 insertions(+), 6 deletions(-) > > > > > > diff --git a/include/lldb/Host/TimeValue.h > > b/include/lldb/Host/TimeValue.h > > > index 81d1aed..04b6015 100644 > > > --- a/include/lldb/Host/TimeValue.h > > > +++ b/include/lldb/Host/TimeValue.h > > > @@ -29,6 +29,8 @@ namespace lldb_private { > > > class TimeValue > > > { > > > public: > > > + static const uint32_t NanoSecondPerSecond = 1000000000U; > > > + > > > //------------------------------------------------------------------ > > > // Constructors and Destructors > > > //------------------------------------------------------------------ > > > diff --git > > a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > > index d0198a0..7ad3d44 100644 > > > --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > > +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp > > > @@ -1385,13 +1385,13 @@ GDBRemoteCommunicationClient::TestPacketSpeed > > (const uint32_t num_packets) > > > } > > > end_time = TimeValue::Now(); > > > total_time_nsec = > > end_time.GetAsNanoSecondsSinceJan1_1970() - > > start_time.GetAsNanoSecondsSinceJan1_1970(); > > > - packets_per_second = > > (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; > > > + packets_per_second = > > (((float)num_packets)/(float)total_time_nsec) * > > (float)TimeValue::NanoSecondPerSecond; > > > printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in > > %llu.%09.9llu sec for %f packets/sec.\n", > > > num_packets, > > > send_size, > > > recv_size, > > > - total_time_nsec / NSEC_PER_SEC, > > > - total_time_nsec % NSEC_PER_SEC, > > > + total_time_nsec / > > TimeValue::NanoSecondPerSecond, > > > + total_time_nsec % > > TimeValue::NanoSecondPerSecond, > > > packets_per_second); > > > if (recv_size == 0) > > > recv_size = 32; > > > @@ -1409,11 +1409,11 @@ GDBRemoteCommunicationClient::TestPacketSpeed > > (const uint32_t num_packets) > > > } > > > end_time = TimeValue::Now(); > > > total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - > > start_time.GetAsNanoSecondsSinceJan1_1970(); > > > - packets_per_second = > > (((float)num_packets)/(float)total_time_nsec) * (float)NSEC_PER_SEC; > > > + packets_per_second = > > (((float)num_packets)/(float)total_time_nsec) * > > (float)TimeValue::NanoSecondPerSecond; > > > printf ("%u 'qC' packets packets in 0x%llu%09.9llu sec for %f > > packets/sec.\n", > > > num_packets, > > > - total_time_nsec / NSEC_PER_SEC, > > > - total_time_nsec % NSEC_PER_SEC, > > > + total_time_nsec / TimeValue::NanoSecondPerSecond, > > > + total_time_nsec % TimeValue::NanoSecondPerSecond, > > > packets_per_second); > > > } > > > } > > > -- > > > 1.7.1 > > > > > > _______________________________________________ > > > lldb-commits mailing list > > > lldb-commits at cs.uiuc.edu > > > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits > > > > > > > -- > Marco Minutoli > > "If A is success in life, then A equals x plus y plus z. Work is x; > y is play; and z is keeping your mouth shut." --A. Einstein > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits -- steve From gclayton at apple.com Thu Apr 7 17:46:35 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 07 Apr 2011 22:46:35 -0000 Subject: [Lldb-commits] [lldb] r129112 - in /lldb/trunk: include/lldb/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Interpreter/ include/lldb/Target/ lldb.xcodeproj/ scripts/ source/API/ source/Commands/ source/Core/ source/Interpreter/ source/Plugins/Disassembler/llvm/ source/Plugins/ObjectContainer/Universal-Mach-O/ source/Plugins/Platform/MacOSX/ source/Plugins/Process/gdb-remote/ source/Symbol/ source/Target/ Message-ID: <20110407224636.027D72A6C12D@llvm.org> Author: gclayton Date: Thu Apr 7 17:46:35 2011 New Revision: 129112 URL: http://llvm.org/viewvc/llvm-project?rev=129112&view=rev Log: Modified the ArchSpec to take an optional "Platform *" when setting the triple. This allows you to have a platform selected, then specify a triple using "i386" and have the remaining triple items (vendor, os, and environment) set automatically. Many interpreter commands take the "--arch" option to specify an architecture triple, so now the command options needed to be able to get to the current platform, so the Options class now take a reference to the interpreter on construction. Modified the build LLVM building in the Xcode project to use the new Xcode project level user definitions: LLVM_BUILD_DIR - a path to the llvm build directory LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb LLVM_CONFIGURATION - the configuration that lldb is built for (Release, Release+Asserts, Debug, Debug+Asserts). I also changed the LLVM build to not check if "lldb/llvm" is a symlink and then assume it is a real llvm build directory versus the unzipped llvm.zip package, so now you can actually have a "lldb/llvm" directory in your lldb sources. Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h lldb/trunk/include/lldb/Core/ArchSpec.h lldb/trunk/include/lldb/Core/STLUtils.h lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h lldb/trunk/include/lldb/Interpreter/Options.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/include/lldb/lldb-forward.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/scripts/build-llvm.pl lldb/trunk/source/API/SBDebugger.cpp lldb/trunk/source/API/SBInstruction.cpp lldb/trunk/source/Commands/CommandObjectArgs.cpp lldb/trunk/source/Commands/CommandObjectArgs.h lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp lldb/trunk/source/Commands/CommandObjectBreakpoint.h lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp lldb/trunk/source/Commands/CommandObjectBreakpointCommand.h lldb/trunk/source/Commands/CommandObjectCommands.cpp lldb/trunk/source/Commands/CommandObjectDisassemble.cpp lldb/trunk/source/Commands/CommandObjectDisassemble.h lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectExpression.h lldb/trunk/source/Commands/CommandObjectFile.cpp lldb/trunk/source/Commands/CommandObjectFile.h lldb/trunk/source/Commands/CommandObjectFrame.cpp lldb/trunk/source/Commands/CommandObjectHelp.cpp lldb/trunk/source/Commands/CommandObjectImage.cpp lldb/trunk/source/Commands/CommandObjectLog.cpp lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Commands/CommandObjectPlatform.cpp lldb/trunk/source/Commands/CommandObjectProcess.cpp lldb/trunk/source/Commands/CommandObjectRegister.cpp lldb/trunk/source/Commands/CommandObjectSettings.cpp lldb/trunk/source/Commands/CommandObjectSettings.h lldb/trunk/source/Commands/CommandObjectSource.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Commands/CommandObjectThread.cpp lldb/trunk/source/Core/ArchSpec.cpp lldb/trunk/source/Core/EmulateInstruction.cpp lldb/trunk/source/Interpreter/CommandObject.cpp lldb/trunk/source/Interpreter/Options.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp lldb/trunk/source/Symbol/SymbolContext.cpp lldb/trunk/source/Target/Process.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h (original) +++ lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h Thu Apr 7 17:46:35 2011 @@ -18,7 +18,6 @@ #include "lldb/lldb-private.h" #include "lldb/Core/Baton.h" #include "lldb/Core/StringList.h" -#include "lldb/Expression/ClangUserExpression.h" namespace lldb_private { Modified: lldb/trunk/include/lldb/Core/ArchSpec.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ArchSpec.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/ArchSpec.h (original) +++ lldb/trunk/include/lldb/Core/ArchSpec.h Thu Apr 7 17:46:35 2011 @@ -113,7 +113,7 @@ /// Triple. //------------------------------------------------------------------ ArchSpec (const llvm::Triple &triple); - ArchSpec (const char *triple_cstr); + ArchSpec (const char *triple_cstr, Platform *platform); //------------------------------------------------------------------ /// Constructor over architecture name. /// @@ -320,7 +320,7 @@ SetTriple (const llvm::Triple &triple); bool - SetTriple (const char *triple_cstr); + SetTriple (const char *triple_cstr, Platform *platform); //------------------------------------------------------------------ /// Returns the default endianness of the architecture. Modified: lldb/trunk/include/lldb/Core/STLUtils.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/STLUtils.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/STLUtils.h (original) +++ lldb/trunk/include/lldb/Core/STLUtils.h Thu Apr 7 17:46:35 2011 @@ -11,7 +11,6 @@ #define liblldb_STLUtils_h_ #if defined(__cplusplus) -#include "llvm/ADT/StringExtras.h" #include #include @@ -62,15 +61,6 @@ } }; -struct StdStringHash -{ - size_t operator()( const std::string& x ) const - { - return llvm::HashString(x); - } -}; - - template inline void PrintAllCollectionElements (std::ostream &s, const T& coll, const char* header_cstr=NULL, const char* separator_cstr=" ") { Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original) +++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Thu Apr 7 17:46:35 2011 @@ -19,6 +19,7 @@ // Other libraries and framework includes // Project includes +#include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseMap.h" #include "lldb/lldb-public.h" #include "lldb/Core/ClangForward.h" Modified: lldb/trunk/include/lldb/Interpreter/Options.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Options.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/Interpreter/Options.h (original) +++ lldb/trunk/include/lldb/Interpreter/Options.h Thu Apr 7 17:46:35 2011 @@ -73,7 +73,7 @@ /// return error; /// } /// -/// CommandOptions () : debug (true), verbose (false), log_file (), log_flags (0) +/// CommandOptions (CommandInterpreter &interpreter) : debug (true), verbose (false), log_file (), log_flags (0) /// {} /// /// bool debug; @@ -112,7 +112,7 @@ { public: - Options (); + Options (CommandInterpreter &interpreter); virtual ~Options (); @@ -157,8 +157,7 @@ uint32_t output_max_columns); void - GenerateOptionUsage (CommandInterpreter &interpreter, - Stream &strm, + GenerateOptionUsage (Stream &strm, CommandObject *cmd); // The following two pure virtual functions must be defined by every class that inherits from @@ -227,8 +226,7 @@ /// \btrue if we were in an option, \bfalse otherwise. //------------------------------------------------------------------ bool - HandleOptionCompletion (CommandInterpreter &interpreter, - Args &input, + HandleOptionCompletion (Args &input, OptionElementVector &option_map, int cursor_index, int char_pos, @@ -277,8 +275,7 @@ /// \btrue if we were in an option, \bfalse otherwise. //------------------------------------------------------------------ virtual bool - HandleOptionArgumentCompletion (CommandInterpreter &interpreter, - Args &input, + HandleOptionArgumentCompletion (Args &input, int cursor_index, int char_pos, OptionElementVector &opt_element_vector, @@ -293,6 +290,7 @@ typedef std::set OptionSet; typedef std::vector OptionSetVector; + CommandInterpreter &m_interpreter; std::vector m_getopt_table; OptionSet m_seen_options; OptionSetVector m_required_options; Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Thu Apr 7 17:46:35 2011 @@ -22,6 +22,7 @@ #include "lldb/Core/Event.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/UserSettingsController.h" +#include "lldb/Expression/ClangPersistentVariables.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ABI.h" #include "lldb/Target/ExecutionContextScope.h" Modified: lldb/trunk/include/lldb/lldb-forward.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/include/lldb/lldb-forward.h (original) +++ lldb/trunk/include/lldb/lldb-forward.h Thu Apr 7 17:46:35 2011 @@ -51,6 +51,7 @@ class ClangExpressionVariableList; class ClangExpressionVariables; class ClangPersistentVariables; +class ClangUserExpression; class CommandInterpreter; class CommandObject; class CommandReturnObject; Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Apr 7 17:46:35 2011 @@ -2716,8 +2716,8 @@ files = ( ); inputPaths = ( + "$(LLVM_SOURCE_DIR)", "$(LLVM_BUILD_DIR)", - "$(SRCROOT)/scripts/build-llvm.pl", ); name = "Build llvm and clang"; outputPaths = ( @@ -3170,10 +3170,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - x86_64, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -3192,6 +3189,10 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = ""; + LLVM_CONFIGURATION = Release; + LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; @@ -3202,10 +3203,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - x86_64, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( __STDC_CONSTANT_MACROS, @@ -3223,6 +3221,10 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = ""; + LLVM_CONFIGURATION = Release; + LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; }; @@ -3235,11 +3237,9 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; INSTALL_PATH = /Developer/usr/bin; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; PRODUCT_NAME = "darwin-debug"; }; name = Debug; @@ -3251,12 +3251,9 @@ COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; INSTALL_PATH = /Developer/usr/bin; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; PRODUCT_NAME = "darwin-debug"; - ZERO_LINK = NO; }; name = Release; }; @@ -3266,10 +3263,8 @@ ALWAYS_SEARCH_USER_PATHS = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; INSTALL_PATH = /Developer/usr/bin; ONLY_ACTIVE_ARCH = NO; - PREBINDING = NO; PRODUCT_NAME = "darwin-debug"; }; name = BuildAndIntegration; @@ -3305,8 +3300,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; OTHER_CFLAGS = "-Wparentheses"; OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3319,9 +3312,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = LLDB; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -3357,8 +3349,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; OTHER_CFLAGS = "-Wparentheses"; OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3371,18 +3361,15 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = LLDB; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = Release; }; 2689FFD513353D7A00698AC0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 46; DYLIB_CURRENT_VERSION = 46; @@ -3403,8 +3390,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-Wparentheses"; @@ -3416,7 +3401,7 @@ OTHER_LDFLAGS = "-lllvmclang"; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -3424,7 +3409,6 @@ 2689FFD613353D7A00698AC0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 46; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -3446,8 +3430,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(SRCROOT)/llvm"; - LLVM_CONFIGURATION = Release; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-Wparentheses"; @@ -3459,7 +3441,7 @@ OTHER_LDFLAGS = "-lllvmclang"; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -3467,7 +3449,6 @@ 2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 46; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -3489,8 +3470,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(DERIVED_FILE_DIR)/llvm.build"; - LLVM_CONFIGURATION = Release; MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-Wparentheses"; @@ -3502,7 +3481,7 @@ OTHER_LDFLAGS = "-lllvmclang"; PRODUCT_NAME = "lib$(TARGET_NAME)"; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = BuildAndIntegration; @@ -3511,10 +3490,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - x86_64, - i386, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_PREPROCESSOR_DEFINITIONS = ( __STDC_CONSTANT_MACROS, @@ -3532,6 +3508,10 @@ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_BUILD_DIR = "$(OBJROOT)/llvm"; + LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/"; + LLVM_CONFIGURATION = Release; + LLVM_SOURCE_DIR = "$(SRCROOT)/llvm"; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; }; @@ -3549,7 +3529,6 @@ ); GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "lldb-Info.plist"; @@ -3563,11 +3542,9 @@ "$(PROJECT_DIR)/tools/driver/lldb-Info.plist", "-Wl,-rpath, at loader_path/../../Library/PrivateFrameworks/", ); - PREBINDING = NO; PRODUCT_NAME = lldb; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = BuildAndIntegration; }; @@ -3602,8 +3579,6 @@ "$(inherited)", "$(LLVM_BUILD_DIR)", ); - LLVM_BUILD_DIR = "$(DERIVED_FILE_DIR)/llvm.build"; - LLVM_CONFIGURATION = Release; OTHER_CFLAGS = "-Wparentheses"; OTHER_CPLUSPLUSFLAGS = ( "-fno-rtti", @@ -3616,11 +3591,9 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = LLDB; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/source $(SRCROOT)/source/Plugins/Process/Utility $(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = BuildAndIntegration; }; @@ -3636,7 +3609,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = /usr/local/bin; @@ -3646,9 +3618,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = "lldb-platform"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include $(SRCROOT)/source/Plugins/Process/gdb-remote $(SRCROOT)/source"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; }; name = Debug; }; @@ -3664,7 +3635,6 @@ ); GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = /usr/local/bin; OTHER_LDFLAGS = ( @@ -3673,10 +3643,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = "lldb-platform"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include $(SRCROOT)/source/Plugins/Process/gdb-remote $(SRCROOT)/source"; - ZERO_LINK = NO; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; }; name = Release; }; @@ -3690,7 +3658,6 @@ ); GCC_ENABLE_CPP_RTTI = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = /usr/local/bin; OTHER_LDFLAGS = ( @@ -3699,9 +3666,8 @@ "-framework", AppKit, ); - PREBINDING = NO; PRODUCT_NAME = "lldb-platform"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include $(SRCROOT)/source/Plugins/Process/gdb-remote $(SRCROOT)/source"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; }; name = BuildAndIntegration; }; @@ -3718,7 +3684,6 @@ ); GCC_DYNAMIC_NO_PIC = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; @@ -3733,9 +3698,8 @@ "$(PROJECT_DIR)/tools/driver/lldb-Info.plist", "-Wl,-rpath, at loader_path/", ); - PREBINDING = NO; PRODUCT_NAME = lldb; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -3743,10 +3707,6 @@ 26F5C26D10F3D9A5009D5894 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - x86_64, - i386, - ); CODE_SIGN_IDENTITY = lldb_codesign; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 46; @@ -3757,7 +3717,6 @@ ); GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_MODEL_TUNING = G5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "lldb-Info.plist"; @@ -3771,11 +3730,9 @@ "$(PROJECT_DIR)/tools/driver/lldb-Info.plist", "-Wl,-rpath, at loader_path/", ); - PREBINDING = NO; PRODUCT_NAME = lldb; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source/Host/macosx/cfcpp $(SRCROOT)/llvm/include $(SRCROOT)/llvm/tools/clang/include $(LLVM_BUILD_DIR)/llvm/include $(LLVM_BUILD_DIR)/llvm/tools/clang/include"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include"; VERSIONING_SYSTEM = "apple-generic"; - ZERO_LINK = NO; }; name = Release; }; Modified: lldb/trunk/scripts/build-llvm.pl URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/build-llvm.pl?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/scripts/build-llvm.pl (original) +++ lldb/trunk/scripts/build-llvm.pl Thu Apr 7 17:46:35 2011 @@ -13,7 +13,8 @@ use File::Glob ':glob'; use List::Util qw[min max]; -our $llvm_dstroot = $ENV{SCRIPT_INPUT_FILE_0}; +our $llvm_srcroot = $ENV{SCRIPT_INPUT_FILE_0}; +our $llvm_dstroot = $ENV{SCRIPT_INPUT_FILE_1}; our $libedis_outfile = $ENV{SCRIPT_OUTPUT_FILE_0}; our ($libedis_basename, $libedis_dirname) = fileparse ($libedis_outfile); @@ -27,8 +28,6 @@ our $llvm_revision = "128303"; our $llvm_source_dir = "$ENV{SRCROOT}"; -our $cc = "$ENV{DEVELOPER_BIN_DIR}/gcc-4.2"; -our $cxx = "$ENV{DEVELOPER_BIN_DIR}/g++-4.2"; our @archs = split (/\s+/, $ENV{ARCHS}); our @archive_files = ( @@ -84,7 +83,7 @@ "$llvm_configuration/lib/libLLVMX86Utils.a", ); -if (-l $llvm_dstroot) +if (-e "$llvm_srcroot/lib") { print "Using standard LLVM build directory...\n"; # LLVM in the "lldb" root is a symlink which indicates we are using a @@ -230,7 +229,7 @@ print "Configuring clang ($arch) in '$llvm_dstroot_arch'...\n"; my $lldb_configuration_options = ''; $llvm_configuration eq 'Release' and $lldb_configuration_options .= '--enable-optimized --disable-assertions'; - do_command ("cd '$llvm_dstroot_arch' && '$llvm_source_dir/llvm/configure' $lldb_configuration_options --enable-targets=x86_64,arm --build=$arch-apple-darwin10 CC=\"$cc -arch $arch\" CXX=\"$cxx -arch $arch\"", + do_command ("cd '$llvm_dstroot_arch' && '$llvm_source_dir/llvm/configure' $lldb_configuration_options --enable-targets=x86_64,arm --build=$arch-apple-darwin10", "configuring llvm build", 1); } Modified: lldb/trunk/source/API/SBDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/API/SBDebugger.cpp (original) +++ lldb/trunk/source/API/SBDebugger.cpp Thu Apr 7 17:46:35 2011 @@ -358,7 +358,7 @@ { if (arch_name) { - ArchSpec arch (arch_name); + ArchSpec arch (arch_name, NULL); if (arch.IsValid()) { lldb_private::Target::SetDefaultArchitecture (arch); @@ -425,7 +425,7 @@ { ArchSpec arch; FileSpec file_spec (filename, true); - arch.SetTriple (target_triple); + arch.SetTriple (target_triple, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); TargetSP target_sp; Error error (m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, file_spec, arch, true, target_sp)); target.reset (target_sp); @@ -455,7 +455,7 @@ Error error; if (arch_cstr) - arch.SetTriple (arch_cstr); + arch.SetTriple (arch_cstr, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, file, arch, true, target_sp); @@ -534,7 +534,7 @@ if (m_opaque_sp && filename && filename[0]) { // No need to lock, the target list is thread safe - ArchSpec arch (arch_name); + ArchSpec arch (arch_name, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get()); TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture (FileSpec(filename, false), arch_name ? &arch : NULL)); sb_target.reset(target_sp); } Modified: lldb/trunk/source/API/SBInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstruction.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/API/SBInstruction.cpp (original) +++ lldb/trunk/source/API/SBInstruction.cpp Thu Apr 7 17:46:35 2011 @@ -140,7 +140,7 @@ { if (m_opaque_sp && triple) { - lldb_private::ArchSpec arch (triple); + lldb_private::ArchSpec arch (triple, NULL); return m_opaque_sp->Emulate (arch, NULL, Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Thu Apr 7 17:46:35 2011 @@ -36,8 +36,8 @@ // calling functions. // -CommandObjectArgs::CommandOptions::CommandOptions () : - Options() +CommandObjectArgs::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { // Keep only one place to reset the values to their defaults ResetOptionValues(); @@ -80,7 +80,8 @@ CommandObject (interpreter, "args", "When stopped at the start of a function, reads function arguments of type (u?)int(8|16|32|64)_t, (void|char)*", - "args") + "args"), + m_options (interpreter) { } Modified: lldb/trunk/source/Commands/CommandObjectArgs.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectArgs.h (original) +++ lldb/trunk/source/Commands/CommandObjectArgs.h Thu Apr 7 17:46:35 2011 @@ -28,7 +28,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Thu Apr 7 17:46:35 2011 @@ -47,8 +47,8 @@ //------------------------------------------------------------------------- #pragma mark Set::CommandOptions -CommandObjectBreakpointSet::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointSet::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_filename (), m_line_num (0), m_column (0), @@ -259,7 +259,8 @@ CommandObject (interpreter, "breakpoint set", "Sets a breakpoint or set of breakpoints in the executable.", - "breakpoint set ") + "breakpoint set "), + m_options (interpreter) { } @@ -637,8 +638,8 @@ //------------------------------------------------------------------------- #pragma mark List::CommandOptions -CommandObjectBreakpointList::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointList::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_level (lldb::eDescriptionLevelBrief) // Breakpoint List defaults to brief descriptions { } @@ -717,7 +718,8 @@ CommandObject (interpreter, "breakpoint list", "List some or all breakpoints at configurable levels of detail.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData bp_id_arg; @@ -1045,8 +1047,8 @@ //------------------------------------------------------------------------- #pragma mark Clear::CommandOptions -CommandObjectBreakpointClear::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointClear::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_filename (), m_line_num (0) { @@ -1114,7 +1116,8 @@ CommandObject (interpreter, "breakpoint clear", "Clears a breakpoint or set of breakpoints in the executable.", - "breakpoint clear ") + "breakpoint clear "), + m_options (interpreter) { } @@ -1348,8 +1351,8 @@ //------------------------------------------------------------------------- #pragma mark Modify::CommandOptions -CommandObjectBreakpointModify::CommandOptions::CommandOptions() : - Options (), +CommandObjectBreakpointModify::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_ignore_count (0), m_thread_id(LLDB_INVALID_THREAD_ID), m_thread_id_passed(false), @@ -1504,7 +1507,8 @@ "Modify the options on a breakpoint or set of breakpoints in the executable. " "If no breakpoint is specified, acts on the last created breakpoint. " "With the exception of -e, -d and -i, passing an empty argument clears the modification.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData bp_id_arg; Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectBreakpoint.h (original) +++ lldb/trunk/source/Commands/CommandObjectBreakpoint.h Thu Apr 7 17:46:35 2011 @@ -76,7 +76,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); @@ -142,7 +142,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); @@ -243,7 +243,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); @@ -303,7 +303,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp Thu Apr 7 17:46:35 2011 @@ -31,8 +31,8 @@ // CommandObjectBreakpointCommandAdd::CommandOptions //------------------------------------------------------------------------- -CommandObjectBreakpointCommandAdd::CommandOptions::CommandOptions () : - Options (), +CommandObjectBreakpointCommandAdd::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), m_use_commands (false), m_use_script_language (false), m_script_language (eScriptLanguageNone), @@ -153,7 +153,8 @@ CommandObject (interpreter, "add", "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit.", - NULL) + NULL), + m_options (interpreter) { SetHelpLong ( "\nGeneral information about entering breakpoint commands \n\ Modified: lldb/trunk/source/Commands/CommandObjectBreakpointCommand.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpointCommand.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectBreakpointCommand.h (original) +++ lldb/trunk/source/Commands/CommandObjectBreakpointCommand.h Thu Apr 7 17:46:35 2011 @@ -95,7 +95,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Thu Apr 7 17:46:35 2011 @@ -34,7 +34,10 @@ { public: - CommandOptions (){} + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) + { + } virtual ~CommandOptions (){} @@ -106,7 +109,8 @@ CommandObject (interpreter, "commands source", "Read in debugger commands from the file and execute them.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Thu Apr 7 17:46:35 2011 @@ -32,8 +32,8 @@ using namespace lldb; using namespace lldb_private; -CommandObjectDisassemble::CommandOptions::CommandOptions () : - Options(), +CommandObjectDisassemble::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter), num_lines_context(0), num_instructions (0), func_name(), @@ -128,7 +128,7 @@ break; case 'a': - arch.SetTriple (option_arg); + arch.SetTriple (option_arg, m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform().get()); break; default: @@ -195,7 +195,8 @@ CommandObject (interpreter, "disassemble", "Disassemble bytes in the current function, or elsewhere in the executable program as specified by the user.", - "disassemble []") + "disassemble []"), + m_options (interpreter) { } @@ -248,10 +249,7 @@ if (command.GetArgumentCount() != 0) { result.AppendErrorWithFormat ("\"disassemble\" arguments are specified as options.\n"); - GetOptions()->GenerateOptionUsage (m_interpreter, - result.GetErrorStream(), - this); - + GetOptions()->GenerateOptionUsage (result.GetErrorStream(), this); result.SetStatus (eReturnStatusFailed); return false; } Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectDisassemble.h (original) +++ lldb/trunk/source/Commands/CommandObjectDisassemble.h Thu Apr 7 17:46:35 2011 @@ -30,7 +30,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Thu Apr 7 17:46:35 2011 @@ -37,8 +37,8 @@ using namespace lldb; using namespace lldb_private; -CommandObjectExpression::CommandOptions::CommandOptions () : - Options() +CommandObjectExpression::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { // Keep only one place to reset the values to their defaults ResetOptionValues(); @@ -115,6 +115,7 @@ "expression", "Evaluate a C/ObjC/C++ expression in the current program context, using variables currently in scope.", NULL), + m_options (interpreter), m_expr_line_count (0), m_expr_lines () { Modified: lldb/trunk/source/Commands/CommandObjectExpression.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectExpression.h (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.h Thu Apr 7 17:46:35 2011 @@ -29,7 +29,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectFile.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFile.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectFile.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectFile.cpp Thu Apr 7 17:46:35 2011 @@ -25,8 +25,8 @@ using namespace lldb; using namespace lldb_private; -CommandObjectFile::CommandOptions::CommandOptions() : - Options (), +CommandObjectFile::CommandOptions::CommandOptions(CommandInterpreter &interpreter) : + Options (interpreter), m_arch () // Breakpoint info defaults to brief descriptions { } @@ -58,7 +58,8 @@ { case 'a': { - ArchSpec option_arch (option_arg); + PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform()); + ArchSpec option_arch (option_arg, platform_sp.get()); if (option_arch.IsValid()) m_arch = option_arch; else @@ -88,7 +89,8 @@ CommandObject (interpreter, "file", "Set the file to be used as the main executable by the debugger.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; Modified: lldb/trunk/source/Commands/CommandObjectFile.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFile.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectFile.h (original) +++ lldb/trunk/source/Commands/CommandObjectFile.h Thu Apr 7 17:46:35 2011 @@ -44,7 +44,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Thu Apr 7 17:46:35 2011 @@ -99,8 +99,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { ResetOptionValues (); } @@ -155,7 +155,8 @@ "frame select", "Select a frame by index from within the current thread and make it the current frame.", NULL, - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData index_arg; @@ -224,7 +225,7 @@ else { result.AppendError ("invalid arguments.\n"); - m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this); + m_options.GenerateOptionUsage (result.GetErrorStream(), this); } } @@ -289,8 +290,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { ResetOptionValues (); } @@ -407,7 +408,8 @@ "Children of aggregate variables can be specified such as " "'var->child.x'.", NULL, - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData var_name_arg; Modified: lldb/trunk/source/Commands/CommandObjectHelp.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectHelp.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectHelp.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectHelp.cpp Thu Apr 7 17:46:35 2011 @@ -140,7 +140,7 @@ else m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1); output_strm.Printf ("\nSyntax: %s\n", sub_cmd_obj->GetSyntax()); - sub_cmd_obj->GetOptions()->GenerateOptionUsage (m_interpreter, output_strm, sub_cmd_obj); + sub_cmd_obj->GetOptions()->GenerateOptionUsage (output_strm, sub_cmd_obj); const char *long_help = sub_cmd_obj->GetHelpLong(); if ((long_help != NULL) && (strlen (long_help) > 0)) Modified: lldb/trunk/source/Commands/CommandObjectImage.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectImage.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectImage.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectImage.cpp Thu Apr 7 17:46:35 2011 @@ -603,7 +603,8 @@ CommandObjectImageDumpModuleList (interpreter, "image dump symtab", "Dump the symbol table from one or more executable images.", - NULL) + NULL), + m_options (interpreter) { } @@ -719,8 +720,8 @@ { public: - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter), m_sort_order (eSortOrderNone) { } @@ -1140,8 +1141,8 @@ { public: - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter), m_format_array() { } @@ -1188,7 +1189,8 @@ CommandObject (interpreter, "image list", "List current executable and dependent shared library images.", - "image list []") + "image list []"), + m_options (interpreter) { } @@ -1346,8 +1348,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(m_interpreter) { ResetOptionValues(); } @@ -1463,7 +1465,8 @@ CommandObject (interpreter, "image lookup", "Look up information within executable and dependent shared library images.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; @@ -1572,7 +1575,7 @@ break; default: - m_options.GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this); + m_options.GenerateOptionUsage (result.GetErrorStream(), this); syntax_error = true; break; } Modified: lldb/trunk/source/Commands/CommandObjectLog.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLog.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectLog.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectLog.cpp Thu Apr 7 17:46:35 2011 @@ -62,7 +62,8 @@ CommandObject (interpreter, "log enable", "Enable logging for a single log channel.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg1; @@ -168,8 +169,8 @@ { public: - CommandOptions () : - Options (), + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), log_file (), log_options (0) { Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Thu Apr 7 17:46:35 2011 @@ -36,8 +36,8 @@ class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { ResetOptionValues(); } @@ -198,7 +198,8 @@ "memory read", "Read from the memory of the process being debugged.", NULL, - eFlagProcessMustBeLaunched) + eFlagProcessMustBeLaunched), + m_options (interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -434,8 +435,8 @@ class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { ResetOptionValues(); } @@ -521,7 +522,8 @@ "Write to the memory of the process being debugged.", //"memory write [] [value1 value2 ...]", NULL, - eFlagProcessMustBeLaunched) + eFlagProcessMustBeLaunched), + m_options (interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Thu Apr 7 17:46:35 2011 @@ -19,8 +19,10 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/Options.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Platform.h" +#include "lldb/Target/Process.h" using namespace lldb; using namespace lldb_private; @@ -36,7 +38,8 @@ "platform create", "Create a platform instance by name and select it as the current platform.", "platform create ", - 0) + 0), + m_options (interpreter) { } @@ -86,7 +89,8 @@ { public: - CommandOptions () : + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), os_version_major (UINT32_MAX), os_version_minor (UINT32_MAX), os_version_update (UINT32_MAX) @@ -418,11 +422,12 @@ { public: CommandObjectPlatformProcessList (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "platform process list", - "List processes on a remote platform by name, pid, or many other matching attributes.", - "platform process list", - 0) + CommandObject (interpreter, + "platform process list", + "List processes on a remote platform by name, pid, or many other matching attributes.", + "platform process list", + 0), + m_options (interpreter) { } @@ -529,7 +534,8 @@ { public: - CommandOptions () : + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), match_info () { } @@ -585,7 +591,7 @@ break; case 'a': - match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg); + match_info.GetProcessInfo().GetArchitecture().SetTriple (option_arg, m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform().get()); break; case 'n': Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Thu Apr 7 17:46:35 2011 @@ -40,8 +40,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -121,7 +121,8 @@ CommandObject (interpreter, "process launch", "Launch the executable in the debugger.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData run_args_arg; @@ -433,8 +434,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -494,8 +495,7 @@ } virtual bool - HandleOptionArgumentCompletion (CommandInterpreter &interpeter, - Args &input, + HandleOptionArgumentCompletion (Args &input, int cursor_index, int char_pos, OptionElementVector &opt_element_vector, @@ -521,7 +521,7 @@ const char *partial_name = NULL; partial_name = input.GetArgumentAtIndex(opt_arg_pos); - PlatformSP platform_sp (interpeter.GetDebugger().GetPlatformList().GetSelectedPlatform ()); + PlatformSP platform_sp (m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform ()); if (platform_sp) { ProcessInfoList process_infos; @@ -563,7 +563,8 @@ CommandObject (interpreter, "process attach", "Attach to a process.", - "process attach ") + "process attach "), + m_options (interpreter) { } @@ -983,8 +984,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -1035,11 +1036,12 @@ }; CommandObjectProcessConnect (CommandInterpreter &interpreter) : - CommandObject (interpreter, - "process connect", - "Connect to a remote debug service.", - "process connect ", - 0) + CommandObject (interpreter, + "process connect", + "Connect to a remote debug service.", + "process connect ", + 0), + m_options (interpreter) { } @@ -1568,8 +1570,8 @@ { public: - CommandOptions () : - Options () + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) { ResetOptionValues (); } @@ -1632,7 +1634,8 @@ CommandObject (interpreter, "process handle", "Show or update what the process and debugger should do with various signals received from the OS.", - NULL) + NULL), + m_options (interpreter) { SetHelpLong ("If no signals are specified, update them all. If no update option is specified, list the current values.\n"); CommandArgumentEntry arg; Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Thu Apr 7 17:46:35 2011 @@ -19,6 +19,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/Options.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/RegisterContext.h" @@ -37,7 +38,8 @@ "Dump the contents of one or more register values from the current frame. If no register is specified, dumps them all.", //"register read [ [ [...]]]", NULL, - eFlagProcessMustBeLaunched | eFlagProcessMustBePaused) + eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData register_arg; @@ -154,8 +156,8 @@ class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { ResetOptionValues(); } Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Thu Apr 7 17:46:35 2011 @@ -66,7 +66,7 @@ "settings set", "Set or change the value of a single debugger setting variable.", NULL), - m_options () + m_options (interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -237,8 +237,8 @@ // CommandObjectSettingsSet::CommandOptions //------------------------------------------------------------------------- -CommandObjectSettingsSet::CommandOptions::CommandOptions () : - Options (), +CommandObjectSettingsSet::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), m_override (true), m_reset (false) { Modified: lldb/trunk/source/Commands/CommandObjectSettings.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.h?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectSettings.h (original) +++ lldb/trunk/source/Commands/CommandObjectSettings.h Thu Apr 7 17:46:35 2011 @@ -59,7 +59,7 @@ { public: - CommandOptions (); + CommandOptions (CommandInterpreter &interpreter); virtual ~CommandOptions (); Modified: lldb/trunk/source/Commands/CommandObjectSource.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSource.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectSource.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectSource.cpp Thu Apr 7 17:46:35 2011 @@ -37,8 +37,8 @@ class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { } @@ -98,7 +98,8 @@ CommandObject (interpreter, "source info", "Display information about the source lines from the current executable's debug info.", - "source info []") + "source info []"), + m_options (interpreter) { } @@ -148,8 +149,8 @@ class CommandOptions : public Options { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { } @@ -227,7 +228,8 @@ CommandObject (interpreter, "source list", "Display source code (as specified) based on the current executable's debug info.", - NULL) + NULL), + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu Apr 7 17:46:35 2011 @@ -489,8 +489,8 @@ class CommandOptions : public Options { public: - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter), m_line_start(0), m_line_end (UINT_MAX), m_func_name_type_mask (eFunctionNameTypeAuto), @@ -634,7 +634,8 @@ CommandObject (interpreter, "target stop-hook add ", "Add a hook to be executed when the target stops.", - "target stop-hook add") + "target stop-hook add"), + m_options (interpreter) { } Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectThread.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectThread.cpp Thu Apr 7 17:46:35 2011 @@ -249,8 +249,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options(interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -325,7 +325,7 @@ "Show the stack for one or more threads. If no threads are specified, show the currently selected thread. Use the thread-index \"all\" to see all threads.", NULL, eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), - m_options() + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData thread_idx_arg; @@ -487,8 +487,8 @@ { public: - CommandOptions () : - Options() + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter) { // Keep default values of all options in one place: ResetOptionValues () ResetOptionValues (); @@ -575,7 +575,7 @@ CommandObject (interpreter, name, help, syntax, flags), m_step_type (step_type), m_step_scope (step_scope), - m_options () + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData thread_id_arg; @@ -976,8 +976,8 @@ uint32_t m_thread_idx; uint32_t m_frame_idx; - CommandOptions () : - Options(), + CommandOptions (CommandInterpreter &interpreter) : + Options (interpreter), m_thread_idx(LLDB_INVALID_THREAD_ID), m_frame_idx(LLDB_INVALID_FRAME_ID) { @@ -1069,7 +1069,7 @@ "Run the current or specified thread until it reaches a given line number or leaves the current function.", NULL, eFlagProcessMustBeLaunched | eFlagProcessMustBePaused), - m_options () + m_options (interpreter) { CommandArgumentEntry arg; CommandArgumentData line_num_arg; Modified: lldb/trunk/source/Core/ArchSpec.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Core/ArchSpec.cpp (original) +++ lldb/trunk/source/Core/ArchSpec.cpp Thu Apr 7 17:46:35 2011 @@ -18,6 +18,7 @@ #include "llvm/Support/MachO.h" #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" +#include "lldb/Target/Platform.h" using namespace lldb; using namespace lldb_private; @@ -273,13 +274,13 @@ { } -ArchSpec::ArchSpec (const char *triple_cstr) : +ArchSpec::ArchSpec (const char *triple_cstr, Platform *platform) : m_triple (), m_core (kCore_invalid), m_byte_order (eByteOrderInvalid) { if (triple_cstr) - SetTriple(triple_cstr); + SetTriple(triple_cstr, platform); } ArchSpec::ArchSpec(const llvm::Triple &triple) : @@ -417,18 +418,10 @@ if (core_def) { m_core = core_def->core; - m_byte_order = core_def->default_byte_order; - - if (m_triple.getVendor() == llvm::Triple::UnknownVendor && - m_triple.getOS() == llvm::Triple::UnknownOS && - m_triple.getEnvironment() == llvm::Triple::UnknownEnvironment) - { - llvm::Triple host_triple(llvm::sys::getHostTriple()); - - m_triple.setVendor(host_triple.getVendor()); - m_triple.setOS(host_triple.getOS()); - m_triple.setEnvironment(host_triple.getEnvironment()); - } + // Set the byte order to the default byte order for an architecture. + // This can be modified if needed for cases when cores handle both + // big and little endian + m_byte_order = core_def->default_byte_order; } else { @@ -440,7 +433,7 @@ } bool -ArchSpec::SetTriple (const char *triple_cstr) +ArchSpec::SetTriple (const char *triple_cstr, Platform *platform) { if (triple_cstr || triple_cstr[0]) { @@ -459,7 +452,46 @@ { std::string normalized_triple_sstr (llvm::Triple::normalize(triple_stref)); triple_stref = normalized_triple_sstr; - SetTriple (llvm::Triple (triple_stref)); + llvm::Triple normalized_triple (triple_stref); + + const bool os_specified = normalized_triple.getOSName().size() > 0; + const bool vendor_specified = normalized_triple.getVendorName().size() > 0; + const bool env_specified = normalized_triple.getEnvironmentName().size() > 0; + + // If we got an arch only, then default the vendor, os, environment + // to match the platform if one is supplied + if (!(os_specified || vendor_specified || env_specified)) + { + if (platform) + { + // If we were given a platform, use the platform's system + // architecture. If this is not available (might not be + // connected) use the first supported architecture. + ArchSpec platform_arch (platform->GetSystemArchitecture()); + if (!platform_arch.IsValid()) + { + if (!platform->GetSupportedArchitectureAtIndex (0, platform_arch)) + platform_arch.Clear(); + } + + if (platform_arch.IsValid()) + { + normalized_triple.setVendor(platform_arch.GetTriple().getVendor()); + normalized_triple.setOS(platform_arch.GetTriple().getOS()); + normalized_triple.setEnvironment(platform_arch.GetTriple().getEnvironment()); + } + } + else + { + // No platform specified, fall back to the host system for + // the default vendor, os, and environment. + llvm::Triple host_triple(llvm::sys::getHostTriple()); + normalized_triple.setVendor(host_triple.getVendor()); + normalized_triple.setOS(host_triple.getOS()); + normalized_triple.setEnvironment(host_triple.getEnvironment()); + } + } + SetTriple (normalized_triple); } } else Modified: lldb/trunk/source/Core/EmulateInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Core/EmulateInstruction.cpp (original) +++ lldb/trunk/source/Core/EmulateInstruction.cpp Thu Apr 7 17:46:35 2011 @@ -315,7 +315,7 @@ size_t length) { PrintContext ("Read from memory", context); - fprintf (stdout, " Read from Memory (address = %p, length = %d)\n",(void *) addr, (uint) length); + fprintf (stdout, " Read from Memory (address = %p, length = %d)\n",(void *) addr, (uint32_t) length); *((uint64_t *) dst) = 0xdeadbeef; return length; @@ -329,7 +329,7 @@ size_t length) { PrintContext ("Write to memory", context); - fprintf (stdout, " Write to Memory (address = %p, length = %d)\n", (void *) addr, (uint) length); + fprintf (stdout, " Write to Memory (address = %p, length = %d)\n", (void *) addr, (uint32_t) length); return length; } Modified: lldb/trunk/source/Interpreter/CommandObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandObject.cpp (original) +++ lldb/trunk/source/Interpreter/CommandObject.cpp Thu Apr 7 17:46:35 2011 @@ -198,7 +198,7 @@ else { // No error string, output the usage information into result - options->GenerateOptionUsage (m_interpreter, result.GetErrorStream(), this); + options->GenerateOptionUsage (result.GetErrorStream(), this); } // Set the return status to failed (this was an error). result.SetStatus (eReturnStatusFailed); @@ -356,8 +356,7 @@ input.DeleteArgumentAtIndex(input.GetArgumentCount() - 1); bool handled_by_options; - handled_by_options = cur_options->HandleOptionCompletion (m_interpreter, - input, + handled_by_options = cur_options->HandleOptionCompletion (input, opt_element_vector, cursor_index, cursor_char_position, @@ -407,7 +406,7 @@ && GetOptions() != NULL) { StreamString usage_help; - GetOptions()->GenerateOptionUsage (m_interpreter, usage_help, this); + GetOptions()->GenerateOptionUsage (usage_help, this); if (usage_help.GetSize() > 0) { const char *usage_text = usage_help.GetData(); Modified: lldb/trunk/source/Interpreter/Options.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Options.cpp (original) +++ lldb/trunk/source/Interpreter/Options.cpp Thu Apr 7 17:46:35 2011 @@ -29,7 +29,8 @@ //------------------------------------------------------------------------- // Options //------------------------------------------------------------------------- -Options::Options () : +Options::Options (CommandInterpreter &interpreter) : + m_interpreter (interpreter), m_getopt_table () { BuildValidOptionSets(); @@ -362,12 +363,11 @@ void Options::GenerateOptionUsage ( - CommandInterpreter &interpreter, Stream &strm, CommandObject *cmd ) { - const uint32_t screen_width = interpreter.GetDebugger().GetTerminalWidth(); + const uint32_t screen_width = m_interpreter.GetDebugger().GetTerminalWidth(); const OptionDefinition *full_options_table = GetDefinitions(); const uint32_t save_indent_level = strm.GetIndentLevel(); @@ -656,7 +656,6 @@ bool Options::HandleOptionCompletion ( - CommandInterpreter &interpreter, Args &input, OptionElementVector &opt_element_vector, int cursor_index, @@ -778,8 +777,7 @@ if (opt_defs_index != -1) { - HandleOptionArgumentCompletion (interpreter, - input, + HandleOptionArgumentCompletion (input, cursor_index, strlen (input.GetArgumentAtIndex(cursor_index)), opt_element_vector, @@ -809,7 +807,6 @@ bool Options::HandleOptionArgumentCompletion ( - CommandInterpreter &interpreter, Args &input, int cursor_index, int char_pos, @@ -868,7 +865,7 @@ if (module_name) { FileSpec module_spec(module_name, false); - lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget(); + lldb::TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget(); // Search filters require a target... if (target_sp != NULL) filter_ap.reset (new SearchFilterByModule (target_sp, module_spec)); @@ -878,7 +875,7 @@ } } - return CommandCompletions::InvokeCommonCompletionCallbacks (interpreter, + return CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, completion_mask, input.GetArgumentAtIndex (opt_arg_pos), match_start_point, 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=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Thu Apr 7 17:46:35 2011 @@ -150,27 +150,26 @@ } } - int numTokens = EDNumTokens(m_inst); + int numTokens = -1; + + if (!raw) + numTokens = EDNumTokens(m_inst); int currentOpIndex = -1; - std::auto_ptr rra; - - if (!raw) + bool printTokenized = false; + + if (numTokens != -1 && !raw) { addr_t base_addr = LLDB_INVALID_ADDRESS; + + RegisterReaderArg rra(base_addr + EDInstByteSize(m_inst), m_disassembler); + if (exe_ctx && exe_ctx->target && !exe_ctx->target->GetSectionLoadList().IsEmpty()) base_addr = GetAddress().GetLoadAddress (exe_ctx->target); if (base_addr == LLDB_INVALID_ADDRESS) base_addr = GetAddress().GetFileAddress (); - - rra.reset(new RegisterReaderArg(base_addr + EDInstByteSize(m_inst), m_disassembler)); - } - - bool printTokenized = false; - - if (numTokens != -1) - { + printTokenized = true; // Handle the opcode column. @@ -246,7 +245,7 @@ { uint64_t operand_value; - if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, rra.get())) + if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, &rra)) { if (EDInstIsBranch(m_inst)) { @@ -327,7 +326,7 @@ if (EDGetInstString(&str, m_inst)) return; else - s->PutCString(str); + s->Write(str, strlen(str) - 1); } } Modified: lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp (original) +++ lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp Thu Apr 7 17:46:35 2011 @@ -207,7 +207,7 @@ { arch = Target::GetDefaultArchitecture (); if (!arch.IsValid()) - arch.SetTriple (LLDB_ARCH_DEFAULT); + arch.SetTriple (LLDB_ARCH_DEFAULT, NULL); } else arch = m_module->GetArchitecture(); 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=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu Apr 7 17:46:35 2011 @@ -142,6 +142,7 @@ { const uint8_t *trap_opcode = NULL; uint32_t trap_opcode_size = 0; + bool bp_is_thumb = false; llvm::Triple::ArchType machine = target.GetArchitecture().GetMachine(); switch (machine) @@ -154,22 +155,26 @@ trap_opcode_size = sizeof(g_i386_breakpoint_opcode); } break; - + + case llvm::Triple::thumb: + bp_is_thumb = true; // Fall through... case llvm::Triple::arm: { static const uint8_t g_arm_breakpoint_opcode[] = { 0xFE, 0xDE, 0xFF, 0xE7 }; static const uint8_t g_thumb_breakpooint_opcode[] = { 0xFE, 0xDE }; - lldb::BreakpointLocationSP bp_loc_sp (bp_site->GetOwnerAtIndex (0)); - if (bp_loc_sp) + // Auto detect arm/thumb if it wasn't explicitly specified + if (!bp_is_thumb) { - const AddressClass addr_class = bp_loc_sp->GetAddress().GetAddressClass (); - if (addr_class == eAddressClassCodeAlternateISA) - { - trap_opcode = g_thumb_breakpooint_opcode; - trap_opcode_size = sizeof(g_thumb_breakpooint_opcode); - break; - } + lldb::BreakpointLocationSP bp_loc_sp (bp_site->GetOwnerAtIndex (0)); + if (bp_loc_sp) + bp_is_thumb = bp_loc_sp->GetAddress().GetAddressClass () == eAddressClassCodeAlternateISA; + } + if (bp_is_thumb) + { + trap_opcode = g_thumb_breakpooint_opcode; + trap_opcode_size = sizeof(g_thumb_breakpooint_opcode); + break; } trap_opcode = g_arm_breakpoint_opcode; trap_opcode_size = sizeof(g_arm_breakpoint_opcode); @@ -186,7 +191,7 @@ break; default: - assert(!"Unhandled architecture in ProcessMacOSX::GetSoftwareBreakpointTrapOpcode()"); + assert(!"Unhandled architecture in PlatformDarwin::GetSoftwareBreakpointTrapOpcode()"); break; } 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=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Thu Apr 7 17:46:35 2011 @@ -473,14 +473,14 @@ default: switch (idx) { - case 0: arch.SetTriple ("armv7-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7f-apple-darwin"); return true; - case 2: arch.SetTriple ("armv7k-apple-darwin"); return true; - case 3: arch.SetTriple ("armv7s-apple-darwin"); return true; - case 4: arch.SetTriple ("armv6-apple-darwin"); return true; - case 5: arch.SetTriple ("armv5-apple-darwin"); return true; - case 6: arch.SetTriple ("armv4-apple-darwin"); return true; - case 7: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7f-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv7k-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv7s-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 6: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 7: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -488,12 +488,12 @@ case ArchSpec::eCore_arm_armv7f: switch (idx) { - case 0: arch.SetTriple ("armv7f-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7-apple-darwin"); return true; - case 2: arch.SetTriple ("armv6-apple-darwin"); return true; - case 3: arch.SetTriple ("armv5-apple-darwin"); return true; - case 4: arch.SetTriple ("armv4-apple-darwin"); return true; - case 5: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7f-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -501,12 +501,12 @@ case ArchSpec::eCore_arm_armv7k: switch (idx) { - case 0: arch.SetTriple ("armv7k-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7-apple-darwin"); return true; - case 2: arch.SetTriple ("armv6-apple-darwin"); return true; - case 3: arch.SetTriple ("armv5-apple-darwin"); return true; - case 4: arch.SetTriple ("armv4-apple-darwin"); return true; - case 5: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7k-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -514,12 +514,12 @@ case ArchSpec::eCore_arm_armv7s: switch (idx) { - case 0: arch.SetTriple ("armv7s-apple-darwin"); return true; - case 1: arch.SetTriple ("armv7-apple-darwin"); return true; - case 2: arch.SetTriple ("armv6-apple-darwin"); return true; - case 3: arch.SetTriple ("armv5-apple-darwin"); return true; - case 4: arch.SetTriple ("armv4-apple-darwin"); return true; - case 5: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7s-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 5: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -527,11 +527,11 @@ case ArchSpec::eCore_arm_armv7: switch (idx) { - case 0: arch.SetTriple ("armv7-apple-darwin"); return true; - case 1: arch.SetTriple ("armv6-apple-darwin"); return true; - case 2: arch.SetTriple ("armv5-apple-darwin"); return true; - case 3: arch.SetTriple ("armv4-apple-darwin"); return true; - case 4: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv7-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 4: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -539,10 +539,10 @@ case ArchSpec::eCore_arm_armv6: switch (idx) { - case 0: arch.SetTriple ("armv6-apple-darwin"); return true; - case 1: arch.SetTriple ("armv5-apple-darwin"); return true; - case 2: arch.SetTriple ("armv4-apple-darwin"); return true; - case 3: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv6-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 3: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -550,9 +550,9 @@ case ArchSpec::eCore_arm_armv5: switch (idx) { - case 0: arch.SetTriple ("armv5-apple-darwin"); return true; - case 1: arch.SetTriple ("armv4-apple-darwin"); return true; - case 2: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv5-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 2: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; @@ -560,8 +560,8 @@ case ArchSpec::eCore_arm_armv4: switch (idx) { - case 0: arch.SetTriple ("armv4-apple-darwin"); return true; - case 1: arch.SetTriple ("arm-apple-darwin"); return true; + case 0: arch.SetTriple ("armv4-apple-darwin", NULL); return true; + case 1: arch.SetTriple ("arm-apple-darwin", NULL); return true; default: break; } break; Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Apr 7 17:46:35 2011 @@ -919,7 +919,7 @@ triple += "unknown"; else triple += os_name; - m_host_arch.SetTriple (triple.c_str()); + m_host_arch.SetTriple (triple.c_str(), NULL); if (pointer_byte_size) { assert (pointer_byte_size == m_host_arch.GetAddressByteSize()); @@ -933,7 +933,7 @@ } else { - m_host_arch.SetTriple (triple.c_str()); + m_host_arch.SetTriple (triple.c_str(), NULL); if (pointer_byte_size) { assert (pointer_byte_size == m_host_arch.GetAddressByteSize()); @@ -1159,7 +1159,7 @@ extractor.GetStringRef().swap(value); extractor.SetFilePos(0); extractor.GetHexByteString (value); - process_info.GetArchitecture ().SetTriple (value.c_str()); + process_info.GetArchitecture ().SetTriple (value.c_str(), NULL); } else if (name.compare("name") == 0) { Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Thu Apr 7 17:46:35 2011 @@ -357,7 +357,7 @@ } else if (key.compare("triple") == 0) { - match_info.GetProcessInfo().GetArchitecture().SetTriple(value.c_str()); + match_info.GetProcessInfo().GetArchitecture().SetTriple (value.c_str(), NULL); } else { Modified: lldb/trunk/source/Symbol/SymbolContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Symbol/SymbolContext.cpp (original) +++ lldb/trunk/source/Symbol/SymbolContext.cpp Thu Apr 7 17:46:35 2011 @@ -10,6 +10,7 @@ #include "lldb/Symbol/SymbolContext.h" #include "lldb/Core/Module.h" +#include "lldb/Interpreter/Args.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Symbol.h" Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Thu Apr 7 17:46:35 2011 @@ -20,6 +20,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" +#include "lldb/Expression/ClangUserExpression.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Host/Host.h" #include "lldb/Target/ABI.h" Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=129112&r1=129111&r2=129112&view=diff ============================================================================== --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Thu Apr 7 17:46:35 2011 @@ -23,6 +23,7 @@ #include "lldb/Core/StreamString.h" #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObject.h" +#include "lldb/Expression/ClangUserExpression.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -1330,7 +1331,7 @@ { if (var_name == GetSettingNameForDefaultArch()) { - m_default_architecture.SetTriple (value); + m_default_architecture.SetTriple (value, NULL); if (!m_default_architecture.IsValid()) err.SetErrorStringWithFormat ("'%s' is not a valid architecture or triple.", value); } From wilsons at start.ca Thu Apr 7 21:00:23 2011 From: wilsons at start.ca (Stephen Wilson) Date: Fri, 08 Apr 2011 02:00:23 -0000 Subject: [Lldb-commits] [lldb] r129118 - /lldb/trunk/source/Plugins/DynamicLoader/Linux-DYLD/DynamicLoaderLinuxDYLD.cpp Message-ID: <20110408020023.D1B482A6C12D@llvm.org> Author: wilsons Date: Thu Apr 7 21:00:23 2011 New Revision: 129118 URL: http://llvm.org/viewvc/llvm-project?rev=129118&view=rev Log: linux: add missing arguments to FindFirstModuleForFileSpec Specifying the new arguments as NULL is appropriate for now as this is backwards-compatible with the old invocation. Modified: lldb/trunk/source/Plugins/DynamicLoader/Linux-DYLD/DynamicLoaderLinuxDYLD.cpp Modified: lldb/trunk/source/Plugins/DynamicLoader/Linux-DYLD/DynamicLoaderLinuxDYLD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Linux-DYLD/DynamicLoaderLinuxDYLD.cpp?rev=129118&r1=129117&r2=129118&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/Linux-DYLD/DynamicLoaderLinuxDYLD.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/Linux-DYLD/DynamicLoaderLinuxDYLD.cpp Thu Apr 7 21:00:23 2011 @@ -278,7 +278,8 @@ for (I = m_rendezvous.unloaded_begin(); I != E; ++I) { FileSpec file(I->path.c_str(), true); - ModuleSP module_sp = loaded_modules.FindFirstModuleForFileSpec(file); + ModuleSP module_sp = + loaded_modules.FindFirstModuleForFileSpec(file, NULL, NULL); if (!module_sp.empty()) old_modules.Append(module_sp); } @@ -368,7 +369,7 @@ ModuleList &modules = target.GetImages(); ModuleSP module_sp; - if ((module_sp = modules.FindFirstModuleForFileSpec(file))) + if ((module_sp = modules.FindFirstModuleForFileSpec(file, NULL, NULL))) { UpdateLoadedSections(module_sp, base_addr); } From wilsons at start.ca Thu Apr 7 21:01:35 2011 From: wilsons at start.ca (Stephen Wilson) Date: Fri, 08 Apr 2011 02:01:35 -0000 Subject: [Lldb-commits] [lldb] r129119 - in /lldb/trunk: lib/Makefile source/Plugins/Makefile Message-ID: <20110408020135.5D1DD2A6C12D@llvm.org> Author: wilsons Date: Thu Apr 7 21:01:35 2011 New Revision: 129119 URL: http://llvm.org/viewvc/llvm-project?rev=129119&view=rev Log: Add makefile support for the ARM instruction emulation plugin. Modified: lldb/trunk/lib/Makefile lldb/trunk/source/Plugins/Makefile Modified: lldb/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=129119&r1=129118&r2=129119&view=diff ============================================================================== --- lldb/trunk/lib/Makefile (original) +++ lldb/trunk/lib/Makefile Thu Apr 7 21:01:35 2011 @@ -32,6 +32,7 @@ lldbPluginABISysV_x86_64.a \ lldbPluginDisassemblerLLVM.a \ lldbPluginDynamicLoaderStatic.a \ + lldbPluginEmulateInstructionARM.a \ lldbPluginObjectContainerBSDArchive.a \ lldbPluginObjectFileELF.a \ lldbPluginPlatformGDBServer.a \ @@ -108,5 +109,5 @@ # Don't allow unresolved symbols. LLVMLibsOptions += -Wl,--no-undefined # Link in python - LD.Flags += $(PYTHON_BUILD_FLAGS) + LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt endif Modified: lldb/trunk/source/Plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=129119&r1=129118&r2=129119&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Makefile (original) +++ lldb/trunk/source/Plugins/Makefile Thu Apr 7 21:01:35 2011 @@ -15,7 +15,7 @@ DIRS := ABI/MacOSX-i386 ABI/SysV-x86_64 Disassembler/llvm \ ObjectContainer/BSD-Archive ObjectFile/ELF SymbolFile/DWARF \ SymbolFile/Symtab Process/Utility DynamicLoader/Static \ - Platform Process/gdb-remote + Platform Process/gdb-remote Instruction/ARM ifeq ($(HOST_OS),Darwin) DIRS += DynamicLoader/MacOSX-DYLD ObjectContainer/Universal-Mach-O \ From wilsons at start.ca Thu Apr 7 21:12:07 2011 From: wilsons at start.ca (Stephen Wilson) Date: Thu, 7 Apr 2011 22:12:07 -0400 Subject: [Lldb-commits] [PATCH] Add missing headers Message-ID: <20110408021207.GA798@fibrous.localdomain> Something changed in commit r129112 where a few standard headers vanished from the include chain when building on Linux. Fix up by including limits.h for INT_MAX and PATH_MAX where needed, and stdio.h for printf(). diff --git a/include/lldb/Core/StreamTee.h b/include/lldb/Core/StreamTee.h index 28951d1..d315551 100644 --- a/include/lldb/Core/StreamTee.h +++ b/include/lldb/Core/StreamTee.h @@ -10,6 +10,8 @@ #ifndef liblldb_StreamTee_h_ #define liblldb_StreamTee_h_ +#include + #include "lldb/Core/Stream.h" #include "lldb/Host/Mutex.h" diff --git a/include/lldb/Core/StringList.h b/include/lldb/Core/StringList.h index f448a67..b080919 100644 --- a/include/lldb/Core/StringList.h +++ b/include/lldb/Core/StringList.h @@ -10,6 +10,7 @@ #ifndef liblldb_StringList_h_ #define liblldb_StringList_h_ +#include #include "lldb/Core/STLUtils.h" #include "lldb/lldb-forward.h" diff --git a/source/API/SBFileSpec.cpp b/source/API/SBFileSpec.cpp index 89275cf..a3a503d 100644 --- a/source/API/SBFileSpec.cpp +++ b/source/API/SBFileSpec.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBStream.h" #include "lldb/Host/FileSpec.h" diff --git a/source/API/SBLineEntry.cpp b/source/API/SBLineEntry.cpp index 5187d58..3567a38 100644 --- a/source/API/SBLineEntry.cpp +++ b/source/API/SBLineEntry.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBStream.h" #include "lldb/Core/StreamString.h" diff --git a/source/Core/DataBufferMemoryMap.cpp b/source/Core/DataBufferMemoryMap.cpp index 83060d5..cf88f34 100644 --- a/source/Core/DataBufferMemoryMap.cpp +++ b/source/Core/DataBufferMemoryMap.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/source/Core/PluginManager.cpp b/source/Core/PluginManager.cpp index a853c50..ae89c72 100644 --- a/source/Core/PluginManager.cpp +++ b/source/Core/PluginManager.cpp @@ -9,6 +9,8 @@ #include "lldb/Core/PluginManager.h" +#include + #include #include diff --git a/source/Host/common/File.cpp b/source/Host/common/File.cpp index 5a97bc9..fefa343 100644 --- a/source/Host/common/File.cpp +++ b/source/Host/common/File.cpp @@ -11,6 +11,7 @@ #include "lldb/Host/File.h" #include +#include #include #include diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp index 987d0b2..5d98402 100644 --- a/source/Host/common/Host.cpp +++ b/source/Host/common/Host.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index 13178af..8e3461d 100644 --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -10,6 +10,7 @@ #include "DWARFDebugAranges.h" #include +#include #include From wilsons at start.ca Thu Apr 7 21:11:29 2011 From: wilsons at start.ca (Stephen Wilson) Date: Fri, 08 Apr 2011 02:11:29 -0000 Subject: [Lldb-commits] [lldb] r129120 - /lldb/trunk/source/Plugins/Instruction/ARM/Makefile Message-ID: <20110408021130.0415F2A6C12D@llvm.org> Author: wilsons Date: Thu Apr 7 21:11:29 2011 New Revision: 129120 URL: http://llvm.org/viewvc/llvm-project?rev=129120&view=rev Log: Add the ARM instruction emulation makefile. I forgot to 'svn add' this file in r129119. Added: lldb/trunk/source/Plugins/Instruction/ARM/Makefile Added: lldb/trunk/source/Plugins/Instruction/ARM/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/Makefile?rev=129120&view=auto ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/Makefile (added) +++ lldb/trunk/source/Plugins/Instruction/ARM/Makefile Thu Apr 7 21:11:29 2011 @@ -0,0 +1,14 @@ +##===- source/Plugins/Instruction/ARM/Makefile -------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../../.. +LIBRARYNAME := lldbPluginEmulateInstructionARM +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile From gclayton at apple.com Fri Apr 8 01:05:11 2011 From: gclayton at apple.com (Greg Clayton) Date: Thu, 07 Apr 2011 23:05:11 -0700 Subject: [Lldb-commits] [PATCH] Add missing headers In-Reply-To: <20110408021207.GA798@fibrous.localdomain> References: <20110408021207.GA798@fibrous.localdomain> Message-ID: <018D486A-F604-480D-A44A-34A2F8D8A359@apple.com> Looks good. On Apr 7, 2011, at 7:12 PM, Stephen Wilson wrote: > > Something changed in commit r129112 where a few standard headers vanished from > the include chain when building on Linux. Fix up by including limits.h for > INT_MAX and PATH_MAX where needed, and stdio.h for printf(). > > > > diff --git a/include/lldb/Core/StreamTee.h b/include/lldb/Core/StreamTee.h > index 28951d1..d315551 100644 > --- a/include/lldb/Core/StreamTee.h > +++ b/include/lldb/Core/StreamTee.h > @@ -10,6 +10,8 @@ > #ifndef liblldb_StreamTee_h_ > #define liblldb_StreamTee_h_ > > +#include > + > #include "lldb/Core/Stream.h" > #include "lldb/Host/Mutex.h" > > diff --git a/include/lldb/Core/StringList.h b/include/lldb/Core/StringList.h > index f448a67..b080919 100644 > --- a/include/lldb/Core/StringList.h > +++ b/include/lldb/Core/StringList.h > @@ -10,6 +10,7 @@ > #ifndef liblldb_StringList_h_ > #define liblldb_StringList_h_ > > +#include > > #include "lldb/Core/STLUtils.h" > #include "lldb/lldb-forward.h" > diff --git a/source/API/SBFileSpec.cpp b/source/API/SBFileSpec.cpp > index 89275cf..a3a503d 100644 > --- a/source/API/SBFileSpec.cpp > +++ b/source/API/SBFileSpec.cpp > @@ -7,6 +7,8 @@ > // > //===----------------------------------------------------------------------===// > > +#include > + > #include "lldb/API/SBFileSpec.h" > #include "lldb/API/SBStream.h" > #include "lldb/Host/FileSpec.h" > diff --git a/source/API/SBLineEntry.cpp b/source/API/SBLineEntry.cpp > index 5187d58..3567a38 100644 > --- a/source/API/SBLineEntry.cpp > +++ b/source/API/SBLineEntry.cpp > @@ -7,6 +7,8 @@ > // > //===----------------------------------------------------------------------===// > > +#include > + > #include "lldb/API/SBLineEntry.h" > #include "lldb/API/SBStream.h" > #include "lldb/Core/StreamString.h" > diff --git a/source/Core/DataBufferMemoryMap.cpp b/source/Core/DataBufferMemoryMap.cpp > index 83060d5..cf88f34 100644 > --- a/source/Core/DataBufferMemoryMap.cpp > +++ b/source/Core/DataBufferMemoryMap.cpp > @@ -10,6 +10,7 @@ > > #include > #include > +#include > #include > #include > > diff --git a/source/Core/PluginManager.cpp b/source/Core/PluginManager.cpp > index a853c50..ae89c72 100644 > --- a/source/Core/PluginManager.cpp > +++ b/source/Core/PluginManager.cpp > @@ -9,6 +9,8 @@ > > #include "lldb/Core/PluginManager.h" > > +#include > + > #include > #include > > diff --git a/source/Host/common/File.cpp b/source/Host/common/File.cpp > index 5a97bc9..fefa343 100644 > --- a/source/Host/common/File.cpp > +++ b/source/Host/common/File.cpp > @@ -11,6 +11,7 @@ > #include "lldb/Host/File.h" > > #include > +#include > #include > #include > > diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp > index 987d0b2..5d98402 100644 > --- a/source/Host/common/Host.cpp > +++ b/source/Host/common/Host.cpp > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp > index 13178af..8e3461d 100644 > --- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp > +++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp > @@ -10,6 +10,7 @@ > #include "DWARFDebugAranges.h" > > #include > +#include > > #include > From mminutoli at gmail.com Fri Apr 8 07:10:12 2011 From: mminutoli at gmail.com (Marco Minutoli) Date: Fri, 8 Apr 2011 14:10:12 +0200 Subject: [Lldb-commits] [PATCH] Missing header for INT_MAX Message-ID: <1302264612-6972-1-git-send-email-mminutoli@gmail.com> limits.h was missing causing a compile error on INT_MAX. --- include/lldb/Core/StreamTee.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/lldb/Core/StreamTee.h b/include/lldb/Core/StreamTee.h index 28951d1..666146b 100644 --- a/include/lldb/Core/StreamTee.h +++ b/include/lldb/Core/StreamTee.h @@ -10,6 +10,9 @@ #ifndef liblldb_StreamTee_h_ #define liblldb_StreamTee_h_ +#include + + #include "lldb/Core/Stream.h" #include "lldb/Host/Mutex.h" -- 1.7.1 From wilsons at start.ca Fri Apr 8 08:36:44 2011 From: wilsons at start.ca (Stephen Wilson) Date: Fri, 08 Apr 2011 13:36:44 -0000 Subject: [Lldb-commits] [lldb] r129130 - in /lldb/trunk: include/lldb/Core/StreamTee.h include/lldb/Core/StringList.h source/API/SBFileSpec.cpp source/API/SBLineEntry.cpp source/Core/DataBufferMemoryMap.cpp source/Core/PluginManager.cpp source/Host/common/File.cpp source/Host/common/Host.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp Message-ID: <20110408133644.422AC2A6C12D@llvm.org> Author: wilsons Date: Fri Apr 8 08:36:44 2011 New Revision: 129130 URL: http://llvm.org/viewvc/llvm-project?rev=129130&view=rev Log: Add missing headers. Something changed in commit r129112 where a few standard headers vanished from the include chain when building on Linux. Fix up by including limits.h for INT_MAX and PATH_MAX where needed, and stdio.h for printf(). Modified: lldb/trunk/include/lldb/Core/StreamTee.h lldb/trunk/include/lldb/Core/StringList.h lldb/trunk/source/API/SBFileSpec.cpp lldb/trunk/source/API/SBLineEntry.cpp lldb/trunk/source/Core/DataBufferMemoryMap.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Host/common/File.cpp lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp Modified: lldb/trunk/include/lldb/Core/StreamTee.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StreamTee.h?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/StreamTee.h (original) +++ lldb/trunk/include/lldb/Core/StreamTee.h Fri Apr 8 08:36:44 2011 @@ -10,6 +10,8 @@ #ifndef liblldb_StreamTee_h_ #define liblldb_StreamTee_h_ +#include + #include "lldb/Core/Stream.h" #include "lldb/Host/Mutex.h" Modified: lldb/trunk/include/lldb/Core/StringList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StringList.h?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/StringList.h (original) +++ lldb/trunk/include/lldb/Core/StringList.h Fri Apr 8 08:36:44 2011 @@ -10,6 +10,7 @@ #ifndef liblldb_StringList_h_ #define liblldb_StringList_h_ +#include #include "lldb/Core/STLUtils.h" #include "lldb/lldb-forward.h" Modified: lldb/trunk/source/API/SBFileSpec.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/API/SBFileSpec.cpp (original) +++ lldb/trunk/source/API/SBFileSpec.cpp Fri Apr 8 08:36:44 2011 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBStream.h" #include "lldb/Host/FileSpec.h" Modified: lldb/trunk/source/API/SBLineEntry.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBLineEntry.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/API/SBLineEntry.cpp (original) +++ lldb/trunk/source/API/SBLineEntry.cpp Fri Apr 8 08:36:44 2011 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBStream.h" #include "lldb/Core/StreamString.h" Modified: lldb/trunk/source/Core/DataBufferMemoryMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferMemoryMap.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/Core/DataBufferMemoryMap.cpp (original) +++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp Fri Apr 8 08:36:44 2011 @@ -10,6 +10,7 @@ #include #include +#include #include #include Modified: lldb/trunk/source/Core/PluginManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/Core/PluginManager.cpp (original) +++ lldb/trunk/source/Core/PluginManager.cpp Fri Apr 8 08:36:44 2011 @@ -9,6 +9,8 @@ #include "lldb/Core/PluginManager.h" +#include + #include #include Modified: lldb/trunk/source/Host/common/File.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/File.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/Host/common/File.cpp (original) +++ lldb/trunk/source/Host/common/File.cpp Fri Apr 8 08:36:44 2011 @@ -11,6 +11,7 @@ #include "lldb/Host/File.h" #include +#include #include #include Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Fri Apr 8 08:36:44 2011 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp?rev=129130&r1=129129&r2=129130&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp Fri Apr 8 08:36:44 2011 @@ -10,6 +10,7 @@ #include "DWARFDebugAranges.h" #include +#include #include From wilsons at start.ca Fri Apr 8 08:42:52 2011 From: wilsons at start.ca (Stephen Wilson) Date: Fri, 8 Apr 2011 09:42:52 -0400 Subject: [Lldb-commits] [PATCH] Missing header for INT_MAX In-Reply-To: <1302264612-6972-1-git-send-email-mminutoli@gmail.com> References: <1302264612-6972-1-git-send-email-mminutoli@gmail.com> Message-ID: <20110408134252.GA5652@fibrous.localdomain> Hi Marco, I just fixed up the header issue in r129130. I think the tree should build again on Linux. Let me know if problems persist. On Fri, Apr 08, 2011 at 02:10:12PM +0200, Marco Minutoli wrote: > limits.h was missing causing a compile error on INT_MAX. > --- > include/lldb/Core/StreamTee.h | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/include/lldb/Core/StreamTee.h b/include/lldb/Core/StreamTee.h > index 28951d1..666146b 100644 > --- a/include/lldb/Core/StreamTee.h > +++ b/include/lldb/Core/StreamTee.h > @@ -10,6 +10,9 @@ > #ifndef liblldb_StreamTee_h_ > #define liblldb_StreamTee_h_ > > +#include > + > + > #include "lldb/Core/Stream.h" > #include "lldb/Host/Mutex.h" > > -- > 1.7.1 > > _______________________________________________ > lldb-commits mailing list > lldb-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits -- steve From johnny.chen at apple.com Fri Apr 8 17:15:29 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 08 Apr 2011 22:15:29 -0000 Subject: [Lldb-commits] [lldb] r129161 - /lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Message-ID: <20110408221529.C20F62A6C137@llvm.org> Author: johnny Date: Fri Apr 8 17:15:29 2011 New Revision: 129161 URL: http://llvm.org/viewvc/llvm-project?rev=129161&view=rev Log: Fix a test suite crasher. Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=129161&r1=129160&r2=129161&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Fri Apr 8 17:15:29 2011 @@ -33,7 +33,7 @@ using namespace lldb_private; CommandObjectDisassemble::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter), + Options(interpreter), num_lines_context(0), num_instructions (0), func_name(), From johnny.chen at apple.com Fri Apr 8 17:39:17 2011 From: johnny.chen at apple.com (Johnny Chen) Date: Fri, 08 Apr 2011 22:39:17 -0000 Subject: [Lldb-commits] [lldb] r129165 - in /lldb/trunk/source/Commands: CommandObjectArgs.cpp CommandObjectExpression.cpp CommandObjectFrame.cpp CommandObjectImage.cpp Message-ID: <20110408223917.A11722A6C137@llvm.org> Author: johnny Date: Fri Apr 8 17:39:17 2011 New Revision: 129165 URL: http://llvm.org/viewvc/llvm-project?rev=129165&view=rev Log: Really fix the test suite crasher this time. Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectFrame.cpp lldb/trunk/source/Commands/CommandObjectImage.cpp Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=129165&r1=129164&r2=129165&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Fri Apr 8 17:39:17 2011 @@ -37,7 +37,7 @@ // CommandObjectArgs::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter) + Options(interpreter) { // Keep only one place to reset the values to their defaults ResetOptionValues(); Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=129165&r1=129164&r2=129165&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Fri Apr 8 17:39:17 2011 @@ -38,7 +38,7 @@ using namespace lldb_private; CommandObjectExpression::CommandOptions::CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter) + Options(interpreter) { // Keep only one place to reset the values to their defaults ResetOptionValues(); Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=129165&r1=129164&r2=129165&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Fri Apr 8 17:39:17 2011 @@ -100,7 +100,7 @@ public: CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter) + Options(interpreter) { ResetOptionValues (); } @@ -291,7 +291,7 @@ public: CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter) + Options(interpreter) { ResetOptionValues (); } Modified: lldb/trunk/source/Commands/CommandObjectImage.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectImage.cpp?rev=129165&r1=129164&r2=129165&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectImage.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectImage.cpp Fri Apr 8 17:39:17 2011 @@ -721,7 +721,7 @@ public: CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter), + Options(interpreter), m_sort_order (eSortOrderNone) { } @@ -1142,7 +1142,7 @@ public: CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter), + Options(interpreter), m_format_array() { } @@ -1349,7 +1349,7 @@ public: CommandOptions (CommandInterpreter &interpreter) : - Options(m_interpreter) + Options(interpreter) { ResetOptionValues(); } From ctice at apple.com Fri Apr 8 18:33:06 2011 From: ctice at apple.com (Caroline Tice) Date: Fri, 08 Apr 2011 23:33:06 -0000 Subject: [Lldb-commits] [lldb] r129168 - in /lldb/trunk: include/lldb/API/SBInstruction.h include/lldb/Core/Disassembler.h include/lldb/Core/EmulateInstruction.h source/API/SBInstruction.cpp source/Core/Disassembler.cpp source/Core/EmulateInstruction.cpp source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Message-ID: <20110408233307.238A12A6C135@llvm.org> Author: ctice Date: Fri Apr 8 18:33:06 2011 New Revision: 129168 URL: http://llvm.org/viewvc/llvm-project?rev=129168&view=rev Log: Fix various things in the instruction emulation code: - Add ability to control whether or not the emulator advances the PC register (in the emulation state), if the instruction itself does not change the pc value.. - Fix a few typos in asm description strings. - Fix bug in the carry flag calculation. Modified: lldb/trunk/include/lldb/API/SBInstruction.h lldb/trunk/include/lldb/Core/Disassembler.h lldb/trunk/include/lldb/Core/EmulateInstruction.h lldb/trunk/source/API/SBInstruction.cpp lldb/trunk/source/Core/Disassembler.cpp lldb/trunk/source/Core/EmulateInstruction.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Modified: lldb/trunk/include/lldb/API/SBInstruction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBInstruction.h?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBInstruction.h (original) +++ lldb/trunk/include/lldb/API/SBInstruction.h Fri Apr 8 18:33:06 2011 @@ -53,7 +53,7 @@ GetDescription (lldb::SBStream &description); bool - EmulateWithFrame (lldb::SBFrame &frame); + EmulateWithFrame (lldb::SBFrame &frame, bool auto_advance_pc); bool DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'arm-apple-darwin' Modified: lldb/trunk/include/lldb/Core/Disassembler.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/Disassembler.h (original) +++ lldb/trunk/include/lldb/Core/Disassembler.h Fri Apr 8 18:33:06 2011 @@ -73,6 +73,7 @@ bool Emulate (const ArchSpec &arch, + bool auto_advance_pc, void *baton, EmulateInstruction::ReadMemory read_mem_callback, EmulateInstruction::WriteMemory write_mem_calback, Modified: lldb/trunk/include/lldb/Core/EmulateInstruction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/EmulateInstruction.h?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/include/lldb/Core/EmulateInstruction.h (original) +++ lldb/trunk/include/lldb/Core/EmulateInstruction.h Fri Apr 8 18:33:06 2011 @@ -144,6 +144,8 @@ eContextAddition, eContextSubtraction, + + eContextAdvancePC, eContextReturnFromException }; @@ -412,6 +414,12 @@ virtual bool EvaluateInstruction () = 0; + bool + GetAdvancePC () { return m_advance_pc; } + + void + SetAdvancePC (bool value) { m_advance_pc = value; } + static void TranslateRegister (uint32_t reg_kind, uint32_t reg_num, std::string ®_name); @@ -548,6 +556,7 @@ WriteRegister m_write_reg_callback; lldb::addr_t m_opcode_pc; Opcode m_opcode; + bool m_advance_pc; //------------------------------------------------------------------ // For EmulateInstruction only //------------------------------------------------------------------ Modified: lldb/trunk/source/API/SBInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstruction.cpp?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/source/API/SBInstruction.cpp (original) +++ lldb/trunk/source/API/SBInstruction.cpp Fri Apr 8 18:33:06 2011 @@ -116,7 +116,7 @@ } bool -SBInstruction::EmulateWithFrame (lldb::SBFrame &frame) +SBInstruction::EmulateWithFrame (lldb::SBFrame &frame, bool auto_advance_pc) { if (m_opaque_sp && frame.get()) { @@ -126,6 +126,7 @@ lldb_private::ArchSpec arch = target->GetArchitecture(); return m_opaque_sp->Emulate (arch, + auto_advance_pc, (void *) frame.get(), &lldb_private::EmulateInstruction::ReadMemoryFrame, &lldb_private::EmulateInstruction::WriteMemoryFrame, @@ -142,12 +143,8 @@ { lldb_private::ArchSpec arch (triple, NULL); - return m_opaque_sp->Emulate (arch, - NULL, - &lldb_private::EmulateInstruction::ReadMemoryDefault, - &lldb_private::EmulateInstruction::WriteMemoryDefault, - &lldb_private::EmulateInstruction::ReadRegisterDefault, - &lldb_private::EmulateInstruction::WriteRegisterDefault); + return m_opaque_sp->DumpEmulation (arch); + } return false; } Modified: lldb/trunk/source/Core/Disassembler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/source/Core/Disassembler.cpp (original) +++ lldb/trunk/source/Core/Disassembler.cpp Fri Apr 8 18:33:06 2011 @@ -504,6 +504,7 @@ bool Instruction::Emulate (const ArchSpec &arch, + bool auto_advance_pc, void *baton, EmulateInstruction::ReadMemory read_mem_callback, EmulateInstruction::WriteMemory write_mem_callback, @@ -516,6 +517,7 @@ insn_emulator_ap->SetBaton (baton); insn_emulator_ap->SetCallbacks (read_mem_callback, write_mem_callback, read_reg_callback, write_reg_callback); insn_emulator_ap->SetInstruction (GetOpcode(), GetAddress()); + insn_emulator_ap->SetAdvancePC (auto_advance_pc); return insn_emulator_ap->EvaluateInstruction (); } Modified: lldb/trunk/source/Core/EmulateInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/source/Core/EmulateInstruction.cpp (original) +++ lldb/trunk/source/Core/EmulateInstruction.cpp Fri Apr 8 18:33:06 2011 @@ -70,7 +70,8 @@ m_read_reg_callback (read_reg_callback), m_write_reg_callback (write_reg_callback), m_opcode (), - m_opcode_pc (LLDB_INVALID_ADDRESS) + m_opcode_pc (LLDB_INVALID_ADDRESS), + m_advance_pc (false) { } @@ -88,7 +89,8 @@ m_write_mem_callback (&WriteMemoryDefault), m_read_reg_callback (&ReadRegisterDefault), m_write_reg_callback (&WriteRegisterDefault), - m_opcode_pc (LLDB_INVALID_ADDRESS) + m_opcode_pc (LLDB_INVALID_ADDRESS), + m_advance_pc (false) { ::memset (&m_opcode, 0, sizeof (m_opcode)); } Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=129168&r1=129167&r2=129168&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Fri Apr 8 18:33:06 2011 @@ -11937,7 +11937,7 @@ // add (register) { 0x0fe00010, 0x00800000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADDReg, "add{s} , , {,}"}, // add (register-shifted register) - { 0x0fe00090, 0x00800010, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADDRegShift, "add{s} , m, , "}, + { 0x0fe00090, 0x00800010, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADDRegShift, "add{s} , , , "}, // adr { 0x0fff0000, 0x028f0000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADR, "add , PC, #"}, { 0x0fff0000, 0x024f0000, ARMvAll, eEncodingA2, No_VFP, eSize32, &EmulateInstructionARM::EmulateADR, "sub , PC, #"}, @@ -12063,7 +12063,7 @@ { 0x0ff00ff0, 0x01800f90, ARMV6_ABOVE, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTREX, "strex , , []"}, { 0x0e500000, 0x04400000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTRBImmARM, "strb ,[,#+/-]!"}, { 0x0e500000, 0x04000000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTRImmARM, "str ,[,#+/-]!"}, - { 0x0e5000f0, 0x004000f0, ARMV5TE_ABOVE, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTRDImm, "strc , , [ #+/-]!"}, + { 0x0e5000f0, 0x004000f0, ARMV5TE_ABOVE, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTRDImm, "strd , , [ #+/-]!"}, { 0x0e500ff0, 0x000000f0, ARMV5TE_ABOVE, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTRDReg, "strd , , [, +/-]{!}"}, { 0x0e100f00, 0x0c000b00, ARMvAll, eEncodingA1, VFPv2_ABOVE, eSize32, &EmulateInstructionARM::EmulateVSTM, "vstm{mode} {!} "}, { 0x0e100f00, 0x0c000a00, ARMvAll, eEncodingA2, VFPv2v3, eSize32, &EmulateInstructionARM::EmulateVSTM, "vstm{mode} {!} "}, @@ -12331,7 +12331,7 @@ { 0xfff00fc0, 0xf8500000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRRegister, "ldr.w , [,{,LSL #}]" }, { 0xfffff800, 0x00007800, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateLDRBImmediate, "ldrb ,[{,#}]" }, { 0xfff00000, 0xf8900000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRBImmediate, "ldrb.w ,[{,#}]" }, - { 0xfff00800, 0xf8100800, ARMV6T2_ABOVE, eEncodingT3, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRBImmediate, "ldrb ,[>Rn>, #+/-]{!}" }, + { 0xfff00800, 0xf8100800, ARMV6T2_ABOVE, eEncodingT3, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRBImmediate, "ldrb ,[, #+/-]{!}" }, { 0xff7f0000, 0xf81f0000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRBLiteral, "ldrb ,[...]" }, { 0xfffffe00, 0x00005c00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateLDRBRegister, "ldrb ,[,]" }, { 0xfff00fc0, 0xf8100000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRBRegister, "ldrb.w ,[,{,LSL #imm2>}]" }, @@ -12351,7 +12351,7 @@ { 0xff7f0000, 0xf93f0000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDRSHLiteral, "ldrsh ,