diff options
author | Ed Maste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 5e95aa85bb660d45e9905ef1d7180b2678280660 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /include/lldb/Core | |
parent | 12bd4897ff0678fa663e09d78ebc22dd255ceb86 (diff) | |
download | src-vendor/lldb/lldb-r241361.tar.gz src-vendor/lldb/lldb-r241361.zip |
Import LLDB as of upstream SVN 241361 (git 612c075f)vendor/lldb/lldb-r241361
Diffstat (limited to 'include/lldb/Core')
31 files changed, 1017 insertions, 356 deletions
diff --git a/include/lldb/Core/Address.h b/include/lldb/Core/Address.h index b430ef7cec21..cfa16c30bedb 100644 --- a/include/lldb/Core/Address.h +++ b/include/lldb/Core/Address.h @@ -88,6 +88,8 @@ public: ///< if the address is in a section (section of pointers, c strings, etc). DumpStyleResolvedDescriptionNoModule, DumpStyleResolvedDescriptionNoFunctionArguments, + DumpStyleNoFunctionName, ///< Elide the function name; display an offset into the current function. + ///< Used primarily in disassembly symbolication DumpStyleDetailedSymbolContext, ///< Detailed symbol context information for an address for all symbol ///< context members. DumpStyleResolvedPointerDescription ///< Dereference a pointer at the current address and then lookup the diff --git a/include/lldb/Core/ArchSpec.h b/include/lldb/Core/ArchSpec.h index 93630f043822..0cadd8d8dec6 100644 --- a/include/lldb/Core/ArchSpec.h +++ b/include/lldb/Core/ArchSpec.h @@ -12,9 +12,8 @@ #if defined(__cplusplus) -#include "lldb/lldb-private.h" +#include "lldb/lldb-forward.h" #include "lldb/Core/ConstString.h" -#include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" namespace lldb_private { @@ -33,6 +32,23 @@ struct CoreDefinition; class ArchSpec { public: + enum MIPSSubType + { + eMIPSSubType_unknown, + eMIPSSubType_mips32, + eMIPSSubType_mips32r2, + eMIPSSubType_mips32r6, + eMIPSSubType_mips32el, + eMIPSSubType_mips32r2el, + eMIPSSubType_mips32r6el, + eMIPSSubType_mips64, + eMIPSSubType_mips64r2, + eMIPSSubType_mips64r6, + eMIPSSubType_mips64el, + eMIPSSubType_mips64r2el, + eMIPSSubType_mips64r6el, + }; + enum Core { eCore_arm_generic, @@ -66,8 +82,27 @@ public: eCore_arm_arm64, eCore_arm_armv8, eCore_arm_aarch64, - + + eCore_mips32, + eCore_mips32r2, + eCore_mips32r3, + eCore_mips32r5, + eCore_mips32r6, + eCore_mips32el, + eCore_mips32r2el, + eCore_mips32r3el, + eCore_mips32r5el, + eCore_mips32r6el, eCore_mips64, + eCore_mips64r2, + eCore_mips64r3, + eCore_mips64r5, + eCore_mips64r6, + eCore_mips64el, + eCore_mips64r2el, + eCore_mips64r3el, + eCore_mips64r5el, + eCore_mips64r6el, eCore_ppc_generic, eCore_ppc_ppc601, @@ -142,7 +177,19 @@ public: kCore_hexagon_last = eCore_hexagon_hexagonv5, kCore_kalimba_first = eCore_kalimba3, - kCore_kalimba_last = eCore_kalimba5 + kCore_kalimba_last = eCore_kalimba5, + + kCore_mips32_first = eCore_mips32, + kCore_mips32_last = eCore_mips32r6, + + kCore_mips32el_first = eCore_mips32el, + kCore_mips32el_last = eCore_mips32r6el, + + kCore_mips64_first = eCore_mips64, + kCore_mips64_last = eCore_mips64r6, + + kCore_mips64el_first = eCore_mips64el, + kCore_mips64el_last = eCore_mips64r6el }; typedef void (* StopInfoOverrideCallbackType)(lldb_private::Thread &thread); @@ -290,58 +337,48 @@ public: //------------------------------------------------------------------ void MergeFrom(const ArchSpec &other); - - //------------------------------------------------------------------ - /// Sets this ArchSpec according to the given architecture name. - /// - /// The architecture name can be one of the generic system default - /// values: - /// - /// @li \c LLDB_ARCH_DEFAULT - The arch the current system defaults - /// to when a program is launched without any extra - /// attributes or settings. - /// @li \c LLDB_ARCH_DEFAULT_32BIT - The default host architecture - /// for 32 bit (if any). - /// @li \c LLDB_ARCH_DEFAULT_64BIT - The default host architecture - /// for 64 bit (if any). - /// - /// Alternatively, if the object type of this ArchSpec has been - /// configured, a concrete architecture can be specified to set - /// the CPU type ("x86_64" for example). - /// - /// Finally, an encoded object and archetecture format is accepted. - /// The format contains an object type (like "macho" or "elf"), - /// followed by a platform dependent encoding of CPU type and - /// subtype. For example: - /// - /// "macho" : Specifies an object type of MachO. - /// "macho-16-6" : MachO specific encoding for ARMv6. - /// "elf-43 : ELF specific encoding for Sparc V9. - /// - /// @param[in] arch_name The name of an architecture. - /// - /// @return True if @p arch_name was successfully translated, false - /// otherwise. - //------------------------------------------------------------------ -// bool -// SetArchitecture (const llvm::StringRef& arch_name); -// -// bool -// SetArchitecture (const char *arch_name); //------------------------------------------------------------------ - /// Change the architecture object type and CPU type. + /// Change the architecture object type, CPU type and OS type. /// /// @param[in] arch_type The object type of this ArchSpec. /// /// @param[in] cpu The required CPU type. /// - /// @return True if the object and CPU type were successfully set. + /// @param[in] os The optional OS type + /// The default value of 0 was choosen to from the ELF spec value + /// ELFOSABI_NONE. ELF is the only one using this parameter. If another + /// format uses this parameter and 0 does not work, use a value over + /// 255 because in the ELF header this is value is only a byte. + /// + /// @return True if the object, and CPU were successfully set. + /// + /// As a side effect, the vendor value is usually set to unknown. + /// The exections are + /// aarch64-apple-ios + /// arm-apple-ios + /// thumb-apple-ios + /// x86-apple- + /// x86_64-apple- + /// + /// As a side effect, the os value is usually set to unknown + /// The exceptions are + /// *-*-aix + /// aarch64-apple-ios + /// arm-apple-ios + /// thumb-apple-ios + /// powerpc-apple-darwin + /// *-*-freebsd + /// *-*-linux + /// *-*-netbsd + /// *-*-openbsd + /// *-*-solaris //------------------------------------------------------------------ bool SetArchitecture (ArchitectureType arch_type, uint32_t cpu, - uint32_t sub); + uint32_t sub, + uint32_t os = 0); //------------------------------------------------------------------ /// Returns the byte order for the architecture specification. @@ -456,8 +493,18 @@ public: GetDefaultEndian () const; //------------------------------------------------------------------ - /// Compare an ArchSpec to another ArchSpec, requiring an exact cpu - /// type match between them. + /// Returns true if 'char' is a signed type by defualt in the + /// architecture false otherwise + /// + /// @return True if 'char' is a signed type by default on the + /// architecture and false otherwise. + //------------------------------------------------------------------ + bool + CharIsSignedByDefault () const; + + //------------------------------------------------------------------ + /// Compare an ArchSpec to another ArchSpec, requiring an exact cpu + /// type match between them. /// e.g. armv7s is not an exact match with armv7 - this would return false /// /// @return true if the two ArchSpecs match. diff --git a/include/lldb/Core/ClangForward.h b/include/lldb/Core/ClangForward.h index ef7308d25f7f..6c627c2ad3b7 100644 --- a/include/lldb/Core/ClangForward.h +++ b/include/lldb/Core/ClangForward.h @@ -72,11 +72,14 @@ namespace clang class FunctionTemplateSpecializationInfo; class GotoStmt; class HeaderSearchOptions; + class IdentifierInfo; class IdentifierTable; class IntegerLiteral; class LabelStmt; class LangOptions; + class MacroDirective; class MemberExpr; + class Module; class NamedDecl; class NamespaceDecl; class NonTypeTemplateParmDecl; diff --git a/include/lldb/Core/Communication.h b/include/lldb/Core/Communication.h index 49532fe123c5..7924ed293d3c 100644 --- a/include/lldb/Core/Communication.h +++ b/include/lldb/Core/Communication.h @@ -85,14 +85,16 @@ namespace lldb_private { class Communication : public Broadcaster { public: - enum { - eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost. - eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available. - eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients. - eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread. - eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet. - kLoUserBroadcastBit = (1 << 16),///< Subclasses can used bits 31:16 for any needed events. - kHiUserBroadcastBit = (1 << 31), + FLAGS_ANONYMOUS_ENUM() + { + eBroadcastBitDisconnected = (1u << 0), ///< Sent when the communications connection is lost. + eBroadcastBitReadThreadGotBytes = (1u << 1), ///< Sent by the read thread when bytes become available. + eBroadcastBitReadThreadDidExit = (1u << 2), ///< Sent by the read thread when it exits to inform clients. + eBroadcastBitReadThreadShouldExit = (1u << 3), ///< Sent by clients that need to cancel the read thread. + eBroadcastBitPacketAvailable = (1u << 4), ///< Sent when data received makes a complete packet. + eBroadcastBitNoMorePendingInput = (1u << 5), ///< Sent by the read thread to indicate all pending input has been processed. + kLoUserBroadcastBit = (1u << 16),///< Subclasses can used bits 31:16 for any needed events. + kHiUserBroadcastBit = (1u << 31), eAllEventBits = 0xffffffff }; @@ -321,6 +323,16 @@ public: SetReadThreadBytesReceivedCallback (ReadThreadBytesReceived callback, void *callback_baton); + + //------------------------------------------------------------------ + /// Wait for the read thread to process all outstanding data. + /// + /// After this function returns, the read thread has processed all data that + /// has been waiting in the Connection queue. + /// + //------------------------------------------------------------------ + void SynchronizeWithReadThread (); + static const char * ConnectionStatusAsCString (lldb::ConnectionStatus status); @@ -354,9 +366,11 @@ protected: lldb::ConnectionSP m_connection_sp; ///< The connection that is current in use by this communications class. HostThread m_read_thread; ///< The read thread handle in case we need to cancel the thread. std::atomic<bool> m_read_thread_enabled; + std::atomic<bool> m_read_thread_did_exit; std::string m_bytes; ///< A buffer to cache bytes read in the ReadThread function. Mutex m_bytes_mutex; ///< A mutex to protect multi-threaded access to the cached bytes. Mutex m_write_mutex; ///< Don't let multiple threads write at the same time... + Mutex m_synchronize_mutex; ReadThreadBytesReceived m_callback; void *m_callback_baton; bool m_close_on_eof; diff --git a/include/lldb/Core/Connection.h b/include/lldb/Core/Connection.h index a7b911ac382f..c354519a222e 100644 --- a/include/lldb/Core/Connection.h +++ b/include/lldb/Core/Connection.h @@ -111,6 +111,13 @@ public: /// The number of bytes to attempt to read, and also the max /// number of bytes that can be placed into \a dst. /// + /// @param[in] timeout_usec + /// The number of microseconds to wait for the data. + /// + /// @param[out] status + /// On return, indicates whether the call was sucessful or terminated + /// due to some error condition. + /// /// @param[out] error_ptr /// A pointer to an error object that should be given an /// approriate error value if this method returns zero. This @@ -164,6 +171,22 @@ public: virtual std::string GetURI() = 0; + //------------------------------------------------------------------ + /// Interrupts an ongoing Read() operation. + /// + /// If there is an ongoing read operation in another thread, this operation + /// return with status == eConnectionStatusInterrupted. Note that if there + /// data waiting to be read and an interrupt request is issued, the Read() + /// function will return the data immediately without processing the + /// interrupt request (which will remain queued for the next Read() + /// operation). + /// + /// @return + /// Returns true is the interrupt request was sucessful. + //------------------------------------------------------------------ + virtual bool + InterruptRead() = 0; + private: //------------------------------------------------------------------ // For Connection only diff --git a/include/lldb/Core/ConstString.h b/include/lldb/Core/ConstString.h index cfa237c46862..cfe8ea2db0e1 100644 --- a/include/lldb/Core/ConstString.h +++ b/include/lldb/Core/ConstString.h @@ -233,7 +233,7 @@ public: const char * AsCString(const char *value_if_empty = NULL) const { - if (m_string == NULL) + if (IsEmpty()) return value_if_empty; return m_string; } diff --git a/include/lldb/Core/CxaDemangle.h b/include/lldb/Core/CxaDemangle.h new file mode 100644 index 000000000000..0cd54fb36a32 --- /dev/null +++ b/include/lldb/Core/CxaDemangle.h @@ -0,0 +1,21 @@ +//===-- CxaDemangle.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_CxaDemangle_h_ +#define liblldb_CxaDemangle_h_ + +namespace lldb_private +{ + + char* + __cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status); + +} + +#endif diff --git a/include/lldb/Core/DataEncoder.h b/include/lldb/Core/DataEncoder.h index 7cd5d6808152..7889f4191e50 100644 --- a/include/lldb/Core/DataEncoder.h +++ b/include/lldb/Core/DataEncoder.h @@ -357,7 +357,7 @@ public: /// The number of bytes that this object now contains. //------------------------------------------------------------------ uint32_t - SetData (const void *bytes, uint32_t length, lldb::ByteOrder byte_order); + SetData (void *bytes, uint32_t length, lldb::ByteOrder byte_order); //------------------------------------------------------------------ /// Adopt a subset of shared data in \a data_sp. @@ -446,7 +446,7 @@ protected: uint8_t *m_end; ///< A pointer to the byte that is past the end of the data. lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from. uint8_t m_addr_size; ///< The address size to use when extracting pointers or addresses - mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances + mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multiple instances private: DISALLOW_COPY_AND_ASSIGN (DataEncoder); diff --git a/include/lldb/Core/DataExtractor.h b/include/lldb/Core/DataExtractor.h index 516953b00c33..e61189b98103 100644 --- a/include/lldb/Core/DataExtractor.h +++ b/include/lldb/Core/DataExtractor.h @@ -234,7 +234,7 @@ public: /// bytes into the contained data, into the stream \a s. \a /// num_per_line objects will be dumped on each line before a new /// line will be output. If \a base_addr is a valid address, then - /// each new line of output will be prededed by the address value + /// each new line of output will be preceded by the address value /// plus appropriate offset, and a colon and space. Bitfield values /// can be dumped by calling this function multiple times with the /// same start offset, format and size, yet differing \a @@ -574,7 +574,7 @@ public: GetSharedDataOffset () const; //------------------------------------------------------------------ - /// Get a the data start pointer. + /// Get the data start pointer. /// /// @return /// Returns a pointer to the first byte contained in this @@ -908,7 +908,7 @@ public: /// /// @return /// \a dst if all values were properly extracted and copied, - /// NULL otherise. + /// NULL otherwise. //------------------------------------------------------------------ void * GetU8 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; @@ -955,7 +955,7 @@ public: /// /// @return /// \a dst if all values were properly extracted and copied, - /// NULL otherise. + /// NULL otherwise. //------------------------------------------------------------------ void * GetU16 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; @@ -1002,7 +1002,7 @@ public: /// /// @return /// \a dst if all values were properly extracted and copied, - /// NULL otherise. + /// NULL otherwise. //------------------------------------------------------------------ void * GetU32 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; @@ -1049,7 +1049,7 @@ public: /// /// @return /// \a dst if all values were properly extracted and copied, - /// NULL otherise. + /// NULL otherwise. //------------------------------------------------------------------ void * GetU64 ( lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; @@ -1328,7 +1328,7 @@ protected: const uint8_t * m_end; ///< A pointer to the byte that is past the end of the data. lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from. uint32_t m_addr_size; ///< The address size to use when extracting pointers or addresses - mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances + mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multiple instances const uint32_t m_target_byte_size; }; diff --git a/include/lldb/Core/Debugger.h b/include/lldb/Core/Debugger.h index 9a3f9736fdca..0d9b90c8919d 100644 --- a/include/lldb/Core/Debugger.h +++ b/include/lldb/Core/Debugger.h @@ -14,22 +14,16 @@ #include <stdint.h> -#include <stack> - #include "lldb/lldb-public.h" #include "lldb/Core/Broadcaster.h" -#include "lldb/Core/Communication.h" #include "lldb/Core/FormatEntity.h" #include "lldb/Core/IOHandler.h" #include "lldb/Core/Listener.h" #include "lldb/Core/SourceManager.h" #include "lldb/Core/UserID.h" #include "lldb/Core/UserSettingsController.h" -#include "lldb/DataFormatters/FormatManager.h" #include "lldb/Host/HostThread.h" #include "lldb/Host/Terminal.h" -#include "lldb/Interpreter/OptionValueProperties.h" -#include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Platform.h" #include "lldb/Target/TargetList.h" @@ -61,10 +55,6 @@ friend class SourceManager; // For GetSourceFileCache. public: - typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType) (const lldb::DebuggerSP &debugger_sp, - const FileSpec& spec, - Error& error); - static lldb::DebuggerSP CreateInstance (lldb::LogOutputCallback log_callback = NULL, void *baton = NULL); @@ -75,10 +65,10 @@ public: FindTargetWithProcess (Process *process); static void - Initialize (LoadPluginCallbackType load_plugin_callback); + Initialize(LoadPluginCallbackType load_plugin_callback); - static void - Terminate (); + static void + Terminate(); static void SettingsInitialize (); @@ -220,6 +210,9 @@ public: bool IsTopIOHandler (const lldb::IOHandlerSP& reader_sp); + void + PrintAsync (const char *s, size_t len, bool is_stdout); + ConstString GetTopIOHandlerControlSequence(char ch); @@ -229,12 +222,6 @@ public: const char * GetIOHandlerHelpPrologue(); - bool - HideTopIOHandler(); - - void - RefreshTopIOHandler(); - static lldb::DebuggerSP FindDebuggerWithID (lldb::user_id_t id); @@ -258,9 +245,6 @@ public: void ClearIOHandlers (); - static int - TestDebuggerRefCount (); - bool GetCloseInputOnEOF () const; @@ -360,7 +344,7 @@ public: LoadPlugin (const FileSpec& spec, Error& error); void - ExecuteIOHanders(); + ExecuteIOHandlers(); bool IsForwardingEvents (); diff --git a/include/lldb/Core/Disassembler.h b/include/lldb/Core/Disassembler.h index 64d35e67bfd0..e08e2def4c18 100644 --- a/include/lldb/Core/Disassembler.h +++ b/include/lldb/Core/Disassembler.h @@ -120,6 +120,12 @@ public: /// @param[in] disassembly_addr_format /// The format specification for how addresses are printed. /// Only needed if show_address is true. + /// + /// @param[in] max_address_text_size + /// The length of the longest address string at the start of the + /// disassembly line that will be printed (the Debugger::FormatDisassemblerAddress() string) + /// so this method can properly align the instruction opcodes. + /// May be 0 to indicate no indentation/alignment of the opcodes. //------------------------------------------------------------------ virtual void @@ -130,7 +136,8 @@ public: const ExecutionContext* exe_ctx, const SymbolContext *sym_ctx, const SymbolContext *prev_sym_ctx, - const FormatEntity::Entry *disassembly_addr_format); + const FormatEntity::Entry *disassembly_addr_format, + size_t max_address_text_size); virtual bool DoesBranch () = 0; @@ -218,7 +225,7 @@ public: GetInstructionAtIndex (size_t idx) const; uint32_t - GetIndexOfNextBranchInstruction(uint32_t start) const; + GetIndexOfNextBranchInstruction(uint32_t start, Target &target) const; uint32_t GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target); diff --git a/include/lldb/Core/FastDemangle.h b/include/lldb/Core/FastDemangle.h new file mode 100644 index 000000000000..cd6128c73038 --- /dev/null +++ b/include/lldb/Core/FastDemangle.h @@ -0,0 +1,24 @@ +//===-- FastDemangle.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_FastDemangle_h_ +#define liblldb_FastDemangle_h_ + +namespace lldb_private +{ + + char * + FastDemangle(const char *mangled_name); + + char * + FastDemangle(const char *mangled_name, long mangled_name_length); + +} + +#endif diff --git a/include/lldb/Core/FormatEntity.h b/include/lldb/Core/FormatEntity.h index 32ff9ea4e3eb..db4f59132832 100644 --- a/include/lldb/Core/FormatEntity.h +++ b/include/lldb/Core/FormatEntity.h @@ -61,6 +61,7 @@ namespace lldb_private ScriptTarget, ModuleFile, File, + Lang, FrameIndex, FrameRegisterPC, FrameRegisterSP, @@ -78,6 +79,8 @@ namespace lldb_private FunctionAddrOffsetConcrete, FunctionLineOffset, FunctionPCOffset, + FunctionInitial, + FunctionChanged, LineEntryFile, LineEntryLineNumber, LineEntryStartAddress, diff --git a/include/lldb/Core/IOHandler.h b/include/lldb/Core/IOHandler.h index 02e6bde1edb6..b617d8e75f58 100644 --- a/include/lldb/Core/IOHandler.h +++ b/include/lldb/Core/IOHandler.h @@ -67,18 +67,6 @@ namespace lldb_private { virtual void Run () = 0; - // Hide any characters that have been displayed so far so async - // output can be displayed. Refresh() will be called after the - // output has been displayed. - virtual void - Hide () = 0; - - // Called when the async output has been received in order to update - // the input reader (refresh the prompt and redisplay any current - // line(s) that are being edited - virtual void - Refresh () = 0; - // Called when an input reader should relinquish its control so another // can be pushed onto the IO handler stack, or so the current IO // handler can pop itself off the stack @@ -246,7 +234,14 @@ namespace lldb_private { void WaitForPop (); - + + virtual void + PrintAsync (Stream *stream, const char *s, size_t len) + { + stream->Write (s, len); + stream->Flush(); + } + protected: Debugger &m_debugger; lldb::StreamFileSP m_input_sp; @@ -318,7 +313,7 @@ namespace lldb_private { } //------------------------------------------------------------------ - /// Called when a new line is created or one of an identifed set of + /// Called when a new line is created or one of an identified set of /// indentation characters is typed. /// /// This function determines how much indentation should be added @@ -332,7 +327,7 @@ namespace lldb_private { /// following the line containing the cursor are not included. /// /// @param[in] cursor_position - /// The number of characters preceeding the cursor on the final + /// The number of characters preceding the cursor on the final /// line at the time. /// /// @return @@ -448,17 +443,17 @@ namespace lldb_private { { } - virtual ConstString - IOHandlerGetControlSequence (char ch) + ConstString + IOHandlerGetControlSequence (char ch) override { if (ch == 'd') return ConstString (m_end_line + "\n"); return ConstString(); } - virtual bool + bool IOHandlerIsInputComplete (IOHandler &io_handler, - StringList &lines) + StringList &lines) override { // Determine whether the end of input signal has been entered const size_t num_lines = lines.GetSize(); @@ -507,53 +502,47 @@ namespace lldb_private { virtual ~IOHandlerEditline (); - virtual void - Run (); + void + Run () override; - virtual void - Hide (); - - virtual void - Refresh (); - - virtual void - Cancel (); + void + Cancel () override; - virtual bool - Interrupt (); + bool + Interrupt () override; - virtual void - GotEOF(); + void + GotEOF() override; - virtual void - Activate (); + void + Activate () override; - virtual void - Deactivate (); + void + Deactivate () override; - virtual ConstString - GetControlSequence (char ch) + ConstString + GetControlSequence (char ch) override { return m_delegate.IOHandlerGetControlSequence (ch); } - virtual const char * - GetCommandPrefix () + const char * + GetCommandPrefix () override { return m_delegate.IOHandlerGetCommandPrefix (); } - virtual const char * - GetHelpPrologue () + const char * + GetHelpPrologue () override { return m_delegate.IOHandlerGetHelpPrologue (); } - virtual const char * - GetPrompt (); + const char * + GetPrompt () override; - virtual bool - SetPrompt (const char *prompt); + bool + SetPrompt (const char *prompt) override; const char * GetContinuationPrompt (); @@ -591,6 +580,9 @@ namespace lldb_private { uint32_t GetCurrentLineIndex () const; + void + PrintAsync (Stream *stream, const char *s, size_t len) override; + private: #ifndef LLDB_DISABLE_LIBEDIT static bool @@ -626,6 +618,7 @@ namespace lldb_private { bool m_multi_line; bool m_color_prompts; bool m_interrupt_exits; + bool m_editing; // Set to true when fetching a line manually (not using libedit) }; // The order of base classes is important. Look at the constructor of IOHandlerConfirm @@ -648,17 +641,17 @@ namespace lldb_private { return m_user_response; } - virtual int + int IOHandlerComplete (IOHandler &io_handler, const char *current_line, const char *cursor, const char *last_char, int skip_first_n_matches, int max_matches, - StringList &matches); + StringList &matches) override; - virtual void - IOHandlerInputComplete (IOHandler &io_handler, std::string &data); + void + IOHandlerInputComplete (IOHandler &io_handler, std::string &data) override; protected: const bool m_default_response; @@ -671,32 +664,25 @@ namespace lldb_private { public: IOHandlerCursesGUI (Debugger &debugger); - virtual - ~IOHandlerCursesGUI (); - - virtual void - Run (); + ~IOHandlerCursesGUI () override; - virtual void - Hide (); + void + Run () override; - virtual void - Refresh (); - - virtual void - Cancel (); + void + Cancel () override; - virtual bool - Interrupt (); + bool + Interrupt () override; - virtual void - GotEOF(); + void + GotEOF() override; - virtual void - Activate (); + void + Activate () override; - virtual void - Deactivate (); + void + Deactivate () override; protected: curses::ApplicationAP m_app_ap; @@ -711,20 +697,11 @@ namespace lldb_private { virtual ~IOHandlerCursesValueObjectList (); - virtual void - Run (); - - virtual void - Hide (); - - virtual void - Refresh (); - - virtual bool - HandleInterrupt (); + void + Run () override; - virtual void - GotEOF(); + void + GotEOF() override; protected: ValueObjectList m_valobj_list; }; @@ -849,7 +826,10 @@ namespace lldb_private { return NULL; } - protected: + void + PrintAsync (Stream *stream, const char *s, size_t len); + + protected: typedef std::vector<lldb::IOHandlerSP> collection; collection m_stack; diff --git a/include/lldb/Core/Log.h b/include/lldb/Core/Log.h index b389946e264c..3aa4b4d48e17 100644 --- a/include/lldb/Core/Log.h +++ b/include/lldb/Core/Log.h @@ -22,20 +22,10 @@ #include "lldb/lldb-private.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" +#include "lldb/Core/Logging.h" #include "lldb/Core/PluginInterface.h" //---------------------------------------------------------------------- -// Logging types -//---------------------------------------------------------------------- -#define LLDB_LOG_FLAG_STDOUT (1u << 0) -#define LLDB_LOG_FLAG_STDERR (1u << 1) -#define LLDB_LOG_FLAG_FATAL (1u << 2) -#define LLDB_LOG_FLAG_ERROR (1u << 3) -#define LLDB_LOG_FLAG_WARNING (1u << 4) -#define LLDB_LOG_FLAG_DEBUG (1u << 5) -#define LLDB_LOG_FLAG_VERBOSE (1u << 6) - -//---------------------------------------------------------------------- // Logging Options //---------------------------------------------------------------------- #define LLDB_LOG_OPTION_THREADSAFE (1u << 0) @@ -46,6 +36,7 @@ #define LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD (1u << 5) #define LLDB_LOG_OPTION_PREPEND_THREAD_NAME (1U << 6) #define LLDB_LOG_OPTION_BACKTRACE (1U << 7) +#define LLDB_LOG_OPTION_APPEND (1U << 8) //---------------------------------------------------------------------- // Logging Functions @@ -59,12 +50,10 @@ public: //------------------------------------------------------------------ // Callback definitions for abstracted plug-in log access. //------------------------------------------------------------------ - typedef void (*DisableCallback) (const char **categories, Stream *feedback_strm); - typedef Log * (*EnableCallback) (lldb::StreamSP &log_stream_sp, - uint32_t log_options, - const char **categories, - Stream *feedback_strm); - typedef void (*ListCategoriesCallback) (Stream *strm); + typedef void (*DisableCallback)(const char **categories, Stream *feedback_strm); + typedef Log *(*EnableCallback)(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, + Stream *feedback_strm); + typedef void (*ListCategoriesCallback)(Stream *strm); struct Callbacks { @@ -77,86 +66,85 @@ public: // Static accessors for logging channels //------------------------------------------------------------------ static void - RegisterLogChannel (const ConstString &channel, - const Log::Callbacks &log_callbacks); + RegisterLogChannel(const ConstString &channel, const Log::Callbacks &log_callbacks); static bool - UnregisterLogChannel (const ConstString &channel); + UnregisterLogChannel(const ConstString &channel); static bool - GetLogChannelCallbacks (const ConstString &channel, - Log::Callbacks &log_callbacks); + GetLogChannelCallbacks(const ConstString &channel, Log::Callbacks &log_callbacks); + static bool + EnableLogChannel(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char *channel, + const char **categories, Stream &error_stream); static void - EnableAllLogChannels (lldb::StreamSP &log_stream_sp, - uint32_t log_options, - const char **categories, - Stream *feedback_strm); + EnableAllLogChannels(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, + Stream *feedback_strm); static void - DisableAllLogChannels (Stream *feedback_strm); + DisableAllLogChannels(Stream *feedback_strm); static void - ListAllLogChannels (Stream *strm); + ListAllLogChannels(Stream *strm); static void - Initialize (); + Initialize(); static void - Terminate (); - + Terminate(); + //------------------------------------------------------------------ // Auto completion //------------------------------------------------------------------ static void - AutoCompleteChannelName (const char *channel_name, - StringList &matches); + AutoCompleteChannelName(const char *channel_name, StringList &matches); //------------------------------------------------------------------ // Member functions //------------------------------------------------------------------ - Log (); + Log(); - Log (const lldb::StreamSP &stream_sp); + Log(const lldb::StreamSP &stream_sp); - ~Log (); + virtual + ~Log(); - void - PutCString (const char *cstr); + virtual void + PutCString(const char *cstr); - void - Printf (const char *format, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); - void - VAPrintf (const char *format, va_list args); + virtual void + VAPrintf(const char *format, va_list args); - void - PrintfWithFlags( uint32_t flags, const char *format, ...) __attribute__ ((format (printf, 3, 4))); + virtual void + LogIf(uint32_t mask, const char *fmt, ...) __attribute__((format(printf, 3, 4))); - void - LogIf (uint32_t mask, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); + virtual void + Debug(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void - Debug (const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + DebugVerbose(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void - DebugVerbose (const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + Error(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void - Error (const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + VAError(const char *format, va_list args); - void - FatalError (int err, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); + virtual void + FatalError(int err, const char *fmt, ...) __attribute__((format(printf, 3, 4))); - void - Verbose (const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + Verbose(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void - Warning (const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + Warning(const char *fmt, ...) __attribute__((format(printf, 2, 3))); - void - WarningVerbose (const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + virtual void + WarningVerbose(const char *fmt, ...) __attribute__((format(printf, 2, 3))); Flags & GetOptions(); @@ -177,7 +165,7 @@ public: GetDebug() const; void - SetStream (const lldb::StreamSP &stream_sp) + SetStream(const lldb::StreamSP &stream_sp) { m_stream_sp = stream_sp; } @@ -190,43 +178,35 @@ protected: Flags m_options; Flags m_mask_bits; - void - PrintfWithFlagsVarArg (uint32_t flags, const char *format, va_list args); - private: - DISALLOW_COPY_AND_ASSIGN (Log); + DISALLOW_COPY_AND_ASSIGN(Log); }; class LogChannel : public PluginInterface { public: - LogChannel (); + LogChannel(); - virtual - ~LogChannel (); + virtual ~LogChannel(); - static lldb::LogChannelSP - FindPlugin (const char *plugin_name); + static lldb::LogChannelSP FindPlugin(const char *plugin_name); // categories is a an array of chars that ends with a NULL element. - virtual void - Disable (const char **categories, Stream *feedback_strm) = 0; + virtual void Disable(const char **categories, Stream *feedback_strm) = 0; - virtual bool - Enable (lldb::StreamSP &log_stream_sp, - uint32_t log_options, - Stream *feedback_strm, // Feedback stream for argument errors etc - const char **categories) = 0;// The categories to enable within this logging stream, if empty, enable default set + virtual bool Enable( + lldb::StreamSP &log_stream_sp, uint32_t log_options, + Stream *feedback_strm, // Feedback stream for argument errors etc + const char **categories) = 0; // The categories to enable within this logging stream, if empty, enable default set - virtual void - ListCategories (Stream *strm) = 0; + virtual void ListCategories(Stream *strm) = 0; protected: std::unique_ptr<Log> m_log_ap; private: - DISALLOW_COPY_AND_ASSIGN (LogChannel); + DISALLOW_COPY_AND_ASSIGN(LogChannel); }; diff --git a/include/lldb/Core/Logging.h b/include/lldb/Core/Logging.h new file mode 100644 index 000000000000..a4dd76f11237 --- /dev/null +++ b/include/lldb/Core/Logging.h @@ -0,0 +1,94 @@ +//===-- Logging.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_Core_Logging_h_ +#define liblldb_Core_Logging_h_ + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/lldb-private.h" + +//---------------------------------------------------------------------- +// Log Bits specific to logging in lldb +//---------------------------------------------------------------------- +#define LIBLLDB_LOG_VERBOSE (1u << 0) +#define LIBLLDB_LOG_PROCESS (1u << 1) +#define LIBLLDB_LOG_THREAD (1u << 2) +#define LIBLLDB_LOG_DYNAMIC_LOADER (1u << 3) +#define LIBLLDB_LOG_EVENTS (1u << 4) +#define LIBLLDB_LOG_BREAKPOINTS (1u << 5) +#define LIBLLDB_LOG_WATCHPOINTS (1u << 6) +#define LIBLLDB_LOG_STEP (1u << 7) +#define LIBLLDB_LOG_EXPRESSIONS (1u << 8) +#define LIBLLDB_LOG_TEMPORARY (1u << 9) +#define LIBLLDB_LOG_STATE (1u << 10) +#define LIBLLDB_LOG_OBJECT (1u << 11) +#define LIBLLDB_LOG_COMMUNICATION (1u << 12) +#define LIBLLDB_LOG_CONNECTION (1u << 13) +#define LIBLLDB_LOG_HOST (1u << 14) +#define LIBLLDB_LOG_UNWIND (1u << 15) +#define LIBLLDB_LOG_API (1u << 16) +#define LIBLLDB_LOG_SCRIPT (1u << 17) +#define LIBLLDB_LOG_COMMANDS (1U << 18) +#define LIBLLDB_LOG_TYPES (1u << 19) +#define LIBLLDB_LOG_SYMBOLS (1u << 20) +#define LIBLLDB_LOG_MODULES (1u << 21) +#define LIBLLDB_LOG_TARGET (1u << 22) +#define LIBLLDB_LOG_MMAP (1u << 23) +#define LIBLLDB_LOG_OS (1u << 24) +#define LIBLLDB_LOG_PLATFORM (1u << 25) +#define LIBLLDB_LOG_SYSTEM_RUNTIME (1u << 26) +#define LIBLLDB_LOG_JIT_LOADER (1u << 27) +#define LIBLLDB_LOG_LANGUAGE (1u << 28) +#define LIBLLDB_LOG_ALL (UINT32_MAX) +#define LIBLLDB_LOG_DEFAULT (LIBLLDB_LOG_PROCESS |\ + LIBLLDB_LOG_THREAD |\ + LIBLLDB_LOG_DYNAMIC_LOADER |\ + LIBLLDB_LOG_BREAKPOINTS |\ + LIBLLDB_LOG_WATCHPOINTS |\ + LIBLLDB_LOG_STEP |\ + LIBLLDB_LOG_STATE |\ + LIBLLDB_LOG_SYMBOLS |\ + LIBLLDB_LOG_TARGET |\ + LIBLLDB_LOG_COMMANDS) + +namespace lldb_private { + +void +LogIfAllCategoriesSet (uint32_t mask, const char *format, ...); + +void +LogIfAnyCategoriesSet (uint32_t mask, const char *format, ...); + +Log * +GetLogIfAllCategoriesSet (uint32_t mask); + +Log * +GetLogIfAnyCategoriesSet (uint32_t mask); + +uint32_t +GetLogMask (); + +bool +IsLogVerbose (); + +void +DisableLog (const char **categories, Stream *feedback_strm); + +Log * +EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm); + +void +ListLogCategories (Stream *strm); + +} // namespace lldb_private + +#endif // liblldb_Core_Logging_h_ diff --git a/include/lldb/Core/Mangled.h b/include/lldb/Core/Mangled.h index 87b23799882f..a2a2b5591d0f 100644 --- a/include/lldb/Core/Mangled.h +++ b/include/lldb/Core/Mangled.h @@ -41,6 +41,13 @@ public: ePreferDemangledWithoutArguments }; + enum ManglingScheme + { + eManglingSchemeNone = 0, + eManglingSchemeMSVC, + eManglingSchemeItanium + }; + //---------------------------------------------------------------------- /// Default constructor. /// @@ -291,12 +298,12 @@ public: SetValue (const ConstString &name); //---------------------------------------------------------------------- - /// Get the language only if it is definitive what the language is from - /// the mangling. + /// Try to guess the language from the mangling. /// /// For a mangled name to have a language it must have both a mangled - /// and a demangled name and it must be definitive from the mangling - /// what the language is. + /// and a demangled name and it can be guessed from the mangling what + /// the language is. Note: this will return C++ for any language that + /// uses Itanium ABI mangling. /// /// Standard C function names will return eLanguageTypeUnknown because /// they aren't mangled and it isn't clear what language the name @@ -307,7 +314,7 @@ public: /// if there is no mangled or demangled counterpart. //---------------------------------------------------------------------- lldb::LanguageType - GetLanguage (); + GuessLanguage () const; private: //---------------------------------------------------------------------- diff --git a/include/lldb/Core/Module.h b/include/lldb/Core/Module.h index 60fbb989502e..127ddaeb9fd4 100644 --- a/include/lldb/Core/Module.h +++ b/include/lldb/Core/Module.h @@ -10,12 +10,12 @@ #ifndef liblldb_Module_h_ #define liblldb_Module_h_ +#include "lldb/lldb-forward.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Mutex.h" #include "lldb/Host/TimeValue.h" -#include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/SymbolContextScope.h" #include "lldb/Target/PathMappingList.h" @@ -1098,7 +1098,7 @@ protected: mutable Mutex m_mutex; ///< A mutex to keep this object happy in multi-threaded environments. TimeValue m_mod_time; ///< The modification time for this module when it was created. ArchSpec m_arch; ///< The architecture for this module. - lldb_private::UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols. + UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols. FileSpec m_file; ///< The file representation on disk for this module (if there is one). FileSpec m_platform_file;///< The path to the module on the platform on which it is being debugged FileSpec m_remote_install_file; ///< If set when debugging on remote platforms, this module will be installed at this location @@ -1107,10 +1107,12 @@ protected: uint64_t m_object_offset; TimeValue m_object_mod_time; lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile - std::unique_ptr<SymbolVendor> m_symfile_ap; ///< A pointer to the symbol vendor for this module. - ClangASTContext m_ast; ///< The AST context for this module. + lldb::SymbolVendorUP m_symfile_ap; ///< A pointer to the symbol vendor for this module. + std::vector<lldb::SymbolVendorUP> m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and changes the symbol file, + ///< we need to keep all old symbol files around in case anyone has type references to them + lldb::ClangASTContextUP m_ast; ///< The AST context for this module. PathMappingList m_source_mappings; ///< Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are - std::unique_ptr<lldb_private::SectionList> m_sections_ap; ///< Unified section list for module that is used by the ObjectFile and and ObjectFile instances for the debug info + lldb::SectionListUP m_sections_ap; ///< Unified section list for module that is used by the ObjectFile and and ObjectFile instances for the debug info bool m_did_load_objfile:1, m_did_load_symbol_vendor:1, diff --git a/include/lldb/Core/ModuleList.h b/include/lldb/Core/ModuleList.h index a46e212da9bb..f4c12cf168ac 100644 --- a/include/lldb/Core/ModuleList.h +++ b/include/lldb/Core/ModuleList.h @@ -12,6 +12,7 @@ #include <vector> #include <list> +#include <functional> #include "lldb/lldb-private.h" #include "lldb/Host/Mutex.h" @@ -562,6 +563,9 @@ public: static bool RemoveSharedModuleIfOrphaned (const Module *module_ptr); + void + ForEach (std::function <bool (const lldb::ModuleSP &module_sp)> const &callback) const; + protected: //------------------------------------------------------------------ // Class typedefs. diff --git a/include/lldb/Core/ModuleSpec.h b/include/lldb/Core/ModuleSpec.h index 195fd991f8de..be7041981a0a 100644 --- a/include/lldb/Core/ModuleSpec.h +++ b/include/lldb/Core/ModuleSpec.h @@ -14,6 +14,7 @@ #include "lldb/Core/Stream.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" +#include "lldb/Host/Mutex.h" #include "lldb/Target/PathMappingList.h" namespace lldb_private { @@ -29,6 +30,7 @@ public: m_uuid (), m_object_name (), m_object_offset (0), + m_object_size (0), m_object_mod_time (), m_source_mappings () { @@ -42,6 +44,7 @@ public: m_uuid (), m_object_name (), m_object_offset (0), + m_object_size (file_spec.GetByteSize ()), m_object_mod_time (), m_source_mappings () { @@ -55,6 +58,7 @@ public: m_uuid (), m_object_name (), m_object_offset (0), + m_object_size (file_spec.GetByteSize ()), m_object_mod_time (), m_source_mappings () { @@ -68,6 +72,7 @@ public: m_uuid (rhs.m_uuid), m_object_name (rhs.m_object_name), m_object_offset (rhs.m_object_offset), + m_object_size (rhs.m_object_size), m_object_mod_time (rhs.m_object_mod_time), m_source_mappings (rhs.m_source_mappings) { @@ -85,6 +90,7 @@ public: m_uuid = rhs.m_uuid; m_object_name = rhs.m_object_name; m_object_offset = rhs.m_object_offset; + m_object_size = rhs.m_object_size; m_object_mod_time = rhs.m_object_mod_time; m_source_mappings = rhs.m_source_mappings; } @@ -254,7 +260,19 @@ public: { m_object_offset = object_offset; } - + + uint64_t + GetObjectSize () const + { + return m_object_size; + } + + void + SetObjectSize (uint64_t object_size) + { + m_object_size = object_size; + } + TimeValue & GetObjectModificationTime () { @@ -283,6 +301,7 @@ public: m_uuid.Clear(); m_object_name.Clear(); m_object_offset = 0; + m_object_size = 0; m_source_mappings.Clear(false); m_object_mod_time.Clear(); } @@ -302,6 +321,8 @@ public: return true; if (m_object_name) return true; + if (m_object_size) + return true; if (m_object_mod_time.IsValid()) return true; return false; @@ -362,7 +383,14 @@ public: { if (dumped_something) strm.PutCString(", "); - strm.Printf("object_offset = 0x%" PRIx64, m_object_offset); + strm.Printf("object_offset = %" PRIu64, m_object_offset); + dumped_something = true; + } + if (m_object_size > 0) + { + if (dumped_something) + strm.PutCString(", "); + strm.Printf("object size = %" PRIu64, m_object_size); dumped_something = true; } if (m_object_mod_time.IsValid()) @@ -425,6 +453,7 @@ protected: UUID m_uuid; ConstString m_object_name; uint64_t m_object_offset; + uint64_t m_object_size; TimeValue m_object_mod_time; mutable PathMappingList m_source_mappings; }; diff --git a/include/lldb/Core/PluginManager.h b/include/lldb/Core/PluginManager.h index 55e6df06d842..af940d788ab0 100644 --- a/include/lldb/Core/PluginManager.h +++ b/include/lldb/Core/PluginManager.h @@ -137,7 +137,8 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, - LanguageRuntimeCreateInstance create_callback); + LanguageRuntimeCreateInstance create_callback, + LanguageRuntimeGetCommandObject command_callback = nullptr); static bool UnregisterPlugin (LanguageRuntimeCreateInstance create_callback); @@ -145,6 +146,9 @@ public: static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx); + static LanguageRuntimeGetCommandObject + GetLanguageRuntimeGetCommandObjectAtIndex (uint32_t idx); + static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name); diff --git a/include/lldb/Core/RangeMap.h b/include/lldb/Core/RangeMap.h index d78504c7d285..d2c43a5d794d 100644 --- a/include/lldb/Core/RangeMap.h +++ b/include/lldb/Core/RangeMap.h @@ -128,9 +128,10 @@ namespace lldb_private { { return Contains(range.GetRangeBase()) && ContainsEndInclusive(range.GetRangeEnd()); } - + + // Returns true if the two ranges adjoing or intersect bool - Overlap (const Range &rhs) const + DoesAdjoinOrIntersect (const Range &rhs) const { const BaseType lhs_base = this->GetRangeBase(); const BaseType rhs_base = rhs.GetRangeBase(); @@ -139,7 +140,19 @@ namespace lldb_private { bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base); return result; } - + + // Returns true if the two ranges intersect + bool + DoesIntersect (const Range &rhs) const + { + const BaseType lhs_base = this->GetRangeBase(); + const BaseType rhs_base = rhs.GetRangeBase(); + const BaseType lhs_end = this->GetRangeEnd(); + const BaseType rhs_end = rhs.GetRangeEnd(); + bool result = (lhs_base < rhs_end) && (lhs_end > rhs_base); + return result; + } + bool operator < (const Range &rhs) const { @@ -241,7 +254,7 @@ namespace lldb_private { // don't end up allocating and making a new collection for no reason for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++) { - if (prev != end && prev->Overlap(*pos)) + if (prev != end && prev->DoesAdjoinOrIntersect(*pos)) { can_combine = true; break; @@ -255,7 +268,7 @@ namespace lldb_private { Collection minimal_ranges; for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++) { - if (prev != end && prev->Overlap(*pos)) + if (prev != end && prev->DoesAdjoinOrIntersect(*pos)) minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd())); else minimal_ranges.push_back (*pos); @@ -521,7 +534,7 @@ namespace lldb_private { // don't end up allocating and making a new collection for no reason for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++) { - if (prev != end && prev->Overlap(*pos)) + if (prev != end && prev->DoesAdjoinOrIntersect(*pos)) { can_combine = true; break; @@ -535,7 +548,7 @@ namespace lldb_private { Collection minimal_ranges; for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++) { - if (prev != end && prev->Overlap(*pos)) + if (prev != end && prev->DoesAdjoinOrIntersect(*pos)) minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd())); else minimal_ranges.push_back (*pos); diff --git a/include/lldb/Core/StreamAsynchronousIO.h b/include/lldb/Core/StreamAsynchronousIO.h index a73a9567fe83..d3b054463fa7 100644 --- a/include/lldb/Core/StreamAsynchronousIO.h +++ b/include/lldb/Core/StreamAsynchronousIO.h @@ -20,7 +20,7 @@ class StreamAsynchronousIO : public Stream { public: - StreamAsynchronousIO (Broadcaster &broadcaster, uint32_t broadcast_event_type); + StreamAsynchronousIO (Debugger &debugger, bool for_stdout); virtual ~StreamAsynchronousIO (); @@ -32,9 +32,9 @@ public: private: - Broadcaster &m_broadcaster; - uint32_t m_broadcast_event_type; - std::string m_accumulated_data; + Debugger &m_debugger; + std::string m_data; + bool m_for_stdout; }; } // namespace lldb_private diff --git a/include/lldb/Core/StreamFile.h b/include/lldb/Core/StreamFile.h index d032c0b21e6b..55bb361780a5 100644 --- a/include/lldb/Core/StreamFile.h +++ b/include/lldb/Core/StreamFile.h @@ -37,6 +37,10 @@ public: StreamFile (const char *path); + StreamFile (const char *path, + uint32_t options, + uint32_t permissions = lldb::eFilePermissionsFileDefault); + StreamFile (FILE *fh, bool transfer_ownership); virtual diff --git a/include/lldb/Core/StringList.h b/include/lldb/Core/StringList.h index b68ab4be2d6d..c69ed872c30d 100644 --- a/include/lldb/Core/StringList.h +++ b/include/lldb/Core/StringList.h @@ -14,6 +14,7 @@ #include "lldb/Core/STLUtils.h" #include "lldb/lldb-forward.h" +#include "llvm/ADT/StringRef.h" namespace lldb_private { @@ -43,6 +44,9 @@ public: AppendString (const char *str, size_t str_len); void + AppendString(llvm::StringRef str); + + void AppendList (const char ** strv, int strc); void diff --git a/include/lldb/Core/StructuredData.h b/include/lldb/Core/StructuredData.h index a4cabf4fe352..8acfa310deac 100644 --- a/include/lldb/Core/StructuredData.h +++ b/include/lldb/Core/StructuredData.h @@ -13,10 +13,11 @@ // C Includes // C++ Includes +#include <functional> #include <map> +#include <string> #include <utility> #include <vector> -#include <string> #include "llvm/ADT/StringRef.h" @@ -54,14 +55,22 @@ public: class Boolean; class String; class Dictionary; + class Generic; typedef std::shared_ptr<Object> ObjectSP; typedef std::shared_ptr<Array> ArraySP; + typedef std::shared_ptr<Integer> IntegerSP; + typedef std::shared_ptr<Float> FloatSP; + typedef std::shared_ptr<Boolean> BooleanSP; + typedef std::shared_ptr<String> StringSP; typedef std::shared_ptr<Dictionary> DictionarySP; + typedef std::shared_ptr<Generic> GenericSP; - enum class Type { + enum class Type + { eTypeInvalid = -1, eTypeNull = 0, + eTypeGeneric, eTypeArray, eTypeInteger, eTypeFloat, @@ -84,6 +93,12 @@ public: { } + virtual bool + IsValid() const + { + return true; + } + virtual void Clear () { @@ -126,6 +141,15 @@ public: return NULL; } + uint64_t + GetIntegerValue (uint64_t fail_value = 0) + { + Integer *integer = GetAsInteger (); + if (integer) + return integer->GetValue(); + return fail_value; + } + Float * GetAsFloat () { @@ -134,6 +158,15 @@ public: return NULL; } + double + GetFloatValue (double fail_value = 0.0) + { + Float *f = GetAsFloat (); + if (f) + return f->GetValue(); + return fail_value; + } + Boolean * GetAsBoolean () { @@ -142,6 +175,15 @@ public: return NULL; } + bool + GetBooleanValue (bool fail_value = false) + { + Boolean *b = GetAsBoolean (); + if (b) + return b->GetValue(); + return fail_value; + } + String * GetAsString () { @@ -150,9 +192,32 @@ public: return NULL; } + std::string + GetStringValue(const char *fail_value = NULL) + { + String *s = GetAsString (); + if (s) + return s->GetValue(); + + if (fail_value && fail_value[0]) + return std::string(fail_value); + + return std::string(); + } + + Generic * + GetAsGeneric() + { + if (m_type == Type::eTypeGeneric) + return (Generic *)this; + return NULL; + } + ObjectSP GetObjectForDotSeparatedPath (llvm::StringRef path); + void DumpToStdout() const; + virtual void Dump (Stream &s) const = 0; @@ -173,8 +238,19 @@ public: { } + void + ForEach (std::function <bool(Object* object)> const &foreach_callback) const + { + for (const auto &object_sp : m_items) + { + if (foreach_callback(object_sp.get()) == false) + break; + } + } + + size_t - GetSize() + GetSize() const { return m_items.size(); } @@ -188,13 +264,97 @@ public: } ObjectSP - GetItemAtIndex (size_t idx) + GetItemAtIndex(size_t idx) const { + assert(idx < GetSize()); if (idx < m_items.size()) return m_items[idx]; return ObjectSP(); } + template <class IntType> + bool + GetItemAtIndexAsInteger(size_t idx, IntType &result) const + { + ObjectSP value = GetItemAtIndex(idx); + if (auto int_value = value->GetAsInteger()) + { + result = static_cast<IntType>(int_value->GetValue()); + return true; + } + return false; + } + + template <class IntType> + bool + GetItemAtIndexAsInteger(size_t idx, IntType &result, IntType default_val) const + { + bool success = GetItemAtIndexAsInteger(idx, result); + if (!success) + result = default_val; + return success; + } + + bool + GetItemAtIndexAsString(size_t idx, std::string &result) const + { + ObjectSP value = GetItemAtIndex(idx); + if (auto string_value = value->GetAsString()) + { + result = string_value->GetValue(); + return true; + } + return false; + } + + bool + GetItemAtIndexAsString(size_t idx, std::string &result, const std::string &default_val) const + { + bool success = GetItemAtIndexAsString(idx, result); + if (!success) + result = default_val; + return success; + } + + bool + GetItemAtIndexAsString(size_t idx, ConstString &result) const + { + ObjectSP value = GetItemAtIndex(idx); + if (!value) + return false; + if (auto string_value = value->GetAsString()) + { + result = ConstString(string_value->GetValue()); + return true; + } + return false; + } + + bool + GetItemAtIndexAsString(size_t idx, ConstString &result, const char *default_val) const + { + bool success = GetItemAtIndexAsString(idx, result); + if (!success) + result.SetCString(default_val); + return success; + } + + bool + GetItemAtIndexAsDictionary(size_t idx, Dictionary *&result) const + { + ObjectSP value = GetItemAtIndex(idx); + result = value->GetAsDictionary(); + return (result != nullptr); + } + + bool + GetItemAtIndexAsArray(size_t idx, Array *&result) const + { + ObjectSP value = GetItemAtIndex(idx); + result = value->GetAsArray(); + return (result != nullptr); + } + void Push(ObjectSP item) { @@ -207,8 +367,7 @@ public: m_items.push_back(item); } - virtual void - Dump (Stream &s) const; + void Dump(Stream &s) const override; protected: typedef std::vector<ObjectSP> collection; @@ -219,9 +378,9 @@ public: class Integer : public Object { public: - Integer () : + Integer (uint64_t i = 0) : Object (Type::eTypeInteger), - m_value () + m_value (i) { } @@ -241,8 +400,7 @@ public: return m_value; } - virtual void - Dump (Stream &s) const; + void Dump(Stream &s) const override; protected: uint64_t m_value; @@ -251,9 +409,9 @@ public: class Float : public Object { public: - Float () : + Float (double d = 0.0) : Object (Type::eTypeFloat), - m_value () + m_value (d) { } @@ -273,8 +431,7 @@ public: return m_value; } - virtual void - Dump (Stream &s) const; + void Dump(Stream &s) const override; protected: double m_value; @@ -283,9 +440,9 @@ public: class Boolean : public Object { public: - Boolean () : + Boolean (bool b = false) : Object (Type::eTypeBoolean), - m_value () + m_value (b) { } @@ -305,8 +462,7 @@ public: return m_value; } - virtual void - Dump (Stream &s) const; + void Dump(Stream &s) const override; protected: bool m_value; @@ -317,26 +473,39 @@ public: class String : public Object { public: - String () : + String (const char *cstr = NULL) : Object (Type::eTypeString), m_value () { + if (cstr) + m_value = cstr; + } + + String (const std::string &s) : + Object (Type::eTypeString), + m_value (s) + { + } + + String (const std::string &&s) : + Object (Type::eTypeString), + m_value (s) + { } void - SetValue (std::string string) + SetValue (const std::string &string) { m_value = string; } - std::string + const std::string & GetValue () { return m_value; } - virtual void - Dump (Stream &s) const; + void Dump(Stream &s) const override; protected: std::string m_value; @@ -345,6 +514,7 @@ public: class Dictionary : public Object { public: + Dictionary () : Object (Type::eTypeDictionary), m_dict () @@ -354,14 +524,25 @@ public: virtual ~Dictionary() { } + size_t - GetSize() + GetSize() const { return m_dict.size(); } + void + ForEach (std::function <bool(ConstString key, Object* object)> const &callback) const + { + for (const auto &pair : m_dict) + { + if (callback (pair.first, pair.second.get()) == false) + break; + } + } + ObjectSP - GetKeys() + GetKeys() const { ObjectSP object_sp(new Array ()); Array *array = object_sp->GetAsArray(); @@ -376,10 +557,10 @@ public: } ObjectSP - GetValueForKey (const char *key) + GetValueForKey(llvm::StringRef key) const { ObjectSP value_sp; - if (key) + if (!key.empty()) { ConstString key_cs(key); for (collection::const_iterator iter = m_dict.begin(); iter != m_dict.end(); ++iter) @@ -394,62 +575,144 @@ public: return value_sp; } + template <class IntType> bool - HasKey (const char *key) + GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const { - ConstString key_cs (key); - collection::const_iterator search = m_dict.find(key_cs); - if (search != m_dict.end()) + ObjectSP value = GetValueForKey(key); + if (!value) + return false; + if (auto int_value = value->GetAsInteger()) { + result = static_cast<IntType>(int_value->GetValue()); return true; } - else + return false; + } + + template <class IntType> + bool + GetValueForKeyAsInteger(llvm::StringRef key, IntType &result, IntType default_val) const + { + bool success = GetValueForKeyAsInteger<IntType>(key, result); + if (!success) + result = default_val; + return success; + } + + bool + GetValueForKeyAsString(llvm::StringRef key, std::string &result) const + { + ObjectSP value = GetValueForKey(key); + if (!value) + return false; + if (auto string_value = value->GetAsString()) { + result = string_value->GetValue(); + return true; + } + return false; + } + + bool + GetValueForKeyAsString(llvm::StringRef key, std::string &result, const char *default_val) const + { + bool success = GetValueForKeyAsString(key, result); + if (!success) + { + if (default_val) + result = default_val; + else + result.clear(); + } + return success; + } + + bool + GetValueForKeyAsString(llvm::StringRef key, ConstString &result) const + { + ObjectSP value = GetValueForKey(key); + if (!value) return false; + if (auto string_value = value->GetAsString()) + { + result = ConstString(string_value->GetValue()); + return true; } + return false; + } + + bool + GetValueForKeyAsString(llvm::StringRef key, ConstString &result, const char *default_val) const + { + bool success = GetValueForKeyAsString(key, result); + if (!success) + result.SetCString(default_val); + return success; + } + + bool + GetValueForKeyAsDictionary(llvm::StringRef key, Dictionary *&result) const + { + result = nullptr; + ObjectSP value = GetValueForKey(key); + if (!value) + return false; + result = value->GetAsDictionary(); + return true; + } + + bool + GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const + { + result = nullptr; + ObjectSP value = GetValueForKey(key); + if (!value) + return false; + result = value->GetAsArray(); + return true; + } + + bool + HasKey(llvm::StringRef key) const + { + ConstString key_cs(key); + collection::const_iterator search = m_dict.find(key_cs); + return search != m_dict.end(); } void - AddItem (const char *key, ObjectSP value) + AddItem (llvm::StringRef key, ObjectSP value) { ConstString key_cs(key); m_dict[key_cs] = value; } void - AddIntegerItem (const char *key, uint64_t value) + AddIntegerItem (llvm::StringRef key, uint64_t value) { - ObjectSP val_obj (new Integer()); - val_obj->GetAsInteger()->SetValue (value); - AddItem (key, val_obj); + AddItem (key, ObjectSP (new Integer(value))); } void - AddFloatItem (const char *key, double value) + AddFloatItem (llvm::StringRef key, double value) { - ObjectSP val_obj (new Float()); - val_obj->GetAsFloat()->SetValue (value); - AddItem (key, val_obj); + AddItem (key, ObjectSP (new Float(value))); } void - AddStringItem (const char *key, std::string value) + AddStringItem (llvm::StringRef key, std::string value) { - ObjectSP val_obj (new String()); - val_obj->GetAsString()->SetValue (value); - AddItem (key, val_obj); + AddItem (key, ObjectSP (new String(std::move(value)))); } void - AddBooleanItem (const char *key, bool value) + AddBooleanItem (llvm::StringRef key, bool value) { - ObjectSP val_obj (new Boolean()); - val_obj->GetAsBoolean()->SetValue (value); - AddItem (key, val_obj); + AddItem (key, ObjectSP (new Boolean(value))); } - virtual void - Dump (Stream &s) const; + void Dump(Stream &s) const override; protected: typedef std::map<ConstString, ObjectSP> collection; @@ -468,12 +731,49 @@ public: { } - virtual void - Dump (Stream &s) const; + bool + IsValid() const override + { + return false; + } + + void Dump(Stream &s) const override; protected: }; + class Generic : public Object + { + public: + explicit Generic(void *object = nullptr) : + Object (Type::eTypeGeneric), + m_object (object) + { + } + + void + SetValue(void *value) + { + m_object = value; + } + + void * + GetValue() const + { + return m_object; + } + + bool + IsValid() const override + { + return m_object != nullptr; + } + + void Dump(Stream &s) const override; + + private: + void *m_object; + }; static ObjectSP ParseJSON (std::string json_text); diff --git a/include/lldb/Core/ThreadSafeDenseSet.h b/include/lldb/Core/ThreadSafeDenseSet.h new file mode 100644 index 000000000000..19c67b65e8c1 --- /dev/null +++ b/include/lldb/Core/ThreadSafeDenseSet.h @@ -0,0 +1,65 @@ +//===-- ThreadSafeDenseSet.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_ThreadSafeDenseSet_h_ +#define liblldb_ThreadSafeDenseSet_h_ + +// C Includes +// C++ Includes + +// Other libraries and framework includes +#include "llvm/ADT/DenseSet.h" + +// Project includes +#include "lldb/Host/Mutex.h" + +namespace lldb_private { + + template <typename _ElementType> + class ThreadSafeDenseSet + { + public: + typedef llvm::DenseSet<_ElementType> LLVMSetType; + + ThreadSafeDenseSet(unsigned set_initial_capacity = 0, + Mutex::Type mutex_type = Mutex::eMutexTypeNormal) : + m_set(set_initial_capacity), + m_mutex(mutex_type) + { + } + + void + Insert (_ElementType e) + { + Mutex::Locker locker(m_mutex); + m_set.insert(e); + } + + void + Erase (_ElementType e) + { + Mutex::Locker locker(m_mutex); + m_set.erase(e); + } + + bool + Lookup (_ElementType e) + { + Mutex::Locker locker(m_mutex); + return (m_set.count(e) > 0); + } + + protected: + LLVMSetType m_set; + Mutex m_mutex; + }; + +} // namespace lldb_private + +#endif // liblldb_ThreadSafeDenseSet_h_ diff --git a/include/lldb/Core/ValueObject.h b/include/lldb/Core/ValueObject.h index b50adfb69564..cdc507093b28 100644 --- a/include/lldb/Core/ValueObject.h +++ b/include/lldb/Core/ValueObject.h @@ -16,6 +16,7 @@ #include <vector> // Other libraries and framework includes +#include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" // Project includes @@ -26,6 +27,7 @@ #include "lldb/Core/ConstString.h" #include "lldb/Core/UserID.h" #include "lldb/Core/Value.h" +#include "lldb/Symbol/ClangASTType.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/Process.h" @@ -139,19 +141,27 @@ public: struct GetValueForExpressionPathOptions { + enum class SyntheticChildrenTraversal + { + None, + ToSynthetic, + FromSynthetic, + Both + }; + bool m_check_dot_vs_arrow_syntax; bool m_no_fragile_ivar; bool m_allow_bitfields_syntax; - bool m_no_synthetic_children; + SyntheticChildrenTraversal m_synthetic_children_traversal; GetValueForExpressionPathOptions(bool dot = false, bool no_ivar = false, bool bitfield = true, - bool no_synth = false) : + SyntheticChildrenTraversal synth_traverse = SyntheticChildrenTraversal::ToSynthetic) : m_check_dot_vs_arrow_syntax(dot), m_no_fragile_ivar(no_ivar), m_allow_bitfields_syntax(bitfield), - m_no_synthetic_children(no_synth) + m_synthetic_children_traversal(synth_traverse) { } @@ -198,16 +208,9 @@ public: } GetValueForExpressionPathOptions& - DoAllowSyntheticChildren() - { - m_no_synthetic_children = false; - return *this; - } - - GetValueForExpressionPathOptions& - DontAllowSyntheticChildren() + SetSyntheticChildrenTraversal(SyntheticChildrenTraversal traverse) { - m_no_synthetic_children = true; + m_synthetic_children_traversal = traverse; return *this; } @@ -282,18 +285,19 @@ public: SetUpdated (); bool - NeedsUpdating() + NeedsUpdating(bool accept_invalid_exe_ctx) { - SyncWithProcessState(); + SyncWithProcessState(accept_invalid_exe_ctx); return m_needs_update; } bool IsValid () { + const bool accept_invalid_exe_ctx = false; if (!m_mod_id.IsValid()) return false; - else if (SyncWithProcessState ()) + else if (SyncWithProcessState (accept_invalid_exe_ctx)) { if (!m_mod_id.IsValid()) return false; @@ -315,7 +319,7 @@ public: private: bool - SyncWithProcessState (); + SyncWithProcessState (bool accept_invalid_exe_ctx); ProcessModID m_mod_id; // This is the stop id when this ValueObject was last evaluated. ExecutionContextRef m_exe_ctx_ref; @@ -647,6 +651,7 @@ public: bool GetValueIsValid () const; + // If you call this on a newly created ValueObject, it will always return false. bool GetValueDidChange (); @@ -679,12 +684,6 @@ public: GetSyntheticArrayMember (size_t index, bool can_create); lldb::ValueObjectSP - GetSyntheticArrayMemberFromPointer (size_t index, bool can_create); - - lldb::ValueObjectSP - GetSyntheticArrayMemberFromArray (size_t index, bool can_create); - - lldb::ValueObjectSP GetSyntheticBitFieldChild (uint32_t from, uint32_t to, bool can_create); lldb::ValueObjectSP @@ -853,12 +852,19 @@ public: virtual bool SetData (DataExtractor &data, Error &error); - bool + virtual bool GetIsConstant () const { return m_update_point.IsConstant(); } + bool + NeedsUpdating () + { + const bool accept_invalid_exe_ctx = CanUpdateWithInvalidExecutionContext(); + return m_update_point.NeedsUpdating(accept_invalid_exe_ctx); + } + void SetIsConstant () { @@ -868,7 +874,7 @@ public: lldb::Format GetFormat () const; - void + virtual void SetFormat (lldb::Format format) { if (format != m_format) @@ -992,6 +998,9 @@ public: //------------------------------------------------------------------ virtual bool MightHaveChildren(); + + virtual bool + IsRuntimeSupportValue (); protected: typedef ClusterManager<ValueObject> ValueObjectManager; @@ -1128,10 +1137,12 @@ protected: m_did_calculate_complete_objc_class_type:1, m_is_synthetic_children_generated:1; + friend class ValueObjectChild; friend class ClangExpressionDeclMap; // For GetValue friend class ClangExpressionVariable; // For SetName friend class Target; // For SetName friend class ValueObjectConstResultImpl; + friend class ValueObjectSynthetic; // For ClearUserVisibleData //------------------------------------------------------------------ // Constructors and Destructors @@ -1161,6 +1172,12 @@ protected: virtual bool UpdateValue () = 0; + virtual bool + CanUpdateWithInvalidExecutionContext () + { + return false; + } + virtual void CalculateDynamicValue (lldb::DynamicValueType use_dynamic); diff --git a/include/lldb/Core/ValueObjectChild.h b/include/lldb/Core/ValueObjectChild.h index 7bbfe8a662d1..bf8707ea3b05 100644 --- a/include/lldb/Core/ValueObjectChild.h +++ b/include/lldb/Core/ValueObjectChild.h @@ -83,6 +83,9 @@ public: protected: virtual bool UpdateValue (); + + virtual bool + CanUpdateWithInvalidExecutionContext (); virtual ClangASTType GetClangTypeImpl () diff --git a/include/lldb/Core/ValueObjectDynamicValue.h b/include/lldb/Core/ValueObjectDynamicValue.h index 7607bd38137d..8d42706be166 100644 --- a/include/lldb/Core/ValueObjectDynamicValue.h +++ b/include/lldb/Core/ValueObjectDynamicValue.h @@ -56,6 +56,12 @@ public: return true; } + virtual bool + GetIsConstant () const + { + return false; + } + virtual ValueObject * GetParent() { @@ -103,6 +109,12 @@ protected: virtual bool UpdateValue (); + virtual bool + CanUpdateWithInvalidExecutionContext () + { + return true; + } + virtual lldb::DynamicValueType GetDynamicValueTypeImpl () { diff --git a/include/lldb/Core/ValueObjectSyntheticFilter.h b/include/lldb/Core/ValueObjectSyntheticFilter.h index aa784add7409..88824ef4fa54 100644 --- a/include/lldb/Core/ValueObjectSyntheticFilter.h +++ b/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -141,12 +141,27 @@ public: } virtual bool + GetIsConstant () const + { + return false; + } + + virtual bool SetValueFromCString (const char *value_str, Error& error); + virtual void + SetFormat (lldb::Format format); + protected: virtual bool UpdateValue (); + virtual bool + CanUpdateWithInvalidExecutionContext () + { + return true; + } + virtual ClangASTType GetClangTypeImpl (); |