diff options
889 files changed, 0 insertions, 10287 deletions
diff --git a/lldb/examples/darwin/heap_find/heap/heap_find.cpp b/lldb/examples/darwin/heap_find/heap/heap_find.cpp index ce1bbee..b712215 100644 --- a/lldb/examples/darwin/heap_find/heap/heap_find.cpp +++ b/lldb/examples/darwin/heap_find/heap/heap_find.cpp @@ -79,9 +79,7 @@ // C++ includes #include <vector> -//---------------------------------------------------------------------- // Redefine private types from "/usr/local/include/stack_logging.h" -//---------------------------------------------------------------------- typedef struct { uint32_t type_flags; uint64_t stack_identifier; @@ -89,9 +87,7 @@ typedef struct { mach_vm_address_t address; } mach_stack_logging_record_t; -//---------------------------------------------------------------------- // Redefine private defines from "/usr/local/include/stack_logging.h" -//---------------------------------------------------------------------- #define stack_logging_type_free 0 #define stack_logging_type_generic 1 #define stack_logging_type_alloc 2 @@ -99,10 +95,8 @@ typedef struct { // This bit is made up by this code #define stack_logging_type_vm_region 8 -//---------------------------------------------------------------------- // Redefine private function prototypes from // "/usr/local/include/stack_logging.h" -//---------------------------------------------------------------------- extern "C" kern_return_t __mach_stack_logging_set_file_path(task_t task, char *file_path); @@ -125,21 +119,15 @@ extern "C" void *gdb_class_getClass(void *objc_class); static void range_info_callback(task_t task, void *baton, unsigned type, uint64_t ptr_addr, uint64_t ptr_size); -//---------------------------------------------------------------------- // Redefine private global variables prototypes from // "/usr/local/include/stack_logging.h" -//---------------------------------------------------------------------- extern "C" int stack_logging_enable_logging; -//---------------------------------------------------------------------- // Local defines -//---------------------------------------------------------------------- #define MAX_FRAMES 1024 -//---------------------------------------------------------------------- // Local Typedefs and Types -//---------------------------------------------------------------------- typedef void range_callback_t(task_t task, void *baton, unsigned type, uint64_t ptr_addr, uint64_t ptr_size); typedef void zone_callback_t(void *info, const malloc_zone_t *zone); @@ -294,10 +282,8 @@ protected: uint32_t m_size; }; -//---------------------------------------------------------------------- // A safe way to allocate memory and keep it from interfering with the // malloc enumerators. -//---------------------------------------------------------------------- void *safe_malloc(size_t n_bytes) { if (n_bytes > 0) { const int k_page_size = getpagesize(); @@ -311,9 +297,7 @@ void *safe_malloc(size_t n_bytes) { return NULL; } -//---------------------------------------------------------------------- // ObjCClasses -//---------------------------------------------------------------------- class ObjCClasses { public: ObjCClasses() : m_objc_class_ptrs(NULL), m_size(0) {} @@ -356,16 +340,12 @@ private: uint32_t m_size; }; -//---------------------------------------------------------------------- // Local global variables -//---------------------------------------------------------------------- MatchResults g_matches; MallocStackLoggingEntries g_malloc_stack_history; ObjCClasses g_objc_classes; -//---------------------------------------------------------------------- // ObjCClassInfo -//---------------------------------------------------------------------- enum HeapInfoSortType { eSortTypeNone, eSortTypeBytes, eSortTypeCount }; @@ -469,13 +449,11 @@ private: ObjCClassInfo g_objc_class_snapshot; -//---------------------------------------------------------------------- // task_peek // // Reads memory from this tasks address space. This callback is needed // by the code that iterates through all of the malloc blocks to read // the memory in this process. -//---------------------------------------------------------------------- static kern_return_t task_peek(task_t task, vm_address_t remote_address, vm_size_t size, void **local_memory) { *local_memory = (void *)remote_address; @@ -534,12 +512,10 @@ static const void foreach_zone_in_this_process(range_callback_info_t *info) { } } -//---------------------------------------------------------------------- // dump_malloc_block_callback // // A simple callback that will dump each malloc block and all available // info from the enumeration callback perspective. -//---------------------------------------------------------------------- static void dump_malloc_block_callback(task_t task, void *baton, unsigned type, uint64_t ptr_addr, uint64_t ptr_size) { printf("task = 0x%4.4x: baton = %p, type = %u, ptr_addr = 0x%llx + 0x%llu\n", @@ -739,12 +715,10 @@ malloc_stack_entry *get_stack_history_for_address(const void *addr, return g_malloc_stack_history.data(); } -//---------------------------------------------------------------------- // find_pointer_in_heap // // Finds a pointer value inside one or more currently valid malloc // blocks. -//---------------------------------------------------------------------- malloc_match *find_pointer_in_heap(const void *addr, int check_vm_regions) { g_matches.clear(); // Setup "info" to look for a malloc block that contains data @@ -767,12 +741,10 @@ malloc_match *find_pointer_in_heap(const void *addr, int check_vm_regions) { return g_matches.data(); } -//---------------------------------------------------------------------- // find_pointer_in_memory // // Finds a pointer value inside one or more currently valid malloc // blocks. -//---------------------------------------------------------------------- malloc_match *find_pointer_in_memory(uint64_t memory_addr, uint64_t memory_size, const void *addr) { g_matches.clear(); @@ -793,13 +765,11 @@ malloc_match *find_pointer_in_memory(uint64_t memory_addr, uint64_t memory_size, return g_matches.data(); } -//---------------------------------------------------------------------- // find_objc_objects_in_memory // // Find all instances of ObjC classes 'c', or all ObjC classes if 'c' is // NULL. If 'c' is non NULL, then also check objects to see if they // inherit from 'c' -//---------------------------------------------------------------------- malloc_match *find_objc_objects_in_memory(void *isa, int check_vm_regions) { g_matches.clear(); if (g_objc_classes.Update()) { @@ -819,12 +789,10 @@ malloc_match *find_objc_objects_in_memory(void *isa, int check_vm_regions) { return g_matches.data(); } -//---------------------------------------------------------------------- // get_heap_info // // Gather information for all allocations on the heap and report // statistics. -//---------------------------------------------------------------------- void get_heap_info(int sort_type) { if (g_objc_classes.Update()) { @@ -859,11 +827,9 @@ void get_heap_info(int sort_type) { } } -//---------------------------------------------------------------------- // find_cstring_in_heap // // Finds a C string inside one or more currently valid malloc blocks. -//---------------------------------------------------------------------- malloc_match *find_cstring_in_heap(const char *s, int check_vm_regions) { g_matches.clear(); if (s == NULL || s[0] == '\0') { @@ -887,11 +853,9 @@ malloc_match *find_cstring_in_heap(const char *s, int check_vm_regions) { return g_matches.data(); } -//---------------------------------------------------------------------- // find_block_for_address // // Find the malloc block that whose address range contains "addr". -//---------------------------------------------------------------------- malloc_match *find_block_for_address(const void *addr, int check_vm_regions) { g_matches.clear(); // Setup "info" to look for a malloc block that contains data diff --git a/lldb/examples/functions/main.cpp b/lldb/examples/functions/main.cpp index cf33f374..07fb206 100644 --- a/lldb/examples/functions/main.cpp +++ b/lldb/examples/functions/main.cpp @@ -29,7 +29,6 @@ using namespace lldb; -//---------------------------------------------------------------------- // This quick sample code shows how to create a debugger instance and // create an executable target without adding dependent shared // libraries. It will then set a regular expression breakpoint to get @@ -47,7 +46,6 @@ using namespace lldb; // // $ DYLD_FRAMEWORK_PATH=/Volumes/data/lldb/tot/build/Debug ./a.out // executable_path1 [executable_path2 ...] -//---------------------------------------------------------------------- class LLDBSentry { public: LLDBSentry() { diff --git a/lldb/examples/interposing/darwin/fd_interposing/FDInterposing.cpp b/lldb/examples/interposing/darwin/fd_interposing/FDInterposing.cpp index efcb9bd..e3f429c 100644 --- a/lldb/examples/interposing/darwin/fd_interposing/FDInterposing.cpp +++ b/lldb/examples/interposing/darwin/fd_interposing/FDInterposing.cpp @@ -68,11 +68,9 @@ #include <unistd.h> #include <vector> -//---------------------------------------------------------------------- /// \def DISALLOW_COPY_AND_ASSIGN(TypeName) /// Macro definition for easily disallowing copy constructor and /// assignment operators in C++ classes. -//---------------------------------------------------------------------- #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName &); \ const TypeName &operator=(const TypeName &) @@ -87,10 +85,8 @@ int __open_extended(const char *, int, uid_t, gid_t, int, namespace fd_interposing { -//---------------------------------------------------------------------- // String class so we can get formatted strings without having to worry // about the memory storage since it will allocate the memory it needs. -//---------------------------------------------------------------------- class String { public: String() : m_str(NULL) {} @@ -142,23 +138,19 @@ private: DISALLOW_COPY_AND_ASSIGN(String); }; -//---------------------------------------------------------------------- // Type definitions -//---------------------------------------------------------------------- typedef std::vector<void *> Frames; class FDEvent; typedef std::vector<void *> Frames; typedef std::tr1::shared_ptr<FDEvent> FDEventSP; typedef std::tr1::shared_ptr<String> StringSP; -//---------------------------------------------------------------------- // FDEvent // // A class that describes a file desciptor event. // // File descriptor events fall into one of two categories: create events // and delete events. -//---------------------------------------------------------------------- class FDEvent { public: FDEvent(int fd, int err, const StringSP &string_sp, bool is_create, @@ -204,11 +196,9 @@ private: bool m_is_create; }; -//---------------------------------------------------------------------- // Templatized class that will save errno only if the "value" it is // constructed with is equal to INVALID. When the class goes out of // scope, it will restore errno if it was saved. -//---------------------------------------------------------------------- template <int INVALID> class Errno { public: // Save errno only if we are supposed to @@ -235,9 +225,7 @@ typedef Errno<-1> NegativeErrorErrno; typedef std::vector<FDEventSP> FDEventArray; typedef std::map<int, FDEventArray> FDEventMap; -//---------------------------------------------------------------------- // Globals -//---------------------------------------------------------------------- // Global event map that contains all file descriptor events. As file // descriptor create and close events come in, they will get filled // into this map (protected by g_mutex). When a file descriptor close @@ -264,10 +252,8 @@ static int g_compact = 1; // The current process ID static int g_pid = -1; static bool g_enabled = true; -//---------------------------------------------------------------------- // Mutex class that will lock a mutex when it is constructed, and unlock // it when is goes out of scope -//---------------------------------------------------------------------- class Locker { public: Locker(pthread_mutex_t *mutex_ptr) : m_mutex_ptr(mutex_ptr) { @@ -543,9 +529,7 @@ void save_backtrace(int fd, int err, const StringSP &string_sp, } } -//---------------------------------------------------------------------- // socket() interpose function -//---------------------------------------------------------------------- extern "C" int socket$__interposed__(int domain, int type, int protocol) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -572,9 +556,7 @@ extern "C" int socket$__interposed__(int domain, int type, int protocol) { } } -//---------------------------------------------------------------------- // socketpair() interpose function -//---------------------------------------------------------------------- extern "C" int socketpair$__interposed__(int domain, int type, int protocol, int fds[2]) { const int pid = get_interposed_pid(); @@ -600,9 +582,7 @@ extern "C" int socketpair$__interposed__(int domain, int type, int protocol, } } -//---------------------------------------------------------------------- // open() interpose function -//---------------------------------------------------------------------- extern "C" int open$__interposed__(const char *path, int oflag, int mode) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -631,9 +611,7 @@ extern "C" int open$__interposed__(const char *path, int oflag, int mode) { } } -//---------------------------------------------------------------------- // open$NOCANCEL() interpose function -//---------------------------------------------------------------------- extern "C" int open$NOCANCEL$__interposed__(const char *path, int oflag, int mode) { const int pid = get_interposed_pid(); @@ -654,9 +632,7 @@ extern "C" int open$NOCANCEL$__interposed__(const char *path, int oflag, } } -//---------------------------------------------------------------------- // __open_extended() interpose function -//---------------------------------------------------------------------- extern "C" int __open_extended$__interposed__(const char *path, int oflag, uid_t uid, gid_t gid, int mode, struct kauth_filesec *fsacl) { @@ -679,9 +655,7 @@ extern "C" int __open_extended$__interposed__(const char *path, int oflag, } } -//---------------------------------------------------------------------- // kqueue() interpose function -//---------------------------------------------------------------------- extern "C" int kqueue$__interposed__(void) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -699,9 +673,7 @@ extern "C" int kqueue$__interposed__(void) { } } -//---------------------------------------------------------------------- // shm_open() interpose function -//---------------------------------------------------------------------- extern "C" int shm_open$__interposed__(const char *path, int oflag, int mode) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -721,9 +693,7 @@ extern "C" int shm_open$__interposed__(const char *path, int oflag, int mode) { } } -//---------------------------------------------------------------------- // accept() interpose function -//---------------------------------------------------------------------- extern "C" int accept$__interposed__(int socket, struct sockaddr *address, socklen_t *address_len) { const int pid = get_interposed_pid(); @@ -743,9 +713,7 @@ extern "C" int accept$__interposed__(int socket, struct sockaddr *address, } } -//---------------------------------------------------------------------- // accept$NOCANCEL() interpose function -//---------------------------------------------------------------------- extern "C" int accept$NOCANCEL$__interposed__(int socket, struct sockaddr *address, socklen_t *address_len) { @@ -766,9 +734,7 @@ extern "C" int accept$NOCANCEL$__interposed__(int socket, } } -//---------------------------------------------------------------------- // dup() interpose function -//---------------------------------------------------------------------- extern "C" int dup$__interposed__(int fd2) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -787,9 +753,7 @@ extern "C" int dup$__interposed__(int fd2) { } } -//---------------------------------------------------------------------- // dup2() interpose function -//---------------------------------------------------------------------- extern "C" int dup2$__interposed__(int fd1, int fd2) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -819,9 +783,7 @@ extern "C" int dup2$__interposed__(int fd1, int fd2) { } } -//---------------------------------------------------------------------- // close() interpose function -//---------------------------------------------------------------------- extern "C" int close$__interposed__(int fd) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -859,9 +821,7 @@ extern "C" int close$__interposed__(int fd) { } } -//---------------------------------------------------------------------- // close$NOCANCEL() interpose function -//---------------------------------------------------------------------- extern "C" int close$NOCANCEL$__interposed__(int fd) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -900,9 +860,7 @@ extern "C" int close$NOCANCEL$__interposed__(int fd) { } } -//---------------------------------------------------------------------- // pipe() interpose function -//---------------------------------------------------------------------- extern "C" int pipe$__interposed__(int fds[2]) { const int pid = get_interposed_pid(); if (pid >= 0) { @@ -926,7 +884,6 @@ extern "C" int pipe$__interposed__(int fds[2]) { } } -//---------------------------------------------------------------------- // get_fd_history() // // This function allows runtime access to the file descriptor history. @@ -936,7 +893,6 @@ extern "C" int pipe$__interposed__(int fds[2]) { // // @param[in] fd // The file descriptor whose history should be dumped -//---------------------------------------------------------------------- extern "C" void get_fd_history(int log_fd, int fd) { // "create" below needs to be outside of the mutex locker scope if (log_fd >= 0) { @@ -960,9 +916,7 @@ extern "C" void get_fd_history(int log_fd, int fd) { } } -//---------------------------------------------------------------------- // Interposing -//---------------------------------------------------------------------- // FD creation routines DYLD_INTERPOSE(accept$__interposed__, accept); DYLD_INTERPOSE(accept$NOCANCEL$__interposed__, accept$NOCANCEL); diff --git a/lldb/examples/lookup/main.cpp b/lldb/examples/lookup/main.cpp index 55d0647..4c6daeb 100644 --- a/lldb/examples/lookup/main.cpp +++ b/lldb/examples/lookup/main.cpp @@ -29,7 +29,6 @@ using namespace lldb; -//---------------------------------------------------------------------- // This quick sample code shows how to create a debugger instance and // create an "i386" executable target. Then we can lookup the executable // module and resolve a file address into a section offset address, @@ -45,7 +44,6 @@ using namespace lldb; // // $ DYLD_FRAMEWORK_PATH=/Volumes/data/lldb/svn/ToT/build/Debug ./a.out // executable_path file_address -//---------------------------------------------------------------------- class LLDBSentry { public: LLDBSentry() { diff --git a/lldb/include/lldb/API/SBAttachInfo.h b/lldb/include/lldb/API/SBAttachInfo.h index bc2ac08..3c20a08 100644 --- a/lldb/include/lldb/API/SBAttachInfo.h +++ b/lldb/include/lldb/API/SBAttachInfo.h @@ -21,7 +21,6 @@ public: SBAttachInfo(lldb::pid_t pid); - //------------------------------------------------------------------ /// Attach to a process by name. /// /// This function implies that a future call to SBTarget::Attach(...) @@ -33,10 +32,8 @@ public: /// \param[in] wait_for /// If \b false, attach to an existing process whose name matches. /// If \b true, then wait for the next process whose name matches. - //------------------------------------------------------------------ SBAttachInfo(const char *path, bool wait_for); - //------------------------------------------------------------------ /// Attach to a process by name. /// /// Future calls to SBTarget::Attach(...) will be synchronous or @@ -59,7 +56,6 @@ public: /// eventually found. If the client wants to cancel the event, /// SBProcess::Stop() can be called and an eStateExited process /// event will be delivered. - //------------------------------------------------------------------ SBAttachInfo(const char *path, bool wait_for, bool async); SBAttachInfo(const SBAttachInfo &rhs); @@ -78,7 +74,6 @@ public: bool GetWaitForLaunch(); - //------------------------------------------------------------------ /// Set attach by process name settings. /// /// Designed to be used after a call to SBAttachInfo::SetExecutable(). @@ -88,10 +83,8 @@ public: /// \param[in] b /// If \b false, attach to an existing process whose name matches. /// If \b true, then wait for the next process whose name matches. - //------------------------------------------------------------------ void SetWaitForLaunch(bool b); - //------------------------------------------------------------------ /// Set attach by process name settings. /// /// Designed to be used after a call to SBAttachInfo::SetExecutable(). @@ -112,7 +105,6 @@ public: /// eventually found. If the client wants to cancel the event, /// SBProcess::Stop() can be called and an eStateExited process /// event will be delivered. - //------------------------------------------------------------------ void SetWaitForLaunch(bool b, bool async); bool GetIgnoreExisting(); @@ -157,23 +149,19 @@ public: bool ParentProcessIDIsValid(); - //---------------------------------------------------------------------- /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to /// SBAttachInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. - //---------------------------------------------------------------------- SBListener GetListener(); - //---------------------------------------------------------------------- /// Set the listener that will be used to receive process events. /// /// By default the SBDebugger, which has a listener, that the SBTarget /// belongs to will listen for the process events. Calling this function /// allows a different listener to be used to listen for process events. - //---------------------------------------------------------------------- void SetListener(SBListener &listener); protected: diff --git a/lldb/include/lldb/API/SBBlock.h b/lldb/include/lldb/API/SBBlock.h index f7a6d3e..0ca92ff 100644 --- a/lldb/include/lldb/API/SBBlock.h +++ b/lldb/include/lldb/API/SBBlock.h @@ -60,7 +60,6 @@ public: lldb::SBValueList GetVariables(lldb::SBTarget &target, bool arguments, bool locals, bool statics); - //------------------------------------------------------------------ /// Get the inlined block that contains this block. /// /// \return @@ -69,7 +68,6 @@ public: /// block and are themselves inlined. An invalid SBBlock will /// be returned if this block nor any parent blocks are inlined /// function blocks. - //------------------------------------------------------------------ lldb::SBBlock GetContainingInlinedBlock(); bool GetDescription(lldb::SBStream &description); diff --git a/lldb/include/lldb/API/SBCommandInterpreter.h b/lldb/include/lldb/API/SBCommandInterpreter.h index 13a3b8c..6c80e8e 100644 --- a/lldb/include/lldb/API/SBCommandInterpreter.h +++ b/lldb/include/lldb/API/SBCommandInterpreter.h @@ -190,16 +190,13 @@ public: lldb_private::CommandInterpreter *interpreter_ptr = nullptr); // Access using SBDebugger::GetCommandInterpreter(); - //---------------------------------------------------------------------- /// Return true if the command interpreter is the active IO handler. /// /// This indicates that any input coming into the debugger handles will /// go to the command interpreter and will result in LLDB command line /// commands being executed. - //---------------------------------------------------------------------- bool IsActive(); - //---------------------------------------------------------------------- /// Get the string that needs to be written to the debugger stdin file /// handle when a control character is typed. /// @@ -215,36 +212,27 @@ public: /// The string that should be written into the file handle that is /// feeding the input stream for the debugger, or nullptr if there is /// no string for this control key. - //---------------------------------------------------------------------- const char *GetIOHandlerControlSequence(char ch); bool GetPromptOnQuit(); void SetPromptOnQuit(bool b); - //---------------------------------------------------------------------- /// Sets whether the command interpreter should allow custom exit codes /// for the 'quit' command. - //---------------------------------------------------------------------- void AllowExitCodeOnQuit(bool allow); - //---------------------------------------------------------------------- /// Returns true if the user has called the 'quit' command with a custom exit /// code. - //---------------------------------------------------------------------- bool HasCustomQuitExitCode(); - //---------------------------------------------------------------------- /// Returns the exit code that the user has specified when running the /// 'quit' command. Returns 0 if the user hasn't called 'quit' at all or /// without a custom exit code. - //---------------------------------------------------------------------- int GetQuitStatus(); - //---------------------------------------------------------------------- /// Resolve the command just as HandleCommand would, expanding abbreviations /// and aliases. If successful, result->GetOutput has the full expansion. - //---------------------------------------------------------------------- void ResolveCommand(const char *command_line, SBCommandReturnObject &result); protected: diff --git a/lldb/include/lldb/API/SBCompileUnit.h b/lldb/include/lldb/API/SBCompileUnit.h index b00dbfa..b6b1382 100644 --- a/lldb/include/lldb/API/SBCompileUnit.h +++ b/lldb/include/lldb/API/SBCompileUnit.h @@ -48,7 +48,6 @@ public: uint32_t FindSupportFileIndex(uint32_t start_idx, const SBFileSpec &sb_file, bool full); - //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// compile unit. /// @@ -62,7 +61,6 @@ public: /// /// \return /// A list of types in this compile unit that match \a type_mask - //------------------------------------------------------------------ lldb::SBTypeList GetTypes(uint32_t type_mask = lldb::eTypeClassAny); lldb::LanguageType GetLanguage(); diff --git a/lldb/include/lldb/API/SBInstructionList.h b/lldb/include/lldb/API/SBInstructionList.h index 308fc96a..4434d50 100644 --- a/lldb/include/lldb/API/SBInstructionList.h +++ b/lldb/include/lldb/API/SBInstructionList.h @@ -33,11 +33,9 @@ public: lldb::SBInstruction GetInstructionAtIndex(uint32_t idx); - // ---------------------------------------------------------------------- // Returns the number of instructions between the start and end address. If // canSetBreakpoint is true then the count will be the number of // instructions on which a breakpoint can be set. - // ---------------------------------------------------------------------- size_t GetInstructionsCount(const SBAddress &start, const SBAddress &end, bool canSetBreakpoint = false); diff --git a/lldb/include/lldb/API/SBLaunchInfo.h b/lldb/include/lldb/API/SBLaunchInfo.h index 939a76e..c7b381f 100644 --- a/lldb/include/lldb/API/SBLaunchInfo.h +++ b/lldb/include/lldb/API/SBLaunchInfo.h @@ -42,7 +42,6 @@ public: SBFileSpec GetExecutableFile(); - //---------------------------------------------------------------------- /// Set the executable file that will be used to launch the process and /// optionally set it as the first argument in the argument vector. /// @@ -64,26 +63,21 @@ public: /// If true, then the path will be inserted into the argument vector /// prior to launching. Otherwise the argument vector will be left /// alone. - //---------------------------------------------------------------------- void SetExecutableFile(SBFileSpec exe_file, bool add_as_first_arg); - //---------------------------------------------------------------------- /// Get the listener that will be used to receive process events. /// /// If no listener has been set via a call to /// SBLaunchInfo::SetListener(), then an invalid SBListener will be /// returned (SBListener::IsValid() will return false). If a listener /// has been set, then the valid listener object will be returned. - //---------------------------------------------------------------------- SBListener GetListener(); - //---------------------------------------------------------------------- /// Set the listener that will be used to receive process events. /// /// By default the SBDebugger, which has a listener, that the SBTarget /// belongs to will listen for the process events. Calling this function /// allows a different listener to be used to listen for process events. - //---------------------------------------------------------------------- void SetListener(SBListener &listener); uint32_t GetNumArguments(); diff --git a/lldb/include/lldb/API/SBMemoryRegionInfo.h b/lldb/include/lldb/API/SBMemoryRegionInfo.h index de416e6..2a9ae94 100644 --- a/lldb/include/lldb/API/SBMemoryRegionInfo.h +++ b/lldb/include/lldb/API/SBMemoryRegionInfo.h @@ -27,56 +27,43 @@ public: void Clear(); - //------------------------------------------------------------------ /// Get the base address of this memory range. /// /// \return /// The base address of this memory range. - //------------------------------------------------------------------ lldb::addr_t GetRegionBase(); - //------------------------------------------------------------------ /// Get the end address of this memory range. /// /// \return /// The base address of this memory range. - //------------------------------------------------------------------ lldb::addr_t GetRegionEnd(); - //------------------------------------------------------------------ /// Check if this memory address is marked readable to the process. /// /// \return /// true if this memory address is marked readable - //------------------------------------------------------------------ bool IsReadable(); - //------------------------------------------------------------------ /// Check if this memory address is marked writable to the process. /// /// \return /// true if this memory address is marked writable - //------------------------------------------------------------------ bool IsWritable(); - //------------------------------------------------------------------ /// Check if this memory address is marked executable to the process. /// /// \return /// true if this memory address is marked executable - //------------------------------------------------------------------ bool IsExecutable(); - //------------------------------------------------------------------ /// Check if this memory address is mapped into the process address /// space. /// /// \return /// true if this memory address is in the process address space. - //------------------------------------------------------------------ bool IsMapped(); - //------------------------------------------------------------------ /// Returns the name of the memory region mapped at the given /// address. /// @@ -84,7 +71,6 @@ public: /// In case of memory mapped files it is the absolute path of /// the file otherwise it is a name associated with the memory /// region. If no name can be determined the returns nullptr. - //------------------------------------------------------------------ const char *GetName(); bool operator==(const lldb::SBMemoryRegionInfo &rhs) const; diff --git a/lldb/include/lldb/API/SBModule.h b/lldb/include/lldb/API/SBModule.h index e13b4be..d2b6a18 100644 --- a/lldb/include/lldb/API/SBModule.h +++ b/lldb/include/lldb/API/SBModule.h @@ -37,7 +37,6 @@ public: void Clear(); - //------------------------------------------------------------------ /// Get const accessor for the module file specification. /// /// This function returns the file for the module on the host system @@ -46,10 +45,8 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetFileSpec() const; - //------------------------------------------------------------------ /// Get accessor for the module platform file specification. /// /// Platform file refers to the path of the module as it is known on @@ -63,12 +60,10 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetPlatformFileSpec() const; bool SetPlatformFileSpec(const lldb::SBFileSpec &platform_file); - //------------------------------------------------------------------ /// Get accessor for the remote install path for a module. /// /// When debugging to a remote platform by connecting to a remote @@ -79,10 +74,8 @@ public: /// /// \return /// A file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetRemoteInstallFileSpec(); - //------------------------------------------------------------------ /// Set accessor for the remote install path for a module. /// /// When debugging to a remote platform by connecting to a remote @@ -99,7 +92,6 @@ public: /// /// \param[in] file /// A file specification object. - //------------------------------------------------------------------ bool SetRemoteInstallFileSpec(lldb::SBFileSpec &file); lldb::ByteOrder GetByteOrder(); @@ -130,7 +122,6 @@ public: lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t); - //------------------------------------------------------------------ /// Find compile units related to *this module and passed source /// file. /// @@ -141,7 +132,6 @@ public: /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec); @@ -158,7 +148,6 @@ public: size_t GetNumSections(); lldb::SBSection GetSectionAtIndex(size_t idx); - //------------------------------------------------------------------ /// Find functions by name. /// /// \param[in] name @@ -174,12 +163,10 @@ public: /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); - //------------------------------------------------------------------ /// Find global and static variables by name. /// /// \param[in] target @@ -194,11 +181,9 @@ public: /// /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBValueList FindGlobalVariables(lldb::SBTarget &target, const char *name, uint32_t max_matches); - //------------------------------------------------------------------ /// Find the first global (or static) variable by name. /// /// \param[in] target @@ -210,7 +195,6 @@ public: /// /// \return /// An SBValue that gets filled in with the found variable (if any). - //------------------------------------------------------------------ lldb::SBValue FindFirstGlobalVariable(lldb::SBTarget &target, const char *name); @@ -218,7 +202,6 @@ public: lldb::SBTypeList FindTypes(const char *type); - //------------------------------------------------------------------ /// Get a type using its type ID. /// /// Each symbol file reader will assign different user IDs to their @@ -233,12 +216,10 @@ public: /// \return /// An SBType for the given type ID, or an empty SBType if the /// type was not found. - //------------------------------------------------------------------ lldb::SBType GetTypeByID(lldb::user_id_t uid); lldb::SBType GetBasicType(lldb::BasicType type); - //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// module. /// @@ -251,10 +232,8 @@ public: /// /// \return /// A list of types in this module that match \a type_mask - //------------------------------------------------------------------ lldb::SBTypeList GetTypes(uint32_t type_mask = lldb::eTypeClassAny); - //------------------------------------------------------------------ /// Get the module version numbers. /// /// Many object files have a set of version numbers that describe @@ -293,10 +272,8 @@ public: /// This function always returns the number of version numbers /// that this object file has regardless of the number of /// version numbers that were copied into \a versions. - //------------------------------------------------------------------ uint32_t GetVersion(uint32_t *versions, uint32_t num_versions); - //------------------------------------------------------------------ /// Get accessor for the symbol file specification. /// /// When debugging an object file an additional debug information can @@ -306,7 +283,6 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetSymbolFileSpec() const; lldb::SBAddress GetObjectFileHeaderAddress() const; diff --git a/lldb/include/lldb/API/SBModuleSpec.h b/lldb/include/lldb/API/SBModuleSpec.h index b15d47f..29b3117 100644 --- a/lldb/include/lldb/API/SBModuleSpec.h +++ b/lldb/include/lldb/API/SBModuleSpec.h @@ -30,7 +30,6 @@ public: void Clear(); - //------------------------------------------------------------------ /// Get const accessor for the module file. /// /// This function returns the file for the module on the host system @@ -39,12 +38,10 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetFileSpec(); void SetFileSpec(const lldb::SBFileSpec &fspec); - //------------------------------------------------------------------ /// Get accessor for the module platform file. /// /// Platform file refers to the path of the module as it is known on @@ -58,7 +55,6 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ lldb::SBFileSpec GetPlatformFileSpec(); void SetPlatformFileSpec(const lldb::SBFileSpec &fspec); diff --git a/lldb/include/lldb/API/SBPlatform.h b/lldb/include/lldb/API/SBPlatform.h index f83d3f4..7207b2e 100644 --- a/lldb/include/lldb/API/SBPlatform.h +++ b/lldb/include/lldb/API/SBPlatform.h @@ -109,9 +109,7 @@ public: bool IsConnected(); - //---------------------------------------------------------------------- // The following functions will work if the platform is connected - //---------------------------------------------------------------------- const char *GetTriple(); const char *GetHostname(); diff --git a/lldb/include/lldb/API/SBProcess.h b/lldb/include/lldb/API/SBProcess.h index a146ea1..863cb3c 100644 --- a/lldb/include/lldb/API/SBProcess.h +++ b/lldb/include/lldb/API/SBProcess.h @@ -22,9 +22,7 @@ class SBEvent; class LLDB_API SBProcess { public: - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ FLAGS_ANONYMOUS_ENUM(){eBroadcastBitStateChanged = (1 << 0), eBroadcastBitInterrupt = (1 << 1), eBroadcastBitSTDOUT = (1 << 2), @@ -72,11 +70,9 @@ public: void AppendEventStateReport(const lldb::SBEvent &event, lldb::SBCommandReturnObject &result); - //------------------------------------------------------------------ /// Remote connection related functions. These will fail if the /// process is not in eStateConnected. They are intended for use /// when connecting to an externally managed debugserver instance. - //------------------------------------------------------------------ bool RemoteAttachToProcessWithID(lldb::pid_t pid, lldb::SBError &error); bool RemoteLaunch(char const **argv, char const **envp, @@ -85,9 +81,7 @@ public: uint32_t launch_flags, bool stop_at_entry, lldb::SBError &error); - //------------------------------------------------------------------ // Thread related functions - //------------------------------------------------------------------ uint32_t GetNumThreads(); lldb::SBThread GetThreadAtIndex(size_t index); @@ -98,12 +92,10 @@ public: lldb::SBThread GetSelectedThread() const; - //------------------------------------------------------------------ // Function for lazily creating a thread using the current OS plug-in. This // function will be removed in the future when there are APIs to create // SBThread objects through the interface and add them to the process through // the SBProcess API. - //------------------------------------------------------------------ lldb::SBThread CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context); bool SetSelectedThread(const lldb::SBThread &thread); @@ -112,16 +104,12 @@ public: bool SetSelectedThreadByIndexID(uint32_t index_id); - //------------------------------------------------------------------ // Queue related functions - //------------------------------------------------------------------ uint32_t GetNumQueues(); lldb::SBQueue GetQueueAtIndex(size_t index); - //------------------------------------------------------------------ // Stepping related functions - //------------------------------------------------------------------ lldb::StateType GetState(); @@ -129,7 +117,6 @@ public: const char *GetExitDescription(); - //------------------------------------------------------------------ /// Gets the process ID /// /// Returns the process identifier for the process as it is known @@ -142,10 +129,8 @@ public: /// contain a valid process object, or if the process has not /// been launched. Returns a valid process ID if the process is /// valid. - //------------------------------------------------------------------ lldb::pid_t GetProcessID(); - //------------------------------------------------------------------ /// Gets the unique ID associated with this process object /// /// Unique IDs start at 1 and increment up with each new process @@ -157,7 +142,6 @@ public: /// Returns a non-zero integer ID if this object contains a /// valid process object, zero if this object does not contain /// a valid process object. - //------------------------------------------------------------------ uint32_t GetUniqueID(); uint32_t GetAddressByteSize() const; @@ -182,7 +166,6 @@ public: uint32_t GetStopID(bool include_expression_stops = false); - //------------------------------------------------------------------ /// Gets the stop event corresponding to stop ID. // /// Note that it wasn't fully implemented and tracks only the stop @@ -193,7 +176,6 @@ public: /// /// \return /// The stop event corresponding to stop ID. - //------------------------------------------------------------------ lldb::SBEvent GetStopEventForStopID(uint32_t stop_id); size_t ReadMemory(addr_t addr, void *buf, size_t size, lldb::SBError &error); @@ -236,7 +218,6 @@ public: bool GetDescription(lldb::SBStream &description); - //------------------------------------------------------------------ /// Start Tracing with the given SBTraceOptions. /// /// \param[in] options @@ -260,12 +241,10 @@ public: /// \return /// A SBTrace instance, which should be used /// to get the trace data or other trace related operations. - //------------------------------------------------------------------ lldb::SBTrace StartTrace(SBTraceOptions &options, lldb::SBError &error); uint32_t GetNumSupportedHardwareWatchpoints(lldb::SBError &error) const; - //------------------------------------------------------------------ /// Load a shared library into this process. /// /// \param[in] remote_image_spec @@ -281,10 +260,8 @@ public: /// later used to unload the shared library. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImage(lldb::SBFileSpec &remote_image_spec, lldb::SBError &error); - //------------------------------------------------------------------ /// Load a shared library into this process. /// /// \param[in] local_image_spec @@ -309,12 +286,10 @@ public: /// later used to unload the shared library. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImage(const lldb::SBFileSpec &local_image_spec, const lldb::SBFileSpec &remote_image_spec, lldb::SBError &error); - //------------------------------------------------------------------ /// Load a shared library into this process, starting with a /// library name and a list of paths, searching along the list of /// paths till you find a matching library. @@ -342,7 +317,6 @@ public: /// later passed to UnloadImage. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImageUsingPaths(const lldb::SBFileSpec &image_spec, SBStringList &paths, lldb::SBFileSpec &loaded_path, @@ -352,7 +326,6 @@ public: lldb::SBError SendEventData(const char *data); - //------------------------------------------------------------------ /// Return the number of different thread-origin extended backtraces /// this process can support. /// @@ -364,10 +337,8 @@ public: /// \return /// The number of thread-origin extended backtrace types that may be /// available. - //------------------------------------------------------------------ uint32_t GetNumExtendedBacktraceTypes(); - //------------------------------------------------------------------ /// Return the name of one of the thread-origin extended backtrace /// methods. /// @@ -379,7 +350,6 @@ public: /// /// \return /// The name at that index. - //------------------------------------------------------------------ const char *GetExtendedBacktraceTypeAtIndex(uint32_t idx); lldb::SBThreadCollection GetHistoryThreads(addr_t addr); @@ -389,7 +359,6 @@ public: /// Save the state of the process in a core file (or mini dump on Windows). lldb::SBError SaveCore(const char *file_name); - //------------------------------------------------------------------ /// Query the address load_addr and store the details of the memory /// region that contains it in the supplied SBMemoryRegionInfo object. /// To iterate over all memory regions use GetMemoryRegionList. @@ -404,25 +373,20 @@ public: /// \return /// An error object describes any errors that occurred while /// querying load_addr. - //------------------------------------------------------------------ lldb::SBError GetMemoryRegionInfo(lldb::addr_t load_addr, lldb::SBMemoryRegionInfo ®ion_info); - //------------------------------------------------------------------ /// Return the list of memory regions within the process. /// /// \return /// A list of all witin the process memory regions. - //------------------------------------------------------------------ lldb::SBMemoryRegionInfoList GetMemoryRegions(); - //------------------------------------------------------------------ /// Return information about the process. /// /// Valid process info will only be returned when the process is /// alive, use SBProcessInfo::IsValid() to check returned info is /// valid. - //------------------------------------------------------------------ lldb::SBProcessInfo GetProcessInfo(); protected: diff --git a/lldb/include/lldb/API/SBSection.h b/lldb/include/lldb/API/SBSection.h index 077e498..06a195e 100644 --- a/lldb/include/lldb/API/SBSection.h +++ b/lldb/include/lldb/API/SBSection.h @@ -54,7 +54,6 @@ public: SectionType GetSectionType(); - //------------------------------------------------------------------ /// Gets the permissions (RWX) of the section of the object file /// /// Returns a mask of bits of enum lldb::Permissions for this section. @@ -65,11 +64,9 @@ public: /// /// \return /// Returns an unsigned value for Permissions for the section. - //------------------------------------------------------------------ uint32_t GetPermissions() const; - //------------------------------------------------------------------ /// Return the size of a target's byte represented by this section /// in numbers of host bytes. Note that certain architectures have /// varying minimum addressable unit (i.e. byte) size for their @@ -77,7 +74,6 @@ public: /// /// \return /// The number of host (8-bit) bytes needed to hold a target byte - //------------------------------------------------------------------ uint32_t GetTargetByteSize(); bool operator==(const lldb::SBSection &rhs); diff --git a/lldb/include/lldb/API/SBStructuredData.h b/lldb/include/lldb/API/SBStructuredData.h index 85d60d2..5b10133 100644 --- a/lldb/include/lldb/API/SBStructuredData.h +++ b/lldb/include/lldb/API/SBStructuredData.h @@ -40,53 +40,36 @@ public: lldb::SBError GetDescription(lldb::SBStream &stream) const; - //------------------------------------------------------------------ /// Return the type of data in this data structure - //------------------------------------------------------------------ lldb::StructuredDataType GetType() const; - //------------------------------------------------------------------ /// Return the size (i.e. number of elements) in this data structure /// if it is an array or dictionary type. For other types, 0 will be // returned. - //------------------------------------------------------------------ size_t GetSize() const; - //------------------------------------------------------------------ /// Fill keys with the keys in this object and return true if this data /// structure is a dictionary. Returns false otherwise. - //------------------------------------------------------------------ bool GetKeys(lldb::SBStringList &keys) const; - //------------------------------------------------------------------ /// Return the value corresponding to a key if this data structure /// is a dictionary type. - //------------------------------------------------------------------ lldb::SBStructuredData GetValueForKey(const char *key) const; - //------------------------------------------------------------------ /// Return the value corresponding to an index if this data structure /// is array. - //------------------------------------------------------------------ lldb::SBStructuredData GetItemAtIndex(size_t idx) const; - //------------------------------------------------------------------ /// Return the integer value if this data structure is an integer type. - //------------------------------------------------------------------ uint64_t GetIntegerValue(uint64_t fail_value = 0) const; - //------------------------------------------------------------------ /// Return the floating point value if this data structure is a floating /// type. - //------------------------------------------------------------------ double GetFloatValue(double fail_value = 0.0) const; - //------------------------------------------------------------------ /// Return the boolean value if this data structure is a boolean type. - //------------------------------------------------------------------ bool GetBooleanValue(bool fail_value = false) const; - //------------------------------------------------------------------ /// Provides the string value if this data structure is a string type. /// /// \param[out] dst @@ -102,7 +85,6 @@ public: /// \return /// Returns the byte size needed to completely write the string value at /// \a dst in all cases. - //------------------------------------------------------------------ size_t GetStringValue(char *dst, size_t dst_len) const; protected: diff --git a/lldb/include/lldb/API/SBSymbol.h b/lldb/include/lldb/API/SBSymbol.h index 6193dc3..52486b8 100644 --- a/lldb/include/lldb/API/SBSymbol.h +++ b/lldb/include/lldb/API/SBSymbol.h @@ -55,16 +55,12 @@ public: bool GetDescription(lldb::SBStream &description); - //---------------------------------------------------------------------- // Returns true if the symbol is externally visible in the module that it is // defined in - //---------------------------------------------------------------------- bool IsExternal(); - //---------------------------------------------------------------------- // Returns true if the symbol was synthetically generated from something // other than the actual symbol table itself in the object file. - //---------------------------------------------------------------------- bool IsSynthetic(); protected: diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h index 7287e30..80a7fa0 100644 --- a/lldb/include/lldb/API/SBTarget.h +++ b/lldb/include/lldb/API/SBTarget.h @@ -28,9 +28,7 @@ class SBPlatform; class LLDB_API SBTarget { public: - //------------------------------------------------------------------ // Broadcaster bits. - //------------------------------------------------------------------ enum { eBroadcastBitBreakpointChanged = (1 << 0), eBroadcastBitModulesLoaded = (1 << 1), @@ -39,18 +37,14 @@ public: eBroadcastBitSymbolsLoaded = (1 << 4) }; - //------------------------------------------------------------------ // Constructors - //------------------------------------------------------------------ SBTarget(); SBTarget(const lldb::SBTarget &rhs); SBTarget(const lldb::TargetSP &target_sp); - //------------------------------------------------------------------ // Destructor - //------------------------------------------------------------------ ~SBTarget(); const lldb::SBTarget &operator=(const lldb::SBTarget &rhs); @@ -72,32 +66,25 @@ public: lldb::SBProcess GetProcess(); - //------------------------------------------------------------------ /// Sets whether we should collect statistics on lldb or not. /// /// \param[in] v /// A boolean to control the collection. - //------------------------------------------------------------------ void SetCollectingStats(bool v); - //------------------------------------------------------------------ /// Returns whether statistics collection are enabled. /// /// \return /// true if statistics are currently being collected, false /// otherwise. - //------------------------------------------------------------------ bool GetCollectingStats(); - //------------------------------------------------------------------ /// Returns a dump of the collected statistics. /// /// \return /// A SBStructuredData with the statistics collected. - //------------------------------------------------------------------ lldb::SBStructuredData GetStatistics(); - //------------------------------------------------------------------ /// Return the platform object associated with the target. /// /// After return, the platform object should be checked for @@ -105,10 +92,8 @@ public: /// /// \return /// A platform object. - //------------------------------------------------------------------ lldb::SBPlatform GetPlatform(); - //------------------------------------------------------------------ /// Install any binaries that need to be installed. /// /// This function does nothing when debugging on the host system. @@ -121,10 +106,8 @@ public: /// \return /// An error describing anything that went wrong during /// installation. - //------------------------------------------------------------------ SBError Install(); - //------------------------------------------------------------------ /// Launch a new process. /// /// Launch a new process by spawning a new process using the @@ -176,7 +159,6 @@ public: /// /// \return /// A process object for the newly created process. - //------------------------------------------------------------------ lldb::SBProcess Launch(SBListener &listener, char const **argv, char const **envp, const char *stdin_path, const char *stdout_path, const char *stderr_path, @@ -187,7 +169,6 @@ public: SBProcess LoadCore(const char *core_file); SBProcess LoadCore(const char *core_file, lldb::SBError &error); - //------------------------------------------------------------------ /// Launch a new process with sensible defaults. /// /// \param[in] argv @@ -212,7 +193,6 @@ public: /// /// \return /// A process object for the newly created process. - //------------------------------------------------------------------ SBProcess LaunchSimple(const char **argv, const char **envp, const char *working_directory); @@ -220,7 +200,6 @@ public: SBProcess Attach(SBAttachInfo &attach_info, SBError &error); - //------------------------------------------------------------------ /// Attach to process with pid. /// /// \param[in] listener @@ -237,11 +216,9 @@ public: /// /// \return /// A process object for the attached process. - //------------------------------------------------------------------ lldb::SBProcess AttachToProcessWithID(SBListener &listener, lldb::pid_t pid, lldb::SBError &error); - //------------------------------------------------------------------ /// Attach to process with name. /// /// \param[in] listener @@ -261,12 +238,10 @@ public: /// /// \return /// A process object for the attached process. - //------------------------------------------------------------------ lldb::SBProcess AttachToProcessWithName(SBListener &listener, const char *name, bool wait_for, lldb::SBError &error); - //------------------------------------------------------------------ /// Connect to a remote debug server with url. /// /// \param[in] listener @@ -286,7 +261,6 @@ public: /// /// \return /// A process object for the connected process. - //------------------------------------------------------------------ lldb::SBProcess ConnectRemote(SBListener &listener, const char *url, const char *plugin_name, SBError &error); @@ -316,7 +290,6 @@ public: lldb::SBModule FindModule(const lldb::SBFileSpec &file_spec); - //------------------------------------------------------------------ /// Find compile units related to *this target and passed source /// file. /// @@ -327,7 +300,6 @@ public: /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec); @@ -337,25 +309,20 @@ public: const char *GetTriple(); - //------------------------------------------------------------------ /// Architecture data byte width accessor /// /// \return /// The size in 8-bit (host) bytes of a minimum addressable /// unit from the Architecture's data bus - //------------------------------------------------------------------ uint32_t GetDataByteSize(); - //------------------------------------------------------------------ /// Architecture code byte width accessor /// /// \return /// The size in 8-bit (host) bytes of a minimum addressable /// unit from the Architecture's code bus - //------------------------------------------------------------------ uint32_t GetCodeByteSize(); - //------------------------------------------------------------------ /// Set the base load address for a module section. /// /// \param[in] section @@ -368,11 +335,9 @@ public: /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError SetSectionLoadAddress(lldb::SBSection section, lldb::addr_t section_base_addr); - //------------------------------------------------------------------ /// Clear the base load address for a module section. /// /// \param[in] section @@ -382,10 +347,8 @@ public: /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError ClearSectionLoadAddress(lldb::SBSection section); - //------------------------------------------------------------------ /// Slide all file addresses for all module sections so that \a module /// appears to loaded at these slide addresses. /// @@ -404,11 +367,9 @@ public: /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError SetModuleLoadAddress(lldb::SBModule module, int64_t sections_offset); - //------------------------------------------------------------------ /// Clear the section base load addresses for all sections in a module. /// /// \param[in] module @@ -417,10 +378,8 @@ public: /// \return /// An error to indicate success, fail, and any reason for /// failure. - //------------------------------------------------------------------ lldb::SBError ClearModuleLoadAddress(lldb::SBModule module); - //------------------------------------------------------------------ /// Find functions by name. /// /// \param[in] name @@ -436,12 +395,10 @@ public: /// \return /// A lldb::SBSymbolContextList that gets filled in with all of /// the symbol contexts for all the matches. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask = lldb::eFunctionNameTypeAny); - //------------------------------------------------------------------ /// Find global and static variables by name. /// /// \param[in] name @@ -453,10 +410,8 @@ public: /// /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBValueList FindGlobalVariables(const char *name, uint32_t max_matches); - //------------------------------------------------------------------ /// Find the first global (or static) variable by name. /// /// \param[in] name @@ -465,10 +420,8 @@ public: /// /// \return /// An SBValue that gets filled in with the found variable (if any). - //------------------------------------------------------------------ lldb::SBValue FindFirstGlobalVariable(const char *name); - //------------------------------------------------------------------ /// Find global and static variables by pattern. /// /// \param[in] name @@ -482,11 +435,9 @@ public: /// /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBValueList FindGlobalVariables(const char *name, uint32_t max_matches, MatchType matchtype); - //------------------------------------------------------------------ /// Find global functions by their name with pattern matching. /// /// \param[in] name @@ -500,14 +451,12 @@ public: /// /// \return /// A list of matched variables in an SBValueList. - //------------------------------------------------------------------ lldb::SBSymbolContextList FindGlobalFunctions(const char *name, uint32_t max_matches, MatchType matchtype); void Clear(); - //------------------------------------------------------------------ /// Resolve a current file address into a section offset address. /// /// \param[in] file_addr @@ -515,10 +464,8 @@ public: /// /// \return /// An SBAddress which will be valid if... - //------------------------------------------------------------------ lldb::SBAddress ResolveFileAddress(lldb::addr_t file_addr); - //------------------------------------------------------------------ /// Resolve a current load address into a section offset address. /// /// \param[in] vm_addr @@ -530,10 +477,8 @@ public: /// successfully resolved into a section offset address, or an /// invalid SBAddress if \a vm_addr doesn't resolve to a section /// in a module. - //------------------------------------------------------------------ lldb::SBAddress ResolveLoadAddress(lldb::addr_t vm_addr); - //------------------------------------------------------------------ /// Resolve a current load address into a section offset address /// using the process stop ID to identify a time in the past. /// @@ -554,14 +499,12 @@ public: /// successfully resolved into a section offset address, or an /// invalid SBAddress if \a vm_addr doesn't resolve to a section /// in a module. - //------------------------------------------------------------------ lldb::SBAddress ResolvePastLoadAddress(uint32_t stop_id, lldb::addr_t vm_addr); SBSymbolContext ResolveSymbolContextForAddress(const SBAddress &addr, uint32_t resolve_scope); - //------------------------------------------------------------------ /// Read target memory. If a target process is running then memory /// is read from here. Otherwise the memory is read from the object /// files. For a target whose bytes are sized as a multiple of host @@ -582,7 +525,6 @@ public: /// /// \return /// The amount of data read in host bytes. - //------------------------------------------------------------------ size_t ReadMemory(const SBAddress addr, void *buf, size_t size, lldb::SBError &error); @@ -683,7 +625,6 @@ public: lldb::SBBreakpoint BreakpointCreateBySBAddress(SBAddress &address); - //------------------------------------------------------------------ /// Create a breakpoint using a scripted resolver. /// /// \param[in] class_name @@ -706,7 +647,6 @@ public: /// \return /// An SBBreakpoint that will set locations based on the logic in the /// resolver's search callback. - //------------------------------------------------------------------ lldb::SBBreakpoint BreakpointCreateFromScript( const char *class_name, SBStructuredData &extra_args, @@ -714,7 +654,6 @@ public: const SBFileSpecList &file_list, bool request_hardware = false); - //------------------------------------------------------------------ /// Read breakpoints from source_file and return the newly created /// breakpoints in bkpt_list. /// @@ -726,11 +665,9 @@ public: /// /// \return /// An SBError detailing any errors in reading in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsCreateFromFile(SBFileSpec &source_file, SBBreakpointList &new_bps); - //------------------------------------------------------------------ /// Read breakpoints from source_file and return the newly created /// breakpoints in bkpt_list. /// @@ -746,12 +683,10 @@ public: /// /// \return /// An SBError detailing any errors in reading in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsCreateFromFile(SBFileSpec &source_file, SBStringList &matching_names, SBBreakpointList &new_bps); - //------------------------------------------------------------------ /// Write breakpoints to dest_file. /// /// \param[in] dest_file @@ -759,10 +694,8 @@ public: /// /// \return /// An SBError detailing any errors in writing in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsWriteToFile(SBFileSpec &dest_file); - //------------------------------------------------------------------ /// Write breakpoints listed in bkpt_list to dest_file. /// /// \param[in] dest_file @@ -778,7 +711,6 @@ public: /// /// \return /// An SBError detailing any errors in writing in the breakpoints. - //------------------------------------------------------------------ lldb::SBError BreakpointsWriteToFile(SBFileSpec &dest_file, SBBreakpointList &bkpt_list, bool append = false); @@ -904,10 +836,8 @@ protected: friend class SBValue; friend class SBVariablesOptions; - //------------------------------------------------------------------ // Constructors are private, use static Target::Create function to create an // instance of this class. - //------------------------------------------------------------------ lldb::TargetSP GetSP() const; diff --git a/lldb/include/lldb/API/SBThread.h b/lldb/include/lldb/API/SBThread.h index 773193b..da8726a 100644 --- a/lldb/include/lldb/API/SBThread.h +++ b/lldb/include/lldb/API/SBThread.h @@ -51,7 +51,6 @@ public: /// See also GetStopReasonDataAtIndex(). size_t GetStopReasonDataCount(); - //-------------------------------------------------------------------------- /// Get information associated with a stop reason. /// /// Breakpoint stop reasons will have data that consists of pairs of @@ -68,7 +67,6 @@ public: /// eStopReasonException N exception data /// eStopReasonExec 0 /// eStopReasonPlanComplete 0 - //-------------------------------------------------------------------------- uint64_t GetStopReasonDataAtIndex(uint32_t idx); bool GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream); @@ -134,7 +132,6 @@ public: SBError UnwindInnermostExpression(); - //-------------------------------------------------------------------------- /// LLDB currently supports process centric debugging which means when any /// thread in a process stops, all other threads are stopped. The Suspend() /// call here tells our process to suspend a thread and not let it run when @@ -154,7 +151,6 @@ public: /// Suspend() and Resume() functions are not currently reference counted, if /// anyone has the need for them to be reference counted, please let us /// know. - //-------------------------------------------------------------------------- bool Suspend(); bool Suspend(SBError &error); diff --git a/lldb/include/lldb/API/SBThreadPlan.h b/lldb/include/lldb/API/SBThreadPlan.h index fae73cf..85fd568 100644 --- a/lldb/include/lldb/API/SBThreadPlan.h +++ b/lldb/include/lldb/API/SBThreadPlan.h @@ -42,7 +42,6 @@ public: /// See also GetStopReasonDataAtIndex(). size_t GetStopReasonDataCount(); - //-------------------------------------------------------------------------- /// Get information associated with a stop reason. /// /// Breakpoint stop reasons will have data that consists of pairs of @@ -59,7 +58,6 @@ public: /// eStopReasonException N exception data /// eStopReasonExec 0 /// eStopReasonPlanComplete 0 - //-------------------------------------------------------------------------- uint64_t GetStopReasonDataAtIndex(uint32_t idx); SBThread GetThread() const; diff --git a/lldb/include/lldb/API/SBTrace.h b/lldb/include/lldb/API/SBTrace.h index cc101a1..87c67ad 100644 --- a/lldb/include/lldb/API/SBTrace.h +++ b/lldb/include/lldb/API/SBTrace.h @@ -19,7 +19,6 @@ namespace lldb { class LLDB_API SBTrace { public: SBTrace(); - //------------------------------------------------------------------ /// Obtain the trace data as raw bytes. /// /// \param[out] error @@ -47,19 +46,15 @@ public: /// /// \return /// The size of the trace data effectively read by the API call. - //------------------------------------------------------------------ size_t GetTraceData(SBError &error, void *buf, size_t size, size_t offset = 0, lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID); - //------------------------------------------------------------------ /// Obtain any meta data as raw bytes for the tracing instance. /// The input parameter definition is similar to the previous /// function. - //------------------------------------------------------------------ size_t GetMetaData(SBError &error, void *buf, size_t size, size_t offset = 0, lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID); - //------------------------------------------------------------------ /// Stop the tracing instance. Stopping the trace will also /// lead to deletion of any gathered trace data. /// @@ -80,11 +75,9 @@ public: /// trace id of the process. /// Now if the StopTrace API is called for the whole process, /// thread A will not be stopped and must be stopped separately. - //------------------------------------------------------------------ void StopTrace(SBError &error, lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID); - //------------------------------------------------------------------ /// Get the trace configuration being used for the trace instance. /// The threadid in the SBTraceOptions needs to be set when the /// configuration used by a specific thread is being requested. @@ -95,7 +88,6 @@ public: /// /// \param[out] error /// An error explaining what went wrong. - //------------------------------------------------------------------ void GetTraceConfig(SBTraceOptions &options, SBError &error); lldb::user_id_t GetTraceUID(); diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index be40806..c36ba20 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -137,7 +137,6 @@ public: lldb::SBValue CreateValueFromData(const char *name, lldb::SBData data, lldb::SBType type); - //------------------------------------------------------------------ /// Get a child value by index from a value. /// /// Structs, unions, classes, arrays and pointers have child @@ -190,7 +189,6 @@ public: /// /// \return /// A new SBValue object that represents the child member value. - //------------------------------------------------------------------ lldb::SBValue GetChildAtIndex(uint32_t idx, lldb::DynamicValueType use_dynamic, bool can_create_synthetic); @@ -217,7 +215,6 @@ public: lldb::SBAddress GetAddress(); - //------------------------------------------------------------------ /// Get an SBData wrapping what this SBValue points to. /// /// This method will dereference the current SBValue, if its @@ -237,10 +234,8 @@ public: /// \return /// An SBData with the contents of the copied items, on success. /// An empty SBData otherwise. - //------------------------------------------------------------------ lldb::SBData GetPointeeData(uint32_t item_idx = 0, uint32_t item_count = 1); - //------------------------------------------------------------------ /// Get an SBData wrapping the contents of this SBValue. /// /// This method will read the contents of this object in memory @@ -249,14 +244,12 @@ public: /// \return /// An SBData with the contents of this SBValue, on success. /// An empty SBData otherwise. - //------------------------------------------------------------------ lldb::SBData GetData(); bool SetData(lldb::SBData &data, lldb::SBError &error); lldb::SBDeclaration GetDeclaration(); - //------------------------------------------------------------------ /// Find out if a SBValue might have children. /// /// This call is much more efficient than GetNumChildren() as it @@ -271,7 +264,6 @@ public: /// \return /// Returns \b true if the SBValue might have children, or \b /// false otherwise. - //------------------------------------------------------------------ bool MightHaveChildren(); bool IsRuntimeSupportValue(); @@ -315,7 +307,6 @@ public: SBValue(const lldb::ValueObjectSP &value_sp); - //------------------------------------------------------------------ /// Watch this value if it resides in memory. /// /// Sets a watchpoint on the value. @@ -340,14 +331,12 @@ public: /// return due to a value not being contained in memory, too /// large, or watchpoint resources are not available or all in /// use. - //------------------------------------------------------------------ lldb::SBWatchpoint Watch(bool resolve_location, bool read, bool write, SBError &error); // Backward compatibility fix in the interim. lldb::SBWatchpoint Watch(bool resolve_location, bool read, bool write); - //------------------------------------------------------------------ /// Watch this value that this value points to in memory /// /// Sets a watchpoint on the value. @@ -372,11 +361,9 @@ public: /// return due to a value not being contained in memory, too /// large, or watchpoint resources are not available or all in /// use. - //------------------------------------------------------------------ lldb::SBWatchpoint WatchPointee(bool resolve_location, bool read, bool write, SBError &error); - //------------------------------------------------------------------ /// Same as the protected version of GetSP that takes a locker, except that we /// make the /// locker locally in the function. Since the Target API mutex is recursive, @@ -388,7 +375,6 @@ public: /// \return /// A ValueObjectSP of the best kind (static, dynamic or synthetic) we /// can cons up, in accordance with the SBValue's settings. - //------------------------------------------------------------------ lldb::ValueObjectSP GetSP() const; protected: @@ -398,7 +384,6 @@ protected: friend class SBThread; friend class SBValueList; - //------------------------------------------------------------------ /// Get the appropriate ValueObjectSP from this SBValue, consulting the /// use_dynamic and use_synthetic options passed in to SetSP when the /// SBValue's contents were set. Since this often requires examining memory, @@ -422,7 +407,6 @@ protected: /// \return /// A ValueObjectSP of the best kind (static, dynamic or synthetic) we /// can cons up, in accordance with the SBValue's settings. - //------------------------------------------------------------------ lldb::ValueObjectSP GetSP(ValueLocker &value_locker) const; // these calls do the right thing WRT adjusting their settings according to diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h index 7e17dc6..3fab6a4 100644 --- a/lldb/include/lldb/Breakpoint/Breakpoint.h +++ b/lldb/include/lldb/Breakpoint/Breakpoint.h @@ -27,12 +27,9 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Breakpoint Breakpoint.h "lldb/Breakpoint/Breakpoint.h" Class that /// manages logical breakpoint setting. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// A breakpoint has four main parts, a filter, a resolver, the list of /// breakpoint @@ -78,16 +75,13 @@ namespace lldb_private { /// subtle point worth observing here is that you don't actually stop at a /// Breakpoint, you always stop at one of its locations. So the "should stop" /// tests are done by the location, not by the breakpoint. -//---------------------------------------------------------------------- class Breakpoint : public std::enable_shared_from_this<Breakpoint>, public Stoppoint { public: static ConstString GetEventIdentifier(); - //------------------------------------------------------------------ /// An enum specifying the match style for breakpoint settings. At present /// only used for function name style breakpoints. - //------------------------------------------------------------------ typedef enum { Exact, Regexp, Glob } MatchType; private: @@ -170,48 +164,33 @@ public: virtual StructuredData::ObjectSP SerializeToStructuredData(); static const char *GetSerializationKey() { return "Breakpoint"; } - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is not virtual since there should be no reason to /// subclass breakpoints. The varieties of breakpoints are specified /// instead by providing different resolvers & filters. - //------------------------------------------------------------------ ~Breakpoint() override; - //------------------------------------------------------------------ // Methods - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Tell whether this breakpoint is an "internal" breakpoint. \return /// Returns \b true if this is an internal breakpoint, \b false otherwise. - //------------------------------------------------------------------ bool IsInternal() const; - //------------------------------------------------------------------ /// Standard "Dump" method. At present it does nothing. - //------------------------------------------------------------------ void Dump(Stream *s) override; - //------------------------------------------------------------------ // The next set of methods provide ways to tell the breakpoint to update it's // location list - usually done when modules appear or disappear. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Tell this breakpoint to clear all its breakpoint sites. Done when the /// process holding the breakpoint sites is destroyed. - //------------------------------------------------------------------ void ClearAllBreakpointSites(); - //------------------------------------------------------------------ /// Tell this breakpoint to scan it's target's module list and resolve any /// new locations that match the breakpoint's specifications. - //------------------------------------------------------------------ void ResolveBreakpoint(); - //------------------------------------------------------------------ /// Tell this breakpoint to scan a given module list and resolve any new /// locations that match the breakpoint's specifications. /// @@ -221,11 +200,9 @@ public: /// \param[in] send_event /// If \b true, send a breakpoint location added event for non-internal /// breakpoints. - //------------------------------------------------------------------ void ResolveBreakpointInModules(ModuleList &module_list, bool send_event = true); - //------------------------------------------------------------------ /// Tell this breakpoint to scan a given module list and resolve any new /// locations that match the breakpoint's specifications. /// @@ -234,11 +211,9 @@ public: /// /// \param[in] new_locations /// Fills new_locations with the new locations that were made. - //------------------------------------------------------------------ void ResolveBreakpointInModules(ModuleList &module_list, BreakpointLocationCollection &new_locations); - //------------------------------------------------------------------ /// Like ResolveBreakpointInModules, but allows for "unload" events, in /// which case we will remove any locations that are in modules that got /// unloaded. @@ -250,11 +225,9 @@ public: /// \param[in] delete_locations /// If \b true then the modules were unloaded delete any locations in the /// changed modules. - //------------------------------------------------------------------ void ModulesChanged(ModuleList &changed_modules, bool load_event, bool delete_locations = false); - //------------------------------------------------------------------ /// Tells the breakpoint the old module \a old_module_sp has been replaced /// by new_module_sp (usually because the underlying file has been rebuilt, /// and the old version is gone.) @@ -263,16 +236,12 @@ public: /// The old module that is going away. /// \param[in] new_module_sp /// The new module that is replacing it. - //------------------------------------------------------------------ void ModuleReplaced(lldb::ModuleSP old_module_sp, lldb::ModuleSP new_module_sp); - //------------------------------------------------------------------ // The next set of methods provide access to the breakpoint locations for // this breakpoint. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Add a location to the breakpoint's location list. This is only meant to /// be called by the breakpoint's resolver. FIXME: how do I ensure that? /// @@ -283,11 +252,9 @@ public: /// already was a location at this Address. /// \return /// Returns a pointer to the new location. - //------------------------------------------------------------------ lldb::BreakpointLocationSP AddLocation(const Address &addr, bool *new_location = nullptr); - //------------------------------------------------------------------ /// Find a breakpoint location by Address. /// /// \param[in] addr @@ -296,10 +263,8 @@ public: /// Returns a shared pointer to the location at \a addr. The pointer /// in the shared pointer will be nullptr if there is no location at that /// address. - //------------------------------------------------------------------ lldb::BreakpointLocationSP FindLocationByAddress(const Address &addr); - //------------------------------------------------------------------ /// Find a breakpoint location ID by Address. /// /// \param[in] addr @@ -307,10 +272,8 @@ public: /// \return /// Returns the UID of the location at \a addr, or \b LLDB_INVALID_ID if /// there is no breakpoint location at that address. - //------------------------------------------------------------------ lldb::break_id_t FindLocationIDByAddress(const Address &addr); - //------------------------------------------------------------------ /// Find a breakpoint location for a given breakpoint location ID. /// /// \param[in] bp_loc_id @@ -320,10 +283,8 @@ public: /// pointer /// in the shared pointer will be nullptr if there is no location with that /// ID. - //------------------------------------------------------------------ lldb::BreakpointLocationSP FindLocationByID(lldb::break_id_t bp_loc_id); - //------------------------------------------------------------------ /// Get breakpoint locations by index. /// /// \param[in] index @@ -333,10 +294,8 @@ public: /// Returns a shared pointer to the location with index \a /// index. The shared pointer might contain nullptr if \a index is /// greater than then number of actual locations. - //------------------------------------------------------------------ lldb::BreakpointLocationSP GetLocationAtIndex(size_t index); - //------------------------------------------------------------------ /// Removes all invalid breakpoint locations. /// /// Removes all breakpoint locations with architectures that aren't @@ -350,83 +309,58 @@ public: /// \param[in] arch /// If valid, check the module in each breakpoint to make sure /// they are compatible, otherwise, ignore architecture. - //------------------------------------------------------------------ void RemoveInvalidLocations(const ArchSpec &arch); - //------------------------------------------------------------------ // The next section deals with various breakpoint options. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// If \a enable is \b true, enable the breakpoint, if \b false disable it. - //------------------------------------------------------------------ void SetEnabled(bool enable) override; - //------------------------------------------------------------------ /// Check the Enable/Disable state. /// \return /// \b true if the breakpoint is enabled, \b false if disabled. - //------------------------------------------------------------------ bool IsEnabled() override; - //------------------------------------------------------------------ /// Set the breakpoint to ignore the next \a count breakpoint hits. /// \param[in] count /// The number of breakpoint hits to ignore. - //------------------------------------------------------------------ void SetIgnoreCount(uint32_t count); - //------------------------------------------------------------------ /// Return the current ignore count/ /// \return /// The number of breakpoint hits to be ignored. - //------------------------------------------------------------------ uint32_t GetIgnoreCount() const; - //------------------------------------------------------------------ /// Return the current hit count for all locations. \return /// The current hit count for all locations. - //------------------------------------------------------------------ uint32_t GetHitCount() const; - //------------------------------------------------------------------ /// If \a one_shot is \b true, breakpoint will be deleted on first hit. - //------------------------------------------------------------------ void SetOneShot(bool one_shot); - //------------------------------------------------------------------ /// Check the OneShot state. /// \return /// \b true if the breakpoint is one shot, \b false otherwise. - //------------------------------------------------------------------ bool IsOneShot() const; - //------------------------------------------------------------------ /// If \a auto_continue is \b true, breakpoint will auto-continue when on /// hit. - //------------------------------------------------------------------ void SetAutoContinue(bool auto_continue); - //------------------------------------------------------------------ /// Check the AutoContinue state. /// \return /// \b true if the breakpoint is set to auto-continue, \b false otherwise. - //------------------------------------------------------------------ bool IsAutoContinue() const; - //------------------------------------------------------------------ /// Set the valid thread to be checked when the breakpoint is hit. /// \param[in] thread_id /// If this thread hits the breakpoint, we stop, otherwise not. - //------------------------------------------------------------------ void SetThreadID(lldb::tid_t thread_id); - //------------------------------------------------------------------ /// Return the current stop thread value. /// \return /// The thread id for which the breakpoint hit will stop, /// LLDB_INVALID_THREAD_ID for all threads. - //------------------------------------------------------------------ lldb::tid_t GetThreadID() const; void SetThreadIndex(uint32_t index); @@ -441,7 +375,6 @@ public: const char *GetQueueName() const; - //------------------------------------------------------------------ /// Set the callback action invoked when the breakpoint is hit. /// /// \param[in] callback @@ -456,7 +389,6 @@ public: /// \return /// \b true if the process should stop when you hit the breakpoint. /// \b false if it should continue. - //------------------------------------------------------------------ void SetCallback(BreakpointHitCallback callback, void *baton, bool is_synchronous = false); @@ -466,54 +398,41 @@ public: void ClearCallback(); - //------------------------------------------------------------------ /// Set the breakpoint's condition. /// /// \param[in] condition /// The condition expression to evaluate when the breakpoint is hit. /// Pass in nullptr to clear the condition. - //------------------------------------------------------------------ void SetCondition(const char *condition); - //------------------------------------------------------------------ /// Return a pointer to the text of the condition expression. /// /// \return /// A pointer to the condition expression text, or nullptr if no // condition has been set. - //------------------------------------------------------------------ const char *GetConditionText() const; - //------------------------------------------------------------------ // The next section are various utility functions. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Return the number of breakpoint locations that have resolved to actual /// breakpoint sites. /// /// \return /// The number locations resolved breakpoint sites. - //------------------------------------------------------------------ size_t GetNumResolvedLocations() const; - //------------------------------------------------------------------ /// Return whether this breakpoint has any resolved locations. /// /// \return /// True if GetNumResolvedLocations > 0 - //------------------------------------------------------------------ bool HasResolvedLocations() const; - //------------------------------------------------------------------ /// Return the number of breakpoint locations. /// /// \return /// The number breakpoint locations. - //------------------------------------------------------------------ size_t GetNumLocations() const; - //------------------------------------------------------------------ /// Put a description of this breakpoint into the stream \a s. /// /// \param[in] s @@ -524,11 +443,9 @@ public: /// provide. /// /// \see lldb::DescriptionLevel - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_locations = false); - //------------------------------------------------------------------ /// Set the "kind" description for a breakpoint. If the breakpoint is hit /// the stop info will show this "kind" description instead of the /// breakpoint number. Mostly useful for internal breakpoints, where the @@ -536,22 +453,17 @@ public: /// /// \param[in] kind /// New "kind" description. - //------------------------------------------------------------------ void SetBreakpointKind(const char *kind) { m_kind_description.assign(kind); } - //------------------------------------------------------------------ /// Return the "kind" description for a breakpoint. /// /// \return /// The breakpoint kind, or nullptr if none is set. - //------------------------------------------------------------------ const char *GetBreakpointKind() const { return m_kind_description.c_str(); } - //------------------------------------------------------------------ /// Accessor for the breakpoint Target. /// \return /// This breakpoint's Target. - //------------------------------------------------------------------ Target &GetTarget() { return m_target; } const Target &GetTarget() const { return m_target; } @@ -560,7 +472,6 @@ public: void GetResolverDescription(Stream *s); - //------------------------------------------------------------------ /// Find breakpoint locations which match the (filename, line_number) /// description. The breakpoint location collection is to be filled with the /// matching locations. It should be initialized with 0 size by the API @@ -574,33 +485,27 @@ public: /// size is 0 and true is returned, it means the breakpoint fully matches /// the /// description. - //------------------------------------------------------------------ bool GetMatchingFileLine(ConstString filename, uint32_t line_number, BreakpointLocationCollection &loc_coll); void GetFilterDescription(Stream *s); - //------------------------------------------------------------------ /// Returns the BreakpointOptions structure set at the breakpoint level. /// /// Meant to be used by the BreakpointLocation class. /// /// \return /// A pointer to this breakpoint's BreakpointOptions. - //------------------------------------------------------------------ BreakpointOptions *GetOptions(); - //------------------------------------------------------------------ /// Returns the BreakpointOptions structure set at the breakpoint level. /// /// Meant to be used by the BreakpointLocation class. /// /// \return /// A pointer to this breakpoint's BreakpointOptions. - //------------------------------------------------------------------ const BreakpointOptions *GetOptions() const; - //------------------------------------------------------------------ /// Invoke the callback action when the breakpoint is hit. /// /// Meant to be used by the BreakpointLocation class. @@ -613,7 +518,6 @@ public: /// /// \return /// \b true if the target should stop at this breakpoint and \b false not. - //------------------------------------------------------------------ bool InvokeCallback(StoppointCallbackContext *context, lldb::break_id_t bp_loc_id); @@ -644,7 +548,6 @@ public: } } - //------------------------------------------------------------------ /// Set a pre-condition filter that overrides all user provided /// filters/callbacks etc. /// @@ -655,7 +558,6 @@ public: /// The Precondition should not continue the target, it should return true /// if the condition says to stop and false otherwise. /// - //------------------------------------------------------------------ void SetPrecondition(BreakpointPreconditionSP precondition_sp) { m_precondition_sp = precondition_sp; } @@ -685,11 +587,8 @@ public: protected: friend class Target; - //------------------------------------------------------------------ // Protected Methods - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Constructors and Destructors /// Only the Target can make a breakpoint, and it owns the breakpoint /// lifespans. The constructor takes a filter and a resolver. Up in Target @@ -717,7 +616,6 @@ protected: /// indirect symbol (i.e. Symbol::IsIndirect returns true) then the actual /// breakpoint site will /// be set on the target of the indirect symbol. - //------------------------------------------------------------------ // This is the generic constructor Breakpoint(Target &target, lldb::SearchFilterSP &filter_sp, lldb::BreakpointResolverSP &resolver_sp, bool hardware, @@ -748,9 +646,7 @@ private: // target - primarily from the dummy target to prime new targets. Breakpoint(Target &new_target, Breakpoint &bp_to_copy_from); - //------------------------------------------------------------------ // For Breakpoint only - //------------------------------------------------------------------ bool m_being_created; bool m_hardware; // If this breakpoint is required to use a hardware breakpoint diff --git a/lldb/include/lldb/Breakpoint/BreakpointID.h b/lldb/include/lldb/Breakpoint/BreakpointID.h index ba4d129..0951329 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointID.h +++ b/lldb/include/lldb/Breakpoint/BreakpointID.h @@ -18,9 +18,7 @@ namespace lldb_private { -//---------------------------------------------------------------------- // class BreakpointID -//---------------------------------------------------------------------- class BreakpointID { public: @@ -50,7 +48,6 @@ public: static bool IsValidIDExpression(llvm::StringRef str); static llvm::ArrayRef<llvm::StringRef> GetRangeSpecifiers(); - //------------------------------------------------------------------ /// Takes an input string containing the description of a breakpoint or /// breakpoint and location and returns a BreakpointID filled out with /// the proper id and location. @@ -61,11 +58,9 @@ public: /// If \p input was not a valid breakpoint ID string, returns /// \b llvm::None. Otherwise returns a BreakpointID with members filled /// out accordingly. - //------------------------------------------------------------------ static llvm::Optional<BreakpointID> ParseCanonicalReference(llvm::StringRef input); - //------------------------------------------------------------------ /// Takes an input string and checks to see whether it is a breakpoint name. /// If it is a mal-formed breakpoint name, error will be set to an appropriate /// error string. @@ -78,10 +73,8 @@ public: /// \return /// \b true if the name is a breakpoint name (as opposed to an ID or /// range) false otherwise. - //------------------------------------------------------------------ static bool StringIsBreakpointName(llvm::StringRef str, Status &error); - //------------------------------------------------------------------ /// Takes a breakpoint ID and the breakpoint location id and returns /// a string containing the canonical description for the breakpoint /// or breakpoint location. @@ -92,7 +85,6 @@ public: /// \param[out] break_loc_id /// This is breakpoint location id, or LLDB_INVALID_BREAK_ID is no /// location is to be specified. - //------------------------------------------------------------------ static void GetCanonicalReference(Stream *s, lldb::break_id_t break_id, lldb::break_id_t break_loc_id); diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h b/lldb/include/lldb/Breakpoint/BreakpointIDList.h index 9845a91..c642922 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h @@ -20,9 +20,7 @@ namespace lldb_private { -//---------------------------------------------------------------------- // class BreakpointIDList -//---------------------------------------------------------------------- class BreakpointIDList { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointList.h b/lldb/include/lldb/Breakpoint/BreakpointList.h index ff324da..fe10adb 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointList.h @@ -16,15 +16,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointList BreakpointList.h "lldb/Breakpoint/BreakpointList.h" /// This class manages a list of breakpoints. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// Allows adding and removing breakpoints and find by ID and index. -//---------------------------------------------------------------------- class BreakpointList { public: @@ -32,7 +28,6 @@ public: ~BreakpointList(); - //------------------------------------------------------------------ /// Add the breakpoint \a bp_sp to the list. /// /// \param[in] bp_sp @@ -40,15 +35,11 @@ public: /// /// \result /// Returns breakpoint id. - //------------------------------------------------------------------ lldb::break_id_t Add(lldb::BreakpointSP &bp_sp, bool notify); - //------------------------------------------------------------------ /// Standard "Dump" method. At present it does nothing. - //------------------------------------------------------------------ void Dump(Stream *s) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint with id \a breakID. Const /// version. /// @@ -58,10 +49,8 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a NULL pointer if the /// breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointSP FindBreakpointByID(lldb::break_id_t breakID) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint with index \a i. /// /// \param[in] i @@ -70,10 +59,8 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a NULL pointer if the /// breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointSP GetBreakpointAtIndex(size_t i) const; - //------------------------------------------------------------------ /// Find all the breakpoints with a given name /// /// \param[in] name @@ -81,21 +68,17 @@ public: /// /// \result /// \bfalse if the input name was not a legal breakpoint name. - //------------------------------------------------------------------ bool FindBreakpointsByName(const char *name, BreakpointList &matching_bps); - //------------------------------------------------------------------ /// Returns the number of elements in this breakpoint list. /// /// \result /// The number of elements. - //------------------------------------------------------------------ size_t GetSize() const { std::lock_guard<std::recursive_mutex> guard(m_mutex); return m_breakpoints.size(); } - //------------------------------------------------------------------ /// Removes the breakpoint given by \b breakID from this list. /// /// \param[in] breakID @@ -103,10 +86,8 @@ public: /// /// \result /// \b true if the breakpoint \a breakID was in the list. - //------------------------------------------------------------------ bool Remove(lldb::break_id_t breakID, bool notify); - //------------------------------------------------------------------ /// Removes all invalid breakpoint locations. /// /// Removes all breakpoint locations in the list with architectures that @@ -120,26 +101,20 @@ public: /// \param[in] arch /// If valid, check the module in each breakpoint to make sure /// they are compatible, otherwise, ignore architecture. - //------------------------------------------------------------------ void RemoveInvalidLocations(const ArchSpec &arch); void SetEnabledAll(bool enabled); void SetEnabledAllowed(bool enabled); - //------------------------------------------------------------------ /// Removes all the breakpoints from this list. - //------------------------------------------------------------------ void RemoveAll(bool notify); - //------------------------------------------------------------------ /// Removes all the breakpoints from this list - first checking the /// ePermDelete on the breakpoints. This call should be used unless you are /// shutting down and need to actually clear them all. - //------------------------------------------------------------------ void RemoveAllowed(bool notify); - //------------------------------------------------------------------ /// Tell all the breakpoints to update themselves due to a change in the /// modules in \a module_list. \a added says whether the module was loaded /// or unloaded. @@ -153,7 +128,6 @@ public: /// \param[in] delete_locations /// If \a load is \b false, then delete breakpoint locations when /// when updating breakpoints. - //------------------------------------------------------------------ void UpdateBreakpoints(ModuleList &module_list, bool load, bool delete_locations); @@ -162,12 +136,10 @@ public: void ClearAllBreakpointSites(); - //------------------------------------------------------------------ /// Sets the passed in Locker to hold the Breakpoint List mutex. /// /// \param[in] locker /// The locker object that is set. - //------------------------------------------------------------------ void GetListMutex(std::unique_lock<std::recursive_mutex> &lock); protected: diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocation.h b/lldb/include/lldb/Breakpoint/BreakpointLocation.h index b156165..7b27160 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointLocation.h +++ b/lldb/include/lldb/Breakpoint/BreakpointLocation.h @@ -20,13 +20,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointLocation BreakpointLocation.h /// "lldb/Breakpoint/BreakpointLocation.h" Class that manages one unique (by /// address) instance of a logical breakpoint. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// A breakpoint location is defined by the breakpoint that produces it, /// and the address that resulted in this particular instantiation. Each @@ -36,7 +33,6 @@ namespace lldb_private { /// FIXME: Should we also store some fingerprint for the location, so /// we can map one location to the "equivalent location" on rerun? This would /// be useful if you've set options on the locations. -//---------------------------------------------------------------------- class BreakpointLocation : public std::enable_shared_from_this<BreakpointLocation>, @@ -44,27 +40,20 @@ class BreakpointLocation public: ~BreakpointLocation() override; - //------------------------------------------------------------------ /// Gets the load address for this breakpoint location \return /// Returns breakpoint location load address, \b /// LLDB_INVALID_ADDRESS if not yet set. - //------------------------------------------------------------------ lldb::addr_t GetLoadAddress() const override; - //------------------------------------------------------------------ /// Gets the Address for this breakpoint location \return /// Returns breakpoint location Address. - //------------------------------------------------------------------ Address &GetAddress(); - //------------------------------------------------------------------ /// Gets the Breakpoint that created this breakpoint location \return /// Returns the owning breakpoint. - //------------------------------------------------------------------ Breakpoint &GetBreakpoint(); Target &GetTarget(); - //------------------------------------------------------------------ /// Determines whether we should stop due to a hit at this breakpoint /// location. /// @@ -74,56 +63,40 @@ public: /// \return /// \b true if this breakpoint location thinks we should stop, /// \b false otherwise. - //------------------------------------------------------------------ bool ShouldStop(StoppointCallbackContext *context) override; - //------------------------------------------------------------------ // The next section deals with various breakpoint options. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// If \a enable is \b true, enable the breakpoint, if \b false disable it. - //------------------------------------------------------------------ void SetEnabled(bool enabled); - //------------------------------------------------------------------ /// Check the Enable/Disable state. /// /// \return /// \b true if the breakpoint is enabled, \b false if disabled. - //------------------------------------------------------------------ bool IsEnabled() const; - //------------------------------------------------------------------ /// If \a auto_continue is \b true, set the breakpoint to continue when hit. - //------------------------------------------------------------------ void SetAutoContinue(bool auto_continue); - //------------------------------------------------------------------ /// Check the AutoContinue state. /// /// \return /// \b true if the breakpoint is set to auto-continue, \b false if not. - //------------------------------------------------------------------ bool IsAutoContinue() const; - //------------------------------------------------------------------ /// Return the current Ignore Count. /// /// \return /// The number of breakpoint hits to be ignored. - //------------------------------------------------------------------ uint32_t GetIgnoreCount(); - //------------------------------------------------------------------ /// Set the breakpoint to ignore the next \a count breakpoint hits. /// /// \param[in] count /// The number of breakpoint hits to ignore. - //------------------------------------------------------------------ void SetIgnoreCount(uint32_t n); - //------------------------------------------------------------------ /// Set the callback action invoked when the breakpoint is hit. /// /// The callback will return a bool indicating whether the target should @@ -137,7 +110,6 @@ public: /// for the callback. /// /// \see lldb_private::Baton - //------------------------------------------------------------------ void SetCallback(BreakpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool is_synchronous); @@ -146,31 +118,25 @@ public: void ClearCallback(); - //------------------------------------------------------------------ /// Set the breakpoint location's condition. /// /// \param[in] condition /// The condition expression to evaluate when the breakpoint is hit. - //------------------------------------------------------------------ void SetCondition(const char *condition); - //------------------------------------------------------------------ /// Return a pointer to the text of the condition expression. /// /// \return /// A pointer to the condition expression text, or nullptr if no // condition has been set. - //------------------------------------------------------------------ const char *GetConditionText(size_t *hash = nullptr) const; bool ConditionSaysStop(ExecutionContext &exe_ctx, Status &error); - //------------------------------------------------------------------ /// Set the valid thread to be checked when the breakpoint is hit. /// /// \param[in] thread_id /// If this thread hits the breakpoint, we stop, otherwise not. - //------------------------------------------------------------------ void SetThreadID(lldb::tid_t thread_id); lldb::tid_t GetThreadID(); @@ -187,43 +153,32 @@ public: const char *GetQueueName() const; - //------------------------------------------------------------------ // The next section deals with this location's breakpoint sites. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Try to resolve the breakpoint site for this location. /// /// \return /// \b true if we were successful at setting a breakpoint site, /// \b false otherwise. - //------------------------------------------------------------------ bool ResolveBreakpointSite(); - //------------------------------------------------------------------ /// Clear this breakpoint location's breakpoint site - for instance when /// disabling the breakpoint. /// /// \return /// \b true if there was a breakpoint site to be cleared, \b false /// otherwise. - //------------------------------------------------------------------ bool ClearBreakpointSite(); - //------------------------------------------------------------------ /// Return whether this breakpoint location has a breakpoint site. \return /// \b true if there was a breakpoint site for this breakpoint /// location, \b false otherwise. - //------------------------------------------------------------------ bool IsResolved() const; lldb::BreakpointSiteSP GetBreakpointSite() const; - //------------------------------------------------------------------ // The next section are generic report functions. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Print a description of this breakpoint location to the stream \a s. /// /// \param[in] s @@ -234,15 +189,11 @@ public: /// provide. /// /// \see lldb::DescriptionLevel - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level); - //------------------------------------------------------------------ /// Standard "Dump" method. At present it does nothing. - //------------------------------------------------------------------ void Dump(Stream *s) const override; - //------------------------------------------------------------------ /// Use this to set location specific breakpoint options. /// /// It will create a copy of the containing breakpoint's options if that @@ -250,10 +201,8 @@ public: /// /// \return /// A pointer to the breakpoint options. - //------------------------------------------------------------------ BreakpointOptions *GetLocationOptions(); - //------------------------------------------------------------------ /// Use this to access breakpoint options from this breakpoint location. /// This will return the options that have a setting for the specified /// BreakpointOptions kind. @@ -263,13 +212,11 @@ public: /// \return /// A pointer to the containing breakpoint's options if this /// location doesn't have its own copy. - //------------------------------------------------------------------ const BreakpointOptions *GetOptionsSpecifyingKind( BreakpointOptions::OptionKind kind) const; bool ValidForThisThread(Thread *thread); - //------------------------------------------------------------------ /// Invoke the callback action when the breakpoint is hit. /// /// Meant to be used by the BreakpointLocation class. @@ -283,44 +230,36 @@ public: /// \return /// \b true if the target should stop at this breakpoint and \b /// false not. - //------------------------------------------------------------------ bool InvokeCallback(StoppointCallbackContext *context); - //------------------------------------------------------------------ /// Returns whether we should resolve Indirect functions in setting the /// breakpoint site for this location. /// /// \return /// \b true if the breakpoint SITE for this location should be set on the /// resolved location for Indirect functions. - //------------------------------------------------------------------ bool ShouldResolveIndirectFunctions() { return m_should_resolve_indirect_functions; } - //------------------------------------------------------------------ /// Returns whether the address set in the breakpoint site for this location /// was found by resolving an indirect symbol. /// /// \return /// \b true or \b false as given in the description above. - //------------------------------------------------------------------ bool IsIndirect() { return m_is_indirect; } void SetIsIndirect(bool is_indirect) { m_is_indirect = is_indirect; } - //------------------------------------------------------------------ /// Returns whether the address set in the breakpoint location was re-routed /// to the target of a re-exported symbol. /// /// \return /// \b true or \b false as given in the description above. - //------------------------------------------------------------------ bool IsReExported() { return m_is_reexported; } void SetIsReExported(bool is_reexported) { m_is_reexported = is_reexported; } - //------------------------------------------------------------------ /// Returns whether the two breakpoint locations might represent "equivalent /// locations". This is used when modules changed to determine if a Location /// in the old module might be the "same as" the input location. @@ -330,7 +269,6 @@ public: /// /// \return /// \b true or \b false as given in the description above. - //------------------------------------------------------------------ bool EquivalentToLocation(BreakpointLocation &location); protected: @@ -339,7 +277,6 @@ protected: friend class Process; friend class StopInfoBreakpoint; - //------------------------------------------------------------------ /// Set the breakpoint site for this location to \a bp_site_sp. /// /// \param[in] bp_site_sp @@ -348,7 +285,6 @@ protected: /// \return /// \b true if we were successful at setting the breakpoint site, /// \b false otherwise. - //------------------------------------------------------------------ bool SetBreakpointSite(lldb::BreakpointSiteSP &bp_site_sp); void DecrementIgnoreCount(); @@ -362,13 +298,10 @@ private: void UndoBumpHitCount(); - //------------------------------------------------------------------ // Constructors and Destructors // // Only the Breakpoint can make breakpoint locations, and it owns them. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Constructor. /// /// \param[in] owner @@ -383,15 +316,12 @@ private: /// /// \param[in] hardware /// \b true if a hardware breakpoint is requested. - //------------------------------------------------------------------ BreakpointLocation(lldb::break_id_t bid, Breakpoint &owner, const Address &addr, lldb::tid_t tid, bool hardware, bool check_for_resolver = true); - //------------------------------------------------------------------ // Data members: - //------------------------------------------------------------------ bool m_being_created; bool m_should_resolve_indirect_functions; bool m_is_reexported; diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h b/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h index c1b3ff9..3da52eb 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h +++ b/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h @@ -25,7 +25,6 @@ public: BreakpointLocationCollection &operator=(const BreakpointLocationCollection &rhs); - //------------------------------------------------------------------ /// Add the breakpoint \a bp_loc_sp to the list. /// /// \param[in] bp_sp @@ -34,10 +33,8 @@ public: /// /// \result /// Returns breakpoint location id. - //------------------------------------------------------------------ void Add(const lldb::BreakpointLocationSP &bp_loc_sp); - //------------------------------------------------------------------ /// Removes the breakpoint location given by \b breakID from this /// list. /// @@ -49,10 +46,8 @@ public: /// /// \result /// \b true if the breakpoint was in the list. - //------------------------------------------------------------------ bool Remove(lldb::break_id_t break_id, lldb::break_id_t break_loc_id); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with id \a /// breakID. /// @@ -65,11 +60,9 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a NULL /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointLocationSP FindByIDPair(lldb::break_id_t break_id, lldb::break_id_t break_loc_id); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with id \a /// breakID, const version. /// @@ -82,11 +75,9 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a NULL /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ const lldb::BreakpointLocationSP FindByIDPair(lldb::break_id_t break_id, lldb::break_id_t break_loc_id) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with index /// \a i. /// @@ -96,10 +87,8 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a NULL /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointLocationSP GetByIndex(size_t i); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with index /// \a i, const version. /// @@ -109,18 +98,14 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a NULL /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ const lldb::BreakpointLocationSP GetByIndex(size_t i) const; - //------------------------------------------------------------------ /// Returns the number of elements in this breakpoint location list. /// /// \result /// The number of elements. - //------------------------------------------------------------------ size_t GetSize() const { return m_break_loc_collection.size(); } - //------------------------------------------------------------------ /// Enquires of all the breakpoint locations in this list whether /// we should stop at a hit at \a breakID. /// @@ -132,10 +117,8 @@ public: /// /// \return /// \b true if we should stop, \b false otherwise. - //------------------------------------------------------------------ bool ShouldStop(StoppointCallbackContext *context); - //------------------------------------------------------------------ /// Print a description of the breakpoint locations in this list /// to the stream \a s. /// @@ -147,10 +130,8 @@ public: /// provide. /// /// \see lldb::DescriptionLevel - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level); - //------------------------------------------------------------------ /// Check whether this collection of breakpoint locations have any /// thread specifiers, and if yes, is \a thread_id contained in any /// of these specifiers. @@ -161,28 +142,21 @@ public: /// return /// \b true if the collection contains at least one location that /// would be valid for this thread, false otherwise. - //------------------------------------------------------------------ bool ValidForThisThread(Thread *thread); - //------------------------------------------------------------------ /// Tell whether ALL the breakpoints in the location collection are internal. /// /// \result /// \b true if all breakpoint locations are owned by internal breakpoints, /// \b false otherwise. - //------------------------------------------------------------------ bool IsInternal() const; protected: - //------------------------------------------------------------------ // Classes that inherit from BreakpointLocationCollection can see and modify // these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For BreakpointLocationCollection only - //------------------------------------------------------------------ typedef std::vector<lldb::BreakpointLocationSP> collection; diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocationList.h b/lldb/include/lldb/Breakpoint/BreakpointLocationList.h index 6cf6f8b..b7e0e49 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointLocationList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointLocationList.h @@ -19,12 +19,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointLocationList BreakpointLocationList.h /// "lldb/Breakpoint/BreakpointLocationList.h" This class is used by /// Breakpoint to manage a list of breakpoint locations, each breakpoint /// location in the list has a unique ID, and is unique by Address as well. -//---------------------------------------------------------------------- class BreakpointLocationList { // Only Breakpoints can make the location list, or add elements to it. This // is not just some random collection of locations. Rather, the act of @@ -36,12 +34,9 @@ class BreakpointLocationList { public: virtual ~BreakpointLocationList(); - //------------------------------------------------------------------ /// Standard "Dump" method. At present it does nothing. - //------------------------------------------------------------------ void Dump(Stream *s) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location at address \a addr - /// const version. /// @@ -51,10 +46,8 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a nullptr /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ const lldb::BreakpointLocationSP FindByAddress(const Address &addr) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with id \a breakID, /// const version. /// @@ -64,10 +57,8 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a nullptr /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointLocationSP FindByID(lldb::break_id_t breakID) const; - //------------------------------------------------------------------ /// Returns the breakpoint location id to the breakpoint location at address /// \a addr. /// @@ -76,10 +67,8 @@ public: /// /// \result /// The ID of the breakpoint location, or LLDB_INVALID_BREAK_ID. - //------------------------------------------------------------------ lldb::break_id_t FindIDByAddress(const Address &addr); - //------------------------------------------------------------------ /// Returns a breakpoint location list of the breakpoint locations in the /// module \a module. This list is allocated, and owned by the caller. /// @@ -92,11 +81,9 @@ public: /// /// \result /// The number of matches - //------------------------------------------------------------------ size_t FindInModule(Module *module, BreakpointLocationCollection &bp_loc_list); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with index \a i. /// /// \param[in] i @@ -105,10 +92,8 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a nullptr /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointLocationSP GetByIndex(size_t i); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint location with index \a i, /// const version. /// @@ -118,39 +103,29 @@ public: /// \result /// A shared pointer to the breakpoint. May contain a nullptr /// pointer if the breakpoint doesn't exist. - //------------------------------------------------------------------ const lldb::BreakpointLocationSP GetByIndex(size_t i) const; - //------------------------------------------------------------------ /// Removes all the locations in this list from their breakpoint site owners /// list. - //------------------------------------------------------------------ void ClearAllBreakpointSites(); - //------------------------------------------------------------------ /// Tells all the breakpoint locations in this list to attempt to resolve /// any possible breakpoint sites. - //------------------------------------------------------------------ void ResolveAllBreakpointSites(); - //------------------------------------------------------------------ /// Returns the number of breakpoint locations in this list with resolved /// breakpoints. /// /// \result /// Number of qualifying breakpoint locations. - //------------------------------------------------------------------ size_t GetNumResolvedLocations() const; - //------------------------------------------------------------------ /// Returns the number hit count of all locations in this list. /// /// \result /// Hit count of all locations in this list. - //------------------------------------------------------------------ uint32_t GetHitCount() const; - //------------------------------------------------------------------ /// Enquires of the breakpoint location in this list with ID \a breakID /// whether we should stop. /// @@ -162,18 +137,14 @@ public: /// /// \return /// \b true if we should stop, \b false otherwise. - //------------------------------------------------------------------ bool ShouldStop(StoppointCallbackContext *context, lldb::break_id_t breakID); - //------------------------------------------------------------------ /// Returns the number of elements in this breakpoint location list. /// /// \result /// The number of elements. - //------------------------------------------------------------------ size_t GetSize() const { return m_locations.size(); } - //------------------------------------------------------------------ /// Print a description of the breakpoint locations in this list to the /// stream \a s. /// @@ -185,20 +156,16 @@ public: /// provide. /// /// \see lldb::DescriptionLevel - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level); protected: - //------------------------------------------------------------------ /// This is the standard constructor. /// /// It creates an empty breakpoint location list. It is protected here /// because only Breakpoints are allowed to create the breakpoint location /// list. - //------------------------------------------------------------------ BreakpointLocationList(Breakpoint &owner); - //------------------------------------------------------------------ /// Add the breakpoint \a bp_loc_sp to the list. /// /// \param[in] bp_sp @@ -207,7 +174,6 @@ protected: /// /// \result /// Returns breakpoint location id. - //------------------------------------------------------------------ lldb::BreakpointLocationSP Create(const Address &addr, bool resolve_indirect_symbols); diff --git a/lldb/include/lldb/Breakpoint/BreakpointOptions.h b/lldb/include/lldb/Breakpoint/BreakpointOptions.h index a406009..cdac5d3 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointOptions.h +++ b/lldb/include/lldb/Breakpoint/BreakpointOptions.h @@ -20,11 +20,9 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointOptions BreakpointOptions.h /// "lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a /// breakpoint or breakpoint location. -//---------------------------------------------------------------------- class BreakpointOptions { friend class BreakpointLocation; @@ -95,11 +93,8 @@ public: typedef std::shared_ptr<CommandBaton> CommandBatonSP; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// This constructor allows you to specify all the breakpoint options except /// the callback. That one is more complicated, and better to do by hand. /// @@ -112,15 +107,12 @@ public: /// \param[in] ignore /// How many breakpoint hits we should ignore before stopping. /// - //------------------------------------------------------------------ BreakpointOptions(const char *condition, bool enabled = true, int32_t ignore = 0, bool one_shot = false, bool auto_continue = false); - //------------------------------------------------------------------ /// Breakpoints make options with all flags set. Locations and Names make /// options with no flags set. - //------------------------------------------------------------------ BreakpointOptions(bool all_flags_set); BreakpointOptions(const BreakpointOptions &rhs); @@ -135,17 +127,12 @@ public: static const char *GetSerializationKey() { return "BKPTOptions"; } - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const BreakpointOptions &operator=(const BreakpointOptions &rhs); - //------------------------------------------------------------------ /// Copy over only the options set in the incoming BreakpointOptions. - //------------------------------------------------------------------ void CopyOverSetOptions(const BreakpointOptions &rhs); - //------------------------------------------------------------------ // Callbacks // // Breakpoint callbacks come in two forms, synchronous and asynchronous. @@ -177,9 +164,7 @@ public: // should be the last action the callback does. We will relax this condition // at some point, but it will take a bit of plumbing to get that to work. // - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Adds a callback to the breakpoint option set. /// /// \param[in] callback @@ -191,7 +176,6 @@ public: /// \param[in] synchronous /// Whether this is a synchronous or asynchronous callback. See discussion /// above. - //------------------------------------------------------------------ void SetCallback(BreakpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous = false); @@ -199,7 +183,6 @@ public: const BreakpointOptions::CommandBatonSP &command_baton_sp, bool synchronous = false); - //------------------------------------------------------------------ /// Returns the command line commands for the callback on this breakpoint. /// /// \param[out] command_list @@ -208,18 +191,14 @@ public: /// \return /// \btrue if the command callback is a command-line callback, /// \bfalse otherwise. - //------------------------------------------------------------------ bool GetCommandLineCallbacks(StringList &command_list); - //------------------------------------------------------------------ /// Remove the callback from this option set. - //------------------------------------------------------------------ void ClearCallback(); // The rest of these functions are meant to be used only within the // breakpoint handling mechanism. - //------------------------------------------------------------------ /// Use this function to invoke the callback for a specific stop. /// /// \param[in] context @@ -238,161 +217,120 @@ public: /// /// \return /// The callback return value. - //------------------------------------------------------------------ bool InvokeCallback(StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id); - //------------------------------------------------------------------ /// Used in InvokeCallback to tell whether it is the right time to run this /// kind of callback. /// /// \return /// The synchronicity of our callback. - //------------------------------------------------------------------ bool IsCallbackSynchronous() const { return m_callback_is_synchronous; } - //------------------------------------------------------------------ /// Fetch the baton from the callback. /// /// \return /// The baton. - //------------------------------------------------------------------ Baton *GetBaton(); - //------------------------------------------------------------------ /// Fetch a const version of the baton from the callback. /// /// \return /// The baton. - //------------------------------------------------------------------ const Baton *GetBaton() const; - //------------------------------------------------------------------ // Condition - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Set the breakpoint option's condition. /// /// \param[in] condition /// The condition expression to evaluate when the breakpoint is hit. - //------------------------------------------------------------------ void SetCondition(const char *condition); - //------------------------------------------------------------------ /// Return a pointer to the text of the condition expression. /// /// \return /// A pointer to the condition expression text, or nullptr if no // condition has been set. - //------------------------------------------------------------------ const char *GetConditionText(size_t *hash = nullptr) const; - //------------------------------------------------------------------ // Enabled/Ignore Count - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Check the Enable/Disable state. /// \return /// \b true if the breakpoint is enabled, \b false if disabled. - //------------------------------------------------------------------ bool IsEnabled() const { return m_enabled; } - //------------------------------------------------------------------ /// If \a enable is \b true, enable the breakpoint, if \b false disable it. - //------------------------------------------------------------------ void SetEnabled(bool enabled) { m_enabled = enabled; m_set_flags.Set(eEnabled); } - //------------------------------------------------------------------ /// Check the auto-continue state. /// \return /// \b true if the breakpoint is set to auto-continue, \b false otherwise. - //------------------------------------------------------------------ bool IsAutoContinue() const { return m_auto_continue; } - //------------------------------------------------------------------ /// Set the auto-continue state. - //------------------------------------------------------------------ void SetAutoContinue(bool auto_continue) { m_auto_continue = auto_continue; m_set_flags.Set(eAutoContinue); } - //------------------------------------------------------------------ /// Check the One-shot state. /// \return /// \b true if the breakpoint is one-shot, \b false otherwise. - //------------------------------------------------------------------ bool IsOneShot() const { return m_one_shot; } - //------------------------------------------------------------------ /// If \a enable is \b true, enable the breakpoint, if \b false disable it. - //------------------------------------------------------------------ void SetOneShot(bool one_shot) { m_one_shot = one_shot; m_set_flags.Set(eOneShot); } - //------------------------------------------------------------------ /// Set the breakpoint to ignore the next \a count breakpoint hits. /// \param[in] count /// The number of breakpoint hits to ignore. - //------------------------------------------------------------------ void SetIgnoreCount(uint32_t n) { m_ignore_count = n; m_set_flags.Set(eIgnoreCount); } - //------------------------------------------------------------------ /// Return the current Ignore Count. /// \return /// The number of breakpoint hits to be ignored. - //------------------------------------------------------------------ uint32_t GetIgnoreCount() const { return m_ignore_count; } - //------------------------------------------------------------------ /// Return the current thread spec for this option. This will return nullptr /// if the no thread specifications have been set for this Option yet. /// \return /// The thread specification pointer for this option, or nullptr if none /// has /// been set yet. - //------------------------------------------------------------------ const ThreadSpec *GetThreadSpecNoCreate() const; - //------------------------------------------------------------------ /// Returns a pointer to the ThreadSpec for this option, creating it. if it /// hasn't been created already. This API is used for setting the /// ThreadSpec items for this option. - //------------------------------------------------------------------ ThreadSpec *GetThreadSpec(); void SetThreadID(lldb::tid_t thread_id); void GetDescription(Stream *s, lldb::DescriptionLevel level) const; - //------------------------------------------------------------------ /// Returns true if the breakpoint option has a callback set. - //------------------------------------------------------------------ bool HasCallback() const; - //------------------------------------------------------------------ /// This is the default empty callback. - //------------------------------------------------------------------ static bool NullCallback(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id); - //------------------------------------------------------------------ /// Set a callback based on BreakpointOptions::CommandData. \param[in] /// cmd_data /// A UP holding the new'ed CommandData object. /// The breakpoint will take ownership of pointer held by this object. - //------------------------------------------------------------------ void SetCommandDataCallback(std::unique_ptr<CommandData> &cmd_data); void Clear(); @@ -402,9 +340,7 @@ public: } protected: -//------------------------------------------------------------------ // Classes that inherit from BreakpointOptions can see and modify these - //------------------------------------------------------------------ bool IsOptionSet(OptionKind kind) { return m_set_flags.Test(kind); @@ -431,9 +367,7 @@ protected: void SetThreadSpec(std::unique_ptr<ThreadSpec> &thread_spec_up); private: - //------------------------------------------------------------------ // For BreakpointOptions only - //------------------------------------------------------------------ BreakpointHitCallback m_callback; // This is the callback function pointer lldb::BatonSP m_callback_baton_sp; // This is the client data for the callback bool m_baton_is_command_baton; diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolver.h b/lldb/include/lldb/Breakpoint/BreakpointResolver.h index 82d43cc..8767e0d 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolver.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolver.h @@ -19,13 +19,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointResolver BreakpointResolver.h /// "lldb/Breakpoint/BreakpointResolver.h" This class works with SearchFilter /// to resolve logical breakpoints to their of concrete breakpoint locations. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// The BreakpointResolver is a Searcher. In that protocol, the SearchFilter /// asks the question "At what depth of the symbol context descent do you want @@ -34,13 +31,11 @@ namespace lldb_private { /// Each Breakpoint has a BreakpointResolver, and it calls either /// ResolveBreakpoint or ResolveBreakpointInModules to tell it to look for new /// breakpoint locations. -//---------------------------------------------------------------------- class BreakpointResolver : public Searcher { friend class Breakpoint; public: - //------------------------------------------------------------------ /// The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint /// to make sense. It can be constructed without a breakpoint, but you have /// to call SetBreakpoint before ResolveBreakpoint. @@ -52,74 +47,57 @@ public: /// /// \result /// Returns breakpoint location id. - //------------------------------------------------------------------ BreakpointResolver(Breakpoint *bkpt, unsigned char resolverType, lldb::addr_t offset = 0); - //------------------------------------------------------------------ /// The Destructor is virtual, all significant breakpoint resolvers derive /// from this class. - //------------------------------------------------------------------ ~BreakpointResolver() override; - //------------------------------------------------------------------ /// This sets the breakpoint for this resolver. /// /// \param[in] bkpt /// The breakpoint that owns this resolver. - //------------------------------------------------------------------ void SetBreakpoint(Breakpoint *bkpt); - //------------------------------------------------------------------ /// This updates the offset for this breakpoint. All the locations /// currently set for this breakpoint will have their offset adjusted when /// this is called. /// /// \param[in] offset /// The offset to add to all locations. - //------------------------------------------------------------------ void SetOffset(lldb::addr_t offset); - //------------------------------------------------------------------ /// This updates the offset for this breakpoint. All the locations /// currently set for this breakpoint will have their offset adjusted when /// this is called. /// /// \param[in] offset /// The offset to add to all locations. - //------------------------------------------------------------------ lldb::addr_t GetOffset() const { return m_offset; } - //------------------------------------------------------------------ /// In response to this method the resolver scans all the modules in the /// breakpoint's target, and adds any new locations it finds. /// /// \param[in] filter /// The filter that will manage the search for this resolver. - //------------------------------------------------------------------ virtual void ResolveBreakpoint(SearchFilter &filter); - //------------------------------------------------------------------ /// In response to this method the resolver scans the modules in the module /// list \a modules, and adds any new locations it finds. /// /// \param[in] filter /// The filter that will manage the search for this resolver. - //------------------------------------------------------------------ virtual void ResolveBreakpointInModules(SearchFilter &filter, ModuleList &modules); - //------------------------------------------------------------------ /// Prints a canonical description for the breakpoint to the stream \a s. /// /// \param[in] s /// Stream to which the output is copied. - //------------------------------------------------------------------ void GetDescription(Stream *s) override = 0; - //------------------------------------------------------------------ /// Standard "Dump" method. At present it does nothing. - //------------------------------------------------------------------ virtual void Dump(Stream *s) const = 0; /// This section handles serializing and deserializing from StructuredData @@ -142,8 +120,6 @@ public: StructuredData::DictionarySP WrapOptionsDict(StructuredData::DictionarySP options_dict_sp); - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// An enumeration for keeping track of the concrete subclass that is /// actually instantiated. Values of this enumeration are kept in the /// BreakpointResolver's SubclassID field. They are used for concrete type @@ -163,7 +139,6 @@ public: // index, and one for UnknownResolver. static const char *g_ty_to_name[LastKnownResolverType + 2]; - //------------------------------------------------------------------ /// getResolverID - Return an ID for the concrete type of this object. This /// is used to implement the LLVM classof checks. This should not be used /// for any other purpose, as the values may change as LLDB evolves. @@ -220,7 +195,6 @@ public: } protected: - //------------------------------------------------------------------ /// Takes a symbol context list of matches which supposedly represent the /// same file and line number in a CU, and find the nearest actual line /// number that matches, and then filter down the matching addresses to diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h b/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h index 1a9a099a..949a788 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h @@ -14,12 +14,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointResolverAddress BreakpointResolverAddress.h /// "lldb/Breakpoint/BreakpointResolverAddress.h" This class sets breakpoints /// on a given Address. This breakpoint only takes once, and then it won't /// attempt to reset itself. -//---------------------------------------------------------------------- class BreakpointResolverAddress : public BreakpointResolver { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h b/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h index 92f4f44..f146a70 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h @@ -13,12 +13,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointResolverFileLine BreakpointResolverFileLine.h /// "lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints /// by file and line. Optionally, it will look for inlined instances of the /// file and line specification. -//---------------------------------------------------------------------- class BreakpointResolverFileLine : public BreakpointResolver { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h b/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h index 2246957..9631457 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolverFileRegex.h @@ -16,12 +16,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointResolverFileRegex BreakpointResolverFileRegex.h /// "lldb/Breakpoint/BreakpointResolverFileRegex.h" This class sets /// breakpoints by file and line. Optionally, it will look for inlined /// instances of the file and line specification. -//---------------------------------------------------------------------- class BreakpointResolverFileRegex : public BreakpointResolver { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverName.h b/lldb/include/lldb/Breakpoint/BreakpointResolverName.h index 46e932f..85a41b60 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolverName.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolverName.h @@ -17,11 +17,9 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointResolverName BreakpointResolverName.h /// "lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on /// a given function name, either by exact match or by regular expression. -//---------------------------------------------------------------------- class BreakpointResolverName : public BreakpointResolver { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h b/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h index d5006ec..980bb46 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h @@ -16,12 +16,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointResolverScripted BreakpointResolverScripted.h /// "lldb/Breakpoint/BreakpointResolverScripted.h" This class sets breakpoints /// on a given Address. This breakpoint only takes once, and then it won't /// attempt to reset itself. -//---------------------------------------------------------------------- class BreakpointResolverScripted : public BreakpointResolver { public: diff --git a/lldb/include/lldb/Breakpoint/BreakpointSite.h b/lldb/include/lldb/Breakpoint/BreakpointSite.h index 6021c47..51ed84f 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointSite.h +++ b/lldb/include/lldb/Breakpoint/BreakpointSite.h @@ -21,7 +21,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointSite BreakpointSite.h "lldb/Breakpoint/BreakpointSite.h" /// Class that manages the actual breakpoint that will be inserted into the /// running program. @@ -32,7 +31,6 @@ namespace lldb_private { /// that share this physical site. When the breakpoint is hit, all the /// locations are informed by the breakpoint site. Breakpoint sites are owned /// by the process. -//---------------------------------------------------------------------- class BreakpointSite : public std::enable_shared_from_this<BreakpointSite>, public StoppointLocation { @@ -49,68 +47,47 @@ public: ~BreakpointSite() override; - //---------------------------------------------------------------------- // This section manages the breakpoint traps - //---------------------------------------------------------------------- - //------------------------------------------------------------------ /// Returns the Opcode Bytes for this breakpoint - //------------------------------------------------------------------ uint8_t *GetTrapOpcodeBytes(); - //------------------------------------------------------------------ /// Returns the Opcode Bytes for this breakpoint - const version - //------------------------------------------------------------------ const uint8_t *GetTrapOpcodeBytes() const; - //------------------------------------------------------------------ /// Get the size of the trap opcode for this address - //------------------------------------------------------------------ size_t GetTrapOpcodeMaxByteSize() const; - //------------------------------------------------------------------ /// Sets the trap opcode - //------------------------------------------------------------------ bool SetTrapOpcode(const uint8_t *trap_opcode, uint32_t trap_opcode_size); - //------------------------------------------------------------------ /// Gets the original instruction bytes that were overwritten by the trap - //------------------------------------------------------------------ uint8_t *GetSavedOpcodeBytes(); - //------------------------------------------------------------------ /// Gets the original instruction bytes that were overwritten by the trap /// const version - //------------------------------------------------------------------ const uint8_t *GetSavedOpcodeBytes() const; - //------------------------------------------------------------------ /// Says whether \a addr and size \a size intersects with the address \a /// intersect_addr - //------------------------------------------------------------------ bool IntersectsRange(lldb::addr_t addr, size_t size, lldb::addr_t *intersect_addr, size_t *intersect_size, size_t *opcode_offset) const; - //------------------------------------------------------------------ /// Tells whether the current breakpoint site is enabled or not /// /// This is a low-level enable bit for the breakpoint sites. If a /// breakpoint site has no enabled owners, it should just get removed. This /// enable/disable is for the low-level target code to enable and disable /// breakpoint sites when single stepping, etc. - //------------------------------------------------------------------ bool IsEnabled() const; - //------------------------------------------------------------------ /// Sets whether the current breakpoint site is enabled or not /// /// \param[in] enabled /// \b true if the breakpoint is enabled, \b false otherwise. - //------------------------------------------------------------------ void SetEnabled(bool enabled); - //------------------------------------------------------------------ /// Enquires of the breakpoint locations that produced this breakpoint site /// whether we should stop at this location. /// @@ -119,36 +96,28 @@ public: /// /// \return /// \b true if we should stop, \b false otherwise. - //------------------------------------------------------------------ bool ShouldStop(StoppointCallbackContext *context) override; - //------------------------------------------------------------------ /// Standard Dump method /// /// \param[in] context /// The stream to dump this output. - //------------------------------------------------------------------ void Dump(Stream *s) const override; - //------------------------------------------------------------------ /// The "Owners" are the breakpoint locations that share this breakpoint /// site. The method adds the \a owner to this breakpoint site's owner list. /// /// \param[in] context /// \a owner is the Breakpoint Location to add. - //------------------------------------------------------------------ void AddOwner(const lldb::BreakpointLocationSP &owner); - //------------------------------------------------------------------ /// This method returns the number of breakpoint locations currently located /// at this breakpoint site. /// /// \return /// The number of owners. - //------------------------------------------------------------------ size_t GetNumberOfOwners(); - //------------------------------------------------------------------ /// This method returns the breakpoint location at index \a index located at /// this breakpoint site. The owners are listed ordinally from 0 to /// GetNumberOfOwners() - 1 so you can use this method to iterate over the @@ -158,10 +127,8 @@ public: /// The index in the list of owners for which you wish the owner location. /// \return /// A shared pointer to the breakpoint location at that index. - //------------------------------------------------------------------ lldb::BreakpointLocationSP GetOwnerAtIndex(size_t idx); - //------------------------------------------------------------------ /// This method copies the breakpoint site's owners into a new collection. /// It does this while the owners mutex is locked. /// @@ -171,10 +138,8 @@ public: /// /// \return /// The number of elements copied into out_collection. - //------------------------------------------------------------------ size_t CopyOwnersList(BreakpointLocationCollection &out_collection); - //------------------------------------------------------------------ /// Check whether the owners of this breakpoint site have any thread /// specifiers, and if yes, is \a thread contained in any of these /// specifiers. @@ -185,10 +150,8 @@ public: /// return /// \b true if the collection contains at least one location that /// would be valid for this thread, false otherwise. - //------------------------------------------------------------------ bool ValidForThisThread(Thread *thread); - //------------------------------------------------------------------ /// Print a description of this breakpoint site to the stream \a s. /// GetDescription tells you about the breakpoint site's owners. Use /// BreakpointSite::Dump(Stream *) to get information about the breakpoint @@ -202,10 +165,8 @@ public: /// provide. /// /// \see lldb::DescriptionLevel - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level); - //------------------------------------------------------------------ /// Tell whether a breakpoint has a location at this site. /// /// \param[in] bp_id @@ -214,17 +175,14 @@ public: /// \result /// \b true if bp_id has a location that is at this site, /// \b false otherwise. - //------------------------------------------------------------------ bool IsBreakpointAtThisSite(lldb::break_id_t bp_id); - //------------------------------------------------------------------ /// Tell whether ALL the breakpoints in the location collection are /// internal. /// /// \result /// \b true if all breakpoint locations are owned by internal breakpoints, /// \b false otherwise. - //------------------------------------------------------------------ bool IsInternal() const; BreakpointSite::Type GetType() const { return m_type; } @@ -241,13 +199,11 @@ private: void BumpHitCounts(); - //------------------------------------------------------------------ /// The method removes the owner at \a break_loc_id from this breakpoint /// list. /// /// \param[in] context /// \a break_loc_id is the Breakpoint Location to remove. - //------------------------------------------------------------------ size_t RemoveOwner(lldb::break_id_t break_id, lldb::break_id_t break_loc_id); BreakpointSite::Type m_type; ///< The type of this breakpoint site. diff --git a/lldb/include/lldb/Breakpoint/BreakpointSiteList.h b/lldb/include/lldb/Breakpoint/BreakpointSiteList.h index 61e4414..b10d119 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointSiteList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointSiteList.h @@ -17,11 +17,9 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class BreakpointSiteList BreakpointSiteList.h /// "lldb/Breakpoint/BreakpointSiteList.h" Class that manages lists of /// BreakpointSite shared pointers. -//---------------------------------------------------------------------- class BreakpointSiteList { // At present Process directly accesses the map of BreakpointSites so it can // do quick lookups into the map (using GetMap). @@ -29,17 +27,12 @@ class BreakpointSiteList { friend class Process; public: - //------------------------------------------------------------------ /// Default constructor makes an empty list. - //------------------------------------------------------------------ BreakpointSiteList(); - //------------------------------------------------------------------ /// Destructor, currently does nothing. - //------------------------------------------------------------------ ~BreakpointSiteList(); - //------------------------------------------------------------------ /// Add a BreakpointSite to the list. /// /// \param[in] bp_site_sp @@ -47,16 +40,12 @@ public: /// /// \return /// The ID of the BreakpointSite in the list. - //------------------------------------------------------------------ lldb::break_id_t Add(const lldb::BreakpointSiteSP &bp_site_sp); - //------------------------------------------------------------------ /// Standard Dump routine, doesn't do anything at present. \param[in] s /// Stream into which to dump the description. - //------------------------------------------------------------------ void Dump(Stream *s) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint site at address \a addr. /// /// \param[in] addr @@ -65,10 +54,8 @@ public: /// \result /// A shared pointer to the breakpoint site. May contain a NULL /// pointer if no breakpoint site exists with a matching address. - //------------------------------------------------------------------ lldb::BreakpointSiteSP FindByAddress(lldb::addr_t addr); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint site with id \a breakID. /// /// \param[in] breakID @@ -78,10 +65,8 @@ public: /// A shared pointer to the breakpoint site. May contain a NULL pointer if /// the /// breakpoint doesn't exist. - //------------------------------------------------------------------ lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID); - //------------------------------------------------------------------ /// Returns a shared pointer to the breakpoint site with id \a breakID - /// const version. /// @@ -92,10 +77,8 @@ public: /// A shared pointer to the breakpoint site. May contain a NULL pointer if /// the /// breakpoint doesn't exist. - //------------------------------------------------------------------ const lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID) const; - //------------------------------------------------------------------ /// Returns the breakpoint site id to the breakpoint site at address \a /// addr. /// @@ -104,10 +87,8 @@ public: /// /// \result /// The ID of the breakpoint site, or LLDB_INVALID_BREAK_ID. - //------------------------------------------------------------------ lldb::break_id_t FindIDByAddress(lldb::addr_t addr); - //------------------------------------------------------------------ /// Returns whether the breakpoint site \a bp_site_id has \a bp_id // as one of its owners. /// @@ -120,13 +101,11 @@ public: /// \result /// True if \a bp_site_id exists in the site list AND \a bp_id is one of the /// owners of that site. - //------------------------------------------------------------------ bool BreakpointSiteContainsBreakpoint(lldb::break_id_t bp_site_id, lldb::break_id_t bp_id); void ForEach(std::function<void(BreakpointSite *)> const &callback); - //------------------------------------------------------------------ /// Removes the breakpoint site given by \b breakID from this list. /// /// \param[in] breakID @@ -134,10 +113,8 @@ public: /// /// \result /// \b true if the breakpoint site \a breakID was in the list. - //------------------------------------------------------------------ bool Remove(lldb::break_id_t breakID); - //------------------------------------------------------------------ /// Removes the breakpoint site at address \a addr from this list. /// /// \param[in] addr @@ -145,7 +122,6 @@ public: /// /// \result /// \b true if \a addr had a breakpoint site to remove from the list. - //------------------------------------------------------------------ bool RemoveByAddress(lldb::addr_t addr); bool FindInRange(lldb::addr_t lower_bound, lldb::addr_t upper_bound, @@ -154,7 +130,6 @@ public: typedef void (*BreakpointSiteSPMapFunc)(lldb::BreakpointSiteSP &bp, void *baton); - //------------------------------------------------------------------ /// Enquires of the breakpoint site on in this list with ID \a breakID /// whether we should stop for the breakpoint or not. /// @@ -166,15 +141,12 @@ public: /// /// \return /// \b true if we should stop, \b false otherwise. - //------------------------------------------------------------------ bool ShouldStop(StoppointCallbackContext *context, lldb::break_id_t breakID); - //------------------------------------------------------------------ /// Returns the number of elements in the list. /// /// \result /// The number of elements. - //------------------------------------------------------------------ size_t GetSize() const { std::lock_guard<std::recursive_mutex> guard(m_mutex); return m_bp_site_list.size(); diff --git a/lldb/include/lldb/Breakpoint/Stoppoint.h b/lldb/include/lldb/Breakpoint/Stoppoint.h index 4547c6f..f20b100 100644 --- a/lldb/include/lldb/Breakpoint/Stoppoint.h +++ b/lldb/include/lldb/Breakpoint/Stoppoint.h @@ -16,16 +16,12 @@ namespace lldb_private { class Stoppoint { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ Stoppoint(); virtual ~Stoppoint(); - //------------------------------------------------------------------ // Methods - //------------------------------------------------------------------ virtual void Dump(Stream *) = 0; virtual bool IsEnabled() = 0; @@ -40,9 +36,7 @@ protected: lldb::break_id_t m_bid; private: - //------------------------------------------------------------------ // For Stoppoint only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(Stoppoint); }; diff --git a/lldb/include/lldb/Breakpoint/StoppointCallbackContext.h b/lldb/include/lldb/Breakpoint/StoppointCallbackContext.h index 584b056..c1724a6 100644 --- a/lldb/include/lldb/Breakpoint/StoppointCallbackContext.h +++ b/lldb/include/lldb/Breakpoint/StoppointCallbackContext.h @@ -14,18 +14,14 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class StoppointCallbackContext StoppointCallbackContext.h /// "lldb/Breakpoint/StoppointCallbackContext.h" Class holds the information /// that a breakpoint callback needs to evaluate this stop. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// When we hit a breakpoint we need to package up whatever information is /// needed to evaluate breakpoint commands and conditions. This class is the /// container of that information. -//---------------------------------------------------------------------- class StoppointCallbackContext { public: @@ -34,17 +30,13 @@ public: StoppointCallbackContext(Event *event, const ExecutionContext &exe_ctx, bool synchronously = false); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the event, process and thread to NULL, and the frame index to an /// invalid value. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ Event *event; // This is the event, the callback can modify this to indicate // the meaning of the breakpoint hit ExecutionContextRef diff --git a/lldb/include/lldb/Breakpoint/StoppointLocation.h b/lldb/include/lldb/Breakpoint/StoppointLocation.h index 095ddf7..906cef5 100644 --- a/lldb/include/lldb/Breakpoint/StoppointLocation.h +++ b/lldb/include/lldb/Breakpoint/StoppointLocation.h @@ -17,9 +17,7 @@ namespace lldb_private { class StoppointLocation { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StoppointLocation(lldb::break_id_t bid, lldb::addr_t m_addr, bool hardware); StoppointLocation(lldb::break_id_t bid, lldb::addr_t m_addr, @@ -27,13 +25,9 @@ public: virtual ~StoppointLocation(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ - //------------------------------------------------------------------ // Methods - //------------------------------------------------------------------ virtual lldb::addr_t GetLoadAddress() const { return m_addr; } virtual void SetLoadAddress(lldb::addr_t addr) { m_addr = addr; } @@ -59,9 +53,7 @@ public: lldb::break_id_t GetID() const { return m_loc_id; } protected: - //------------------------------------------------------------------ // Classes that inherit from StoppointLocation can see and modify these - //------------------------------------------------------------------ lldb::break_id_t m_loc_id; // Stoppoint location ID lldb::addr_t m_addr; // The load address of this stop point. The base Stoppoint doesn't @@ -84,9 +76,7 @@ protected: void DecrementHitCount(); private: - //------------------------------------------------------------------ // For StoppointLocation only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(StoppointLocation); StoppointLocation(); // Disallow default constructor }; diff --git a/lldb/include/lldb/Breakpoint/Watchpoint.h b/lldb/include/lldb/Breakpoint/Watchpoint.h index 0113564..e71f89b 100644 --- a/lldb/include/lldb/Breakpoint/Watchpoint.h +++ b/lldb/include/lldb/Breakpoint/Watchpoint.h @@ -97,15 +97,12 @@ public: Target &GetTarget() { return m_target; } const Status &GetError() { return m_error; } - //------------------------------------------------------------------ /// Returns the WatchpointOptions structure set for this watchpoint. /// /// \return /// A pointer to this watchpoint's WatchpointOptions. - //------------------------------------------------------------------ WatchpointOptions *GetOptions() { return &m_options; } - //------------------------------------------------------------------ /// Set the callback action invoked when the watchpoint is hit. /// /// \param[in] callback @@ -120,7 +117,6 @@ public: /// \return /// \b true if the process should stop when you hit the watchpoint. /// \b false if it should continue. - //------------------------------------------------------------------ void SetCallback(WatchpointHitCallback callback, void *callback_baton, bool is_synchronous = false); @@ -130,7 +126,6 @@ public: void ClearCallback(); - //------------------------------------------------------------------ /// Invoke the callback action when the watchpoint is hit. /// /// \param[in] context @@ -138,28 +133,21 @@ public: /// /// \return /// \b true if the target should stop at this watchpoint and \b false not. - //------------------------------------------------------------------ bool InvokeCallback(StoppointCallbackContext *context); - //------------------------------------------------------------------ // Condition - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Set the watchpoint's condition. /// /// \param[in] condition /// The condition expression to evaluate when the watchpoint is hit. /// Pass in nullptr to clear the condition. - //------------------------------------------------------------------ void SetCondition(const char *condition); - //------------------------------------------------------------------ /// Return a pointer to the text of the condition expression. /// /// \return /// A pointer to the condition expression text, or nullptr if no // condition has been set. - //------------------------------------------------------------------ const char *GetConditionText() const; void TurnOnEphemeralMode(); diff --git a/lldb/include/lldb/Breakpoint/WatchpointList.h b/lldb/include/lldb/Breakpoint/WatchpointList.h index 899643b..98c6483 100644 --- a/lldb/include/lldb/Breakpoint/WatchpointList.h +++ b/lldb/include/lldb/Breakpoint/WatchpointList.h @@ -18,12 +18,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class WatchpointList WatchpointList.h "lldb/Breakpoint/WatchpointList.h" /// This class is used by Watchpoint to manage a list of watchpoints, // each watchpoint in the list has a unique ID, and is unique by Address as // well. -//---------------------------------------------------------------------- class WatchpointList { // Only Target can make the watchpoint list, or add elements to it. This is @@ -33,17 +31,12 @@ class WatchpointList { friend class Target; public: - //------------------------------------------------------------------ /// Default constructor makes an empty list. - //------------------------------------------------------------------ WatchpointList(); - //------------------------------------------------------------------ /// Destructor, currently does nothing. - //------------------------------------------------------------------ ~WatchpointList(); - //------------------------------------------------------------------ /// Add a Watchpoint to the list. /// /// \param[in] wp_sp @@ -51,20 +44,14 @@ public: /// /// \return /// The ID of the Watchpoint in the list. - //------------------------------------------------------------------ lldb::watch_id_t Add(const lldb::WatchpointSP &wp_sp, bool notify); - //------------------------------------------------------------------ /// Standard "Dump" method. - //------------------------------------------------------------------ void Dump(Stream *s) const; - //------------------------------------------------------------------ /// Dump with lldb::DescriptionLevel. - //------------------------------------------------------------------ void DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the watchpoint at address \a addr - const /// version. /// @@ -74,10 +61,8 @@ public: /// \result /// A shared pointer to the watchpoint. May contain a NULL /// pointer if the watchpoint doesn't exist. - //------------------------------------------------------------------ const lldb::WatchpointSP FindByAddress(lldb::addr_t addr) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the watchpoint with watchpoint spec \a spec /// - const version. /// @@ -87,10 +72,8 @@ public: /// \result /// A shared pointer to the watchpoint. May contain a NULL /// pointer if the watchpoint doesn't exist. - //------------------------------------------------------------------ const lldb::WatchpointSP FindBySpec(std::string spec) const; - //------------------------------------------------------------------ /// Returns a shared pointer to the watchpoint with id \a watchID, const /// version. /// @@ -100,10 +83,8 @@ public: /// \result /// A shared pointer to the watchpoint. May contain a NULL /// pointer if the watchpoint doesn't exist. - //------------------------------------------------------------------ lldb::WatchpointSP FindByID(lldb::watch_id_t watchID) const; - //------------------------------------------------------------------ /// Returns the watchpoint id to the watchpoint at address \a addr. /// /// \param[in] addr @@ -111,10 +92,8 @@ public: /// /// \result /// The ID of the watchpoint, or LLDB_INVALID_WATCH_ID. - //------------------------------------------------------------------ lldb::watch_id_t FindIDByAddress(lldb::addr_t addr); - //------------------------------------------------------------------ /// Returns the watchpoint id to the watchpoint with watchpoint spec \a /// spec. /// @@ -123,10 +102,8 @@ public: /// /// \result /// The ID of the watchpoint, or LLDB_INVALID_WATCH_ID. - //------------------------------------------------------------------ lldb::watch_id_t FindIDBySpec(std::string spec); - //------------------------------------------------------------------ /// Returns a shared pointer to the watchpoint with index \a i. /// /// \param[in] i @@ -135,10 +112,8 @@ public: /// \result /// A shared pointer to the watchpoint. May contain a NULL pointer if /// the watchpoint doesn't exist. - //------------------------------------------------------------------ lldb::WatchpointSP GetByIndex(uint32_t i); - //------------------------------------------------------------------ /// Returns a shared pointer to the watchpoint with index \a i, const /// version. /// @@ -148,10 +123,8 @@ public: /// \result /// A shared pointer to the watchpoint. May contain a NULL pointer if /// the watchpoint location doesn't exist. - //------------------------------------------------------------------ const lldb::WatchpointSP GetByIndex(uint32_t i) const; - //------------------------------------------------------------------ /// Removes the watchpoint given by \b watchID from this list. /// /// \param[in] watchID @@ -159,18 +132,14 @@ public: /// /// \result /// \b true if the watchpoint \a watchID was in the list. - //------------------------------------------------------------------ bool Remove(lldb::watch_id_t watchID, bool notify); - //------------------------------------------------------------------ /// Returns the number hit count of all watchpoints in this list. /// /// \result /// Hit count of all watchpoints in this list. - //------------------------------------------------------------------ uint32_t GetHitCount() const; - //------------------------------------------------------------------ /// Enquires of the watchpoint in this list with ID \a watchID whether we /// should stop. /// @@ -182,21 +151,17 @@ public: /// /// \return /// \b true if we should stop, \b false otherwise. - //------------------------------------------------------------------ bool ShouldStop(StoppointCallbackContext *context, lldb::watch_id_t watchID); - //------------------------------------------------------------------ /// Returns the number of elements in this watchpoint list. /// /// \result /// The number of elements. - //------------------------------------------------------------------ size_t GetSize() const { std::lock_guard<std::recursive_mutex> guard(m_mutex); return m_watchpoints.size(); } - //------------------------------------------------------------------ /// Print a description of the watchpoints in this list to the stream \a s. /// /// \param[in] s @@ -207,19 +172,16 @@ public: /// provide. /// /// \see lldb::DescriptionLevel - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level); void SetEnabledAll(bool enabled); void RemoveAll(bool notify); - //------------------------------------------------------------------ /// Sets the passed in Locker to hold the Watchpoint List mutex. /// /// \param[in] locker /// The locker object that is set. - //------------------------------------------------------------------ void GetListMutex(std::unique_lock<std::recursive_mutex> &lock); protected: diff --git a/lldb/include/lldb/Breakpoint/WatchpointOptions.h b/lldb/include/lldb/Breakpoint/WatchpointOptions.h index 710be22..b395dde 100644 --- a/lldb/include/lldb/Breakpoint/WatchpointOptions.h +++ b/lldb/include/lldb/Breakpoint/WatchpointOptions.h @@ -18,26 +18,19 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class WatchpointOptions WatchpointOptions.h /// "lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a /// watchpoint. -//---------------------------------------------------------------------- class WatchpointOptions { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Default constructor. The watchpoint is enabled, and has no condition, /// callback, ignore count, etc... - //------------------------------------------------------------------ WatchpointOptions(); WatchpointOptions(const WatchpointOptions &rhs); static WatchpointOptions *CopyOptionsNoCallback(WatchpointOptions &rhs); - //------------------------------------------------------------------ /// This constructor allows you to specify all the watchpoint options. /// /// \param[in] callback @@ -49,18 +42,14 @@ public: /// /// \param[in] thread_id /// Only stop if \a thread_id hits the watchpoint. - //------------------------------------------------------------------ WatchpointOptions(WatchpointHitCallback callback, void *baton, lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID); virtual ~WatchpointOptions(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const WatchpointOptions &operator=(const WatchpointOptions &rhs); - //------------------------------------------------------------------ // Callbacks // // Watchpoint callbacks come in two forms, synchronous and asynchronous. @@ -88,9 +77,7 @@ public: // take a bit of plumbing to get // that to work. // - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Adds a callback to the watchpoint option set. /// /// \param[in] callback @@ -102,19 +89,15 @@ public: /// \param[in] synchronous /// Whether this is a synchronous or asynchronous callback. See discussion /// above. - //------------------------------------------------------------------ void SetCallback(WatchpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous = false); - //------------------------------------------------------------------ /// Remove the callback from this option set. - //------------------------------------------------------------------ void ClearCallback(); // The rest of these functions are meant to be used only within the // watchpoint handling mechanism. - //------------------------------------------------------------------ /// Use this function to invoke the callback for a specific stop. /// /// \param[in] context @@ -130,72 +113,55 @@ public: /// /// \return /// The callback return value. - //------------------------------------------------------------------ bool InvokeCallback(StoppointCallbackContext *context, lldb::user_id_t watch_id); - //------------------------------------------------------------------ /// Used in InvokeCallback to tell whether it is the right time to run this /// kind of callback. /// /// \return /// The synchronicity of our callback. - //------------------------------------------------------------------ bool IsCallbackSynchronous() { return m_callback_is_synchronous; } - //------------------------------------------------------------------ /// Fetch the baton from the callback. /// /// \return /// The baton. - //------------------------------------------------------------------ Baton *GetBaton(); - //------------------------------------------------------------------ /// Fetch a const version of the baton from the callback. /// /// \return /// The baton. - //------------------------------------------------------------------ const Baton *GetBaton() const; - //------------------------------------------------------------------ /// Return the current thread spec for this option. This will return nullptr /// if the no thread specifications have been set for this Option yet. /// \return /// The thread specification pointer for this option, or nullptr if none /// has /// been set yet. - //------------------------------------------------------------------ const ThreadSpec *GetThreadSpecNoCreate() const; - //------------------------------------------------------------------ /// Returns a pointer to the ThreadSpec for this option, creating it. if it /// hasn't been created already. This API is used for setting the /// ThreadSpec items for this option. - //------------------------------------------------------------------ ThreadSpec *GetThreadSpec(); void SetThreadID(lldb::tid_t thread_id); void GetDescription(Stream *s, lldb::DescriptionLevel level) const; - //------------------------------------------------------------------ /// Get description for callback only. - //------------------------------------------------------------------ void GetCallbackDescription(Stream *s, lldb::DescriptionLevel level) const; - //------------------------------------------------------------------ /// Returns true if the watchpoint option has a callback set. - //------------------------------------------------------------------ bool HasCallback(); - //------------------------------------------------------------------ /// This is the default empty callback. /// \return /// The thread id for which the watchpoint hit will stop, /// LLDB_INVALID_THREAD_ID for all threads. - //------------------------------------------------------------------ static bool NullCallback(void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id); @@ -218,14 +184,10 @@ public: }; protected: - //------------------------------------------------------------------ // Classes that inherit from WatchpointOptions can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For WatchpointOptions only - //------------------------------------------------------------------ WatchpointHitCallback m_callback; // This is the callback function pointer lldb::BatonSP m_callback_baton_sp; // This is the client data for the callback bool m_callback_is_synchronous; diff --git a/lldb/include/lldb/Core/Address.h b/lldb/include/lldb/Core/Address.h index 6cadf72..aca73a7 100644 --- a/lldb/include/lldb/Core/Address.h +++ b/lldb/include/lldb/Core/Address.h @@ -50,7 +50,6 @@ struct LineEntry; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Address Address.h "lldb/Core/Address.h" /// A section + offset based address class. /// @@ -78,13 +77,10 @@ namespace lldb_private { /// load addresses of the main executable and any images (shared libraries) /// will be resolved/unresolved. When this happens, breakpoints that are in /// one of these sections can be set/cleared. -//---------------------------------------------------------------------- class Address { public: - //------------------------------------------------------------------ /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const function /// to display Address contents in a variety of ways. - //------------------------------------------------------------------ typedef enum { DumpStyleInvalid, ///< Invalid dump style DumpStyleSectionNameOffset, ///< Display as the section name + offset. @@ -127,26 +123,21 @@ public: ///< dereferenced address using DumpStyleResolvedDescription } DumpStyle; - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize with a invalid section (NULL) and an invalid offset /// (LLDB_INVALID_ADDRESS). - //------------------------------------------------------------------ Address() : m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) {} - //------------------------------------------------------------------ /// Copy constructor /// /// Makes a copy of the another Address object \a rhs. /// /// \param[in] rhs /// A const Address object reference to copy. - //------------------------------------------------------------------ Address(const Address &rhs) : m_section_wp(rhs.m_section_wp), m_offset(rhs.m_offset) {} - //------------------------------------------------------------------ /// Construct with a section pointer and offset. /// /// Initialize the address with the supplied \a section and \a offset. @@ -157,7 +148,6 @@ public: /// /// \param[in] offset /// The offset in bytes into \a section. - //------------------------------------------------------------------ Address(const lldb::SectionSP §ion_sp, lldb::addr_t offset) : m_section_wp(), // Don't init with section_sp in case section_sp is // invalid (the weak_ptr will throw) @@ -166,7 +156,6 @@ public: m_section_wp = section_sp; } - //------------------------------------------------------------------ /// Construct with a virtual address and section list. /// /// Initialize and resolve the address with the supplied virtual address \a @@ -177,12 +166,10 @@ public: /// /// \param[in] section_list /// A list of sections, one of which may contain the \a file_addr. - //------------------------------------------------------------------ Address(lldb::addr_t file_addr, const SectionList *section_list); Address(lldb::addr_t abs_addr); -//------------------------------------------------------------------ /// Assignment operator. /// /// Copies the address value from another Address object \a rhs into \a this @@ -193,21 +180,17 @@ public: /// /// \return /// A const Address object reference to \a this. -//------------------------------------------------------------------ const Address &operator=(const Address &rhs); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the section to an invalid value (NULL) and an invalid offset /// (LLDB_INVALID_ADDRESS). - //------------------------------------------------------------------ void Clear() { m_section_wp.reset(); m_offset = LLDB_INVALID_ADDRESS; } - //------------------------------------------------------------------ /// Compare two Address objects. /// /// \param[in] lhs @@ -220,7 +203,6 @@ public: /// \li -1 if lhs < rhs /// \li 0 if lhs == rhs /// \li 1 if lhs > rhs - //------------------------------------------------------------------ static int CompareFileAddress(const Address &lhs, const Address &rhs); static int CompareLoadAddress(const Address &lhs, const Address &rhs, @@ -239,7 +221,6 @@ public: } }; - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -262,14 +243,12 @@ public: /// in such cases. /// /// \see Address::DumpStyle - //------------------------------------------------------------------ bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style = DumpStyleInvalid, uint32_t addr_byte_size = UINT32_MAX) const; AddressClass GetAddressClass() const; - //------------------------------------------------------------------ /// Get the file address. /// /// If an address comes from a file on disk that has section relative @@ -280,10 +259,8 @@ public: /// The valid file virtual address, or LLDB_INVALID_ADDRESS if /// the address doesn't have a file virtual address (image is /// from memory only with no representation on disk). - //------------------------------------------------------------------ lldb::addr_t GetFileAddress() const; - //------------------------------------------------------------------ /// Get the load address. /// /// If an address comes from a file on disk that has section relative @@ -296,10 +273,8 @@ public: /// \return /// The valid load virtual address, or LLDB_INVALID_ADDRESS if /// the address is currently not loaded. - //------------------------------------------------------------------ lldb::addr_t GetLoadAddress(Target *target) const; - //------------------------------------------------------------------ /// Get the load address as a callable code load address. /// /// This function will first resolve its address to a load address. Then, if @@ -312,11 +287,9 @@ public: /// \return /// The valid load virtual address, or LLDB_INVALID_ADDRESS if /// the address is currently not loaded. - //------------------------------------------------------------------ lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect = false) const; - //------------------------------------------------------------------ /// Get the load address as an opcode load address. /// /// This function will first resolve its address to a load address. Then, if @@ -332,21 +305,17 @@ public: /// The valid load virtual address with extra callable bits /// removed, or LLDB_INVALID_ADDRESS if the address is currently /// not loaded. - //------------------------------------------------------------------ lldb::addr_t GetOpcodeLoadAddress( Target *target, AddressClass addr_class = AddressClass::eInvalid) const; - //------------------------------------------------------------------ /// Get the section relative offset value. /// /// \return /// The current offset, or LLDB_INVALID_ADDRESS if this address /// doesn't contain a valid offset. - //------------------------------------------------------------------ lldb::addr_t GetOffset() const { return m_offset; } - //------------------------------------------------------------------ /// Check if an address is section offset. /// /// When converting a virtual file or load address into a section offset @@ -358,12 +327,10 @@ public: /// \return /// Returns \b true if the address has a valid section and /// offset, \b false otherwise. - //------------------------------------------------------------------ bool IsSectionOffset() const { return IsValid() && (GetSection().get() != nullptr); } - //------------------------------------------------------------------ /// Check if the object state is valid. /// /// A valid Address object contains either a section pointer and @@ -373,18 +340,14 @@ public: /// \return /// Returns \b true if the offset is valid, \b false /// otherwise. - //------------------------------------------------------------------ bool IsValid() const { return m_offset != LLDB_INVALID_ADDRESS; } - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// \return /// The number of bytes that this object occupies in memory. - //------------------------------------------------------------------ size_t MemorySize() const; - //------------------------------------------------------------------ /// Resolve a file virtual address using a section list. /// /// Given a list of sections, attempt to resolve \a addr as an offset into @@ -393,11 +356,9 @@ public: /// \return /// Returns \b true if \a addr was able to be resolved, \b false /// otherwise. - //------------------------------------------------------------------ bool ResolveAddressUsingFileSections(lldb::addr_t addr, const SectionList *sections); - //------------------------------------------------------------------ /// Set the address to represent \a load_addr. /// /// The address will attempt to find a loaded section within \a target that @@ -423,7 +384,6 @@ public: /// address to not resolve to a section in a module, this often /// happens for JIT'ed code, or any load addresses on the stack /// or heap. - //------------------------------------------------------------------ bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end = false); @@ -434,26 +394,21 @@ public: bool SetCallableLoadAddress(lldb::addr_t load_addr, Target *target); - //------------------------------------------------------------------ /// Get accessor for the module for this address. /// /// \return /// Returns the Module pointer that this address is an offset /// in, or NULL if this address doesn't belong in a module, or /// isn't resolved yet. - //------------------------------------------------------------------ lldb::ModuleSP GetModule() const; - //------------------------------------------------------------------ /// Get const accessor for the section. /// /// \return /// Returns the const lldb::Section pointer that this address is an /// offset in, or NULL if this address is absolute. - //------------------------------------------------------------------ lldb::SectionSP GetSection() const { return m_section_wp.lock(); } - //------------------------------------------------------------------ /// Set accessor for the offset. /// /// \param[in] offset @@ -461,7 +416,6 @@ public: /// /// \return /// Returns \b true if the offset changed, \b false otherwise. - //------------------------------------------------------------------ bool SetOffset(lldb::addr_t offset) { bool changed = m_offset != offset; m_offset = offset; @@ -481,21 +435,18 @@ public: return false; } - //------------------------------------------------------------------ /// Set accessor for the section. /// /// \param[in] section /// A new lldb::Section pointer to use as the section base. Can /// be NULL for absolute addresses that are not relative to /// any section. - //------------------------------------------------------------------ void SetSection(const lldb::SectionSP §ion_sp) { m_section_wp = section_sp; } void ClearSection() { m_section_wp.reset(); } - //------------------------------------------------------------------ /// Reconstruct a symbol context from an address. /// /// This class doesn't inherit from SymbolContextScope because many address @@ -504,7 +455,6 @@ public: /// module found in the section. /// /// \see SymbolContextScope::CalculateSymbolContext(SymbolContext*) - //------------------------------------------------------------------ uint32_t CalculateSymbolContext(SymbolContext *sc, lldb::SymbolContextItem resolve_scope = lldb::eSymbolContextEverything) const; @@ -521,33 +471,26 @@ public: bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const; - //------------------------------------------------------------------ // Returns true if the section should be valid, but isn't because the shared // pointer to the section can't be reconstructed from a weak pointer that // contains a valid weak reference to a section. Returns false if the section // weak pointer has no reference to a section, or if the section is still // valid - //------------------------------------------------------------------ bool SectionWasDeleted() const; protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ lldb::SectionWP m_section_wp; ///< The section for the address, can be NULL. lldb::addr_t m_offset; ///< Offset into section if \a m_section_wp is valid... - //------------------------------------------------------------------ // Returns true if the m_section_wp once had a reference to a valid section // shared pointer, but no longer does. This can happen if we have an address // from a module that gets unloaded and deleted. This function should only be // called if GetSection() returns an empty shared pointer and you want to // know if this address used to have a valid section. - //------------------------------------------------------------------ bool SectionWasDeletedPrivate() const; }; -//---------------------------------------------------------------------- // NOTE: Be careful using this operator. It can correctly compare two // addresses from the same Module correctly. It can't compare two addresses // from different modules in any meaningful way, but it will compare the module @@ -559,7 +502,6 @@ protected: // address results to make much sense // // This basically lets Address objects be used in ordered collection classes. -//---------------------------------------------------------------------- bool operator<(const Address &lhs, const Address &rhs); bool operator>(const Address &lhs, const Address &rhs); bool operator==(const Address &lhs, const Address &rhs); diff --git a/lldb/include/lldb/Core/AddressRange.h b/lldb/include/lldb/Core/AddressRange.h index 787b473..b55c279 100644 --- a/lldb/include/lldb/Core/AddressRange.h +++ b/lldb/include/lldb/Core/AddressRange.h @@ -27,21 +27,16 @@ class Target; namespace lldb_private { -//---------------------------------------------------------------------- /// \class AddressRange AddressRange.h "lldb/Core/AddressRange.h" /// A section + offset based address range class. -//---------------------------------------------------------------------- class AddressRange { public: - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize with a invalid section (NULL), an invalid offset /// (LLDB_INVALID_ADDRESS), and zero byte size. - //------------------------------------------------------------------ AddressRange(); - //------------------------------------------------------------------ /// Construct with a section pointer, offset, and byte_size. /// /// Initialize the address with the supplied \a section, \a offset and \a @@ -56,11 +51,9 @@ public: /// /// \param[in] byte_size /// The size in bytes of the address range. - //------------------------------------------------------------------ AddressRange(const lldb::SectionSP §ion, lldb::addr_t offset, lldb::addr_t byte_size); - //------------------------------------------------------------------ /// Construct with a virtual address, section list and byte size. /// /// Initialize and resolve the address with the supplied virtual address \a @@ -74,11 +67,9 @@ public: /// /// \param[in] section_list /// A list of sections, one of which may contain the \a vaddr. - //------------------------------------------------------------------ AddressRange(lldb::addr_t file_addr, lldb::addr_t byte_size, const SectionList *section_list = nullptr); - //------------------------------------------------------------------ /// Construct with a Address object address and byte size. /// /// Initialize by copying the section offset address in \a so_addr, and @@ -89,25 +80,19 @@ public: /// /// \param[in] byte_size /// The size in bytes of the address range. - //------------------------------------------------------------------ AddressRange(const Address &so_addr, lldb::addr_t byte_size); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual in case this class is subclassed. - //------------------------------------------------------------------ ~AddressRange(); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the section to an invalid value (NULL), an invalid offset /// (LLDB_INVALID_ADDRESS) and a zero byte size. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Check if a section offset address is contained in this range. /// /// \param[in] so_addr @@ -116,11 +101,9 @@ public: /// \return /// Returns \b true if \a so_addr is contained in this range, /// \b false otherwise. - //------------------------------------------------------------------ // bool // Contains (const Address &so_addr) const; - //------------------------------------------------------------------ /// Check if a section offset address is contained in this range. /// /// \param[in] so_addr_ptr @@ -129,11 +112,9 @@ public: /// \return /// Returns \b true if \a so_addr is contained in this range, /// \b false otherwise. - //------------------------------------------------------------------ // bool // Contains (const Address *so_addr_ptr) const; - //------------------------------------------------------------------ /// Check if a section offset \a so_addr when represented as a file address /// is contained within this object's file address range. /// @@ -144,10 +125,8 @@ public: /// Returns \b true if both \a this and \a so_addr have /// resolvable file address values and \a so_addr is contained /// in the address range, \b false otherwise. - //------------------------------------------------------------------ bool ContainsFileAddress(const Address &so_addr) const; - //------------------------------------------------------------------ /// Check if the resolved file address \a file_addr is contained within this /// object's file address range. /// @@ -158,10 +137,8 @@ public: /// Returns \b true if both \a this has a resolvable file /// address value and \a so_addr is contained in the address /// range, \b false otherwise. - //------------------------------------------------------------------ bool ContainsFileAddress(lldb::addr_t file_addr) const; - //------------------------------------------------------------------ /// Check if a section offset \a so_addr when represented as a load address /// is contained within this object's load address range. /// @@ -172,10 +149,8 @@ public: /// Returns \b true if both \a this and \a so_addr have /// resolvable load address values and \a so_addr is contained /// in the address range, \b false otherwise. - //------------------------------------------------------------------ bool ContainsLoadAddress(const Address &so_addr, Target *target) const; - //------------------------------------------------------------------ /// Check if the resolved load address \a load_addr is contained within this /// object's load address range. /// @@ -186,10 +161,8 @@ public: /// Returns \b true if both \a this has a resolvable load /// address value and \a so_addr is contained in the address /// range, \b false otherwise. - //------------------------------------------------------------------ bool ContainsLoadAddress(lldb::addr_t load_addr, Target *target) const; - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -210,12 +183,10 @@ public: /// in such cases. /// /// \see Address::DumpStyle - //------------------------------------------------------------------ bool Dump(Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style = Address::DumpStyleInvalid) const; - //------------------------------------------------------------------ /// Dump a debug description of this object to a Stream. /// /// Dump a debug description of the contents of this object to the supplied @@ -226,57 +197,44 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void DumpDebug(Stream *s) const; - //------------------------------------------------------------------ /// Get accessor for the base address of the range. /// /// \return /// A reference to the base address object. - //------------------------------------------------------------------ Address &GetBaseAddress() { return m_base_addr; } - //------------------------------------------------------------------ /// Get const accessor for the base address of the range. /// /// \return /// A const reference to the base address object. - //------------------------------------------------------------------ const Address &GetBaseAddress() const { return m_base_addr; } - //------------------------------------------------------------------ /// Get accessor for the byte size of this range. /// /// \return /// The size in bytes of this address range. - //------------------------------------------------------------------ lldb::addr_t GetByteSize() const { return m_byte_size; } - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// \return /// The number of bytes that this object occupies in memory. - //------------------------------------------------------------------ size_t MemorySize() const { // Noting special for the memory size of a single AddressRange object, it // is just the size of itself. return sizeof(AddressRange); } - //------------------------------------------------------------------ /// Set accessor for the byte size of this range. /// /// \param[in] byte_size /// The new size in bytes of this address range. - //------------------------------------------------------------------ void SetByteSize(lldb::addr_t byte_size) { m_byte_size = byte_size; } protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ Address m_base_addr; ///< The section offset base address of this range. lldb::addr_t m_byte_size; ///< The size in bytes of this address range. }; diff --git a/lldb/include/lldb/Core/AddressResolver.h b/lldb/include/lldb/Core/AddressResolver.h index f3f1622..4d459a2 100644 --- a/lldb/include/lldb/Core/AddressResolver.h +++ b/lldb/include/lldb/Core/AddressResolver.h @@ -24,19 +24,15 @@ class Stream; } namespace lldb_private { -//---------------------------------------------------------------------- /// \class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h" /// This class works with SearchFilter to resolve function names and source /// file locations to their concrete addresses. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// The AddressResolver is a Searcher. In that protocol, the SearchFilter /// asks the question "At what depth of the symbol context descent do you want /// your callback to get called?" of the filter. The resolver answers this /// question (in the GetDepth method) and provides the resolution callback. -//---------------------------------------------------------------------- class AddressResolver : public Searcher { public: diff --git a/lldb/include/lldb/Core/AddressResolverFileLine.h b/lldb/include/lldb/Core/AddressResolverFileLine.h index ba66c6d..0b4edc2 100644 --- a/lldb/include/lldb/Core/AddressResolverFileLine.h +++ b/lldb/include/lldb/Core/AddressResolverFileLine.h @@ -28,12 +28,10 @@ class SymbolContext; namespace lldb_private { -//---------------------------------------------------------------------- /// \class AddressResolverFileLine AddressResolverFileLine.h /// "lldb/Core/AddressResolverFileLine.h" This class finds address for source /// file and line. Optionally, it will look for inlined instances of the file /// and line specification. -//---------------------------------------------------------------------- class AddressResolverFileLine : public AddressResolver { public: diff --git a/lldb/include/lldb/Core/AddressResolverName.h b/lldb/include/lldb/Core/AddressResolverName.h index 917238d..8f591f7 100644 --- a/lldb/include/lldb/Core/AddressResolverName.h +++ b/lldb/include/lldb/Core/AddressResolverName.h @@ -27,11 +27,9 @@ class SymbolContext; namespace lldb_private { -//---------------------------------------------------------------------- /// \class AddressResolverName AddressResolverName.h /// "lldb/Core/AddressResolverName.h" This class finds addresses for a given /// function name, either by exact match or by regular expression. -//---------------------------------------------------------------------- class AddressResolverName : public AddressResolver { public: diff --git a/lldb/include/lldb/Core/Architecture.h b/lldb/include/lldb/Core/Architecture.h index 195fd7b..031f9587a 100644 --- a/lldb/include/lldb/Core/Architecture.h +++ b/lldb/include/lldb/Core/Architecture.h @@ -18,7 +18,6 @@ public: Architecture() = default; virtual ~Architecture() = default; - //------------------------------------------------------------------ /// This is currently intended to handle cases where a /// program stops at an instruction that won't get executed and it /// allows the stop reason, like "breakpoint hit", to be replaced @@ -29,10 +28,8 @@ public: /// executed and therefore it wouldn't be correct to show the program /// stopped at the current PC. The code is generic and applies to all /// ARM CPUs. - //------------------------------------------------------------------ virtual void OverrideStopInfo(Thread &thread) const = 0; - //------------------------------------------------------------------ /// This method is used to get the number of bytes that should be /// skipped, from function start address, to reach the first /// instruction after the prologue. If overrode, it must return @@ -48,12 +45,10 @@ public: /// be compared with current address, in order to find out the /// number of bytes that should be skipped, in case we are stopped /// at either function entry point. - //------------------------------------------------------------------ virtual size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const { return 0; } - //------------------------------------------------------------------ /// Adjust function breakpoint address, if needed. In some cases, /// the function start address is not the right place to set the /// breakpoint, specially in functions with multiple entry points. @@ -62,12 +57,10 @@ public: /// both a global and a local entry point. In this case, the /// breakpoint is adjusted to the first function address reached /// by both entry points. - //------------------------------------------------------------------ virtual void AdjustBreakpointAddress(const Symbol &func, Address &addr) const {} - //------------------------------------------------------------------ /// Get \a load_addr as a callable code load address for this target /// /// Take \a load_addr and potentially add any address bits that are @@ -77,13 +70,11 @@ public: /// adjustment will always happen. If it is set to an address class /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be /// returned. - //------------------------------------------------------------------ virtual lldb::addr_t GetCallableLoadAddress( lldb::addr_t addr, AddressClass addr_class = AddressClass::eInvalid) const { return addr; } - //------------------------------------------------------------------ /// Get \a load_addr as an opcode for this target. /// /// Take \a load_addr and potentially strip any address bits that are @@ -94,7 +85,6 @@ public: /// adjustment will always happen. If it is set to an address class /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be /// returned. - //------------------------------------------------------------------ virtual lldb::addr_t GetOpcodeLoadAddress( lldb::addr_t addr, AddressClass addr_class = AddressClass::eInvalid) const { diff --git a/lldb/include/lldb/Core/Communication.h b/lldb/include/lldb/Core/Communication.h index 4e1ceba..3874f0b 100644 --- a/lldb/include/lldb/Core/Communication.h +++ b/lldb/include/lldb/Core/Communication.h @@ -37,7 +37,6 @@ class Status; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Communication Communication.h "lldb/Core/Communication.h" An /// abstract communications class. /// @@ -89,7 +88,6 @@ namespace lldb_private { /// eBroadcastBitReadThreadDidExit event will be broadcast. Clients can also /// post a \b eBroadcastBitReadThreadShouldExit event to this object which /// will cause the read thread to exit. -//---------------------------------------------------------------------- class Communication : public Broadcaster { public: FLAGS_ANONYMOUS_ENUM(){ @@ -115,7 +113,6 @@ public: typedef void (*ReadThreadBytesReceived)(void *baton, const void *src, size_t src_len); - //------------------------------------------------------------------ /// Construct the Communication object with the specified name for the /// Broadcaster that this object inherits from. /// @@ -124,19 +121,15 @@ public: /// complete as possible to uniquely identify this object. The /// broadcaster name can be updated after the connect function /// is called. - //------------------------------------------------------------------ Communication(const char *broadcaster_name); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class gets subclassed. - //------------------------------------------------------------------ ~Communication() override; void Clear(); - //------------------------------------------------------------------ /// Connect using the current connection by passing \a url to its connect /// function. string. /// @@ -151,10 +144,8 @@ public: /// /// \see Status& Communication::GetError (); /// \see bool Connection::Connect (const char *url); - //------------------------------------------------------------------ lldb::ConnectionStatus Connect(const char *url, Status *error_ptr); - //------------------------------------------------------------------ /// Disconnect the communications connection if one is currently connected. /// /// \return @@ -164,23 +155,19 @@ public: /// /// \see Status& Communication::GetError (); /// \see bool Connection::Disconnect (); - //------------------------------------------------------------------ lldb::ConnectionStatus Disconnect(Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Check if the connection is valid. /// /// \return /// \b True if this object is currently connected, \b false /// otherwise. - //------------------------------------------------------------------ bool IsConnected() const; bool HasConnection() const; lldb_private::Connection *GetConnection() { return m_connection_sp.get(); } - //------------------------------------------------------------------ /// Read bytes from the current connection. /// /// If no read thread is running, this function call the connection's @@ -208,11 +195,9 @@ public: /// The number of bytes actually read. /// /// \see size_t Connection::Read (void *, size_t); - //------------------------------------------------------------------ size_t Read(void *dst, size_t dst_len, const Timeout<std::micro> &timeout, lldb::ConnectionStatus &status, Status *error_ptr); - //------------------------------------------------------------------ /// The actual write function that attempts to write to the communications /// protocol. /// @@ -228,11 +213,9 @@ public: /// /// \return /// The number of bytes actually Written. - //------------------------------------------------------------------ size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr); - //------------------------------------------------------------------ /// Sets the connection that it to be used by this class. /// /// By making a communication class that uses different connections it @@ -245,10 +228,8 @@ public: /// /// \see /// class Connection - //------------------------------------------------------------------ void SetConnection(Connection *connection); - //------------------------------------------------------------------ /// Starts a read thread whose sole purpose it to read bytes from the /// current connection. This function will call connection's read function: /// @@ -271,28 +252,22 @@ public: /// \see size_t Connection::Read (void *, size_t); /// \see void Communication::AppendBytesToCache (const uint8_t * bytes, /// size_t len, bool broadcast); - //------------------------------------------------------------------ virtual bool StartReadThread(Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Stops the read thread by cancelling it. /// /// \return /// \b True if the read thread was successfully canceled, \b /// false otherwise. - //------------------------------------------------------------------ virtual bool StopReadThread(Status *error_ptr = nullptr); virtual bool JoinReadThread(Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Checks if there is a currently running read thread. /// /// \return /// \b True if the read thread is running, \b false otherwise. - //------------------------------------------------------------------ bool ReadThreadIsRunning(); - //------------------------------------------------------------------ /// The static read thread function. This function will call the "DoRead" /// function continuously and wait for data to become available. When data /// is received it will append the available data to the internal cache and @@ -305,19 +280,16 @@ public: /// \b NULL. /// /// \see void Communication::ReadThreadGotBytes (const uint8_t *, size_t); - //------------------------------------------------------------------ static lldb::thread_result_t ReadThread(lldb::thread_arg_t comm_ptr); void 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,7 +326,6 @@ protected: const Timeout<std::micro> &timeout, lldb::ConnectionStatus &status, Status *error_ptr); - //------------------------------------------------------------------ /// Append new bytes that get read from the read thread into the internal /// object byte cache. This will cause a \b eBroadcastBitReadThreadGotBytes /// event to be broadcast if \a broadcast is true. @@ -373,12 +344,10 @@ protected: /// /// \param[in] src_len /// The number of bytes to append to the cache. - //------------------------------------------------------------------ virtual void AppendBytesToCache(const uint8_t *src, size_t src_len, bool broadcast, lldb::ConnectionStatus status); - //------------------------------------------------------------------ /// Get any available bytes from our data cache. If this call empties the /// data cache, the \b eBroadcastBitReadThreadGotBytes event will be reset /// to signify no more bytes are available. @@ -394,7 +363,6 @@ protected: /// /// \return /// The number of bytes extracted from the data cache. - //------------------------------------------------------------------ size_t GetCachedBytes(void *dst, size_t dst_len); private: diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h index b3902c2..1e032beb 100644 --- a/lldb/include/lldb/Core/Debugger.h +++ b/lldb/include/lldb/Core/Debugger.h @@ -74,12 +74,10 @@ class raw_ostream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Debugger Debugger.h "lldb/Core/Debugger.h" /// A class to manage flag bits. /// /// Provides a global root objects for the debugger core. -//---------------------------------------------------------------------- class Debugger : public std::enable_shared_from_this<Debugger>, public UserID, @@ -169,7 +167,6 @@ public: } ExecutionContext GetSelectedExecutionContext(); - //------------------------------------------------------------------ /// Get accessor for the target list. /// /// The target list is part of the global debugger object. This the single @@ -178,7 +175,6 @@ public: /// /// \return /// A global shared target list. - //------------------------------------------------------------------ TargetList &GetTargetList() { return m_target_list; } PlatformList &GetPlatformList() { return m_platform_list; } @@ -187,10 +183,8 @@ public: void DispatchInputEndOfFile(); - //------------------------------------------------------------------ // If any of the streams are not set, set them to the in/out/err stream of // the top most input reader to ensure they at least have something - //------------------------------------------------------------------ void AdoptTopIOHandlerFilesIfInvalid(lldb::StreamFileSP &in, lldb::StreamFileSP &out, lldb::StreamFileSP &err); @@ -229,9 +223,7 @@ public: void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton); - //---------------------------------------------------------------------- // Properties Functions - //---------------------------------------------------------------------- enum StopDisassemblyType { eStopDisassemblyTypeNever = 0, eStopDisassemblyTypeNoDebugInfo, @@ -416,9 +408,7 @@ protected: lldb::ListenerSP m_forward_listener_sp; llvm::once_flag m_clear_once; - //---------------------------------------------------------------------- // Events for m_sync_broadcaster - //---------------------------------------------------------------------- enum { eBroadcastBitEventThreadIsListening = (1 << 0), }; diff --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h index dacc67a..a2a0bd5 100644 --- a/lldb/include/lldb/Core/Disassembler.h +++ b/lldb/include/lldb/Core/Disassembler.h @@ -109,7 +109,6 @@ public: m_address = addr; } - //------------------------------------------------------------------ /// Dump the text representation of this Instruction to a Stream /// /// Print the (optional) address, (optional) bytes, opcode, @@ -159,7 +158,6 @@ public: /// 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 Dump(Stream *s, uint32_t max_opcode_byte_size, bool show_address, bool show_bytes, const ExecutionContext *exe_ctx, const SymbolContext *sym_ctx, @@ -423,9 +421,7 @@ public: uint32_t num_instructions, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ Disassembler(const ArchSpec &arch, const char *flavor); ~Disassembler() override; @@ -535,18 +531,14 @@ protected: return ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, sl); }; - //------------------------------------------------------------------ // Classes that inherit from Disassembler can see and modify these - //------------------------------------------------------------------ ArchSpec m_arch; InstructionList m_instruction_list; lldb::addr_t m_base_addr; std::string m_flavor; private: - //------------------------------------------------------------------ // For Disassembler only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(Disassembler); }; diff --git a/lldb/include/lldb/Core/DumpDataExtractor.h b/lldb/include/lldb/Core/DumpDataExtractor.h index 5fb88b5..2a9d778 100644 --- a/lldb/include/lldb/Core/DumpDataExtractor.h +++ b/lldb/include/lldb/Core/DumpDataExtractor.h @@ -20,7 +20,6 @@ class DataExtractor; class ExecutionContextScope; class Stream; -//------------------------------------------------------------------ /// Dumps \a item_count objects into the stream \a s. /// /// Dumps \a item_count objects using \a item_format, each of which @@ -79,7 +78,6 @@ class Stream; /// /// \return /// The offset at which dumping ended. -//------------------------------------------------------------------ lldb::offset_t DumpDataExtractor(const DataExtractor &DE, Stream *s, lldb::offset_t offset, lldb::Format item_format, size_t item_byte_size, diff --git a/lldb/include/lldb/Core/EmulateInstruction.h b/lldb/include/lldb/Core/EmulateInstruction.h index 26df698..f08cf2c 100644 --- a/lldb/include/lldb/Core/EmulateInstruction.h +++ b/lldb/include/lldb/Core/EmulateInstruction.h @@ -44,7 +44,6 @@ class UnwindPlan; namespace lldb_private { -//---------------------------------------------------------------------- /// \class EmulateInstruction EmulateInstruction.h /// "lldb/Core/EmulateInstruction.h" /// A class that allows emulation of CPU opcodes. @@ -102,7 +101,6 @@ namespace lldb_private { /// paths in a debugger (single step prediction, finding save restore /// locations of registers for unwinding stack frame variables) and emulating /// the instruction is just a bonus. -//---------------------------------------------------------------------- class EmulateInstruction : public PluginInterface { public: @@ -367,9 +365,7 @@ public: ~EmulateInstruction() override = default; - //---------------------------------------------------------------------- // Mandatory overrides - //---------------------------------------------------------------------- virtual bool SupportsEmulatingInstructionsOfType(InstructionType inst_type) = 0; @@ -389,9 +385,7 @@ public: virtual bool GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterInfo ®_info) = 0; - //---------------------------------------------------------------------- // Optional overrides - //---------------------------------------------------------------------- virtual bool SetInstruction(const Opcode &insn_opcode, const Address &inst_addr, Target *target); @@ -400,9 +394,7 @@ public: static const char *TranslateRegister(lldb::RegisterKind reg_kind, uint32_t reg_num, std::string ®_name); - //---------------------------------------------------------------------- // RegisterInfo variants - //---------------------------------------------------------------------- bool ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value); uint64_t ReadRegisterUnsigned(const RegisterInfo *reg_info, @@ -414,9 +406,7 @@ public: bool WriteRegisterUnsigned(const Context &context, const RegisterInfo *reg_info, uint64_t reg_value); - //---------------------------------------------------------------------- // Register kind and number variants - //---------------------------------------------------------------------- bool ReadRegister(lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterValue ®_value); @@ -520,9 +510,7 @@ protected: Opcode m_opcode; private: - //------------------------------------------------------------------ // For EmulateInstruction only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(EmulateInstruction); }; diff --git a/lldb/include/lldb/Core/FileLineResolver.h b/lldb/include/lldb/Core/FileLineResolver.h index 01cc9db..f3cde73 100644 --- a/lldb/include/lldb/Core/FileLineResolver.h +++ b/lldb/include/lldb/Core/FileLineResolver.h @@ -25,11 +25,9 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h" /// This class finds address for source file and line. Optionally, it will /// look for inlined instances of the file and line specification. -//---------------------------------------------------------------------- class FileLineResolver : public Searcher { public: diff --git a/lldb/include/lldb/Core/FileSpecList.h b/lldb/include/lldb/Core/FileSpecList.h index fd744f1..cbc26c3 100644 --- a/lldb/include/lldb/Core/FileSpecList.h +++ b/lldb/include/lldb/Core/FileSpecList.h @@ -22,19 +22,15 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class FileSpecList FileSpecList.h "lldb/Core/FileSpecList.h" /// A file collection class. /// /// A class that contains a mutable list of FileSpec objects. -//---------------------------------------------------------------------- class FileSpecList { public: - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize this object with an empty file list. - //------------------------------------------------------------------ FileSpecList(); /// Copy constructor. @@ -46,12 +42,9 @@ public: /// Initialize this object from a vector of FileSpecs FileSpecList(std::vector<FileSpec> &&rhs) : m_files(std::move(rhs)) {} - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~FileSpecList(); - //------------------------------------------------------------------ /// Assignment operator. /// /// Replace the file list in this object with the file list from \a rhs. @@ -61,23 +54,19 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ FileSpecList &operator=(const FileSpecList &rhs) = default; /// Move-assignment operator. FileSpecList &operator=(FileSpecList &&rhs) = default; - //------------------------------------------------------------------ /// Append a FileSpec object to the list. /// /// Appends \a file to the end of the file list. /// /// \param[in] file /// A new file to append to this file list. - //------------------------------------------------------------------ void Append(const FileSpec &file); - //------------------------------------------------------------------ /// Append a FileSpec object if unique. /// /// Appends \a file to the end of the file list if it doesn't already exist @@ -88,23 +77,17 @@ public: /// /// \return /// \b true if the file was appended, \b false otherwise. - //------------------------------------------------------------------ bool AppendIfUnique(const FileSpec &file); - //------------------------------------------------------------------ /// Clears the file list. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Dumps the file list to the supplied stream pointer "s". /// /// \param[in] s /// The stream that will be used to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, const char *separator_cstr = "\n") const; - //------------------------------------------------------------------ /// Find a file index. /// /// Find the index of the file in the file spec list that matches \a file @@ -122,10 +105,8 @@ public: /// \return /// The index of the file that matches \a file if it is found, /// else UINT32_MAX is returned. - //------------------------------------------------------------------ size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const; - //------------------------------------------------------------------ /// Get file at index. /// /// Gets a file from the file list. If \a idx is not a valid index, an empty @@ -139,10 +120,8 @@ public: /// A copy of the FileSpec object at index \a idx. If \a idx /// is out of range, then an empty FileSpec object will be /// returned. - //------------------------------------------------------------------ const FileSpec &GetFileSpecAtIndex(size_t idx) const; - //------------------------------------------------------------------ /// Get file specification pointer at index. /// /// Gets a file from the file list. The file objects that are returned can @@ -154,10 +133,8 @@ public: /// \return /// A pointer to a contained FileSpec object at index \a idx. /// If \a idx is out of range, then an NULL is returned. - //------------------------------------------------------------------ const FileSpec *GetFileSpecPointerAtIndex(size_t idx) const; - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// Return the size in bytes that this object takes in memory. This returns @@ -168,17 +145,14 @@ public: /// The number of bytes that this object occupies in memory. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ size_t MemorySize() const; bool IsEmpty() const { return m_files.empty(); } - //------------------------------------------------------------------ /// Get the number of files in the file list. /// /// \return /// The number of files in the file spec list. - //------------------------------------------------------------------ size_t GetSize() const; bool Insert(size_t idx, const FileSpec &file) { diff --git a/lldb/include/lldb/Core/FormatEntity.h b/lldb/include/lldb/Core/FormatEntity.h index 2a9e6c0..74b5125 100644 --- a/lldb/include/lldb/Core/FormatEntity.h +++ b/lldb/include/lldb/Core/FormatEntity.h @@ -215,14 +215,12 @@ public: static size_t AutoComplete(lldb_private::CompletionRequest &request); - //---------------------------------------------------------------------- // Format the current elements into the stream \a s. // // The root element will be stripped off and the format str passed in will be // either an empty string (print a description of this object), or contain a // `.`-separated series like a domain name that identifies further // sub-elements to display. - //---------------------------------------------------------------------- static bool FormatFileSpec(const FileSpec &file, Stream &s, llvm::StringRef elements, llvm::StringRef element_format); diff --git a/lldb/include/lldb/Core/Highlighter.h b/lldb/include/lldb/Core/Highlighter.h index 0f1f949..88d3bb3 100644 --- a/lldb/include/lldb/Core/Highlighter.h +++ b/lldb/include/lldb/Core/Highlighter.h @@ -18,17 +18,13 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// Represents style that the highlighter should apply to the given source code. /// Stores information about how every kind of token should be annotated. -//---------------------------------------------------------------------- struct HighlightStyle { - //---------------------------------------------------------------------- /// A pair of strings that should be placed around a certain token. Usually /// stores color codes in these strings (the suffix string is often used for /// resetting the terminal attributes back to normal). - //---------------------------------------------------------------------- class ColorStyle { std::string m_prefix; std::string m_suffix; @@ -83,9 +79,7 @@ struct HighlightStyle { /// Matches '(' or ')' ColorStyle parentheses; - //----------------------------------------------------------------------- // C language specific options - //----------------------------------------------------------------------- /// Matches directives to a preprocessor (if the language has any). ColorStyle pp_directive; @@ -94,9 +88,7 @@ struct HighlightStyle { static HighlightStyle MakeVimStyle(); }; -//---------------------------------------------------------------------- /// Annotates source code with color attributes. -//---------------------------------------------------------------------- class Highlighter { public: Highlighter() = default; diff --git a/lldb/include/lldb/Core/IOHandler.h b/lldb/include/lldb/Core/IOHandler.h index cda6a32..b718067 100644 --- a/lldb/include/lldb/Core/IOHandler.h +++ b/lldb/include/lldb/Core/IOHandler.h @@ -138,23 +138,19 @@ public: const Flags &GetFlags() const { return m_flags; } - //------------------------------------------------------------------ /// Check if the input is being supplied interactively by a user /// /// This will return true if the input stream is a terminal (tty or /// pty) and can cause IO handlers to do different things (like /// for a confirmation when deleting all breakpoints). - //------------------------------------------------------------------ bool GetIsInteractive(); - //------------------------------------------------------------------ /// Check if the input is coming from a real terminal. /// /// A real terminal has a valid size with a certain number of rows /// and columns. If this function returns true, then terminal escape /// sequences are expected to work (cursor movement escape sequences, /// clearing lines, etc). - //------------------------------------------------------------------ bool GetIsRealTerminal(); void SetPopped(bool b); @@ -183,14 +179,12 @@ private: DISALLOW_COPY_AND_ASSIGN(IOHandler); }; -//------------------------------------------------------------------ /// A delegate class for use with IOHandler subclasses. /// /// The IOHandler delegate is designed to be mixed into classes so /// they can use an IOHandler subclass to fetch input and notify the /// object that inherits from this delegate class when a token is /// received. -//------------------------------------------------------------------ class IOHandlerDelegate { public: enum class Completion { None, LLDBCommand, Expression }; @@ -211,7 +205,6 @@ public: virtual const char *IOHandlerGetFixIndentationCharacters() { return nullptr; } - //------------------------------------------------------------------ /// Called when a new line is created or one of an identified set of /// indentation characters is typed. /// @@ -234,14 +227,12 @@ public: /// to correct the indentation level. Positive values indicate /// that spaces should be added, while negative values represent /// spaces that should be removed. - //------------------------------------------------------------------ virtual int IOHandlerFixIndentation(IOHandler &io_handler, const StringList &lines, int cursor_position) { return 0; } - //------------------------------------------------------------------ /// Called when a line or lines have been retrieved. /// /// This function can handle the current line and possibly call @@ -249,14 +240,12 @@ public: /// "quit" is entered as a command, of when an empty line is /// received. It is up to the delegate to determine when a line /// should cause a IOHandler to exit. - //------------------------------------------------------------------ virtual void IOHandlerInputComplete(IOHandler &io_handler, std::string &data) = 0; virtual void IOHandlerInputInterrupted(IOHandler &io_handler, std::string &data) {} - //------------------------------------------------------------------ /// Called to determine whether typing enter after the last line in /// \a lines should end input. This function will not be called on /// IOHandler objects that are getting single lines. @@ -271,7 +260,6 @@ public: /// Return an boolean to indicate whether input is complete, /// true indicates that no additional input is necessary, while /// false indicates that more input is required. - //------------------------------------------------------------------ virtual bool IOHandlerIsInputComplete(IOHandler &io_handler, StringList &lines) { // Impose no requirements for input to be considered complete. subclasses @@ -287,24 +275,20 @@ public: virtual const char *IOHandlerGetHelpPrologue() { return nullptr; } - //------------------------------------------------------------------ // Intercept the IOHandler::Interrupt() calls and do something. // // Return true if the interrupt was handled, false if the IOHandler should // continue to try handle the interrupt itself. - //------------------------------------------------------------------ virtual bool IOHandlerInterrupt(IOHandler &io_handler) { return false; } protected: Completion m_completion; // Support for common builtin completions }; -//---------------------------------------------------------------------- // IOHandlerDelegateMultiline // // A IOHandlerDelegate that handles terminating multi-line input when // the last line is equal to "end_line" which is specified in the constructor. -//---------------------------------------------------------------------- class IOHandlerDelegateMultiline : public IOHandlerDelegate { public: IOHandlerDelegateMultiline(const char *end_line, diff --git a/lldb/include/lldb/Core/Mangled.h b/lldb/include/lldb/Core/Mangled.h index 267c1fc..fb52afd 100644 --- a/lldb/include/lldb/Core/Mangled.h +++ b/lldb/include/lldb/Core/Mangled.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Mangled Mangled.h "lldb/Core/Mangled.h" /// A class that handles mangled names. /// @@ -33,7 +32,6 @@ namespace lldb_private { /// class for their mangled names. Uniqued string pools are used for the /// mangled, demangled, and token string values to allow for faster /// comparisons and for efficient memory use. -//---------------------------------------------------------------------- class Mangled { public: enum NamePreference { @@ -48,14 +46,11 @@ public: eManglingSchemeItanium }; - //---------------------------------------------------------------------- /// Default constructor. /// /// Initialize with both mangled and demangled names empty. - //---------------------------------------------------------------------- Mangled(); - //---------------------------------------------------------------------- /// Construct with name. /// /// Constructor with an optional string and a boolean indicating if it is @@ -67,11 +62,9 @@ public: /// \param[in] is_mangled /// If \b true then \a name is a mangled name, if \b false then /// \a name is demangled. - //---------------------------------------------------------------------- Mangled(ConstString name, bool is_mangled); Mangled(llvm::StringRef name, bool is_mangled); - //---------------------------------------------------------------------- /// Construct with name. /// /// Constructor with an optional string and auto-detect if \a name is @@ -79,20 +72,16 @@ public: /// /// \param[in] name /// The already const name to copy into this object. - //---------------------------------------------------------------------- explicit Mangled(ConstString name); explicit Mangled(llvm::StringRef name); - //---------------------------------------------------------------------- /// Destructor /// /// Releases its ref counts on the mangled and demangled strings that live /// in the global string pool. - //---------------------------------------------------------------------- ~Mangled(); - //---------------------------------------------------------------------- /// Convert to pointer operator. /// /// This allows code to check a Mangled object to see if it contains a valid @@ -107,10 +96,8 @@ public: /// \return /// A pointer to this object if either the mangled or unmangled /// name is set, NULL otherwise. - //---------------------------------------------------------------------- operator void *() const; - //---------------------------------------------------------------------- /// Logical NOT operator. /// /// This allows code to check a Mangled object to see if it contains an @@ -125,15 +112,11 @@ public: /// \return /// Returns \b true if the object has an empty mangled and /// unmangled name, \b false otherwise. - //---------------------------------------------------------------------- bool operator!() const; - //---------------------------------------------------------------------- /// Clear the mangled and demangled values. - //---------------------------------------------------------------------- void Clear(); - //---------------------------------------------------------------------- /// Compare the mangled string values /// /// Compares the Mangled::GetName() string in \a lhs and \a rhs. @@ -148,10 +131,8 @@ public: /// \li -1 if \a lhs is less than \a rhs /// \li 0 if \a lhs is equal to \a rhs /// \li 1 if \a lhs is greater than \a rhs - //---------------------------------------------------------------------- static int Compare(const Mangled &lhs, const Mangled &rhs); - //---------------------------------------------------------------------- /// Dump a description of this object to a Stream \a s. /// /// Dump a Mangled object to stream \a s. We don't force our demangled name @@ -159,54 +140,42 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //---------------------------------------------------------------------- void Dump(Stream *s) const; - //---------------------------------------------------------------------- /// Dump a debug description of this object to a Stream \a s. /// /// \param[in] s /// The stream to which to dump the object description. - //---------------------------------------------------------------------- void DumpDebug(Stream *s) const; - //---------------------------------------------------------------------- /// Demangled name get accessor. /// /// \return /// A const reference to the demangled name string object. - //---------------------------------------------------------------------- ConstString GetDemangledName(lldb::LanguageType language) const; - //---------------------------------------------------------------------- /// Display demangled name get accessor. /// /// \return /// A const reference to the display demangled name string object. - //---------------------------------------------------------------------- ConstString GetDisplayDemangledName(lldb::LanguageType language) const; void SetDemangledName(ConstString name) { m_demangled = name; } void SetMangledName(ConstString name) { m_mangled = name; } - //---------------------------------------------------------------------- /// Mangled name get accessor. /// /// \return /// A reference to the mangled name string object. - //---------------------------------------------------------------------- ConstString &GetMangledName() { return m_mangled; } - //---------------------------------------------------------------------- /// Mangled name get accessor. /// /// \return /// A const reference to the mangled name string object. - //---------------------------------------------------------------------- ConstString GetMangledName() const { return m_mangled; } - //---------------------------------------------------------------------- /// Best name get accessor. /// /// \param[in] preference @@ -216,11 +185,9 @@ public: /// A const reference to the preferred name string object if this /// object has a valid name of that kind, else a const reference to the /// other name is returned. - //---------------------------------------------------------------------- ConstString GetName(lldb::LanguageType language, NamePreference preference = ePreferDemangled) const; - //---------------------------------------------------------------------- /// Check if "name" matches either the mangled or demangled name. /// /// \param[in] name @@ -228,7 +195,6 @@ public: /// /// \return /// \b True if \a name matches either name, \b false otherwise. - //---------------------------------------------------------------------- bool NameMatches(ConstString name, lldb::LanguageType language) const { if (m_mangled == name) return true; @@ -237,7 +203,6 @@ public: bool NameMatches(const RegularExpression ®ex, lldb::LanguageType language) const; - //---------------------------------------------------------------------- /// Get the memory cost of this object. /// /// Return the size in bytes that this object takes in memory. This returns @@ -248,10 +213,8 @@ public: /// The number of bytes that this object occupies in memory. /// /// \see ConstString::StaticMemorySize () - //---------------------------------------------------------------------- size_t MemorySize() const; - //---------------------------------------------------------------------- /// Set the string value in this object. /// /// If \a is_mangled is \b true, then the mangled named is set to \a name, @@ -263,10 +226,8 @@ public: /// \param[in] is_mangled /// If \b true then \a name is a mangled name, if \b false then /// \a name is demangled. - //---------------------------------------------------------------------- void SetValue(ConstString name, bool is_mangled); - //---------------------------------------------------------------------- /// Set the string value in this object. /// /// This version auto detects if the string is mangled by inspecting the @@ -274,10 +235,8 @@ public: /// /// \param[in] name /// The already const version of the name for this object. - //---------------------------------------------------------------------- void SetValue(ConstString name); - //---------------------------------------------------------------------- /// Try to guess the language from the mangling. /// /// For a mangled name to have a language it must have both a mangled and a @@ -292,13 +251,11 @@ public: /// \return /// The language for the mangled/demangled name, eLanguageTypeUnknown /// if there is no mangled or demangled counterpart. - //---------------------------------------------------------------------- lldb::LanguageType GuessLanguage() const; /// Function signature for filtering mangled names. using SkipMangledNameFn = bool(llvm::StringRef, ManglingScheme); - //---------------------------------------------------------------------- /// Trigger explicit demangling to obtain rich mangling information. This is /// optimized for batch processing while populating a name index. To get the /// pure demangled name string for a single entity, use GetDemangledName() @@ -321,14 +278,11 @@ public: /// /// \return /// True on success, false otherwise. - //---------------------------------------------------------------------- bool DemangleWithRichManglingInfo(RichManglingContext &context, SkipMangledNameFn *skip_mangled_name); private: - //---------------------------------------------------------------------- /// Mangled member variables. - //---------------------------------------------------------------------- ConstString m_mangled; ///< The mangled version of the name mutable ConstString m_demangled; ///< Mutable so we can get it on demand with ///a const version of this object diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h index 7359d7b..25b04a3 100644 --- a/lldb/include/lldb/Core/Module.h +++ b/lldb/include/lldb/Core/Module.h @@ -91,7 +91,6 @@ class VariableList; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Module Module.h "lldb/Core/Module.h" /// A class that describes an executable image and its associated /// object and symbol files. @@ -107,7 +106,6 @@ namespace lldb_private { /// Module::GetSymbolVendor() is called. /// /// The module will parse more detailed information as more queries are made. -//---------------------------------------------------------------------- class Module : public std::enable_shared_from_this<Module>, public SymbolContextScope { public: @@ -123,7 +121,6 @@ public: static std::recursive_mutex &GetAllocationModuleCollectionMutex(); - //------------------------------------------------------------------ /// Construct with file specification and architecture. /// /// Clients that wish to share modules with other targets should use @@ -146,7 +143,6 @@ public: /// The offset within an existing module used to extract a /// module within a module (.a files and modules that contain /// multiple architectures). - //------------------------------------------------------------------ Module( const FileSpec &file_spec, const ArchSpec &arch, const ConstString *object_name = nullptr, @@ -178,14 +174,11 @@ public: return module_sp; } - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~Module() override; bool MatchesModuleSpec(const ModuleSpec &module_ref); - //------------------------------------------------------------------ /// Set the load address for all sections in a module to be the file address /// plus \a slide. /// @@ -222,15 +215,12 @@ public: /// \return /// /b True if any sections were successfully loaded in \a target, /// /b false otherwise. - //------------------------------------------------------------------ bool SetLoadAddress(Target &target, lldb::addr_t value, bool value_is_offset, bool &changed); - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void CalculateSymbolContext(SymbolContext *sc) override; lldb::ModuleSP CalculateSymbolContextModule() override; @@ -239,7 +229,6 @@ public: GetDescription(Stream *s, lldb::DescriptionLevel level = lldb::eDescriptionLevelFull); - //------------------------------------------------------------------ /// Get the module path and object name. /// /// Modules can refer to object files. In this case the specification is @@ -257,10 +246,8 @@ public: /// /// \return /// The object path + object name if there is one. - //------------------------------------------------------------------ std::string GetSpecificationDescription() const; - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -270,17 +257,13 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s); - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void DumpSymbolContext(Stream *s) override; - //------------------------------------------------------------------ /// Find a symbol in the object file's symbol table. /// /// \param[in] name @@ -295,7 +278,6 @@ public: /// \return /// Returns a valid symbol pointer if a symbol was found, /// nullptr otherwise. - //------------------------------------------------------------------ const Symbol *FindFirstSymbolWithNameAndType( ConstString name, lldb::SymbolType symbol_type = lldb::eSymbolTypeAny); @@ -308,7 +290,6 @@ public: lldb::SymbolType symbol_type, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Find a function symbols in the object file's symbol table. /// /// \param[in] name @@ -324,11 +305,9 @@ public: /// /// \return /// The number of symbol contexts that were added to \a sc_list - //------------------------------------------------------------------ size_t FindFunctionSymbols(ConstString name, uint32_t name_type_mask, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Find compile units by partial or full path. /// /// Finds all compile units that match \a path in all of the modules and @@ -348,11 +327,9 @@ public: /// /// \return /// The number of matches added to \a sc_list. - //------------------------------------------------------------------ size_t FindCompileUnits(const FileSpec &path, bool append, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Find functions by name. /// /// If the function is an inlined function, it will have a block, @@ -381,14 +358,12 @@ public: /// /// \return /// The number of matches added to \a sc_list. - //------------------------------------------------------------------ size_t FindFunctions(ConstString name, const CompilerDeclContext *parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool symbols_ok, bool inlines_ok, bool append, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Find functions by name. /// /// If the function is an inlined function, it will have a block, @@ -408,12 +383,10 @@ public: /// /// \return /// The number of matches added to \a sc_list. - //------------------------------------------------------------------ size_t FindFunctions(const RegularExpression ®ex, bool symbols_ok, bool inlines_ok, bool append, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Find addresses by file/line /// /// \param[in] target_sp @@ -441,7 +414,6 @@ public: std::vector<Address> &output_local, std::vector<Address> &output_extern); - //------------------------------------------------------------------ /// Find global and static variables by name. /// /// \param[in] name @@ -460,12 +432,10 @@ public: /// /// \return /// The number of matches added to \a variable_list. - //------------------------------------------------------------------ size_t FindGlobalVariables(ConstString name, const CompilerDeclContext *parent_decl_ctx, size_t max_matches, VariableList &variable_list); - //------------------------------------------------------------------ /// Find global and static variables by regular expression. /// /// \param[in] regex @@ -480,11 +450,9 @@ public: /// /// \return /// The number of matches added to \a variable_list. - //------------------------------------------------------------------ size_t FindGlobalVariables(const RegularExpression ®ex, size_t max_matches, VariableList &variable_list); - //------------------------------------------------------------------ /// Find types by name. /// /// Type lookups in modules go through the SymbolVendor (which will use one @@ -518,7 +486,6 @@ public: /// /// \return /// The number of matches added to \a type_list. - //------------------------------------------------------------------ size_t FindTypes(ConstString type_name, bool exact_match, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, @@ -527,7 +494,6 @@ public: lldb::TypeSP FindFirstType(const SymbolContext &sc, ConstString type_name, bool exact_match); - //------------------------------------------------------------------ /// Find types by name that are in a namespace. This function is used by the /// expression parser when searches need to happen in an exact namespace /// scope. @@ -544,20 +510,16 @@ public: /// /// \return /// The number of matches added to \a type_list. - //------------------------------------------------------------------ size_t FindTypesInNamespace(ConstString type_name, const CompilerDeclContext *parent_decl_ctx, size_t max_matches, TypeList &type_list); - //------------------------------------------------------------------ /// Get const accessor for the module architecture. /// /// \return /// A const reference to the architecture object. - //------------------------------------------------------------------ const ArchSpec &GetArchitecture() const; - //------------------------------------------------------------------ /// Get const accessor for the module file specification. /// /// This function returns the file for the module on the host system that is @@ -566,10 +528,8 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ const FileSpec &GetFileSpec() const { return m_file; } - //------------------------------------------------------------------ /// Get accessor for the module platform file specification. /// /// Platform file refers to the path of the module as it is known on the @@ -582,7 +542,6 @@ public: /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ const FileSpec &GetPlatformFileSpec() const { if (m_platform_file) return m_platform_file; @@ -617,16 +576,13 @@ public: m_mod_time = mod_time; } - //------------------------------------------------------------------ /// Tells whether this module is capable of being the main executable for a /// process. /// /// \return /// \b true if it is, \b false otherwise. - //------------------------------------------------------------------ bool IsExecutable(); - //------------------------------------------------------------------ /// Tells whether this module has been loaded in the target passed in. This /// call doesn't distinguish between whether the module is loaded by the /// dynamic loader, or by a "target module add" type call. @@ -636,19 +592,16 @@ public: /// /// \return /// \b true if it is, \b false otherwise. - //------------------------------------------------------------------ bool IsLoadedInTarget(Target *target); bool LoadScriptingResourceInTarget(Target *target, Status &error, Stream *feedback_stream = nullptr); - //------------------------------------------------------------------ /// Get the number of compile units for this module. /// /// \return /// The number of compile units that the symbol vendor plug-in /// finds. - //------------------------------------------------------------------ size_t GetNumCompileUnits(); lldb::CompUnitSP GetCompileUnitAtIndex(size_t idx); @@ -657,7 +610,6 @@ public: uint64_t GetObjectOffset() const { return m_object_offset; } - //------------------------------------------------------------------ /// Get the object file representation for the current architecture. /// /// If the object file has not been located or parsed yet, this function @@ -670,10 +622,8 @@ public: /// returned, else a valid object file interface will be /// returned. The returned pointer is owned by this object and /// remains valid as long as the object is around. - //------------------------------------------------------------------ virtual ObjectFile *GetObjectFile(); - //------------------------------------------------------------------ /// Get the unified section list for the module. This is the section list /// created by the module's object file and any debug info and symbol files /// created by the symbol vendor. @@ -683,10 +633,8 @@ public: /// /// \return /// Unified module section list. - //------------------------------------------------------------------ virtual SectionList *GetSectionList(); - //------------------------------------------------------------------ /// Notify the module that the file addresses for the Sections have been /// updated. /// @@ -694,10 +642,8 @@ public: /// should be called. Any parts of the module, object file, or symbol file /// that has cached those file addresses must invalidate or update its /// cache. - //------------------------------------------------------------------ virtual void SectionFileAddressesChanged(); - //------------------------------------------------------------------ /// Returns a reference to the UnwindTable for this Module /// /// The UnwindTable contains FuncUnwinders objects for any function in this @@ -709,12 +655,10 @@ public: /// \return /// Returns the unwind table for this module. If this object has no /// associated object file, an empty UnwindTable is returned. - //------------------------------------------------------------------ UnwindTable &GetUnwindTable(); llvm::VersionTuple GetVersion(); - //------------------------------------------------------------------ /// Load an object file from memory. /// /// If available, the size of the object file in memory may be passed to @@ -726,11 +670,9 @@ public: /// \return /// The object file loaded from memory or nullptr, if the operation /// failed (see the `error` for more information in that case). - //------------------------------------------------------------------ ObjectFile *GetMemoryObjectFile(const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, Status &error, size_t size_to_read = 512); - //------------------------------------------------------------------ /// Get the symbol vendor interface for the current architecture. /// /// If the symbol vendor file has not been located yet, this function will @@ -742,21 +684,17 @@ public: /// be returned, else a valid symbol vendor plug-in interface /// will be returned. The returned pointer is owned by this /// object and remains valid as long as the object is around. - //------------------------------------------------------------------ virtual SymbolVendor * GetSymbolVendor(bool can_create = true, lldb_private::Stream *feedback_strm = nullptr); - //------------------------------------------------------------------ /// Get accessor the type list for this module. /// /// \return /// A valid type list pointer, or nullptr if there is no valid /// symbol vendor for this module. - //------------------------------------------------------------------ TypeList *GetTypeList(); - //------------------------------------------------------------------ /// Get a reference to the UUID value contained in this object. /// /// If the executable image file doesn't not have a UUID value built into @@ -767,10 +705,8 @@ public: /// A const pointer to the internal copy of the UUID value in /// this module if this module has a valid UUID value, NULL /// otherwise. - //------------------------------------------------------------------ const lldb_private::UUID &GetUUID(); - //------------------------------------------------------------------ /// A debugging function that will cause everything in a module to /// be parsed. /// @@ -781,12 +717,10 @@ public: /// complete list of the resulting debug information that gets parsed, or as /// a debug function to ensure that the module can consume all of the debug /// data the symbol vendor provides. - //------------------------------------------------------------------ void ParseAllDebugSymbols(); bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr); - //------------------------------------------------------------------ /// Resolve the symbol context for the given address. /// /// Tries to resolve the matching symbol context based on a lookup from the @@ -824,12 +758,10 @@ public: /// The scope that has been resolved (see SymbolContext::Scope). /// /// \see SymbolContext::Scope - //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress( const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc, bool resolve_tail_call_address = false); - //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. /// /// Tries to resolve \a file_path and \a line to a list of matching symbol @@ -869,12 +801,10 @@ public: /// The number of matches that were added to \a sc_list. /// /// \see SymbolContext::Scope - //------------------------------------------------------------------ uint32_t ResolveSymbolContextForFilePath( const char *file_path, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. /// /// Tries to resolve \a file_spec and \a line to a list of matching symbol @@ -915,7 +845,6 @@ public: /// each item that was successfully resolved. /// /// \see SymbolContext::Scope - //------------------------------------------------------------------ uint32_t ResolveSymbolContextsForFileSpec( const FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); @@ -949,17 +878,13 @@ public: void ReportErrorIfModifyDetected(const char *format, ...) __attribute__((format(printf, 2, 3))); - //------------------------------------------------------------------ // Return true if the file backing this module has changed since the module // was originally created since we saved the initial file modification time // when the module first gets created. - //------------------------------------------------------------------ bool FileHasChanged() const; - //------------------------------------------------------------------ // SymbolVendor, SymbolFile and ObjectFile member objects should lock the // module mutex to avoid deadlocks. - //------------------------------------------------------------------ std::recursive_mutex &GetMutex() const { return m_mutex; } PathMappingList &GetSourceMappingList() { return m_source_mappings; } @@ -968,7 +893,6 @@ public: return m_source_mappings; } - //------------------------------------------------------------------ /// Finds a source file given a file spec using the module source path /// remappings (if any). /// @@ -987,10 +911,8 @@ public: /// /b true if \a orig_spec was successfully located and /// \a new_spec is filled in with an existing file spec, /// \b false otherwise. - //------------------------------------------------------------------ bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const; - //------------------------------------------------------------------ /// Remaps a source file given \a path into \a new_path. /// /// Remaps \a path if any source remappings match. This function does NOT @@ -1006,11 +928,9 @@ public: /// \return /// /b true if \a path was successfully located and \a new_path /// is filled in with a new source path, \b false otherwise. - //------------------------------------------------------------------ bool RemapSourceFile(llvm::StringRef path, std::string &new_path) const; bool RemapSourceFile(const char *, std::string &) const = delete; - //---------------------------------------------------------------------- /// \class LookupInfo Module.h "lldb/Core/Module.h" /// A class that encapsulates name lookup information. /// @@ -1032,7 +952,6 @@ public: /// Function lookups are done in Module.cpp, ModuleList.cpp and in /// BreakpointResolverName.cpp and they all now use this class to do lookups /// correctly. - //---------------------------------------------------------------------- class LookupInfo { public: LookupInfo() @@ -1079,9 +998,7 @@ public: }; protected: - //------------------------------------------------------------------ // Member Variables - //------------------------------------------------------------------ mutable std::recursive_mutex m_mutex; ///< A mutex to keep this object happy ///in multi-threaded environments. @@ -1136,7 +1053,6 @@ protected: m_first_file_changed_log : 1; /// See if the module was modified after it /// was initially opened. - //------------------------------------------------------------------ /// Resolve a file or load virtual address. /// /// Tries to resolve \a vm_addr as a file address (if \a @@ -1169,7 +1085,6 @@ protected: /// each item that was successfully resolved. /// /// \see SymbolContext::Scope - //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress(lldb::addr_t vm_addr, bool vm_addr_is_file_addr, lldb::SymbolContextItem resolve_scope, diff --git a/lldb/include/lldb/Core/ModuleChild.h b/lldb/include/lldb/Core/ModuleChild.h index 805ab99..e63abcc 100644 --- a/lldb/include/lldb/Core/ModuleChild.h +++ b/lldb/include/lldb/Core/ModuleChild.h @@ -13,36 +13,27 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ModuleChild ModuleChild.h "lldb/Core/ModuleChild.h" /// A mix in class that contains a pointer back to the module /// that owns the object which inherits from it. -//---------------------------------------------------------------------- class ModuleChild { public: - //------------------------------------------------------------------ /// Construct with owning module. /// /// \param[in] module /// The module that owns the object that inherits from this /// class. - //------------------------------------------------------------------ ModuleChild(const lldb::ModuleSP &module_sp); - //------------------------------------------------------------------ /// Copy constructor. /// /// \param[in] rhs /// A const ModuleChild class reference to copy. - //------------------------------------------------------------------ ModuleChild(const ModuleChild &rhs); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~ModuleChild(); - //------------------------------------------------------------------ /// Assignment operator. /// /// \param[in] rhs @@ -50,31 +41,24 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ const ModuleChild &operator=(const ModuleChild &rhs); - //------------------------------------------------------------------ /// Get const accessor for the module pointer. /// /// \return /// A const pointer to the module that owns the object that /// inherits from this class. - //------------------------------------------------------------------ lldb::ModuleSP GetModule() const; - //------------------------------------------------------------------ /// Set accessor for the module pointer. /// /// \param[in] module /// A new module that owns the object that inherits from this /// class. - //------------------------------------------------------------------ void SetModule(const lldb::ModuleSP &module_sp); protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ lldb::ModuleWP m_module_wp; ///< The Module that owns the object that inherits ///< from this class. }; diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 9c24794..0db9bfd 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -83,13 +83,11 @@ public: bool GetEnableExternalLookup() const; }; -//---------------------------------------------------------------------- /// \class ModuleList ModuleList.h "lldb/Core/ModuleList.h" /// A collection class for Module objects. /// /// Modules in the module collection class are stored as reference counted /// shared pointers to Module objects. -//---------------------------------------------------------------------- class ModuleList { public: class Notifier { @@ -108,31 +106,24 @@ public: virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list) = 0; }; - //------------------------------------------------------------------ /// Default constructor. /// /// Creates an empty list of Module objects. - //------------------------------------------------------------------ ModuleList(); - //------------------------------------------------------------------ /// Copy Constructor. /// /// Creates a new module list object with a copy of the modules from \a rhs. /// /// \param[in] rhs /// Another module list object. - //------------------------------------------------------------------ ModuleList(const ModuleList &rhs); ModuleList(ModuleList::Notifier *notifier); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~ModuleList(); - //------------------------------------------------------------------ /// Assignment operator. /// /// Copies the module list from \a rhs into this list. @@ -142,10 +133,8 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ const ModuleList &operator=(const ModuleList &rhs); - //------------------------------------------------------------------ /// Append a module to the module list. /// /// \param[in] module_sp @@ -160,10 +149,8 @@ public: /// ModulesDidLoad may be deferred when adding multiple Modules /// to the Target, but it must be called at the end, /// before resuming execution. - //------------------------------------------------------------------ void Append(const lldb::ModuleSP &module_sp, bool notify = true); - //------------------------------------------------------------------ /// Append a module to the module list and remove any equivalent modules. /// Equivalent modules are ones whose file, platform file and architecture /// matches. @@ -172,10 +159,8 @@ public: /// /// \param[in] module_sp /// A shared pointer to a module to replace in this collection. - //------------------------------------------------------------------ void ReplaceEquivalent(const lldb::ModuleSP &module_sp); - //------------------------------------------------------------------ /// Append a module to the module list, if it is not already there. /// /// \param[in] module_sp @@ -189,7 +174,6 @@ public: /// ModulesDidLoad may be deferred when adding multiple Modules /// to the Target, but it must be called at the end, /// before resuming execution. - //------------------------------------------------------------------ bool AppendIfNeeded(const lldb::ModuleSP &module_sp, bool notify = true); void Append(const ModuleList &module_list); @@ -199,26 +183,21 @@ public: bool ReplaceModule(const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Clears the list of modules and releases a reference to each module /// object and if the reference count goes to zero, the module will be /// deleted. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Clears the list of modules and releases a reference to each module /// object and if the reference count goes to zero, the module will be /// deleted. Also release all memory that might be held by any collection /// classes (like std::vector) - //------------------------------------------------------------------ void Destroy(); - //------------------------------------------------------------------ /// Dump the description of each module contained in this list. /// /// Dump the description of each module contained in this list to the @@ -228,7 +207,6 @@ public: /// The stream to which to dump the object description. /// /// \see Module::Dump(Stream *) const - //------------------------------------------------------------------ void Dump(Stream *s) const; void LogUUIDAndPaths(Log *log, const char *prefix_cstr); @@ -237,7 +215,6 @@ public: size_t GetIndexForModule(const Module *module) const; - //------------------------------------------------------------------ /// Get the module shared pointer for the module at index \a idx. /// /// \param[in] idx @@ -248,10 +225,8 @@ public: /// \a idx is out of range. /// /// \see ModuleList::GetSize() - //------------------------------------------------------------------ lldb::ModuleSP GetModuleAtIndex(size_t idx) const; - //------------------------------------------------------------------ /// Get the module shared pointer for the module at index \a idx without /// acquiring the ModuleList mutex. This MUST already have been acquired /// with ModuleList::GetMutex and locked for this call to be safe. @@ -264,10 +239,8 @@ public: /// \a idx is out of range. /// /// \see ModuleList::GetSize() - //------------------------------------------------------------------ lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const; - //------------------------------------------------------------------ /// Get the module pointer for the module at index \a idx. /// /// \param[in] idx @@ -278,10 +251,8 @@ public: /// of range. /// /// \see ModuleList::GetSize() - //------------------------------------------------------------------ Module *GetModulePointerAtIndex(size_t idx) const; - //------------------------------------------------------------------ /// Get the module pointer for the module at index \a idx without acquiring /// the ModuleList mutex. This MUST already have been acquired with /// ModuleList::GetMutex and locked for this call to be safe. @@ -294,10 +265,8 @@ public: /// of range. /// /// \see ModuleList::GetSize() - //------------------------------------------------------------------ Module *GetModulePointerAtIndexUnlocked(size_t idx) const; - //------------------------------------------------------------------ /// Find compile units by partial or full path. /// /// Finds all compile units that match \a path in all of the modules and @@ -317,33 +286,25 @@ public: /// /// \return /// The number of matches added to \a sc_list. - //------------------------------------------------------------------ size_t FindCompileUnits(const FileSpec &path, bool append, SymbolContextList &sc_list) const; - //------------------------------------------------------------------ /// \see Module::FindFunctions () - //------------------------------------------------------------------ size_t FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, bool include_symbols, bool include_inlines, bool append, SymbolContextList &sc_list) const; - //------------------------------------------------------------------ /// \see Module::FindFunctionSymbols () - //------------------------------------------------------------------ size_t FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// \see Module::FindFunctions () - //------------------------------------------------------------------ size_t FindFunctions(const RegularExpression &name, bool include_symbols, bool include_inlines, bool append, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Find global and static variables by name. /// /// \param[in] name @@ -359,11 +320,9 @@ public: /// /// \return /// The number of matches added to \a variable_list. - //------------------------------------------------------------------ size_t FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const; - //------------------------------------------------------------------ /// Find global and static variables by regular expression. /// /// \param[in] regex @@ -378,11 +337,9 @@ public: /// /// \return /// The number of matches added to \a variable_list. - //------------------------------------------------------------------ size_t FindGlobalVariables(const RegularExpression ®ex, size_t max_matches, VariableList &variable_list) const; - //------------------------------------------------------------------ /// Finds the first module whose file specification matches \a file_spec. /// /// \param[in] file_spec_ptr @@ -411,19 +368,16 @@ public: /// /// \return /// The number of matching modules found by the search. - //------------------------------------------------------------------ size_t FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const; lldb::ModuleSP FindModule(const Module *module_ptr) const; - //------------------------------------------------------------------ // Find a module by UUID // // The UUID value for a module is extracted from the ObjectFile and is the // MD5 checksum, or a smarter object file equivalent, so finding modules by // UUID values is very efficient and accurate. - //------------------------------------------------------------------ lldb::ModuleSP FindModule(const UUID &uuid) const; lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const; @@ -438,7 +392,6 @@ public: SymbolContextList &sc_list, bool append = false) const; - //------------------------------------------------------------------ /// Find types by name. /// /// \param[in] search_first @@ -470,7 +423,6 @@ public: /// /// \return /// The number of matches added to \a type_list. - //------------------------------------------------------------------ size_t FindTypes(Module *search_first, ConstString name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet<SymbolFile *> &searched_symbol_files, @@ -478,7 +430,6 @@ public: bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const; - //------------------------------------------------------------------ /// Find addresses by file/line /// /// \param[in] target_sp @@ -506,7 +457,6 @@ public: std::vector<Address> &output_local, std::vector<Address> &output_extern); - //------------------------------------------------------------------ /// Remove a module from the module list. /// /// \param[in] module_sp @@ -521,7 +471,6 @@ public: /// ModulesDidUnload may be deferred when removing multiple Modules /// from the Target, but it must be called at the end, /// before resuming execution. - //------------------------------------------------------------------ bool Remove(const lldb::ModuleSP &module_sp, bool notify = true); size_t Remove(ModuleList &module_list); @@ -532,36 +481,28 @@ public: bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const; - //------------------------------------------------------------------ /// \copydoc Module::ResolveSymbolContextForAddress (const Address /// &,uint32_t,SymbolContext&) - //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const; - //------------------------------------------------------------------ /// \copydoc Module::ResolveSymbolContextForFilePath (const char /// *,uint32_t,bool,uint32_t,SymbolContextList&) - //------------------------------------------------------------------ uint32_t ResolveSymbolContextForFilePath( const char *file_path, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const; - //------------------------------------------------------------------ /// \copydoc Module::ResolveSymbolContextsForFileSpec (const FileSpec /// &,uint32_t,bool,uint32_t,SymbolContextList&) - //------------------------------------------------------------------ uint32_t ResolveSymbolContextsForFileSpec( const FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const; - //------------------------------------------------------------------ /// Gets the size of the module list. /// /// \return /// The number of modules in the module list. - //------------------------------------------------------------------ size_t GetSize() const; bool LoadScriptingResourcesInTarget(Target *target, std::list<Status> &errors, @@ -592,9 +533,7 @@ public: &callback) const; protected: - //------------------------------------------------------------------ // Class typedefs. - //------------------------------------------------------------------ typedef std::vector<lldb::ModuleSP> collection; ///< The module collection type. @@ -607,9 +546,7 @@ protected: void ClearImpl(bool use_notifier = true); - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ collection m_modules; ///< The collection of modules. mutable std::recursive_mutex m_modules_mutex; diff --git a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h index 0cf35f2..37e287f 100644 --- a/lldb/include/lldb/Core/PluginManager.h +++ b/lldb/include/lldb/Core/PluginManager.h @@ -40,9 +40,7 @@ public: static void Terminate(); - //------------------------------------------------------------------ // ABI - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, ABICreateInstance create_callback); @@ -53,9 +51,7 @@ public: static ABICreateInstance GetABICreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // Architecture - //------------------------------------------------------------------ using ArchitectureCreateInstance = std::unique_ptr<Architecture> (*)(const ArchSpec &); @@ -68,9 +64,7 @@ public: static std::unique_ptr<Architecture> CreateArchitectureInstance(const ArchSpec &arch); - //------------------------------------------------------------------ // Disassembler - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, DisassemblerCreateInstance create_callback); @@ -82,9 +76,7 @@ public: static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // DynamicLoader - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, DynamicLoaderCreateInstance create_callback, @@ -98,9 +90,7 @@ public: static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // JITLoader - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, JITLoaderCreateInstance create_callback, @@ -114,9 +104,7 @@ public: static JITLoaderCreateInstance GetJITLoaderCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // EmulateInstruction - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, EmulateInstructionCreateInstance create_callback); @@ -129,9 +117,7 @@ public: static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // OperatingSystem - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, OperatingSystemCreateInstance create_callback, DebuggerInitializeCallback debugger_init_callback); @@ -144,9 +130,7 @@ public: static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // Language - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, LanguageCreateInstance create_callback); @@ -157,9 +141,7 @@ public: static LanguageCreateInstance GetLanguageCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // LanguageRuntime - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, LanguageRuntimeCreateInstance create_callback, @@ -176,9 +158,7 @@ public: static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // SystemRuntime - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, SystemRuntimeCreateInstance create_callback); @@ -190,9 +170,7 @@ public: static SystemRuntimeCreateInstance GetSystemRuntimeCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // ObjectFile - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, ObjectFileCreateInstance create_callback, @@ -220,9 +198,7 @@ public: static Status SaveCore(const lldb::ProcessSP &process_sp, const FileSpec &outfile); - //------------------------------------------------------------------ // ObjectContainer - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, ObjectContainerCreateInstance create_callback, @@ -239,9 +215,7 @@ public: static ObjectFileGetModuleSpecifications GetObjectContainerGetModuleSpecificationsCallbackAtIndex(uint32_t idx); - //------------------------------------------------------------------ // Platform - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, PlatformCreateInstance create_callback, @@ -260,9 +234,7 @@ public: static size_t AutoCompletePlatformName(llvm::StringRef partial_name, StringList &matches); - //------------------------------------------------------------------ // Process - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, ProcessCreateInstance create_callback, @@ -279,9 +251,7 @@ public: static const char *GetProcessPluginDescriptionAtIndex(uint32_t idx); - //------------------------------------------------------------------ // ScriptInterpreter - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, lldb::ScriptLanguage script_lang, ScriptInterpreterCreateInstance create_callback); @@ -295,11 +265,8 @@ public: GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang, CommandInterpreter &interpreter); - //------------------------------------------------------------------ // StructuredDataPlugin - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Register a StructuredDataPlugin class along with optional /// callbacks for debugger initialization and Process launch info /// filtering and manipulation. @@ -332,7 +299,6 @@ public: /// /// \return /// Returns true upon success; otherwise, false. - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, StructuredDataPluginCreateInstance create_callback, @@ -352,9 +318,7 @@ public: GetStructuredDataFilterCallbackAtIndex(uint32_t idx, bool &iteration_complete); - //------------------------------------------------------------------ // SymbolFile - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, SymbolFileCreateInstance create_callback, @@ -368,9 +332,7 @@ public: static SymbolFileCreateInstance GetSymbolFileCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // SymbolVendor - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, SymbolVendorCreateInstance create_callback); @@ -382,9 +344,7 @@ public: static SymbolVendorCreateInstance GetSymbolVendorCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // UnwindAssembly - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, UnwindAssemblyCreateInstance create_callback); @@ -396,9 +356,7 @@ public: static UnwindAssemblyCreateInstance GetUnwindAssemblyCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // MemoryHistory - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, MemoryHistoryCreateInstance create_callback); @@ -410,9 +368,7 @@ public: static MemoryHistoryCreateInstance GetMemoryHistoryCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // InstrumentationRuntime - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, InstrumentationRuntimeCreateInstance create_callback, @@ -430,9 +386,7 @@ public: static InstrumentationRuntimeCreateInstance GetInstrumentationRuntimeCreateCallbackForPluginName(ConstString name); - //------------------------------------------------------------------ // TypeSystem - //------------------------------------------------------------------ static bool RegisterPlugin( ConstString name, const char *description, TypeSystemCreateInstance create_callback, @@ -453,9 +407,7 @@ public: GetTypeSystemEnumerateSupportedLanguagesCallbackForPluginName( ConstString name); - //------------------------------------------------------------------ // REPL - //------------------------------------------------------------------ static bool RegisterPlugin(ConstString name, const char *description, REPLCreateInstance create_callback, @@ -475,13 +427,11 @@ public: GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName( ConstString name); - //------------------------------------------------------------------ // Some plug-ins might register a DebuggerInitializeCallback callback when // registering the plug-in. After a new Debugger instance is created, this // DebuggerInitialize function will get called. This allows plug-ins to // install Properties and do any other initialization that requires a // debugger instance. - //------------------------------------------------------------------ static void DebuggerInitialize(Debugger &debugger); static lldb::OptionValuePropertiesSP diff --git a/lldb/include/lldb/Core/STLUtils.h b/lldb/include/lldb/Core/STLUtils.h index 9e63055..830aca3 100644 --- a/lldb/include/lldb/Core/STLUtils.h +++ b/lldb/include/lldb/Core/STLUtils.h @@ -16,28 +16,22 @@ #include <vector> -//---------------------------------------------------------------------- // C string less than compare function object -//---------------------------------------------------------------------- struct CStringCompareFunctionObject { bool operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) < 0; } }; -//---------------------------------------------------------------------- // C string equality function object (binary predicate). -//---------------------------------------------------------------------- struct CStringEqualBinaryPredicate { bool operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) == 0; } }; -//---------------------------------------------------------------------- // Templated type for finding an entry in a std::map<F,S> whose value is equal // to something -//---------------------------------------------------------------------- template <class F, class S> class ValueEquals { public: ValueEquals(const S &val) : second_value(val) {} diff --git a/lldb/include/lldb/Core/SearchFilter.h b/lldb/include/lldb/Core/SearchFilter.h index e515115..82c36c5 100644 --- a/lldb/include/lldb/Core/SearchFilter.h +++ b/lldb/include/lldb/Core/SearchFilter.h @@ -50,16 +50,12 @@ class Target; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Searcher SearchFilter.h "lldb/Core/SearchFilter.h" Class that is /// driven by the SearchFilter to search the SymbolContext space of the target /// program. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// Provides the callback and search depth for the SearchFilter search. -//---------------------------------------------------------------------- class Searcher { public: @@ -79,23 +75,18 @@ public: virtual lldb::SearchDepth GetDepth() = 0; - //------------------------------------------------------------------ /// Prints a canonical description for the searcher to the stream \a s. /// /// \param[in] s /// Stream to which the output is copied. - //------------------------------------------------------------------ virtual void GetDescription(Stream *s); }; -//---------------------------------------------------------------------- /// \class SearchFilter SearchFilter.h "lldb/Core/SearchFilter.h" Class /// descends through the SymbolContext space of the target, applying a filter /// at each stage till it reaches the depth specified by the GetDepth method /// of the searcher, and calls its callback at that point. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- /// General Outline: /// Provides the callback and search depth for the SearchFilter search. /// @@ -106,16 +97,13 @@ public: /// that since the resolution of the Searcher may be greater than that of the /// SearchFilter, before the Searcher qualifies an address it should pass it /// to "AddressPasses." The default implementation is "Everything Passes." -//---------------------------------------------------------------------- class SearchFilter { public: - //------------------------------------------------------------------ /// The basic constructor takes a Target, which gives the space to search. /// /// \param[in] target /// The Target that provides the module list to search. - //------------------------------------------------------------------ SearchFilter(const lldb::TargetSP &target_sp); SearchFilter(const SearchFilter &rhs); @@ -126,17 +114,14 @@ public: SearchFilter &operator=(const SearchFilter &rhs); - //------------------------------------------------------------------ /// Call this method with a file spec to see if that spec passes the filter. /// /// \param[in] spec /// The file spec to check against the filter. /// \return /// \b true if \a spec passes, and \b false otherwise. - //------------------------------------------------------------------ virtual bool ModulePasses(const FileSpec &spec); - //------------------------------------------------------------------ /// Call this method with a Module to see if that module passes the filter. /// /// \param[in] module @@ -144,10 +129,8 @@ public: /// /// \return /// \b true if \a module passes, and \b false otherwise. - //------------------------------------------------------------------ virtual bool ModulePasses(const lldb::ModuleSP &module_sp); - //------------------------------------------------------------------ /// Call this method with a Address to see if \a address passes the filter. /// /// \param[in] addr @@ -155,10 +138,8 @@ public: /// /// \return /// \b true if \a address passes, and \b false otherwise. - //------------------------------------------------------------------ virtual bool AddressPasses(Address &addr); - //------------------------------------------------------------------ /// Call this method with a FileSpec to see if \a file spec passes the /// filter as the name of a compilation unit. /// @@ -167,10 +148,8 @@ public: /// /// \return /// \b true if \a file spec passes, and \b false otherwise. - //------------------------------------------------------------------ virtual bool CompUnitPasses(FileSpec &fileSpec); - //------------------------------------------------------------------ /// Call this method with a CompileUnit to see if \a comp unit passes the /// filter. /// @@ -179,10 +158,8 @@ public: /// /// \return /// \b true if \a Comp Unit passes, and \b false otherwise. - //------------------------------------------------------------------ virtual bool CompUnitPasses(CompileUnit &compUnit); - //------------------------------------------------------------------ /// Call this method with a Function to see if \a function passes the /// filter. /// @@ -191,19 +168,15 @@ public: /// /// \return /// \b true if \a function passes, and \b false otherwise. - //------------------------------------------------------------------ virtual bool FunctionPasses(Function &function); - //------------------------------------------------------------------ /// Call this method to do the search using the Searcher. /// /// \param[in] searcher /// The searcher to drive with this search. /// - //------------------------------------------------------------------ virtual void Search(Searcher &searcher); - //------------------------------------------------------------------ /// Call this method to do the search using the Searcher in the module list /// \a modules. /// @@ -213,10 +186,8 @@ public: /// \param[in] modules /// The module list within which to restrict the search. /// - //------------------------------------------------------------------ virtual void SearchInModuleList(Searcher &searcher, ModuleList &modules); - //------------------------------------------------------------------ /// This determines which items are REQUIRED for the filter to pass. For /// instance, if you are filtering by Compilation Unit, obviously symbols /// that have no compilation unit can't pass So return eSymbolContextCU and @@ -227,20 +198,15 @@ public: /// The required elements for the search, which is an or'ed together /// set of lldb:SearchContextItem enum's. /// - //------------------------------------------------------------------ virtual uint32_t GetFilterRequiredItems(); - //------------------------------------------------------------------ /// Prints a canonical description for the search filter to the stream \a s. /// /// \param[in] s /// Stream to which the output is copied. - //------------------------------------------------------------------ virtual void GetDescription(Stream *s); - //------------------------------------------------------------------ /// Standard "Dump" method. At present it does nothing. - //------------------------------------------------------------------ virtual void Dump(Stream *s) const; lldb::SearchFilterSP CopyForBreakpoint(Breakpoint &breakpoint); @@ -328,12 +294,10 @@ private: unsigned char SubclassID; }; -//---------------------------------------------------------------------- /// \class SearchFilterForUnconstrainedSearches SearchFilter.h /// "lldb/Core/SearchFilter.h" This is a SearchFilter that searches through /// all modules. It also consults the /// Target::ModuleIsExcludedForUnconstrainedSearches. -//---------------------------------------------------------------------- class SearchFilterForUnconstrainedSearches : public SearchFilter { public: SearchFilterForUnconstrainedSearches(const lldb::TargetSP &target_sp) @@ -356,14 +320,11 @@ protected: lldb::SearchFilterSP DoCopyForBreakpoint(Breakpoint &breakpoint) override; }; -//---------------------------------------------------------------------- /// \class SearchFilterByModule SearchFilter.h "lldb/Core/SearchFilter.h" This /// is a SearchFilter that restricts the search to a given module. -//---------------------------------------------------------------------- class SearchFilterByModule : public SearchFilter { public: - //------------------------------------------------------------------ /// The basic constructor takes a Target, which gives the space to search, /// and the module to restrict the search to. /// @@ -372,7 +333,6 @@ public: /// /// \param[in] module /// The Module that limits the search. - //------------------------------------------------------------------ SearchFilterByModule(const lldb::TargetSP &targetSP, const FileSpec &module); SearchFilterByModule(const SearchFilterByModule &rhs); @@ -415,7 +375,6 @@ private: class SearchFilterByModuleList : public SearchFilter { public: - //------------------------------------------------------------------ /// The basic constructor takes a Target, which gives the space to search, /// and the module list to restrict the search to. /// @@ -424,7 +383,6 @@ public: /// /// \param[in] module /// The Module that limits the search. - //------------------------------------------------------------------ SearchFilterByModuleList(const lldb::TargetSP &targetSP, const FileSpecList &module_list); @@ -474,7 +432,6 @@ protected: class SearchFilterByModuleListAndCU : public SearchFilterByModuleList { public: - //------------------------------------------------------------------ /// The basic constructor takes a Target, which gives the space to search, /// and the module list to restrict the search to. /// @@ -483,7 +440,6 @@ public: /// /// \param[in] module /// The Module that limits the search. - //------------------------------------------------------------------ SearchFilterByModuleListAndCU(const lldb::TargetSP &targetSP, const FileSpecList &module_list, const FileSpecList &cu_list); diff --git a/lldb/include/lldb/Core/Section.h b/lldb/include/lldb/Core/Section.h index 6ba3b93..77a5d54 100644 --- a/lldb/include/lldb/Core/Section.h +++ b/lldb/include/lldb/Core/Section.h @@ -189,20 +189,15 @@ public: void SetIsThreadSpecific(bool b) { m_thread_specific = b; } - //------------------------------------------------------------------ /// Get the permissions as OR'ed bits from lldb::Permissions - //------------------------------------------------------------------ uint32_t GetPermissions() const; - //------------------------------------------------------------------ /// Set the permissions using bits OR'ed from lldb::Permissions - //------------------------------------------------------------------ void SetPermissions(uint32_t permissions); ObjectFile *GetObjectFile() { return m_obj_file; } const ObjectFile *GetObjectFile() const { return m_obj_file; } - //------------------------------------------------------------------ /// Read the section data from the object file that the section /// resides in. /// @@ -220,11 +215,9 @@ public: /// The number of bytes read from the section, or zero if the /// section has no data or \a offset is not a valid offset /// in this section. - //------------------------------------------------------------------ lldb::offset_t GetSectionData(void *dst, lldb::offset_t dst_len, lldb::offset_t offset = 0); - //------------------------------------------------------------------ /// Get the shared reference to the section data from the object /// file that the section resides in. No copies of the data will be /// make unless the object file has been read from memory. If the @@ -238,7 +231,6 @@ public: /// The number of bytes read from the section, or zero if the /// section has no data or \a offset is not a valid offset /// in this section. - //------------------------------------------------------------------ lldb::offset_t GetSectionData(DataExtractor &data); uint32_t GetLog2Align() { return m_log2align; } diff --git a/lldb/include/lldb/Core/SourceManager.h b/lldb/include/lldb/Core/SourceManager.h index 0426efc..ed5bf2e 100644 --- a/lldb/include/lldb/Core/SourceManager.h +++ b/lldb/include/lldb/Core/SourceManager.h @@ -117,9 +117,7 @@ public: FileCache m_file_cache; }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ // A source manager can be made with a non-null target, in which case it can // use the path remappings to find // source files that are not in their build locations. With no target it diff --git a/lldb/include/lldb/Core/StreamFile.h b/lldb/include/lldb/Core/StreamFile.h index 4941e99..54aeab1 100644 --- a/lldb/include/lldb/Core/StreamFile.h +++ b/lldb/include/lldb/Core/StreamFile.h @@ -21,9 +21,7 @@ namespace lldb_private { class StreamFile : public Stream { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StreamFile(); StreamFile(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); @@ -47,9 +45,7 @@ public: protected: - //------------------------------------------------------------------ // Classes that inherit from StreamFile can see and modify these - //------------------------------------------------------------------ File m_file; size_t WriteImpl(const void *s, size_t length) override; diff --git a/lldb/include/lldb/Core/ThreadSafeSTLMap.h b/lldb/include/lldb/Core/ThreadSafeSTLMap.h index cc5a716..df0208c 100644 --- a/lldb/include/lldb/Core/ThreadSafeSTLMap.h +++ b/lldb/include/lldb/Core/ThreadSafeSTLMap.h @@ -21,9 +21,7 @@ public: typedef std::map<_Key, _Tp> collection; typedef typename collection::iterator iterator; typedef typename collection::const_iterator const_iterator; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ThreadSafeSTLMap() : m_collection(), m_mutex() {} ~ThreadSafeSTLMap() {} @@ -121,9 +119,7 @@ private: collection m_collection; mutable std::recursive_mutex m_mutex; - //------------------------------------------------------------------ // For ThreadSafeSTLMap only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ThreadSafeSTLMap); }; diff --git a/lldb/include/lldb/Core/ThreadSafeSTLVector.h b/lldb/include/lldb/Core/ThreadSafeSTLVector.h index 7d20eb9..e1666a69 100644 --- a/lldb/include/lldb/Core/ThreadSafeSTLVector.h +++ b/lldb/include/lldb/Core/ThreadSafeSTLVector.h @@ -22,9 +22,7 @@ public: typedef std::vector<_Object> collection; typedef typename collection::iterator iterator; typedef typename collection::const_iterator const_iterator; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ThreadSafeSTLVector() : m_collection(), m_mutex() {} ~ThreadSafeSTLVector() = default; @@ -65,9 +63,7 @@ private: collection m_collection; mutable std::recursive_mutex m_mutex; - //------------------------------------------------------------------ // For ThreadSafeSTLVector only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ThreadSafeSTLVector); }; diff --git a/lldb/include/lldb/Core/ThreadSafeValue.h b/lldb/include/lldb/Core/ThreadSafeValue.h index 0bef087..91f9681 100644 --- a/lldb/include/lldb/Core/ThreadSafeValue.h +++ b/lldb/include/lldb/Core/ThreadSafeValue.h @@ -18,9 +18,7 @@ namespace lldb_private { template <class T> class ThreadSafeValue { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ThreadSafeValue() : m_value(), m_mutex() {} ThreadSafeValue(const T &value) : m_value(value), m_mutex() {} @@ -55,9 +53,7 @@ private: T m_value; mutable std::recursive_mutex m_mutex; - //------------------------------------------------------------------ // For ThreadSafeValue only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ThreadSafeValue); }; diff --git a/lldb/include/lldb/Core/UniqueCStringMap.h b/lldb/include/lldb/Core/UniqueCStringMap.h index 5545078..fdea065 100644 --- a/lldb/include/lldb/Core/UniqueCStringMap.h +++ b/lldb/include/lldb/Core/UniqueCStringMap.h @@ -17,14 +17,12 @@ namespace lldb_private { -//---------------------------------------------------------------------- // Templatized uniqued string map. // // This map is useful for mapping unique C string names to values of type T. // Each "const char *" name added must be unique for a given // C string value. ConstString::GetCString() can provide such strings. // Any other string table that has guaranteed unique values can also be used. -//---------------------------------------------------------------------- template <typename T> class UniqueCStringMap { public: struct Entry { @@ -44,11 +42,9 @@ public: T value; }; - //------------------------------------------------------------------ // Call this function multiple times to add a bunch of entries to this map, // then later call UniqueCStringMap<T>::Sort() before doing any searches by // name. - //------------------------------------------------------------------ void Append(ConstString unique_cstr, const T &value) { m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value)); } @@ -57,10 +53,8 @@ public: void Clear() { m_map.clear(); } - //------------------------------------------------------------------ // Call this function to always keep the map sorted when putting entries into // the map. - //------------------------------------------------------------------ void Insert(ConstString unique_cstr, const T &value) { typename UniqueCStringMap<T>::Entry e(unique_cstr, value); m_map.insert(std::upper_bound(m_map.begin(), m_map.end(), e), e); @@ -70,12 +64,10 @@ public: m_map.insert(std::upper_bound(m_map.begin(), m_map.end(), e), e); } - //------------------------------------------------------------------ // Get an entries by index in a variety of forms. // // The caller is responsible for ensuring that the collection does not change // during while using the returned values. - //------------------------------------------------------------------ bool GetValueAtIndex(uint32_t idx, T &value) const { if (idx < m_map.size()) { value = m_map[idx].value; @@ -102,14 +94,12 @@ public: return ((idx < m_map.size()) ? m_map[idx].cstring : ConstString()); } - //------------------------------------------------------------------ // Find the value for the unique string in the map. // // Return the value for \a unique_cstr if one is found, return \a fail_value // otherwise. This method works well for simple type // T values and only if there is a sensible failure value that can // be returned and that won't match any existing values. - //------------------------------------------------------------------ T Find(ConstString unique_cstr, T fail_value) const { Entry search_entry(unique_cstr); const_iterator end = m_map.end(); @@ -121,13 +111,11 @@ public: return fail_value; } - //------------------------------------------------------------------ // Get a pointer to the first entry that matches "name". nullptr will be // returned if there is no entry that matches "name". // // The caller is responsible for ensuring that the collection does not change // during while using the returned pointer. - //------------------------------------------------------------------ const Entry *FindFirstValueForName(ConstString unique_cstr) const { Entry search_entry(unique_cstr); const_iterator end = m_map.end(); @@ -137,14 +125,12 @@ public: return nullptr; } - //------------------------------------------------------------------ // Get a pointer to the next entry that matches "name" from a previously // returned Entry pointer. nullptr will be returned if there is no subsequent // entry that matches "name". // // The caller is responsible for ensuring that the collection does not change // during while using the returned pointer. - //------------------------------------------------------------------ const Entry *FindNextValueForName(const Entry *entry_ptr) const { if (!m_map.empty()) { const Entry *first_entry = &m_map[0]; @@ -187,25 +173,18 @@ public: return values.size() - start_size; } - //------------------------------------------------------------------ // Get the total number of entries in this map. - //------------------------------------------------------------------ size_t GetSize() const { return m_map.size(); } - //------------------------------------------------------------------ // Returns true if this map is empty. - //------------------------------------------------------------------ bool IsEmpty() const { return m_map.empty(); } - //------------------------------------------------------------------ // Reserve memory for at least "n" entries in the map. This is useful to call // when you know you will be adding a lot of entries using // UniqueCStringMap::Append() (which should be followed by a call to // UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert(). - //------------------------------------------------------------------ void Reserve(size_t n) { m_map.reserve(n); } - //------------------------------------------------------------------ // Sort the unsorted contents in this map. A typical code flow would be: // size_t approximate_num_entries = .... // UniqueCStringMap<uint32_t> my_map; @@ -215,16 +194,13 @@ public: // my_map.Append (UniqueCStringMap::Entry(GetName(...), GetValue(...))); // } // my_map.Sort(); - //------------------------------------------------------------------ void Sort() { llvm::sort(m_map.begin(), m_map.end()); } - //------------------------------------------------------------------ // Since we are using a vector to contain our items it will always double its // memory consumption as things are added to the vector, so if you intend to // keep a UniqueCStringMap around and have a lot of entries in the map, you // will want to call this function to create a new vector and copy _only_ the // exact size needed as part of the finalization of the string map. - //------------------------------------------------------------------ void SizeToFit() { if (m_map.size() < m_map.capacity()) { collection temp(m_map.begin(), m_map.end()); diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index 9d5fd2f..c27a128 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -379,16 +379,12 @@ public: virtual bool CanProvideValue(); - //------------------------------------------------------------------ // Subclasses must implement the functions below. - //------------------------------------------------------------------ virtual uint64_t GetByteSize() = 0; virtual lldb::ValueType GetValueType() const = 0; - //------------------------------------------------------------------ // Subclasses can implement the functions below. - //------------------------------------------------------------------ virtual ConstString GetTypeName(); virtual ConstString GetDisplayTypeName(); @@ -478,9 +474,7 @@ public: virtual bool GetDeclaration(Declaration &decl); - //------------------------------------------------------------------ // The functions below should NOT be modified by subclasses - //------------------------------------------------------------------ const Status &GetError(); ConstString GetName() const; @@ -788,7 +782,6 @@ public: void SetHasCompleteType() { m_did_calculate_complete_objc_class_type = true; } - //------------------------------------------------------------------ /// Find out if a ValueObject might have children. /// /// This call is much more efficient than CalculateNumChildren() as @@ -803,7 +796,6 @@ public: /// \return /// Returns \b true if the ValueObject might have children, or \b /// false otherwise. - //------------------------------------------------------------------ virtual bool MightHaveChildren(); virtual lldb::VariableSP GetVariable() { return nullptr; } @@ -858,9 +850,7 @@ protected: size_t m_children_count; }; - //------------------------------------------------------------------ // Classes that inherit from ValueObject can see and modify these - //------------------------------------------------------------------ ValueObject *m_parent; // The parent value object, or nullptr if this has no parent ValueObject *m_root; // The root of the hierarchy for this ValueObject (or @@ -943,9 +933,7 @@ protected: friend class ValueObjectConstResultImpl; friend class ValueObjectSynthetic; // For ClearUserVisibleData - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ // Use the no-argument constructor to make a constant variable object (with // no ExecutionContextScope.) @@ -1005,9 +993,7 @@ protected: void ClearDynamicTypeInformation(); - //------------------------------------------------------------------ // Subclasses must implement the functions below. - //------------------------------------------------------------------ virtual CompilerType GetCompilerTypeImpl() = 0; @@ -1031,14 +1017,12 @@ private: DISALLOW_COPY_AND_ASSIGN(ValueObject); }; -//------------------------------------------------------------------------------ // A value object manager class that is seeded with the static variable value // and it vends the user facing value object. If the type is dynamic it can // vend the dynamic type. If this user type also has a synthetic type // associated with it, it will vend the synthetic type. The class watches the // process' stop // ID and will update the user type when needed. -//------------------------------------------------------------------------------ class ValueObjectManager { // The root value object is the static typed variable object. lldb::ValueObjectSP m_root_valobj_sp; diff --git a/lldb/include/lldb/Core/ValueObjectCast.h b/lldb/include/lldb/Core/ValueObjectCast.h index 890c66f..b7c919e 100644 --- a/lldb/include/lldb/Core/ValueObjectCast.h +++ b/lldb/include/lldb/Core/ValueObjectCast.h @@ -24,9 +24,7 @@ class ConstString; namespace lldb_private { -//--------------------------------------------------------------------------------- // A ValueObject that represents a given value represented as a different type. -//--------------------------------------------------------------------------------- class ValueObjectCast : public ValueObject { public: ~ValueObjectCast() override; diff --git a/lldb/include/lldb/Core/ValueObjectChild.h b/lldb/include/lldb/Core/ValueObjectChild.h index d66124c..76209a2 100644 --- a/lldb/include/lldb/Core/ValueObjectChild.h +++ b/lldb/include/lldb/Core/ValueObjectChild.h @@ -25,9 +25,7 @@ namespace lldb_private { -//---------------------------------------------------------------------- // A child of another ValueObject. -//---------------------------------------------------------------------- class ValueObjectChild : public ValueObject { public: ~ValueObjectChild() override; diff --git a/lldb/include/lldb/Core/ValueObjectConstResult.h b/lldb/include/lldb/Core/ValueObjectConstResult.h index 2c96dc1..b87e6e2 100644 --- a/lldb/include/lldb/Core/ValueObjectConstResult.h +++ b/lldb/include/lldb/Core/ValueObjectConstResult.h @@ -35,9 +35,7 @@ class Module; } namespace lldb_private { -//---------------------------------------------------------------------- // A frozen ValueObject copied into host memory -//---------------------------------------------------------------------- class ValueObjectConstResult : public ValueObject { public: ~ValueObjectConstResult() override; diff --git a/lldb/include/lldb/Core/ValueObjectConstResultChild.h b/lldb/include/lldb/Core/ValueObjectConstResultChild.h index a867245..73da87b 100644 --- a/lldb/include/lldb/Core/ValueObjectConstResultChild.h +++ b/lldb/include/lldb/Core/ValueObjectConstResultChild.h @@ -31,9 +31,7 @@ class ValueObject; namespace lldb_private { -//---------------------------------------------------------------------- // A child of a ValueObjectConstResult. -//---------------------------------------------------------------------- class ValueObjectConstResultChild : public ValueObjectChild { public: ValueObjectConstResultChild(ValueObject &parent, diff --git a/lldb/include/lldb/Core/ValueObjectConstResultImpl.h b/lldb/include/lldb/Core/ValueObjectConstResultImpl.h index 753db72..4d69402 100644 --- a/lldb/include/lldb/Core/ValueObjectConstResultImpl.h +++ b/lldb/include/lldb/Core/ValueObjectConstResultImpl.h @@ -32,11 +32,9 @@ class ValueObject; namespace lldb_private { -//---------------------------------------------------------------------- // A class wrapping common implementation details for operations in // ValueObjectConstResult ( & Child ) that may need to jump from the host // memory space into the target's memory space -//---------------------------------------------------------------------- class ValueObjectConstResultImpl { public: ValueObjectConstResultImpl(ValueObject *valobj, diff --git a/lldb/include/lldb/Core/ValueObjectDynamicValue.h b/lldb/include/lldb/Core/ValueObjectDynamicValue.h index 44f0274..8f23198 100644 --- a/lldb/include/lldb/Core/ValueObjectDynamicValue.h +++ b/lldb/include/lldb/Core/ValueObjectDynamicValue.h @@ -35,10 +35,8 @@ class Status; } namespace lldb_private { -//---------------------------------------------------------------------- // A ValueObject that represents memory at a given address, viewed as some // set lldb type. -//---------------------------------------------------------------------- class ValueObjectDynamicValue : public ValueObject { public: ~ValueObjectDynamicValue() override; diff --git a/lldb/include/lldb/Core/ValueObjectList.h b/lldb/include/lldb/Core/ValueObjectList.h index 03f944b..29857e5 100644 --- a/lldb/include/lldb/Core/ValueObjectList.h +++ b/lldb/include/lldb/Core/ValueObjectList.h @@ -22,14 +22,10 @@ class ValueObject; namespace lldb_private { -//---------------------------------------------------------------------- // A collection of ValueObject values that -//---------------------------------------------------------------------- class ValueObjectList { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ValueObjectList(); ValueObjectList(const ValueObjectList &rhs); @@ -67,9 +63,7 @@ public: } protected: typedef std::vector<lldb::ValueObjectSP> collection; - //------------------------------------------------------------------ // Classes that inherit from ValueObjectList can see and modify these - //------------------------------------------------------------------ collection m_value_objects; }; diff --git a/lldb/include/lldb/Core/ValueObjectMemory.h b/lldb/include/lldb/Core/ValueObjectMemory.h index 946baf4..f0374eb 100644 --- a/lldb/include/lldb/Core/ValueObjectMemory.h +++ b/lldb/include/lldb/Core/ValueObjectMemory.h @@ -27,10 +27,8 @@ class ExecutionContextScope; namespace lldb_private { -//---------------------------------------------------------------------- // A ValueObject that represents memory at a given address, viewed as some // set lldb type. -//---------------------------------------------------------------------- class ValueObjectMemory : public ValueObject { public: ~ValueObjectMemory() override; @@ -74,9 +72,7 @@ private: ValueObjectMemory(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, const CompilerType &ast_type); - //------------------------------------------------------------------ // For ValueObject only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ValueObjectMemory); }; diff --git a/lldb/include/lldb/Core/ValueObjectRegister.h b/lldb/include/lldb/Core/ValueObjectRegister.h index 1a83046..5492124 100644 --- a/lldb/include/lldb/Core/ValueObjectRegister.h +++ b/lldb/include/lldb/Core/ValueObjectRegister.h @@ -39,10 +39,8 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- // A ValueObject that contains a root variable that may or may not // have children. -//---------------------------------------------------------------------- class ValueObjectRegisterContext : public ValueObject { public: ~ValueObjectRegisterContext() override; @@ -74,9 +72,7 @@ protected: private: ValueObjectRegisterContext(ValueObject &parent, lldb::RegisterContextSP ®_ctx_sp); - //------------------------------------------------------------------ // For ValueObject only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterContext); }; @@ -123,9 +119,7 @@ private: ValueObjectRegisterSet(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx); - //------------------------------------------------------------------ // For ValueObject only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterSet); }; @@ -179,9 +173,7 @@ private: ValueObjectRegister(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, uint32_t reg_num); - //------------------------------------------------------------------ // For ValueObject only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ValueObjectRegister); }; diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h index 08f83d99..15b3622 100644 --- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h +++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -35,13 +35,11 @@ class SyntheticChildrenFrontEnd; } namespace lldb_private { -//---------------------------------------------------------------------- // A ValueObject that obtains its children from some source other than // real information // This is currently used to implement Python-based children and filters but // you can bind it to any source of synthetic information and have it behave // accordingly -//---------------------------------------------------------------------- class ValueObjectSynthetic : public ValueObject { public: ~ValueObjectSynthetic() override; diff --git a/lldb/include/lldb/Core/ValueObjectVariable.h b/lldb/include/lldb/Core/ValueObjectVariable.h index 3a974a0..93feb8e 100644 --- a/lldb/include/lldb/Core/ValueObjectVariable.h +++ b/lldb/include/lldb/Core/ValueObjectVariable.h @@ -39,10 +39,8 @@ class SymbolContextScope; namespace lldb_private { -//---------------------------------------------------------------------- // A ValueObject that contains a root variable that may or may not // have children. -//---------------------------------------------------------------------- class ValueObjectVariable : public ValueObject { public: ~ValueObjectVariable() override; @@ -91,9 +89,7 @@ protected: private: ValueObjectVariable(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp); - //------------------------------------------------------------------ // For ValueObject only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ValueObjectVariable); }; diff --git a/lldb/include/lldb/Expression/DWARFExpression.h b/lldb/include/lldb/Expression/DWARFExpression.h index 60965ac..3ec8115 100644 --- a/lldb/include/lldb/Expression/DWARFExpression.h +++ b/lldb/include/lldb/Expression/DWARFExpression.h @@ -21,7 +21,6 @@ class DWARFUnit; namespace lldb_private { -//---------------------------------------------------------------------- /// \class DWARFExpression DWARFExpression.h /// "lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location /// expression and interprets it. @@ -33,7 +32,6 @@ namespace lldb_private { /// overhead from copying JIT-compiled code into the target is too high or /// where the target cannot be run. This class encapsulates a single DWARF /// location expression or a location list and interprets it. -//---------------------------------------------------------------------- class DWARFExpression { public: enum LocationListFormat : uint8_t { @@ -45,12 +43,9 @@ public: // (.debug_loclists/.debug_loclists.dwo). }; - //------------------------------------------------------------------ /// Constructor - //------------------------------------------------------------------ explicit DWARFExpression(DWARFUnit *dwarf_cu); - //------------------------------------------------------------------ /// Constructor /// /// \param[in] data @@ -62,22 +57,16 @@ public: /// /// \param[in] data_length /// The byte length of the location expression. - //------------------------------------------------------------------ DWARFExpression(lldb::ModuleSP module, const DataExtractor &data, DWARFUnit *dwarf_cu, lldb::offset_t data_offset, lldb::offset_t data_length); - //------------------------------------------------------------------ /// Copy constructor - //------------------------------------------------------------------ DWARFExpression(const DWARFExpression &rhs); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ virtual ~DWARFExpression(); - //------------------------------------------------------------------ /// Print the description of the expression to a stream /// /// \param[in] s @@ -96,21 +85,15 @@ public: /// \param[in] abi /// An optional ABI plug-in that can be used to resolve register /// names. - //------------------------------------------------------------------ void GetDescription(Stream *s, lldb::DescriptionLevel level, lldb::addr_t location_list_base_addr, ABI *abi) const; - //------------------------------------------------------------------ /// Return true if the location expression contains data - //------------------------------------------------------------------ bool IsValid() const; - //------------------------------------------------------------------ /// Return true if a location list was provided - //------------------------------------------------------------------ bool IsLocationList() const; - //------------------------------------------------------------------ /// Search for a load address in the location list /// /// \param[in] process @@ -122,7 +105,6 @@ public: /// \return /// True if IsLocationList() is true and the address was found; /// false otherwise. - //------------------------------------------------------------------ // bool // LocationListContainsLoadAddress (Process* process, const Address &addr) // const; @@ -130,7 +112,6 @@ public: bool LocationListContainsAddress(lldb::addr_t loclist_base_addr, lldb::addr_t addr) const; - //------------------------------------------------------------------ /// If a location is not a location list, return true if the location /// contains a DW_OP_addr () opcode in the stream that matches \a file_addr. /// If file_addr is LLDB_INVALID_ADDRESS, the this function will return true @@ -150,7 +131,6 @@ public: /// \return /// LLDB_INVALID_ADDRESS if the location doesn't contain a /// DW_OP_addr for \a op_addr_idx, otherwise a valid file address - //------------------------------------------------------------------ lldb::addr_t GetLocation_DW_OP_addr(uint32_t op_addr_idx, bool &error) const; bool Update_DW_OP_addr(lldb::addr_t file_addr); @@ -164,17 +144,14 @@ public: std::function<lldb::addr_t(lldb::addr_t file_addr)> const &link_address_callback); - //------------------------------------------------------------------ /// Make the expression parser read its location information from a given /// data source. Does not change the offset and length /// /// \param[in] data /// A data extractor configured to read the DWARF location expression's /// bytecode. - //------------------------------------------------------------------ void SetOpcodeData(const DataExtractor &data); - //------------------------------------------------------------------ /// Make the expression parser read its location information from a given /// data source /// @@ -190,11 +167,9 @@ public: /// /// \param[in] data_length /// The byte length of the location expression. - //------------------------------------------------------------------ void SetOpcodeData(lldb::ModuleSP module_sp, const DataExtractor &data, lldb::offset_t data_offset, lldb::offset_t data_length); - //------------------------------------------------------------------ /// Copy the DWARF location expression into a local buffer. /// /// It is a good idea to copy the data so we don't keep the entire object @@ -219,7 +194,6 @@ public: /// /// \param[in] data_length /// The byte length of the location expression. - //------------------------------------------------------------------ void CopyOpcodeData(lldb::ModuleSP module_sp, const DataExtractor &data, lldb::offset_t data_offset, lldb::offset_t data_length); @@ -230,7 +204,6 @@ public: lldb::offset_t const_value_byte_size, uint8_t addr_byte_size); - //------------------------------------------------------------------ /// Tells the expression that it refers to a location list. /// /// \param[in] slide @@ -239,42 +212,32 @@ public: /// offsets into the object that owns the location list. We need /// to make location lists relative to the objects that own them /// so we can relink addresses on the fly. - //------------------------------------------------------------------ void SetLocationListSlide(lldb::addr_t slide); - //------------------------------------------------------------------ /// Return the call-frame-info style register kind - //------------------------------------------------------------------ int GetRegisterKind(); - //------------------------------------------------------------------ /// Set the call-frame-info style register kind /// /// \param[in] reg_kind /// The register kind. - //------------------------------------------------------------------ void SetRegisterKind(lldb::RegisterKind reg_kind); - //------------------------------------------------------------------ /// Wrapper for the static evaluate function that accepts an /// ExecutionContextScope instead of an ExecutionContext and uses member /// variables to populate many operands - //------------------------------------------------------------------ bool Evaluate(ExecutionContextScope *exe_scope, lldb::addr_t loclist_base_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) const; - //------------------------------------------------------------------ /// Wrapper for the static evaluate function that uses member variables to /// populate many operands - //------------------------------------------------------------------ bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t loclist_base_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) const; - //------------------------------------------------------------------ /// Evaluate a DWARF location expression in a particular context /// /// \param[in] exe_ctx @@ -332,7 +295,6 @@ public: /// \return /// True on success; false otherwise. If error_ptr is non-NULL, /// details of the failure are provided through it. - //------------------------------------------------------------------ static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes, DWARFUnit *dwarf_cu, const lldb::offset_t offset, @@ -366,7 +328,6 @@ public: bool MatchesOperand(StackFrame &frame, const Instruction::Operand &op); protected: - //------------------------------------------------------------------ /// Pretty-prints the location expression to a stream /// /// \param[in] stream @@ -384,7 +345,6 @@ protected: /// \param[in] abi /// An optional ABI plug-in that can be used to resolve register /// names. - //------------------------------------------------------------------ void DumpLocation(Stream *s, lldb::offset_t offset, lldb::offset_t length, lldb::DescriptionLevel level, ABI *abi) const; @@ -398,9 +358,7 @@ protected: bool GetOpAndEndOffsets(StackFrame &frame, lldb::offset_t &op_offset, lldb::offset_t &end_offset); - //------------------------------------------------------------------ /// Classes that inherit from DWARFExpression can see and modify these - //------------------------------------------------------------------ lldb::ModuleWP m_module_wp; ///< Module which defined this expression. DataExtractor m_data; ///< A data extractor capable of reading opcode bytes diff --git a/lldb/include/lldb/Expression/Expression.h b/lldb/include/lldb/Expression/Expression.h index c402bf8..2f0183c 100644 --- a/lldb/include/lldb/Expression/Expression.h +++ b/lldb/include/lldb/Expression/Expression.h @@ -22,7 +22,6 @@ namespace lldb_private { class RecordingMemoryManager; -//---------------------------------------------------------------------- /// \class Expression Expression.h "lldb/Expression/Expression.h" Encapsulates /// a single expression for use in lldb /// @@ -31,7 +30,6 @@ class RecordingMemoryManager; /// objects needed to parse and interpret or JIT an expression. It uses the /// expression parser appropriate to the language of the expression to produce /// LLVM IR from the expression. -//---------------------------------------------------------------------- class Expression { public: /// Discriminator for LLVM-style RTTI (dyn_cast<> et al.) @@ -51,65 +49,43 @@ public: Expression(ExecutionContextScope &exe_scope, ExpressionKind kind); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ virtual ~Expression() {} - //------------------------------------------------------------------ /// Return the string that the parser should parse. Must be a full /// translation unit. - //------------------------------------------------------------------ virtual const char *Text() = 0; - //------------------------------------------------------------------ /// Return the function name that should be used for executing the /// expression. Text() should contain the definition of this function. - //------------------------------------------------------------------ virtual const char *FunctionName() = 0; - //------------------------------------------------------------------ /// Return the language that should be used when parsing. To use the /// default, return eLanguageTypeUnknown. - //------------------------------------------------------------------ virtual lldb::LanguageType Language() { return lldb::eLanguageTypeUnknown; } - //------------------------------------------------------------------ /// Return the desired result type of the function, or eResultTypeAny if /// indifferent. - //------------------------------------------------------------------ virtual ResultType DesiredResultType() { return eResultTypeAny; } - //------------------------------------------------------------------ /// Flags - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Return true if validation code should be inserted into the expression. - //------------------------------------------------------------------ virtual bool NeedsValidation() = 0; - //------------------------------------------------------------------ /// Return true if external variables in the expression should be resolved. - //------------------------------------------------------------------ virtual bool NeedsVariableResolution() = 0; virtual EvaluateExpressionOptions *GetOptions() { return nullptr; }; - //------------------------------------------------------------------ /// Return the address of the function's JIT-compiled code, or /// LLDB_INVALID_ADDRESS if the function is not JIT compiled - //------------------------------------------------------------------ lldb::addr_t StartAddress() { return m_jit_start_addr; } - //------------------------------------------------------------------ /// Called to notify the expression that it is about to be executed. - //------------------------------------------------------------------ virtual void WillStartExecuting() {} - //------------------------------------------------------------------ /// Called to notify the expression that its execution has finished. - //------------------------------------------------------------------ virtual void DidFinishExecuting() {} virtual ExpressionTypeSystemHelper *GetTypeSystemHelper() { return nullptr; } diff --git a/lldb/include/lldb/Expression/ExpressionParser.h b/lldb/include/lldb/Expression/ExpressionParser.h index 37dddf6..59f7c15 100644 --- a/lldb/include/lldb/Expression/ExpressionParser.h +++ b/lldb/include/lldb/Expression/ExpressionParser.h @@ -18,16 +18,13 @@ namespace lldb_private { class IRExecutionUnit; -//---------------------------------------------------------------------- /// \class ExpressionParser ExpressionParser.h /// "lldb/Expression/ExpressionParser.h" Encapsulates an instance of a /// compiler that can parse expressions. /// /// ExpressionParser is the base class for llvm based Expression parsers. -//---------------------------------------------------------------------- class ExpressionParser { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -39,17 +36,13 @@ public: /// /// \param[in] expr /// The expression to be parsed. - //------------------------------------------------------------------ ExpressionParser(ExecutionContextScope *exe_scope, Expression &expr, bool generate_debug_info) : m_expr(expr), m_generate_debug_info(generate_debug_info) {} - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ virtual ~ExpressionParser(){}; - //------------------------------------------------------------------ /// Attempts to find possible command line completions for the given /// expression. /// @@ -80,11 +73,9 @@ public: /// \return /// True if we added any completion results to the output; /// false otherwise. - //------------------------------------------------------------------ virtual bool Complete(CompletionRequest &request, unsigned line, unsigned pos, unsigned typed_pos) = 0; - //------------------------------------------------------------------ /// Parse a single expression and convert it to IR using Clang. Don't wrap /// the expression in anything at all. /// @@ -94,10 +85,8 @@ public: /// \return /// The number of errors encountered during parsing. 0 means /// success. - //------------------------------------------------------------------ virtual unsigned Parse(DiagnosticManager &diagnostic_manager) = 0; - //------------------------------------------------------------------ /// Try to use the FixIts in the diagnostic_manager to rewrite the /// expression. If successful, the rewritten expression is stored in the /// diagnostic_manager, get it out with GetFixedExpression. @@ -107,12 +96,10 @@ public: /// /// \return /// \b true if the rewrite was successful, \b false otherwise. - //------------------------------------------------------------------ virtual bool RewriteExpression(DiagnosticManager &diagnostic_manager) { return false; } - //------------------------------------------------------------------ /// Ready an already-parsed expression for execution, possibly evaluating it /// statically. /// @@ -143,7 +130,6 @@ public: /// \return /// An error code indicating the success or failure of the operation. /// Test with Success(). - //------------------------------------------------------------------ virtual Status PrepareForExecution(lldb::addr_t &func_addr, lldb::addr_t &func_end, std::shared_ptr<IRExecutionUnit> &execution_unit_sp, diff --git a/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h b/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h index 30fdcf8..9c64553 100644 --- a/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h +++ b/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h @@ -14,7 +14,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ExpressionTypeSystemHelper ExpressionTypeSystemHelper.h /// "lldb/Expression/ExpressionTypeSystemHelper.h" /// A helper object that the Expression can pass to its ExpressionParser @@ -23,7 +22,6 @@ namespace lldb_private { /// dyn_cast so that the expression parser can cast it back to the requisite /// specific type. /// -//---------------------------------------------------------------------- class ExpressionTypeSystemHelper { public: diff --git a/lldb/include/lldb/Expression/ExpressionVariable.h b/lldb/include/lldb/Expression/ExpressionVariable.h index dba879c..e5f7890 100644 --- a/lldb/include/lldb/Expression/ExpressionVariable.h +++ b/lldb/include/lldb/Expression/ExpressionVariable.h @@ -25,9 +25,7 @@ class ClangExpressionVariable; class ExpressionVariable : public std::enable_shared_from_this<ExpressionVariable> { public: - //---------------------------------------------------------------------- // See TypeSystem.h for how to add subclasses to this. - //---------------------------------------------------------------------- enum LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds }; LLVMCastKind getKind() const { return m_kind; } @@ -118,18 +116,14 @@ public: LLVMCastKind m_kind; }; -//---------------------------------------------------------------------- /// \class ExpressionVariableList ExpressionVariable.h /// "lldb/Expression/ExpressionVariable.h" /// A list of variable references. /// /// This class stores variables internally, acting as the permanent store. -//---------------------------------------------------------------------- class ExpressionVariableList { public: - //---------------------------------------------------------------------- /// Implementation of methods in ExpressionVariableListBase - //---------------------------------------------------------------------- size_t GetSize() { return m_variables.size(); } lldb::ExpressionVariableSP GetVariableAtIndex(size_t index) { @@ -160,7 +154,6 @@ public: return false; } - //---------------------------------------------------------------------- /// Finds a variable by name in the list. /// /// \param[in] name @@ -169,7 +162,6 @@ public: /// \return /// The variable requested, or nullptr if that variable is not in the /// list. - //---------------------------------------------------------------------- lldb::ExpressionVariableSP GetVariable(ConstString name) { lldb::ExpressionVariableSP var_sp; for (size_t index = 0, size = GetSize(); index < size; ++index) { @@ -214,9 +206,7 @@ private: class PersistentExpressionState : public ExpressionVariableList { public: - //---------------------------------------------------------------------- // See TypeSystem.h for how to add subclasses to this. - //---------------------------------------------------------------------- enum LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds }; LLVMCastKind getKind() const { return m_kind; } diff --git a/lldb/include/lldb/Expression/FunctionCaller.h b/lldb/include/lldb/Expression/FunctionCaller.h index d8b40f6..ea9d020 100644 --- a/lldb/include/lldb/Expression/FunctionCaller.h +++ b/lldb/include/lldb/Expression/FunctionCaller.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class FunctionCaller FunctionCaller.h "lldb/Expression/FunctionCaller.h" /// Encapsulates a function that can be called. /// @@ -54,7 +53,6 @@ namespace lldb_private { /// /// Any of the methods that take arg_addr_ptr can be passed nullptr, and the /// argument space will be managed for you. -//---------------------------------------------------------------------- class FunctionCaller : public Expression { public: /// LLVM-style RTTI support. @@ -62,7 +60,6 @@ public: return E->getKind() == eKindFunctionCaller; } - //------------------------------------------------------------------ /// Constructor /// /// \param[in] exe_scope @@ -82,18 +79,14 @@ public: /// \param[in] arg_value_list /// The default values to use when calling this function. Can /// be overridden using WriteFunctionArguments(). - //------------------------------------------------------------------ FunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, const char *name); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~FunctionCaller() override; - //------------------------------------------------------------------ /// Compile the wrapper function /// /// \param[in] thread_to_use_sp @@ -106,11 +99,9 @@ public: /// /// \return /// The number of errors. - //------------------------------------------------------------------ virtual unsigned CompileFunction(lldb::ThreadSP thread_to_use_sp, DiagnosticManager &diagnostic_manager) = 0; - //------------------------------------------------------------------ /// Insert the default function wrapper and its default argument struct /// /// \param[in] exe_ctx @@ -127,11 +118,9 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool InsertFunction(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, DiagnosticManager &diagnostic_manager); - //------------------------------------------------------------------ /// Insert the default function wrapper (using the JIT) /// /// \param[in] exe_ctx @@ -143,11 +132,9 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool WriteFunctionWrapper(ExecutionContext &exe_ctx, DiagnosticManager &diagnostic_manager); - //------------------------------------------------------------------ /// Insert the default function argument struct /// /// \param[in] exe_ctx @@ -164,12 +151,10 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool WriteFunctionArguments(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, DiagnosticManager &diagnostic_manager); - //------------------------------------------------------------------ /// Insert an argument struct with a non-default function address and non- /// default argument values /// @@ -190,13 +175,11 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool WriteFunctionArguments(ExecutionContext &exe_ctx, lldb::addr_t &args_addr_ref, ValueList &arg_values, DiagnosticManager &diagnostic_manager); - //------------------------------------------------------------------ /// Run the function this FunctionCaller was created with. /// /// This is the full version. @@ -228,13 +211,11 @@ public: /// \return /// Returns one of the ExpressionResults enum indicating function call /// status. - //------------------------------------------------------------------ lldb::ExpressionResults ExecuteFunction(ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager, Value &results); - //------------------------------------------------------------------ /// Get a thread plan to run the function this FunctionCaller was created /// with. /// @@ -259,13 +240,11 @@ public: /// /// \return /// A ThreadPlan shared pointer for executing the function. - //------------------------------------------------------------------ lldb::ThreadPlanSP GetThreadPlanToCallFunction(ExecutionContext &exe_ctx, lldb::addr_t args_addr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager); - //------------------------------------------------------------------ /// Get the result of the function from its struct /// /// \param[in] exe_ctx @@ -279,11 +258,9 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool FetchFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr, Value &ret_value); - //------------------------------------------------------------------ /// Deallocate the arguments structure /// /// \param[in] exe_ctx @@ -292,42 +269,29 @@ public: /// /// \param[in] args_addr /// The address of the argument struct. - //------------------------------------------------------------------ void DeallocateFunctionResults(ExecutionContext &exe_ctx, lldb::addr_t args_addr); - //------------------------------------------------------------------ /// Interface for ClangExpression - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Return the string that the parser should parse. Must be a full /// translation unit. - //------------------------------------------------------------------ const char *Text() override { return m_wrapper_function_text.c_str(); } - //------------------------------------------------------------------ /// Return the function name that should be used for executing the /// expression. Text() should contain the definition of this function. - //------------------------------------------------------------------ const char *FunctionName() override { return m_wrapper_function_name.c_str(); } - //------------------------------------------------------------------ /// Return the object that the parser should use when registering local /// variables. May be nullptr if the Expression doesn't care. - //------------------------------------------------------------------ ExpressionVariableList *LocalVariables() { return nullptr; } - //------------------------------------------------------------------ /// Return true if validation code should be inserted into the expression. - //------------------------------------------------------------------ bool NeedsValidation() override { return false; } - //------------------------------------------------------------------ /// Return true if external variables in the expression should be resolved. - //------------------------------------------------------------------ bool NeedsVariableResolution() override { return false; } ValueList GetArgumentValues() const { return m_arg_values; } @@ -366,7 +330,6 @@ protected: bool m_struct_valid; ///< True if the ASTStructExtractor has populated the ///variables below. - //------------------------------------------------------------------ /// These values are populated by the ASTStructExtractor size_t m_struct_size; ///< The size of the argument struct, in bytes. std::vector<uint64_t> @@ -374,7 +337,6 @@ protected: uint64_t m_return_size; ///< The size of the result variable, in bytes. uint64_t m_return_offset; ///< The offset of the result variable in the ///struct, in bytes. - //------------------------------------------------------------------ ValueList m_arg_values; ///< The default values of the arguments. diff --git a/lldb/include/lldb/Expression/IRDynamicChecks.h b/lldb/include/lldb/Expression/IRDynamicChecks.h index af1e412..26f1cdb 100644 --- a/lldb/include/lldb/Expression/IRDynamicChecks.h +++ b/lldb/include/lldb/Expression/IRDynamicChecks.h @@ -30,7 +30,6 @@ class ClangExpressionDeclMap; class ExecutionContext; class Stream; -//---------------------------------------------------------------------- /// \class DynamicCheckerFunctions IRDynamicChecks.h /// "lldb/Expression/IRDynamicChecks.h" Encapsulates dynamic check functions /// used by expressions. @@ -44,20 +43,14 @@ class Stream; /// /// The class installs each checker function into the target process and makes /// it available to IRDynamicChecks to use. -//---------------------------------------------------------------------- class DynamicCheckerFunctions { public: - //------------------------------------------------------------------ /// Constructor - //------------------------------------------------------------------ DynamicCheckerFunctions(); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~DynamicCheckerFunctions(); - //------------------------------------------------------------------ /// Install the utility functions into a process. This binds the instance /// of DynamicCheckerFunctions to that process. /// @@ -70,7 +63,6 @@ public: /// \return /// True on success; false on failure, or if the functions have /// already been installed. - //------------------------------------------------------------------ bool Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx); @@ -80,7 +72,6 @@ public: std::unique_ptr<UtilityFunction> m_objc_object_check; }; -//---------------------------------------------------------------------- /// \class IRDynamicChecks IRDynamicChecks.h /// "lldb/Expression/IRDynamicChecks.h" Adds dynamic checks to a user-entered /// expression to reduce its likelihood of crashing @@ -91,10 +82,8 @@ public: /// /// IRDynamicChecks adds calls to the functions in DynamicCheckerFunctions to /// appropriate locations in an expression's IR. -//---------------------------------------------------------------------- class IRDynamicChecks : public llvm::ModulePass { public: - //------------------------------------------------------------------ /// Constructor /// /// \param[in] checker_functions @@ -106,16 +95,12 @@ public: /// \param[in] decl_map /// The mapping used to look up entities in the target process. In /// this case, used to find objc_msgSend - //------------------------------------------------------------------ IRDynamicChecks(DynamicCheckerFunctions &checker_functions, const char *func_name = "$__lldb_expr"); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~IRDynamicChecks() override; - //------------------------------------------------------------------ /// Run this IR transformer on a single module /// /// \param[in] M @@ -125,28 +110,20 @@ public: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool runOnModule(llvm::Module &M) override; - //------------------------------------------------------------------ /// Interface stub - //------------------------------------------------------------------ void assignPassManager( llvm::PMStack &PMS, llvm::PassManagerType T = llvm::PMT_ModulePassManager) override; - //------------------------------------------------------------------ /// Returns PMT_ModulePassManager - //------------------------------------------------------------------ llvm::PassManagerType getPotentialPassManagerType() const override; private: - //------------------------------------------------------------------ /// A basic block-level pass to find all pointer dereferences and /// validate them before use. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] M @@ -157,7 +134,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool FindDataLoads(llvm::Module &M, llvm::BasicBlock &BB); std::string m_func_name; ///< The name of the function to add checks to diff --git a/lldb/include/lldb/Expression/IRExecutionUnit.h b/lldb/include/lldb/Expression/IRExecutionUnit.h index d8f599c..37f31358 100644 --- a/lldb/include/lldb/Expression/IRExecutionUnit.h +++ b/lldb/include/lldb/Expression/IRExecutionUnit.h @@ -36,7 +36,6 @@ namespace lldb_private { class Status; -//---------------------------------------------------------------------- /// \class IRExecutionUnit IRExecutionUnit.h /// "lldb/Expression/IRExecutionUnit.h" Contains the IR and, optionally, JIT- /// compiled code for a module. @@ -54,22 +53,17 @@ class Status; /// is how the JIT emits code. Because LLDB needs to move JIT-compiled code /// into the target process, the IRExecutionUnit knows how to copy the emitted /// code into the target process. -//---------------------------------------------------------------------- class IRExecutionUnit : public std::enable_shared_from_this<IRExecutionUnit>, public IRMemoryMap, public ObjectFileJITDelegate { public: - //------------------------------------------------------------------ /// Constructor - //------------------------------------------------------------------ IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_up, std::unique_ptr<llvm::Module> &module_up, ConstString &name, const lldb::TargetSP &target_sp, const SymbolContext &sym_ctx, std::vector<std::string> &cpu_features); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~IRExecutionUnit() override; ConstString GetFunctionName() { return m_name; } @@ -84,19 +78,15 @@ public: void GetRunnableInfo(Status &error, lldb::addr_t &func_addr, lldb::addr_t &func_end); - //------------------------------------------------------------------ /// Accessors for IRForTarget and other clients that may want binary data /// placed on their behalf. The binary data is owned by the IRExecutionUnit /// unless the client explicitly chooses to free it. - //------------------------------------------------------------------ lldb::addr_t WriteNow(const uint8_t *bytes, size_t size, Status &error); void FreeNow(lldb::addr_t allocation); - //------------------------------------------------------------------ /// ObjectFileJITDelegate overrides - //------------------------------------------------------------------ lldb::ByteOrder GetByteOrder() const override; uint32_t GetAddressByteSize() const override; @@ -115,7 +105,6 @@ public: void GetStaticInitializers(std::vector<lldb::addr_t> &static_initializers); - //---------------------------------------------------------------------- /// \class JittedFunction IRExecutionUnit.h /// "lldb/Expression/IRExecutionUnit.h" /// Encapsulates a single function that has been generated by the JIT. @@ -123,14 +112,12 @@ public: /// Functions that have been generated by the JIT are first resident in the /// local process, and then placed in the target process. JittedFunction /// represents a function possibly resident in both. - //---------------------------------------------------------------------- struct JittedEntity { ConstString m_name; ///< The function's name lldb::addr_t m_local_addr; ///< The address of the function in LLDB's memory lldb::addr_t m_remote_addr; ///< The address of the function in the target's memory - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variabes. @@ -145,7 +132,6 @@ public: /// \param[in] remote_addr /// The address of the function in the target, or LLDB_INVALID_ADDRESS /// if it is not present in the target's memory. - //------------------------------------------------------------------ JittedEntity(const char *name, lldb::addr_t local_addr = LLDB_INVALID_ADDRESS, lldb::addr_t remote_addr = LLDB_INVALID_ADDRESS) @@ -176,7 +162,6 @@ public: } private: - //------------------------------------------------------------------ /// Look up the object in m_address_map that contains a given address, find /// where it was copied to, and return the remote address at the same offset /// into the copied entity @@ -186,10 +171,8 @@ private: /// /// \return /// The address in the target process. - //------------------------------------------------------------------ lldb::addr_t GetRemoteAddressForLocal(lldb::addr_t local_address); - //------------------------------------------------------------------ /// Look up the object in m_address_map that contains a given address, find /// where it was copied to, and return its address range in the target /// process @@ -199,11 +182,9 @@ private: /// /// \return /// The range of the containing object in the target process. - //------------------------------------------------------------------ typedef std::pair<lldb::addr_t, uintptr_t> AddrRange; AddrRange GetRemoteRangeForLocal(lldb::addr_t local_address); - //------------------------------------------------------------------ /// Commit all allocations to the process and record where they were stored. /// /// \param[in] process @@ -213,18 +194,14 @@ private: /// True <=> all allocations were performed successfully. /// This method will attempt to free allocated memory if the /// operation fails. - //------------------------------------------------------------------ bool CommitAllocations(lldb::ProcessSP &process_sp); - //------------------------------------------------------------------ /// Report all committed allocations to the execution engine. /// /// \param[in] engine /// The execution engine to notify. - //------------------------------------------------------------------ void ReportAllocations(llvm::ExecutionEngine &engine); - //------------------------------------------------------------------ /// Write the contents of all allocations to the process. /// /// \param[in] local_address @@ -232,7 +209,6 @@ private: /// /// \return /// True <=> all allocations were performed successfully. - //------------------------------------------------------------------ bool WriteData(lldb::ProcessSP &process_sp); Status DisassembleFunction(Stream &stream, lldb::ProcessSP &process_sp); @@ -266,7 +242,6 @@ private: ~MemoryManager() override; - //------------------------------------------------------------------ /// Allocate space for executable code, and add it to the m_spaceBlocks /// map /// @@ -281,12 +256,10 @@ private: /// /// \return /// Allocated space. - //------------------------------------------------------------------ uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, llvm::StringRef SectionName) override; - //------------------------------------------------------------------ /// Allocate space for data, and add it to the m_spaceBlocks map /// /// \param[in] Size @@ -303,13 +276,11 @@ private: /// /// \return /// Allocated space. - //------------------------------------------------------------------ uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, llvm::StringRef SectionName, bool IsReadOnly) override; - //------------------------------------------------------------------ /// Called when object loading is complete and section page permissions /// can be applied. Currently unimplemented for LLDB. /// @@ -318,7 +289,6 @@ private: /// /// \return /// True in case of failure, false in case of success. - //------------------------------------------------------------------ bool finalizeMemory(std::string *ErrMsg) override { // TODO: Ensure that the instruction cache is flushed because // relocations are updated by dy-load. See: @@ -348,14 +318,12 @@ private: static const unsigned eSectionIDInvalid = (unsigned)-1; - //---------------------------------------------------------------------- /// \class AllocationRecord IRExecutionUnit.h /// "lldb/Expression/IRExecutionUnit.h" Encapsulates a single allocation /// request made by the JIT. /// /// Allocations made by the JIT are first queued up and then applied in bulk /// to the underlying process. - //---------------------------------------------------------------------- enum class AllocationKind { Stub, Code, Data, Global, Bytes }; static lldb::SectionType diff --git a/lldb/include/lldb/Expression/IRInterpreter.h b/lldb/include/lldb/Expression/IRInterpreter.h index 53d2846..6148093e 100644 --- a/lldb/include/lldb/Expression/IRInterpreter.h +++ b/lldb/include/lldb/Expression/IRInterpreter.h @@ -26,7 +26,6 @@ class ClangExpressionDeclMap; class IRMemoryMap; } -//---------------------------------------------------------------------- /// \class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h" /// Attempt to interpret the function's code if it does not require /// running the target. @@ -34,7 +33,6 @@ class IRMemoryMap; /// In some cases, the IR for an expression can be evaluated entirely in the /// debugger, manipulating variables but not executing any code in the target. /// The IRInterpreter attempts to do this. -//---------------------------------------------------------------------- class IRInterpreter { public: static bool CanInterpret(llvm::Module &module, llvm::Function &function, diff --git a/lldb/include/lldb/Expression/IRMemoryMap.h b/lldb/include/lldb/Expression/IRMemoryMap.h index 3a410d4..9521b0f 100644 --- a/lldb/include/lldb/Expression/IRMemoryMap.h +++ b/lldb/include/lldb/Expression/IRMemoryMap.h @@ -17,7 +17,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class IRMemoryMap IRMemoryMap.h "lldb/Expression/IRMemoryMap.h" /// Encapsulates memory that may exist in the process but must /// also be available in the host process. @@ -32,7 +31,6 @@ namespace lldb_private { /// address in the tar at which they reside. If the inferior does not exist, /// allocations still get made-up addresses. If an inferior appears at some /// point, then those addresses need to be re-mapped. -//---------------------------------------------------------------------- class IRMemoryMap { public: IRMemoryMap(lldb::TargetSP target_sp); diff --git a/lldb/include/lldb/Expression/LLVMUserExpression.h b/lldb/include/lldb/Expression/LLVMUserExpression.h index fec3b97..c2af723 100644 --- a/lldb/include/lldb/Expression/LLVMUserExpression.h +++ b/lldb/include/lldb/Expression/LLVMUserExpression.h @@ -19,7 +19,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class LLVMUserExpression LLVMUserExpression.h /// "lldb/Expression/LLVMUserExpression.h" Encapsulates a one-time expression /// for use in lldb. @@ -30,7 +29,6 @@ namespace lldb_private { /// expression. The actual parsing part will be provided by the specific /// implementations of LLVMUserExpression - which will be vended through the /// appropriate TypeSystem. -//---------------------------------------------------------------------- class LLVMUserExpression : public UserExpression { public: /// LLVM-style RTTI support. @@ -65,10 +63,8 @@ public: bool CanInterpret() override { return m_can_interpret; } - //------------------------------------------------------------------ /// Return the string that the parser should parse. Must be a full /// translation unit. - //------------------------------------------------------------------ const char *Text() override { return m_transformed_text.c_str(); } lldb::ModuleSP GetJITModule() override; diff --git a/lldb/include/lldb/Expression/REPL.h b/lldb/include/lldb/Expression/REPL.h index 406fa21..850d2f6 100644 --- a/lldb/include/lldb/Expression/REPL.h +++ b/lldb/include/lldb/Expression/REPL.h @@ -20,9 +20,7 @@ namespace lldb_private { class REPL : public IOHandlerDelegate { public: - //---------------------------------------------------------------------- // See TypeSystem.h for how to add subclasses to this. - //---------------------------------------------------------------------- enum LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds }; LLVMCastKind getKind() const { return m_kind; } @@ -31,7 +29,6 @@ public: ~REPL() override; - //------------------------------------------------------------------ /// Get a REPL with an existing target (or, failing that, a debugger to use), /// and (optional) extra arguments for the compiler. /// @@ -55,7 +52,6 @@ public: /// /// \return /// The range of the containing object in the target process. - //------------------------------------------------------------------ static lldb::REPLSP Create(Status &Status, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); @@ -82,9 +78,7 @@ public: Status RunLoop(); - //------------------------------------------------------------------ // IOHandler::Delegate functions - //------------------------------------------------------------------ void IOHandlerActivated(IOHandler &io_handler, bool interactive) override; bool IOHandlerInterrupt(IOHandler &io_handler) override; @@ -117,9 +111,7 @@ public: protected: static int CalculateActualIndentation(const StringList &lines); - //---------------------------------------------------------------------- // Subclasses should override these functions to implement a functional REPL. - //---------------------------------------------------------------------- virtual Status DoInitialization() = 0; diff --git a/lldb/include/lldb/Expression/UserExpression.h b/lldb/include/lldb/Expression/UserExpression.h index 8562c20..b1d52f8 100644 --- a/lldb/include/lldb/Expression/UserExpression.h +++ b/lldb/include/lldb/Expression/UserExpression.h @@ -23,7 +23,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class UserExpression UserExpression.h "lldb/Expression/UserExpression.h" /// Encapsulates a one-time expression for use in lldb. /// @@ -33,7 +32,6 @@ namespace lldb_private { /// JIT an expression. The actual parsing part will be provided by the specific /// implementations of UserExpression - which will be vended through the /// appropriate TypeSystem. -//---------------------------------------------------------------------- class UserExpression : public Expression { public: /// LLVM-style RTTI support. @@ -43,7 +41,6 @@ public: enum { kDefaultTimeout = 500000u }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] expr @@ -61,19 +58,15 @@ public: /// \param[in] desired_type /// If not eResultTypeAny, the type to use for the expression /// result. - //------------------------------------------------------------------ UserExpression(ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options, ExpressionKind kind); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~UserExpression() override; - //------------------------------------------------------------------ /// Parse the expression /// /// \param[in] diagnostic_manager @@ -93,13 +86,11 @@ public: /// /// \return /// True on success (no errors); false otherwise. - //------------------------------------------------------------------ virtual bool Parse(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info) = 0; - //------------------------------------------------------------------ /// Attempts to find possible command line completions for the given /// (possible incomplete) user expression. /// @@ -121,7 +112,6 @@ public: /// \return /// True if we added any completion results to the output; /// false otherwise. - //------------------------------------------------------------------ virtual bool Complete(ExecutionContext &exe_ctx, CompletionRequest &request, unsigned complete_pos) { return false; @@ -131,7 +121,6 @@ public: bool MatchesContext(ExecutionContext &exe_ctx); - //------------------------------------------------------------------ /// Execute the parsed expression by callinng the derived class's DoExecute /// method. /// @@ -158,14 +147,12 @@ public: /// /// \return /// A Process::Execution results value. - //------------------------------------------------------------------ lldb::ExpressionResults Execute(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, lldb::UserExpressionSP &shared_ptr_to_me, lldb::ExpressionVariableSP &result); - //------------------------------------------------------------------ /// Apply the side effects of the function to program state. /// /// \param[in] diagnostic_manager @@ -187,49 +174,34 @@ public: /// /// \return /// A Process::Execution results value. - //------------------------------------------------------------------ virtual bool FinalizeJITExecution( DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb::ExpressionVariableSP &result, lldb::addr_t function_stack_bottom = LLDB_INVALID_ADDRESS, lldb::addr_t function_stack_top = LLDB_INVALID_ADDRESS) = 0; - //------------------------------------------------------------------ /// Return the string that the parser should parse. - //------------------------------------------------------------------ const char *Text() override { return m_expr_text.c_str(); } - //------------------------------------------------------------------ /// Return the string that the user typed. - //------------------------------------------------------------------ const char *GetUserText() { return m_expr_text.c_str(); } - //------------------------------------------------------------------ /// Return the function name that should be used for executing the /// expression. Text() should contain the definition of this function. - //------------------------------------------------------------------ const char *FunctionName() override { return "$__lldb_expr"; } - //------------------------------------------------------------------ /// Return the language that should be used when parsing. To use the /// default, return eLanguageTypeUnknown. - //------------------------------------------------------------------ lldb::LanguageType Language() override { return m_language; } - //------------------------------------------------------------------ /// Return the desired result type of the function, or eResultTypeAny if /// indifferent. - //------------------------------------------------------------------ ResultType DesiredResultType() override { return m_desired_type; } - //------------------------------------------------------------------ /// Return true if validation code should be inserted into the expression. - //------------------------------------------------------------------ bool NeedsValidation() override { return true; } - //------------------------------------------------------------------ /// Return true if external variables in the expression should be resolved. - //------------------------------------------------------------------ bool NeedsVariableResolution() override { return true; } EvaluateExpressionOptions *GetOptions() override { return &m_options; } @@ -241,7 +213,6 @@ public: virtual lldb::ModuleSP GetJITModule() { return lldb::ModuleSP(); } - //------------------------------------------------------------------ /// Evaluate one expression in the scratch context of the target passed in /// the exe_ctx and return its result. /// @@ -287,7 +258,6 @@ public: /// \result /// A Process::ExpressionResults value. eExpressionCompleted for /// success. - //------------------------------------------------------------------ static lldb::ExpressionResults Evaluate(ExecutionContext &exe_ctx, const EvaluateExpressionOptions &options, llvm::StringRef expr_cstr, llvm::StringRef expr_prefix, @@ -316,10 +286,8 @@ protected: static lldb::addr_t GetObjectPointer(lldb::StackFrameSP frame_sp, ConstString &object_name, Status &err); - //------------------------------------------------------------------ /// Populate m_in_cplusplus_method and m_in_objectivec_method based on the /// environment. - //------------------------------------------------------------------ void InstallContext(ExecutionContext &exe_ctx); diff --git a/lldb/include/lldb/Expression/UtilityFunction.h b/lldb/include/lldb/Expression/UtilityFunction.h index 48386a8..26da081 100644 --- a/lldb/include/lldb/Expression/UtilityFunction.h +++ b/lldb/include/lldb/Expression/UtilityFunction.h @@ -19,7 +19,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class UtilityFunction UtilityFunction.h /// "lldb/Expression/UtilityFunction.h" Encapsulates a bit of source code that /// provides a function that is callable @@ -28,7 +27,6 @@ namespace lldb_private { /// and as a backend for the expr command. UtilityFunction encapsulates a /// self-contained function meant to be used from other code. Utility /// functions can perform error-checking for ClangUserExpressions, -//---------------------------------------------------------------------- class UtilityFunction : public Expression { public: /// LLVM-style RTTI support. @@ -36,7 +34,6 @@ public: return E->getKind() == eKindUtilityFunction; } - //------------------------------------------------------------------ /// Constructor /// /// \param[in] text @@ -44,13 +41,11 @@ public: /// /// \param[in] name /// The name of the function, as used in the text. - //------------------------------------------------------------------ UtilityFunction(ExecutionContextScope &exe_scope, const char *text, const char *name, ExpressionKind kind); ~UtilityFunction() override; - //------------------------------------------------------------------ /// Install the utility function into a process /// /// \param[in] diagnostic_manager @@ -61,11 +56,9 @@ public: /// /// \return /// True on success (no errors); false otherwise. - //------------------------------------------------------------------ virtual bool Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) = 0; - //------------------------------------------------------------------ /// Check whether the given PC is inside the function /// /// Especially useful if the function dereferences nullptr to indicate a @@ -77,39 +70,28 @@ public: /// \return /// True if the program counter falls within the function's bounds; /// false if not (or the function is not JIT compiled) - //------------------------------------------------------------------ bool ContainsAddress(lldb::addr_t address) { // nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS, so // this always returns false if the function is not JIT compiled yet return (address >= m_jit_start_addr && address < m_jit_end_addr); } - //------------------------------------------------------------------ /// Return the string that the parser should parse. Must be a full /// translation unit. - //------------------------------------------------------------------ const char *Text() override { return m_function_text.c_str(); } - //------------------------------------------------------------------ /// Return the function name that should be used for executing the /// expression. Text() should contain the definition of this function. - //------------------------------------------------------------------ const char *FunctionName() override { return m_function_name.c_str(); } - //------------------------------------------------------------------ /// Return the object that the parser should use when registering local /// variables. May be nullptr if the Expression doesn't care. - //------------------------------------------------------------------ ExpressionVariableList *LocalVariables() { return nullptr; } - //------------------------------------------------------------------ /// Return true if validation code should be inserted into the expression. - //------------------------------------------------------------------ bool NeedsValidation() override { return false; } - //------------------------------------------------------------------ /// Return true if external variables in the expression should be resolved. - //------------------------------------------------------------------ bool NeedsVariableResolution() override { return false; } // This makes the function caller function. Pass in the ThreadSP if you have diff --git a/lldb/include/lldb/Host/Debug.h b/lldb/include/lldb/Host/Debug.h index f8fd564..036ce1e 100644 --- a/lldb/include/lldb/Host/Debug.h +++ b/lldb/include/lldb/Host/Debug.h @@ -15,9 +15,7 @@ namespace lldb_private { -//------------------------------------------------------------------ // Tells a thread what it needs to do when the process is resumed. -//------------------------------------------------------------------ struct ResumeAction { lldb::tid_t tid; // The thread ID that this action applies to, // LLDB_INVALID_THREAD_ID for the default thread @@ -28,12 +26,10 @@ struct ResumeAction { // value is > 0 }; -//------------------------------------------------------------------ // A class that contains instructions for all threads for // NativeProcessProtocol::Resume(). Each thread can either run, stay suspended, // or step when the process is resumed. We optionally have the ability to also // send a signal to the thread when the action is run or step. -//------------------------------------------------------------------ class ResumeActionList { public: ResumeActionList() : m_actions(), m_signal_handled() {} diff --git a/lldb/include/lldb/Host/File.h b/lldb/include/lldb/Host/File.h index 90d4fa9..eb28c4a 100644 --- a/lldb/include/lldb/Host/File.h +++ b/lldb/include/lldb/Host/File.h @@ -21,13 +21,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class File File.h "lldb/Host/File.h" /// A file class. /// /// A file class that divides abstracts the LLDB core from host file /// functionality. -//---------------------------------------------------------------------- class File : public IOObject { public: static int kInvalidDescriptor; @@ -72,18 +70,15 @@ public: m_is_interactive(eLazyBoolCalculate), m_is_real_terminal(eLazyBoolCalculate) {} - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual in case this class is subclassed. - //------------------------------------------------------------------ ~File() override; bool IsValid() const override { return DescriptorIsValid() || StreamIsValid(); } - //------------------------------------------------------------------ /// Convert to pointer operator. /// /// This allows code to check a File object to see if it contains anything @@ -98,10 +93,8 @@ public: /// \return /// A pointer to this object if either the directory or filename /// is valid, nullptr otherwise. - //------------------------------------------------------------------ operator bool() const { return DescriptorIsValid() || StreamIsValid(); } - //------------------------------------------------------------------ /// Logical NOT operator. /// /// This allows code to check a File object to see if it is invalid using @@ -116,15 +109,12 @@ public: /// \return /// Returns \b true if the object has an empty directory and /// filename, \b false otherwise. - //------------------------------------------------------------------ bool operator!() const { return !DescriptorIsValid() && !StreamIsValid(); } - //------------------------------------------------------------------ /// Get the file spec for this file. /// /// \return /// A reference to the file specification object. - //------------------------------------------------------------------ Status GetFileSpec(FileSpec &file_spec) const; Status Close() override; @@ -141,7 +131,6 @@ public: void SetStream(FILE *fh, bool transfer_ownership); - //------------------------------------------------------------------ /// Read bytes from a file from the current file position. /// /// NOTE: This function is NOT thread safe. Use the read function @@ -158,10 +147,8 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Read(void *buf, size_t &num_bytes) override; - //------------------------------------------------------------------ /// Write bytes to a file at the current file position. /// /// NOTE: This function is NOT thread safe. Use the write function @@ -179,10 +166,8 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Write(const void *buf, size_t &num_bytes) override; - //------------------------------------------------------------------ /// Seek to an offset relative to the beginning of the file. /// /// NOTE: This function is NOT thread safe, other threads that @@ -201,10 +186,8 @@ public: /// /// \return /// The resulting seek offset, or -1 on error. - //------------------------------------------------------------------ off_t SeekFromStart(off_t offset, Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Seek to an offset relative to the current file position. /// /// NOTE: This function is NOT thread safe, other threads that @@ -223,10 +206,8 @@ public: /// /// \return /// The resulting seek offset, or -1 on error. - //------------------------------------------------------------------ off_t SeekFromCurrent(off_t offset, Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Seek to an offset relative to the end of the file. /// /// NOTE: This function is NOT thread safe, other threads that @@ -246,10 +227,8 @@ public: /// /// \return /// The resulting seek offset, or -1 on error. - //------------------------------------------------------------------ off_t SeekFromEnd(off_t offset, Status *error_ptr = nullptr); - //------------------------------------------------------------------ /// Read bytes from a file from the specified file offset. /// /// NOTE: This function is thread safe in that clients manager their @@ -271,10 +250,8 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Read(void *dst, size_t &num_bytes, off_t &offset); - //------------------------------------------------------------------ /// Read bytes from a file from the specified file offset. /// /// NOTE: This function is thread safe in that clients manager their @@ -302,11 +279,9 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Read(size_t &num_bytes, off_t &offset, bool null_terminate, lldb::DataBufferSP &data_buffer_sp); - //------------------------------------------------------------------ /// Write bytes to a file at the specified file offset. /// /// NOTE: This function is thread safe in that clients manager their @@ -330,46 +305,36 @@ public: /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Write(const void *src, size_t &num_bytes, off_t &offset); - //------------------------------------------------------------------ /// Flush the current stream /// /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Flush(); - //------------------------------------------------------------------ /// Sync to disk. /// /// \return /// An error object that indicates success or the reason for /// failure. - //------------------------------------------------------------------ Status Sync(); - //------------------------------------------------------------------ /// Get the permissions for a this file. /// /// \return /// Bits logical OR'ed together from the permission bits defined /// in lldb_private::File::Permissions. - //------------------------------------------------------------------ uint32_t GetPermissions(Status &error) const; - //------------------------------------------------------------------ /// Return true if this file is interactive. /// /// \return /// True if this file is a terminal (tty or pty), false /// otherwise. - //------------------------------------------------------------------ bool GetIsInteractive(); - //------------------------------------------------------------------ /// Return true if this file from a real terminal. /// /// Just knowing a file is a interactive isn't enough, we also need to know @@ -379,12 +344,10 @@ public: /// \return /// True if this file is a terminal (tty, not a pty) that has /// a non-zero width and height, false otherwise. - //------------------------------------------------------------------ bool GetIsRealTerminal(); bool GetIsTerminalWithColors(); - //------------------------------------------------------------------ /// Output printf formatted output to the stream. /// /// Print some formatted output to the stream. @@ -395,7 +358,6 @@ public: /// \param[in] ... /// Variable arguments that are needed for the printf style /// format string \a format. - //------------------------------------------------------------------ size_t Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); size_t PrintfVarArg(const char *format, va_list args); @@ -411,9 +373,7 @@ protected: void CalculateInteractiveAndTerminal(); - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ int m_descriptor; FILE *m_stream; uint32_t m_options; diff --git a/lldb/include/lldb/Host/Host.h b/lldb/include/lldb/Host/Host.h index b4230ba..b289283 100644 --- a/lldb/include/lldb/Host/Host.h +++ b/lldb/include/lldb/Host/Host.h @@ -30,9 +30,7 @@ class ProcessInstanceInfo; class ProcessInstanceInfoList; class ProcessInstanceInfoMatch; -//---------------------------------------------------------------------- // Exit Type for inferior processes -//---------------------------------------------------------------------- struct WaitStatus { enum Type : uint8_t { Exit, // The status represents the return code from normal @@ -57,12 +55,10 @@ inline bool operator==(WaitStatus a, WaitStatus b) { inline bool operator!=(WaitStatus a, WaitStatus b) { return !(a == b); } -//---------------------------------------------------------------------- /// \class Host Host.h "lldb/Host/Host.h" /// A class that provides host computer information. /// /// Host is a class that answers information about the host operating system. -//---------------------------------------------------------------------- class Host { public: typedef std::function<bool( @@ -71,7 +67,6 @@ public: int status)> // Exit value of process if signal is zero MonitorChildProcessCallback; - //------------------------------------------------------------------ /// Start monitoring a child process. /// /// Allows easy monitoring of child processes. \a callback will be called @@ -104,7 +99,6 @@ public: /// was spawned to monitor \a pid. /// /// \see static void Host::StopMonitoringChildProcess (uint32_t) - //------------------------------------------------------------------ static HostThread StartMonitoringChildProcess(const MonitorChildProcessCallback &callback, lldb::pid_t pid, bool monitor_signals); @@ -116,28 +110,23 @@ public: static void SystemLog(SystemLogType type, const char *format, va_list args); - //------------------------------------------------------------------ /// Get the process ID for the calling process. /// /// \return /// The process ID for the current process. - //------------------------------------------------------------------ static lldb::pid_t GetCurrentProcessID(); static void Kill(lldb::pid_t pid, int signo); - //------------------------------------------------------------------ /// Get the thread token (the one returned by ThreadCreate when the thread /// was created) for the calling thread in the current process. /// /// \return /// The thread token for the calling thread in the current process. - //------------------------------------------------------------------ static lldb::thread_t GetCurrentThread(); static const char *GetSignalAsCString(int signo); - //------------------------------------------------------------------ /// Given an address in the current process (the process that is running the /// LLDB code), return the name of the module that it comes from. This can /// be useful when you need to know the path to the shared library that your @@ -151,10 +140,8 @@ public: /// \b A file spec with the module that contains \a host_addr, /// which may be invalid if \a host_addr doesn't fall into /// any valid module address range. - //------------------------------------------------------------------ static FileSpec GetModuleFileSpecForHostAddress(const void *host_addr); - //------------------------------------------------------------------ /// If you have an executable that is in a bundle and want to get back to /// the bundle directory from the path itself, this function will change a /// path to a file within a bundle to the bundle directory itself. @@ -170,11 +157,9 @@ public: /// \return /// \b true if \a file was resolved in \a bundle_directory, /// \b false otherwise. - //------------------------------------------------------------------ static bool GetBundleDirectory(const FileSpec &file, FileSpec &bundle_directory); - //------------------------------------------------------------------ /// When executable files may live within a directory, where the directory /// represents an executable bundle (like the MacOSX app bundles), then /// locate the executable within the containing bundle. @@ -187,7 +172,6 @@ public: /// \return /// \b true if \a file was resolved, \b false if this function /// was not able to resolve the path. - //------------------------------------------------------------------ static bool ResolveExecutableInBundle(FileSpec &file); static uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info, @@ -204,13 +188,11 @@ public: /// terminates. static Status LaunchProcess(ProcessLaunchInfo &launch_info); - //------------------------------------------------------------------ /// Perform expansion of the command-line for this launch info This can /// potentially involve wildcard expansion /// environment variable replacement, and whatever other /// argument magic the platform defines as part of its typical /// user experience - //------------------------------------------------------------------ static Status ShellExpandArguments(ProcessLaunchInfo &launch_info); // TODO: Convert this function to take a StringRef. diff --git a/lldb/include/lldb/Host/HostInfo.h b/lldb/include/lldb/Host/HostInfo.h index e81ef465..feb8957 100644 --- a/lldb/include/lldb/Host/HostInfo.h +++ b/lldb/include/lldb/Host/HostInfo.h @@ -9,7 +9,6 @@ #ifndef lldb_Host_HostInfo_h_ #define lldb_Host_HostInfo_h_ -//---------------------------------------------------------------------- /// \class HostInfo HostInfo.h "lldb/Host/HostInfo.h" /// A class that provides host computer information. /// @@ -32,7 +31,6 @@ /// method and if used in a context where the method doesn't make sense, will /// generate a compiler error. /// -//---------------------------------------------------------------------- #if defined(_WIN32) #include "lldb/Host/windows/HostInfoWindows.h" diff --git a/lldb/include/lldb/Host/HostInfoBase.h b/lldb/include/lldb/Host/HostInfoBase.h index 72cd7c7..6f66889 100644 --- a/lldb/include/lldb/Host/HostInfoBase.h +++ b/lldb/include/lldb/Host/HostInfoBase.h @@ -33,21 +33,17 @@ public: static void Initialize(); static void Terminate(); - //------------------------------------------------------------------ /// Gets the host target triple as a const string. /// /// \return /// A const string object containing the host target triple. - //------------------------------------------------------------------ static llvm::StringRef GetTargetTriple(); - //------------------------------------------------------------------ /// Gets the host architecture. /// /// \return /// A const architecture object that represents the host /// architecture. - //------------------------------------------------------------------ enum ArchitectureKind { eArchKindDefault, // The overall default architecture that applications will // run on this host @@ -92,11 +88,9 @@ public: /// FileSpec is filled in. static FileSpec GetGlobalTempDir(); - //--------------------------------------------------------------------------- /// If the triple does not specify the vendor, os, and environment parts, we /// "augment" these using information from the host and return the resulting /// ArchSpec object. - //--------------------------------------------------------------------------- static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple); static bool ComputePathRelativeToLibrary(FileSpec &file_spec, diff --git a/lldb/include/lldb/Host/HostProcess.h b/lldb/include/lldb/Host/HostProcess.h index 926d37e..56eaa46 100644 --- a/lldb/include/lldb/Host/HostProcess.h +++ b/lldb/include/lldb/Host/HostProcess.h @@ -12,7 +12,6 @@ #include "lldb/Host/Host.h" #include "lldb/lldb-types.h" -//---------------------------------------------------------------------- /// \class HostInfo HostInfo.h "lldb/Host/HostProcess.h" /// A class that represents a running process on the host machine. /// @@ -26,7 +25,6 @@ /// statically to the concrete Process implementation for that platform. See /// HostInfo for more details. /// -//---------------------------------------------------------------------- namespace lldb_private { diff --git a/lldb/include/lldb/Host/HostThread.h b/lldb/include/lldb/Host/HostThread.h index c5544e8..7bf2a1d 100644 --- a/lldb/include/lldb/Host/HostThread.h +++ b/lldb/include/lldb/Host/HostThread.h @@ -19,7 +19,6 @@ namespace lldb_private { class HostNativeThreadBase; -//---------------------------------------------------------------------- /// \class HostInfo HostInfo.h "lldb/Host/HostThread.h" /// A class that represents a thread running inside of a process on the /// local machine. @@ -27,7 +26,6 @@ class HostNativeThreadBase; /// HostThread allows querying and manipulation of threads running on the host /// machine. /// -//---------------------------------------------------------------------- class HostThread { public: HostThread(); diff --git a/lldb/include/lldb/Host/ProcessLaunchInfo.h b/lldb/include/lldb/Host/ProcessLaunchInfo.h index 94d0108..d068aa6 100644 --- a/lldb/include/lldb/Host/ProcessLaunchInfo.h +++ b/lldb/include/lldb/Host/ProcessLaunchInfo.h @@ -23,11 +23,9 @@ namespace lldb_private { -//---------------------------------------------------------------------- // ProcessLaunchInfo // // Describes any information that is required to launch a process. -//---------------------------------------------------------------------- class ProcessLaunchInfo : public ProcessInfo { public: diff --git a/lldb/include/lldb/Host/ProcessRunLock.h b/lldb/include/lldb/Host/ProcessRunLock.h index 527bcce..4927fbb 100644 --- a/lldb/include/lldb/Host/ProcessRunLock.h +++ b/lldb/include/lldb/Host/ProcessRunLock.h @@ -14,17 +14,13 @@ #include "lldb/lldb-defines.h" -//---------------------------------------------------------------------- /// Enumerations for broadcasting. -//---------------------------------------------------------------------- namespace lldb_private { -//---------------------------------------------------------------------- /// \class ProcessRunLock ProcessRunLock.h "lldb/Host/ProcessRunLock.h" /// A class used to prevent the process from starting while other /// threads are accessing its data, and prevent access to its data while it is /// running. -//---------------------------------------------------------------------- class ProcessRunLock { public: diff --git a/lldb/include/lldb/Host/PseudoTerminal.h b/lldb/include/lldb/Host/PseudoTerminal.h index ed60647..8b27890 100644 --- a/lldb/include/lldb/Host/PseudoTerminal.h +++ b/lldb/include/lldb/Host/PseudoTerminal.h @@ -16,47 +16,36 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class PseudoTerminal PseudoTerminal.h "lldb/Host/PseudoTerminal.h" /// A pseudo terminal helper class. /// /// The pseudo terminal class abstracts the use of pseudo terminals on the /// host system. -//---------------------------------------------------------------------- class PseudoTerminal { public: enum { invalid_fd = -1 ///< Invalid file descriptor value }; - //------------------------------------------------------------------ /// Default constructor /// /// Constructs this object with invalid master and slave file descriptors. - //------------------------------------------------------------------ PseudoTerminal(); - //------------------------------------------------------------------ /// Destructor /// /// The destructor will close the master and slave file descriptors if they /// are valid and ownership has not been released using one of: @li /// PseudoTerminal::ReleaseMasterFileDescriptor() @li /// PseudoTerminal::ReleaseSaveFileDescriptor() - //------------------------------------------------------------------ ~PseudoTerminal(); - //------------------------------------------------------------------ /// Close the master file descriptor if it is valid. - //------------------------------------------------------------------ void CloseMasterFileDescriptor(); - //------------------------------------------------------------------ /// Close the slave file descriptor if it is valid. - //------------------------------------------------------------------ void CloseSlaveFileDescriptor(); - //------------------------------------------------------------------ /// Fork a child process that uses pseudo terminals for its stdio. /// /// In the parent process, a call to this function results in a pid being @@ -80,10 +69,8 @@ public: /// \li \b Parent process: a child process ID that is greater /// than zero, or -1 if the fork fails. /// \li \b Child process: zero. - //------------------------------------------------------------------ lldb::pid_t Fork(char *error_str, size_t error_len); - //------------------------------------------------------------------ /// The master file descriptor accessor. /// /// This object retains ownership of the master file descriptor when this @@ -96,10 +83,8 @@ public: /// if the master file descriptor is not currently valid. /// /// \see PseudoTerminal::ReleaseMasterFileDescriptor() - //------------------------------------------------------------------ int GetMasterFileDescriptor() const; - //------------------------------------------------------------------ /// The slave file descriptor accessor. /// /// This object retains ownership of the slave file descriptor when this @@ -112,10 +97,8 @@ public: /// if the slave file descriptor is not currently valid. /// /// \see PseudoTerminal::ReleaseSlaveFileDescriptor() - //------------------------------------------------------------------ int GetSlaveFileDescriptor() const; - //------------------------------------------------------------------ /// Get the name of the slave pseudo terminal. /// /// A master pseudo terminal should already be valid prior to @@ -134,10 +117,8 @@ public: /// \c ptsname() fails. /// /// \see PseudoTerminal::OpenFirstAvailableMaster() - //------------------------------------------------------------------ const char *GetSlaveName(char *error_str, size_t error_len) const; - //------------------------------------------------------------------ /// Open the first available pseudo terminal. /// /// Opens the first available pseudo terminal with \a oflag as the @@ -166,10 +147,8 @@ public: /// /// \see PseudoTerminal::GetMasterFileDescriptor() @see /// PseudoTerminal::ReleaseMasterFileDescriptor() - //------------------------------------------------------------------ bool OpenFirstAvailableMaster(int oflag, char *error_str, size_t error_len); - //------------------------------------------------------------------ /// Open the slave for the current master pseudo terminal. /// /// A master pseudo terminal should already be valid prior to @@ -198,10 +177,8 @@ public: /// \see PseudoTerminal::OpenFirstAvailableMaster() @see /// PseudoTerminal::GetSlaveFileDescriptor() @see /// PseudoTerminal::ReleaseSlaveFileDescriptor() - //------------------------------------------------------------------ bool OpenSlave(int oflag, char *error_str, size_t error_len); - //------------------------------------------------------------------ /// Release the master file descriptor. /// /// Releases ownership of the master pseudo terminal file descriptor without @@ -212,10 +189,8 @@ public: /// \return /// The master file descriptor, or PseudoTerminal::invalid_fd /// if the mast file descriptor is not currently valid. - //------------------------------------------------------------------ int ReleaseMasterFileDescriptor(); - //------------------------------------------------------------------ /// Release the slave file descriptor. /// /// Release ownership of the slave pseudo terminal file descriptor without @@ -226,13 +201,10 @@ public: /// \return /// The slave file descriptor, or PseudoTerminal::invalid_fd /// if the slave file descriptor is not currently valid. - //------------------------------------------------------------------ int ReleaseSlaveFileDescriptor(); protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ int m_master_fd; ///< The file descriptor for the master. int m_slave_fd; ///< The file descriptor for the slave. diff --git a/lldb/include/lldb/Host/SocketAddress.h b/lldb/include/lldb/Host/SocketAddress.h index 8bf884e..a655c82 100644 --- a/lldb/include/lldb/Host/SocketAddress.h +++ b/lldb/include/lldb/Host/SocketAddress.h @@ -33,16 +33,12 @@ namespace lldb_private { class SocketAddress { public: - //---------------------------------------------------------------------------- // Static method to get all address information for a host and/or service - //---------------------------------------------------------------------------- static std::vector<SocketAddress> GetAddressInfo(const char *hostname, const char *servname, int ai_family, int ai_socktype, int ai_protocol, int ai_flags = 0); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SocketAddress(); SocketAddress(const struct addrinfo *addr_info); SocketAddress(const struct sockaddr &s); @@ -52,9 +48,7 @@ public: SocketAddress(const SocketAddress &rhs); ~SocketAddress(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const SocketAddress &operator=(const SocketAddress &rhs); const SocketAddress &operator=(const struct addrinfo *addr_info); @@ -70,53 +64,35 @@ public: bool operator==(const SocketAddress &rhs) const; bool operator!=(const SocketAddress &rhs) const; - //------------------------------------------------------------------ // Clear the contents of this socket address - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ // Get the length for the current socket address family - //------------------------------------------------------------------ socklen_t GetLength() const; - //------------------------------------------------------------------ // Get the max length for the largest socket address supported. - //------------------------------------------------------------------ static socklen_t GetMaxLength(); - //------------------------------------------------------------------ // Get the socket address family - //------------------------------------------------------------------ sa_family_t GetFamily() const; - //------------------------------------------------------------------ // Set the socket address family - //------------------------------------------------------------------ void SetFamily(sa_family_t family); - //------------------------------------------------------------------ // Get the address - //------------------------------------------------------------------ std::string GetIPAddress() const; - //------------------------------------------------------------------ // Get the port if the socket address for the family has a port - //------------------------------------------------------------------ uint16_t GetPort() const; - //------------------------------------------------------------------ // Set the port if the socket address for the family has a port. The family // must be set correctly prior to calling this function. - //------------------------------------------------------------------ bool SetPort(uint16_t port); - //------------------------------------------------------------------ // Set the socket address according to the first match from a call to // getaddrinfo() (or equivalent functions for systems that don't have // getaddrinfo(). If "addr_info_ptr" is not NULL, it will get filled in with // the match that was used to populate this socket address. - //------------------------------------------------------------------ bool getaddrinfo(const char *host, // Hostname ("foo.bar.com" or "foo" or IP // address string ("123.234.12.1" or @@ -126,33 +102,23 @@ public: int ai_family = PF_UNSPEC, int ai_socktype = 0, int ai_protocol = 0, int ai_flags = 0); - //------------------------------------------------------------------ // Quick way to set the SocketAddress to localhost given the family. Returns // true if successful, false if "family" doesn't support localhost or if // "family" is not supported by this class. - //------------------------------------------------------------------ bool SetToLocalhost(sa_family_t family, uint16_t port); bool SetToAnyAddress(sa_family_t family, uint16_t port); - //------------------------------------------------------------------ // Returns true if there is a valid socket address in this object. - //------------------------------------------------------------------ bool IsValid() const; - //------------------------------------------------------------------ // Returns true if the socket is INADDR_ANY - //------------------------------------------------------------------ bool IsAnyAddr() const; - //------------------------------------------------------------------ // Returns true if the socket is INADDR_LOOPBACK - //------------------------------------------------------------------ bool IsLocalhost() const; - //------------------------------------------------------------------ // Direct access to all of the sockaddr structures - //------------------------------------------------------------------ struct sockaddr &sockaddr() { return m_socket_addr.sa; } @@ -183,12 +149,10 @@ public: return m_socket_addr.sa_storage; } - //------------------------------------------------------------------ // Conversion operators to allow getting the contents of this class as a // pointer to the appropriate structure. This allows an instance of this // class to be used in calls that take one of the sockaddr structure variants // without having to manually use the correct accessor function. - //------------------------------------------------------------------ operator struct sockaddr *() { return &m_socket_addr.sa; } @@ -218,9 +182,7 @@ protected: struct sockaddr_storage sa_storage; } sockaddr_t; - //------------------------------------------------------------------ // Classes that inherit from SocketAddress can see and modify these - //------------------------------------------------------------------ sockaddr_t m_socket_addr; }; diff --git a/lldb/include/lldb/Host/StringConvert.h b/lldb/include/lldb/Host/StringConvert.h index 1b3b7df..4b2c6901 100644 --- a/lldb/include/lldb/Host/StringConvert.h +++ b/lldb/include/lldb/Host/StringConvert.h @@ -17,10 +17,8 @@ namespace lldb_private { namespace StringConvert { -//---------------------------------------------------------------------- /// \namespace StringConvert StringConvert.h "lldb/Host/StringConvert.h" /// Utility classes for converting strings into Integers -//---------------------------------------------------------------------- int32_t ToSInt32(const char *s, int32_t fail_value = 0, int base = 0, bool *success_ptr = nullptr); diff --git a/lldb/include/lldb/Host/Terminal.h b/lldb/include/lldb/Host/Terminal.h index ceb42e3..e5e96ee 100644 --- a/lldb/include/lldb/Host/Terminal.h +++ b/lldb/include/lldb/Host/Terminal.h @@ -41,26 +41,19 @@ protected: int m_fd; // This may or may not be a terminal file descriptor }; -//---------------------------------------------------------------------- /// \class State Terminal.h "lldb/Host/Terminal.h" /// A terminal state saving/restoring class. /// /// This class can be used to remember the terminal state for a file /// descriptor and later restore that state as it originally was. -//---------------------------------------------------------------------- class TerminalState { public: - //------------------------------------------------------------------ /// Default constructor - //------------------------------------------------------------------ TerminalState(); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~TerminalState(); - //------------------------------------------------------------------ /// Save the TTY state for \a fd. /// /// Save the current state of the TTY for the file descriptor "fd" and if @@ -77,10 +70,8 @@ public: /// \return /// Returns \b true if \a fd describes a TTY and if the state /// was able to be saved, \b false otherwise. - //------------------------------------------------------------------ bool Save(int fd, bool save_process_group); - //------------------------------------------------------------------ /// Restore the TTY state to the cached state. /// /// Restore the state of the TTY using the cached values from a previous @@ -89,52 +80,41 @@ public: /// \return /// Returns \b true if the TTY state was successfully restored, /// \b false otherwise. - //------------------------------------------------------------------ bool Restore() const; - //------------------------------------------------------------------ /// Test for valid cached TTY state information. /// /// \return /// Returns \b true if this object has valid saved TTY state /// settings that can be used to restore a previous state, /// \b false otherwise. - //------------------------------------------------------------------ bool IsValid() const; void Clear(); protected: - //------------------------------------------------------------------ /// Test if tflags is valid. /// /// \return /// Returns \b true if \a m_tflags is valid and can be restored, /// \b false otherwise. - //------------------------------------------------------------------ bool TFlagsIsValid() const; - //------------------------------------------------------------------ /// Test if ttystate is valid. /// /// \return /// Returns \b true if \a m_ttystate is valid and can be /// restored, \b false otherwise. - //------------------------------------------------------------------ bool TTYStateIsValid() const; - //------------------------------------------------------------------ /// Test if the process group information is valid. /// /// \return /// Returns \b true if \a m_process_group is valid and can be /// restored, \b false otherwise. - //------------------------------------------------------------------ bool ProcessGroupIsValid() const; - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ Terminal m_tty; ///< A terminal int m_tflags; ///< Cached tflags information. #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED @@ -144,43 +124,32 @@ protected: lldb::pid_t m_process_group; ///< Cached process group information. }; -//---------------------------------------------------------------------- /// \class TerminalStateSwitcher Terminal.h "lldb/Host/Terminal.h" /// A TTY state switching class. /// /// This class can be used to remember 2 TTY states for a given file /// descriptor and switch between the two states. -//---------------------------------------------------------------------- class TerminalStateSwitcher { public: - //------------------------------------------------------------------ /// Constructor - //------------------------------------------------------------------ TerminalStateSwitcher(); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~TerminalStateSwitcher(); - //------------------------------------------------------------------ /// Get the number of possible states to save. /// /// \return /// The number of states that this TTY switcher object contains. - //------------------------------------------------------------------ uint32_t GetNumberOfStates() const; - //------------------------------------------------------------------ /// Restore the TTY state for state at index \a idx. /// /// \return /// Returns \b true if the TTY state was successfully restored, /// \b false otherwise. - //------------------------------------------------------------------ bool Restore(uint32_t idx) const; - //------------------------------------------------------------------ /// Save the TTY state information for the state at index \a idx. The TTY /// state is saved for the file descriptor \a fd and the process group /// information will also be saved if requested by \a save_process_group. @@ -198,13 +167,10 @@ public: /// \return /// Returns \b true if the save was successful, \b false /// otherwise. - //------------------------------------------------------------------ bool Save(uint32_t idx, int fd, bool save_process_group); protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ mutable uint32_t m_currentState; ///< The currently active TTY state index. TerminalState m_ttystates[2]; ///< The array of TTY states that holds saved TTY info. diff --git a/lldb/include/lldb/Host/XML.h b/lldb/include/lldb/Host/XML.h index e859987..625cf43 100644 --- a/lldb/include/lldb/Host/XML.h +++ b/lldb/include/lldb/Host/XML.h @@ -84,20 +84,14 @@ public: XMLNode GetElementForPath(const NamePath &path); - //---------------------------------------------------------------------- // Iterate through all sibling nodes of any type - //---------------------------------------------------------------------- void ForEachSiblingNode(NodeCallback const &callback) const; - //---------------------------------------------------------------------- // Iterate through only the sibling nodes that are elements - //---------------------------------------------------------------------- void ForEachSiblingElement(NodeCallback const &callback) const; - //---------------------------------------------------------------------- // Iterate through only the sibling nodes that are elements and whose name // matches \a name. - //---------------------------------------------------------------------- void ForEachSiblingElementWithName(const char *name, NodeCallback const &callback) const; @@ -131,10 +125,8 @@ public: bool ParseMemory(const char *xml, size_t xml_length, const char *url = "untitled.xml"); - //---------------------------------------------------------------------- // If \a name is nullptr, just get the root element node, else only return a // value XMLNode if the name of the root element matches \a name. - //---------------------------------------------------------------------- XMLNode GetRootElement(const char *required_name = nullptr); llvm::StringRef GetErrors() const; diff --git a/lldb/include/lldb/Host/common/NativeProcessProtocol.h b/lldb/include/lldb/Host/common/NativeProcessProtocol.h index f927ab0..6ff925a 100644 --- a/lldb/include/lldb/Host/common/NativeProcessProtocol.h +++ b/lldb/include/lldb/Host/common/NativeProcessProtocol.h @@ -32,9 +32,7 @@ namespace lldb_private { class MemoryRegionInfo; class ResumeActionList; -//------------------------------------------------------------------ // NativeProcessProtocol -//------------------------------------------------------------------ class NativeProcessProtocol { public: virtual ~NativeProcessProtocol() {} @@ -45,15 +43,12 @@ public: virtual Status Detach() = 0; - //------------------------------------------------------------------ /// Sends a process a UNIX signal \a signal. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status Signal(int signo) = 0; - //------------------------------------------------------------------ /// Tells a process to interrupt all operations as if by a Ctrl-C. /// /// The default implementation will send a local host's equivalent of @@ -62,20 +57,15 @@ public: /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status Interrupt(); virtual Status Kill() = 0; - //------------------------------------------------------------------ // Tells a process not to stop the inferior on given signals and just // reinject them back. - //------------------------------------------------------------------ virtual Status IgnoreSignals(llvm::ArrayRef<int> signals); - //---------------------------------------------------------------------- // Memory and memory region functions - //---------------------------------------------------------------------- virtual Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info); @@ -102,26 +92,20 @@ public: virtual const ArchSpec &GetArchitecture() const = 0; - //---------------------------------------------------------------------- // Breakpoint functions - //---------------------------------------------------------------------- virtual Status SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) = 0; virtual Status RemoveBreakpoint(lldb::addr_t addr, bool hardware = false); - //---------------------------------------------------------------------- // Hardware Breakpoint functions - //---------------------------------------------------------------------- virtual const HardwareBreakpointMap &GetHardwareBreakpointMap() const; virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size); virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr); - //---------------------------------------------------------------------- // Watchpoint functions - //---------------------------------------------------------------------- virtual const NativeWatchpointList::WatchpointMap &GetWatchpointMap() const; virtual llvm::Optional<std::pair<uint32_t, uint32_t>> @@ -132,9 +116,7 @@ public: virtual Status RemoveWatchpoint(lldb::addr_t addr); - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- lldb::pid_t GetID() const { return m_pid; } lldb::StateType GetState() const; @@ -154,16 +136,12 @@ public: virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> GetAuxvData() const = 0; - //---------------------------------------------------------------------- // Exit Status - //---------------------------------------------------------------------- virtual llvm::Optional<WaitStatus> GetExitStatus(); virtual bool SetExitStatus(WaitStatus status, bool bNotifyStateChange); - //---------------------------------------------------------------------- // Access to threads - //---------------------------------------------------------------------- NativeThreadProtocol *GetThreadAtIndex(uint32_t idx); NativeThreadProtocol *GetThreadByID(lldb::tid_t tid); @@ -176,20 +154,14 @@ public: return GetThreadByID(m_current_thread_id); } - //---------------------------------------------------------------------- // Access to inferior stdio - //---------------------------------------------------------------------- virtual int GetTerminalFileDescriptor() { return m_terminal_fd; } - //---------------------------------------------------------------------- // Stop id interface - //---------------------------------------------------------------------- uint32_t GetStopID() const; - // --------------------------------------------------------------------- // Callbacks for low-level process state changes - // --------------------------------------------------------------------- class NativeDelegate { public: virtual ~NativeDelegate() {} @@ -202,7 +174,6 @@ public: virtual void DidExec(NativeProcessProtocol *process) = 0; }; - //------------------------------------------------------------------ /// Register a native delegate. /// /// Clients can register nofication callbacks by passing in a @@ -220,10 +191,8 @@ public: /// false if the delegate was already registered. /// /// \see NativeProcessProtocol::NativeDelegate. - //------------------------------------------------------------------ bool RegisterNativeDelegate(NativeDelegate &native_delegate); - //------------------------------------------------------------------ /// Unregister a native delegate previously registered. /// /// \param[in] native_delegate @@ -233,7 +202,6 @@ public: /// successfully removed from the process, \b false otherwise. /// /// \see NativeProcessProtocol::NativeDelegate - //------------------------------------------------------------------ bool UnregisterNativeDelegate(NativeDelegate &native_delegate); virtual Status GetLoadedModuleFileSpec(const char *module_path, @@ -245,7 +213,6 @@ public: class Factory { public: virtual ~Factory(); - //------------------------------------------------------------------ /// Launch a process for debugging. /// /// \param[in] launch_info @@ -264,12 +231,10 @@ public: /// \return /// A NativeProcessProtocol shared pointer if the operation succeeded or /// an error object if it failed. - //------------------------------------------------------------------ virtual llvm::Expected<std::unique_ptr<NativeProcessProtocol>> Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const = 0; - //------------------------------------------------------------------ /// Attach to an existing process. /// /// \param[in] pid @@ -288,13 +253,11 @@ public: /// \return /// A NativeProcessProtocol shared pointer if the operation succeeded or /// an error object if it failed. - //------------------------------------------------------------------ virtual llvm::Expected<std::unique_ptr<NativeProcessProtocol>> Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop) const = 0; }; - //------------------------------------------------------------------ /// StartTracing API for starting a tracing instance with the /// TraceOptions on a specific thread or process. /// @@ -310,14 +273,12 @@ public: /// The user_id is a key to identify and operate with a tracing /// instance. It may refer to the complete process or a single /// thread. - //------------------------------------------------------------------ virtual lldb::user_id_t StartTrace(const TraceOptions &config, Status &error) { error.SetErrorString("Not implemented"); return LLDB_INVALID_UID; } - //------------------------------------------------------------------ /// StopTracing API as the name suggests stops a tracing instance. /// /// \param[in] traceid @@ -332,13 +293,11 @@ public: /// /// \return /// Status indicating what went wrong. - //------------------------------------------------------------------ virtual Status StopTrace(lldb::user_id_t traceid, lldb::tid_t thread = LLDB_INVALID_THREAD_ID) { return Status("Not implemented"); } - //------------------------------------------------------------------ /// This API provides the trace data collected in the form of raw /// data. /// @@ -358,24 +317,20 @@ public: /// /// \return /// The size of the data actually read. - //------------------------------------------------------------------ virtual Status GetData(lldb::user_id_t traceid, lldb::tid_t thread, llvm::MutableArrayRef<uint8_t> &buffer, size_t offset = 0) { return Status("Not implemented"); } - //------------------------------------------------------------------ /// Similar API as above except it aims to provide any extra data /// useful for decoding the actual trace data. - //------------------------------------------------------------------ virtual Status GetMetaData(lldb::user_id_t traceid, lldb::tid_t thread, llvm::MutableArrayRef<uint8_t> &buffer, size_t offset = 0) { return Status("Not implemented"); } - //------------------------------------------------------------------ /// API to query the TraceOptions for a given user id /// /// \param[in] traceid @@ -391,7 +346,6 @@ public: /// /// \param[out] config /// The actual configuration being used for tracing. - //------------------------------------------------------------------ virtual Status GetTraceConfig(lldb::user_id_t traceid, TraceOptions &config) { return Status("Not implemented"); } @@ -433,9 +387,7 @@ protected: NativeProcessProtocol(lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate); - // ----------------------------------------------------------- Internal // interface for state handling - // ----------------------------------------------------------- void SetState(lldb::StateType state, bool notify_delegates = true); // Derived classes need not implement this. It can be used as a hook to @@ -444,9 +396,7 @@ protected: // Note this function is called with the state mutex obtained by the caller. virtual void DoStopIDBumped(uint32_t newBumpId); - // ----------------------------------------------------------- Internal // interface for software breakpoints - // ----------------------------------------------------------- Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint); Status RemoveSoftwareBreakpoint(lldb::addr_t addr); @@ -465,12 +415,10 @@ protected: // resets it to point to the breakpoint itself. void FixupBreakpointPCAsNeeded(NativeThreadProtocol &thread); - // ----------------------------------------------------------- /// Notify the delegate that an exec occurred. /// /// Provide a mechanism for a delegate to clear out any exec- /// sensitive data. - // ----------------------------------------------------------- void NotifyDidExec(); NativeThreadProtocol *GetThreadByIDUnlocked(lldb::tid_t tid); diff --git a/lldb/include/lldb/Host/common/NativeRegisterContext.h b/lldb/include/lldb/Host/common/NativeRegisterContext.h index 8e175fd..6bba8f2 100644 --- a/lldb/include/lldb/Host/common/NativeRegisterContext.h +++ b/lldb/include/lldb/Host/common/NativeRegisterContext.h @@ -19,9 +19,7 @@ class NativeThreadProtocol; class NativeRegisterContext : public std::enable_shared_from_this<NativeRegisterContext> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ NativeRegisterContext(NativeThreadProtocol &thread); virtual ~NativeRegisterContext(); @@ -29,9 +27,7 @@ public: // void // InvalidateIfNeeded (bool force); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ // virtual void // InvalidateAllRegisters () = 0; @@ -60,9 +56,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(uint32_t kind, uint32_t num) const; - //------------------------------------------------------------------ // Subclasses can override these functions if desired - //------------------------------------------------------------------ virtual uint32_t NumSupportedHardwareBreakpoints(); virtual uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size); @@ -115,9 +109,7 @@ public: lldb::addr_t dst_addr, size_t dst_len, const RegisterValue ®_value); - //------------------------------------------------------------------ // Subclasses should not override these - //------------------------------------------------------------------ virtual lldb::tid_t GetThreadID() const; virtual NativeThreadProtocol &GetThread() { return m_thread; } @@ -170,18 +162,14 @@ public: // } protected: - //------------------------------------------------------------------ // Classes that inherit from RegisterContext can see and modify these - //------------------------------------------------------------------ NativeThreadProtocol &m_thread; // The thread that this register context belongs to. // uint32_t m_stop_id; // The stop ID that any data in this // context is valid for private: - //------------------------------------------------------------------ // For RegisterContext only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(NativeRegisterContext); }; diff --git a/lldb/include/lldb/Host/common/NativeThreadProtocol.h b/lldb/include/lldb/Host/common/NativeThreadProtocol.h index 02c9cee..36ae679 100644 --- a/lldb/include/lldb/Host/common/NativeThreadProtocol.h +++ b/lldb/include/lldb/Host/common/NativeThreadProtocol.h @@ -16,9 +16,7 @@ #include "lldb/lldb-types.h" namespace lldb_private { -//------------------------------------------------------------------ // NativeThreadProtocol -//------------------------------------------------------------------ class NativeThreadProtocol { public: NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid); @@ -38,17 +36,13 @@ public: NativeProcessProtocol &GetProcess() { return m_process; } - // --------------------------------------------------------------------- // Thread-specific watchpoints - // --------------------------------------------------------------------- virtual Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) = 0; virtual Status RemoveWatchpoint(lldb::addr_t addr) = 0; - // --------------------------------------------------------------------- // Thread-specific Hardware Breakpoint routines - // --------------------------------------------------------------------- virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0; virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0; diff --git a/lldb/include/lldb/Host/posix/PipePosix.h b/lldb/include/lldb/Host/posix/PipePosix.h index 703588b..df341f2 100644 --- a/lldb/include/lldb/Host/posix/PipePosix.h +++ b/lldb/include/lldb/Host/posix/PipePosix.h @@ -14,13 +14,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class PipePosix PipePosix.h "lldb/Host/posix/PipePosix.h" /// A posix-based implementation of Pipe, a class that abtracts /// unix style pipes. /// /// A class that abstracts the LLDB core from host pipe functionality. -//---------------------------------------------------------------------- class PipePosix : public PipeBase { public: static int kInvalidDescriptor; diff --git a/lldb/include/lldb/Host/windows/PipeWindows.h b/lldb/include/lldb/Host/windows/PipeWindows.h index 1335d43..c2f22fc 100644 --- a/lldb/include/lldb/Host/windows/PipeWindows.h +++ b/lldb/include/lldb/Host/windows/PipeWindows.h @@ -14,13 +14,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Pipe PipeWindows.h "lldb/Host/windows/PipeWindows.h" /// A windows-based implementation of Pipe, a class that abtracts /// unix style pipes. /// /// A class that abstracts the LLDB core from host pipe functionality. -//---------------------------------------------------------------------- class PipeWindows : public PipeBase { public: static const int kInvalidDescriptor = -1; diff --git a/lldb/include/lldb/Initialization/SystemInitializerCommon.h b/lldb/include/lldb/Initialization/SystemInitializerCommon.h index 83b24c0..ad7e58e 100644 --- a/lldb/include/lldb/Initialization/SystemInitializerCommon.h +++ b/lldb/include/lldb/Initialization/SystemInitializerCommon.h @@ -12,7 +12,6 @@ #include "SystemInitializer.h" namespace lldb_private { -//------------------------------------------------------------------ /// Initializes common lldb functionality. /// /// This class is responsible for initializing a subset of lldb @@ -21,7 +20,6 @@ namespace lldb_private { /// functionality is separate. This class is used by constructing /// an instance of SystemLifetimeManager with this class passed to /// the constructor. -//------------------------------------------------------------------ class SystemInitializerCommon : public SystemInitializer { public: SystemInitializerCommon(); diff --git a/lldb/include/lldb/Interpreter/CommandCompletions.h b/lldb/include/lldb/Interpreter/CommandCompletions.h index 092e36e..64544ca 100644 --- a/lldb/include/lldb/Interpreter/CommandCompletions.h +++ b/lldb/include/lldb/Interpreter/CommandCompletions.h @@ -23,11 +23,9 @@ namespace lldb_private { class TildeExpressionResolver; class CommandCompletions { public: - //---------------------------------------------------------------------- // This is the command completion callback that is used to complete the // argument of the option it is bound to (in the OptionDefinition table // below). Return the total number of matches. - //---------------------------------------------------------------------- typedef int (*CompletionCallback)(CommandInterpreter &interpreter, CompletionRequest &request, // A search filter to limit the search... @@ -58,9 +56,7 @@ public: CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher); - //---------------------------------------------------------------------- // These are the generic completer functions: - //---------------------------------------------------------------------- static int DiskFiles(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher); @@ -98,10 +94,8 @@ public: static int VariablePath(CommandInterpreter &interpreter, CompletionRequest &request, SearchFilter *searcher); - //---------------------------------------------------------------------- // The Completer class is a convenient base class for building searchers that // go along with the SearchFilter passed to the standard Completer functions. - //---------------------------------------------------------------------- class Completer : public Searcher { public: Completer(CommandInterpreter &interpreter, CompletionRequest &request); @@ -123,9 +117,7 @@ public: DISALLOW_COPY_AND_ASSIGN(Completer); }; - //---------------------------------------------------------------------- // SourceFileCompleter implements the source file completer - //---------------------------------------------------------------------- class SourceFileCompleter : public Completer { public: SourceFileCompleter(CommandInterpreter &interpreter, @@ -149,9 +141,7 @@ public: DISALLOW_COPY_AND_ASSIGN(SourceFileCompleter); }; - //---------------------------------------------------------------------- // ModuleCompleter implements the module completer - //---------------------------------------------------------------------- class ModuleCompleter : public Completer { public: ModuleCompleter(CommandInterpreter &interpreter, @@ -173,9 +163,7 @@ public: DISALLOW_COPY_AND_ASSIGN(ModuleCompleter); }; - //---------------------------------------------------------------------- // SymbolCompleter implements the symbol completer - //---------------------------------------------------------------------- class SymbolCompleter : public Completer { public: SymbolCompleter(CommandInterpreter &interpreter, diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index e2fcd90..a1805e8 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -29,7 +29,6 @@ namespace lldb_private { class CommandInterpreterRunOptions { public: - //------------------------------------------------------------------ /// Construct a CommandInterpreterRunOptions object. This class is used to /// control all the instances where we run multiple commands, e.g. /// HandleCommands, HandleCommandsFromFile, RunCommandInterpreter. @@ -59,7 +58,6 @@ public: /// \param[in] add_to_history /// If \b true add the commands to the command history. If \b false, don't /// add them. - //------------------------------------------------------------------ CommandInterpreterRunOptions(LazyBool stop_on_continue, LazyBool stop_on_error, LazyBool stop_on_crash, LazyBool echo_commands, LazyBool echo_comments, @@ -254,7 +252,6 @@ public: bool WasInterrupted() const; - //------------------------------------------------------------------ /// Execute a list of commands in sequence. /// /// \param[in] commands @@ -272,12 +269,10 @@ public: /// safely, /// and failed with some explanation if we aborted executing the commands /// at some point. - //------------------------------------------------------------------ void HandleCommands(const StringList &commands, ExecutionContext *context, CommandInterpreterRunOptions &options, CommandReturnObject &result); - //------------------------------------------------------------------ /// Execute a list of commands from a file. /// /// \param[in] file @@ -295,7 +290,6 @@ public: /// safely, /// and failed with some explanation if we aborted executing the commands /// at some point. - //------------------------------------------------------------------ void HandleCommandsFromFile(FileSpec &file, ExecutionContext *context, CommandInterpreterRunOptions &options, CommandReturnObject &result); @@ -459,9 +453,7 @@ public: const char *GetCommandPrefix(); - //------------------------------------------------------------------ // Properties - //------------------------------------------------------------------ bool GetExpandRegexAliases() const; bool GetPromptOnQuit() const; @@ -474,28 +466,22 @@ public: bool GetEchoCommentCommands() const; void SetEchoCommentCommands(bool b); - //------------------------------------------------------------------ /// Specify if the command interpreter should allow that the user can /// specify a custom exit code when calling 'quit'. - //------------------------------------------------------------------ void AllowExitCodeOnQuit(bool allow); - //------------------------------------------------------------------ /// Sets the exit code for the quit command. /// \param[in] exit_code /// The exit code that the driver should return on exit. /// \return True if the exit code was successfully set; false if the /// interpreter doesn't allow custom exit codes. /// \see AllowExitCodeOnQuit - //------------------------------------------------------------------ LLVM_NODISCARD bool SetQuitExitCode(int exit_code); - //------------------------------------------------------------------ /// Returns the exit code that the user has specified when running the /// 'quit' command. /// \param[out] exited /// Set to true if the user has called quit with a custom exit code. - //------------------------------------------------------------------ int GetQuitExitCode(bool &exited) const; void ResolveCommand(const char *command_line, CommandReturnObject &result); @@ -517,9 +503,7 @@ public: protected: friend class Debugger; - //------------------------------------------------------------------ // IOHandlerDelegate functions - //------------------------------------------------------------------ void IOHandlerInputComplete(IOHandler &io_handler, std::string &line) override; diff --git a/lldb/include/lldb/Interpreter/CommandObject.h b/lldb/include/lldb/Interpreter/CommandObject.h index 32f4dee..02b094c 100644 --- a/lldb/include/lldb/Interpreter/CommandObject.h +++ b/lldb/include/lldb/Interpreter/CommandObject.h @@ -220,7 +220,6 @@ public: void SetCommandName(llvm::StringRef name); - //------------------------------------------------------------------ /// This default version handles calling option argument completions and then /// calls HandleArgumentCompletion if the cursor is on an argument, not an /// option. Don't override this method, override HandleArgumentCompletion @@ -235,10 +234,8 @@ public: /// /// \return /// \btrue if we were in an option, \bfalse otherwise. - //------------------------------------------------------------------ virtual int HandleCompletion(CompletionRequest &request); - //------------------------------------------------------------------ /// The input array contains a parsed version of the line. The insertion /// point is given by cursor_index (the index in input of the word containing /// the cursor) and cursor_char_position (the position of the cursor in that @@ -255,7 +252,6 @@ public: /// /// \return /// The number of completions. - //------------------------------------------------------------------ virtual int HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) { @@ -268,23 +264,18 @@ public: bool search_syntax = true, bool search_options = true); - //------------------------------------------------------------------ /// The flags accessor. /// /// \return /// A reference to the Flags member variable. - //------------------------------------------------------------------ Flags &GetFlags() { return m_flags; } - //------------------------------------------------------------------ /// The flags const accessor. /// /// \return /// A const reference to the Flags member variable. - //------------------------------------------------------------------ const Flags &GetFlags() const { return m_flags; } - //------------------------------------------------------------------ /// Get the command that appropriate for a "repeat" of the current command. /// /// \param[in] current_command_line @@ -296,7 +287,6 @@ public: /// Otherwise a pointer to the command to be repeated. /// If the returned string is the empty string, the command won't be /// repeated. - //------------------------------------------------------------------ virtual const char *GetRepeatCommand(Args ¤t_command_args, uint32_t index) { return nullptr; @@ -367,7 +357,6 @@ protected: // insulates you from the details of this calculation. Thread *GetDefaultThread(); - //------------------------------------------------------------------ /// Check the command to make sure anything required by this /// command is available. /// @@ -377,7 +366,6 @@ protected: /// /// \return /// \b true if it is okay to run this command, \b false otherwise. - //------------------------------------------------------------------ bool CheckRequirements(CommandReturnObject &result); void Cleanup(); diff --git a/lldb/include/lldb/Interpreter/CommandObjectMultiword.h b/lldb/include/lldb/Interpreter/CommandObjectMultiword.h index 49da49e..660e9d4 100644 --- a/lldb/include/lldb/Interpreter/CommandObjectMultiword.h +++ b/lldb/include/lldb/Interpreter/CommandObjectMultiword.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiword -//------------------------------------------------------------------------- class CommandObjectMultiword : public CommandObject { // These two want to iterate over the subcommand dictionary. diff --git a/lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h b/lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h index b4acf71..7f06e26 100644 --- a/lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h +++ b/lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h @@ -17,9 +17,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectRegexCommand -//------------------------------------------------------------------------- class CommandObjectRegexCommand : public CommandObjectRaw { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupArchitecture.h b/lldb/include/lldb/Interpreter/OptionGroupArchitecture.h index c82daec..4b7f9fe 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupArchitecture.h +++ b/lldb/include/lldb/Interpreter/OptionGroupArchitecture.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupArchitecture -//------------------------------------------------------------------------- class OptionGroupArchitecture : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupBoolean.h b/lldb/include/lldb/Interpreter/OptionGroupBoolean.h index 3d478bf..7749045 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupBoolean.h +++ b/lldb/include/lldb/Interpreter/OptionGroupBoolean.h @@ -13,9 +13,7 @@ #include "lldb/Interpreter/Options.h" namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupBoolean -//------------------------------------------------------------------------- class OptionGroupBoolean : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupFile.h b/lldb/include/lldb/Interpreter/OptionGroupFile.h index 4c5a288..cce3714 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupFile.h +++ b/lldb/include/lldb/Interpreter/OptionGroupFile.h @@ -15,9 +15,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupFile -//------------------------------------------------------------------------- class OptionGroupFile : public OptionGroup { public: @@ -47,9 +45,7 @@ protected: OptionDefinition m_option_definition; }; -//------------------------------------------------------------------------- // OptionGroupFileList -//------------------------------------------------------------------------- class OptionGroupFileList : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupFormat.h b/lldb/include/lldb/Interpreter/OptionGroupFormat.h index 222a798..1b5020a 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupFormat.h +++ b/lldb/include/lldb/Interpreter/OptionGroupFormat.h @@ -16,9 +16,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupFormat -//------------------------------------------------------------------------- class OptionGroupFormat : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupOutputFile.h b/lldb/include/lldb/Interpreter/OptionGroupOutputFile.h index 3bb9b0e..82d68b7 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupOutputFile.h +++ b/lldb/include/lldb/Interpreter/OptionGroupOutputFile.h @@ -14,9 +14,7 @@ #include "lldb/Interpreter/Options.h" namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupOutputFile -//------------------------------------------------------------------------- class OptionGroupOutputFile : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupPlatform.h b/lldb/include/lldb/Interpreter/OptionGroupPlatform.h index 1c083cc..ea5a3f3 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupPlatform.h +++ b/lldb/include/lldb/Interpreter/OptionGroupPlatform.h @@ -15,11 +15,9 @@ namespace lldb_private { -//------------------------------------------------------------------------- // PlatformOptionGroup // // Make platform options available to any commands that need the settings. -//------------------------------------------------------------------------- class OptionGroupPlatform : public OptionGroup { public: OptionGroupPlatform(bool include_platform_option) diff --git a/lldb/include/lldb/Interpreter/OptionGroupString.h b/lldb/include/lldb/Interpreter/OptionGroupString.h index ad3e724..ce10589 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupString.h +++ b/lldb/include/lldb/Interpreter/OptionGroupString.h @@ -13,9 +13,7 @@ #include "lldb/Interpreter/Options.h" namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupString -//------------------------------------------------------------------------- class OptionGroupString : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupUInt64.h b/lldb/include/lldb/Interpreter/OptionGroupUInt64.h index 1b2e9f0..12f08a3 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupUInt64.h +++ b/lldb/include/lldb/Interpreter/OptionGroupUInt64.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupUInt64 -//------------------------------------------------------------------------- class OptionGroupUInt64 : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupUUID.h b/lldb/include/lldb/Interpreter/OptionGroupUUID.h index 0a3d520..22fc3a10 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupUUID.h +++ b/lldb/include/lldb/Interpreter/OptionGroupUUID.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupUUID -//------------------------------------------------------------------------- class OptionGroupUUID : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h b/lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h index 0ae9d9d..5a1bbc9 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h +++ b/lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupValueObjectDisplay -//------------------------------------------------------------------------- class OptionGroupValueObjectDisplay : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupVariable.h b/lldb/include/lldb/Interpreter/OptionGroupVariable.h index b14ac7a..0c042f4 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupVariable.h +++ b/lldb/include/lldb/Interpreter/OptionGroupVariable.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupVariable -//------------------------------------------------------------------------- class OptionGroupVariable : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h b/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h index f424e15..0d6ec24 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h +++ b/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // OptionGroupWatchpoint -//------------------------------------------------------------------------- class OptionGroupWatchpoint : public OptionGroup { public: diff --git a/lldb/include/lldb/Interpreter/OptionValue.h b/lldb/include/lldb/Interpreter/OptionValue.h index 3e4b6e6..cb0fbfb 100644 --- a/lldb/include/lldb/Interpreter/OptionValue.h +++ b/lldb/include/lldb/Interpreter/OptionValue.h @@ -19,9 +19,7 @@ namespace lldb_private { -//--------------------------------------------------------------------- // OptionValue -//--------------------------------------------------------------------- class OptionValue { public: typedef enum { @@ -69,9 +67,7 @@ public: virtual ~OptionValue() = default; - //----------------------------------------------------------------- // Subclasses should override these functions - //----------------------------------------------------------------- virtual Type GetType() const = 0; // If this value is always hidden, the avoid showing any info on this value, @@ -100,9 +96,7 @@ public: virtual size_t AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request); - //----------------------------------------------------------------- // Subclasses can override these functions - //----------------------------------------------------------------- virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx, llvm::StringRef name, bool will_modify, @@ -121,10 +115,8 @@ public: virtual bool DumpQualifiedName(Stream &strm) const; - //----------------------------------------------------------------- // Subclasses should NOT override these functions as they use the above // functions to implement functionality - //----------------------------------------------------------------- uint32_t GetTypeAsMask() { return 1u << GetType(); } static uint32_t ConvertTypeToMask(OptionValue::Type type) { diff --git a/lldb/include/lldb/Interpreter/OptionValueArch.h b/lldb/include/lldb/Interpreter/OptionValueArch.h index 39951ed..f8f4068 100644 --- a/lldb/include/lldb/Interpreter/OptionValueArch.h +++ b/lldb/include/lldb/Interpreter/OptionValueArch.h @@ -33,9 +33,7 @@ public: ~OptionValueArch() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeArch; } @@ -60,9 +58,7 @@ public: size_t AutoComplete(CommandInterpreter &interpreter, lldb_private::CompletionRequest &request) override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- ArchSpec &GetCurrentValue() { return m_current_value; } diff --git a/lldb/include/lldb/Interpreter/OptionValueArray.h b/lldb/include/lldb/Interpreter/OptionValueArray.h index d7871ca..10f3bf5 100644 --- a/lldb/include/lldb/Interpreter/OptionValueArray.h +++ b/lldb/include/lldb/Interpreter/OptionValueArray.h @@ -22,9 +22,7 @@ public: ~OptionValueArray() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeArray; } @@ -52,9 +50,7 @@ public: llvm::StringRef name, bool will_modify, Status &error) const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- size_t GetSize() const { return m_values.size(); } diff --git a/lldb/include/lldb/Interpreter/OptionValueBoolean.h b/lldb/include/lldb/Interpreter/OptionValueBoolean.h index 46c523c..2fc97d4 100644 --- a/lldb/include/lldb/Interpreter/OptionValueBoolean.h +++ b/lldb/include/lldb/Interpreter/OptionValueBoolean.h @@ -23,9 +23,7 @@ public: ~OptionValueBoolean() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeBoolean; } @@ -48,11 +46,8 @@ public: size_t AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- - //------------------------------------------------------------------ /// Convert to bool operator. /// /// This allows code to check a OptionValueBoolean in conditions. @@ -66,7 +61,6 @@ public: /// \return /// /b True this object contains a valid namespace decl, \b /// false otherwise. - //------------------------------------------------------------------ explicit operator bool() const { return m_current_value; } const bool &operator=(bool b) { diff --git a/lldb/include/lldb/Interpreter/OptionValueChar.h b/lldb/include/lldb/Interpreter/OptionValueChar.h index 21b3092..f4407a5 100644 --- a/lldb/include/lldb/Interpreter/OptionValueChar.h +++ b/lldb/include/lldb/Interpreter/OptionValueChar.h @@ -24,9 +24,7 @@ public: ~OptionValueChar() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeChar; } @@ -46,9 +44,7 @@ public: return true; } - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- const char &operator=(char c) { m_current_value = c; diff --git a/lldb/include/lldb/Interpreter/OptionValueDictionary.h b/lldb/include/lldb/Interpreter/OptionValueDictionary.h index 3f4c14d..8785d38 100644 --- a/lldb/include/lldb/Interpreter/OptionValueDictionary.h +++ b/lldb/include/lldb/Interpreter/OptionValueDictionary.h @@ -24,9 +24,7 @@ public: ~OptionValueDictionary() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeDictionary; } @@ -51,9 +49,7 @@ public: return ConvertTypeMaskToType(m_type_mask) != eTypeInvalid; } - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- size_t GetNumValues() const { return m_values.size(); } diff --git a/lldb/include/lldb/Interpreter/OptionValueEnumeration.h b/lldb/include/lldb/Interpreter/OptionValueEnumeration.h index 3bf56b6..71f3ab5 100644 --- a/lldb/include/lldb/Interpreter/OptionValueEnumeration.h +++ b/lldb/include/lldb/Interpreter/OptionValueEnumeration.h @@ -33,9 +33,7 @@ public: ~OptionValueEnumeration() override; - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeEnum; } @@ -60,9 +58,7 @@ public: size_t AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- enum_type operator=(enum_type value) { m_current_value = value; diff --git a/lldb/include/lldb/Interpreter/OptionValueFileSpec.h b/lldb/include/lldb/Interpreter/OptionValueFileSpec.h index ca3584d..aa1022a 100644 --- a/lldb/include/lldb/Interpreter/OptionValueFileSpec.h +++ b/lldb/include/lldb/Interpreter/OptionValueFileSpec.h @@ -27,9 +27,7 @@ public: ~OptionValueFileSpec() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeFileSpec; } @@ -56,9 +54,7 @@ public: size_t AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- FileSpec &GetCurrentValue() { return m_current_value; } diff --git a/lldb/include/lldb/Interpreter/OptionValueFileSpecList.h b/lldb/include/lldb/Interpreter/OptionValueFileSpecList.h index 84f7a4f..67e562e 100644 --- a/lldb/include/lldb/Interpreter/OptionValueFileSpecList.h +++ b/lldb/include/lldb/Interpreter/OptionValueFileSpecList.h @@ -23,9 +23,7 @@ public: ~OptionValueFileSpecList() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeFileSpecList; } @@ -49,9 +47,7 @@ public: bool IsAggregateValue() const override { return true; } - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- FileSpecList &GetCurrentValue() { return m_current_value; } diff --git a/lldb/include/lldb/Interpreter/OptionValueFormat.h b/lldb/include/lldb/Interpreter/OptionValueFormat.h index 9241aba..020f4ae 100644 --- a/lldb/include/lldb/Interpreter/OptionValueFormat.h +++ b/lldb/include/lldb/Interpreter/OptionValueFormat.h @@ -24,9 +24,7 @@ public: ~OptionValueFormat() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeFormat; } @@ -48,9 +46,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- lldb::Format GetCurrentValue() const { return m_current_value; } diff --git a/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h b/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h index 7338d61..b05be95 100644 --- a/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h +++ b/lldb/include/lldb/Interpreter/OptionValueFormatEntity.h @@ -20,9 +20,7 @@ public: ~OptionValueFormatEntity() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeFormatEntity; } @@ -43,9 +41,7 @@ public: size_t AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- FormatEntity::Entry &GetCurrentValue() { return m_current_entry; } diff --git a/lldb/include/lldb/Interpreter/OptionValueLanguage.h b/lldb/include/lldb/Interpreter/OptionValueLanguage.h index cfac304..505dc89 100644 --- a/lldb/include/lldb/Interpreter/OptionValueLanguage.h +++ b/lldb/include/lldb/Interpreter/OptionValueLanguage.h @@ -27,9 +27,7 @@ public: ~OptionValueLanguage() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeLanguage; } @@ -51,9 +49,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- lldb::LanguageType GetCurrentValue() const { return m_current_value; } diff --git a/lldb/include/lldb/Interpreter/OptionValuePathMappings.h b/lldb/include/lldb/Interpreter/OptionValuePathMappings.h index 6d3cbdb..35c2af4 100644 --- a/lldb/include/lldb/Interpreter/OptionValuePathMappings.h +++ b/lldb/include/lldb/Interpreter/OptionValuePathMappings.h @@ -21,9 +21,7 @@ public: ~OptionValuePathMappings() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypePathMap; } @@ -47,9 +45,7 @@ public: bool IsAggregateValue() const override { return true; } - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- PathMappingList &GetCurrentValue() { return m_path_mappings; } diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h index b8e7aa3..bea2b3c 100644 --- a/lldb/include/lldb/Interpreter/OptionValueProperties.h +++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h @@ -62,24 +62,18 @@ public: // bool // GetQualifiedName (Stream &strm); - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- virtual size_t GetNumProperties() const; - //--------------------------------------------------------------------- // Get the index of a property given its exact name in this property // collection, "name" can't be a path to a property path that refers to a // property within a property - //--------------------------------------------------------------------- virtual uint32_t GetPropertyIndex(ConstString name) const; - //--------------------------------------------------------------------- // Get a property by exact name exists in this property collection, name can // not be a path to a property path that refers to a property within a // property - //--------------------------------------------------------------------- virtual const Property *GetProperty(const ExecutionContext *exe_ctx, bool will_modify, ConstString name) const; @@ -88,10 +82,8 @@ public: bool will_modify, uint32_t idx) const; - //--------------------------------------------------------------------- // Property can be be a property path like // "target.process.extra-startup-command" - //--------------------------------------------------------------------- virtual const Property *GetPropertyAtPath(const ExecutionContext *exe_ctx, bool will_modify, llvm::StringRef property_path) const; diff --git a/lldb/include/lldb/Interpreter/OptionValueRegex.h b/lldb/include/lldb/Interpreter/OptionValueRegex.h index 925ef39..f5b2557 100644 --- a/lldb/include/lldb/Interpreter/OptionValueRegex.h +++ b/lldb/include/lldb/Interpreter/OptionValueRegex.h @@ -21,9 +21,7 @@ public: ~OptionValueRegex() override = default; - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeRegex; } @@ -45,9 +43,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- const RegularExpression *GetCurrentValue() const { return (m_regex.IsValid() ? &m_regex : nullptr); } diff --git a/lldb/include/lldb/Interpreter/OptionValueSInt64.h b/lldb/include/lldb/Interpreter/OptionValueSInt64.h index 1ca0042..c2e8ff4 100644 --- a/lldb/include/lldb/Interpreter/OptionValueSInt64.h +++ b/lldb/include/lldb/Interpreter/OptionValueSInt64.h @@ -36,9 +36,7 @@ public: ~OptionValueSInt64() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeSInt64; } @@ -60,9 +58,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- const int64_t &operator=(int64_t value) { m_current_value = value; diff --git a/lldb/include/lldb/Interpreter/OptionValueString.h b/lldb/include/lldb/Interpreter/OptionValueString.h index db619ca..d9e76d8 100644 --- a/lldb/include/lldb/Interpreter/OptionValueString.h +++ b/lldb/include/lldb/Interpreter/OptionValueString.h @@ -71,9 +71,7 @@ public: ~OptionValueString() override = default; - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeString; } @@ -95,9 +93,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- Flags &GetOptions() { return m_options; } diff --git a/lldb/include/lldb/Interpreter/OptionValueUInt64.h b/lldb/include/lldb/Interpreter/OptionValueUInt64.h index 8d65dba..5978cdb4 100644 --- a/lldb/include/lldb/Interpreter/OptionValueUInt64.h +++ b/lldb/include/lldb/Interpreter/OptionValueUInt64.h @@ -27,17 +27,13 @@ public: ~OptionValueUInt64() override {} - //--------------------------------------------------------------------- // Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object // inside of a lldb::OptionValueSP object if all goes well. If the string // isn't a uint64_t value or any other error occurs, return an empty // lldb::OptionValueSP and fill error in with the correct stuff. - //--------------------------------------------------------------------- static lldb::OptionValueSP Create(const char *, Status &) = delete; static lldb::OptionValueSP Create(llvm::StringRef value_str, Status &error); - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeUInt64; } @@ -59,9 +55,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- const uint64_t &operator=(uint64_t value) { m_current_value = value; diff --git a/lldb/include/lldb/Interpreter/OptionValueUUID.h b/lldb/include/lldb/Interpreter/OptionValueUUID.h index 68332bb..7273e35 100644 --- a/lldb/include/lldb/Interpreter/OptionValueUUID.h +++ b/lldb/include/lldb/Interpreter/OptionValueUUID.h @@ -22,9 +22,7 @@ public: ~OptionValueUUID() override {} - //--------------------------------------------------------------------- // Virtual subclass pure virtual overrides - //--------------------------------------------------------------------- OptionValue::Type GetType() const override { return eTypeUUID; } @@ -46,9 +44,7 @@ public: lldb::OptionValueSP DeepCopy() const override; - //--------------------------------------------------------------------- // Subclass specific functions - //--------------------------------------------------------------------- UUID &GetCurrentValue() { return m_uuid; } diff --git a/lldb/include/lldb/Interpreter/Options.h b/lldb/include/lldb/Interpreter/Options.h index 2d3358b..a008d51 100644 --- a/lldb/include/lldb/Interpreter/Options.h +++ b/lldb/include/lldb/Interpreter/Options.h @@ -46,7 +46,6 @@ static inline bool isprint8(int ch) { return isprint(ch); } -//---------------------------------------------------------------------- /// \class Options Options.h "lldb/Interpreter/Options.h" /// A command line option parsing protocol class. /// @@ -60,7 +59,6 @@ static inline bool isprint8(int ch) { /// *optstring, const struct option *longopts, int *longindex); /// \endcode /// -//---------------------------------------------------------------------- class Options { public: Options(); @@ -73,12 +71,10 @@ public: uint32_t NumCommandOptions(); - //------------------------------------------------------------------ /// Get the option definitions to use when parsing Args options. /// /// \see Args::ParseOptions (Options&) /// \see man getopt_long_only - //------------------------------------------------------------------ Option *GetLongOptions(); // This gets passed the short option as an integer... @@ -114,7 +110,6 @@ public: // and subclasses shouldn't have to do it. void NotifyOptionParsingStarting(ExecutionContext *execution_context); - //------------------------------------------------------------------ /// Parse the provided arguments. /// /// The parsed options are set via calls to SetOptionValue. In case of a @@ -131,7 +126,6 @@ public: /// param[in] require_validation /// When true, it will fail option parsing if validation could /// not occur due to not having a platform. - //------------------------------------------------------------------ llvm::Expected<Args> Parse(const Args &args, ExecutionContext *execution_context, lldb::PlatformSP platform_sp, @@ -146,7 +140,6 @@ public: Status NotifyOptionParsingFinished(ExecutionContext *execution_context); - //------------------------------------------------------------------ /// Set the value of an option. /// /// \param[in] option_idx @@ -164,11 +157,9 @@ public: /// /// \see Args::ParseOptions (Options&) /// \see man getopt_long_only - //------------------------------------------------------------------ virtual Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) = 0; - //------------------------------------------------------------------ /// Handles the generic bits of figuring out whether we are in an option, /// and if so completing it. /// @@ -184,12 +175,10 @@ public: /// /// \return /// \btrue if we were in an option, \bfalse otherwise. - //------------------------------------------------------------------ bool HandleOptionCompletion(lldb_private::CompletionRequest &request, OptionElementVector &option_map, CommandInterpreter &interpreter); - //------------------------------------------------------------------ /// Handles the generic bits of figuring out whether we are in an option, /// and if so completing it. /// @@ -205,7 +194,6 @@ public: /// /// \return /// \btrue if we were in an option, \bfalse otherwise. - //------------------------------------------------------------------ virtual bool HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request, OptionElementVector &opt_element_vector, @@ -283,7 +271,6 @@ public: ~OptionGroupOptions() override = default; - //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// /// Append all options from \a group using the exact same option groups that @@ -292,10 +279,8 @@ public: /// \param[in] group /// A group of options to take option values from and copy their /// definitions into this class. - //---------------------------------------------------------------------- void Append(OptionGroup *group); - //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// /// Append options from \a group that have a usage mask that has any bits in @@ -316,7 +301,6 @@ public: /// \param[in] dst_mask /// Set the usage mask for any copied options to \a dst_mask after /// copying the option definition. - //---------------------------------------------------------------------- void Append(OptionGroup *group, uint32_t src_mask, uint32_t dst_mask); void Finalize(); diff --git a/lldb/include/lldb/Symbol/Block.h b/lldb/include/lldb/Symbol/Block.h index 5bf8cd8..8c414a5 100644 --- a/lldb/include/lldb/Symbol/Block.h +++ b/lldb/include/lldb/Symbol/Block.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Block Block.h "lldb/Symbol/Block.h" /// A class that describes a single lexical block. /// @@ -39,13 +38,11 @@ namespace lldb_private { /// Inlined functions are represented by attaching a InlineFunctionInfo shared /// pointer object to a block. Inlined functions are represented as named /// blocks. -//---------------------------------------------------------------------- class Block : public UserID, public SymbolContextScope { public: typedef RangeArray<uint32_t, uint32_t, 1> RangeList; typedef RangeList::Entry Range; - //------------------------------------------------------------------ /// Construct with a User ID \a uid, \a depth. /// /// Initialize this block with the specified UID \a uid. The \a depth in the @@ -67,24 +64,18 @@ public: /// The block list that this object belongs to. /// /// \see BlockList - //------------------------------------------------------------------ Block(lldb::user_id_t uid); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~Block() override; - //------------------------------------------------------------------ /// Add a child to this object. /// /// \param[in] child_block_sp /// A shared pointer to a child block that will get added to /// this block. - //------------------------------------------------------------------ void AddChild(const lldb::BlockSP &child_block_sp); - //------------------------------------------------------------------ /// Add a new offset range to this block. /// /// \param[in] start_offset @@ -94,16 +85,13 @@ public: /// \param[in] end_offset /// An offset into this Function's address range that /// describes the end address of a range for this block. - //------------------------------------------------------------------ void AddRange(const Range &range); void FinalizeRanges(); - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void CalculateSymbolContext(SymbolContext *sc) override; lldb::ModuleSP CalculateSymbolContextModule() override; @@ -114,7 +102,6 @@ public: Block *CalculateSymbolContextBlock() override; - //------------------------------------------------------------------ /// Check if an offset is in one of the block offset ranges. /// /// \param[in] range_offset @@ -123,10 +110,8 @@ public: /// \return /// Returns \b true if \a range_offset falls in one of this /// block's ranges, \b false otherwise. - //------------------------------------------------------------------ bool Contains(lldb::addr_t range_offset) const; - //------------------------------------------------------------------ /// Check if a offset range is in one of the block offset ranges. /// /// \param[in] range @@ -135,10 +120,8 @@ public: /// \return /// Returns \b true if \a range falls in one of this /// block's ranges, \b false otherwise. - //------------------------------------------------------------------ bool Contains(const Range &range) const; - //------------------------------------------------------------------ /// Check if this object contains "block" as a child block at any depth. /// /// \param[in] block @@ -147,10 +130,8 @@ public: /// \return /// Returns \b true if \a block is a child of this block, \b /// false otherwise. - //------------------------------------------------------------------ bool Contains(const Block *block) const; - //------------------------------------------------------------------ /// Dump the block contents. /// /// \param[in] s @@ -168,15 +149,12 @@ public: /// /// \param[in] show_context /// If \b true, variables will dump their context information. - //------------------------------------------------------------------ void Dump(Stream *s, lldb::addr_t base_addr, int32_t depth, bool show_context) const; - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void DumpSymbolContext(Stream *s) override; void DumpAddressRanges(Stream *s, lldb::addr_t base_addr); @@ -184,16 +162,13 @@ public: void GetDescription(Stream *s, Function *function, lldb::DescriptionLevel level, Target *target) const; - //------------------------------------------------------------------ /// Get the parent block. /// /// \return /// The parent block pointer, or nullptr if this block has no /// parent. - //------------------------------------------------------------------ Block *GetParent() const; - //------------------------------------------------------------------ /// Get the inlined block that contains this block. /// /// \return @@ -201,39 +176,31 @@ public: /// this block, else parent blocks will be searched to see if /// any contain this block. nullptr will be returned if this block /// nor any parent blocks are inlined function blocks. - //------------------------------------------------------------------ Block *GetContainingInlinedBlock(); - //------------------------------------------------------------------ /// Get the inlined parent block for this block. /// /// \return /// The parent block pointer, or nullptr if this block has no /// parent. - //------------------------------------------------------------------ Block *GetInlinedParent(); - //------------------------------------------------------------------ /// Get the sibling block for this block. /// /// \return /// The sibling block pointer, or nullptr if this block has no /// sibling. - //------------------------------------------------------------------ Block *GetSibling() const; - //------------------------------------------------------------------ /// Get the first child block. /// /// \return /// The first child block pointer, or nullptr if this block has no /// children. - //------------------------------------------------------------------ Block *GetFirstChild() const { return (m_children.empty() ? nullptr : m_children.front().get()); } - //------------------------------------------------------------------ /// Get the variable list for this block only. /// /// \param[in] can_create @@ -244,10 +211,8 @@ public: /// \return /// A variable list shared pointer that contains all variables /// for this block. - //------------------------------------------------------------------ lldb::VariableListSP GetBlockVariableList(bool can_create); - //------------------------------------------------------------------ /// Get the variable list for this block and optionally all child blocks if /// \a get_child_variables is \b true. /// @@ -271,13 +236,11 @@ public: /// \return /// A variable list shared pointer that contains all variables /// for this block. - //------------------------------------------------------------------ uint32_t AppendBlockVariables(bool can_create, bool get_child_block_variables, bool stop_if_child_block_is_inlined_function, const std::function<bool(Variable *)> &filter, VariableList *variable_list); - //------------------------------------------------------------------ /// Appends the variables from this block, and optionally from all parent /// blocks, to \a variable_list. /// @@ -304,34 +267,28 @@ public: /// \return /// The number of variable that were appended to \a /// variable_list. - //------------------------------------------------------------------ uint32_t AppendVariables(bool can_create, bool get_parent_variables, bool stop_if_block_is_inlined_function, const std::function<bool(Variable *)> &filter, VariableList *variable_list); - //------------------------------------------------------------------ /// Get const accessor for any inlined function information. /// /// \return /// A const pointer to any inlined function information, or nullptr /// if this is a regular block. - //------------------------------------------------------------------ const InlineFunctionInfo *GetInlinedFunctionInfo() const { return m_inlineInfoSP.get(); } - //------------------------------------------------------------------ /// Get the symbol file which contains debug info for this block's /// symbol context module. /// /// \return A pointer to the symbol file or nullptr. - //------------------------------------------------------------------ SymbolFile *GetSymbolFile(); CompilerDeclContext GetDeclContext(); - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// Returns the cost of this object plus any owned objects from the ranges, @@ -339,10 +296,8 @@ public: /// /// \return /// The number of bytes that this object occupies in memory. - //------------------------------------------------------------------ size_t MemorySize() const; - //------------------------------------------------------------------ /// Set accessor for any inlined function information. /// /// \param[in] name @@ -362,7 +317,6 @@ public: /// \param[in] call_decl_ptr /// Optional calling location declaration information that /// describes from where this inlined function was called. - //------------------------------------------------------------------ void SetInlinedFunctionInfo(const char *name, const char *mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr); @@ -371,7 +325,6 @@ public: m_parent_scope = parent_scope; } - //------------------------------------------------------------------ /// Set accessor for the variable list. /// /// Called by the SymbolFile plug-ins after they have parsed the variable @@ -379,7 +332,6 @@ public: /// /// \param[in] variable_list_sp /// A shared pointer to a VariableList. - //------------------------------------------------------------------ void SetVariableList(lldb::VariableListSP &variable_list_sp) { m_variable_list_sp = variable_list_sp; } @@ -401,10 +353,8 @@ public: uint32_t GetRangeIndexContainingAddress(const Address &addr); - //------------------------------------------------------------------ // Since blocks might have multiple discontiguous address ranges, we need to // be able to get at any of the address ranges in a block. - //------------------------------------------------------------------ bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range); bool GetStartAddress(Address &addr); @@ -413,9 +363,7 @@ public: protected: typedef std::vector<lldb::BlockSP> collection; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ SymbolContextScope *m_parent_scope; collection m_children; RangeList m_ranges; diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 4aafb36..0c76a59 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -46,25 +46,19 @@ public: typedef void (*CompleteObjCInterfaceDeclCallback)(void *baton, clang::ObjCInterfaceDecl *); - //------------------------------------------------------------------ // llvm casting support - //------------------------------------------------------------------ static bool classof(const TypeSystem *ts) { return ts->getKind() == TypeSystem::eKindClang; } - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ClangASTContext(const char *triple = nullptr); ~ClangASTContext() override; void Finalize() override; - //------------------------------------------------------------------ // PluginInterface functions - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; @@ -153,9 +147,7 @@ public: static ClangASTMetadata *GetMetadata(clang::ASTContext *ast, const void *object); - //------------------------------------------------------------------ // Basic Types - //------------------------------------------------------------------ CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size) override; @@ -257,9 +249,7 @@ public: static bool IsOperator(const char *name, clang::OverloadedOperatorKind &op_kind); - //------------------------------------------------------------------ // Structure, Unions, Classes - //------------------------------------------------------------------ static clang::AccessSpecifier ConvertAccessTypeToAccessSpecifier(lldb::AccessType access); @@ -349,9 +339,7 @@ public: // Returns a mask containing bits from the ClangASTContext::eTypeXXX // enumerations - //------------------------------------------------------------------ // Namespace Declarations - //------------------------------------------------------------------ clang::NamespaceDecl * GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx, @@ -362,9 +350,7 @@ public: clang::DeclContext *decl_ctx, bool is_inline = false); - //------------------------------------------------------------------ // Function Types - //------------------------------------------------------------------ clang::FunctionDecl * CreateFunctionDeclaration(clang::DeclContext *decl_ctx, const char *name, @@ -413,25 +399,19 @@ public: CompilerType CreateBlockPointerType(const CompilerType &function_type); - //------------------------------------------------------------------ // Array Types - //------------------------------------------------------------------ CompilerType CreateArrayType(const CompilerType &element_type, size_t element_count, bool is_vector); - //------------------------------------------------------------------ // Enumeration Types - //------------------------------------------------------------------ CompilerType CreateEnumerationType(const char *name, clang::DeclContext *decl_ctx, const Declaration &decl, const CompilerType &integer_qual_type, bool is_scoped); - //------------------------------------------------------------------ // Integer type functions - //------------------------------------------------------------------ static CompilerType GetIntTypeFromBitSize(clang::ASTContext *ast, size_t bit_size, bool is_signed); @@ -443,22 +423,16 @@ public: static CompilerType GetPointerSizedIntType(clang::ASTContext *ast, bool is_signed); - //------------------------------------------------------------------ // Floating point functions - //------------------------------------------------------------------ static CompilerType GetFloatTypeFromBitSize(clang::ASTContext *ast, size_t bit_size); - //------------------------------------------------------------------ // TypeSystem methods - //------------------------------------------------------------------ DWARFASTParser *GetDWARFParser() override; PDBASTParser *GetPDBParser() override; - //------------------------------------------------------------------ // ClangASTContext callbacks for external source lookups. - //------------------------------------------------------------------ static void CompleteTagDecl(void *baton, clang::TagDecl *); static void CompleteObjCInterfaceDecl(void *baton, @@ -473,9 +447,7 @@ public: llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &vbase_offsets); - //---------------------------------------------------------------------- // CompilerDecl override functions - //---------------------------------------------------------------------- ConstString DeclGetName(void *opaque_decl) override; ConstString DeclGetMangledName(void *opaque_decl) override; @@ -489,9 +461,7 @@ public: CompilerType DeclGetFunctionArgumentType(void *opaque_decl, size_t arg_idx) override; - //---------------------------------------------------------------------- // CompilerDeclContext override functions - //---------------------------------------------------------------------- std::vector<CompilerDecl> DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, @@ -511,9 +481,7 @@ public: bool DeclContextIsContainedInLookup(void *opaque_decl_ctx, void *other_opaque_decl_ctx) override; - //---------------------------------------------------------------------- // Clang specific clang::DeclContext functions - //---------------------------------------------------------------------- static clang::DeclContext * DeclContextGetAsDeclContext(const CompilerDeclContext &dc); @@ -536,9 +504,7 @@ public: static clang::ASTContext * DeclContextGetClangASTContext(const CompilerDeclContext &dc); - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- bool IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, @@ -637,15 +603,11 @@ public: static bool GetObjCClassName(const CompilerType &type, std::string &class_name); - //---------------------------------------------------------------------- // Type Completion - //---------------------------------------------------------------------- bool GetCompleteType(lldb::opaque_compiler_type_t type) override; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- ConstString GetTypeName(lldb::opaque_compiler_type_t type) override; @@ -659,9 +621,7 @@ public: unsigned GetTypeQualifiers(lldb::opaque_compiler_type_t type) override; - //---------------------------------------------------------------------- // Creating related types - //---------------------------------------------------------------------- // Using the current type, create a new typedef to that type using // "typedef_name" as the name and "decl_ctx" as the decl context. @@ -721,14 +681,10 @@ public: // If the current object represents a typedef type, get the underlying type CompilerType GetTypedefedType(lldb::opaque_compiler_type_t type) override; - //---------------------------------------------------------------------- // Create related types using the current type's AST - //---------------------------------------------------------------------- CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) override; - //---------------------------------------------------------------------- // Exploring the type - //---------------------------------------------------------------------- llvm::Optional<uint64_t> GetByteSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) { @@ -835,9 +791,7 @@ public: ConstString *child_name = nullptr, CompilerType *child_type = nullptr); - //---------------------------------------------------------------------- // Modifying RecordType - //---------------------------------------------------------------------- static clang::FieldDecl *AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, @@ -897,16 +851,12 @@ public: bool has_extern); static bool GetHasExternalStorage(const CompilerType &type); - //------------------------------------------------------------------ // Tag Declarations - //------------------------------------------------------------------ static bool StartTagDeclarationDefinition(const CompilerType &type); static bool CompleteTagDeclarationDefinition(const CompilerType &type); - //---------------------------------------------------------------------- // Modifying Enumeration types - //---------------------------------------------------------------------- clang::EnumConstantDecl *AddEnumerationValueToEnumerationType( const CompilerType &enum_type, const Declaration &decl, const char *name, int64_t enum_value, uint32_t enum_value_bit_size); @@ -916,9 +866,7 @@ public: CompilerType GetEnumerationIntegerType(lldb::opaque_compiler_type_t type); - //------------------------------------------------------------------ // Pointers & References - //------------------------------------------------------------------ // Call this function using the class type when you want to make a member // pointer type to pointee_type. @@ -931,9 +879,7 @@ public: const char *s, uint8_t *dst, size_t dst_size) override; - //---------------------------------------------------------------------- // Dumping types - //---------------------------------------------------------------------- #ifndef NDEBUG /// Convenience LLVM-style dump method for use in the debugger only. /// In contrast to the other \p Dump() methods this directly invokes @@ -1025,9 +971,7 @@ protected: const clang::ClassTemplateSpecializationDecl * GetAsTemplateSpecialization(lldb::opaque_compiler_type_t type); - //------------------------------------------------------------------ // Classes that inherit from ClangASTContext can see and modify these - //------------------------------------------------------------------ // clang-format off std::string m_target_triple; std::unique_ptr<clang::ASTContext> m_ast_up; @@ -1055,9 +999,7 @@ protected: bool m_can_evaluate_expressions; // clang-format on private: - //------------------------------------------------------------------ // For ClangASTContext only - //------------------------------------------------------------------ ClangASTContext(const ClangASTContext &); const ClangASTContext &operator=(const ClangASTContext &); }; diff --git a/lldb/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h b/lldb/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h index 5d7fa61..a2d4f81 100644 --- a/lldb/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h +++ b/lldb/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h @@ -50,9 +50,7 @@ public: m_callback_layout_record_type(layout_record_type_callback), m_callback_baton(callback_baton) {} - //------------------------------------------------------------------ // clang::ExternalASTSource - //------------------------------------------------------------------ clang::Decl *GetExternalDecl(uint32_t ID) override { // This method only needs to be implemented if the AST source ever passes @@ -126,10 +124,8 @@ public: } protected: - //------------------------------------------------------------------ // Classes that inherit from ClangExternalASTSourceCallbacks can see and // modify these - //------------------------------------------------------------------ CompleteTagDeclCallback m_callback_tag_decl; CompleteObjCInterfaceDeclCallback m_callback_objc_decl; FindExternalVisibleDeclsByNameCallback m_callback_find_by_name; diff --git a/lldb/include/lldb/Symbol/CompileUnit.h b/lldb/include/lldb/Symbol/CompileUnit.h index 20751ec..25927d9 100644 --- a/lldb/include/lldb/Symbol/CompileUnit.h +++ b/lldb/include/lldb/Symbol/CompileUnit.h @@ -21,7 +21,6 @@ #include "llvm/ADT/DenseMap.h" namespace lldb_private { -//---------------------------------------------------------------------- /// \class CompileUnit CompileUnit.h "lldb/Symbol/CompileUnit.h" /// A class that describes a compilation unit. /// @@ -33,14 +32,12 @@ namespace lldb_private { /// Each compile unit has a list of functions, global and static variables, /// support file list (include files and inlined source files), and a line /// table. -//---------------------------------------------------------------------- class CompileUnit : public std::enable_shared_from_this<CompileUnit>, public ModuleChild, public FileSpec, public UserID, public SymbolContextScope { public: - //------------------------------------------------------------------ /// Construct with a module, path, UID and language. /// /// Initialize the compile unit given the owning \a module, a path to @@ -75,12 +72,10 @@ public: /// CompileUnit::GetIsOptimized() is called. /// /// \see lldb::LanguageType - //------------------------------------------------------------------ CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid, lldb::LanguageType language, lldb_private::LazyBool is_optimized); - //------------------------------------------------------------------ /// Construct with a module, file spec, UID and language. /// /// Initialize the compile unit given the owning \a module, a path to @@ -116,17 +111,13 @@ public: /// CompileUnit::GetIsOptimized() is called. /// /// \see lldb::LanguageType - //------------------------------------------------------------------ CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const FileSpec &file_spec, lldb::user_id_t uid, lldb::LanguageType language, lldb_private::LazyBool is_optimized); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~CompileUnit() override; - //------------------------------------------------------------------ /// Add a function to this compile unit. /// /// Typically called by the SymbolFile plug-ins as they partially parse the @@ -134,25 +125,20 @@ public: /// /// \param[in] function_sp /// A shared pointer to the Function object. - //------------------------------------------------------------------ void AddFunction(lldb::FunctionSP &function_sp); - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void CalculateSymbolContext(SymbolContext *sc) override; lldb::ModuleSP CalculateSymbolContextModule() override; CompileUnit *CalculateSymbolContextCompileUnit() override; - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void DumpSymbolContext(Stream *s) override; lldb::LanguageType GetLanguage(); @@ -164,7 +150,6 @@ public: void GetDescription(Stream *s, lldb::DescriptionLevel level) const; - //------------------------------------------------------------------ /// Apply a lambda to each function in this compile unit. /// /// This provides raw access to the function shared pointer list and will not @@ -175,11 +160,9 @@ public: /// \param[in] lambda /// The lambda that should be applied to every function. The lambda can /// return true if the iteration should be aborted earlier. - //------------------------------------------------------------------ void ForeachFunction( llvm::function_ref<bool(const lldb::FunctionSP &)> lambda) const; - //------------------------------------------------------------------ /// Dump the compile unit contents to the stream \a s. /// /// \param[in] s @@ -188,10 +171,8 @@ public: /// \param[in] show_context /// If \b true, variables will dump their symbol context /// information. - //------------------------------------------------------------------ void Dump(Stream *s, bool show_context) const; - //------------------------------------------------------------------ /// Find the line entry by line and optional inlined file spec. /// /// Finds the first line entry that has an index greater than \a start_idx @@ -227,12 +208,10 @@ public: /// \return /// The zero based index of a matching line entry, or UINT32_MAX /// if no matching line entry is found. - //------------------------------------------------------------------ uint32_t FindLineEntry(uint32_t start_idx, uint32_t line, const FileSpec *file_spec_ptr, bool exact, LineEntry *line_entry); - //------------------------------------------------------------------ /// Get the line table for the compile unit. /// /// Called by clients and the SymbolFile plug-in. The SymbolFile plug-ins @@ -242,12 +221,10 @@ public: /// \return /// The line table object pointer, or NULL if this line table /// hasn't been parsed yet. - //------------------------------------------------------------------ LineTable *GetLineTable(); DebugMacros *GetDebugMacros(); - //------------------------------------------------------------------ /// Get the compile unit's support file list. /// /// The support file list is used by the line table, and any objects that @@ -255,10 +232,8 @@ public: /// /// \return /// A support file list object. - //------------------------------------------------------------------ FileSpecList &GetSupportFiles(); - //------------------------------------------------------------------ /// Get the compile unit's imported module list. /// /// This reports all the imports that the compile unit made, including the @@ -266,10 +241,8 @@ public: /// /// \return /// A list of imported module names. - //------------------------------------------------------------------ const std::vector<SourceModule> &GetImportedModules(); - //------------------------------------------------------------------ /// Get the SymbolFile plug-in user data. /// /// SymbolFile plug-ins can store user data to internal state or objects to @@ -278,10 +251,8 @@ public: /// \return /// The user data stored with the CompileUnit when it was /// constructed. - //------------------------------------------------------------------ void *GetUserData() const; - //------------------------------------------------------------------ /// Get the variable list for a compile unit. /// /// Called by clients to get the variable list for a compile unit. The @@ -299,10 +270,8 @@ public: /// A shared pointer to a variable list, that can contain NULL /// VariableList pointer if there are no global or static /// variables. - //------------------------------------------------------------------ lldb::VariableListSP GetVariableList(bool can_create); - //------------------------------------------------------------------ /// Finds a function by user ID. /// /// Typically used by SymbolFile plug-ins when partially parsing the debug @@ -317,10 +286,8 @@ public: /// \return /// A shared pointer to the function object that might contain /// a NULL Function pointer. - //------------------------------------------------------------------ lldb::FunctionSP FindFunctionByUID(lldb::user_id_t uid); - //------------------------------------------------------------------ /// Set the line table for the compile unit. /// /// Called by the SymbolFile plug-in when if first parses the line table and @@ -329,12 +296,10 @@ public: /// /// \param[in] line_table /// A line table object pointer that this object now owns. - //------------------------------------------------------------------ void SetLineTable(LineTable *line_table); void SetDebugMacros(const DebugMacrosSP &debug_macros); - //------------------------------------------------------------------ /// Set accessor for the variable list. /// /// Called by the SymbolFile plug-ins after they have parsed the variable @@ -342,10 +307,8 @@ public: /// /// \param[in] variable_list_sp /// A shared pointer to a VariableList. - //------------------------------------------------------------------ void SetVariableList(lldb::VariableListSP &variable_list_sp); - //------------------------------------------------------------------ /// Resolve symbol contexts by file and line. /// /// Given a file in \a file_spec, and a line number, find all instances and @@ -388,13 +351,11 @@ public: /// The number of new matches that were added to \a sc_list. /// /// \see enum SymbolContext::Scope - //------------------------------------------------------------------ uint32_t ResolveSymbolContext(const FileSpec &file_spec, uint32_t line, bool check_inlines, bool exact, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Get whether compiler optimizations were enabled for this compile unit /// /// "optimized" means that the debug experience may be difficult for the @@ -406,12 +367,9 @@ public: /// Returns 'true' if this compile unit was compiled with /// optimization. 'false' indicates that either the optimization /// is unknown, or this compile unit was built without optimization. - //------------------------------------------------------------------ bool GetIsOptimized(); - //------------------------------------------------------------------ /// Returns the number of functions in this compile unit - //------------------------------------------------------------------ size_t GetNumFunctions() const { return m_functions_by_uid.size(); } protected: diff --git a/lldb/include/lldb/Symbol/CompilerDecl.h b/lldb/include/lldb/Symbol/CompilerDecl.h index 8567290..4817ec4 100644 --- a/lldb/include/lldb/Symbol/CompilerDecl.h +++ b/lldb/include/lldb/Symbol/CompilerDecl.h @@ -17,9 +17,7 @@ namespace lldb_private { class CompilerDecl { public: - //---------------------------------------------------------------------- // Constructors and Destructors - //---------------------------------------------------------------------- CompilerDecl() : m_type_system(nullptr), m_opaque_decl(nullptr) {} CompilerDecl(TypeSystem *type_system, void *decl) @@ -27,9 +25,7 @@ public: ~CompilerDecl() {} - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- explicit operator bool() const { return IsValid(); } @@ -45,9 +41,7 @@ public: bool IsClang() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- TypeSystem *GetTypeSystem() const { return m_type_system; } diff --git a/lldb/include/lldb/Symbol/CompilerDeclContext.h b/lldb/include/lldb/Symbol/CompilerDeclContext.h index e26d373..e7958c0 100644 --- a/lldb/include/lldb/Symbol/CompilerDeclContext.h +++ b/lldb/include/lldb/Symbol/CompilerDeclContext.h @@ -18,9 +18,7 @@ namespace lldb_private { class CompilerDeclContext { public: - //---------------------------------------------------------------------- // Constructors and Destructors - //---------------------------------------------------------------------- CompilerDeclContext() : m_type_system(nullptr), m_opaque_decl_ctx(nullptr) {} CompilerDeclContext(TypeSystem *type_system, void *decl_ctx) @@ -28,9 +26,7 @@ public: ~CompilerDeclContext() {} - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- explicit operator bool() const { return IsValid(); } @@ -49,7 +45,6 @@ public: std::vector<CompilerDecl> FindDeclByName(ConstString name, const bool ignore_using_decls); - //---------------------------------------------------------------------- /// Checks if this decl context represents a method of a class. /// /// \param[out] language_ptr @@ -70,12 +65,10 @@ public: /// \return /// Returns true if this is a decl context that represents a method /// in a struct, union or class. - //---------------------------------------------------------------------- bool IsClassMethod(lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr); - //---------------------------------------------------------------------- /// Check if the given other decl context is contained in the lookup /// of this decl context (for example because the other context is a nested /// inline namespace). @@ -87,12 +80,9 @@ public: /// @return /// Returns true iff the other decl context is contained in the lookup /// of this decl context. - //---------------------------------------------------------------------- bool IsContainedInLookup(CompilerDeclContext other) const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- TypeSystem *GetTypeSystem() const { return m_type_system; } diff --git a/lldb/include/lldb/Symbol/CompilerType.h b/lldb/include/lldb/Symbol/CompilerType.h index 23d53df..98d9165 100644 --- a/lldb/include/lldb/Symbol/CompilerType.h +++ b/lldb/include/lldb/Symbol/CompilerType.h @@ -21,7 +21,6 @@ namespace lldb_private { class DataExtractor; -//---------------------------------------------------------------------- // A class that can carry around a clang ASTContext and a opaque clang // QualType. A clang::QualType can be easily reconstructed from an opaque clang // type and often the ASTContext is needed when doing various type related @@ -29,12 +28,9 @@ class DataExtractor; // lightweight class that can be used. There are many static equivalents of the // member functions that allow the ASTContext and the opaque clang QualType to // be specified for ease of use and to avoid code duplication. -//---------------------------------------------------------------------- class CompilerType { public: - //---------------------------------------------------------------------- // Constructors and Destructors - //---------------------------------------------------------------------- CompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type); CompilerType(clang::ASTContext *ast_context, clang::QualType qual_type); @@ -45,9 +41,7 @@ public: ~CompilerType(); - //---------------------------------------------------------------------- // Operators - //---------------------------------------------------------------------- const CompilerType &operator=(const CompilerType &rhs) { m_type = rhs.m_type; @@ -55,9 +49,7 @@ public: return *this; } - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- explicit operator bool() const { return m_type != nullptr && m_type_system != nullptr; @@ -145,21 +137,15 @@ public: bool IsVoidType() const; - //---------------------------------------------------------------------- // Type Completion - //---------------------------------------------------------------------- bool GetCompleteType() const; - //---------------------------------------------------------------------- // AST related queries - //---------------------------------------------------------------------- size_t GetPointerByteSize() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- TypeSystem *GetTypeSystem() const { return m_type_system; } @@ -187,9 +173,7 @@ public: unsigned GetTypeQualifiers() const; - //---------------------------------------------------------------------- // Creating related types - //---------------------------------------------------------------------- CompilerType GetArrayElementType(uint64_t *stride = nullptr) const; @@ -211,78 +195,56 @@ public: TypeMemberFunctionImpl GetMemberFunctionAtIndex(size_t idx); - //---------------------------------------------------------------------- // If this type is a reference to a type (L value or R value reference), // return a new type with the reference removed, else return the current type // itself. - //---------------------------------------------------------------------- CompilerType GetNonReferenceType() const; - //---------------------------------------------------------------------- // If this type is a pointer type, return the type that the pointer points // to, else return an invalid type. - //---------------------------------------------------------------------- CompilerType GetPointeeType() const; - //---------------------------------------------------------------------- // Return a new CompilerType that is a pointer to this type - //---------------------------------------------------------------------- CompilerType GetPointerType() const; - //---------------------------------------------------------------------- // Return a new CompilerType that is a L value reference to this type if this // type is valid and the type system supports L value references, else return // an invalid type. - //---------------------------------------------------------------------- CompilerType GetLValueReferenceType() const; - //---------------------------------------------------------------------- // Return a new CompilerType that is a R value reference to this type if this // type is valid and the type system supports R value references, else return // an invalid type. - //---------------------------------------------------------------------- CompilerType GetRValueReferenceType() const; - //---------------------------------------------------------------------- // Return a new CompilerType adds a const modifier to this type if this type // is valid and the type system supports const modifiers, else return an // invalid type. - //---------------------------------------------------------------------- CompilerType AddConstModifier() const; - //---------------------------------------------------------------------- // Return a new CompilerType adds a volatile modifier to this type if this // type is valid and the type system supports volatile modifiers, else return // an invalid type. - //---------------------------------------------------------------------- CompilerType AddVolatileModifier() const; - //---------------------------------------------------------------------- // Return a new CompilerType adds a restrict modifier to this type if this // type is valid and the type system supports restrict modifiers, else return // an invalid type. - //---------------------------------------------------------------------- CompilerType AddRestrictModifier() const; - //---------------------------------------------------------------------- // Create a typedef to this type using "name" as the name of the typedef this // type is valid and the type system supports typedefs, else return an // invalid type. - //---------------------------------------------------------------------- CompilerType CreateTypedef(const char *name, const CompilerDeclContext &decl_ctx) const; // If the current object represents a typedef type, get the underlying type CompilerType GetTypedefedType() const; - //---------------------------------------------------------------------- // Create related types using the current type's AST - //---------------------------------------------------------------------- CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const; - //---------------------------------------------------------------------- // Exploring the type - //---------------------------------------------------------------------- struct IntegralTemplateArgument; @@ -304,11 +266,9 @@ public: static lldb::BasicType GetBasicTypeEnumeration(ConstString name); - //---------------------------------------------------------------------- // If this type is an enumeration, iterate through all of its enumerators // using a callback. If the callback returns true, keep iterating, else abort // the iteration. - //---------------------------------------------------------------------- void ForEachEnumerator( std::function<bool(const CompilerType &integer_type, ConstString name, @@ -376,18 +336,14 @@ public: bool IsMeaninglessWithoutDynamicResolution() const; - //------------------------------------------------------------------ // Pointers & References - //------------------------------------------------------------------ // Converts "s" to a floating point value and place resulting floating point // bytes in the "dst" buffer. size_t ConvertStringToFloatValue(const char *s, uint8_t *dst, size_t dst_size) const; - //---------------------------------------------------------------------- // Dumping types - //---------------------------------------------------------------------- #ifndef NDEBUG /// Convenience LLVM-style dump method for use in the debugger only. diff --git a/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h b/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h index 73306b0..ef472a1 100644 --- a/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h +++ b/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h @@ -49,7 +49,6 @@ public: typedef RangeVector<lldb::addr_t, uint32_t> FunctionAddressAndSizeVector; - //------------------------------------------------------------------ // Build a vector of file address and size for all functions in this Module // based on the eh_frame FDE entries. // diff --git a/lldb/include/lldb/Symbol/DeclVendor.h b/lldb/include/lldb/Symbol/DeclVendor.h index 5ab6bf1..1945877 100644 --- a/lldb/include/lldb/Symbol/DeclVendor.h +++ b/lldb/include/lldb/Symbol/DeclVendor.h @@ -18,20 +18,15 @@ namespace lldb_private { -//---------------------------------------------------------------------- // The Decl vendor class is intended as a generic interface to search for named // declarations that are not necessarily backed by a specific symbol file. -//---------------------------------------------------------------------- class DeclVendor { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ DeclVendor() {} virtual ~DeclVendor() {} - //------------------------------------------------------------------ /// Look up the set of Decls that the DeclVendor currently knows about /// matching a given name. /// @@ -48,24 +43,19 @@ public: /// \return /// The number of Decls added to decls; will not exceed /// max_matches. - //------------------------------------------------------------------ virtual uint32_t FindDecls(ConstString name, bool append, uint32_t max_matches, std::vector<clang::NamedDecl *> &decls) = 0; - //------------------------------------------------------------------ /// Interface for ExternalASTMerger. Returns an ImporterSource /// allowing type completion. /// /// \return /// An ImporterSource for this DeclVendor. - //------------------------------------------------------------------ virtual clang::ExternalASTMerger::ImporterSource GetImporterSource() = 0; private: - //------------------------------------------------------------------ // For DeclVendor only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(DeclVendor); }; diff --git a/lldb/include/lldb/Symbol/Declaration.h b/lldb/include/lldb/Symbol/Declaration.h index bfbbce5..e2e600a 100644 --- a/lldb/include/lldb/Symbol/Declaration.h +++ b/lldb/include/lldb/Symbol/Declaration.h @@ -14,7 +14,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Declaration Declaration.h "lldb/Symbol/Declaration.h" /// A class that describes the declaration location of a /// lldb object. @@ -22,12 +21,9 @@ namespace lldb_private { /// The declarations include the file specification, line number, and the /// column info and can help track where functions, blocks, inlined functions, /// types, variables, any many other debug core objects were declared. -//---------------------------------------------------------------------- class Declaration { public: - //------------------------------------------------------------------ /// Default constructor. - //------------------------------------------------------------------ Declaration() : m_file(), m_line(0) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS @@ -37,7 +33,6 @@ public: { } - //------------------------------------------------------------------ /// Construct with file specification, and optional line and column. /// /// \param[in] file_spec @@ -51,7 +46,6 @@ public: /// \param[in] column /// The column number that describes where this was declared. /// Set to zero if there is no column number information. - //------------------------------------------------------------------ Declaration(const FileSpec &file_spec, uint32_t line = 0, uint32_t column = 0) : m_file(file_spec), m_line(line) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS @@ -61,9 +55,7 @@ public: { } - //------------------------------------------------------------------ /// Construct with a reference to another Declaration object. - //------------------------------------------------------------------ Declaration(const Declaration &rhs) : m_file(rhs.m_file), m_line(rhs.m_line) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS @@ -73,9 +65,7 @@ public: { } - //------------------------------------------------------------------ /// Construct with a pointer to another Declaration object. - //------------------------------------------------------------------ Declaration(const Declaration *decl_ptr) : m_file(), m_line(0) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS @@ -87,12 +77,10 @@ public: *this = *decl_ptr; } - //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the file specification to be empty, and the line and column to /// zero. - //------------------------------------------------------------------ void Clear() { m_file.Clear(); m_line = 0; @@ -101,7 +89,6 @@ public: #endif } - //------------------------------------------------------------------ /// Compare two declaration objects. /// /// Compares the two file specifications from \a lhs and \a rhs. If the file @@ -118,10 +105,8 @@ public: /// \li -1 if lhs < rhs /// \li 0 if lhs == rhs /// \li 1 if lhs > rhs - //------------------------------------------------------------------ static int Compare(const Declaration &lhs, const Declaration &rhs); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -129,17 +114,14 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, bool show_fullpaths) const; bool DumpStopContext(Stream *s, bool show_fullpaths) const; - //------------------------------------------------------------------ /// Get accessor for the declaration column number. /// /// \return /// Non-zero indicates a valid column number, zero indicates no /// column information is available. - //------------------------------------------------------------------ uint32_t GetColumn() const { #ifdef LLDB_ENABLE_DECLARATION_COLUMNS return m_column; @@ -148,34 +130,27 @@ public: #endif } - //------------------------------------------------------------------ /// Get accessor for file specification. /// /// \return /// A reference to the file specification object. - //------------------------------------------------------------------ FileSpec &GetFile() { return m_file; } - //------------------------------------------------------------------ /// Get const accessor for file specification. /// /// \return /// A const reference to the file specification object. - //------------------------------------------------------------------ const FileSpec &GetFile() const { return m_file; } - //------------------------------------------------------------------ /// Get accessor for the declaration line number. /// /// \return /// Non-zero indicates a valid line number, zero indicates no /// line information is available. - //------------------------------------------------------------------ uint32_t GetLine() const { return m_line; } bool IsValid() const { return m_file && m_line != 0; } - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// \return @@ -184,43 +159,34 @@ public: /// shared string values. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ size_t MemorySize() const; - //------------------------------------------------------------------ /// Set accessor for the declaration column number. /// /// \param[in] column /// Non-zero indicates a valid column number, zero indicates no /// column information is available. - //------------------------------------------------------------------ void SetColumn(uint32_t column) { #ifdef LLDB_ENABLE_DECLARATION_COLUMNS m_column = col; #endif } - //------------------------------------------------------------------ /// Set accessor for the declaration file specification. /// /// \param[in] file_spec /// The new declaration file specification. - //------------------------------------------------------------------ void SetFile(const FileSpec &file_spec) { m_file = file_spec; } - //------------------------------------------------------------------ /// Set accessor for the declaration line number. /// /// \param[in] line /// Non-zero indicates a valid line number, zero indicates no /// line information is available. - //------------------------------------------------------------------ void SetLine(uint32_t line) { m_line = line; } protected: - //------------------------------------------------------------------ /// Member variables. - //------------------------------------------------------------------ FileSpec m_file; ///< The file specification that points to the ///< source file where the declaration occurred. uint32_t m_line; ///< Non-zero values indicates a valid line number, diff --git a/lldb/include/lldb/Symbol/Function.h b/lldb/include/lldb/Symbol/Function.h index 744db0f6..f68a167 100644 --- a/lldb/include/lldb/Symbol/Function.h +++ b/lldb/include/lldb/Symbol/Function.h @@ -19,16 +19,13 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class FunctionInfo Function.h "lldb/Symbol/Function.h" /// A class that contains generic function information. /// /// This provides generic function information that gets reused between inline /// functions and function types. -//---------------------------------------------------------------------- class FunctionInfo { public: - //------------------------------------------------------------------ /// Construct with the function method name and optional declaration /// information. /// @@ -40,10 +37,8 @@ public: /// \param[in] decl_ptr /// Optional declaration information that describes where the /// function was declared. This can be NULL. - //------------------------------------------------------------------ FunctionInfo(const char *name, const Declaration *decl_ptr); - //------------------------------------------------------------------ /// Construct with the function method name and optional declaration /// information. /// @@ -54,17 +49,13 @@ public: /// \param[in] decl_ptr /// Optional declaration information that describes where the /// function was declared. This can be NULL. - //------------------------------------------------------------------ FunctionInfo(ConstString name, const Declaration *decl_ptr); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since classes inherit from this class. - //------------------------------------------------------------------ virtual ~FunctionInfo(); - //------------------------------------------------------------------ /// Compare two function information objects. /// /// First compares the method names, and if equal, then compares the @@ -80,10 +71,8 @@ public: /// \li -1 if lhs < rhs /// \li 0 if lhs == rhs /// \li 1 if lhs > rhs - //------------------------------------------------------------------ static int Compare(const FunctionInfo &lhs, const FunctionInfo &rhs); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -91,34 +80,26 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, bool show_fullpaths) const; - //------------------------------------------------------------------ /// Get accessor for the declaration information. /// /// \return /// A reference to the declaration object. - //------------------------------------------------------------------ Declaration &GetDeclaration(); - //------------------------------------------------------------------ /// Get const accessor for the declaration information. /// /// \return /// A const reference to the declaration object. - //------------------------------------------------------------------ const Declaration &GetDeclaration() const; - //------------------------------------------------------------------ /// Get accessor for the method name. /// /// \return /// A const reference to the method name object. - //------------------------------------------------------------------ ConstString GetName() const; - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// \return @@ -127,25 +108,19 @@ public: /// shared string values. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ virtual size_t MemorySize() const; protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ ConstString m_name; ///< Function method name (not a mangled name). Declaration m_declaration; ///< Information describing where this function ///information was defined. }; -//---------------------------------------------------------------------- /// \class InlineFunctionInfo Function.h "lldb/Symbol/Function.h" /// A class that describes information for an inlined function. -//---------------------------------------------------------------------- class InlineFunctionInfo : public FunctionInfo { public: - //------------------------------------------------------------------ /// Construct with the function method name, mangled name, and optional /// declaration information. /// @@ -165,12 +140,10 @@ public: /// \param[in] call_decl_ptr /// Optional calling location declaration information that /// describes from where this inlined function was called. - //------------------------------------------------------------------ InlineFunctionInfo(const char *name, const char *mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr); - //------------------------------------------------------------------ /// Construct with the function method name, mangled name, and optional /// declaration information. /// @@ -189,17 +162,13 @@ public: /// \param[in] call_decl_ptr /// Optional calling location declaration information that /// describes from where this inlined function was called. - //------------------------------------------------------------------ InlineFunctionInfo(ConstString name, const Mangled &mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~InlineFunctionInfo() override; - //------------------------------------------------------------------ /// Compare two inlined function information objects. /// /// First compares the FunctionInfo objects, and if equal, compares the @@ -217,10 +186,8 @@ public: /// \li -1 if lhs < rhs /// \li 0 if lhs == rhs /// \li 1 if lhs > rhs - //------------------------------------------------------------------ int Compare(const InlineFunctionInfo &lhs, const InlineFunctionInfo &rhs); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -228,7 +195,6 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, bool show_fullpaths) const; void DumpStopContext(Stream *s, lldb::LanguageType language) const; @@ -237,39 +203,30 @@ public: ConstString GetDisplayName(lldb::LanguageType language) const; - //------------------------------------------------------------------ /// Get accessor for the call site declaration information. /// /// \return /// A reference to the declaration object. - //------------------------------------------------------------------ Declaration &GetCallSite(); - //------------------------------------------------------------------ /// Get const accessor for the call site declaration information. /// /// \return /// A const reference to the declaration object. - //------------------------------------------------------------------ const Declaration &GetCallSite() const; - //------------------------------------------------------------------ /// Get accessor for the mangled name object. /// /// \return /// A reference to the mangled name object. - //------------------------------------------------------------------ Mangled &GetMangled(); - //------------------------------------------------------------------ /// Get const accessor for the mangled name object. /// /// \return /// A const reference to the mangled name object. - //------------------------------------------------------------------ const Mangled &GetMangled() const; - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// \return @@ -278,13 +235,10 @@ public: /// shared string values. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ size_t MemorySize() const override; private: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ Mangled m_mangled; ///< Mangled inlined function name (can be empty if there ///is no mangled information). Declaration m_call_decl; @@ -292,12 +246,10 @@ private: class Function; -//---------------------------------------------------------------------- /// \class CallEdge Function.h "lldb/Symbol/Function.h" /// /// Represent a call made within a Function. This can be used to find a path /// in the call graph between two functions. -//---------------------------------------------------------------------- class CallEdge { public: /// Construct a call edge using a symbol name to identify the calling @@ -348,7 +300,6 @@ private: DISALLOW_COPY_AND_ASSIGN(CallEdge); }; -//---------------------------------------------------------------------- /// \class Function Function.h "lldb/Symbol/Function.h" /// A class that describes a function. /// @@ -369,10 +320,8 @@ private: /// /// The concrete information is the address range information and specific /// locations for an instance of this function. -//---------------------------------------------------------------------- class Function : public UserID, public SymbolContextScope { public: - //------------------------------------------------------------------ /// Construct with a compile unit, function UID, function type UID, optional /// mangled name, function type, and a section offset based address range. /// @@ -401,21 +350,16 @@ public: /// /// \param[in] range /// The section offset based address for this function. - //------------------------------------------------------------------ Function(CompileUnit *comp_unit, lldb::user_id_t func_uid, lldb::user_id_t func_type_uid, const Mangled &mangled, Type *func_type, const AddressRange &range); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~Function() override; - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void CalculateSymbolContext(SymbolContext *sc) override; lldb::ModuleSP CalculateSymbolContextModule() override; @@ -427,7 +371,6 @@ public: const AddressRange &GetAddressRange() { return m_range; } lldb::LanguageType GetLanguage() const; - //------------------------------------------------------------------ /// Find the file and line number of the source location of the start of the /// function. This will use the declaration if present and fall back on the /// line table if that fails. So there may NOT be a line table entry for @@ -438,10 +381,8 @@ public: /// /// \param[out] line_no /// The line number. - //------------------------------------------------------------------ void GetStartLineSourceInfo(FileSpec &source_file, uint32_t &line_no); - //------------------------------------------------------------------ /// Find the file and line number of the source location of the end of the /// function. /// @@ -451,22 +392,16 @@ public: /// /// \param[out] line_no /// The line number. - //------------------------------------------------------------------ void GetEndLineSourceInfo(FileSpec &source_file, uint32_t &line_no); - //------------------------------------------------------------------ /// Get the outgoing call edges from this function, sorted by their return /// PC addresses (in increasing order). - //------------------------------------------------------------------ llvm::MutableArrayRef<CallEdge> GetCallEdges(); - //------------------------------------------------------------------ /// Get the outgoing tail-calling edges from this function. If none exist, /// return None. - //------------------------------------------------------------------ llvm::MutableArrayRef<CallEdge> GetTailCallingEdges(); - //------------------------------------------------------------------ /// Get accessor for the block list. /// /// \return @@ -474,42 +409,33 @@ public: /// in the function. /// /// \see BlockList - //------------------------------------------------------------------ Block &GetBlock(bool can_create); - //------------------------------------------------------------------ /// Get accessor for the compile unit that owns this function. /// /// \return /// A compile unit object pointer. - //------------------------------------------------------------------ CompileUnit *GetCompileUnit(); - //------------------------------------------------------------------ /// Get const accessor for the compile unit that owns this function. /// /// \return /// A const compile unit object pointer. - //------------------------------------------------------------------ const CompileUnit *GetCompileUnit() const; void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target); - //------------------------------------------------------------------ /// Get accessor for the frame base location. /// /// \return /// A location expression that describes the function frame /// base. - //------------------------------------------------------------------ DWARFExpression &GetFrameBaseExpression() { return m_frame_base; } - //------------------------------------------------------------------ /// Get const accessor for the frame base location. /// /// \return /// A const compile unit object pointer. - //------------------------------------------------------------------ const DWARFExpression &GetFrameBaseExpression() const { return m_frame_base; } ConstString GetName() const; @@ -520,45 +446,36 @@ public: const Mangled &GetMangled() const { return m_mangled; } - //------------------------------------------------------------------ /// Get the DeclContext for this function, if available. /// /// \return /// The DeclContext, or NULL if none exists. - //------------------------------------------------------------------ CompilerDeclContext GetDeclContext(); - //------------------------------------------------------------------ /// Get accessor for the type that describes the function return value type, /// and parameter types. /// /// \return /// A type object pointer. - //------------------------------------------------------------------ Type *GetType(); - //------------------------------------------------------------------ /// Get const accessor for the type that describes the function return value /// type, and parameter types. /// /// \return /// A const type object pointer. - //------------------------------------------------------------------ const Type *GetType() const; CompilerType GetCompilerType(); - //------------------------------------------------------------------ /// Get the size of the prologue instructions for this function. The /// "prologue" instructions include any instructions given line number 0 /// immediately following the prologue end. /// /// \return /// The size of the prologue. - //------------------------------------------------------------------ uint32_t GetPrologueByteSize(); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -570,17 +487,13 @@ public: /// \param[in] show_context /// If \b true, variables will dump their symbol context /// information. - //------------------------------------------------------------------ void Dump(Stream *s, bool show_context) const; - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void DumpSymbolContext(Stream *s) override; - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// \return @@ -589,10 +502,8 @@ public: /// shared string values. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ size_t MemorySize() const; - //------------------------------------------------------------------ /// Get whether compiler optimizations were enabled for this function /// /// The debug information may provide information about whether this @@ -606,10 +517,8 @@ public: /// Returns 'true' if this function was compiled with /// optimization. 'false' indicates that either the optimization /// is unknown, or this function was built without optimization. - //------------------------------------------------------------------ bool GetIsOptimized(); - //------------------------------------------------------------------ /// Get whether this function represents a 'top-level' function /// /// The concept of a top-level function is language-specific, mostly meant @@ -623,7 +532,6 @@ public: /// \return /// Returns 'true' if this function is a top-level function, /// 'false' otherwise. - //------------------------------------------------------------------ bool IsTopLevelFunction(); lldb::DisassemblerSP GetInstructions(const ExecutionContext &exe_ctx, @@ -639,9 +547,7 @@ protected: (1 << 0) ///< Have we already tried to calculate the prologue size? }; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ CompileUnit *m_comp_unit; ///< The compile unit that owns this function. lldb::user_id_t m_type_uid; ///< The user ID of for the prototype Type for this function. diff --git a/lldb/include/lldb/Symbol/LineEntry.h b/lldb/include/lldb/Symbol/LineEntry.h index 591ed5e..647fe87 100644 --- a/lldb/include/lldb/Symbol/LineEntry.h +++ b/lldb/include/lldb/Symbol/LineEntry.h @@ -15,16 +15,12 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class LineEntry LineEntry.h "lldb/Symbol/LineEntry.h" /// A line table entry class. -//---------------------------------------------------------------------- struct LineEntry { - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize all member variables to invalid values. - //------------------------------------------------------------------ LineEntry(); LineEntry(const lldb::SectionSP §ion_sp, lldb::addr_t section_offset, @@ -33,14 +29,11 @@ struct LineEntry { bool _is_start_of_basic_block, bool _is_prologue_end, bool _is_epilogue_begin, bool _is_terminal_entry); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Clears all member variables to invalid values. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -70,14 +63,12 @@ struct LineEntry { /// dumped. /// /// \see Address::DumpStyle - //------------------------------------------------------------------ bool Dump(Stream *s, Target *target, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const; bool GetDescription(Stream *s, lldb::DescriptionLevel level, CompileUnit *cu, Target *target, bool show_address_only) const; - //------------------------------------------------------------------ /// Dumps information specific to a process that stops at this line entry to /// the supplied stream \a s. /// @@ -92,20 +83,16 @@ struct LineEntry { /// \return /// Returns \b true if the file and line were properly dumped, /// \b false otherwise. - //------------------------------------------------------------------ bool DumpStopContext(Stream *s, bool show_fullpaths) const; - //------------------------------------------------------------------ /// Check if a line entry object is valid. /// /// \return /// Returns \b true if the line entry contains a valid section /// offset address, file index, and line number, \b false /// otherwise. - //------------------------------------------------------------------ bool IsValid() const; - //------------------------------------------------------------------ /// Compare two LineEntry objects. /// /// \param[in] lhs @@ -118,10 +105,8 @@ struct LineEntry { /// \li -1 if lhs < rhs /// \li 0 if lhs == rhs /// \li 1 if lhs > rhs - //------------------------------------------------------------------ static int Compare(const LineEntry &lhs, const LineEntry &rhs); - //------------------------------------------------------------------ /// Give the range for this LineEntry + any additional LineEntries for this /// same source line that are contiguous. /// @@ -144,21 +129,16 @@ struct LineEntry { /// /// \return /// The contiguous AddressRange for this source line. - //------------------------------------------------------------------ AddressRange GetSameLineContiguousAddressRange() const; - //------------------------------------------------------------------ /// Apply file mappings from target.source-map to the LineEntry's file. /// /// \param[in] target_sp /// Shared pointer to the target this LineEntry belongs to. - //------------------------------------------------------------------ void ApplyFileMappings(lldb::TargetSP target_sp); - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ AddressRange range; ///< The section offset address range for this line entry. FileSpec file; ///< The source file, possibly mapped by the target.source-map ///setting @@ -182,7 +162,6 @@ struct LineEntry { ///instructions. }; -//------------------------------------------------------------------ /// Less than operator. /// /// \param[in] lhs @@ -193,7 +172,6 @@ struct LineEntry { /// /// \return /// Returns \b true if lhs < rhs, false otherwise. -//------------------------------------------------------------------ bool operator<(const LineEntry &lhs, const LineEntry &rhs); } // namespace lldb_private diff --git a/lldb/include/lldb/Symbol/LineTable.h b/lldb/include/lldb/Symbol/LineTable.h index e799e5b..d24cc35 100644 --- a/lldb/include/lldb/Symbol/LineTable.h +++ b/lldb/include/lldb/Symbol/LineTable.h @@ -18,10 +18,8 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class LineSequence LineTable.h "lldb/Symbol/LineTable.h" An abstract base /// class used during symbol table creation. -//---------------------------------------------------------------------- class LineSequence { public: LineSequence(); @@ -34,26 +32,19 @@ private: DISALLOW_COPY_AND_ASSIGN(LineSequence); }; -//---------------------------------------------------------------------- /// \class LineTable LineTable.h "lldb/Symbol/LineTable.h" /// A line table class. -//---------------------------------------------------------------------- class LineTable { public: - //------------------------------------------------------------------ /// Construct with compile unit. /// /// \param[in] comp_unit /// The compile unit to which this line table belongs. - //------------------------------------------------------------------ LineTable(CompileUnit *comp_unit); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~LineTable(); - //------------------------------------------------------------------ /// Adds a new line entry to this line table. /// /// All line entries are maintained in file address order. @@ -63,7 +54,6 @@ public: /// table. /// /// \see Address::DumpStyle - //------------------------------------------------------------------ // void // AddLineEntry (const LineEntry& line_entry); @@ -88,7 +78,6 @@ public: // Insert a sequence of entries into this line table. void InsertSequence(LineSequence *sequence); - //------------------------------------------------------------------ /// Dump all line entries in this line table to the stream \a s. /// /// \param[in] s @@ -98,13 +87,11 @@ public: /// The display style for the address. /// /// \see Address::DumpStyle - //------------------------------------------------------------------ void Dump(Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_line_ranges); void GetDescription(Stream *s, Target *target, lldb::DescriptionLevel level); - //------------------------------------------------------------------ /// Find a line entry that contains the section offset address \a so_addr. /// /// \param[in] so_addr @@ -122,11 +109,9 @@ public: /// \return /// Returns \b true if \a so_addr is contained in a line entry /// in this line table, \b false otherwise. - //------------------------------------------------------------------ bool FindLineEntryByAddress(const Address &so_addr, LineEntry &line_entry, uint32_t *index_ptr = nullptr); - //------------------------------------------------------------------ /// Find a line entry index that has a matching file index and source line /// number. /// @@ -161,7 +146,6 @@ public: /// /// \see CompileUnit::GetSupportFiles() /// \see FileSpecList::FindFileIndex (uint32_t, const FileSpec &) const - //------------------------------------------------------------------ uint32_t FindLineEntryIndexByFileIndex(uint32_t start_idx, uint32_t file_idx, uint32_t line, bool exact, LineEntry *line_entry_ptr); @@ -173,7 +157,6 @@ public: size_t FineLineEntriesForFileIndex(uint32_t file_idx, bool append, SymbolContextList &sc_list); - //------------------------------------------------------------------ /// Get the line entry from the line table at index \a idx. /// /// \param[in] idx @@ -185,21 +168,17 @@ public: /// /// \see LineTable::GetSize() /// \see LineEntry::IsValid() const - //------------------------------------------------------------------ bool GetLineEntryAtIndex(uint32_t idx, LineEntry &line_entry); - //------------------------------------------------------------------ /// Gets the size of the line table in number of line table entries. /// /// \return /// The number of line table entries in this line table. - //------------------------------------------------------------------ uint32_t GetSize() const; typedef lldb_private::RangeArray<lldb::addr_t, lldb::addr_t, 32> FileAddressRanges; - //------------------------------------------------------------------ /// Gets all contiguous file address ranges for the entire line table. /// /// \param[out] file_ranges @@ -212,11 +191,9 @@ public: /// /// \return /// The number of address ranges added to \a file_ranges - //------------------------------------------------------------------ size_t GetContiguousFileAddressRanges(FileAddressRanges &file_ranges, bool append); - //------------------------------------------------------------------ /// Given a file range link map, relink the current line table and return a /// fixed up line table. /// @@ -227,7 +204,6 @@ public: /// \return /// A new line table if at least one line table entry was able /// to be mapped. - //------------------------------------------------------------------ typedef RangeDataVector<lldb::addr_t, lldb::addr_t, lldb::addr_t> FileRangeMap; @@ -302,9 +278,7 @@ protected: return lhs.file_addr < rhs.file_addr; } - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ /// The file address for this line entry. lldb::addr_t file_addr; /// The source line number, or zero if there is no line number @@ -337,24 +311,18 @@ protected: Entry *a_entry; }; - //------------------------------------------------------------------ // Types - //------------------------------------------------------------------ typedef std::vector<lldb_private::Section *> section_collection; ///< The collection type for the sections. typedef std::vector<Entry> entry_collection; ///< The collection type for the line entries. - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ CompileUnit *m_comp_unit; ///< The compile unit that this line table belongs to. entry_collection m_entries; ///< The collection of line entries in this line table. - //------------------------------------------------------------------ // Helper class - //------------------------------------------------------------------ class LineSequenceImpl : public LineSequence { public: LineSequenceImpl() = default; diff --git a/lldb/include/lldb/Symbol/LocateSymbolFile.h b/lldb/include/lldb/Symbol/LocateSymbolFile.h index 20120c8..0e0e9a2 100644 --- a/lldb/include/lldb/Symbol/LocateSymbolFile.h +++ b/lldb/include/lldb/Symbol/LocateSymbolFile.h @@ -22,20 +22,16 @@ class UUID; class Symbols { public: - //---------------------------------------------------------------------- // Locate the executable file given a module specification. // // Locating the file should happen only on the local computer or using the // current computers global settings. - //---------------------------------------------------------------------- static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec); - //---------------------------------------------------------------------- // Locate the symbol file given a module specification. // // Locating the file should happen only on the local computer or using the // current computers global settings. - //---------------------------------------------------------------------- static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths); @@ -44,7 +40,6 @@ public: const lldb_private::UUID *uuid, const ArchSpec *arch); - //---------------------------------------------------------------------- // Locate the object and symbol file given a module specification. // // Locating the file can try to download the file from a corporate build @@ -54,7 +49,6 @@ public: // the symbol file, or if the user's settings are checked to see if they've // enabled the external program before calling. // - //---------------------------------------------------------------------- static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, bool force_lookup = true); }; diff --git a/lldb/include/lldb/Symbol/ObjectContainer.h b/lldb/include/lldb/Symbol/ObjectContainer.h index b85ac4e..9310fdc 100644 --- a/lldb/include/lldb/Symbol/ObjectContainer.h +++ b/lldb/include/lldb/Symbol/ObjectContainer.h @@ -18,7 +18,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ObjectContainer ObjectContainer.h "lldb/Symbol/ObjectContainer.h" /// A plug-in interface definition class for object containers. /// @@ -28,16 +27,13 @@ namespace lldb_private { /// Typical object containers are static libraries (.a files) that contain /// multiple named object files, and universal files that contain multiple /// architectures. -//---------------------------------------------------------------------- class ObjectContainer : public PluginInterface, public ModuleChild { public: - //------------------------------------------------------------------ /// Construct with a parent module, offset, and header data. /// /// Object files belong to modules and a valid module must be supplied upon /// construction. The at an offset within a file for objects that contain /// more than one architecture or object. - //------------------------------------------------------------------ ObjectContainer(const lldb::ModuleSP &module_sp, const FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset) @@ -50,15 +46,12 @@ public: m_data.SetData(data_sp, data_offset, length); } - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be inherited /// from by the plug-in instance. - //------------------------------------------------------------------ ~ObjectContainer() override = default; - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the current contents of this object to the @@ -67,10 +60,8 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ virtual void Dump(Stream *s) const = 0; - //------------------------------------------------------------------ /// Gets the architecture given an index. /// /// Copies the architecture specification for index \a idx. @@ -87,12 +78,10 @@ public: /// filled in, \b false otherwise. /// /// \see ObjectContainer::GetNumArchitectures() const - //------------------------------------------------------------------ virtual bool GetArchitectureAtIndex(uint32_t idx, ArchSpec &arch) const { return false; } - //------------------------------------------------------------------ /// Returns the offset into a file at which this object resides. /// /// Some files contain many object files, and this function allows access to @@ -101,21 +90,17 @@ public: /// \return /// The offset in bytes into the file. Defaults to zero for /// simple object files that a represented by an entire file. - //------------------------------------------------------------------ virtual lldb::addr_t GetOffset() const { return m_offset; } virtual lldb::addr_t GetByteSize() const { return m_length; } - //------------------------------------------------------------------ /// Get the number of objects within this object file (archives). /// /// \return /// Zero for object files that are not archives, or the number /// of objects contained in the archive. - //------------------------------------------------------------------ virtual size_t GetNumObjects() const { return 0; } - //------------------------------------------------------------------ /// Get the number of architectures in this object file. /// /// The default implementation returns 1 as for object files that contain a @@ -125,10 +110,8 @@ public: /// /// \return /// The number of architectures contained in this object file. - //------------------------------------------------------------------ virtual size_t GetNumArchitectures() const { return 0; } - //------------------------------------------------------------------ /// Attempts to parse the object header. /// /// This function is used as a test to see if a given plug-in instance can @@ -140,10 +123,8 @@ public: /// \return /// Returns \b true if the header was parsed successfully, \b /// false otherwise. - //------------------------------------------------------------------ virtual bool ParseHeader() = 0; - //------------------------------------------------------------------ /// Selects an architecture in an object file. /// /// Object files that contain a single architecture should verify that the @@ -159,7 +140,6 @@ public: /// Returns a pointer to the object file of the requested \a /// arch and optional \a name. Returns nullptr of no such object /// file exists in the container. - //------------------------------------------------------------------ virtual lldb::ObjectFileSP GetObjectFile(const FileSpec *file) = 0; virtual bool ObjectAtIndexIsContainer(uint32_t object_idx) { return false; } @@ -177,9 +157,7 @@ public: } protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ FileSpec m_file; ///< The file that represents this container objects (which ///can be different from the module's file). lldb::addr_t diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h index 8a29e87a..e5c5285 100644 --- a/lldb/include/lldb/Symbol/ObjectFile.h +++ b/lldb/include/lldb/Symbol/ObjectFile.h @@ -42,7 +42,6 @@ public: virtual ArchSpec GetArchitecture() = 0; }; -//---------------------------------------------------------------------- /// \class ObjectFile ObjectFile.h "lldb/Symbol/ObjectFile.h" /// A plug-in interface definition class for object file parsers. /// @@ -56,7 +55,6 @@ public: /// /// Once an architecture is selected the object file information can be /// extracted from this abstract class. -//---------------------------------------------------------------------- class ObjectFile : public std::enable_shared_from_this<ObjectFile>, public PluginInterface, public ModuleChild { @@ -92,13 +90,11 @@ public: llvm::ArrayRef<uint8_t> Contents; }; - //------------------------------------------------------------------ /// Construct with a parent module, offset, and header data. /// /// Object files belong to modules and a valid module must be supplied upon /// construction. The at an offset within a file for objects that contain /// more than one architecture or object. - //------------------------------------------------------------------ ObjectFile(const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr, lldb::offset_t file_offset, lldb::offset_t length, const lldb::DataBufferSP &data_sp, lldb::offset_t data_offset); @@ -106,15 +102,12 @@ public: ObjectFile(const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::DataBufferSP &data_sp); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be inherited /// from by the plug-in instance. - //------------------------------------------------------------------ ~ObjectFile() override; - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the current contents of this object to the @@ -123,10 +116,8 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ virtual void Dump(Stream *s) = 0; - //------------------------------------------------------------------ /// Find a ObjectFile plug-in that can parse \a file_spec. /// /// Scans all loaded plug-in interfaces that implement versions of the @@ -150,13 +141,11 @@ public: /// or if it is known. This can be zero. /// /// \see ObjectFile::ParseHeader() - //------------------------------------------------------------------ static lldb::ObjectFileSP FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file_spec, lldb::offset_t file_offset, lldb::offset_t file_size, lldb::DataBufferSP &data_sp, lldb::offset_t &data_offset); - //------------------------------------------------------------------ /// Find a ObjectFile plug-in that can parse a file in memory. /// /// Scans all loaded plug-in interfaces that implement versions of the @@ -172,7 +161,6 @@ public: /// /// \param[in] header_addr /// The address of the header for the object file in memory. - //------------------------------------------------------------------ static lldb::ObjectFileSP FindPlugin(const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, @@ -189,7 +177,6 @@ public: lldb::offset_t file_offset, lldb::offset_t file_size, lldb_private::ModuleSpecList &specs); - //------------------------------------------------------------------ /// Split a path into a file path with object name. /// /// For paths like "/tmp/foo.a(bar.o)" we often need to split a path up into @@ -213,22 +200,18 @@ public: /// and \a archive_file and \a archive_object are modified, /// \b false otherwise and \a archive_file and \a archive_object /// are guaranteed to be remain unchanged. - //------------------------------------------------------------------ static bool SplitArchivePathWithObject( const char *path_with_object, lldb_private::FileSpec &archive_file, lldb_private::ConstString &archive_object, bool must_exist); - //------------------------------------------------------------------ /// Gets the address size in bytes for the current object file. /// /// \return /// The size of an address in bytes for the currently selected /// architecture (and object for archives). Returns zero if no /// architecture or object has been selected. - //------------------------------------------------------------------ virtual uint32_t GetAddressByteSize() const = 0; - //------------------------------------------------------------------ /// Get the address type given a file address in an object file. /// /// Many binary file formats know what kinds This is primarily for ARM @@ -239,10 +222,8 @@ public: /// The size of an address in bytes for the currently selected /// architecture (and object for archives). Returns zero if no /// architecture or object has been selected. - //------------------------------------------------------------------ virtual AddressClass GetAddressClass(lldb::addr_t file_addr); - //------------------------------------------------------------------ /// Extract the dependent modules from an object file. /// /// If an object file has information about which other images it depends on @@ -259,19 +240,15 @@ public: /// The number of new files that were appended to \a file_list. /// /// \see FileSpecList::AppendIfUnique(const FileSpec &) - //------------------------------------------------------------------ virtual uint32_t GetDependentModules(FileSpecList &file_list) = 0; - //------------------------------------------------------------------ /// Tells whether this object file is capable of being the main executable /// for a process. /// /// \return /// \b true if it is, \b false otherwise. - //------------------------------------------------------------------ virtual bool IsExecutable() const = 0; - //------------------------------------------------------------------ /// Returns the offset into a file at which this object resides. /// /// Some files contain many object files, and this function allows access to @@ -280,39 +257,31 @@ public: /// \return /// The offset in bytes into the file. Defaults to zero for /// simple object files that a represented by an entire file. - //------------------------------------------------------------------ virtual lldb::addr_t GetFileOffset() const { return m_file_offset; } virtual lldb::addr_t GetByteSize() const { return m_length; } - //------------------------------------------------------------------ /// Get accessor to the object file specification. /// /// \return /// The file specification object pointer if there is one, or /// NULL if this object is only from memory. - //------------------------------------------------------------------ virtual FileSpec &GetFileSpec() { return m_file; } - //------------------------------------------------------------------ /// Get const accessor to the object file specification. /// /// \return /// The const file specification object pointer if there is one, /// or NULL if this object is only from memory. - //------------------------------------------------------------------ virtual const FileSpec &GetFileSpec() const { return m_file; } - //------------------------------------------------------------------ /// Get the ArchSpec for this object file. /// /// \return /// The ArchSpec of this object file. In case of error, an invalid /// ArchSpec object is returned. - //------------------------------------------------------------------ virtual ArchSpec GetArchitecture() = 0; - //------------------------------------------------------------------ /// Gets the section list for the currently selected architecture (and /// object for archives). /// @@ -321,18 +290,14 @@ public: /// /// \return /// The list of sections contained in this object file. - //------------------------------------------------------------------ virtual SectionList *GetSectionList(bool update_module_section_list = true); virtual void CreateSections(SectionList &unified_section_list) = 0; - //------------------------------------------------------------------ /// Notify the ObjectFile that the file addresses in the Sections for this /// module have been changed. - //------------------------------------------------------------------ virtual void SectionFileAddressesChanged() {} - //------------------------------------------------------------------ /// Gets the symbol table for the currently selected architecture (and /// object for archives). /// @@ -341,16 +306,12 @@ public: /// /// \return /// The symbol table for this object file. - //------------------------------------------------------------------ virtual Symtab *GetSymtab() = 0; - //------------------------------------------------------------------ /// Perform relocations on the section if necessary. /// - //------------------------------------------------------------------ virtual void RelocateSection(lldb_private::Section *section); - //------------------------------------------------------------------ /// Appends a Symbol for the specified so_addr to the symbol table. /// /// If verify_unique is false, the symbol table is not searched to determine @@ -362,7 +323,6 @@ public: /// \return /// The resolved symbol or nullptr. Returns nullptr if a /// a Symbol could not be found for the specified so_addr. - //------------------------------------------------------------------ virtual Symbol *ResolveSymbolForAddress(const Address &so_addr, bool verify_unique) { // Typically overridden to lazily add stripped symbols recoverable from the @@ -375,18 +335,14 @@ public: return nullptr; } - //------------------------------------------------------------------ /// Detect if this object file has been stripped of local symbols. - //------------------------------------------------------------------ /// Detect if this object file has been stripped of local symbols. /// /// \return /// Return \b true if the object file has been stripped of local /// symbols. - //------------------------------------------------------------------ virtual bool IsStripped() = 0; - //------------------------------------------------------------------ /// Frees the symbol table. /// /// This function should only be used when an object file is @@ -397,10 +353,8 @@ public: /// /// \return /// The symbol table for this object file. - //------------------------------------------------------------------ virtual void ClearSymtab(); - //------------------------------------------------------------------ /// Gets the UUID for this object file. /// /// If the object file format contains a UUID, the value should be returned. @@ -410,10 +364,8 @@ public: /// \return /// The object file's UUID. In case of an error, an empty UUID is /// returned. - //------------------------------------------------------------------ virtual UUID GetUUID() = 0; - //------------------------------------------------------------------ /// Gets the symbol file spec list for this object file. /// /// If the object file format contains a debug symbol file link, the values @@ -421,12 +373,10 @@ public: /// /// \return /// Returns filespeclist. - //------------------------------------------------------------------ virtual lldb_private::FileSpecList GetDebugSymbolFilePaths() { return FileSpecList(); } - //------------------------------------------------------------------ /// Gets the file spec list of libraries re-exported by this object file. /// /// If the object file format has the notion of one library re-exporting the @@ -435,34 +385,28 @@ public: /// /// \return /// Returns filespeclist. - //------------------------------------------------------------------ virtual lldb_private::FileSpecList GetReExportedLibraries() { return FileSpecList(); } - //------------------------------------------------------------------ /// Sets the load address for an entire module, assuming a rigid slide of /// sections, if possible in the implementation. /// /// \return /// Returns true iff any section's load address changed. - //------------------------------------------------------------------ virtual bool SetLoadAddress(Target &target, lldb::addr_t value, bool value_is_offset) { return false; } - //------------------------------------------------------------------ /// Gets whether endian swapping should occur when extracting data from this /// object file. /// /// \return /// Returns \b true if endian swapping is needed, \b false /// otherwise. - //------------------------------------------------------------------ virtual lldb::ByteOrder GetByteOrder() const = 0; - //------------------------------------------------------------------ /// Attempts to parse the object header. /// /// This function is used as a test to see if a given plug-in instance can @@ -474,10 +418,8 @@ public: /// \return /// Returns \b true if the header was parsed successfully, \b /// false otherwise. - //------------------------------------------------------------------ virtual bool ParseHeader() = 0; - //------------------------------------------------------------------ /// Returns if the function bounds for symbols in this symbol file are /// likely accurate. /// @@ -499,10 +441,8 @@ public: /// module. /// Only returns false if the ObjectFile is sure that symbol /// addresses are insufficient for accurate assembly emulation. - //------------------------------------------------------------------ virtual bool AllowAssemblyEmulationUnwindPlans() { return true; } - //------------------------------------------------------------------ /// Similar to Process::GetImageInfoAddress(). /// /// Some platforms embed auxiliary structures useful to debuggers in the @@ -519,17 +459,14 @@ public: return Address(); } - //------------------------------------------------------------------ /// Returns the address of the Entry Point in this object file - if the /// object file doesn't have an entry point (because it is not an executable /// file) then an invalid address is returned. /// /// \return /// Returns the entry address for this module. - //------------------------------------------------------------------ virtual lldb_private::Address GetEntryPointAddress() { return Address(); } - //------------------------------------------------------------------ /// Returns base address of this object file. /// /// This also sometimes referred to as the "preferred load address" or the @@ -538,14 +475,12 @@ public: /// (usually the first byte of the first section) then the returned address /// will have this section set. Otherwise, the address will just have the /// offset member filled in, indicating that this represents a file address. - //------------------------------------------------------------------ virtual lldb_private::Address GetBaseAddress() { return Address(m_memory_addr); } virtual uint32_t GetNumThreadContexts() { return 0; } - //------------------------------------------------------------------ /// Some object files may have an identifier string embedded in them, e.g. /// in a Mach-O core file using the LC_IDENT load command (which is /// obsolete, but can still be found in some old files) @@ -553,12 +488,10 @@ public: /// \return /// Returns the identifier string if one exists, else an empty /// string. - //------------------------------------------------------------------ virtual std::string GetIdentifierString () { return std::string(); } - //------------------------------------------------------------------ /// When the ObjectFile is a core file, lldb needs to locate the "binary" in /// the core file. lldb can iterate over the pages looking for a valid /// binary, but some core files may have metadata describing where the main @@ -577,7 +510,6 @@ public: /// /// \return /// Returns true if either address or uuid has been set. - //------------------------------------------------------------------ virtual bool GetCorefileMainBinaryInfo (lldb::addr_t &address, UUID &uuid) { address = LLDB_INVALID_ADDRESS; uuid.Clear(); @@ -589,7 +521,6 @@ public: return lldb::RegisterContextSP(); } - //------------------------------------------------------------------ /// The object file should be able to calculate its type by looking at its /// file header and possibly the sections or other data in the object file. /// The file type is used in the debugger to help select the correct plug- @@ -599,16 +530,13 @@ public: /// /// \return /// The calculated file type for the current object file. - //------------------------------------------------------------------ virtual Type CalculateType() = 0; - //------------------------------------------------------------------ /// In cases where the type can't be calculated (elf files), this routine /// allows someone to explicitly set it. As an example, SymbolVendorELF uses /// this routine to set eTypeDebugInfo when loading debug link files. virtual void SetType(Type type) { m_type = type; } - //------------------------------------------------------------------ /// The object file should be able to calculate the strata of the object /// file. /// @@ -620,10 +548,8 @@ public: /// \return /// The calculated object file strata for the current object /// file. - //------------------------------------------------------------------ virtual Strata CalculateStrata() = 0; - //------------------------------------------------------------------ /// Get the object file version numbers. /// /// Many object files have a set of version numbers that describe the @@ -635,10 +561,8 @@ public: /// This function returns extracted version numbers as a /// llvm::VersionTuple. In case of error an empty VersionTuple is /// returned. - //------------------------------------------------------------------ virtual llvm::VersionTuple GetVersion() { return llvm::VersionTuple(); } - //------------------------------------------------------------------ /// Get the minimum OS version this object file can run on. /// /// Some object files have information that specifies the minimum OS version @@ -648,17 +572,14 @@ public: /// This function returns extracted version numbers as a /// llvm::VersionTuple. In case of error an empty VersionTuple is /// returned. - //------------------------------------------------------------------ virtual llvm::VersionTuple GetMinimumOSVersion() { return llvm::VersionTuple(); } - //------------------------------------------------------------------ /// Get the SDK OS version this object file was built with. /// /// The versions arguments and returns values are the same as the /// GetMinimumOSVersion() - //------------------------------------------------------------------ virtual uint32_t GetSDKVersion(uint32_t *versions, uint32_t num_versions) { if (versions && num_versions) { for (uint32_t i = 0; i < num_versions; ++i) @@ -667,7 +588,6 @@ public: return 0; } - //------------------------------------------------------------------ /// Return true if this file is a dynamic link editor (dyld) /// /// Often times dyld has symbols that mirror symbols in libc and other @@ -675,12 +595,9 @@ public: /// to stop in these shared libraries by default. We can ask the ObjectFile /// if it is such a file and should be avoided for things like settings /// breakpoints and doing function lookups for expressions. - //------------------------------------------------------------------ virtual bool GetIsDynamicLinkEditor() { return false; } - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ Type GetType() { if (m_type == eTypeInvalid) m_type = CalculateType(); @@ -732,7 +649,6 @@ public: llvm::StringRef name, lldb::SymbolType symbol_type_hint = lldb::eSymbolTypeUndefined); - //------------------------------------------------------------------ /// Loads this objfile to memory. /// /// Loads the bits needed to create an executable image to the memory. It is @@ -743,13 +659,10 @@ public: /// Target where to load. /// /// \return - //------------------------------------------------------------------ virtual std::vector<LoadableData> GetLoadableData(Target &target); protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ FileSpec m_file; Type m_type; Strata m_strata; @@ -766,7 +679,6 @@ protected: std::unique_ptr<lldb_private::Symtab> m_symtab_up; uint32_t m_synthetic_symbol_idx; - //------------------------------------------------------------------ /// Sets the architecture for a module. At present the architecture can /// only be set if it is invalid. It is not allowed to switch from one /// concrete architecture to another. @@ -777,7 +689,6 @@ protected: /// \return /// Returns \b true if the architecture was changed, \b /// false otherwise. - //------------------------------------------------------------------ bool SetModulesArchitecture(const ArchSpec &new_arch); ConstString GetNextSyntheticSymbolName(); diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h index 1efbc35..d366297 100644 --- a/lldb/include/lldb/Symbol/Symbol.h +++ b/lldb/include/lldb/Symbol/Symbol.h @@ -48,35 +48,27 @@ public: bool ValueIsAddress() const; - //------------------------------------------------------------------ // The GetAddressRef() accessor functions should only be called if you // previously call ValueIsAddress() otherwise you might get an reference to // an Address object that contains an constant integer value in // m_addr_range.m_base_addr.m_offset which could be incorrectly used to // represent an absolute address since it has no section. - //------------------------------------------------------------------ Address &GetAddressRef() { return m_addr_range.GetBaseAddress(); } const Address &GetAddressRef() const { return m_addr_range.GetBaseAddress(); } - //------------------------------------------------------------------ // Makes sure the symbol's value is an address and returns the file address. // Returns LLDB_INVALID_ADDRESS if the symbol's value isn't an address. - //------------------------------------------------------------------ lldb::addr_t GetFileAddress() const; - //------------------------------------------------------------------ // Makes sure the symbol's value is an address and gets the load address // using \a target if it is. Returns LLDB_INVALID_ADDRESS if the symbol's // value isn't an address or if the section isn't loaded in \a target. - //------------------------------------------------------------------ lldb::addr_t GetLoadAddress(Target *target) const; - //------------------------------------------------------------------ // Access the address value. Do NOT hand out the AddressRange as an object as // the byte size of the address range may not be filled in and it should be // accessed via GetByteSize(). - //------------------------------------------------------------------ Address GetAddress() const { // Make sure the our value is an address before we hand a copy out. We use // the Address inside m_addr_range to contain the value for symbols that @@ -203,22 +195,18 @@ public: void SetContainsLinkerAnnotations(bool b) { m_contains_linker_annotations = b; } - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void CalculateSymbolContext(SymbolContext *sc) override; lldb::ModuleSP CalculateSymbolContextModule() override; Symbol *CalculateSymbolContextSymbol() override; - //------------------------------------------------------------------ /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*) /// /// \see SymbolContextScope - //------------------------------------------------------------------ void DumpSymbolContext(Stream *s) override; lldb::DisassemblerSP GetInstructions(const ExecutionContext &exe_ctx, diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 5298f5e..10f52f1 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -23,7 +23,6 @@ namespace lldb_private { class SymbolContextScope; -//---------------------------------------------------------------------- /// \class SymbolContext SymbolContext.h "lldb/Symbol/SymbolContext.h" Defines /// a symbol context baton that can be handed other debug core functions. /// @@ -31,28 +30,22 @@ class SymbolContextScope; /// provides a common structure that can be used as the result of a query that /// can contain a single result. Examples of such queries include /// \li Looking up a load address. -//---------------------------------------------------------------------- class SymbolContext { public: - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize all pointer members to nullptr and all struct members to /// their default state. - //------------------------------------------------------------------ SymbolContext(); - //------------------------------------------------------------------ /// Construct with an object that knows how to reconstruct its symbol /// context. /// /// \param[in] sc_scope /// A symbol context scope object that knows how to reconstruct /// it's context. - //------------------------------------------------------------------ explicit SymbolContext(SymbolContextScope *sc_scope); - //------------------------------------------------------------------ /// Construct with module, and optional compile unit, function, block, line /// table, line entry and symbol. /// @@ -75,7 +68,6 @@ public: /// /// \param[in] symbol /// A Symbol pointer to the symbol for this context. - //------------------------------------------------------------------ explicit SymbolContext(const lldb::TargetSP &target_sp, const lldb::ModuleSP &module_sp, CompileUnit *comp_unit = nullptr, @@ -90,19 +82,16 @@ public: LineEntry *line_entry = nullptr, Symbol *symbol = nullptr); - //------------------------------------------------------------------ /// Copy constructor /// /// Makes a copy of the another SymbolContext object \a rhs. /// /// \param[in] rhs /// A const SymbolContext object reference to copy. - //------------------------------------------------------------------ SymbolContext(const SymbolContext &rhs); ~SymbolContext(); - //------------------------------------------------------------------ /// Assignment operator. /// /// Copies the address value from another SymbolContext object \a rhs into @@ -113,18 +102,14 @@ public: /// /// \return /// A const SymbolContext object reference to \a this. - //------------------------------------------------------------------ const SymbolContext &operator=(const SymbolContext &rhs); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Resets all pointer members to nullptr, and clears any class objects to /// their default state. - //------------------------------------------------------------------ void Clear(bool clear_target); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the supplied stream @@ -132,10 +117,8 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, Target *target) const; - //------------------------------------------------------------------ /// Dump the stop context in this object to a Stream. /// /// Dump the best description of this object to the stream. The information @@ -176,14 +159,12 @@ public: /// be printed. In disassembly formatting, where we want a format /// like "<*+36>", this should be false and "*" will be printed /// instead. - //------------------------------------------------------------------ bool DumpStopContext(Stream *s, ExecutionContextScope *exe_scope, const Address &so_addr, bool show_fullpaths, bool show_module, bool show_inlined_frames, bool show_function_arguments, bool show_function_name) const; - //------------------------------------------------------------------ /// Get the address range contained within a symbol context. /// /// Address range priority is as follows: @@ -221,14 +202,12 @@ public: /// \return /// \b True if this symbol context contains items that describe /// an address range, \b false otherwise. - //------------------------------------------------------------------ bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const; bool GetAddressRangeFromHereToEndLine(uint32_t end_line, AddressRange &range, Status &error); - //------------------------------------------------------------------ /// Find the best global data symbol visible from this context. /// /// Symbol priority is: @@ -248,7 +227,6 @@ public: /// /// \return /// The symbol that was found, or \b nullptr if none was found. - //------------------------------------------------------------------ const Symbol *FindBestGlobalDataSymbol(ConstString name, Status &error); void GetDescription(Stream *s, lldb::DescriptionLevel level, @@ -258,7 +236,6 @@ public: lldb::LanguageType GetLanguage() const; - //------------------------------------------------------------------ /// Find a block that defines the function represented by this symbol /// context. /// @@ -278,10 +255,8 @@ public: /// \return /// The block object pointer that defines the function that is /// represented by this symbol context object, nullptr otherwise. - //------------------------------------------------------------------ Block *GetFunctionBlock(); - //------------------------------------------------------------------ /// If this symbol context represents a function that is a method, return /// true and provide information about the method. /// @@ -299,18 +274,14 @@ public: /// \return /// \b True if this symbol context represents a function that /// is a method of a class, \b false otherwise. - //------------------------------------------------------------------ bool GetFunctionMethodInfo(lldb::LanguageType &language, bool &is_instance_method, ConstString &language_object_name); - //------------------------------------------------------------------ /// Sorts the types in TypeMap according to SymbolContext to TypeList /// - //------------------------------------------------------------------ void SortTypeList(TypeMap &type_map, TypeList &type_list) const; - //------------------------------------------------------------------ /// Find a name of the innermost function for the symbol context. /// /// For instance, if the symbol context contains an inlined block, it will @@ -323,11 +294,9 @@ public: /// /// \return /// The name of the function represented by this symbol context. - //------------------------------------------------------------------ ConstString GetFunctionName( Mangled::NamePreference preference = Mangled::ePreferDemangled) const; - //------------------------------------------------------------------ /// Get the line entry that corresponds to the function. /// /// If the symbol context contains an inlined block, the line entry for the @@ -345,10 +314,8 @@ public: /// /// \return /// The name of the function represented by this symbol context. - //------------------------------------------------------------------ LineEntry GetFunctionStartLineEntry() const; - //------------------------------------------------------------------ /// Find the block containing the inlined block that contains this block. /// /// For instance, if the symbol context contains an inlined block, it will @@ -367,14 +334,11 @@ public: /// \b true if this SymbolContext specifies a block contained in an /// inlined block. If this returns \b true, \a next_frame_sc and /// \a next_frame_addr will be filled in correctly. - //------------------------------------------------------------------ bool GetParentOfInlinedScope(const Address &curr_frame_pc, SymbolContext &next_frame_sc, Address &inlined_frame_addr) const; - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ lldb::TargetSP target_sp; ///< The Target for a given query lldb::ModuleSP module_sp; ///< The Module for a given query CompileUnit *comp_unit; ///< The CompileUnit for a given query @@ -428,7 +392,6 @@ private: uint32_t m_type; // Or'ed bits from SpecificationType }; -//---------------------------------------------------------------------- /// \class SymbolContextList SymbolContext.h "lldb/Symbol/SymbolContext.h" /// Defines a list of symbol context objects. /// @@ -437,27 +400,20 @@ private: /// queries include: /// \li Looking up a function by name. /// \li Finding all addresses for a specified file and line number. -//---------------------------------------------------------------------- class SymbolContextList { public: - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize with an empty list. - //------------------------------------------------------------------ SymbolContextList(); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~SymbolContextList(); - //------------------------------------------------------------------ /// Append a new symbol context to the list. /// /// \param[in] sc /// A symbol context to append to the list. - //------------------------------------------------------------------ void Append(const SymbolContext &sc); void Append(const SymbolContextList &sc_list); @@ -467,14 +423,11 @@ public: uint32_t AppendIfUnique(const SymbolContextList &sc_list, bool merge_symbol_into_function); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Clears the symbol context list. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of each symbol context in the list to @@ -482,10 +435,8 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, Target *target) const; - //------------------------------------------------------------------ /// Get accessor for a symbol context at index \a idx. /// /// Dump a description of the contents of each symbol context in the list to @@ -501,10 +452,8 @@ public: /// Returns \b true if \a idx was a valid index into this /// symbol context list and \a sc was filled in, \b false /// otherwise. - //------------------------------------------------------------------ bool GetContextAtIndex(size_t idx, SymbolContext &sc) const; - //------------------------------------------------------------------ /// Direct reference accessor for a symbol context at index \a idx. /// /// The index \a idx must be a valid index, no error checking will be done @@ -515,7 +464,6 @@ public: /// /// \return /// A const reference to the symbol context to fill in. - //------------------------------------------------------------------ SymbolContext &operator[](size_t idx) { return m_symbol_contexts[idx]; } const SymbolContext &operator[](size_t idx) const { @@ -524,12 +472,10 @@ public: bool RemoveContextAtIndex(size_t idx); - //------------------------------------------------------------------ /// Get accessor for a symbol context list size. /// /// \return /// Returns the number of symbol context objects in the list. - //------------------------------------------------------------------ uint32_t GetSize() const; uint32_t NumLineEntriesWithLine(uint32_t line) const; @@ -541,9 +487,7 @@ protected: typedef std::vector<SymbolContext> collection; ///< The collection type for the list. - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ collection m_symbol_contexts; ///< The list of symbol contexts. public: diff --git a/lldb/include/lldb/Symbol/SymbolContextScope.h b/lldb/include/lldb/Symbol/SymbolContextScope.h index afb2174..a626302 100644 --- a/lldb/include/lldb/Symbol/SymbolContextScope.h +++ b/lldb/include/lldb/Symbol/SymbolContextScope.h @@ -13,7 +13,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class SymbolContextScope SymbolContextScope.h /// "lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is /// part of a symbol context @@ -62,12 +61,10 @@ namespace lldb_private { /// can also be created using a SymbolContextScope* and and object pairs that /// allow large collections of objects to be passed around with minimal /// overhead. -//---------------------------------------------------------------------- class SymbolContextScope { public: virtual ~SymbolContextScope() = default; - //------------------------------------------------------------------ /// Reconstruct the object's symbol context into \a sc. /// /// The object should fill in as much of the SymbolContext as it can so @@ -76,7 +73,6 @@ public: /// /// \param[out] sc /// A symbol context object pointer that gets filled in. - //------------------------------------------------------------------ virtual void CalculateSymbolContext(SymbolContext *sc) = 0; virtual lldb::ModuleSP CalculateSymbolContextModule() { @@ -91,7 +87,6 @@ public: virtual Symbol *CalculateSymbolContextSymbol() { return nullptr; } - //------------------------------------------------------------------ /// Dump the object's symbol context to the stream \a s. /// /// The object should dump its symbol context to the stream \a s. This @@ -100,7 +95,6 @@ public: /// /// \param[in] s /// The stream to which to dump the object's symbol context. - //------------------------------------------------------------------ virtual void DumpSymbolContext(Stream *s) = 0; }; diff --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h index 04d95e2..5d60798 100644 --- a/lldb/include/lldb/Symbol/SymbolFile.h +++ b/lldb/include/lldb/Symbol/SymbolFile.h @@ -32,14 +32,12 @@ namespace lldb_private { class SymbolFile : public PluginInterface { public: - //------------------------------------------------------------------ // Symbol file ability bits. // // Each symbol file can claim to support one or more symbol file abilities. // These get returned from SymbolFile::GetAbilities(). These help us to // determine which plug-in will be best to load the debug information found // in files. - //------------------------------------------------------------------ enum Abilities { CompileUnits = (1u << 0), LineTables = (1u << 1), @@ -53,15 +51,12 @@ public: static SymbolFile *FindPlugin(ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFile(ObjectFile *obj_file) : m_obj_file(obj_file), m_abilities(0), m_calculated_abilities(false) {} ~SymbolFile() override {} - //------------------------------------------------------------------ /// Get a mask of what this symbol file supports for the object file /// that it was constructed with. /// @@ -89,7 +84,6 @@ public: /// A uint32_t mask containing bits from the SymbolFile::Abilities /// enumeration. Any bits that are set represent an ability that /// this symbol plug-in can parse from the object file. - ///------------------------------------------------------------------ uint32_t GetAbilities() { if (!m_calculated_abilities) { m_abilities = CalculateAbilities(); @@ -101,13 +95,10 @@ public: virtual uint32_t CalculateAbilities() = 0; - //------------------------------------------------------------------ /// Symbols file subclasses should override this to return the Module that /// owns the TypeSystem that this symbol file modifies type information in. - //------------------------------------------------------------------ virtual std::recursive_mutex &GetModuleMutex() const; - //------------------------------------------------------------------ /// Initialize the SymbolFile object. /// /// The SymbolFile object with the best set of abilities (detected @@ -115,12 +106,9 @@ public: /// called if it is chosen to parse an object file. More complete /// initialization can happen in this function which will get called /// prior to any other functions in the SymbolFile protocol. - //------------------------------------------------------------------ virtual void InitializeObject() {} - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ // Approach 1 - iterator virtual uint32_t GetNumCompileUnits() = 0; virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) = 0; @@ -231,10 +219,8 @@ public: virtual void AddSymbols(Symtab &symtab) {} - //------------------------------------------------------------------ /// Notify the SymbolFile that the file addresses in the Sections /// for this module have been changed. - //------------------------------------------------------------------ virtual void SectionFileAddressesChanged() {} virtual void Dump(Stream &s) {} diff --git a/lldb/include/lldb/Symbol/SymbolVendor.h b/lldb/include/lldb/Symbol/SymbolVendor.h index 4767e92..c4015ff 100644 --- a/lldb/include/lldb/Symbol/SymbolVendor.h +++ b/lldb/include/lldb/Symbol/SymbolVendor.h @@ -21,7 +21,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- // The symbol vendor class is designed to abstract the process of searching for // debug information for a given module. Platforms can subclass this class and // provide extra ways to find debug information. Examples would be a subclass @@ -29,15 +28,12 @@ namespace lldb_private { // or runtime data in the object files. A symbol vendor can use multiple // sources (SymbolFile objects) to provide the information and only parse as // deep as needed in order to provide the information that is requested. -//---------------------------------------------------------------------- class SymbolVendor : public ModuleChild, public PluginInterface { public: static SymbolVendor *FindPlugin(const lldb::ModuleSP &module_sp, Stream *feedback_strm); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolVendor(const lldb::ModuleSP &module_sp); ~SymbolVendor() override; @@ -136,23 +132,17 @@ public: // Clear module unified section list symbol table. virtual void ClearSymtab(); - //------------------------------------------------------------------ /// Notify the SymbolVendor that the file addresses in the Sections /// for this module have been changed. - //------------------------------------------------------------------ virtual void SectionFileAddressesChanged(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; protected: - //------------------------------------------------------------------ // Classes that inherit from SymbolVendor can see and modify these - //------------------------------------------------------------------ typedef std::vector<lldb::CompUnitSP> CompileUnits; typedef CompileUnits::iterator CompileUnitIter; typedef CompileUnits::const_iterator CompileUnitConstIter; @@ -169,9 +159,7 @@ protected: // the symbol file each time when it is needed private: - //------------------------------------------------------------------ // For SymbolVendor only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(SymbolVendor); }; diff --git a/lldb/include/lldb/Symbol/Symtab.h b/lldb/include/lldb/Symbol/Symtab.h index 3d47b5de..1f2cd8f8 100644 --- a/lldb/include/lldb/Symbol/Symtab.h +++ b/lldb/include/lldb/Symbol/Symtab.h @@ -54,13 +54,11 @@ public: Symbol *FindSymbolWithType(lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx); - //---------------------------------------------------------------------- /// Get the parent symbol for the given symbol. /// /// Many symbols in symbol tables are scoped by other symbols that /// contain one or more symbol. This function will look for such a /// containing symbol and return it if there is one. - //---------------------------------------------------------------------- const Symbol *GetParent(Symbol *symbol) const; uint32_t AppendSymbolIndexesWithType(lldb::SymbolType symbol_type, std::vector<uint32_t> &indexes, diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index f2ededa..f1b094a 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -22,10 +22,8 @@ #include <set> namespace lldb_private { -//---------------------------------------------------------------------- // CompilerContext allows an array of these items to be passed to perform // detailed lookups in SymbolVendor and SymbolFile functions. -//---------------------------------------------------------------------- struct CompilerContext { CompilerContext(CompilerContextKind t, ConstString n) : type(t), name(n) {} diff --git a/lldb/include/lldb/Symbol/TypeList.h b/lldb/include/lldb/Symbol/TypeList.h index 8862fd8..982f673 100644 --- a/lldb/include/lldb/Symbol/TypeList.h +++ b/lldb/include/lldb/Symbol/TypeList.h @@ -19,9 +19,7 @@ namespace lldb_private { class TypeList { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ TypeList(); virtual ~TypeList(); diff --git a/lldb/include/lldb/Symbol/TypeMap.h b/lldb/include/lldb/Symbol/TypeMap.h index abf1cf3..e7d2b25 100644 --- a/lldb/include/lldb/Symbol/TypeMap.h +++ b/lldb/include/lldb/Symbol/TypeMap.h @@ -19,9 +19,7 @@ namespace lldb_private { class TypeMap { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ TypeMap(); virtual ~TypeMap(); diff --git a/lldb/include/lldb/Symbol/TypeSystem.h b/lldb/include/lldb/Symbol/TypeSystem.h index 82a22b2..39226eb 100644 --- a/lldb/include/lldb/Symbol/TypeSystem.h +++ b/lldb/include/lldb/Symbol/TypeSystem.h @@ -29,12 +29,9 @@ class PDBASTParser; namespace lldb_private { -//---------------------------------------------------------------------- // Interface for representing the Type Systems in different languages. -//---------------------------------------------------------------------- class TypeSystem : public PluginInterface { public: - //---------------------------------------------------------------------- // Intrusive type system that allows us to use llvm casting. // // To add a new type system: @@ -64,7 +61,6 @@ public: // // Then you can use the llvm casting on any "TypeSystem *" to get an instance // of your subclass. - //---------------------------------------------------------------------- enum LLVMCastKind { eKindClang, eKindSwift, @@ -72,9 +68,7 @@ public: kNumKinds }; - //---------------------------------------------------------------------- // Constructors and Destructors - //---------------------------------------------------------------------- TypeSystem(LLVMCastKind kind); ~TypeSystem() override; @@ -99,9 +93,7 @@ public: // Returns true if the symbol file changed during the set accessor. virtual void SetSymbolFile(SymbolFile *sym_file) { m_sym_file = sym_file; } - //---------------------------------------------------------------------- // CompilerDecl functions - //---------------------------------------------------------------------- virtual ConstString DeclGetName(void *opaque_decl) = 0; virtual ConstString DeclGetMangledName(void *opaque_decl); @@ -115,9 +107,7 @@ public: virtual CompilerType DeclGetFunctionArgumentType(void *opaque_decl, size_t arg_idx); - //---------------------------------------------------------------------- // CompilerDeclContext functions - //---------------------------------------------------------------------- virtual std::vector<CompilerDecl> DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, @@ -137,9 +127,7 @@ public: virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx, void *other_opaque_decl_ctx) = 0; - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- virtual bool IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size, @@ -196,21 +184,15 @@ public: // TypeSystems can support more than one language virtual bool SupportsLanguage(lldb::LanguageType language) = 0; - //---------------------------------------------------------------------- // Type Completion - //---------------------------------------------------------------------- virtual bool GetCompleteType(lldb::opaque_compiler_type_t type) = 0; - //---------------------------------------------------------------------- // AST related queries - //---------------------------------------------------------------------- virtual uint32_t GetPointerByteSize() = 0; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type) = 0; @@ -223,9 +205,7 @@ public: virtual lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) = 0; - //---------------------------------------------------------------------- // Creating related types - //---------------------------------------------------------------------- virtual CompilerType GetArrayElementType(lldb::opaque_compiler_type_t type, uint64_t *stride) = 0; @@ -271,9 +251,7 @@ public: const char *name, const CompilerDeclContext &decl_ctx); - //---------------------------------------------------------------------- // Exploring the type - //---------------------------------------------------------------------- virtual llvm::Optional<uint64_t> GetBitSize(lldb::opaque_compiler_type_t type, @@ -356,9 +334,7 @@ public: virtual llvm::Optional<CompilerType::IntegralTemplateArgument> GetIntegralTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx); - //---------------------------------------------------------------------- // Dumping types - //---------------------------------------------------------------------- #ifndef NDEBUG /// Convenience LLVM-style dump method for use in the debugger only. @@ -387,9 +363,7 @@ public: virtual void DumpTypeDescription(lldb::opaque_compiler_type_t type, Stream *s) = 0; - //---------------------------------------------------------------------- // TODO: These methods appear unused. Should they be removed? - //---------------------------------------------------------------------- virtual bool IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type) = 0; @@ -405,9 +379,7 @@ public: const char *s, uint8_t *dst, size_t dst_size) = 0; - //---------------------------------------------------------------------- // TODO: Determine if these methods should move to ClangASTContext. - //---------------------------------------------------------------------- virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type) = 0; diff --git a/lldb/include/lldb/Symbol/Variable.h b/lldb/include/lldb/Symbol/Variable.h index b7118f0..ea46df7 100644 --- a/lldb/include/lldb/Symbol/Variable.h +++ b/lldb/include/lldb/Symbol/Variable.h @@ -26,9 +26,7 @@ class Variable : public UserID, public std::enable_shared_from_this<Variable> { public: typedef RangeVector<lldb::addr_t, lldb::addr_t> RangeList; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ Variable(lldb::user_id_t uid, const char *name, const char *mangled, // The mangled or fully qualified name of the variable. diff --git a/lldb/include/lldb/Symbol/VariableList.h b/lldb/include/lldb/Symbol/VariableList.h index 7b3d609..54d2758 100644 --- a/lldb/include/lldb/Symbol/VariableList.h +++ b/lldb/include/lldb/Symbol/VariableList.h @@ -17,9 +17,7 @@ namespace lldb_private { class VariableList { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ // VariableList(const SymbolContext &symbol_context); VariableList(); virtual ~VariableList(); @@ -75,9 +73,7 @@ protected: collection m_variables; private: - //------------------------------------------------------------------ // For VariableList only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(VariableList); }; diff --git a/lldb/include/lldb/Target/ABI.h b/lldb/include/lldb/Target/ABI.h index a3cd544..f254839 100644 --- a/lldb/include/lldb/Target/ABI.h +++ b/lldb/include/lldb/Target/ABI.h @@ -86,14 +86,12 @@ protected: virtual lldb::ValueObjectSP GetReturnValueObjectImpl(Thread &thread, llvm::Type &ir_type) const; - //------------------------------------------------------------------ /// Request to get a Process shared pointer. /// /// This ABI object may not have been created with a Process object, /// or the Process object may no longer be alive. Be sure to handle /// the case where the shared pointer returned does not have an /// object inside it. - //------------------------------------------------------------------ lldb::ProcessSP GetProcessSP() const { return m_process_wp.lock(); } public: @@ -138,9 +136,7 @@ public: static lldb::ABISP FindPlugin(lldb::ProcessSP process_sp, const ArchSpec &arch); protected: - //------------------------------------------------------------------ // Classes that inherit from ABI can see and modify these - //------------------------------------------------------------------ ABI(lldb::ProcessSP process_sp) { if (process_sp.get()) m_process_wp = process_sp; diff --git a/lldb/include/lldb/Target/CPPLanguageRuntime.h b/lldb/include/lldb/Target/CPPLanguageRuntime.h index dd038e0..11d965f 100644 --- a/lldb/include/lldb/Target/CPPLanguageRuntime.h +++ b/lldb/include/lldb/Target/CPPLanguageRuntime.h @@ -1,5 +1,4 @@ //===-- CPPLanguageRuntime.h -//---------------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -65,9 +64,7 @@ public: bool stop_others); protected: - //------------------------------------------------------------------ // Classes that inherit from CPPLanguageRuntime can see and modify these - //------------------------------------------------------------------ CPPLanguageRuntime(Process *process); private: diff --git a/lldb/include/lldb/Target/DynamicLoader.h b/lldb/include/lldb/Target/DynamicLoader.h index 8030569..c8ad4b4 100644 --- a/lldb/include/lldb/Target/DynamicLoader.h +++ b/lldb/include/lldb/Target/DynamicLoader.h @@ -44,7 +44,6 @@ class Thread; namespace lldb_private { -//---------------------------------------------------------------------- /// \class DynamicLoader DynamicLoader.h "lldb/Target/DynamicLoader.h" /// A plug-in interface definition class for dynamic loaders. /// @@ -62,10 +61,8 @@ namespace lldb_private { /// boolean value that indicates if the process should continue or halt and /// should return the global setting for this using: /// DynamicLoader::StopWhenImagesChange() const. -//---------------------------------------------------------------------- class DynamicLoader : public PluginInterface { public: - //------------------------------------------------------------------ /// Find a dynamic loader plugin for a given process. /// /// Scans the installed DynamicLoader plug-ins and tries to find an instance @@ -78,48 +75,36 @@ public: /// \param[in] plugin_name /// An optional name of a specific dynamic loader plug-in that /// should be used. If NULL, pick the best plug-in. - //------------------------------------------------------------------ static DynamicLoader *FindPlugin(Process *process, const char *plugin_name); - //------------------------------------------------------------------ /// Construct with a process. - //------------------------------------------------------------------ DynamicLoader(Process *process); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be inherited /// from by the plug-in instance. - //------------------------------------------------------------------ virtual ~DynamicLoader() override; - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after attaching to a /// process. - //------------------------------------------------------------------ virtual void DidAttach() = 0; - //------------------------------------------------------------------ /// Called after launching a process. /// /// Allow DynamicLoader plug-ins to execute some code after the process has /// stopped for the first time on launch. - //------------------------------------------------------------------ virtual void DidLaunch() = 0; - //------------------------------------------------------------------ /// Helper function that can be used to detect when a process has called /// exec and is now a new and different process. This can be called when /// necessary to try and detect the exec. The process might be able to /// answer this question, but sometimes it might not be able and the dynamic /// loader often knows what the program entry point is. So the process and /// the dynamic loader can work together to detect this. - //------------------------------------------------------------------ virtual bool ProcessDidExec() { return false; } - //------------------------------------------------------------------ /// Get whether the process should stop when images change. /// /// When images (executables and shared libraries) get loaded or unloaded, @@ -131,10 +116,8 @@ public: /// \return /// Returns \b true if the process should stop when images /// change, \b false if the process should resume. - //------------------------------------------------------------------ bool GetStopWhenImagesChange() const; - //------------------------------------------------------------------ /// Set whether the process should stop when images change. /// /// When images (executables and shared libraries) get loaded or unloaded, @@ -146,10 +129,8 @@ public: /// \param[in] stop /// Boolean value that indicates whether the process should stop /// when images change. - //------------------------------------------------------------------ void SetStopWhenImagesChange(bool stop); - //------------------------------------------------------------------ /// Provides a plan to step through the dynamic loader trampoline for the /// current state of \a thread. /// @@ -160,11 +141,9 @@ public: /// \return /// A pointer to the plan (caller owned) or NULL if we are not at such /// a trampoline. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) = 0; - //------------------------------------------------------------------ /// Some dynamic loaders provide features where there are a group of symbols /// "equivalent to" a given symbol one of which will be chosen when the /// symbol is bound. If you want to set a breakpoint on one of these @@ -183,14 +162,12 @@ public: /// /// \return /// Number of equivalent symbols found. - //------------------------------------------------------------------ virtual size_t FindEquivalentSymbols(Symbol *original_symbol, ModuleList &module_list, SymbolContextList &equivalent_symbols) { return 0; } - //------------------------------------------------------------------ /// Ask if it is ok to try and load or unload an shared library (image). /// /// The dynamic loader often knows when it would be ok to try and load or @@ -201,10 +178,8 @@ public: /// \return /// \b true if it is currently ok to try and load a shared /// library into the process, \b false otherwise. - //------------------------------------------------------------------ virtual Status CanLoadImage() = 0; - //------------------------------------------------------------------ /// Ask if the eh_frame information for the given SymbolContext should be /// relied on even when it's the first frame in a stack unwind. /// @@ -225,12 +200,10 @@ public: /// unconditionally when unwinding from this frame. Else \b false, /// the normal lldb unwind behavior of only using eh_frame when the /// function appears in the middle of the stack. - //------------------------------------------------------------------ virtual bool AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) { return false; } - //------------------------------------------------------------------ /// Retrieves the per-module TLS block for a given thread. /// /// \param[in] module @@ -243,7 +216,6 @@ public: /// If the given thread has TLS data allocated for the /// module, the address of the TLS block. Otherwise /// LLDB_INVALID_ADDRESS is returned. - //------------------------------------------------------------------ virtual lldb::addr_t GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) { @@ -257,7 +229,6 @@ public: lldb::addr_t base_addr, bool base_addr_is_offset); - //------------------------------------------------------------------ /// Get information about the shared cache for a process, if possible. /// /// On some systems (e.g. Darwin based systems), a set of libraries that are @@ -292,7 +263,6 @@ public: /// \return /// Returns false if this DynamicLoader cannot gather information /// about the shared cache / has no concept of a shared cache. - //------------------------------------------------------------------ virtual bool GetSharedCacheInformation(lldb::addr_t &base_address, UUID &uuid, LazyBool &using_shared_cache, LazyBool &private_shared_cache) { @@ -304,9 +274,7 @@ public: } protected: - //------------------------------------------------------------------ // Utility methods for derived classes - //------------------------------------------------------------------ /// Checks to see if the target module has changed, updates the target /// accordingly and returns the target executable module. @@ -353,9 +321,7 @@ protected: void LoadOperatingSystemPlugin(bool flush); - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ Process *m_process; ///< The process that this dynamic loader plug-in is tracking. diff --git a/lldb/include/lldb/Target/ExecutionContext.h b/lldb/include/lldb/Target/ExecutionContext.h index 4e421e37..0819357 100644 --- a/lldb/include/lldb/Target/ExecutionContext.h +++ b/lldb/include/lldb/Target/ExecutionContext.h @@ -40,7 +40,6 @@ namespace lldb_private { /// a wide variety of functions that require execution contexts. //===----------------------------------------------------------------------===// -//---------------------------------------------------------------------- /// \class ExecutionContextRef ExecutionContext.h /// "lldb/Target/ExecutionContext.h" /// A class that holds a weak reference to an execution context. @@ -70,44 +69,32 @@ namespace lldb_private { /// exist during a function that requires the objects. ExecutionContext /// objects should NOT be used for long term storage since they will keep /// objects alive with extra shared pointer references to these objects. -//---------------------------------------------------------------------- class ExecutionContextRef { public: - //------------------------------------------------------------------ /// Default Constructor. - //------------------------------------------------------------------ ExecutionContextRef(); - //------------------------------------------------------------------ /// Copy Constructor. - //------------------------------------------------------------------ ExecutionContextRef(const ExecutionContextRef &rhs); - //------------------------------------------------------------------ /// Construct using an ExecutionContext object that might be nullptr. /// /// If \a exe_ctx_ptr is valid, then make weak references to any valid /// objects in the ExecutionContext, otherwise no weak references to any /// execution context objects will be made. - //------------------------------------------------------------------ ExecutionContextRef(const ExecutionContext *exe_ctx_ptr); - //------------------------------------------------------------------ /// Construct using an ExecutionContext object. /// /// Make weak references to any valid objects in the ExecutionContext. - //------------------------------------------------------------------ ExecutionContextRef(const ExecutionContext &exe_ctx); - //------------------------------------------------------------------ /// Construct using the target and all the selected items inside of it (the /// process and its selected thread, and the thread's selected frame). If /// there is no selected thread, default to the first thread If there is no /// selected frame, default to the first frame. - //------------------------------------------------------------------ ExecutionContextRef(Target *target, bool adopt_selected); - //------------------------------------------------------------------ /// Construct using an execution context scope. /// /// If the ExecutionContextScope object is valid and refers to a frame, make @@ -118,10 +105,8 @@ public: /// references too the process and target. If the ExecutionContextScope /// object is valid and refers to a target, make weak references too the /// target. - //------------------------------------------------------------------ ExecutionContextRef(ExecutionContextScope *exe_scope); - //------------------------------------------------------------------ /// Construct using an execution context scope. /// /// If the ExecutionContextScope object refers to a frame, make weak @@ -131,34 +116,26 @@ public: /// refers to a process, make weak references too the process and target. If /// the ExecutionContextScope object refers to a target, make weak /// references too the target. - //------------------------------------------------------------------ ExecutionContextRef(ExecutionContextScope &exe_scope); ~ExecutionContextRef(); - //------------------------------------------------------------------ /// Assignment operator /// /// Copy all weak references in \a rhs. - //------------------------------------------------------------------ ExecutionContextRef &operator=(const ExecutionContextRef &rhs); - //------------------------------------------------------------------ /// Assignment operator from a ExecutionContext /// /// Make weak references to any strongly referenced objects in \a exe_ctx. - //------------------------------------------------------------------ ExecutionContextRef &operator=(const ExecutionContext &exe_ctx); - //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the process and thread to nullptr, and the frame index to an /// invalid value. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Set accessor that creates a weak reference to the target referenced in /// \a target_sp. /// @@ -172,10 +149,8 @@ public: /// ExecutionContextRef::SetContext() functions. /// /// \see ExecutionContextRef::SetContext(const lldb::TargetSP &, bool) - //------------------------------------------------------------------ void SetTargetSP(const lldb::TargetSP &target_sp); - //------------------------------------------------------------------ /// Set accessor that creates a weak reference to the process referenced in /// \a process_sp. /// @@ -189,10 +164,8 @@ public: /// ExecutionContextRef::SetContext() functions. /// /// \see ExecutionContextRef::SetContext(const lldb::ProcessSP &) - //------------------------------------------------------------------ void SetProcessSP(const lldb::ProcessSP &process_sp); - //------------------------------------------------------------------ /// Set accessor that creates a weak reference to the thread referenced in /// \a thread_sp. /// @@ -206,10 +179,8 @@ public: /// ExecutionContextRef::SetContext() functions. /// /// \see ExecutionContextRef::SetContext(const lldb::ThreadSP &) - //------------------------------------------------------------------ void SetThreadSP(const lldb::ThreadSP &thread_sp); - //------------------------------------------------------------------ /// Set accessor that creates a weak reference to the frame referenced in \a /// frame_sp. /// @@ -223,7 +194,6 @@ public: /// ExecutionContextRef::SetContext() functions. /// /// \see ExecutionContextRef::SetContext(const lldb::StackFrameSP &) - //------------------------------------------------------------------ void SetFrameSP(const lldb::StackFrameSP &frame_sp); void SetTargetPtr(Target *target, bool adopt_selected); @@ -234,43 +204,34 @@ public: void SetFramePtr(StackFrame *frame); - //------------------------------------------------------------------ /// Get accessor that creates a strong reference from the weak target /// reference contained in this object. /// /// \returns /// A shared pointer to a target that is not guaranteed to be valid. - //------------------------------------------------------------------ lldb::TargetSP GetTargetSP() const; - //------------------------------------------------------------------ /// Get accessor that creates a strong reference from the weak process /// reference contained in this object. /// /// \returns /// A shared pointer to a process that is not guaranteed to be valid. - //------------------------------------------------------------------ lldb::ProcessSP GetProcessSP() const; - //------------------------------------------------------------------ /// Get accessor that creates a strong reference from the weak thread /// reference contained in this object. /// /// \returns /// A shared pointer to a thread that is not guaranteed to be valid. - //------------------------------------------------------------------ lldb::ThreadSP GetThreadSP() const; - //------------------------------------------------------------------ /// Get accessor that creates a strong reference from the weak frame /// reference contained in this object. /// /// \returns /// A shared pointer to a frame that is not guaranteed to be valid. - //------------------------------------------------------------------ lldb::StackFrameSP GetFrameSP() const; - //------------------------------------------------------------------ /// Create an ExecutionContext object from this object. /// /// Create strong references to any execution context objects that are still @@ -278,21 +239,16 @@ public: /// objects is not guaranteed to be valid. \returns /// An execution context object that has strong references to /// any valid weak references in this object. - //------------------------------------------------------------------ ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const; - //------------------------------------------------------------------ /// Returns true if this object has a weak reference to a thread. The return /// value is only an indication of whether this object has a weak reference /// and does not indicate whether the weak reference is valid or not. - //------------------------------------------------------------------ bool HasThreadRef() const { return m_tid != LLDB_INVALID_THREAD_ID; } - //------------------------------------------------------------------ /// Returns true if this object has a weak reference to a frame. The return /// value is only an indication of whether this object has a weak reference /// and does not indicate whether the weak reference is valid or not. - //------------------------------------------------------------------ bool HasFrameRef() const { return m_stack_id.IsValid(); } void ClearThread() { @@ -303,9 +259,7 @@ public: void ClearFrame() { m_stack_id.Clear(); } protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ lldb::TargetWP m_target_wp; ///< A weak reference to a target lldb::ProcessWP m_process_wp; ///< A weak reference to a process mutable lldb::ThreadWP m_thread_wp; ///< A weak reference to a thread @@ -315,7 +269,6 @@ protected: ///backing object changes }; -//---------------------------------------------------------------------- /// \class ExecutionContext ExecutionContext.h /// "lldb/Target/ExecutionContext.h" /// A class that contains an execution context. @@ -335,35 +288,24 @@ protected: /// for passing down to other functions that also require specific contexts. /// They should NOT be used for long term storage, for long term storage use /// ExecutionContextRef objects. -//---------------------------------------------------------------------- class ExecutionContext { public: - //------------------------------------------------------------------ /// Default Constructor. - //------------------------------------------------------------------ ExecutionContext(); - //------------------------------------------------------------------ // Copy constructor - //------------------------------------------------------------------ ExecutionContext(const ExecutionContext &rhs); - //------------------------------------------------------------------ // Adopt the target and optionally its current context. - //------------------------------------------------------------------ ExecutionContext(Target *t, bool fill_current_process_thread_frame = true); - //------------------------------------------------------------------ // Create execution contexts from shared pointers - //------------------------------------------------------------------ ExecutionContext(const lldb::TargetSP &target_sp, bool get_process); ExecutionContext(const lldb::ProcessSP &process_sp); ExecutionContext(const lldb::ThreadSP &thread_sp); ExecutionContext(const lldb::StackFrameSP &frame_sp); - //------------------------------------------------------------------ // Create execution contexts from weak pointers - //------------------------------------------------------------------ ExecutionContext(const lldb::TargetWP &target_wp, bool get_process); ExecutionContext(const lldb::ProcessWP &process_wp); ExecutionContext(const lldb::ThreadWP &thread_wp); @@ -378,13 +320,10 @@ public: std::unique_lock<std::recursive_mutex> &locker); ExecutionContext(const ExecutionContextRef *exe_ctx_ref, std::unique_lock<std::recursive_mutex> &locker); - //------------------------------------------------------------------ // Create execution contexts from execution context scopes - //------------------------------------------------------------------ ExecutionContext(ExecutionContextScope *exe_scope); ExecutionContext(ExecutionContextScope &exe_scope); - //------------------------------------------------------------------ /// Construct with process, thread, and frame index. /// /// Initialize with process \a p, thread \a t, and frame index \a f. @@ -397,7 +336,6 @@ public: /// /// \param[in] frame /// The frame index for this execution context. - //------------------------------------------------------------------ ExecutionContext(Process *process, Thread *thread = nullptr, StackFrame *frame = nullptr); @@ -409,12 +347,10 @@ public: bool operator!=(const ExecutionContext &rhs) const; - //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the process and thread to nullptr, and the frame index to an /// invalid value. - //------------------------------------------------------------------ void Clear(); RegisterContext *GetRegisterContext() const; @@ -425,7 +361,6 @@ public: lldb::ByteOrder GetByteOrder() const; - //------------------------------------------------------------------ /// Returns a pointer to the target object. /// /// The returned pointer might be nullptr. Calling HasTargetScope(), @@ -437,10 +372,8 @@ public: /// ExecutionContext::HasProcessScope() const @see /// ExecutionContext::HasThreadScope() const @see /// ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ Target *GetTargetPtr() const; - //------------------------------------------------------------------ /// Returns a pointer to the process object. /// /// The returned pointer might be nullptr. Calling HasProcessScope(), @@ -451,10 +384,8 @@ public: /// \see ExecutionContext::HasProcessScope() const @see /// ExecutionContext::HasThreadScope() const @see /// ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ Process *GetProcessPtr() const; - //------------------------------------------------------------------ /// Returns a pointer to the thread object. /// /// The returned pointer might be nullptr. Calling HasThreadScope() or @@ -464,10 +395,8 @@ public: /// /// \see ExecutionContext::HasThreadScope() const @see /// ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ Thread *GetThreadPtr() const { return m_thread_sp.get(); } - //------------------------------------------------------------------ /// Returns a pointer to the frame object. /// /// The returned pointer might be nullptr. Calling HasFrameScope(), can help @@ -475,10 +404,8 @@ public: /// without having to check for nullptr each time. /// /// \see ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ StackFrame *GetFramePtr() const { return m_frame_sp.get(); } - //------------------------------------------------------------------ /// Returns a reference to the target object. /// /// Clients should call HasTargetScope(), HasProcessScope(), @@ -489,10 +416,8 @@ public: /// ExecutionContext::HasProcessScope() const @see /// ExecutionContext::HasThreadScope() const @see /// ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ Target &GetTargetRef() const; - //------------------------------------------------------------------ /// Returns a reference to the process object. /// /// Clients should call HasProcessScope(), HasThreadScope(), or @@ -502,10 +427,8 @@ public: /// \see ExecutionContext::HasProcessScope() const @see /// ExecutionContext::HasThreadScope() const @see /// ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ Process &GetProcessRef() const; - //------------------------------------------------------------------ /// Returns a reference to the thread object. /// /// Clients should call HasThreadScope(), or HasFrameScope() prior to @@ -514,135 +437,97 @@ public: /// /// \see ExecutionContext::HasThreadScope() const @see /// ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ Thread &GetThreadRef() const; - //------------------------------------------------------------------ /// Returns a reference to the thread object. /// /// Clients should call HasFrameScope() prior to calling this function to /// ensure that this ExecutionContext object contains a valid target. /// /// \see ExecutionContext::HasFrameScope() const - //------------------------------------------------------------------ StackFrame &GetFrameRef() const; - //------------------------------------------------------------------ /// Get accessor to get the target shared pointer. /// /// The returned shared pointer is not guaranteed to be valid. - //------------------------------------------------------------------ const lldb::TargetSP &GetTargetSP() const { return m_target_sp; } - //------------------------------------------------------------------ /// Get accessor to get the process shared pointer. /// /// The returned shared pointer is not guaranteed to be valid. - //------------------------------------------------------------------ const lldb::ProcessSP &GetProcessSP() const { return m_process_sp; } - //------------------------------------------------------------------ /// Get accessor to get the thread shared pointer. /// /// The returned shared pointer is not guaranteed to be valid. - //------------------------------------------------------------------ const lldb::ThreadSP &GetThreadSP() const { return m_thread_sp; } - //------------------------------------------------------------------ /// Get accessor to get the frame shared pointer. /// /// The returned shared pointer is not guaranteed to be valid. - //------------------------------------------------------------------ const lldb::StackFrameSP &GetFrameSP() const { return m_frame_sp; } - //------------------------------------------------------------------ /// Set accessor to set only the target shared pointer. - //------------------------------------------------------------------ void SetTargetSP(const lldb::TargetSP &target_sp); - //------------------------------------------------------------------ /// Set accessor to set only the process shared pointer. - //------------------------------------------------------------------ void SetProcessSP(const lldb::ProcessSP &process_sp); - //------------------------------------------------------------------ /// Set accessor to set only the thread shared pointer. - //------------------------------------------------------------------ void SetThreadSP(const lldb::ThreadSP &thread_sp); - //------------------------------------------------------------------ /// Set accessor to set only the frame shared pointer. - //------------------------------------------------------------------ void SetFrameSP(const lldb::StackFrameSP &frame_sp); - //------------------------------------------------------------------ /// Set accessor to set only the target shared pointer from a target /// pointer. - //------------------------------------------------------------------ void SetTargetPtr(Target *target); - //------------------------------------------------------------------ /// Set accessor to set only the process shared pointer from a process /// pointer. - //------------------------------------------------------------------ void SetProcessPtr(Process *process); - //------------------------------------------------------------------ /// Set accessor to set only the thread shared pointer from a thread /// pointer. - //------------------------------------------------------------------ void SetThreadPtr(Thread *thread); - //------------------------------------------------------------------ /// Set accessor to set only the frame shared pointer from a frame pointer. - //------------------------------------------------------------------ void SetFramePtr(StackFrame *frame); - //------------------------------------------------------------------ // Set the execution context using a target shared pointer. // // If "target_sp" is valid, sets the target context to match and if // "get_process" is true, sets the process shared pointer if the target // currently has a process. - //------------------------------------------------------------------ void SetContext(const lldb::TargetSP &target_sp, bool get_process); - //------------------------------------------------------------------ // Set the execution context using a process shared pointer. // // If "process_sp" is valid, then set the process and target in this context. // Thread and frame contexts will be cleared. If "process_sp" is not valid, // all shared pointers are reset. - //------------------------------------------------------------------ void SetContext(const lldb::ProcessSP &process_sp); - //------------------------------------------------------------------ // Set the execution context using a thread shared pointer. // // If "thread_sp" is valid, then set the thread, process and target in this // context. The frame context will be cleared. If "thread_sp" is not valid, // all shared pointers are reset. - //------------------------------------------------------------------ void SetContext(const lldb::ThreadSP &thread_sp); - //------------------------------------------------------------------ // Set the execution context using a frame shared pointer. // // If "frame_sp" is valid, then set the frame, thread, process and target in // this context If "frame_sp" is not valid, all shared pointers are reset. - //------------------------------------------------------------------ void SetContext(const lldb::StackFrameSP &frame_sp); - //------------------------------------------------------------------ /// Returns true the ExecutionContext object contains a valid target. /// /// This function can be called after initializing an ExecutionContext /// object, and if it returns true, calls to GetTargetPtr() and /// GetTargetRef() do not need to be checked for validity. - //------------------------------------------------------------------ bool HasTargetScope() const; - //------------------------------------------------------------------ /// Returns true the ExecutionContext object contains a valid target and /// process. /// @@ -650,10 +535,8 @@ public: /// object, and if it returns true, calls to GetTargetPtr() and /// GetTargetRef(), GetProcessPtr(), and GetProcessRef(), do not need to be /// checked for validity. - //------------------------------------------------------------------ bool HasProcessScope() const; - //------------------------------------------------------------------ /// Returns true the ExecutionContext object contains a valid target, /// process, and thread. /// @@ -661,10 +544,8 @@ public: /// object, and if it returns true, calls to GetTargetPtr(), GetTargetRef(), /// GetProcessPtr(), GetProcessRef(), GetThreadPtr(), and GetThreadRef() do /// not need to be checked for validity. - //------------------------------------------------------------------ bool HasThreadScope() const; - //------------------------------------------------------------------ /// Returns true the ExecutionContext object contains a valid target, /// process, thread and frame. /// @@ -672,13 +553,10 @@ public: /// object, and if it returns true, calls to GetTargetPtr(), GetTargetRef(), /// GetProcessPtr(), GetProcessRef(), GetThreadPtr(), GetThreadRef(), /// GetFramePtr(), and GetFrameRef() do not need to be checked for validity. - //------------------------------------------------------------------ bool HasFrameScope() const; protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ lldb::TargetSP m_target_sp; ///< The target that owns the process/thread/frame lldb::ProcessSP m_process_sp; ///< The process that owns the thread/frame lldb::ThreadSP m_thread_sp; ///< The thread that owns the frame diff --git a/lldb/include/lldb/Target/ExecutionContextScope.h b/lldb/include/lldb/Target/ExecutionContextScope.h index ea70803..0121ce6 100644 --- a/lldb/include/lldb/Target/ExecutionContextScope.h +++ b/lldb/include/lldb/Target/ExecutionContextScope.h @@ -13,7 +13,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// @class ExecutionContextScope ExecutionContextScope.h /// "lldb/Target/ExecutionContextScope.h" Inherit from this if your object can /// reconstruct its @@ -30,7 +29,6 @@ namespace lldb_private { /// /// Objects that adhere to this protocol can reconstruct enough of a execution /// context to allow functions that take a execution contexts to be called. -//---------------------------------------------------------------------- class ExecutionContextScope { public: virtual ~ExecutionContextScope() {} @@ -43,7 +41,6 @@ public: virtual lldb::StackFrameSP CalculateStackFrame() = 0; - //------------------------------------------------------------------ /// Reconstruct the object's execution context into \a sc. /// /// The object should fill in as much of the ExecutionContextScope as it can @@ -53,7 +50,6 @@ public: /// \param[out] exe_ctx /// A reference to an execution context object that gets filled /// in. - //------------------------------------------------------------------ virtual void CalculateExecutionContext(ExecutionContext &exe_ctx) = 0; }; diff --git a/lldb/include/lldb/Target/JITLoader.h b/lldb/include/lldb/Target/JITLoader.h index 5693e68..1bafd82 100644 --- a/lldb/include/lldb/Target/JITLoader.h +++ b/lldb/include/lldb/Target/JITLoader.h @@ -16,7 +16,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class JITLoader JITLoader.h "lldb/Target/JITLoader.h" /// A plug-in interface definition class for JIT loaders. /// @@ -25,10 +24,8 @@ namespace lldb_private { /// not have information about the target's dyld and that there may be /// multiple JITLoader plugins per process, while there is at most one /// DynamicLoader. -//---------------------------------------------------------------------- class JITLoader : public PluginInterface { public: - //------------------------------------------------------------------ /// Find a JIT loader plugin for a given process. /// /// Scans the installed DynamicLoader plug-ins and tries to find all @@ -38,42 +35,31 @@ public: /// The process for which to try and locate a JIT loader /// plug-in instance. /// - //------------------------------------------------------------------ static void LoadPlugins(Process *process, lldb_private::JITLoaderList &list); - //------------------------------------------------------------------ /// Construct with a process. - //------------------------------------------------------------------ JITLoader(Process *process); ~JITLoader() override; - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow JITLoader plug-ins to execute some code after attaching to a /// process. - //------------------------------------------------------------------ virtual void DidAttach() = 0; - //------------------------------------------------------------------ /// Called after launching a process. /// /// Allow JITLoader plug-ins to execute some code after the process has /// stopped for the first time on launch. - //------------------------------------------------------------------ virtual void DidLaunch() = 0; - //------------------------------------------------------------------ /// Called after a new shared object has been loaded so that it can be /// probed for JIT entry point hooks. - //------------------------------------------------------------------ virtual void ModulesDidLoad(lldb_private::ModuleList &module_list) = 0; protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ Process *m_process; }; diff --git a/lldb/include/lldb/Target/JITLoaderList.h b/lldb/include/lldb/Target/JITLoaderList.h index 8043e5b..4cc3a9e 100644 --- a/lldb/include/lldb/Target/JITLoaderList.h +++ b/lldb/include/lldb/Target/JITLoaderList.h @@ -16,11 +16,9 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class JITLoaderList JITLoaderList.h "lldb/Target/JITLoaderList.h" /// /// Class used by the Process to hold a list of its JITLoaders. -//---------------------------------------------------------------------- class JITLoaderList { public: JITLoaderList(); diff --git a/lldb/include/lldb/Target/Language.h b/lldb/include/lldb/Target/Language.h index 1293091..d58aeff 100644 --- a/lldb/include/lldb/Target/Language.h +++ b/lldb/include/lldb/Target/Language.h @@ -261,9 +261,7 @@ public: GetLanguagesSupportingREPLs(std::set<lldb::LanguageType> &languages); protected: - //------------------------------------------------------------------ // Classes that inherit from Language can see and modify these - //------------------------------------------------------------------ Language(); diff --git a/lldb/include/lldb/Target/LanguageRuntime.h b/lldb/include/lldb/Target/LanguageRuntime.h index da6f9fe..efd2bcb 100644 --- a/lldb/include/lldb/Target/LanguageRuntime.h +++ b/lldb/include/lldb/Target/LanguageRuntime.h @@ -162,9 +162,7 @@ public: } protected: - //------------------------------------------------------------------ // Classes that inherit from LanguageRuntime can see and modify these - //------------------------------------------------------------------ LanguageRuntime(Process *process); Process *m_process; diff --git a/lldb/include/lldb/Target/Memory.h b/lldb/include/lldb/Target/Memory.h index 4e3f737..e62b8ef 100644 --- a/lldb/include/lldb/Target/Memory.h +++ b/lldb/include/lldb/Target/Memory.h @@ -16,15 +16,11 @@ #include <vector> namespace lldb_private { -//---------------------------------------------------------------------- // A class to track memory that was read from a live process between // runs. -//---------------------------------------------------------------------- class MemoryCache { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ MemoryCache(Process &process); ~MemoryCache(); @@ -51,9 +47,7 @@ protected: typedef std::map<lldb::addr_t, lldb::DataBufferSP> BlockMap; typedef RangeArray<lldb::addr_t, lldb::addr_t, 4> InvalidRanges; typedef Range<lldb::addr_t, lldb::addr_t> AddrRange; - //------------------------------------------------------------------ // Classes that inherit from MemoryCache can see and modify these - //------------------------------------------------------------------ std::recursive_mutex m_mutex; BlockMap m_L1_cache; // A first level memory cache whose chunk sizes vary that // will be used only if the memory read fits entirely in @@ -111,16 +105,12 @@ protected: RangeVector<lldb::addr_t, uint32_t> m_reserved_blocks; }; -//---------------------------------------------------------------------- // A class that can track allocated memory and give out allocated memory // without us having to make an allocate/deallocate call every time we need // some memory in a process that is being debugged. -//---------------------------------------------------------------------- class AllocatedMemoryCache { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ AllocatedMemoryCache(Process &process); ~AllocatedMemoryCache(); @@ -138,9 +128,7 @@ protected: AllocatedBlockSP AllocatePage(uint32_t byte_size, uint32_t permissions, uint32_t chunk_size, Status &error); - //------------------------------------------------------------------ // Classes that inherit from MemoryCache can see and modify these - //------------------------------------------------------------------ Process &m_process; std::recursive_mutex m_mutex; typedef std::multimap<uint32_t, AllocatedBlockSP> PermissionsToBlockMap; diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h index bd6dfbf..5cab2ef 100644 --- a/lldb/include/lldb/Target/MemoryRegionInfo.h +++ b/lldb/include/lldb/Target/MemoryRegionInfo.h @@ -64,10 +64,8 @@ public: void SetBlocksize(lldb::offset_t blocksize) { m_blocksize = blocksize; } - //---------------------------------------------------------------------- // Get permissions as a uint32_t that is a mask of one or more bits from the // lldb::Permissions - //---------------------------------------------------------------------- uint32_t GetLLDBPermissions() const { uint32_t permissions = 0; if (m_read) @@ -79,10 +77,8 @@ public: return permissions; } - //---------------------------------------------------------------------- // Set permissions from a uint32_t that contains one or more bits from the // lldb::Permissions - //---------------------------------------------------------------------- void SetLLDBPermissions(uint32_t permissions) { m_read = (permissions & lldb::ePermissionsReadable) ? eYes : eNo; m_write = (permissions & lldb::ePermissionsWritable) ? eYes : eNo; diff --git a/lldb/include/lldb/Target/ModuleCache.h b/lldb/include/lldb/Target/ModuleCache.h index 245809a..1196169 100644 --- a/lldb/include/lldb/Target/ModuleCache.h +++ b/lldb/include/lldb/Target/ModuleCache.h @@ -25,7 +25,6 @@ namespace lldb_private { class Module; class UUID; -//---------------------------------------------------------------------- /// \class ModuleCache ModuleCache.h "lldb/Target/ModuleCache.h" /// A module cache class. /// @@ -44,7 +43,6 @@ class UUID; /// /tmp/lldb/remote- /// linux/.cache/30C94DC6-6A1F-E951-80C3-D68D2B89E576-D5AE213C/libc.so.6 /// Sysroot view: /tmp/lldb/remote-linux/ubuntu/lib/x86_64-linux-gnu/libc.so.6 -//---------------------------------------------------------------------- class ModuleCache { public: diff --git a/lldb/include/lldb/Target/ObjCLanguageRuntime.h b/lldb/include/lldb/Target/ObjCLanguageRuntime.h index 1cfbbd0..9dfec86 100644 --- a/lldb/include/lldb/Target/ObjCLanguageRuntime.h +++ b/lldb/include/lldb/Target/ObjCLanguageRuntime.h @@ -293,9 +293,7 @@ public: uint64_t &size) override; protected: - //------------------------------------------------------------------ // Classes that inherit from ObjCLanguageRuntime can see and modify these - //------------------------------------------------------------------ ObjCLanguageRuntime(Process *process); virtual bool CalculateHasNewLiteralsAndIndexing() { return false; } diff --git a/lldb/include/lldb/Target/OperatingSystem.h b/lldb/include/lldb/Target/OperatingSystem.h index 2197462..c75d1ca 100644 --- a/lldb/include/lldb/Target/OperatingSystem.h +++ b/lldb/include/lldb/Target/OperatingSystem.h @@ -16,7 +16,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class OperatingSystem OperatingSystem.h "lldb/Target/OperatingSystem.h" /// A plug-in interface definition class for halted OS helpers. /// @@ -25,11 +24,9 @@ namespace lldb_private { /// This is commonly used when attaching to an operating system that is /// halted, such as when debugging over JTAG or connecting to low level kernel /// debug services. -//---------------------------------------------------------------------- class OperatingSystem : public PluginInterface { public: - //------------------------------------------------------------------ /// Find a halted OS plugin for a given process. /// /// Scans the installed OperatingSystem plug-ins and tries to find an @@ -42,19 +39,14 @@ public: /// \param[in] plugin_name /// An optional name of a specific halted OS plug-in that /// should be used. If NULL, pick the best plug-in. - //------------------------------------------------------------------ static OperatingSystem *FindPlugin(Process *process, const char *plugin_name); - //------------------------------------------------------------------ // Class Methods - //------------------------------------------------------------------ OperatingSystem(Process *process); ~OperatingSystem() override; - //------------------------------------------------------------------ // Plug-in Methods - //------------------------------------------------------------------ virtual bool UpdateThreadList(ThreadList &old_thread_list, ThreadList &real_thread_list, ThreadList &new_thread_list) = 0; @@ -74,9 +66,7 @@ public: virtual bool IsOperatingSystemPluginThread(const lldb::ThreadSP &thread_sp); protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ Process *m_process; ///< The process that this dynamic loader plug-in is tracking. private: diff --git a/lldb/include/lldb/Target/PathMappingList.h b/lldb/include/lldb/Target/PathMappingList.h index d7d45db..d175966 100644 --- a/lldb/include/lldb/Target/PathMappingList.h +++ b/lldb/include/lldb/Target/PathMappingList.h @@ -21,9 +21,7 @@ public: typedef void (*ChangedCallback)(const PathMappingList &path_list, void *baton); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ PathMappingList(); PathMappingList(ChangedCallback callback, void *callback_baton); @@ -65,7 +63,6 @@ public: uint32_t index, bool notify); bool RemapPath(ConstString path, ConstString &new_path) const; - //------------------------------------------------------------------ /// Remaps a source file given \a path into \a new_path. /// /// Remaps \a path if any source remappings match. This function @@ -81,13 +78,11 @@ public: /// \return /// /b true if \a path was successfully located and \a new_path /// is filled in with a new source path, \b false otherwise. - //------------------------------------------------------------------ bool RemapPath(llvm::StringRef path, std::string &new_path) const; bool RemapPath(const char *, std::string &) const = delete; bool ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const; - //------------------------------------------------------------------ /// Finds a source file given a file spec using the path remappings. /// /// Tries to resolve \a orig_spec by checking the path remappings. @@ -106,7 +101,6 @@ public: /// /b true if \a orig_spec was successfully located and /// \a new_spec is filled in with an existing file spec, /// \b false otherwise. - //------------------------------------------------------------------ bool FindFile(const FileSpec &orig_spec, FileSpec &new_spec) const; uint32_t FindIndexForPath(ConstString path) const; diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h index 82442a4..3ba58c0 100644 --- a/lldb/include/lldb/Target/Platform.h +++ b/lldb/include/lldb/Target/Platform.h @@ -53,7 +53,6 @@ public: typedef std::shared_ptr<PlatformProperties> PlatformPropertiesSP; typedef llvm::SmallVector<lldb::addr_t, 6> MmapArgList; -//---------------------------------------------------------------------- /// \class Platform Platform.h "lldb/Target/Platform.h" /// A plug-in interface definition class for debug platform that /// includes many platform abilities such as: @@ -65,20 +64,15 @@ typedef llvm::SmallVector<lldb::addr_t, 6> MmapArgList; /// \li execute shell commands /// \li listing and getting info for existing processes /// \li attaching and possibly debugging the platform's kernel -//---------------------------------------------------------------------- class Platform : public PluginInterface { public: - //------------------------------------------------------------------ /// Default Constructor - //------------------------------------------------------------------ Platform(bool is_host_platform); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be inherited /// from by the plug-in instance. - //------------------------------------------------------------------ ~Platform() override; static void Initialize(); @@ -87,7 +81,6 @@ public: static const PlatformPropertiesSP &GetGlobalPlatformProperties(); - //------------------------------------------------------------------ /// Get the native host platform plug-in. /// /// There should only be one of these for each host that LLDB runs upon that @@ -97,7 +90,6 @@ public: /// /// This platform will be used as the default platform when launching or /// attaching to processes unless another platform is specified. - //------------------------------------------------------------------ static lldb::PlatformSP GetHostPlatform(); static lldb::PlatformSP @@ -115,14 +107,11 @@ public: static lldb::PlatformSP Create(const ArchSpec &arch, ArchSpec *platform_arch_ptr, Status &error); - //------------------------------------------------------------------------ /// Augments the triple either with information from platform or the host /// system (if platform is null). - //------------------------------------------------------------------------ static ArchSpec GetAugmentedArchSpec(Platform *platform, llvm::StringRef triple); - //------------------------------------------------------------------ /// Find a platform plugin for a given process. /// /// Scans the installed Platform plug-ins and tries to find an instance that @@ -135,11 +124,9 @@ public: /// \param[in] plugin_name /// An optional name of a specific platform plug-in that /// should be used. If nullptr, pick the best plug-in. - //------------------------------------------------------------------ // static lldb::PlatformSP // FindPlugin (Process *process, ConstString plugin_name); - //------------------------------------------------------------------ /// Set the target's executable based off of the existing architecture /// information in \a target given a path to an executable \a exe_file. /// @@ -155,12 +142,10 @@ public: /// \return /// Returns \b true if this Platform plug-in was able to find /// a suitable executable, \b false otherwise. - //------------------------------------------------------------------ virtual Status ResolveExecutable(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr); - //------------------------------------------------------------------ /// Find a symbol file given a symbol file module specification. /// /// Each platform might have tricks to find symbol files for an executable @@ -206,18 +191,14 @@ public: /// /// \return /// Returns an error that describes success or failure. - //------------------------------------------------------------------ virtual Status ResolveSymbolFile(Target &target, const ModuleSpec &sym_spec, FileSpec &sym_file); - //------------------------------------------------------------------ /// Resolves the FileSpec to a (possibly) remote path. Remote platforms must /// override this to resolve to a path on the remote side. - //------------------------------------------------------------------ virtual bool ResolveRemotePath(const FileSpec &platform_path, FileSpec &resolved_platform_path); - //------------------------------------------------------------------ /// Get the OS version from a connected platform. /// /// Some platforms might not be connected to a remote platform, but can @@ -225,7 +206,6 @@ public: /// platforms that will run native programs on the current host, but the /// simulator might be simulating a different OS. The \a process parameter /// might be specified to help to determine the OS version. - //------------------------------------------------------------------ virtual llvm::VersionTuple GetOSVersion(Process *process = nullptr); bool SetOSVersion(llvm::VersionTuple os_version); @@ -243,23 +223,19 @@ public: virtual const char *GetDescription() = 0; - //------------------------------------------------------------------ /// Report the current status for this platform. /// /// The returned string usually involves returning the OS version (if /// available), and any SDK directory that might be being used for local /// file caching, and if connected a quick blurb about what this platform is /// connected to. - //------------------------------------------------------------------ virtual void GetStatus(Stream &strm); - //------------------------------------------------------------------ // Subclasses must be able to fetch the current OS version // // Remote classes must be connected for this to succeed. Local subclasses // don't need to override this function as it will just call the // HostInfo::GetOSVersion(). - //------------------------------------------------------------------ virtual bool GetRemoteOSVersion() { return false; } virtual bool GetRemoteOSBuildString(std::string &s) { @@ -281,7 +257,6 @@ public: virtual bool SetRemoteWorkingDirectory(const FileSpec &working_dir); - //------------------------------------------------------------------ /// Retrieve the system include directories on this platform for the /// given language. /// @@ -290,7 +265,6 @@ public: /// /// \param[out] directories /// The include directories for this system. - //------------------------------------------------------------------ virtual std::vector<std::string> GetSystemIncludeDirectories(lldb::LanguageType lang) { return {}; @@ -298,7 +272,6 @@ public: virtual UserIDResolver &GetUserIDResolver() = 0; - //------------------------------------------------------------------ /// Locate a file for a platform. /// /// The default implementation of this function will return the same file @@ -325,16 +298,13 @@ public: /// /// \return /// An error object. - //------------------------------------------------------------------ virtual Status GetFileWithUUID(const FileSpec &platform_file, const UUID *uuid_ptr, FileSpec &local_file); - //---------------------------------------------------------------------- // Locate the scripting resource given a module specification. // // Locating the file should happen only on the local computer or using the // current computers global settings. - //---------------------------------------------------------------------- virtual FileSpecList LocateExecutableScriptingResources(Target *target, Module &module, Stream *feedback_stream); @@ -352,7 +322,6 @@ public: virtual Status DisconnectRemote(); - //------------------------------------------------------------------ /// Get the platform's supported architectures in the order in which they /// should be searched. /// @@ -366,56 +335,43 @@ public: /// \return /// \b true if \a arch was filled in and is valid, \b false /// otherwise. - //------------------------------------------------------------------ virtual bool GetSupportedArchitectureAtIndex(uint32_t idx, ArchSpec &arch) = 0; virtual size_t GetSoftwareBreakpointTrapOpcode(Target &target, BreakpointSite *bp_site); - //------------------------------------------------------------------ /// Launch a new process on a platform, not necessarily for debugging, it /// could be just for running the process. - //------------------------------------------------------------------ virtual Status LaunchProcess(ProcessLaunchInfo &launch_info); - //------------------------------------------------------------------ /// Perform expansion of the command-line for this launch info This can /// potentially involve wildcard expansion /// environment variable replacement, and whatever other /// argument magic the platform defines as part of its typical /// user experience - //------------------------------------------------------------------ virtual Status ShellExpandArguments(ProcessLaunchInfo &launch_info); - //------------------------------------------------------------------ /// Kill process on a platform. - //------------------------------------------------------------------ virtual Status KillProcess(const lldb::pid_t pid); - //------------------------------------------------------------------ /// Lets a platform answer if it is compatible with a given architecture and /// the target triple contained within. - //------------------------------------------------------------------ virtual bool IsCompatibleArchitecture(const ArchSpec &arch, bool exact_arch_match, ArchSpec *compatible_arch_ptr); - //------------------------------------------------------------------ /// Not all platforms will support debugging a process by spawning somehow /// halted for a debugger (specified using the "eLaunchFlagDebug" launch /// flag) and then attaching. If your platform doesn't support this, /// override this function and return false. - //------------------------------------------------------------------ virtual bool CanDebugProcess() { return true; } - //------------------------------------------------------------------ /// Subclasses do not need to implement this function as it uses the /// Platform::LaunchProcess() followed by Platform::Attach (). Remote /// platforms will want to subclass this function in order to be able to /// intercept STDIO and possibly launch a separate process that will debug /// the debuggee. - //------------------------------------------------------------------ virtual lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, // Can be nullptr, if nullptr create a new @@ -428,7 +384,6 @@ public: lldb_private::Target *target, lldb_private::Status &error); - //------------------------------------------------------------------ /// Attach to an existing process using a process ID. /// /// Each platform subclass needs to implement this function and attempt to @@ -445,7 +400,6 @@ public: /// to the default Process subclass for the platform that is /// attached to the process, or an empty shared pointer with an /// appropriate error fill into the \a error object. - //------------------------------------------------------------------ virtual lldb::ProcessSP Attach(ProcessAttachInfo &attach_info, Debugger &debugger, Target *target, // Can be nullptr, if nullptr @@ -453,7 +407,6 @@ public: // use existing one Status &error) = 0; - //------------------------------------------------------------------ /// Attach to an existing process by process name. /// /// This function is not meant to be overridden by Process subclasses. It @@ -468,32 +421,25 @@ public: /// \return /// Returns \a pid if attaching was successful, or /// LLDB_INVALID_PROCESS_ID if attaching fails. - //------------------------------------------------------------------ // virtual lldb::ProcessSP // Attach (const char *process_name, // bool wait_for_launch, // Status &error) = 0; - //------------------------------------------------------------------ // The base class Platform will take care of the host platform. Subclasses // will need to fill in the remote case. - //------------------------------------------------------------------ virtual uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &proc_infos); virtual bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info); - //------------------------------------------------------------------ // Set a breakpoint on all functions that can end up creating a thread for // this platform. This is needed when running expressions and also for // process control. - //------------------------------------------------------------------ virtual lldb::BreakpointSP SetThreadCreationBreakpoint(Target &target); - //------------------------------------------------------------------ // Given a target, find the local SDK directory if one exists on the current // host. - //------------------------------------------------------------------ virtual lldb_private::ConstString GetSDKDirectory(lldb_private::Target &target) { return lldb_private::ConstString(); @@ -520,11 +466,9 @@ public: m_os_version_set_while_connected = m_system_arch.IsValid(); } - //--------------------------------------------------------------------------- /// If the triple contains not specify the vendor, os, and environment /// parts, we "augment" these using information from the platform and return /// the resulting ArchSpec object. - //--------------------------------------------------------------------------- ArchSpec GetAugmentedArchSpec(llvm::StringRef triple); // Used for column widths @@ -610,7 +554,6 @@ public: CreateSymlink(const FileSpec &src, // The name of the link is in src const FileSpec &dst); // The symlink points to dst - //---------------------------------------------------------------------- /// Install a file or directory to the remote system. /// /// Install is similar to Platform::PutFile(), but it differs in that if an @@ -633,7 +576,6 @@ public: /// /// \return /// An error object that describes anything that went wrong. - //---------------------------------------------------------------------- virtual Status Install(const FileSpec &src, const FileSpec &dst); virtual Environment GetEnvironment(); @@ -709,7 +651,6 @@ public: lldb::UnixSignalsSP GetUnixSignals(); - //------------------------------------------------------------------ /// Locate a queue name given a thread's qaddr /// /// On a system using libdispatch ("Grand Central Dispatch") style queues, a @@ -729,13 +670,11 @@ public: /// The name of the queue, if there is one. An empty string /// means that this thread is not associated with a dispatch /// queue. - //------------------------------------------------------------------ virtual std::string GetQueueNameForThreadQAddress(Process *process, lldb::addr_t dispatch_qaddr) { return ""; } - //------------------------------------------------------------------ /// Locate a queue ID given a thread's qaddr /// /// On a system using libdispatch ("Grand Central Dispatch") style queues, a @@ -754,13 +693,11 @@ public: /// \return /// The queue_id for this thread, if this thread is associated /// with a dispatch queue. Else LLDB_INVALID_QUEUE_ID is returned. - //------------------------------------------------------------------ virtual lldb::queue_id_t GetQueueIDForThreadQAddress(Process *process, lldb::addr_t dispatch_qaddr) { return LLDB_INVALID_QUEUE_ID; } - //------------------------------------------------------------------ /// Provide a list of trap handler function names for this platform /// /// The unwinder needs to treat trap handlers specially -- the stack frame @@ -780,10 +717,8 @@ public: /// /// \return /// A list of symbol names. The list may be empty. - //------------------------------------------------------------------ virtual const std::vector<ConstString> &GetTrapHandlerSymbolNames(); - //------------------------------------------------------------------ /// Find a support executable that may not live within in the standard /// locations related to LLDB. /// @@ -797,17 +732,13 @@ public: /// \return /// A FileSpec pointing to the executable on disk, or an invalid /// FileSpec if the executable cannot be found. - //------------------------------------------------------------------ virtual FileSpec LocateExecutable(const char *basename) { return FileSpec(); } - //------------------------------------------------------------------ /// Allow the platform to set preferred memory cache line size. If non-zero /// (and the user has not set cache line size explicitly), this value will /// be used as the cache line size for memory reads. - //------------------------------------------------------------------ virtual uint32_t GetDefaultMemoryCacheLineSize() { return 0; } - //------------------------------------------------------------------ /// Load a shared library into this process. /// /// Try and load a shared library into the current process. This call might @@ -839,13 +770,11 @@ public: /// later used to unload the shared library. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImage(lldb_private::Process *process, const lldb_private::FileSpec &local_file, const lldb_private::FileSpec &remote_file, lldb_private::Status &error); - //------------------------------------------------------------------ /// Load a shared library specified by base name into this process, /// looking by hand along a set of paths. /// @@ -876,7 +805,6 @@ public: /// passed to UnloadImage. A value of /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared /// library can't be opened. - //------------------------------------------------------------------ uint32_t LoadImageUsingPaths(lldb_private::Process *process, const lldb_private::FileSpec &library_name, const std::vector<std::string> &paths, @@ -892,7 +820,6 @@ public: virtual Status UnloadImage(lldb_private::Process *process, uint32_t image_token); - //------------------------------------------------------------------ /// Connect to all processes waiting for a debugger to attach /// /// If the platform have a list of processes waiting for a debugger to @@ -907,7 +834,6 @@ public: /// /// \return /// The number of processes we are successfully connected to. - //------------------------------------------------------------------ virtual size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger, lldb_private::Status &error); @@ -947,7 +873,6 @@ protected: bool m_calculated_trap_handlers; const std::unique_ptr<ModuleCache> m_module_cache; - //------------------------------------------------------------------ /// Ask the Platform subclass to fill in the list of trap handler names /// /// For most Unix user process environments, this will be a single function @@ -959,7 +884,6 @@ protected: /// The base class Platform ivar m_trap_handlers should be updated by the /// Platform subclass when this method is called. If there are no /// predefined trap handlers, this method may be a no-op. - //------------------------------------------------------------------ virtual void CalculateTrapHandlerSymbolNames() = 0; Status GetCachedExecutable(ModuleSpec &module_spec, lldb::ModuleSP &module_sp, @@ -1025,14 +949,12 @@ public: return platform_sp; } - //------------------------------------------------------------------ /// Select the active platform. /// /// In order to debug remotely, other platform's can be remotely connected /// to and set as the selected platform for any subsequent debugging. This /// allows connection to remote targets and allows the ability to discover /// process info, launch and attach to remote processes. - //------------------------------------------------------------------ lldb::PlatformSP GetSelectedPlatform() { std::lock_guard<std::recursive_mutex> guard(m_mutex); if (!m_selected_platform_sp && !m_platforms.empty()) diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 2675c6d..19643b9 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -56,9 +56,7 @@ namespace lldb_private { template <typename B, typename S> struct Range; -//---------------------------------------------------------------------- // ProcessProperties -//---------------------------------------------------------------------- class ProcessProperties : public Properties { public: // Pass nullptr for "process" if the ProcessProperties are to be the global @@ -94,11 +92,9 @@ protected: typedef std::shared_ptr<ProcessProperties> ProcessPropertiesSP; -//---------------------------------------------------------------------- // ProcessAttachInfo // // Describes any information that is required to attach to a process. -//---------------------------------------------------------------------- class ProcessAttachInfo : public ProcessInstanceInfo { public: @@ -352,10 +348,8 @@ inline bool operator!=(const ProcessModID &lhs, const ProcessModID &rhs) { return (!lhs.StopIDEqual(rhs) || !lhs.MemoryIDEqual(rhs)); } -//---------------------------------------------------------------------- /// \class Process Process.h "lldb/Target/Process.h" /// A plug-in interface definition class for debugging a process. -//---------------------------------------------------------------------- class Process : public std::enable_shared_from_this<Process>, public ProcessProperties, public UserID, @@ -371,9 +365,7 @@ class Process : public std::enable_shared_from_this<Process>, friend class ThreadList; public: - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitStateChanged = (1 << 0), eBroadcastBitInterrupt = (1 << 1), @@ -389,9 +381,7 @@ public: eBroadcastInternalStateControlResume = (1 << 2) }; - //------------------------------------------------------------------ /// Process warning types. - //------------------------------------------------------------------ enum Warnings { eWarningsOptimization = 1 }; typedef Range<lldb::addr_t, lldb::addr_t> LoadRange; @@ -411,13 +401,11 @@ public: return GetStaticBroadcasterClass(); } -//------------------------------------------------------------------ /// A notification structure that can be used by clients to listen /// for changes in a process's lifetime. /// /// \see RegisterNotificationCallbacks (const Notifications&) @see /// UnregisterNotificationCallbacks (const Notifications&) -//------------------------------------------------------------------ typedef struct { void *baton; void (*initialize)(void *baton, Process *process); @@ -503,25 +491,19 @@ public: DISALLOW_COPY_AND_ASSIGN(ProcessEventData); }; - //------------------------------------------------------------------ /// Construct with a shared pointer to a target, and the Process listener. /// Uses the Host UnixSignalsSP by default. - //------------------------------------------------------------------ Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp); - //------------------------------------------------------------------ /// Construct with a shared pointer to a target, the Process listener, and /// the appropriate UnixSignalsSP for the process. - //------------------------------------------------------------------ Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb::UnixSignalsSP &unix_signals_sp); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be inherited /// from by the plug-in instance. - //------------------------------------------------------------------ ~Process() override; static void SettingsInitialize(); @@ -530,7 +512,6 @@ public: static const ProcessPropertiesSP &GetGlobalProperties(); - //------------------------------------------------------------------ /// Find a Process plug-in that can debug \a module using the currently /// selected architecture. /// @@ -547,13 +528,11 @@ public: /// this string. /// /// \see Process::CanDebug () - //------------------------------------------------------------------ static lldb::ProcessSP FindPlugin(lldb::TargetSP target_sp, llvm::StringRef plugin_name, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path); - //------------------------------------------------------------------ /// Static function that can be used with the \b host function /// Host::StartMonitoringChildProcess (). /// @@ -564,7 +543,6 @@ public: /// callback = Process::SetHostProcessExitStatus /// pid = Process::GetID() /// monitor_signals = false - //------------------------------------------------------------------ static bool SetProcessExitStatus(lldb::pid_t pid, // The process ID we want to monitor bool exited, @@ -577,7 +555,6 @@ public: uint32_t GetUniqueID() const { return m_process_unique_id; } - //------------------------------------------------------------------ /// Check if a plug-in instance can debug the file in \a module. /// /// Each plug-in is given a chance to say whether it can debug the file in @@ -587,28 +564,22 @@ public: /// \return /// Returns \b true if this Process plug-in instance can /// debug the executable, \b false otherwise. - //------------------------------------------------------------------ virtual bool CanDebug(lldb::TargetSP target, bool plugin_specified_by_name) = 0; - //------------------------------------------------------------------ /// This object is about to be destroyed, do any necessary cleanup. /// /// Subclasses that override this method should always call this superclass /// method. - //------------------------------------------------------------------ virtual void Finalize(); - //------------------------------------------------------------------ /// Return whether this object is valid (i.e. has not been finalized.) /// /// \return /// Returns \b true if this Process has not been finalized /// and \b false otherwise. - //------------------------------------------------------------------ bool IsValid() const { return !m_finalize_called; } - //------------------------------------------------------------------ /// Return a multi-word command object that can be used to expose plug-in /// specific commands. /// @@ -621,10 +592,8 @@ public: /// A CommandObject which can be one of the concrete subclasses /// of CommandObject like CommandObjectRaw, CommandObjectParsed, /// or CommandObjectMultiword. - //------------------------------------------------------------------ virtual CommandObject *GetPluginCommandObject() { return nullptr; } - //------------------------------------------------------------------ /// Launch a new process. /// /// Launch a new process by spawning a new process using the target object's @@ -644,7 +613,6 @@ public: /// \return /// An error object. Call GetID() to get the process ID if /// the error object is success. - //------------------------------------------------------------------ virtual Status Launch(ProcessLaunchInfo &launch_info); virtual Status LoadCore(); @@ -657,7 +625,6 @@ public: return error; } - //------------------------------------------------------------------ // FUTURE WORK: GetLoadImageUtilityFunction are the first use we've // had of having other plugins cache data in the Process. This is handy for // long-living plugins - like the Platform - which manage interactions whose @@ -672,8 +639,6 @@ public: // whether the registree should be notified of the Process' demise. // // We are postponing designing this till we have at least a second use case. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Get the cached UtilityFunction that assists in loading binary images /// into the process. /// @@ -687,12 +652,10 @@ public: /// \return /// The cached utility function or null if the platform is not the /// same as the target's platform. - //------------------------------------------------------------------ UtilityFunction *GetLoadImageUtilityFunction( Platform *platform, llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory); - //------------------------------------------------------------------ /// Get the dynamic loader plug-in for this process. /// /// The default action is to let the DynamicLoader plug-ins check the main @@ -700,20 +663,16 @@ public: /// Subclasses can override this if inspecting the executable is not /// desired, or if Process subclasses can only use a specific DynamicLoader /// plug-in. - //------------------------------------------------------------------ virtual DynamicLoader *GetDynamicLoader(); - //------------------------------------------------------------------ // Returns AUXV structure found in many ELF-based environments. // // The default action is to return an empty data buffer. // // \return // A data buffer containing the contents of the AUXV data. - //------------------------------------------------------------------ virtual const lldb::DataBufferSP GetAuxvData(); - //------------------------------------------------------------------ /// Sometimes processes know how to retrieve and load shared libraries. This /// is normally done by DynamicLoader plug-ins, but sometimes the connection /// to the process allows retrieving this information. The dynamic loader @@ -722,7 +681,6 @@ public: /// /// \return /// The number of shared libraries that were loaded - //------------------------------------------------------------------ virtual size_t LoadModules() { return 0; } virtual size_t LoadModules(LoadedModuleInfoList &) { return 0; } @@ -731,16 +689,13 @@ protected: virtual JITLoaderList &GetJITLoaders(); public: - //------------------------------------------------------------------ /// Get the system runtime plug-in for this process. /// /// \return /// Returns a pointer to the SystemRuntime plugin for this Process /// if one is available. Else returns nullptr. - //------------------------------------------------------------------ virtual SystemRuntime *GetSystemRuntime(); - //------------------------------------------------------------------ /// Attach to an existing process using the process attach info. /// /// This function is not meant to be overridden by Process subclasses. It @@ -755,10 +710,8 @@ public: /// \return /// Returns \a pid if attaching was successful, or /// LLDB_INVALID_PROCESS_ID if attaching fails. - //------------------------------------------------------------------ virtual Status Attach(ProcessAttachInfo &attach_info); - //------------------------------------------------------------------ /// Attach to a remote system via a URL /// /// \param[in] strm @@ -771,14 +724,12 @@ public: /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status ConnectRemote(Stream *strm, llvm::StringRef remote_url); bool GetShouldDetach() const { return m_should_detach; } void SetShouldDetach(bool b) { m_should_detach = b; } - //------------------------------------------------------------------ /// Get the image information address for the current process. /// /// Some runtimes have system functions that can help dynamic loaders locate @@ -791,10 +742,8 @@ public: /// The address of the dynamic loader information, or /// LLDB_INVALID_ADDRESS if this is not supported by this /// interface. - //------------------------------------------------------------------ virtual lldb::addr_t GetImageInfoAddress(); - //------------------------------------------------------------------ /// Called when the process is about to broadcast a public stop. /// /// There are public and private stops. Private stops are when the process @@ -807,10 +756,8 @@ public: /// more). This function can be overriden and allows process subclasses to /// do something before the eBroadcastBitStateChanged event is sent to /// public clients. - //------------------------------------------------------------------ virtual void WillPublicStop() {} -//------------------------------------------------------------------ /// Register for process and thread notifications. /// /// Clients can register notification callbacks by filling out a @@ -821,10 +768,8 @@ public: /// callback functions. /// /// \see Process::Notifications -//------------------------------------------------------------------ void RegisterNotificationCallbacks(const Process::Notifications &callbacks); -//------------------------------------------------------------------ /// Unregister for process and thread notifications. /// /// Clients can unregister notification callbacks by passing a copy of the @@ -839,13 +784,11 @@ public: /// successfully removed from the process, \b false otherwise. /// /// \see Process::Notifications -//------------------------------------------------------------------ bool UnregisterNotificationCallbacks(const Process::Notifications &callbacks); //================================================================== // Built in Process Control functions //================================================================== - //------------------------------------------------------------------ /// Resumes all of a process's threads as configured using the Thread run /// control functions. /// @@ -871,12 +814,10 @@ public: /// \see Thread:Resume() /// \see Thread:Step() /// \see Thread:Suspend() - //------------------------------------------------------------------ Status Resume(); Status ResumeSynchronous(Stream *stream); - //------------------------------------------------------------------ /// Halts a running process. /// /// This function is not meant to be overridden by Process subclasses. If @@ -894,10 +835,8 @@ public: /// Returns an error object. If the error is empty, the process is /// halted. /// otherwise the halt has failed. - //------------------------------------------------------------------ Status Halt(bool clear_thread_plans = false, bool use_run_lock = true); - //------------------------------------------------------------------ /// Detaches from a running or stopped process. /// /// This function is not meant to be overridden by Process subclasses. @@ -907,10 +846,8 @@ public: /// /// \return /// Returns an error object. - //------------------------------------------------------------------ Status Detach(bool keep_stopped); - //------------------------------------------------------------------ /// Kills the process and shuts down all threads that were spawned to track /// and monitor the process. /// @@ -926,17 +863,14 @@ public: /// /// \return /// Returns an error object. - //------------------------------------------------------------------ Status Destroy(bool force_kill); - //------------------------------------------------------------------ /// Sends a process a UNIX signal \a signal. /// /// This function is not meant to be overridden by Process subclasses. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ Status Signal(int signal); void SetUnixSignals(lldb::UnixSignalsSP &&signals_sp); @@ -947,30 +881,25 @@ public: // Plug-in Process Control Overrides //================================================================== - //------------------------------------------------------------------ /// Called before attaching to a process. /// /// Allow Process plug-ins to execute some code before attaching a process. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status WillAttachToProcessWithID(lldb::pid_t pid) { return Status(); } - //------------------------------------------------------------------ /// Called before attaching to a process. /// /// Allow Process plug-ins to execute some code before attaching a process. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status WillAttachToProcessWithName(const char *process_name, bool wait_for_launch) { return Status(); } - //------------------------------------------------------------------ /// Attach to a remote system via a URL /// /// \param[in] strm @@ -983,14 +912,12 @@ public: /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { Status error; error.SetErrorString("remote connections are not supported"); return error; } - //------------------------------------------------------------------ /// Attach to an existing process using a process ID. /// /// \param[in] pid @@ -1005,7 +932,6 @@ public: /// an appropriate (possibly platform-specific) error code if /// attaching fails. /// hanming : need flag - //------------------------------------------------------------------ virtual Status DoAttachToProcessWithID(lldb::pid_t pid, const ProcessAttachInfo &attach_info) { Status error; @@ -1015,7 +941,6 @@ public: return error; } - //------------------------------------------------------------------ /// Attach to an existing process using a partial process name. /// /// \param[in] process_name @@ -1029,7 +954,6 @@ public: /// Returns a successful Status attaching was successful, or /// an appropriate (possibly platform-specific) error code if /// attaching fails. - //------------------------------------------------------------------ virtual Status DoAttachToProcessWithName(const char *process_name, const ProcessAttachInfo &attach_info) { @@ -1038,7 +962,6 @@ public: return error; } - //------------------------------------------------------------------ /// Called after attaching a process. /// /// \param[in] process_arch @@ -1047,36 +970,28 @@ public: /// /// Allow Process plug-ins to execute some code after attaching to a /// process. - //------------------------------------------------------------------ virtual void DidAttach(ArchSpec &process_arch) { process_arch.Clear(); } - //------------------------------------------------------------------ /// Called after a process re-execs itself. /// /// Allow Process plug-ins to execute some code after a process has exec'ed /// itself. Subclasses typically should override DoDidExec() as the /// lldb_private::Process class needs to remove its dynamic loader, runtime, /// ABI and other plug-ins, as well as unload all shared libraries. - //------------------------------------------------------------------ virtual void DidExec(); - //------------------------------------------------------------------ /// Subclasses of Process should implement this function if they need to do /// anything after a process exec's itself. - //------------------------------------------------------------------ virtual void DoDidExec() {} - //------------------------------------------------------------------ /// Called before launching to a process. /// /// Allow Process plug-ins to execute some code before launching a process. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status WillLaunch(Module *module) { return Status(); } - //------------------------------------------------------------------ /// Launch a new process. /// /// Launch a new process by spawning a new process using \a exe_module's @@ -1094,7 +1009,6 @@ public: /// \return /// An Status instance indicating success or failure of the /// operation. - //------------------------------------------------------------------ virtual Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) { Status error; error.SetErrorStringWithFormat( @@ -1103,24 +1017,19 @@ public: return error; } - //------------------------------------------------------------------ /// Called after launching a process. /// /// Allow Process plug-ins to execute some code after launching a process. - //------------------------------------------------------------------ virtual void DidLaunch() {} - //------------------------------------------------------------------ /// Called before resuming to a process. /// /// Allow Process plug-ins to execute some code before resuming a process. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status WillResume() { return Status(); } - //------------------------------------------------------------------ /// Resumes all of a process's threads as configured using the Thread run /// control functions. /// @@ -1136,7 +1045,6 @@ public: /// \see Thread:Resume() /// \see Thread:Step() /// \see Thread:Suspend() - //------------------------------------------------------------------ virtual Status DoResume() { Status error; error.SetErrorStringWithFormat( @@ -1145,24 +1053,19 @@ public: return error; } - //------------------------------------------------------------------ /// Called after resuming a process. /// /// Allow Process plug-ins to execute some code after resuming a process. - //------------------------------------------------------------------ virtual void DidResume() {} - //------------------------------------------------------------------ /// Called before halting to a process. /// /// Allow Process plug-ins to execute some code before halting a process. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status WillHalt() { return Status(); } - //------------------------------------------------------------------ /// Halts a running process. /// /// DoHalt must produce one and only one stop StateChanged event if it @@ -1178,7 +1081,6 @@ public: /// \return /// Returns \b true if the process successfully halts, \b false /// otherwise. - //------------------------------------------------------------------ virtual Status DoHalt(bool &caused_stop) { Status error; error.SetErrorStringWithFormat( @@ -1187,14 +1089,11 @@ public: return error; } - //------------------------------------------------------------------ /// Called after halting a process. /// /// Allow Process plug-ins to execute some code after halting a process. - //------------------------------------------------------------------ virtual void DidHalt() {} - //------------------------------------------------------------------ /// Called before detaching from a process. /// /// Allow Process plug-ins to execute some code before detaching from a @@ -1202,16 +1101,13 @@ public: /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status WillDetach() { return Status(); } - //------------------------------------------------------------------ /// Detaches from a running or stopped process. /// /// \return /// Returns \b true if the process successfully detaches, \b /// false otherwise. - //------------------------------------------------------------------ virtual Status DoDetach(bool keep_stopped) { Status error; error.SetErrorStringWithFormat( @@ -1220,17 +1116,14 @@ public: return error; } - //------------------------------------------------------------------ /// Called after detaching from a process. /// /// Allow Process plug-ins to execute some code after detaching from a /// process. - //------------------------------------------------------------------ virtual void DidDetach() {} virtual bool DetachRequiresHalt() { return false; } - //------------------------------------------------------------------ /// Called before sending a signal to a process. /// /// Allow Process plug-ins to execute some code before sending a signal to a @@ -1240,15 +1133,12 @@ public: /// Returns no error if it is safe to proceed with a call to /// Process::DoSignal(int), otherwise an error describing what /// prevents the signal from being sent. - //------------------------------------------------------------------ virtual Status WillSignal() { return Status(); } - //------------------------------------------------------------------ /// Sends a process a UNIX signal \a signal. /// /// \return /// Returns an error object. - //------------------------------------------------------------------ virtual Status DoSignal(int signal) { Status error; error.SetErrorStringWithFormat( @@ -1265,15 +1155,12 @@ public: virtual bool DestroyRequiresHalt() { return true; } - //------------------------------------------------------------------ /// Called after sending a signal to a process. /// /// Allow Process plug-ins to execute some code after sending a signal to a /// process. - //------------------------------------------------------------------ virtual void DidSignal() {} - //------------------------------------------------------------------ /// Currently called as part of ShouldStop. /// FIXME: Should really happen when the target stops before the /// event is taken from the queue... @@ -1284,10 +1171,8 @@ public: /// operations include updating the thread list, invalidating any thread /// state (registers, stack, etc) prior to letting the notification go out. /// - //------------------------------------------------------------------ virtual void RefreshStateAfterStop() = 0; - //------------------------------------------------------------------ /// Sometimes the connection to a process can detect the host OS version /// that the process is running on. The current platform should be checked /// first in case the platform is connected, but clients can fall back onto @@ -1299,28 +1184,22 @@ public: /// \return /// Returns the version tuple of the host OS. In case of failure an empty /// VersionTuple is returner. - //------------------------------------------------------------------ virtual llvm::VersionTuple GetHostOSVersion() { return llvm::VersionTuple(); } - //------------------------------------------------------------------ /// Get the target object pointer for this module. /// /// \return /// A Target object pointer to the target that owns this /// module. - //------------------------------------------------------------------ Target &GetTarget() { return *m_target_wp.lock(); } - //------------------------------------------------------------------ /// Get the const target object pointer for this module. /// /// \return /// A const Target object pointer to the target that owns this /// module. - //------------------------------------------------------------------ const Target &GetTarget() const { return *m_target_wp.lock(); } - //------------------------------------------------------------------ /// Flush all data in the process. /// /// Flush the memory caches, all threads, and any other cached data in the @@ -1329,17 +1208,14 @@ public: /// This function can be called after a world changing event like adding a /// new symbol file, or after the process makes a large context switch (from /// boot ROM to booted into an OS). - //------------------------------------------------------------------ void Flush(); - //------------------------------------------------------------------ /// Get accessor for the current process state. /// /// \return /// The current state of the process. /// /// \see lldb::StateType - //------------------------------------------------------------------ lldb::StateType GetState(); lldb::ExpressionResults @@ -1358,15 +1234,12 @@ public: void SendAsyncInterrupt(); - //------------------------------------------------------------------ // Notify this process class that modules got loaded. // // If subclasses override this method, they must call this version before // doing anything in the subclass version of the function. - //------------------------------------------------------------------ virtual void ModulesDidLoad(ModuleList &module_list); - //------------------------------------------------------------------ /// Retrieve the list of shared libraries that are loaded for this process /// This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre- /// watchOS 3 systems. The following two methods are for newer versions of @@ -1393,7 +1266,6 @@ public: /// A StructureDataSP object which, if non-empty, will contain the /// information the DynamicLoader needs to get the initial scan of /// solibs resolved. - //------------------------------------------------------------------ virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(lldb::addr_t image_list_address, lldb::addr_t image_count) { @@ -1414,19 +1286,16 @@ public: return StructuredData::ObjectSP(); } - //------------------------------------------------------------------ // Get information about the library shared cache, if that exists // // On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can // return information about the library shared cache (a set of standard // libraries that are loaded at the same location for all processes on a // system) in use. - //------------------------------------------------------------------ virtual lldb_private::StructuredData::ObjectSP GetSharedCacheInfo() { return StructuredData::ObjectSP(); } - //------------------------------------------------------------------ /// Print a user-visible warning about a module being built with /// optimization /// @@ -1436,38 +1305,31 @@ public: /// \param [in] sc /// A SymbolContext with eSymbolContextFunction and eSymbolContextModule /// pre-computed. - //------------------------------------------------------------------ void PrintWarningOptimization(const SymbolContext &sc); virtual bool GetProcessInfo(ProcessInstanceInfo &info); public: - //------------------------------------------------------------------ /// Get the exit status for a process. /// /// \return /// The process's return code, or -1 if the current process /// state is not eStateExited. - //------------------------------------------------------------------ int GetExitStatus(); - //------------------------------------------------------------------ /// Get a textual description of what the process exited. /// /// \return /// The textual description of why the process exited, or nullptr /// if there is no description available. - //------------------------------------------------------------------ const char *GetExitDescription(); virtual void DidExit() {} - //------------------------------------------------------------------ /// Get the Modification ID of the process. /// /// \return /// The modification ID of the process. - //------------------------------------------------------------------ ProcessModID GetModID() const { return m_mod_id; } const ProcessModID &GetModIDRef() const { return m_mod_id; } @@ -1488,7 +1350,6 @@ public: return m_mod_id.GetStopEventForStopID(stop_id); } - //------------------------------------------------------------------ /// Set accessor for the process exit status (return code). /// /// Sometimes a child exits and the exit can be detected by global functions @@ -1502,19 +1363,15 @@ public: /// The value for the process's return code. /// /// \see lldb::StateType - //------------------------------------------------------------------ virtual bool SetExitStatus(int exit_status, const char *cstr); - //------------------------------------------------------------------ /// Check if a process is still alive. /// /// \return /// Returns \b true if the process is still valid, \b false /// otherwise. - //------------------------------------------------------------------ virtual bool IsAlive(); - //------------------------------------------------------------------ /// Before lldb detaches from a process, it warns the user that they are /// about to lose their debug session. In some cases, this warning doesn't /// need to be emitted -- for instance, with core file debugging where the @@ -1523,10 +1380,8 @@ public: /// /// \return // true if the user should be warned about detaching from this process. - //------------------------------------------------------------------ virtual bool WarnBeforeDetach() const { return true; } - //------------------------------------------------------------------ /// Actually do the reading of memory from a process. /// /// Subclasses must override this function and can return fewer bytes than @@ -1553,11 +1408,9 @@ public: /// \return /// The number of bytes that were actually read into \a buf. /// Zero is returned in the case of an error. - //------------------------------------------------------------------ virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error) = 0; - //------------------------------------------------------------------ /// Read of memory from a process. /// /// This function will read memory from the current process's address space @@ -1590,11 +1443,9 @@ public: /// size, then this function will get called again with \a /// vm_addr, \a buf, and \a size updated appropriately. Zero is /// returned in the case of an error. - //------------------------------------------------------------------ virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error); - //------------------------------------------------------------------ /// Read of memory from a process. /// /// This function has the same semantics of ReadMemory except that it @@ -1623,11 +1474,9 @@ public: /// size, then this function will get called again with \a /// vm_addr, \a buf, and \a size updated appropriately. Zero is /// returned in the case of an error. - //------------------------------------------------------------------ size_t ReadMemoryFromInferior(lldb::addr_t vm_addr, void *buf, size_t size, Status &error); - //------------------------------------------------------------------ /// Read a NULL terminated string from memory /// /// This function will read a cache page at a time until a NULL string @@ -1655,11 +1504,9 @@ public: /// /// \return /// The error status or the number of bytes prior to the null terminator. - //------------------------------------------------------------------ size_t ReadStringFromMemory(lldb::addr_t vm_addr, char *str, size_t max_bytes, Status &error, size_t type_width = 1); - //------------------------------------------------------------------ /// Read a NULL terminated C string from memory /// /// This function will read a cache page at a time until the NULL @@ -1667,14 +1514,12 @@ public: /// termination byte isn't found before reading \a cstr_max_len bytes, and /// the results are always guaranteed to be NULL terminated (at most /// cstr_max_len - 1 bytes will be read). - //------------------------------------------------------------------ size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr, size_t cstr_max_len, Status &error); size_t ReadCStringFromMemory(lldb::addr_t vm_addr, std::string &out_str, Status &error); - //------------------------------------------------------------------ /// Reads an unsigned integer of the specified byte size from process /// memory. /// @@ -1700,7 +1545,6 @@ public: /// byte order differs from the host byte order, the integer /// value will be appropriately byte swapped into host byte /// order. - //------------------------------------------------------------------ uint64_t ReadUnsignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Status &error); @@ -1713,7 +1557,6 @@ public: bool WritePointerToMemory(lldb::addr_t vm_addr, lldb::addr_t ptr_value, Status &error); - //------------------------------------------------------------------ /// Actually do the writing of memory to a process. /// /// \param[in] vm_addr @@ -1732,7 +1575,6 @@ public: /// /// \return /// The number of bytes that were actually written. - //------------------------------------------------------------------ virtual size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error) { error.SetErrorStringWithFormat( @@ -1741,7 +1583,6 @@ public: return 0; } - //------------------------------------------------------------------ /// Write all or part of a scalar value to memory. /// /// The value contained in \a scalar will be swapped to match the byte order @@ -1771,7 +1612,6 @@ public: /// /// \return /// The number of bytes that were actually written. - //------------------------------------------------------------------ size_t WriteScalarToMemory(lldb::addr_t vm_addr, const Scalar &scalar, size_t size, Status &error); @@ -1779,7 +1619,6 @@ public: bool is_signed, Scalar &scalar, Status &error); - //------------------------------------------------------------------ /// Write memory to a process. /// /// This function will write memory to the current process's address space @@ -1803,12 +1642,10 @@ public: /// /// \return /// The number of bytes that were actually written. - //------------------------------------------------------------------ // TODO: change this to take an ArrayRef<uint8_t> size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error); - //------------------------------------------------------------------ /// Actually allocate memory in the process. /// /// This function will allocate memory in the process's address space. This @@ -1821,7 +1658,6 @@ public: /// \return /// The address of the allocated buffer in the process, or /// LLDB_INVALID_ADDRESS if the allocation failed. - //------------------------------------------------------------------ virtual lldb::addr_t DoAllocateMemory(size_t size, uint32_t permissions, Status &error) { @@ -1833,7 +1669,6 @@ public: virtual Status WriteObjectFile(std::vector<ObjectFile::LoadableData> entries); - //------------------------------------------------------------------ /// The public interface to allocating memory in the process. /// /// This function will allocate memory in the process's address space. This @@ -1855,10 +1690,8 @@ public: /// \return /// The address of the allocated buffer in the process, or /// LLDB_INVALID_ADDRESS if the allocation failed. - //------------------------------------------------------------------ lldb::addr_t AllocateMemory(size_t size, uint32_t permissions, Status &error); - //------------------------------------------------------------------ /// The public interface to allocating memory in the process, this also /// clears the allocated memory. /// @@ -1881,12 +1714,10 @@ public: /// \return /// The address of the allocated buffer in the process, or /// LLDB_INVALID_ADDRESS if the allocation failed. - //------------------------------------------------------------------ lldb::addr_t CallocateMemory(size_t size, uint32_t permissions, Status &error); - //------------------------------------------------------------------ /// Resolve dynamically loaded indirect functions. /// /// \param[in] address @@ -1898,11 +1729,9 @@ public: /// \return /// The address of the resolved function. /// LLDB_INVALID_ADDRESS if the resolution failed. - //------------------------------------------------------------------ virtual lldb::addr_t ResolveIndirectFunction(const Address *address, Status &error); - //------------------------------------------------------------------ /// Locate the memory region that contains load_addr. /// /// If load_addr is within the address space the process has mapped @@ -1927,7 +1756,6 @@ public: /// /// \return /// An error value. - //------------------------------------------------------------------ virtual Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info) { Status error; @@ -1935,7 +1763,6 @@ public: return error; } - //------------------------------------------------------------------ /// Obtain all the mapped memory regions within this process. /// /// \param[out] region_list @@ -1944,7 +1771,6 @@ public: /// /// \return /// An error value. - //------------------------------------------------------------------ virtual Status GetMemoryRegions(lldb_private::MemoryRegionInfos ®ion_list); @@ -1967,7 +1793,6 @@ public: lldb::addr_t header_addr, size_t size_to_read = 512); - //------------------------------------------------------------------ /// Attempt to get the attributes for a region of memory in the process. /// /// It may be possible for the remote debug server to inspect attributes for @@ -1987,57 +1812,45 @@ public: /// \return /// Returns true if it was able to determine the attributes of the /// memory region. False if not. - //------------------------------------------------------------------ virtual bool GetLoadAddressPermissions(lldb::addr_t load_addr, uint32_t &permissions); - //------------------------------------------------------------------ /// Determines whether executing JIT-compiled code in this process is /// possible. /// /// \return /// True if execution of JIT code is possible; false otherwise. - //------------------------------------------------------------------ bool CanJIT(); - //------------------------------------------------------------------ /// Sets whether executing JIT-compiled code in this process is possible. /// /// \param[in] can_jit /// True if execution of JIT code is possible; false otherwise. - //------------------------------------------------------------------ void SetCanJIT(bool can_jit); - //------------------------------------------------------------------ /// Determines whether executing function calls using the interpreter is /// possible for this process. /// /// \return /// True if possible; false otherwise. - //------------------------------------------------------------------ bool CanInterpretFunctionCalls() { return m_can_interpret_function_calls; } - //------------------------------------------------------------------ /// Sets whether executing function calls using the interpreter is possible /// for this process. /// /// \param[in] can_interpret_function_calls /// True if possible; false otherwise. - //------------------------------------------------------------------ void SetCanInterpretFunctionCalls(bool can_interpret_function_calls) { m_can_interpret_function_calls = can_interpret_function_calls; } - //------------------------------------------------------------------ /// Sets whether executing code in this process is possible. This could be /// either through JIT or interpreting. /// /// \param[in] can_run_code /// True if execution of code is possible; false otherwise. - //------------------------------------------------------------------ void SetCanRunCode(bool can_run_code); - //------------------------------------------------------------------ /// Actually deallocate memory in the process. /// /// This function will deallocate memory in the process's address space that @@ -2049,7 +1862,6 @@ public: /// /// \return /// \btrue if the memory was deallocated, \bfalse otherwise. - //------------------------------------------------------------------ virtual Status DoDeallocateMemory(lldb::addr_t ptr) { Status error; error.SetErrorStringWithFormat( @@ -2058,7 +1870,6 @@ public: return error; } - //------------------------------------------------------------------ /// The public interface to deallocating memory in the process. /// /// This function will deallocate memory in the process's address space that @@ -2070,10 +1881,8 @@ public: /// /// \return /// \btrue if the memory was deallocated, \bfalse otherwise. - //------------------------------------------------------------------ Status DeallocateMemory(lldb::addr_t ptr); - //------------------------------------------------------------------ /// Get any available STDOUT. /// /// Calling this method is a valid operation only if all of the following @@ -2101,10 +1910,8 @@ public: /// The number of bytes written into \a buf. If this value is /// equal to \a buf_size, another call to this function should /// be made to retrieve more STDOUT data. - //------------------------------------------------------------------ virtual size_t GetSTDOUT(char *buf, size_t buf_size, Status &error); - //------------------------------------------------------------------ /// Get any available STDERR. /// /// Calling this method is a valid operation only if all of the following @@ -2132,10 +1939,8 @@ public: /// The number of bytes written into \a buf. If this value is /// equal to \a buf_size, another call to this function should /// be made to retrieve more STDERR data. - //------------------------------------------------------------------ virtual size_t GetSTDERR(char *buf, size_t buf_size, Status &error); - //------------------------------------------------------------------ /// Puts data into this process's STDIN. /// /// Calling this method is a valid operation only if all of the following @@ -2154,13 +1959,11 @@ public: /// The number of bytes written into \a buf. If this value is /// less than \a buf_size, another call to this function should /// be made to write the rest of the data. - //------------------------------------------------------------------ virtual size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) { error.SetErrorString("stdin unsupported"); return 0; } - //------------------------------------------------------------------ /// Get any available profile data. /// /// \param[out] buf @@ -2174,12 +1977,9 @@ public: /// The number of bytes written into \a buf. If this value is /// equal to \a buf_size, another call to this function should /// be made to retrieve more profile data. - //------------------------------------------------------------------ virtual size_t GetAsyncProfileData(char *buf, size_t buf_size, Status &error); - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- size_t GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site); virtual Status EnableBreakpointSite(BreakpointSite *bp_site) { @@ -2231,16 +2031,12 @@ public: lldb::user_id_t owner_loc_id, lldb::BreakpointSiteSP &bp_site_sp); - //---------------------------------------------------------------------- // Process Watchpoints (optional) - //---------------------------------------------------------------------- virtual Status EnableWatchpoint(Watchpoint *wp, bool notify = true); virtual Status DisableWatchpoint(Watchpoint *wp, bool notify = true); - //------------------------------------------------------------------ // Thread Queries - //------------------------------------------------------------------ virtual bool UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) = 0; @@ -2268,9 +2064,7 @@ public: // id will be used. uint32_t AssignIndexIDToThread(uint64_t thread_id); - //------------------------------------------------------------------ // Queue Queries - //------------------------------------------------------------------ void UpdateQueueListIfNeeded(); @@ -2284,9 +2078,7 @@ public: return m_queue_list.Queues(); } - //------------------------------------------------------------------ // Event Handling - //------------------------------------------------------------------ lldb::StateType GetNextEvent(lldb::EventSP &event_sp); // Returns the process state when it is stopped. If specified, event_sp_ptr @@ -2304,7 +2096,6 @@ public: uint32_t GetIOHandlerID() const { return m_iohandler_sync.GetValue(); } - //-------------------------------------------------------------------------------------- /// Waits for the process state to be running within a given msec timeout. /// /// The main purpose of this is to implement an interlock waiting for @@ -2313,7 +2104,6 @@ public: /// \param[in] timeout /// The maximum time length to wait for the process to transition to the /// eStateRunning state. - //-------------------------------------------------------------------------------------- void SyncIOHandler(uint32_t iohandler_id, const Timeout<std::micro> &timeout); lldb::StateType GetStateChangedEvents( @@ -2321,7 +2111,6 @@ public: lldb::ListenerSP hijack_listener); // Pass an empty ListenerSP to use builtin listener - //-------------------------------------------------------------------------------------- /// Centralize the code that handles and prints descriptions for process /// state changes. /// @@ -2341,7 +2130,6 @@ public: /// \return /// \b true if the event describes a process state changed event, \b false /// otherwise. - //-------------------------------------------------------------------------------------- static bool HandleProcessStateChangedEvent(const lldb::EventSP &event_sp, Stream *stream, bool &pop_process_io_handler); @@ -2363,7 +2151,6 @@ public: friend class ProcessEventHijacker; friend class ProcessProperties; - //------------------------------------------------------------------ /// If you need to ensure that you and only you will hear about some public /// event, then make a new listener, set to listen to process events, and /// then call this with that listener. Then you will have to wait on that @@ -2377,13 +2164,10 @@ public: /// \return /// Returns \b true if the new listener could be installed, /// \b false otherwise. - //------------------------------------------------------------------ bool HijackProcessEvents(lldb::ListenerSP listener_sp); - //------------------------------------------------------------------ /// Restores the process event broadcasting to its normal state. /// - //------------------------------------------------------------------ void RestoreProcessEvents(); bool StateChangedIsHijackedForSynchronousResume(); @@ -2412,7 +2196,6 @@ public: void SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers); - //------------------------------------------------------------------ /// Call this to set the lldb in the mode where it breaks on new thread /// creations, and then auto-restarts. This is useful when you are trying /// to run only one thread, but either that thread or the kernel is creating @@ -2423,24 +2206,19 @@ public: /// \return /// Returns \b true if we were able to start up the notification /// \b false otherwise. - //------------------------------------------------------------------ virtual bool StartNoticingNewThreads() { return true; } - //------------------------------------------------------------------ /// Call this to turn off the stop & notice new threads mode. /// /// \return /// Returns \b true if we were able to start up the notification /// \b false otherwise. - //------------------------------------------------------------------ virtual bool StopNoticingNewThreads() { return true; } void SetRunningUserExpression(bool on); void SetRunningUtilityFunction(bool on); - //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions - //------------------------------------------------------------------ lldb::TargetSP CalculateTarget() override; lldb::ProcessSP CalculateProcess() override { return shared_from_this(); } @@ -2455,28 +2233,22 @@ public: void SetSTDIOFileDescriptor(int file_descriptor); - //------------------------------------------------------------------ // Add a permanent region of memory that should never be read or written to. // This can be used to ensure that memory reads or writes to certain areas of // memory never end up being sent to the DoReadMemory or DoWriteMemory // functions which can improve performance. - //------------------------------------------------------------------ void AddInvalidMemoryRegion(const LoadRange ®ion); - //------------------------------------------------------------------ // Remove a permanent region of memory that should never be read or written // to that was previously added with AddInvalidMemoryRegion. - //------------------------------------------------------------------ bool RemoveInvalidMemoryRange(const LoadRange ®ion); - //------------------------------------------------------------------ // If the setup code of a thread plan needs to do work that might involve // calling a function in the target, it should not do that work directly in // one of the thread plan functions (DidPush/WillResume) because such work // needs to be handled carefully. Instead, put that work in a // PreResumeAction callback, and register it with the process. It will get // done before the actual "DoResume" gets called. - //------------------------------------------------------------------ typedef bool(PreResumeActionCallback)(void *); @@ -2500,7 +2272,6 @@ public: lldb::InstrumentationRuntimeSP GetInstrumentationRuntime(lldb::InstrumentationRuntimeType type); - //------------------------------------------------------------------ /// Try to fetch the module specification for a module with the given file /// name and architecture. Process sub-classes have to override this method /// if they support platforms where the Platform object can't get the module @@ -2519,14 +2290,12 @@ public: /// \return /// Returns \b true if the module spec fetched successfully, /// \b false otherwise. - //------------------------------------------------------------------ virtual bool GetModuleSpec(const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec); virtual void PrefetchModuleSpecs(llvm::ArrayRef<FileSpec> module_file_specs, const llvm::Triple &triple) {} - //------------------------------------------------------------------ /// Try to find the load address of a file. /// The load address is defined as the address of the first memory region /// what contains data mapped from the specified file. @@ -2541,7 +2310,6 @@ public: /// \param[out] load_addr /// The load address of the file if it is loaded into the /// processes address space, LLDB_INVALID_ADDRESS otherwise. - //------------------------------------------------------------------ virtual Status GetFileLoadAddress(const FileSpec &file, bool &is_loaded, lldb::addr_t &load_addr) { return Status("Not supported"); @@ -2553,7 +2321,6 @@ public: void ResetImageToken(size_t token); - //------------------------------------------------------------------ /// Find the next branch instruction to set a breakpoint on /// /// When instruction stepping through a source line, instead of stepping @@ -2575,11 +2342,9 @@ public: /// the range provided in range_bounds. If there are any /// problems with the disassembly or getting the instructions, /// the original default_stop_addr will be returned. - //------------------------------------------------------------------ Address AdvanceAddressToNextBranchInstruction(Address default_stop_addr, AddressRange range_bounds); - //------------------------------------------------------------------ /// Configure asynchronous structured data feature. /// /// Each Process type that supports using an asynchronous StructuredData @@ -2604,12 +2369,10 @@ public: /// /// \return /// Returns the result of attempting to configure the feature. - //------------------------------------------------------------------ virtual Status ConfigureStructuredData(ConstString type_name, const StructuredData::ObjectSP &config_sp); - //------------------------------------------------------------------ /// Broadcasts the given structured data object from the given plugin. /// /// StructuredDataPlugin instances can use this to optionally broadcast any @@ -2623,11 +2386,9 @@ public: /// \param[in] plugin_sp /// The plugin that will be reported in the event's plugin /// parameter. - //------------------------------------------------------------------ void BroadcastStructuredData(const StructuredData::ObjectSP &object_sp, const lldb::StructuredDataPluginSP &plugin_sp); - //------------------------------------------------------------------ /// Returns the StructuredDataPlugin associated with a given type name, if /// there is one. /// @@ -2638,11 +2399,9 @@ public: /// \return /// The plugin if one is available for the specified feature; /// otherwise, returns an empty shared pointer. - //------------------------------------------------------------------ lldb::StructuredDataPluginSP GetStructuredDataPlugin(ConstString type_name) const; - //------------------------------------------------------------------ /// Starts tracing with the configuration provided in options. To enable /// tracing on the complete process the thread_id in the options should be /// set to LLDB_INVALID_THREAD_ID. The API returns a user_id which is needed @@ -2651,48 +2410,40 @@ public: /// implementations in the server, as they could be returned as an error, or /// rounded to a valid configuration to start tracing. In the later case the /// GetTraceConfig should supply the actual used trace configuration. - //------------------------------------------------------------------ virtual lldb::user_id_t StartTrace(const TraceOptions &options, Status &error) { error.SetErrorString("Not implemented"); return LLDB_INVALID_UID; } - //------------------------------------------------------------------ /// Stops the tracing instance leading to deletion of the trace data. The /// tracing instance is identified by the user_id which is obtained when /// tracing was started from the StartTrace. In case tracing of the complete /// process needs to be stopped the thread_id should be set to /// LLDB_INVALID_THREAD_ID. In the other case that tracing on an individual /// thread needs to be stopped a thread_id can be supplied. - //------------------------------------------------------------------ virtual Status StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id) { return Status("Not implemented"); } - //------------------------------------------------------------------ /// Provides the trace data as raw bytes. A buffer needs to be supplied to /// copy the trace data. The exact behavior of this API may vary across /// trace technology, as some may support partial reading of the trace data /// from a specified offset while some may not. The thread_id should be used /// to select a particular thread for trace extraction. - //------------------------------------------------------------------ virtual Status GetData(lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef<uint8_t> &buffer, size_t offset = 0) { return Status("Not implemented"); } - //------------------------------------------------------------------ /// Similar API as above except for obtaining meta data - //------------------------------------------------------------------ virtual Status GetMetaData(lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef<uint8_t> &buffer, size_t offset = 0) { return Status("Not implemented"); } - //------------------------------------------------------------------ /// API to obtain the trace configuration used by a trace instance. /// Configurations that may be specific to some trace technology should be /// stored in the custom parameters. The options are transported to the @@ -2700,7 +2451,6 @@ public: /// specified in the options to obtain the configuration used by a specific /// thread. The thread_id specified should also match the uid otherwise an /// error will be returned. - //------------------------------------------------------------------ virtual Status GetTraceConfig(lldb::user_id_t uid, TraceOptions &options) { return Status("Not implemented"); } @@ -2710,21 +2460,16 @@ protected: lldb::StateType GetPrivateState(); - //------------------------------------------------------------------ /// The "private" side of resuming a process. This doesn't alter the state /// of m_run_lock, but just causes the process to resume. /// /// \return /// An Status object describing the success or failure of the resume. - //------------------------------------------------------------------ Status PrivateResume(); - //------------------------------------------------------------------ // Called internally - //------------------------------------------------------------------ void CompleteAttach(); - //------------------------------------------------------------------ /// Print a user-visible warning one time per Process /// /// A facility for printing a warning to the user once per repeat_key. @@ -2751,11 +2496,9 @@ protected: /// /// \param [in] fmt /// printf style format string - //------------------------------------------------------------------ void PrintWarning(uint64_t warning_type, const void *repeat_key, const char *fmt, ...) __attribute__((format(printf, 4, 5))); - //------------------------------------------------------------------ // NextEventAction provides a way to register an action on the next event // that is delivered to this process. There is currently only one next event // action allowed in the process at one time. If a new "NextEventAction" is @@ -2764,7 +2507,6 @@ protected: // // If you want to resume the process as a result of a resume action, call // RequestResume, don't call Resume directly. - //------------------------------------------------------------------ class NextEventAction { public: typedef enum EventActionResult { @@ -2818,7 +2560,6 @@ protected: void ForceNextEventDelivery() { m_force_next_event_delivery = true; } - //------------------------------------------------------------------ /// Loads any plugins associated with asynchronous structured data and maps /// the relevant supported type name to the plugin. /// @@ -2835,11 +2576,9 @@ protected: /// An array of zero or more type names. Each must be unique. /// For each entry in the list, a StructuredDataPlugin will be /// searched for that supports the structured data type name. - //------------------------------------------------------------------ void MapSupportedStructuredDataPlugins( const StructuredData::Array &supported_type_names); - //------------------------------------------------------------------ /// Route the incoming structured data dictionary to the right plugin. /// /// The incoming structured data must be a dictionary, and it must have a @@ -2862,12 +2601,9 @@ protected: /// \return /// True if the structured data was routed to a plugin; otherwise, /// false. - //------------------------------------------------------------------ bool RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp); - //------------------------------------------------------------------ // Type definitions - //------------------------------------------------------------------ typedef std::map<lldb::LanguageType, lldb::LanguageRuntimeSP> LanguageRuntimeCollection; typedef std::unordered_set<const void *> WarningsPointerSet; @@ -2887,9 +2623,7 @@ protected: using StructuredDataPluginMap = std::map<ConstString, lldb::StructuredDataPluginSP>; - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ std::weak_ptr<Target> m_target_wp; ///< The target that owns this process. ThreadSafeValue<lldb::StateType> m_public_state; ThreadSafeValue<lldb::StateType> @@ -3084,7 +2818,6 @@ protected: void LoadOperatingSystemPlugin(bool flush); private: - //------------------------------------------------------------------ /// This is the part of the event handling that for a process event. It /// decides what to do with the event and returns true if the event needs to /// be propagated to the user, and false otherwise. If the event is not @@ -3098,7 +2831,6 @@ private: /// \return /// Returns \b true if the event should be reported to the /// user, \b false otherwise. - //------------------------------------------------------------------ bool ShouldBroadcastEvent(Event *event_ptr); void ControlPrivateStateThread(uint32_t signal); @@ -3106,10 +2838,8 @@ private: DISALLOW_COPY_AND_ASSIGN(Process); }; -//------------------------------------------------------------------ /// RAII guard that should be aquired when an utility function is called within /// a given process. -//------------------------------------------------------------------ class UtilityFunctionScope { Process *m_process; diff --git a/lldb/include/lldb/Target/Queue.h b/lldb/include/lldb/Target/Queue.h index 2f5f1d5..01e8994 100644 --- a/lldb/include/lldb/Target/Queue.h +++ b/lldb/include/lldb/Target/Queue.h @@ -19,7 +19,6 @@ namespace lldb_private { -//------------------------------------------------------------------ // Queue: // This class represents a libdispatch aka Grand Central Dispatch queue in the // process. @@ -29,7 +28,6 @@ namespace lldb_private { // pthreads to execute the work items for the queues. A serial queue will be // associated with a single thread (or possibly no thread, if it is not doing // any work). A concurrent queue may be associated with multiple threads. -//------------------------------------------------------------------ class Queue : public std::enable_shared_from_this<Queue> { public: @@ -38,7 +36,6 @@ public: ~Queue(); - //------------------------------------------------------------------ /// Get the QueueID for this Queue /// /// A 64-bit ID number that uniquely identifies a queue at this particular @@ -49,19 +46,15 @@ public: /// /// \return /// The QueueID for this Queue. - //------------------------------------------------------------------ lldb::queue_id_t GetID(); - //------------------------------------------------------------------ /// Get the name of this Queue /// /// \return /// The name of the queue, if one is available. /// A NULL pointer is returned if none is available. - //------------------------------------------------------------------ const char *GetName(); - //------------------------------------------------------------------ /// Get the IndexID for this Queue /// /// This is currently the same as GetID(). If it changes in the future, @@ -74,10 +67,8 @@ public: /// /// \return /// The IndexID for this queue. - //------------------------------------------------------------------ uint32_t GetIndexID(); - //------------------------------------------------------------------ /// Return the threads currently associated with this queue /// /// Zero, one, or many threads may be executing code for a queue at @@ -86,10 +77,8 @@ public: /// /// \return /// The threads currently performing work for this queue - //------------------------------------------------------------------ std::vector<lldb::ThreadSP> GetThreads(); - //------------------------------------------------------------------ /// Return the items that are currently enqueued /// /// "Enqueued" means that the item has been added to the queue to @@ -98,31 +87,25 @@ public: /// /// \return /// The vector of enqueued items for this queue - //------------------------------------------------------------------ const std::vector<lldb::QueueItemSP> &GetPendingItems(); lldb::ProcessSP GetProcess() const { return m_process_wp.lock(); } - //------------------------------------------------------------------ /// Get the number of work items that this queue is currently running /// /// \return /// The number of work items currently executing. For a serial /// queue, this will be 0 or 1. For a concurrent queue, this /// may be any number. - //------------------------------------------------------------------ uint32_t GetNumRunningWorkItems() const; - //------------------------------------------------------------------ /// Get the number of work items enqueued on this queue /// /// \return /// The number of work items currently enqueued, waiting to /// execute. - //------------------------------------------------------------------ uint32_t GetNumPendingWorkItems() const; - //------------------------------------------------------------------ /// Get the dispatch_queue_t structure address for this Queue /// /// Get the address in the inferior process' memory of this Queue's @@ -131,7 +114,6 @@ public: /// \return /// The address of the dispatch_queue_t structure, if known. /// LLDB_INVALID_ADDRESS will be returned if it is unavailable. - //------------------------------------------------------------------ lldb::addr_t GetLibdispatchQueueAddress() const; void SetNumRunningWorkItems(uint32_t count); @@ -144,20 +126,16 @@ public: m_pending_items.push_back(item); } - //------------------------------------------------------------------ /// Return the kind (serial, concurrent) of this queue /// /// \return // Whether this is a serial or a concurrent queue - //------------------------------------------------------------------ lldb::QueueKind GetKind(); void SetKind(lldb::QueueKind kind); private: - //------------------------------------------------------------------ // For Queue only - //------------------------------------------------------------------ lldb::ProcessWP m_process_wp; lldb::queue_id_t m_queue_id; diff --git a/lldb/include/lldb/Target/QueueItem.h b/lldb/include/lldb/Target/QueueItem.h index b4fd3c2..dfae3b8 100644 --- a/lldb/include/lldb/Target/QueueItem.h +++ b/lldb/include/lldb/Target/QueueItem.h @@ -22,14 +22,12 @@ namespace lldb_private { -//------------------------------------------------------------------ // QueueItem: // This class represents a work item enqueued on a libdispatch aka Grand // Central Dispatch (GCD) queue. Most often, this will be a function or block. // "enqueued" here means that the work item has been added to a queue but it // has not yet started executing. When it is "dequeued", execution of the item // begins. -//------------------------------------------------------------------ class QueueItem : public std::enable_shared_from_this<QueueItem> { public: @@ -38,24 +36,19 @@ public: ~QueueItem(); - //------------------------------------------------------------------ /// Get the kind of work item this is /// /// \return /// The type of work item that this QueueItem object /// represents. eQueueItemKindUnknown may be returned. - //------------------------------------------------------------------ lldb::QueueItemKind GetKind(); - //------------------------------------------------------------------ /// Set the type of work item this is /// /// \param [in] item_kind /// Set the kind of this work item object. - //------------------------------------------------------------------ void SetKind(lldb::QueueItemKind item_kind); - //------------------------------------------------------------------ /// Get the code address that will be executed when this work item /// is executed. /// @@ -66,19 +59,15 @@ public: /// Address is valid, or check that the WorkItemKind is a /// kind that involves an address, such as eQueueItemKindFunction /// or eQueueItemKindBlock. - //------------------------------------------------------------------ lldb_private::Address &GetAddress(); - //------------------------------------------------------------------ /// Set the work item address for this object /// /// \param [in] addr /// The address that will be invoked when this work item /// is executed. - //------------------------------------------------------------------ void SetAddress(lldb_private::Address addr); - //------------------------------------------------------------------ /// Check if this QueueItem object is valid /// /// If the weak pointer to the parent Queue cannot be revivified, @@ -86,10 +75,8 @@ public: /// /// \return /// True if this object is valid. - //------------------------------------------------------------------ bool IsValid() { return m_queue_wp.lock() != nullptr; } - //------------------------------------------------------------------ /// Get an extended backtrace thread for this queue item, if available /// /// If the backtrace/thread information was collected when this item @@ -102,7 +89,6 @@ public: /// \return /// A thread shared pointer which will have a reference to an extended /// thread if one was available. - //------------------------------------------------------------------ lldb::ThreadSP GetExtendedBacktraceThread(ConstString type); void SetItemThatEnqueuedThis(lldb::addr_t address_of_item) { diff --git a/lldb/include/lldb/Target/QueueList.h b/lldb/include/lldb/Target/QueueList.h index d898e5b..7029fa2 100644 --- a/lldb/include/lldb/Target/QueueList.h +++ b/lldb/include/lldb/Target/QueueList.h @@ -18,14 +18,12 @@ namespace lldb_private { -//------------------------------------------------------------------ // QueueList: // This is the container for libdispatch aka Grand Central Dispatch Queue // objects. // // Each Process will have a QueueList. When the process execution is paused, // the QueueList may be populated with Queues by the SystemRuntime. -//------------------------------------------------------------------ class QueueList { friend class Process; @@ -35,22 +33,18 @@ public: ~QueueList(); - //------------------------------------------------------------------ /// Get the number of libdispatch queues that are available /// /// \return /// The number of queues that are stored in the QueueList. - //------------------------------------------------------------------ uint32_t GetSize(); - //------------------------------------------------------------------ /// Get the Queue at a given index number /// /// \param [in] idx /// The index number (0-based) of the queue. /// \return /// The Queue at that index number. - //------------------------------------------------------------------ lldb::QueueSP GetQueueAtIndex(uint32_t idx); typedef std::vector<lldb::QueueSP> collection; @@ -58,29 +52,22 @@ public: std::mutex> QueueIterable; - //------------------------------------------------------------------ /// Iterate over the list of queues /// /// \return /// An Iterable object which can be used to loop over the queues /// that exist. - //------------------------------------------------------------------ QueueIterable Queues() { return QueueIterable(m_queues, m_mutex); } - //------------------------------------------------------------------ /// Clear out the list of queues from the QueueList - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Add a Queue to the QueueList /// /// \param [in] queue /// Used by the SystemRuntime to populate the QueueList - //------------------------------------------------------------------ void AddQueue(lldb::QueueSP queue); - //------------------------------------------------------------------ /// Find a queue in the QueueList by QueueID /// /// \param [in] qid @@ -89,10 +76,8 @@ public: /// \return /// A QueueSP to the queue requested, if it is present in the QueueList. /// An empty QueueSP will be returned if this queue was not found. - //------------------------------------------------------------------ lldb::QueueSP FindQueueByID(lldb::queue_id_t qid); - //------------------------------------------------------------------ /// Find a queue in the QueueList by IndexID /// /// \param [in] index_id @@ -104,15 +89,12 @@ public: /// \return /// A QueueSP to the queue requested, if it is present in the QueueList. /// An empty QueueSP will be returned if this queue was not found. - //------------------------------------------------------------------ lldb::QueueSP FindQueueByIndexID(uint32_t index_id); std::mutex &GetMutex(); protected: - //------------------------------------------------------------------ // Classes that inherit from Process can see and modify these - //------------------------------------------------------------------ Process *m_process; ///< The process that manages this queue list. uint32_t m_stop_id; ///< The process stop ID that this queue list is valid for. diff --git a/lldb/include/lldb/Target/RegisterContext.h b/lldb/include/lldb/Target/RegisterContext.h index 93ba724..d6212dd 100644 --- a/lldb/include/lldb/Target/RegisterContext.h +++ b/lldb/include/lldb/Target/RegisterContext.h @@ -17,18 +17,14 @@ namespace lldb_private { class RegisterContext : public std::enable_shared_from_this<RegisterContext>, public ExecutionContextScope { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContext(Thread &thread, uint32_t concrete_frame_idx); ~RegisterContext() override; void InvalidateIfNeeded(bool force); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ virtual void InvalidateAllRegisters() = 0; virtual size_t GetRegisterCount() = 0; @@ -75,7 +71,6 @@ public: bool CopyFromRegisterContext(lldb::RegisterContextSP context); - //------------------------------------------------------------------ /// Convert from a given register numbering scheme to the lldb register /// numbering scheme /// @@ -109,13 +104,10 @@ public: /// \return /// The equivalent register number in the eRegisterKindLLDB /// numbering scheme, if possible, else LLDB_INVALID_REGNUM. - //------------------------------------------------------------------ virtual uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) = 0; - //------------------------------------------------------------------ // Subclasses can override these functions if desired - //------------------------------------------------------------------ virtual uint32_t NumSupportedHardwareBreakpoints(); virtual uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size); @@ -141,9 +133,7 @@ public: lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value); - //------------------------------------------------------------------ // Subclasses should not override these - //------------------------------------------------------------------ virtual lldb::tid_t GetThreadID() const; virtual Thread &GetThread() { return m_thread; } @@ -188,9 +178,7 @@ public: lldb::RegisterKind target_rk, uint32_t &target_regnum); - //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions - //------------------------------------------------------------------ lldb::TargetSP CalculateTarget() override; lldb::ProcessSP CalculateProcess() override; @@ -206,17 +194,13 @@ public: void SetStopID(uint32_t stop_id) { m_stop_id = stop_id; } protected: - //------------------------------------------------------------------ // Classes that inherit from RegisterContext can see and modify these - //------------------------------------------------------------------ Thread &m_thread; // The thread that this register context belongs to. uint32_t m_concrete_frame_idx; // The concrete frame index for this register // context uint32_t m_stop_id; // The stop ID that any data in this context is valid for private: - //------------------------------------------------------------------ // For RegisterContext only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(RegisterContext); }; diff --git a/lldb/include/lldb/Target/RegisterNumber.h b/lldb/include/lldb/Target/RegisterNumber.h index 5574800..0bef0c1 100644 --- a/lldb/include/lldb/Target/RegisterNumber.h +++ b/lldb/include/lldb/Target/RegisterNumber.h @@ -12,11 +12,9 @@ #include "lldb/lldb-private.h" #include <map> -//-------------------------------------------------------------------- /// A class to represent register numbers, and able to convert between /// different register numbering schemes that may be used in a single /// debug session. -//-------------------------------------------------------------------- class RegisterNumber { public: diff --git a/lldb/include/lldb/Target/SectionLoadHistory.h b/lldb/include/lldb/Target/SectionLoadHistory.h index 1c4878a3..71b5d0c 100644 --- a/lldb/include/lldb/Target/SectionLoadHistory.h +++ b/lldb/include/lldb/Target/SectionLoadHistory.h @@ -23,9 +23,7 @@ public: // value. eStopIDNow = UINT32_MAX }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SectionLoadHistory() : m_stop_id_to_section_load_list(), m_mutex() {} ~SectionLoadHistory() { diff --git a/lldb/include/lldb/Target/SectionLoadList.h b/lldb/include/lldb/Target/SectionLoadList.h index a893247..caefa00 100644 --- a/lldb/include/lldb/Target/SectionLoadList.h +++ b/lldb/include/lldb/Target/SectionLoadList.h @@ -21,9 +21,7 @@ namespace lldb_private { class SectionLoadList { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SectionLoadList() : m_addr_to_sect(), m_sect_to_addr(), m_mutex() {} SectionLoadList(const SectionLoadList &rhs); diff --git a/lldb/include/lldb/Target/StackFrame.h b/lldb/include/lldb/Target/StackFrame.h index fcefb62..4e6e79b 100644 --- a/lldb/include/lldb/Target/StackFrame.h +++ b/lldb/include/lldb/Target/StackFrame.h @@ -63,7 +63,6 @@ public: Artificial }; - //------------------------------------------------------------------ /// Construct a StackFrame object without supplying a RegisterContextSP. /// /// This is the one constructor that doesn't take a RegisterContext @@ -106,7 +105,6 @@ public: /// Optionally seed the StackFrame with the SymbolContext information that /// has /// already been discovered. - //------------------------------------------------------------------ StackFrame(const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx, lldb::user_id_t concrete_frame_idx, lldb::addr_t cfa, bool cfa_is_valid, lldb::addr_t pc, Kind frame_kind, @@ -128,17 +126,14 @@ public: StackID &GetStackID(); - //------------------------------------------------------------------ /// Get an Address for the current pc value in this StackFrame. /// /// May not be the same as the actual PC value for inlined stack frames. /// /// \return /// The Address object set to the current PC value. - //------------------------------------------------------------------ const Address &GetFrameCodeAddress(); - //------------------------------------------------------------------ /// Change the pc value for a given thread. /// /// Change the current pc value for the frame on this thread. @@ -149,10 +144,8 @@ public: /// \return /// true if the pc was changed. false if this failed -- possibly /// because this frame is not a live StackFrame. - //------------------------------------------------------------------ bool ChangePC(lldb::addr_t pc); - //------------------------------------------------------------------ /// Provide a SymbolContext for this StackFrame's current pc value. /// /// The StackFrame maintains this SymbolContext and adds additional @@ -167,10 +160,8 @@ public: /// \return /// A SymbolContext reference which includes the types of information /// requested by resolve_scope, if they are available. - //------------------------------------------------------------------ const SymbolContext &GetSymbolContext(lldb::SymbolContextItem resolve_scope); - //------------------------------------------------------------------ /// Return the Canonical Frame Address (DWARF term) for this frame. /// /// The CFA is typically the value of the stack pointer register before the @@ -191,10 +182,8 @@ public: /// \return /// Returns true if the CFA value was successfully set in value. Some /// frames may be unable to provide this value; they will return false. - //------------------------------------------------------------------ bool GetFrameBaseValue(Scalar &value, Status *error_ptr); - //------------------------------------------------------------------ /// Get the DWARFExpression corresponding to the Canonical Frame Address. /// /// Often a register (bp), but sometimes a register + offset. @@ -205,10 +194,8 @@ public: /// /// \return /// Returns the corresponding DWARF expression, or NULL. - //------------------------------------------------------------------ DWARFExpression *GetFrameBaseExpression(Status *error_ptr); - //------------------------------------------------------------------ /// Get the current lexical scope block for this StackFrame, if possible. /// /// If debug information is available for this stack frame, return a pointer @@ -217,10 +204,8 @@ public: /// \return /// A pointer to the current Block. nullptr is returned if this can /// not be provided. - //------------------------------------------------------------------ Block *GetFrameBlock(); - //------------------------------------------------------------------ /// Get the RegisterContext for this frame, if possible. /// /// Returns a shared pointer to the RegisterContext for this stack frame. @@ -233,14 +218,12 @@ public: /// /// \return /// The RegisterContext shared point for this frame. - //------------------------------------------------------------------ lldb::RegisterContextSP GetRegisterContext(); const lldb::RegisterContextSP &GetRegisterContextSP() const { return m_reg_context_sp; } - //------------------------------------------------------------------ /// Retrieve the list of variables that are in scope at this StackFrame's /// pc. /// @@ -255,10 +238,8 @@ public: /// /// \return /// A pointer to a list of variables. - //------------------------------------------------------------------ VariableList *GetVariableList(bool get_file_globals); - //------------------------------------------------------------------ /// Retrieve the list of variables that are in scope at this StackFrame's /// pc. /// @@ -273,12 +254,10 @@ public: /// /// \return /// A pointer to a list of variables. - //------------------------------------------------------------------ lldb::VariableListSP GetInScopeVariableList(bool get_file_globals, bool must_have_valid_location = false); - //------------------------------------------------------------------ /// Create a ValueObject for a variable name / pathname, possibly including /// simple dereference/child selection syntax. /// @@ -304,30 +283,24 @@ public: /// /// \return /// A shared pointer to the ValueObject described by var_expr. - //------------------------------------------------------------------ lldb::ValueObjectSP GetValueForVariableExpressionPath( llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error); - //------------------------------------------------------------------ /// Determine whether this StackFrame has debug information available or not /// /// \return // true if debug information is available for this frame (function, // compilation unit, block, etc.) - //------------------------------------------------------------------ bool HasDebugInformation(); - //------------------------------------------------------------------ /// Return the disassembly for the instructions of this StackFrame's /// function as a single C string. /// /// \return // C string with the assembly instructions for this function. - //------------------------------------------------------------------ const char *Disassemble(); - //------------------------------------------------------------------ /// Print a description for this frame using the frame-format formatter /// settings. /// @@ -339,11 +312,9 @@ public: /// /// \param [in] frame_marker /// Optional string that will be prepended to the frame output description. - //------------------------------------------------------------------ void DumpUsingSettingsFormat(Stream *strm, bool show_unique = false, const char *frame_marker = nullptr); - //------------------------------------------------------------------ /// Print a description for this frame using a default format. /// /// \param [in] strm @@ -354,10 +325,8 @@ public: /// /// \param [in] show_fullpaths /// Whether to print the full source paths or just the file base name. - //------------------------------------------------------------------ void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths); - //------------------------------------------------------------------ /// Print a description of this stack frame and/or the source /// context/assembly for this stack frame. /// @@ -379,48 +348,36 @@ public: /// /// \return /// Returns true if successful. - //------------------------------------------------------------------ bool GetStatus(Stream &strm, bool show_frame_info, bool show_source, bool show_unique = false, const char *frame_marker = nullptr); - //------------------------------------------------------------------ /// Query whether this frame is a concrete frame on the call stack, or if it /// is an inlined frame derived from the debug information and presented by /// the debugger. /// /// \return /// true if this is an inlined frame. - //------------------------------------------------------------------ bool IsInlined(); - //------------------------------------------------------------------ /// Query whether this frame is part of a historical backtrace. - //------------------------------------------------------------------ bool IsHistorical() const; - //------------------------------------------------------------------ /// Query whether this frame is artificial (e.g a synthesized result of /// inferring missing tail call frames from a backtrace). Artificial frames /// may have limited support for inspecting variables. - //------------------------------------------------------------------ bool IsArtificial() const; - //------------------------------------------------------------------ /// Query this frame to find what frame it is in this Thread's /// StackFrameList. /// /// \return /// StackFrame index 0 indicates the currently-executing function. Inline /// frames are included in this frame index count. - //------------------------------------------------------------------ uint32_t GetFrameIndex() const; - //------------------------------------------------------------------ /// Set this frame's synthetic frame index. - //------------------------------------------------------------------ void SetFrameIndex(uint32_t index) { m_frame_index = index; } - //------------------------------------------------------------------ /// Query this frame to find what frame it is in this Thread's /// StackFrameList, not counting inlined frames. /// @@ -429,10 +386,8 @@ public: /// frames are not included in this frame index count; their concrete /// frame index will be the same as the concrete frame that they are /// derived from. - //------------------------------------------------------------------ uint32_t GetConcreteFrameIndex() const { return m_concrete_frame_index; } - //------------------------------------------------------------------ /// Create a ValueObject for a given Variable in this StackFrame. /// /// \params [in] variable_sp @@ -445,12 +400,10 @@ public: /// /// \return // A ValueObject for this variable. - //------------------------------------------------------------------ lldb::ValueObjectSP GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic); - //------------------------------------------------------------------ /// Add an arbitrary Variable object (e.g. one that specifics a global or /// static) to a StackFrame's list of ValueObjects. /// @@ -464,24 +417,20 @@ public: /// /// \return // A ValueObject for this variable. - //------------------------------------------------------------------ lldb::ValueObjectSP TrackGlobalVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic); - //------------------------------------------------------------------ /// Query this frame to determine what the default language should be when /// parsing expressions given the execution context. /// /// \return /// The language of the frame if known, else lldb::eLanguageTypeUnknown. - //------------------------------------------------------------------ lldb::LanguageType GetLanguage(); // similar to GetLanguage(), but is allowed to take a potentially incorrect // guess if exact information is not available lldb::LanguageType GuessLanguage(); - //------------------------------------------------------------------ /// Attempt to econstruct the ValueObject for a given raw address touched by /// the current instruction. The ExpressionPath should indicate how to get /// to this value using "frame variable." @@ -491,10 +440,8 @@ public: /// /// \return /// The ValueObject if found. If valid, it has a valid ExpressionPath. - //------------------------------------------------------------------ lldb::ValueObjectSP GuessValueForAddress(lldb::addr_t addr); - //------------------------------------------------------------------ /// Attempt to reconstruct the ValueObject for the address contained in a /// given register plus an offset. The ExpressionPath should indicate how /// to get to this value using "frame variable." @@ -507,11 +454,9 @@ public: /// /// \return /// The ValueObject if found. If valid, it has a valid ExpressionPath. - //------------------------------------------------------------------ lldb::ValueObjectSP GuessValueForRegisterAndOffset(ConstString reg, int64_t offset); - //------------------------------------------------------------------ /// Attempt to reconstruct the ValueObject for a variable with a given \a name /// from within the current StackFrame, within the current block. The search /// for the variable starts in the deepest block corresponding to the current @@ -523,12 +468,9 @@ public: /// /// \return /// The ValueObject if found. - //------------------------------------------------------------------ lldb::ValueObjectSP FindVariable(ConstString name); - //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions - //------------------------------------------------------------------ lldb::TargetSP CalculateTarget() override; lldb::ProcessSP CalculateProcess() override; @@ -553,9 +495,7 @@ protected: bool HasCachedData() const; private: - //------------------------------------------------------------------ // For StackFrame only - //------------------------------------------------------------------ lldb::ThreadWP m_thread_wp; uint32_t m_frame_index; uint32_t m_concrete_frame_index; diff --git a/lldb/include/lldb/Target/StackFrameList.h b/lldb/include/lldb/Target/StackFrameList.h index 696e76e..5eb7919 100644 --- a/lldb/include/lldb/Target/StackFrameList.h +++ b/lldb/include/lldb/Target/StackFrameList.h @@ -19,9 +19,7 @@ namespace lldb_private { class StackFrameList { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StackFrameList(Thread &thread, const lldb::StackFrameListSP &prev_frames_sp, bool show_inline_frames); diff --git a/lldb/include/lldb/Target/StackID.h b/lldb/include/lldb/Target/StackID.h index 950929d..a649a4f 100644 --- a/lldb/include/lldb/Target/StackID.h +++ b/lldb/include/lldb/Target/StackID.h @@ -16,9 +16,7 @@ namespace lldb_private { class StackID { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StackID() : m_pc(LLDB_INVALID_ADDRESS), m_cfa(LLDB_INVALID_ADDRESS), m_symbol_scope(nullptr) {} @@ -54,9 +52,7 @@ public: void Dump(Stream *s); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const StackID &operator=(const StackID &rhs) { if (this != &rhs) { m_pc = rhs.m_pc; diff --git a/lldb/include/lldb/Target/StopInfo.h b/lldb/include/lldb/Target/StopInfo.h index 811841d..59033b1 100644 --- a/lldb/include/lldb/Target/StopInfo.h +++ b/lldb/include/lldb/Target/StopInfo.h @@ -22,9 +22,7 @@ class StopInfo { friend class ThreadPlanBase; public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StopInfo(Thread &thread, uint64_t value); virtual ~StopInfo() {} @@ -156,9 +154,7 @@ protected: // to consult this later on. virtual bool ShouldStop(Event *event_ptr) { return true; } - //------------------------------------------------------------------ // Classes that inherit from StackID can see and modify these - //------------------------------------------------------------------ lldb::ThreadWP m_thread_wp; // The thread corresponding to the stop reason. uint32_t m_stop_id; // The process stop ID for which this stop info is valid uint32_t m_resume_id; // This is the resume ID when we made this stop ID. diff --git a/lldb/include/lldb/Target/StructuredDataPlugin.h b/lldb/include/lldb/Target/StructuredDataPlugin.h index 6d8bb93..1b36670 100644 --- a/lldb/include/lldb/Target/StructuredDataPlugin.h +++ b/lldb/include/lldb/Target/StructuredDataPlugin.h @@ -16,7 +16,6 @@ namespace lldb_private { class CommandObjectMultiword; -// ----------------------------------------------------------------------------- /// Plugin that supports process-related structured data sent asynchronously /// from the debug monitor (e.g. debugserver, lldb-server, etc.) /// @@ -37,7 +36,6 @@ class CommandObjectMultiword; /// and error streams such that the plugin can display something about the /// event, at a time when the debugger ensures it is safe to write to the /// output or error streams. -// ----------------------------------------------------------------------------- class StructuredDataPlugin : public PluginInterface, @@ -47,11 +45,8 @@ public: lldb::ProcessSP GetProcess() const; - // ------------------------------------------------------------------------- // Public instance API - // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- /// Return whether this plugin supports the given StructuredData feature. /// /// When Process is informed of a list of process-monitor-supported @@ -69,10 +64,8 @@ public: /// /// \return /// true if the plugin supports the feature; otherwise, false. - // ------------------------------------------------------------------------- virtual bool SupportsStructuredDataType(ConstString type_name) = 0; - // ------------------------------------------------------------------------- /// Handle the arrival of asynchronous structured data from the process. /// /// When asynchronous structured data arrives from the process monitor, @@ -98,12 +91,10 @@ public: /// be a dictionary. The only key required is the aforementioned /// key named "type" that must be a string value containing the /// structured data type name. - // ------------------------------------------------------------------------- virtual void HandleArrivalOfStructuredData(Process &process, ConstString type_name, const StructuredData::ObjectSP &object_sp) = 0; - // ------------------------------------------------------------------------- /// Get a human-readable description of the contents of the data. /// /// In command-line LLDB, this method will be called by the Debugger @@ -121,11 +112,9 @@ public: /// \return /// The error if formatting the object contents failed; otherwise, /// success. - // ------------------------------------------------------------------------- virtual Status GetDescription(const StructuredData::ObjectSP &object_sp, lldb_private::Stream &stream) = 0; - // ------------------------------------------------------------------------- /// Returns whether the plugin's features are enabled. /// /// This is a convenience method for plugins that can enable or disable @@ -135,10 +124,8 @@ public: /// \param[in] type_name /// The name of the feature tag for the asynchronous structured data. /// This is needed for plugins that support more than one feature. - // ------------------------------------------------------------------------- virtual bool GetEnabled(ConstString type_name) const; - // ------------------------------------------------------------------------- /// Allow the plugin to do work related to modules that loaded in the /// the corresponding process. /// @@ -154,16 +141,12 @@ public: /// \param[in] module_list /// The list of modules that the process registered as having just /// loaded. See \b Process::ModulesDidLoad(...). - // ------------------------------------------------------------------------- virtual void ModulesDidLoad(Process &process, ModuleList &module_list); protected: - // ------------------------------------------------------------------------- // Derived-class API - // ------------------------------------------------------------------------- StructuredDataPlugin(const lldb::ProcessWP &process_wp); - // ------------------------------------------------------------------------- /// Derived classes must call this before attempting to hook up commands /// to the 'plugin structured-data' tree. /// @@ -174,7 +157,6 @@ protected: /// \param[in] debugger /// The Debugger instance for which we're creating the required shared /// components for the StructuredDataPlugin derived classes. - // ------------------------------------------------------------------------- static void InitializeBasePluginForDebugger(Debugger &debugger); private: diff --git a/lldb/include/lldb/Target/SystemRuntime.h b/lldb/include/lldb/Target/SystemRuntime.h index cb2dbe2..b45f882 100644 --- a/lldb/include/lldb/Target/SystemRuntime.h +++ b/lldb/include/lldb/Target/SystemRuntime.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class SystemRuntime SystemRuntime.h "lldb/Target/SystemRuntime.h" /// A plug-in interface definition class for system runtimes. /// @@ -39,11 +38,9 @@ namespace lldb_private { /// collecting information. Later when it comes time to augment a Thread, it /// can be asked to provide that information. /// -//---------------------------------------------------------------------- class SystemRuntime : public PluginInterface { public: - //------------------------------------------------------------------ /// Find a system runtime plugin for a given process. /// /// Scans the installed SystemRuntime plugins and tries to find an instance @@ -52,55 +49,41 @@ public: /// \param[in] process /// The process for which to try and locate a system runtime /// plugin instance. - //------------------------------------------------------------------ static SystemRuntime *FindPlugin(Process *process); - //------------------------------------------------------------------ /// Construct with a process. - // ----------------------------------------------------------------- SystemRuntime(lldb_private::Process *process); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be inherited /// by the plug-in instance. - //------------------------------------------------------------------ ~SystemRuntime() override; - //------------------------------------------------------------------ /// Called after attaching to a process. /// /// Allow the SystemRuntime plugin to execute some code after attaching to a /// process. - //------------------------------------------------------------------ virtual void DidAttach(); - //------------------------------------------------------------------ /// Called after launching a process. /// /// Allow the SystemRuntime plugin to execute some code after launching a /// process. - //------------------------------------------------------------------ virtual void DidLaunch(); - //------------------------------------------------------------------ /// Called when modules have been loaded in the process. /// /// Allow the SystemRuntime plugin to enable logging features in the system /// runtime libraries. - //------------------------------------------------------------------ virtual void ModulesDidLoad(lldb_private::ModuleList &module_list); - //------------------------------------------------------------------ /// Called before detaching from a process. /// /// This will give a SystemRuntime plugin a chance to free any resources in /// the inferior process before we detach. - //------------------------------------------------------------------ virtual void Detach(); - //------------------------------------------------------------------ /// Return a list of thread origin extended backtraces that may be /// available. /// @@ -122,10 +105,8 @@ public: /// A vector of ConstStrings with names like "pthread" or "libdispatch". /// An empty vector may be returned if no thread origin extended /// backtrace capabilities are available. - //------------------------------------------------------------------ virtual const std::vector<ConstString> &GetExtendedBacktraceTypes(); - //------------------------------------------------------------------ /// Return a Thread which shows the origin of this thread's creation. /// /// This likely returns a HistoryThread which shows how thread was @@ -150,11 +131,9 @@ public: /// view thread and may be only useful for showing a backtrace. /// /// An empty ThreadSP will be returned if no thread origin is available. - //------------------------------------------------------------------ virtual lldb::ThreadSP GetExtendedBacktraceThread(lldb::ThreadSP thread, ConstString type); - //------------------------------------------------------------------ /// Get the extended backtrace thread for a QueueItem /// /// A QueueItem represents a function/block that will be executed on @@ -174,14 +153,12 @@ public: /// \return /// If an extended backtrace is available, it is returned. Else /// an empty ThreadSP is returned. - //------------------------------------------------------------------ virtual lldb::ThreadSP GetExtendedBacktraceForQueueItem(lldb::QueueItemSP queue_item_sp, ConstString type) { return lldb::ThreadSP(); } - //------------------------------------------------------------------ /// Populate the Process' QueueList with libdispatch / GCD queues that /// exist. /// @@ -192,10 +169,8 @@ public: /// This QueueList will be cleared, and any queues that currently exist /// will be added. An empty QueueList will be returned if no queues /// exist or if this Systemruntime does not support libdispatch queues. - //------------------------------------------------------------------ virtual void PopulateQueueList(lldb_private::QueueList &queue_list) {} - //------------------------------------------------------------------ /// Get the queue name for a thread given a thread's dispatch_qaddr. /// /// On systems using libdispatch queues, a thread may be associated with a @@ -210,13 +185,11 @@ public: /// \return /// The string of this queue's name. An empty string is returned if the /// name could not be found. - //------------------------------------------------------------------ virtual std::string GetQueueNameFromThreadQAddress(lldb::addr_t dispatch_qaddr) { return ""; } - //------------------------------------------------------------------ /// Get the QueueID for the libdispatch queue given the thread's /// dispatch_qaddr. /// @@ -231,13 +204,11 @@ public: /// /// \return /// The queue ID, or if it could not be retrieved, LLDB_INVALID_QUEUE_ID. - //------------------------------------------------------------------ virtual lldb::queue_id_t GetQueueIDFromThreadQAddress(lldb::addr_t dispatch_qaddr) { return LLDB_INVALID_QUEUE_ID; } - //------------------------------------------------------------------ /// Get the libdispatch_queue_t address for the queue given the thread's /// dispatch_qaddr. /// @@ -252,13 +223,11 @@ public: /// \return /// The libdispatch_queue_t address, or LLDB_INVALID_ADDRESS if /// unavailable/not found. - //------------------------------------------------------------------ virtual lldb::addr_t GetLibdispatchQueueAddressFromThreadQAddress(lldb::addr_t dispatch_qaddr) { return LLDB_INVALID_ADDRESS; } - //------------------------------------------------------------------ /// Retrieve the Queue kind for the queue at a thread's dispatch_qaddr. /// /// Retrieve the Queue kind - either eQueueKindSerial or @@ -267,12 +236,10 @@ public: /// /// \return /// The Queue kind, if it could be read, else eQueueKindUnknown. - //------------------------------------------------------------------ virtual lldb::QueueKind GetQueueKind(lldb::addr_t dispatch_qaddr) { return lldb::eQueueKindUnknown; } - //------------------------------------------------------------------ /// Get the pending work items for a libdispatch Queue /// /// If this system/process is using libdispatch and the runtime can do so, @@ -281,10 +248,8 @@ public: /// /// \param [in] queue /// The queue of interest. - //------------------------------------------------------------------ virtual void PopulatePendingItemsForQueue(lldb_private::Queue *queue) {} - //------------------------------------------------------------------ /// Complete the fields in a QueueItem /// /// PopulatePendingItemsForQueue() may not fill in all of the QueueItem @@ -297,11 +262,9 @@ public: /// \param [in] item_ref /// The item_ref token that is needed to retrieve the rest of the /// information about the QueueItem. - //------------------------------------------------------------------ virtual void CompleteQueueItem(lldb_private::QueueItem *queue_item, lldb::addr_t item_ref) {} - //------------------------------------------------------------------ /// Add key-value pairs to the StructuredData dictionary object with /// information debugserver may need when constructing the /// jThreadExtendedInfo packet. @@ -310,7 +273,6 @@ public: /// Dictionary to which key-value pairs should be added; they will /// be sent to the remote gdb server stub as arguments in the /// jThreadExtendedInfo request. - //------------------------------------------------------------------ virtual void AddThreadExtendedInfoPacketHints( lldb_private::StructuredData::ObjectSP dict) {} @@ -327,15 +289,12 @@ public: /// True will be returned if there are no known problems with running an /// expression on this thread. False means that the inferior function /// call should not be made on this thread. - //------------------------------------------------------------------ virtual bool SafeToCallFunctionsOnThisThread(lldb::ThreadSP thread_sp) { return true; } protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ Process *m_process; std::vector<ConstString> m_types; diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 530615a..d51a778 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -62,9 +62,7 @@ typedef enum LoadDependentFiles { eLoadDependentsNo, } LoadDependentFiles; -//---------------------------------------------------------------------- // TargetProperties -//---------------------------------------------------------------------- class TargetExperimentalProperties : public Properties { public: TargetExperimentalProperties(); @@ -208,9 +206,7 @@ public: bool GetRequireHardwareBreakpoints() const; private: - //------------------------------------------------------------------ // Callbacks for m_launch_info. - //------------------------------------------------------------------ static void Arg0ValueChangedCallback(void *target_property_ptr, OptionValue *); static void RunArgsValueChangedCallback(void *target_property_ptr, @@ -232,9 +228,7 @@ private: static void DisableSTDIOValueChangedCallback(void *target_property_ptr, OptionValue *); - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ ProcessLaunchInfo m_launch_info; std::unique_ptr<TargetExperimentalProperties> m_experimental_properties_up; }; @@ -423,9 +417,7 @@ private: mutable uint32_t m_pound_line_line; }; -//---------------------------------------------------------------------- // Target -//---------------------------------------------------------------------- class Target : public std::enable_shared_from_this<Target>, public TargetProperties, public Broadcaster, @@ -434,9 +426,7 @@ class Target : public std::enable_shared_from_this<Target>, public: friend class TargetList; - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitBreakpointChanged = (1 << 0), eBroadcastBitModulesLoaded = (1 << 1), @@ -505,7 +495,6 @@ public: static void SetDefaultArchitecture(const ArchSpec &arch); - //------------------------------------------------------------------ /// Find a binary on the system and return its Module, /// or return an existing Module that is already in the Target. /// @@ -537,14 +526,11 @@ public: /// An empty ModuleSP will be returned if no matching file /// was found. If error_ptr was non-nullptr, an error message /// will likely be provided. - //------------------------------------------------------------------ lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr = nullptr); - //---------------------------------------------------------------------- // Settings accessors - //---------------------------------------------------------------------- static const lldb::TargetPropertiesSP &GetGlobalProperties(); @@ -554,7 +540,6 @@ public: void CleanupProcess(); - //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the @@ -565,7 +550,6 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s, lldb::DescriptionLevel description_level); // If listener_sp is null, the listener of the owning Debugger object will be @@ -586,9 +570,7 @@ public: Status Attach(ProcessAttachInfo &attach_info, Stream *stream); // Optional stream to receive first stop info - //------------------------------------------------------------------ // This part handles the breakpoints. - //------------------------------------------------------------------ BreakpointList &GetBreakpointList(bool internal = false); @@ -787,7 +769,6 @@ public: std::vector<std::string> &names, BreakpointIDList &new_bps); - //------------------------------------------------------------------ /// Get \a load_addr as a callable code load address for this target /// /// Take \a load_addr and potentially add any address bits that are @@ -797,12 +778,10 @@ public: /// adjustment will always happen. If it is set to an address class /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be /// returned. - //------------------------------------------------------------------ lldb::addr_t GetCallableLoadAddress( lldb::addr_t load_addr, AddressClass addr_class = AddressClass::eInvalid) const; - //------------------------------------------------------------------ /// Get \a load_addr as an opcode for this target. /// /// Take \a load_addr and potentially strip any address bits that are @@ -813,7 +792,6 @@ public: /// adjustment will always happen. If it is set to an address class /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be /// returned. - //------------------------------------------------------------------ lldb::addr_t GetOpcodeLoadAddress(lldb::addr_t load_addr, AddressClass addr_class = AddressClass::eInvalid) const; @@ -833,7 +811,6 @@ public: void ClearModules(bool delete_locations); - //------------------------------------------------------------------ /// Called as the last function in Process::DidExec(). /// /// Process::DidExec() will clear a lot of state in the process, @@ -843,10 +820,8 @@ public: /// has been figured out. It can remove breakpoints that no longer /// make sense as the exec might have changed the target /// architecture, and unloaded some modules that might get deleted. - //------------------------------------------------------------------ void DidExec(); - //------------------------------------------------------------------ /// Gets the module for the main executable. /// /// Each process has a notion of a main executable that is the file @@ -862,12 +837,10 @@ public: /// \see DynamicLoader /// \see ObjectFile::GetDependentModules (FileSpecList&) /// \see Process::SetExecutableModule(lldb::ModuleSP&) - //------------------------------------------------------------------ lldb::ModuleSP GetExecutableModule(); Module *GetExecutableModulePointer(); - //------------------------------------------------------------------ /// Set the main executable module. /// /// Each process has a notion of a main executable that is the file @@ -893,7 +866,6 @@ public: /// /// \see ObjectFile::GetDependentModules (FileSpecList&) /// \see Process::GetImages() - //------------------------------------------------------------------ void SetExecutableModule( lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files = eLoadDependentsDefault); @@ -905,7 +877,6 @@ public: this, errors, feedback_stream, continue_on_error); } - //------------------------------------------------------------------ /// Get accessor for the images for this process. /// /// Each process has a notion of a main executable that is the file @@ -923,12 +894,10 @@ public: /// /// \return /// A list of Module objects in a module list. - //------------------------------------------------------------------ const ModuleList &GetImages() const { return m_images; } ModuleList &GetImages() { return m_images; } - //------------------------------------------------------------------ /// Return whether this FileSpec corresponds to a module that should be /// considered for general searches. /// @@ -944,10 +913,8 @@ public: /// A shared pointer reference to the module that checked. /// /// \return \b true if the module should be excluded, \b false otherwise. - //------------------------------------------------------------------ bool ModuleIsExcludedForUnconstrainedSearches(const FileSpec &module_spec); - //------------------------------------------------------------------ /// Return whether this module should be considered for general searches. /// /// This API will be consulted by the SearchFilterForUnconstrainedSearches @@ -966,13 +933,11 @@ public: /// A shared pointer reference to the module that checked. /// /// \return \b true if the module should be excluded, \b false otherwise. - //------------------------------------------------------------------ bool ModuleIsExcludedForUnconstrainedSearches(const lldb::ModuleSP &module_sp); const ArchSpec &GetArchitecture() const { return m_arch.GetSpec(); } - //------------------------------------------------------------------ /// Set the architecture for this target. /// /// If the current target has no Images read in, then this just sets the @@ -998,7 +963,6 @@ public: /// /// \return /// \b true if the architecture was successfully set, \bfalse otherwise. - //------------------------------------------------------------------ bool SetArchitecture(const ArchSpec &arch_spec, bool set_platform = false); bool MergeArchitecture(const ArchSpec &arch_spec); @@ -1050,9 +1014,7 @@ public: static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr, const SymbolContext *sc_ptr); - //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions - //------------------------------------------------------------------ lldb::TargetSP CalculateTarget() override; lldb::ProcessSP CalculateProcess() override; @@ -1109,10 +1071,8 @@ public: lldb::ClangASTImporterSP GetClangASTImporter(); - //---------------------------------------------------------------------- // Install any files through the platform that need be to installed prior to // launching or attaching. - //---------------------------------------------------------------------- Status Install(ProcessLaunchInfo *launch_info); bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr); @@ -1156,9 +1116,7 @@ public: lldb::addr_t GetPersistentSymbol(ConstString name); - //------------------------------------------------------------------ // Target Stop Hooks - //------------------------------------------------------------------ class StopHook : public UserID { public: StopHook(const StopHook &rhs); @@ -1261,9 +1219,7 @@ public: ClangModulesDeclVendor *GetClangModulesDeclVendor(); - //------------------------------------------------------------------ // Methods. - //------------------------------------------------------------------ lldb::SearchFilterSP GetSearchFilterForModule(const FileSpec *containingModule); @@ -1280,9 +1236,7 @@ public: void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp); protected: - //------------------------------------------------------------------ /// Implementing of ModuleList::Notifier. - //------------------------------------------------------------------ void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp) override; @@ -1310,9 +1264,7 @@ protected: ArchSpec m_spec; std::unique_ptr<Architecture> m_plugin_up; }; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ Debugger &m_debugger; lldb::PlatformSP m_platform_sp; ///< The platform for this target. std::recursive_mutex m_mutex; ///< An API mutex that is used by the lldb::SB* @@ -1356,9 +1308,7 @@ protected: static void ImageSearchPathsChanged(const PathMappingList &path_list, void *baton); - //------------------------------------------------------------------ // Utilities for `statistics` command. - //------------------------------------------------------------------ private: std::vector<uint32_t> m_stats_storage; bool m_collecting_stats = false; @@ -1379,7 +1329,6 @@ public: std::vector<uint32_t> GetStatistics() { return m_stats_storage; } private: - //------------------------------------------------------------------ /// Construct with optional file and arch. /// /// This member is private. Clients must use @@ -1387,7 +1336,6 @@ private: /// so all targets can be tracked from the central target list. /// /// \see TargetList::CreateTarget(const FileSpec*, const ArchSpec*) - //------------------------------------------------------------------ Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp, bool is_dummy_target); diff --git a/lldb/include/lldb/Target/TargetList.h b/lldb/include/lldb/Target/TargetList.h index af0f499..ece0705 100644 --- a/lldb/include/lldb/Target/TargetList.h +++ b/lldb/include/lldb/Target/TargetList.h @@ -21,7 +21,6 @@ class TargetList : public Broadcaster { private: friend class Debugger; - //------------------------------------------------------------------ /// Constructor /// /// The constructor for the target list is private. Clients can @@ -29,13 +28,10 @@ private: /// lldb_private::Debugger::GetSharedInstance().GetTargetList(). /// /// \see static TargetList& lldb_private::Debugger::GetTargetList(). - //------------------------------------------------------------------ TargetList(Debugger &debugger); public: - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitInterrupt = (1 << 0) }; // These two functions fill out the Broadcaster interface: @@ -48,7 +44,6 @@ public: ~TargetList() override; - //------------------------------------------------------------------ /// Create a new Target. /// /// Clients must use this function to create a Target. This allows @@ -85,25 +80,21 @@ public: /// /// \return /// An error object that indicates success or failure - //------------------------------------------------------------------ Status CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, llvm::StringRef triple_str, LoadDependentFiles get_dependent_modules, const OptionGroupPlatform *platform_options, lldb::TargetSP &target_sp); - //------------------------------------------------------------------ /// Create a new Target. /// /// Same as the function above, but used when you already know the /// platform you will be using - //------------------------------------------------------------------ Status CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, const ArchSpec &arch, LoadDependentFiles get_dependent_modules, lldb::PlatformSP &platform_sp, lldb::TargetSP &target_sp); - //------------------------------------------------------------------ /// Delete a Target object from the list. /// /// When clients are done with the Target objects, this function @@ -118,7 +109,6 @@ public: /// from this target list, \b false otherwise. The client will /// be left with the last remaining shared pointer to the target /// in \a target_sp which can then be properly released. - //------------------------------------------------------------------ bool DeleteTarget(lldb::TargetSP &target_sp); int GetNumTargets() const; @@ -127,7 +117,6 @@ public: uint32_t GetIndexOfTarget(lldb::TargetSP target_sp) const; - //------------------------------------------------------------------ /// Find the target that contains has an executable whose path /// matches \a exe_file_spec, and whose architecture matches /// \a arch_ptr if arch_ptr is not nullptr. @@ -149,12 +138,10 @@ public: /// pointer will contain nullptr if no target objects have a /// executable whose full or partial path matches /// with a matching process ID. - //------------------------------------------------------------------ lldb::TargetSP FindTargetWithExecutableAndArchitecture( const FileSpec &exe_file_spec, const ArchSpec *exe_arch_ptr = nullptr) const; - //------------------------------------------------------------------ /// Find the target that contains a process with process ID \a /// pid. /// @@ -165,14 +152,12 @@ public: /// A shared pointer to a target object. The returned shared /// pointer will contain nullptr if no target objects own a process /// with a matching process ID. - //------------------------------------------------------------------ lldb::TargetSP FindTargetWithProcessID(lldb::pid_t pid) const; lldb::TargetSP FindTargetWithProcess(lldb_private::Process *process) const; lldb::TargetSP GetTargetSP(Target *target) const; - //------------------------------------------------------------------ /// Send an async interrupt to one or all processes. /// /// Find the target that contains the process with process ID \a @@ -186,7 +171,6 @@ public: /// /// \return /// The number of async interrupts sent. - //------------------------------------------------------------------ uint32_t SendAsyncInterrupt(lldb::pid_t pid = LLDB_INVALID_PROCESS_ID); uint32_t SignalIfRunning(lldb::pid_t pid, int signo); @@ -197,9 +181,7 @@ public: protected: typedef std::vector<lldb::TargetSP> collection; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ collection m_target_list; lldb::TargetSP m_dummy_target_sp; mutable std::recursive_mutex m_target_list_mutex; diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h index e9b6281..bc99fe3 100644 --- a/lldb/include/lldb/Target/Thread.h +++ b/lldb/include/lldb/Target/Thread.h @@ -34,7 +34,6 @@ public: ~ThreadProperties() override; - //------------------------------------------------------------------ /// The regular expression returned determines symbols that this /// thread won't stop in during "step-in" operations. /// @@ -42,7 +41,6 @@ public: /// A pointer to a regular expression to compare against symbols, /// or nullptr if all symbols are allowed. /// - //------------------------------------------------------------------ const RegularExpression *GetSymbolsToAvoidRegexp(); FileSpecList &GetLibrariesToAvoid() const; @@ -64,9 +62,7 @@ class Thread : public std::enable_shared_from_this<Thread>, public ExecutionContextScope, public Broadcaster { public: - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitStackChanged = (1 << 0), eBroadcastBitThreadSuspended = (1 << 1), @@ -130,7 +126,6 @@ public: lldb::addr_t current_inlined_pc; }; - //------------------------------------------------------------------ /// Constructor /// /// \param [in] process @@ -146,7 +141,6 @@ public: /// to reuse the IndexID of that thread, or create a new one. If a /// client wants to know the original thread's IndexID, they should use /// Thread::GetExtendedBacktraceOriginatingIndexID(). - //------------------------------------------------------------------ Thread(Process &process, lldb::tid_t tid, bool use_invalid_index_id = false); ~Thread() override; @@ -167,7 +161,6 @@ public: void SetState(lldb::StateType state); - //------------------------------------------------------------------ /// Sets the USER resume state for this thread. If you set a thread to /// suspended with /// this API, it won't take part in any of the arbitration for ShouldResume, @@ -190,14 +183,12 @@ public: /// (e.g. in SBThread::Resume()), then pass true to override_suspend. /// \return /// The User resume state for this thread. - //------------------------------------------------------------------ void SetResumeState(lldb::StateType state, bool override_suspend = false) { if (m_resume_state == lldb::eStateSuspended && !override_suspend) return; m_resume_state = state; } - //------------------------------------------------------------------ /// Gets the USER resume state for this thread. This is not the same as what /// this thread is going to do for any particular step, however if this thread /// returns eStateSuspended, then the process control logic will never allow @@ -206,7 +197,6 @@ public: /// /// \return /// The User resume state for this thread. - //------------------------------------------------------------------ lldb::StateType GetResumeState() const { return m_resume_state; } // This function is called on all the threads before "ShouldResume" and @@ -266,7 +256,6 @@ public: virtual const char *GetInfo() { return nullptr; } - //------------------------------------------------------------------ /// Retrieve a dictionary of information about this thread /// /// On Mac OS X systems there may be voucher information. @@ -277,7 +266,6 @@ public: /// array /// being a dictionary (keys include "message" with the text of the trace /// message). - //------------------------------------------------------------------ StructuredData::ObjectSP GetExtendedInfo() { if (!m_extended_info_fetched) { m_extended_info = FetchThreadExtendedInfo(); @@ -290,7 +278,6 @@ public: virtual void SetName(const char *name) {} - //------------------------------------------------------------------ /// Whether this thread can be associated with a libdispatch queue /// /// The Thread may know if it is associated with a libdispatch queue, @@ -307,7 +294,6 @@ public: /// /// eLazyBoolCalculate this thread may be associated with a libdispatch /// queue but the thread doesn't know one way or the other. - //------------------------------------------------------------------ virtual lldb_private::LazyBool GetAssociatedWithLibdispatchQueue() { return eLazyBoolNo; } @@ -315,7 +301,6 @@ public: virtual void SetAssociatedWithLibdispatchQueue( lldb_private::LazyBool associated_with_libdispatch_queue) {} - //------------------------------------------------------------------ /// Retrieve the Queue ID for the queue currently using this Thread /// /// If this Thread is doing work on behalf of a libdispatch/GCD queue, @@ -329,12 +314,10 @@ public: /// \return /// A QueueID if the Thread subclass implements this, else /// LLDB_INVALID_QUEUE_ID. - //------------------------------------------------------------------ virtual lldb::queue_id_t GetQueueID() { return LLDB_INVALID_QUEUE_ID; } virtual void SetQueueID(lldb::queue_id_t new_val) {} - //------------------------------------------------------------------ /// Retrieve the Queue name for the queue currently using this Thread /// /// If this Thread is doing work on behalf of a libdispatch/GCD queue, @@ -343,12 +326,10 @@ public: /// \return /// The Queue name, if the Thread subclass implements this, else /// nullptr. - //------------------------------------------------------------------ virtual const char *GetQueueName() { return nullptr; } virtual void SetQueueName(const char *name) {} - //------------------------------------------------------------------ /// Retrieve the Queue kind for the queue currently using this Thread /// /// If this Thread is doing work on behalf of a libdispatch/GCD queue, @@ -359,12 +340,10 @@ public: /// \return /// The Queue kind, if the Thread subclass implements this, else /// eQueueKindUnknown. - //------------------------------------------------------------------ virtual lldb::QueueKind GetQueueKind() { return lldb::eQueueKindUnknown; } virtual void SetQueueKind(lldb::QueueKind kind) {} - //------------------------------------------------------------------ /// Retrieve the Queue for this thread, if any. /// /// \return @@ -373,10 +352,8 @@ public: /// An empty shared pointer indicates that this thread is not /// associated with a queue, or libdispatch queues are not /// supported on this target. - //------------------------------------------------------------------ virtual lldb::QueueSP GetQueue() { return lldb::QueueSP(); } - //------------------------------------------------------------------ /// Retrieve the address of the libdispatch_queue_t struct for queue /// currently using this Thread /// @@ -391,14 +368,12 @@ public: /// \return /// The Queue's libdispatch_queue_t address if the Thread subclass /// implements this, else LLDB_INVALID_ADDRESS. - //------------------------------------------------------------------ virtual lldb::addr_t GetQueueLibdispatchQueueAddress() { return LLDB_INVALID_ADDRESS; } virtual void SetQueueLibdispatchQueueAddress(lldb::addr_t dispatch_queue_t) {} - //------------------------------------------------------------------ /// Whether this Thread already has all the Queue information cached or not /// /// A Thread may be associated with a libdispatch work Queue at a given @@ -411,7 +386,6 @@ public: /// This method allows the SystemRuntime to discover if a thread has this /// information already, instead of calling the thread to get the information /// and having the thread call the SystemRuntime again. - //------------------------------------------------------------------ virtual bool ThreadHasQueueInformation() const { return false; } virtual uint32_t GetStackFrameCount() { @@ -499,7 +473,6 @@ public: bool GetDescription(Stream &s, lldb::DescriptionLevel level, bool print_json_thread, bool print_json_stopinfo); - //------------------------------------------------------------------ /// Default implementation for stepping into. /// /// This function is designed to be used by commands where the @@ -520,13 +493,11 @@ public: /// /// \return /// An error that describes anything that went wrong - //------------------------------------------------------------------ virtual Status StepIn(bool source_step, LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); - //------------------------------------------------------------------ /// Default implementation for stepping over. /// /// This function is designed to be used by commands where the @@ -538,12 +509,10 @@ public: /// /// \return /// An error that describes anything that went wrong - //------------------------------------------------------------------ virtual Status StepOver( bool source_step, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); - //------------------------------------------------------------------ /// Default implementation for stepping out. /// /// This function is designed to be used by commands where the @@ -551,10 +520,8 @@ public: /// /// \return /// An error that describes anything that went wrong - //------------------------------------------------------------------ virtual Status StepOut(); - //------------------------------------------------------------------ /// Retrieves the per-thread data area. /// Most OSs maintain a per-thread pointer (e.g. the FS register on /// x64), which we return the value of here. @@ -562,10 +529,8 @@ public: /// \return /// LLDB_INVALID_ADDRESS if not supported, otherwise the thread /// pointer value. - //------------------------------------------------------------------ virtual lldb::addr_t GetThreadPointer(); - //------------------------------------------------------------------ /// Retrieves the per-module TLS block for a thread. /// /// \param[in] module @@ -577,11 +542,9 @@ public: /// If the thread has TLS data allocated for the /// module, the address of the TLS block. Otherwise /// LLDB_INVALID_ADDRESS is returned. - //------------------------------------------------------------------ virtual lldb::addr_t GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr); - //------------------------------------------------------------------ /// Check whether this thread is safe to run functions /// /// The SystemRuntime may know of certain thread states (functions in @@ -591,10 +554,8 @@ public: /// \return /// True if it is safe to call functions on this thread. /// False if function calls should be avoided on this thread. - //------------------------------------------------------------------ virtual bool SafeToCallFunctions(); - //------------------------------------------------------------------ // Thread Plan Providers: // This section provides the basic thread plans that the Process control // machinery uses to run the target. ThreadPlan.h provides more details on @@ -617,9 +578,7 @@ public: // annoying to do because there's no elegant way to friend a method to all // sub-classes of a given class. // - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Queues the base plan for a thread. /// The version returned by Process does some things that are useful, /// like handle breakpoints and signals, so if you return a plugin specific @@ -634,10 +593,8 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueFundamentalPlan(bool abort_other_plans); - //------------------------------------------------------------------ /// Queues the plan used to step one instruction from the current PC of \a /// thread. /// @@ -658,12 +615,10 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForStepSingleInstruction( bool step_over, bool abort_other_plans, bool stop_other_threads, Status &status); - //------------------------------------------------------------------ /// Queues the plan used to step through an address range, stepping over /// function calls. /// @@ -702,7 +657,6 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange( bool abort_other_plans, const AddressRange &range, const SymbolContext &addr_context, lldb::RunMode stop_other_threads, @@ -718,7 +672,6 @@ public: Status &status, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); - //------------------------------------------------------------------ /// Queues the plan used to step through an address range, stepping into /// functions. /// @@ -766,7 +719,6 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange( bool abort_other_plans, const AddressRange &range, const SymbolContext &addr_context, const char *step_in_target, @@ -784,7 +736,6 @@ public: LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); - //------------------------------------------------------------------ /// Queue the plan used to step out of the function at the current PC of /// \a thread. /// @@ -823,14 +774,12 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut( bool abort_other_plans, SymbolContext *addr_context, bool first_insn, bool stop_other_threads, Vote stop_vote, Vote run_vote, uint32_t frame_idx, Status &status, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); - //------------------------------------------------------------------ /// Queue the plan used to step out of the function at the current PC of /// a thread. This version does not consult the should stop here callback, /// and should only @@ -887,13 +836,11 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop( bool abort_other_plans, SymbolContext *addr_context, bool first_insn, bool stop_other_threads, Vote stop_vote, Vote run_vote, uint32_t frame_idx, Status &status, bool continue_to_next_branch = false); - //------------------------------------------------------------------ /// Gets the plan used to step through the code that steps from a function /// call site at the current PC into the actual function call. /// @@ -916,13 +863,11 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForStepThrough(StackID &return_stack_id, bool abort_other_plans, bool stop_other_threads, Status &status); - //------------------------------------------------------------------ /// Gets the plan used to continue from the current PC. /// This is a simple plan, mostly useful as a backstop when you are continuing /// for some particular purpose. @@ -944,7 +889,6 @@ public: /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - //------------------------------------------------------------------ virtual lldb::ThreadPlanSP QueueThreadPlanForRunToAddress(bool abort_other_plans, Address &target_addr, bool stop_other_threads, Status &status); @@ -957,57 +901,44 @@ public: QueueThreadPlanForStepScripted(bool abort_other_plans, const char *class_name, bool stop_other_threads, Status &status); - //------------------------------------------------------------------ // Thread Plan accessors: - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Gets the plan which will execute next on the plan stack. /// /// \return /// A pointer to the next executed plan. - //------------------------------------------------------------------ ThreadPlan *GetCurrentPlan(); - //------------------------------------------------------------------ /// Unwinds the thread stack for the innermost expression plan currently /// on the thread plan stack. /// /// \return /// An error if the thread plan could not be unwound. - //------------------------------------------------------------------ Status UnwindInnermostExpression(); - //------------------------------------------------------------------ /// Gets the outer-most plan that was popped off the plan stack in the /// most recent stop. Useful for printing the stop reason accurately. /// /// \return /// A pointer to the last completed plan. - //------------------------------------------------------------------ lldb::ThreadPlanSP GetCompletedPlan(); - //------------------------------------------------------------------ /// Gets the outer-most return value from the completed plans /// /// \return /// A ValueObjectSP, either empty if there is no return value, /// or containing the return value. - //------------------------------------------------------------------ lldb::ValueObjectSP GetReturnValueObject(); - //------------------------------------------------------------------ /// Gets the outer-most expression variable from the completed plans /// /// \return /// A ExpressionVariableSP, either empty if there is no /// plan completed an expression during the current stop /// or the expression variable that was made for the completed expression. - //------------------------------------------------------------------ lldb::ExpressionVariableSP GetExpressionVariable(); - //------------------------------------------------------------------ /// Checks whether the given plan is in the completed plans for this /// stop. /// @@ -1017,10 +948,8 @@ public: /// \return /// Returns true if the input plan is in the completed plan stack, /// false otherwise. - //------------------------------------------------------------------ bool IsThreadPlanDone(ThreadPlan *plan); - //------------------------------------------------------------------ /// Checks whether the given plan is in the discarded plans for this /// stop. /// @@ -1030,19 +959,15 @@ public: /// \return /// Returns true if the input plan is in the discarded plan stack, /// false otherwise. - //------------------------------------------------------------------ bool WasThreadPlanDiscarded(ThreadPlan *plan); - //------------------------------------------------------------------ /// Check if we have completed plan to override breakpoint stop reason /// /// \return /// Returns true if completed plan stack is not empty /// false otherwise. - //------------------------------------------------------------------ bool CompletedPlanOverridesBreakpoint(); - //------------------------------------------------------------------ /// Queues a generic thread plan. /// /// \param[in] plan_sp @@ -1055,30 +980,24 @@ public: /// /// \return /// A pointer to the last completed plan. - //------------------------------------------------------------------ Status QueueThreadPlan(lldb::ThreadPlanSP &plan_sp, bool abort_other_plans); - //------------------------------------------------------------------ /// Discards the plans queued on the plan stack of the current thread. This /// is /// arbitrated by the "Master" ThreadPlans, using the "OkayToDiscard" call. // But if \a force is true, all thread plans are discarded. - //------------------------------------------------------------------ void DiscardThreadPlans(bool force); - //------------------------------------------------------------------ /// Discards the plans queued on the plan stack of the current thread up to /// and /// including up_to_plan_sp. // // \param[in] up_to_plan_sp // Discard all plans up to and including this one. - //------------------------------------------------------------------ void DiscardThreadPlansUpToPlan(lldb::ThreadPlanSP &up_to_plan_sp); void DiscardThreadPlansUpToPlan(ThreadPlan *up_to_plan_ptr); - //------------------------------------------------------------------ /// Discards the plans queued on the plan stack of the current thread up to /// and /// including the plan in that matches \a thread_index counting only @@ -1091,16 +1010,13 @@ public: /// \return /// \b true if there was a thread plan with that user index, \b false /// otherwise. - //------------------------------------------------------------------ bool DiscardUserThreadPlansUpToIndex(uint32_t thread_index); - //------------------------------------------------------------------ /// Prints the current plan stack. /// /// \param[in] s /// The stream to which to dump the plan stack info. /// - //------------------------------------------------------------------ void DumpThreadPlans( Stream *s, lldb::DescriptionLevel desc_level = lldb::eDescriptionLevelVerbose, @@ -1118,15 +1034,12 @@ public: void SetTracer(lldb::ThreadPlanTracerSP &tracer_sp); - //------------------------------------------------------------------ // Get the thread index ID. The index ID that is guaranteed to not be re-used // by a process. They start at 1 and increase with each new thread. This // allows easy command line access by a unique ID that is easier to type than // the actual system thread ID. - //------------------------------------------------------------------ uint32_t GetIndexID() const; - //------------------------------------------------------------------ // Get the originating thread's index ID. // In the case of an "extended" thread -- a thread which represents the stack // that enqueued/spawned work that is currently executing -- we need to @@ -1136,22 +1049,17 @@ public: // is iterating over extended threads may ask for the OriginatingThreadID to // display that information to the user. // Normal threads will return the same thing as GetIndexID(); - //------------------------------------------------------------------ virtual uint32_t GetExtendedBacktraceOriginatingIndexID() { return GetIndexID(); } - //------------------------------------------------------------------ // The API ID is often the same as the Thread::GetID(), but not in all cases. // Thread::GetID() is the user visible thread ID that clients would want to // see. The API thread ID is the thread ID that is used when sending data // to/from the debugging protocol. - //------------------------------------------------------------------ virtual lldb::user_id_t GetProtocolID() const { return GetID(); } - //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions - //------------------------------------------------------------------ lldb::TargetSP CalculateTarget() override; lldb::ProcessSP CalculateProcess() override; @@ -1194,7 +1102,6 @@ public: // with what you might have calculated. virtual lldb::StopInfoSP GetPrivateStopInfo(); - //---------------------------------------------------------------------- // Ask the thread subclass to set its stop info. // // Thread subclasses should call Thread::SetStopInfo(...) with the reason the @@ -1202,10 +1109,8 @@ public: // // \return // True if Thread::SetStopInfo(...) was called, false otherwise. - //---------------------------------------------------------------------- virtual bool CalculateStopInfo() = 0; - //---------------------------------------------------------------------- // Gets the temporary resume state for a thread. // // This value gets set in each thread by complex debugger logic in @@ -1219,7 +1124,6 @@ public: // is resumed // eStateSuspended - thread should not execute any instructions when // process is resumed - //---------------------------------------------------------------------- lldb::StateType GetTemporaryResumeState() const { return m_temporary_resume_state; } @@ -1230,17 +1134,14 @@ public: void SetShouldReportStop(Vote vote); - //---------------------------------------------------------------------- /// Sets the extended backtrace token for this thread /// /// Some Thread subclasses may maintain a token to help with providing /// an extended backtrace. The SystemRuntime plugin will set/request this. /// /// \param [in] token - //---------------------------------------------------------------------- virtual void SetExtendedBacktraceToken(uint64_t token) {} - //---------------------------------------------------------------------- /// Gets the extended backtrace token for this thread /// /// Some Thread subclasses may maintain a token to help with providing @@ -1249,7 +1150,6 @@ public: /// \return /// The token needed by the SystemRuntime to create an extended backtrace. /// LLDB_INVALID_ADDRESS is returned if no token is available. - //---------------------------------------------------------------------- virtual uint64_t GetExtendedBacktraceToken() { return LLDB_INVALID_ADDRESS; } lldb::ValueObjectSP GetCurrentException(); @@ -1305,9 +1205,7 @@ protected: void FunctionOptimizationWarning(lldb_private::StackFrame *frame); - //------------------------------------------------------------------ // Classes that inherit from Process can see and modify these - //------------------------------------------------------------------ lldb::ProcessWP m_process_wp; ///< The process that owns this thread. lldb::StopInfoSP m_stop_info_sp; ///< The private stop reason for this thread uint32_t m_stop_info_stop_id; // This is the stop id for which the StopInfo is diff --git a/lldb/include/lldb/Target/ThreadList.h b/lldb/include/lldb/Target/ThreadList.h index 6db6d65..dcbd9aa 100644 --- a/lldb/include/lldb/Target/ThreadList.h +++ b/lldb/include/lldb/Target/ThreadList.h @@ -110,7 +110,6 @@ public: void RefreshStateAfterStop(); - //------------------------------------------------------------------ /// The thread list asks tells all the threads it is about to resume. /// If a thread can "resume" without having to resume the target, it /// will return false for WillResume, and then the process will not be @@ -122,7 +121,6 @@ public: /// the process will not actually run. The thread must then return /// the correct StopInfo when asked. /// - //------------------------------------------------------------------ bool WillResume(); void DidResume(); @@ -144,9 +142,7 @@ protected: void NotifySelectedThreadChanged(lldb::tid_t tid); - //------------------------------------------------------------------ // Classes that inherit from Process can see and modify these - //------------------------------------------------------------------ Process *m_process; ///< The process that manages this thread list. uint32_t m_stop_id; ///< The process stop ID that this thread list is valid for. diff --git a/lldb/include/lldb/Target/ThreadPlan.h b/lldb/include/lldb/Target/ThreadPlan.h index a37d7ec..dd6766b 100644 --- a/lldb/include/lldb/Target/ThreadPlan.h +++ b/lldb/include/lldb/Target/ThreadPlan.h @@ -22,7 +22,6 @@ namespace lldb_private { -//------------------------------------------------------------------ // ThreadPlan: // This is the pure virtual base class for thread plans. // @@ -328,7 +327,6 @@ namespace lldb_private { // for a plan to instruct a sub-plan // on how to respond to ShouldReportStop. // -//------------------------------------------------------------------ class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>, public UserID { @@ -355,28 +353,22 @@ public: } ThreadPlanKind; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, Vote stop_vote, Vote run_vote); virtual ~ThreadPlan(); - //------------------------------------------------------------------ /// Returns the name of this thread plan. /// /// \return /// A const char * pointer to the thread plan's name. - //------------------------------------------------------------------ const char *GetName() const { return m_name.c_str(); } - //------------------------------------------------------------------ /// Returns the Thread that is using this thread plan. /// /// \return /// A pointer to the thread plan's owning thread. - //------------------------------------------------------------------ Thread &GetThread() { return m_thread; } const Thread &GetThread() const { return m_thread; } @@ -385,7 +377,6 @@ public: const Target &GetTarget() const { return m_thread.GetProcess()->GetTarget(); } - //------------------------------------------------------------------ /// Print a description of this thread to the stream \a s. /// \a thread. /// @@ -395,10 +386,8 @@ public: /// \param[in] level /// The level of description desired. Note that eDescriptionLevelBrief /// will be used in the stop message printed when the plan is complete. - //------------------------------------------------------------------ virtual void GetDescription(Stream *s, lldb::DescriptionLevel level) = 0; - //------------------------------------------------------------------ /// Returns whether this plan could be successfully created. /// /// \param[in] error @@ -408,7 +397,6 @@ public: /// /// \return /// \b true if the plan should be queued, \b false otherwise. - //------------------------------------------------------------------ virtual bool ValidatePlan(Stream *error) = 0; bool TracerExplainsStop() { @@ -556,9 +544,7 @@ public: } protected: - //------------------------------------------------------------------ // Classes that inherit from ThreadPlan can see and modify these - //------------------------------------------------------------------ virtual bool DoWillResume(lldb::StateType resume_state, bool current_plan) { return true; @@ -604,9 +590,7 @@ protected: int32_t m_iteration_count = 1; private: - //------------------------------------------------------------------ // For ThreadPlan only - //------------------------------------------------------------------ static lldb::user_id_t GetNextID(); ThreadPlanKind m_kind; @@ -625,13 +609,11 @@ private: DISALLOW_COPY_AND_ASSIGN(ThreadPlan); }; -//---------------------------------------------------------------------- // ThreadPlanNull: // Threads are assumed to always have at least one plan on the plan stack. This // is put on the plan stack when a thread is destroyed so that if you // accidentally access a thread after it is destroyed you won't crash. But // asking questions of the ThreadPlanNull is definitely an error. -//---------------------------------------------------------------------- class ThreadPlanNull : public ThreadPlan { public: diff --git a/lldb/include/lldb/Target/ThreadPlanBase.h b/lldb/include/lldb/Target/ThreadPlanBase.h index f428856..bc92a06 100644 --- a/lldb/include/lldb/Target/ThreadPlanBase.h +++ b/lldb/include/lldb/Target/ThreadPlanBase.h @@ -15,12 +15,10 @@ namespace lldb_private { -//------------------------------------------------------------------ // Base thread plans: // This is the generic version of the bottom most plan on the plan stack. It // should // be able to handle generic breakpoint hitting, and signals and exceptions. -//------------------------------------------------------------------ class ThreadPlanBase : public ThreadPlan { friend class Process; // RunThreadPlan manages "stopper" base plans. diff --git a/lldb/include/lldb/Target/ThreadPlanCallOnFunctionExit.h b/lldb/include/lldb/Target/ThreadPlanCallOnFunctionExit.h index 00bdda0b..ad3ee6e 100644 --- a/lldb/include/lldb/Target/ThreadPlanCallOnFunctionExit.h +++ b/lldb/include/lldb/Target/ThreadPlanCallOnFunctionExit.h @@ -29,9 +29,7 @@ public: void DidPush() override; - // ------------------------------------------------------------------------- // ThreadPlan API - // ------------------------------------------------------------------------- void GetDescription(Stream *s, lldb::DescriptionLevel level) override; diff --git a/lldb/include/lldb/Target/ThreadPlanPython.h b/lldb/include/lldb/Target/ThreadPlanPython.h index 0e253e3..3825bf6 100644 --- a/lldb/include/lldb/Target/ThreadPlanPython.h +++ b/lldb/include/lldb/Target/ThreadPlanPython.h @@ -24,10 +24,8 @@ namespace lldb_private { -//------------------------------------------------------------------ // ThreadPlanPython: // -//------------------------------------------------------------------ class ThreadPlanPython : public ThreadPlan { public: diff --git a/lldb/include/lldb/Target/ThreadPlanShouldStopHere.h b/lldb/include/lldb/Target/ThreadPlanShouldStopHere.h index 1602736..dfcbbb3 100644 --- a/lldb/include/lldb/Target/ThreadPlanShouldStopHere.h +++ b/lldb/include/lldb/Target/ThreadPlanShouldStopHere.h @@ -62,9 +62,7 @@ public: eStepOutAvoidNoDebug = (1 << 2) }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ThreadPlanShouldStopHere(ThreadPlan *owner); ThreadPlanShouldStopHere(ThreadPlan *owner, diff --git a/lldb/include/lldb/Target/UnixSignals.h b/lldb/include/lldb/Target/UnixSignals.h index 682f7d21..120ffdd 100644 --- a/lldb/include/lldb/Target/UnixSignals.h +++ b/lldb/include/lldb/Target/UnixSignals.h @@ -24,9 +24,7 @@ public: static lldb::UnixSignalsSP Create(const ArchSpec &arch); static lldb::UnixSignalsSP CreateForHost(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ UnixSignals(); virtual ~UnixSignals(); @@ -95,9 +93,7 @@ public: llvm::Optional<bool> should_notify); protected: - //------------------------------------------------------------------ // Classes that inherit from UnixSignals can see and modify these - //------------------------------------------------------------------ struct Signal { ConstString m_name; diff --git a/lldb/include/lldb/Target/Unwind.h b/lldb/include/lldb/Target/Unwind.h index 0433022..a648e06 100644 --- a/lldb/include/lldb/Target/Unwind.h +++ b/lldb/include/lldb/Target/Unwind.h @@ -17,9 +17,7 @@ namespace lldb_private { class Unwind { protected: - //------------------------------------------------------------------ // Classes that inherit from Unwind can see and modify these - //------------------------------------------------------------------ Unwind(Thread &thread) : m_thread(thread), m_unwind_mutex() {} public: @@ -62,9 +60,7 @@ public: Thread &GetThread() { return m_thread; } protected: - //------------------------------------------------------------------ // Classes that inherit from Unwind can see and modify these - //------------------------------------------------------------------ virtual void DoClear() = 0; virtual uint32_t DoGetFrameCount() = 0; diff --git a/lldb/include/lldb/Utility/ArchSpec.h b/lldb/include/lldb/Utility/ArchSpec.h index 38c43e2..7a32556 100644 --- a/lldb/include/lldb/Utility/ArchSpec.h +++ b/lldb/include/lldb/Utility/ArchSpec.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ArchSpec ArchSpec.h "lldb/Utility/ArchSpec.h" An architecture /// specification class. /// @@ -30,7 +29,6 @@ namespace lldb_private { /// string representation, or an llvm::Triple. Keeping all of the conversions /// of strings to architecture enumeration values confined to this class /// allows new architecture support to be added easily. -//---------------------------------------------------------------------- class ArchSpec { public: enum MIPSSubType { @@ -235,131 +233,99 @@ public: }; - //------------------------------------------------------------------ /// Default constructor. /// /// Default constructor that initializes the object with invalid cpu type /// and subtype values. - //------------------------------------------------------------------ ArchSpec(); - //------------------------------------------------------------------ /// Constructor over triple. /// /// Constructs an ArchSpec with properties consistent with the given Triple. - //------------------------------------------------------------------ explicit ArchSpec(const llvm::Triple &triple); explicit ArchSpec(const char *triple_cstr); explicit ArchSpec(llvm::StringRef triple_str); - //------------------------------------------------------------------ /// Constructor over architecture name. /// /// Constructs an ArchSpec with properties consistent with the given object /// type and architecture name. - //------------------------------------------------------------------ explicit ArchSpec(ArchitectureType arch_type, uint32_t cpu_type, uint32_t cpu_subtype); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~ArchSpec(); - //------------------------------------------------------------------ /// Assignment operator. /// /// \param[in] rhs another ArchSpec object to copy. /// /// \return A const reference to this object. - //------------------------------------------------------------------ const ArchSpec &operator=(const ArchSpec &rhs); - //--------------------------------------------------------------------------- /// Returns true if the OS, vendor and environment fields of the triple are /// unset. The triple is expected to be normalized /// (llvm::Triple::normalize). - //--------------------------------------------------------------------------- static bool ContainsOnlyArch(const llvm::Triple &normalized_triple); static void ListSupportedArchNames(StringList &list); static size_t AutoComplete(CompletionRequest &request); - //------------------------------------------------------------------ /// Returns a static string representing the current architecture. /// /// \return A static string corresponding to the current /// architecture. - //------------------------------------------------------------------ const char *GetArchitectureName() const; - //----------------------------------------------------------------- /// if MIPS architecture return true. /// /// \return a boolean value. - //----------------------------------------------------------------- bool IsMIPS() const; - //------------------------------------------------------------------ /// Returns a string representing current architecture as a target CPU for /// tools like compiler, disassembler etc. /// /// \return A string representing target CPU for the current /// architecture. - //------------------------------------------------------------------ std::string GetClangTargetCPU() const; - //------------------------------------------------------------------ /// Return a string representing target application ABI. /// /// \return A string representing target application ABI. - //------------------------------------------------------------------ std::string GetTargetABI() const; - //------------------------------------------------------------------ /// Clears the object state. /// /// Clears the object state back to a default invalid state. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Returns the size in bytes of an address of the current architecture. /// /// \return The byte size of an address of the current architecture. - //------------------------------------------------------------------ uint32_t GetAddressByteSize() const; - //------------------------------------------------------------------ /// Returns a machine family for the current architecture. /// /// \return An LLVM arch type. - //------------------------------------------------------------------ llvm::Triple::ArchType GetMachine() const; - //------------------------------------------------------------------ /// Returns the distribution id of the architecture. /// /// This will be something like "ubuntu", "fedora", etc. on Linux. /// /// \return A ConstString ref containing the distribution id, /// potentially empty. - //------------------------------------------------------------------ ConstString GetDistributionId() const; - //------------------------------------------------------------------ /// Set the distribution id of the architecture. /// /// This will be something like "ubuntu", "fedora", etc. on Linux. This /// should be the same value returned by HostInfo::GetDistributionId (). - ///------------------------------------------------------------------ void SetDistributionId(const char *distribution_id); - //------------------------------------------------------------------ /// Tests if this ArchSpec is valid. /// /// \return True if the current architecture is valid, false /// otherwise. - //------------------------------------------------------------------ bool IsValid() const { return m_core >= eCore_arm_generic && m_core < kNumCores; } @@ -375,7 +341,6 @@ public: return m_triple.hasEnvironment(); } - //------------------------------------------------------------------ /// Merges fields from another ArchSpec into this ArchSpec. /// /// This will use the supplied ArchSpec to fill in any fields of the triple @@ -385,10 +350,8 @@ public: /// have a triple which is x64-pc-windows-msvc, then merging that triple /// into this one will result in the triple i386-pc-windows-msvc. /// - //------------------------------------------------------------------ void MergeFrom(const ArchSpec &other); - //------------------------------------------------------------------ /// Change the architecture object type, CPU type and OS type. /// /// \param[in] arch_type The object type of this ArchSpec. @@ -423,26 +386,21 @@ public: /// *-*-netbsd /// *-*-openbsd /// *-*-solaris - //------------------------------------------------------------------ bool SetArchitecture(ArchitectureType arch_type, uint32_t cpu, uint32_t sub, uint32_t os = 0); - //------------------------------------------------------------------ /// Returns the byte order for the architecture specification. /// /// \return The endian enumeration for the current endianness of /// the architecture specification - //------------------------------------------------------------------ lldb::ByteOrder GetByteOrder() const; - //------------------------------------------------------------------ /// Sets this ArchSpec's byte order. /// /// In the common case there is no need to call this method as the byte /// order can almost always be determined by the architecture. However, many /// CPU's are bi-endian (ARM, Alpha, PowerPC, etc) and the default/assumed /// byte order may be incorrect. - //------------------------------------------------------------------ void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; } uint32_t GetMinimumOpcodeByteSize() const; @@ -455,39 +413,30 @@ public: uint32_t GetMachOCPUSubType() const; - //------------------------------------------------------------------ /// Architecture data byte width accessor /// /// \return the size in 8-bit (host) bytes of a minimum addressable unit /// from the Architecture's data bus - //------------------------------------------------------------------ uint32_t GetDataByteSize() const; - //------------------------------------------------------------------ /// Architecture code byte width accessor /// /// \return the size in 8-bit (host) bytes of a minimum addressable unit /// from the Architecture's code bus - //------------------------------------------------------------------ uint32_t GetCodeByteSize() const; - //------------------------------------------------------------------ /// Architecture triple accessor. /// /// \return A triple describing this ArchSpec. - //------------------------------------------------------------------ llvm::Triple &GetTriple() { return m_triple; } - //------------------------------------------------------------------ /// Architecture triple accessor. /// /// \return A triple describing this ArchSpec. - //------------------------------------------------------------------ const llvm::Triple &GetTriple() const { return m_triple; } void DumpTriple(Stream &s) const; - //------------------------------------------------------------------ /// Architecture triple setter. /// /// Configures this ArchSpec according to the given triple. If the triple @@ -498,44 +447,35 @@ public: /// etc. /// /// \return A triple describing this ArchSpec. - //------------------------------------------------------------------ bool SetTriple(const llvm::Triple &triple); bool SetTriple(llvm::StringRef triple_str); - //------------------------------------------------------------------ /// Returns the default endianness of the architecture. /// /// \return The endian enumeration for the default endianness of /// the architecture. - //------------------------------------------------------------------ lldb::ByteOrder GetDefaultEndian() const; - //------------------------------------------------------------------ /// Returns true if 'char' is a signed type by default 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. - //------------------------------------------------------------------ bool IsExactMatch(const ArchSpec &rhs) const; - //------------------------------------------------------------------ /// Compare an ArchSpec to another ArchSpec, requiring a compatible cpu type /// match between them. e.g. armv7s is compatible with armv7 - this method /// would return true /// /// \return true if the two ArchSpecs are compatible - //------------------------------------------------------------------ bool IsCompatibleMatch(const ArchSpec &rhs) const; bool IsFullySpecifiedTriple() const; @@ -545,7 +485,6 @@ public: bool &os_version_different, bool &env_different) const; - //------------------------------------------------------------------ /// Detect whether this architecture uses thumb code exclusively /// /// Some embedded ARM chips (e.g. the ARM Cortex M0-7 line) can only execute @@ -557,7 +496,6 @@ public: /// /// \return true if this is an arm ArchSpec which can only execute Thumb /// instructions - //------------------------------------------------------------------ bool IsAlwaysThumbInstructions() const; uint32_t GetFlags() const { return m_flags; } @@ -585,7 +523,6 @@ protected: void CoreUpdated(bool update_triple); }; -//------------------------------------------------------------------ /// \fn bool operator< (const ArchSpec& lhs, const ArchSpec& rhs) Less than /// operator. /// @@ -595,7 +532,6 @@ protected: /// rhs The Left Hand Side ArchSpec object to compare. /// /// \return true if \a lhs is less than \a rhs -//------------------------------------------------------------------ bool operator<(const ArchSpec &lhs, const ArchSpec &rhs); bool operator==(const ArchSpec &lhs, const ArchSpec &rhs); diff --git a/lldb/include/lldb/Utility/Args.h b/lldb/include/lldb/Utility/Args.h index 6dcdbee..f46ef97 100644 --- a/lldb/include/lldb/Utility/Args.h +++ b/lldb/include/lldb/Utility/Args.h @@ -20,7 +20,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Args Args.h "lldb/Utility/Args.h" /// A command line argument class. /// @@ -30,7 +29,6 @@ namespace lldb_private { /// quotes) surrounding the argument. Spaces can be escaped using a \ /// character to avoid having to surround an argument that contains a space /// with quotes. -//---------------------------------------------------------------------- class Args { public: struct ArgEntry { @@ -48,13 +46,10 @@ public: char quote; const char *c_str() const { return ptr.get(); } - //------------------------------------------------------------------ /// Returns true if this argument was quoted in any way. - //------------------------------------------------------------------ bool IsQuoted() const { return quote != '\0'; } }; - //------------------------------------------------------------------ /// Construct with an option command string. /// /// \param[in] command @@ -62,7 +57,6 @@ public: /// into arguments. /// /// \see Args::SetCommandString(llvm::StringRef) - //------------------------------------------------------------------ Args(llvm::StringRef command = llvm::StringRef()); Args(const Args &rhs); @@ -70,9 +64,7 @@ public: Args &operator=(const Args &rhs); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~Args(); explicit Args(const Environment &env) : Args() { @@ -81,7 +73,6 @@ public: explicit operator Environment() const { return GetConstArgumentVector(); } - //------------------------------------------------------------------ /// Dump all entries to the stream \a s using label \a label_name. /// /// If label_name is nullptr, the dump operation is skipped. @@ -93,10 +84,8 @@ public: /// The label_name to use as the label printed for each /// entry of the args like so: /// {label_name}[{index}]={value} - //------------------------------------------------------------------ void Dump(Stream &s, const char *label_name = "argv") const; - //------------------------------------------------------------------ /// Sets the command string contained by this object. /// /// The command string will be copied and split up into arguments that can @@ -110,30 +99,25 @@ public: /// \see Args::GetArgumentAtIndex (size_t) const @see /// Args::GetArgumentVector () \see Args::Shift () \see Args::Unshift (const /// char *) - //------------------------------------------------------------------ void SetCommandString(llvm::StringRef command); bool GetCommandString(std::string &command) const; bool GetQuotedCommandString(std::string &command) const; - //------------------------------------------------------------------ /// Gets the number of arguments left in this command object. /// /// \return /// The number or arguments in this object. - //------------------------------------------------------------------ size_t GetArgumentCount() const; bool empty() const { return GetArgumentCount() == 0; } - //------------------------------------------------------------------ /// Gets the NULL terminated C string argument pointer for the argument at /// index \a idx. /// /// \return /// The NULL terminated C string argument pointer if \a idx is a /// valid argument index, NULL otherwise. - //------------------------------------------------------------------ const char *GetArgumentAtIndex(size_t idx) const; llvm::ArrayRef<ArgEntry> entries() const { return m_entries; } @@ -147,7 +131,6 @@ public: size_t size() const { return GetArgumentCount(); } const ArgEntry &operator[](size_t n) const { return m_entries[n]; } - //------------------------------------------------------------------ /// Gets the argument vector. /// /// The value returned by this function can be used by any function that @@ -160,10 +143,8 @@ public: /// \return /// An array of NULL terminated C string argument pointers that /// also has a terminating NULL C string pointer - //------------------------------------------------------------------ char **GetArgumentVector(); - //------------------------------------------------------------------ /// Gets the argument vector. /// /// The value returned by this function can be used by any function that @@ -176,19 +157,15 @@ public: /// \return /// An array of NULL terminate C string argument pointers that /// also has a terminating NULL C string pointer - //------------------------------------------------------------------ const char **GetConstArgumentVector() const; - //------------------------------------------------------------------ /// Gets the argument as an ArrayRef. Note that the return value does *not* /// have a nullptr const char * at the end, as the size of the list is /// embedded in the ArrayRef object. - //------------------------------------------------------------------ llvm::ArrayRef<const char *> GetArgumentArrayRef() const { return llvm::makeArrayRef(m_argv).drop_back(); } - //------------------------------------------------------------------ /// Appends a new argument to the end of the list argument list. /// /// \param[in] arg_cstr @@ -196,14 +173,12 @@ public: /// /// \param[in] quote_char /// If the argument was originally quoted, put in the quote char here. - //------------------------------------------------------------------ void AppendArgument(llvm::StringRef arg_str, char quote_char = '\0'); void AppendArguments(const Args &rhs); void AppendArguments(const char **argv); - //------------------------------------------------------------------ /// Insert the argument value at index \a idx to \a arg_cstr. /// /// \param[in] idx @@ -217,11 +192,9 @@ public: /// /// \return /// The NULL terminated C string of the copy of \a arg_cstr. - //------------------------------------------------------------------ void InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char = '\0'); - //------------------------------------------------------------------ /// Replaces the argument value at index \a idx to \a arg_cstr if \a idx is /// a valid argument index. /// @@ -233,21 +206,17 @@ public: /// /// \param[in] quote_char /// If the argument was originally quoted, put in the quote char here. - //------------------------------------------------------------------ void ReplaceArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char = '\0'); - //------------------------------------------------------------------ /// Deletes the argument value at index /// if \a idx is a valid argument index. /// /// \param[in] idx /// The index of the argument that will have its value replaced. /// - //------------------------------------------------------------------ void DeleteArgumentAtIndex(size_t idx); - //------------------------------------------------------------------ /// Sets the argument vector value, optionally copying all arguments into an /// internal buffer. /// @@ -255,12 +224,10 @@ public: /// will be copied into an internal buffers. // // FIXME: Handle the quote character somehow. - //------------------------------------------------------------------ void SetArguments(size_t argc, const char **argv); void SetArguments(const char **argv); - //------------------------------------------------------------------ /// Shifts the first argument C string value of the array off the argument /// array. /// @@ -269,10 +236,8 @@ public: /// returned value before calling Args::Shift(). /// /// \see Args::GetArgumentAtIndex (size_t) const - //------------------------------------------------------------------ void Shift(); - //------------------------------------------------------------------ /// Inserts a class owned copy of \a arg_cstr at the beginning of the /// argument vector. /// @@ -283,14 +248,11 @@ public: /// /// \param[in] quote_char /// If the argument was originally quoted, put in the quote char here. - //------------------------------------------------------------------ void Unshift(llvm::StringRef arg_str, char quote_char = '\0'); - //------------------------------------------------------------------ // Clear the arguments. // // For re-setting or blanking out the list of arguments. - //------------------------------------------------------------------ void Clear(); static const char *StripSpaces(std::string &s, bool leading = true, @@ -357,7 +319,6 @@ private: std::vector<char *> m_argv; }; -//---------------------------------------------------------------------- /// \class OptionsWithRaw Args.h "lldb/Utility/Args.h" /// A pair of an option list with a 'raw' string as a suffix. /// @@ -377,70 +338,55 @@ private: /// string without any options. /// /// \see Args -//---------------------------------------------------------------------- class OptionsWithRaw { public: - //------------------------------------------------------------------ /// Parse the given string as a list of optional arguments with a raw suffix. /// /// See the class description for a description of the input format. /// /// \param[in] argument_string /// The string that should be parsed. - //------------------------------------------------------------------ explicit OptionsWithRaw(llvm::StringRef argument_string); - //------------------------------------------------------------------ /// Returns true if there are any arguments before the raw suffix. - //------------------------------------------------------------------ bool HasArgs() const { return m_has_args; } - //------------------------------------------------------------------ /// Returns the list of arguments. /// /// You can only call this method if HasArgs returns true. - //------------------------------------------------------------------ Args &GetArgs() { assert(m_has_args); return m_args; } - //------------------------------------------------------------------ /// Returns the list of arguments. /// /// You can only call this method if HasArgs returns true. - //------------------------------------------------------------------ const Args &GetArgs() const { assert(m_has_args); return m_args; } - //------------------------------------------------------------------ /// Returns the part of the input string that was used for parsing the /// argument list. This string also includes the double dash that is used /// for separating the argument list from the suffix. /// /// You can only call this method if HasArgs returns true. - //------------------------------------------------------------------ llvm::StringRef GetArgStringWithDelimiter() const { assert(m_has_args); return m_arg_string_with_delimiter; } - //------------------------------------------------------------------ /// Returns the part of the input string that was used for parsing the /// argument list. /// /// You can only call this method if HasArgs returns true. - //------------------------------------------------------------------ llvm::StringRef GetArgString() const { assert(m_has_args); return m_arg_string; } - //------------------------------------------------------------------ /// Returns the raw suffix part of the parsed string. - //------------------------------------------------------------------ const std::string &GetRawPart() const { return m_suffix; } private: diff --git a/lldb/include/lldb/Utility/Baton.h b/lldb/include/lldb/Utility/Baton.h index e9a450e..68b9e9f 100644 --- a/lldb/include/lldb/Utility/Baton.h +++ b/lldb/include/lldb/Utility/Baton.h @@ -20,7 +20,6 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Baton Baton.h "lldb/Core/Baton.h" /// A class designed to wrap callback batons so they can cleanup /// any acquired resources @@ -31,7 +30,6 @@ namespace lldb_private { /// /// The default behavior is to not free anything. Subclasses can free any /// needed resources in their destructors. -//---------------------------------------------------------------------- class Baton { public: Baton() {} diff --git a/lldb/include/lldb/Utility/Broadcaster.h b/lldb/include/lldb/Utility/Broadcaster.h index eecd437..c278ccd 100644 --- a/lldb/include/lldb/Utility/Broadcaster.h +++ b/lldb/include/lldb/Utility/Broadcaster.h @@ -39,12 +39,10 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- // lldb::BroadcastEventSpec // // This class is used to specify a kind of event to register for. The Debugger // maintains a list of BroadcastEventSpec's and when it is made -//---------------------------------------------------------------------- class BroadcastEventSpec { public: BroadcastEventSpec(ConstString broadcaster_class, uint32_t event_bits) @@ -221,7 +219,6 @@ private: }; }; -//---------------------------------------------------------------------- /// \class Broadcaster Broadcaster.h "lldb/Utility/Broadcaster.h" An event /// broadcasting class. /// @@ -241,9 +238,7 @@ private: /// class Foo : public Broadcaster /// { /// public: -/// //---------------------------------------------------------- /// // Broadcaster event bits definitions. -/// //---------------------------------------------------------- /// enum /// { /// eBroadcastBitOne = (1 << 0), @@ -252,31 +247,25 @@ private: /// ... /// }; /// \endcode -//---------------------------------------------------------------------- class Broadcaster { friend class Listener; friend class Event; public: - //------------------------------------------------------------------ /// Construct with a broadcaster with a name. /// /// \param[in] name /// A NULL terminated C string that contains the name of the /// broadcaster object. - //------------------------------------------------------------------ Broadcaster(lldb::BroadcasterManagerSP manager_sp, const char *name); - //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class gets subclassed. - //------------------------------------------------------------------ virtual ~Broadcaster(); void CheckInWithManager(); - //------------------------------------------------------------------ /// Broadcast an event which has no associated data. /// /// \param[in] event_type @@ -291,7 +280,6 @@ public: /// If true, then only add an event of this type if there isn't /// one already in the queue. /// - //------------------------------------------------------------------ void BroadcastEvent(lldb::EventSP &event_sp) { m_broadcaster_sp->BroadcastEvent(event_sp); } @@ -319,7 +307,6 @@ public: virtual void AddInitialEventsToListener(const lldb::ListenerSP &listener_sp, uint32_t requested_events); - //------------------------------------------------------------------ /// Listen for any events specified by \a event_mask. /// /// Only one listener can listen to each event bit in a given Broadcaster. @@ -339,21 +326,17 @@ public: /// /// \return /// The actual event bits that were acquired by \a listener. - //------------------------------------------------------------------ uint32_t AddListener(const lldb::ListenerSP &listener_sp, uint32_t event_mask) { return m_broadcaster_sp->AddListener(listener_sp, event_mask); } - //------------------------------------------------------------------ /// Get the NULL terminated C string name of this Broadcaster object. /// /// \return /// The NULL terminated C string name of this Broadcaster. - //------------------------------------------------------------------ ConstString GetBroadcasterName() { return m_broadcaster_name; } - //------------------------------------------------------------------ /// Get the event name(s) for one or more event bits. /// /// \param[in] event_mask @@ -361,14 +344,12 @@ public: /// /// \return /// The NULL terminated C string name of this Broadcaster. - //------------------------------------------------------------------ bool GetEventNames(Stream &s, const uint32_t event_mask, bool prefix_with_broadcaster_name) const { return m_broadcaster_sp->GetEventNames(s, event_mask, prefix_with_broadcaster_name); } - //------------------------------------------------------------------ /// Set the name for an event bit. /// /// \param[in] event_mask @@ -377,7 +358,6 @@ public: /// /// \return /// The NULL terminated C string name of this Broadcaster. - //------------------------------------------------------------------ void SetEventName(uint32_t event_mask, const char *name) { m_broadcaster_sp->SetEventName(event_mask, name); } @@ -390,7 +370,6 @@ public: return m_broadcaster_sp->EventTypeHasListeners(event_type); } - //------------------------------------------------------------------ /// Removes a Listener from this broadcasters list and frees the event bits /// specified by \a event_mask that were previously acquired by \a listener /// (assuming \a listener was listening to this object) for other listener @@ -407,13 +386,11 @@ public: /// and was removed, \b false otherwise. /// /// \see uint32_t Broadcaster::AddListener (Listener*, uint32_t) - //------------------------------------------------------------------ bool RemoveListener(const lldb::ListenerSP &listener_sp, uint32_t event_mask = UINT32_MAX) { return m_broadcaster_sp->RemoveListener(listener_sp, event_mask); } - //------------------------------------------------------------------ /// Provides a simple mechanism to temporarily redirect events from /// broadcaster. When you call this function passing in a listener and /// event type mask, all events from the broadcaster matching the mask will @@ -432,7 +409,6 @@ public: /// \b True if the event mask could be hijacked, \b false otherwise. /// /// \see uint32_t Broadcaster::AddListener (Listener*, uint32_t) - //------------------------------------------------------------------ bool HijackBroadcaster(const lldb::ListenerSP &listener_sp, uint32_t event_mask = UINT32_MAX) { return m_broadcaster_sp->HijackBroadcaster(listener_sp, event_mask); @@ -442,10 +418,8 @@ public: return m_broadcaster_sp->IsHijackedForEvent(event_mask); } - //------------------------------------------------------------------ /// Restore the state of the Broadcaster from a previous hijack attempt. /// - //------------------------------------------------------------------ void RestoreBroadcaster() { m_broadcaster_sp->RestoreBroadcaster(); } // This needs to be filled in if you are going to register the broadcaster @@ -537,9 +511,7 @@ protected: const char *GetHijackingListenerName(); - //------------------------------------------------------------------ // - //------------------------------------------------------------------ typedef llvm::SmallVector<std::pair<lldb::ListenerWP, uint32_t>, 4> collection; typedef std::map<uint32_t, std::string> event_names_map; @@ -562,9 +534,7 @@ protected: // collections, but for now this is just for private hijacking. private: - //------------------------------------------------------------------ // For Broadcaster only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(BroadcasterImpl); }; @@ -576,14 +546,10 @@ protected: const char *GetHijackingListenerName() { return m_broadcaster_sp->GetHijackingListenerName(); } - //------------------------------------------------------------------ // Classes that inherit from Broadcaster can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For Broadcaster only - //------------------------------------------------------------------ BroadcasterImplSP m_broadcaster_sp; lldb::BroadcasterManagerSP m_manager_sp; const ConstString diff --git a/lldb/include/lldb/Utility/CompletionRequest.h b/lldb/include/lldb/Utility/CompletionRequest.h index 8f4085d..f5ccb01 100644 --- a/lldb/include/lldb/Utility/CompletionRequest.h +++ b/lldb/include/lldb/Utility/CompletionRequest.h @@ -17,9 +17,7 @@ namespace lldb_private { class CompletionResult { - //---------------------------------------------------------- /// A single completion and all associated data. - //---------------------------------------------------------- struct Completion { Completion(llvm::StringRef completion, llvm::StringRef description) : m_completion(completion.str()), m_descripton(description.str()) {} @@ -38,24 +36,19 @@ class CompletionResult { public: void AddResult(llvm::StringRef completion, llvm::StringRef description); - //---------------------------------------------------------- /// Adds all collected completion matches to the given list. /// The list will be cleared before the results are added. The number of /// results here is guaranteed to be equal to GetNumberOfResults(). - //---------------------------------------------------------- void GetMatches(StringList &matches) const; - //---------------------------------------------------------- /// Adds all collected completion descriptions to the given list. /// The list will be cleared before the results are added. The number of /// results here is guaranteed to be equal to GetNumberOfResults(). - //---------------------------------------------------------- void GetDescriptions(StringList &descriptions) const; std::size_t GetNumberOfResults() const { return m_results.size(); } }; -//---------------------------------------------------------------------- /// \class CompletionRequest CompletionRequest.h /// "lldb/Utility/ArgCompletionRequest.h" /// @@ -63,10 +56,8 @@ public: /// for the user. Will be filled with the generated completions by the different /// completions functions. /// -//---------------------------------------------------------------------- class CompletionRequest { public: - //---------------------------------------------------------- /// Constructs a completion request. /// /// \param [in] command_line @@ -87,7 +78,6 @@ public: /// \param [out] result /// The CompletionResult that will be filled with the results after this /// request has been handled. - //---------------------------------------------------------- CompletionRequest(llvm::StringRef command_line, unsigned raw_cursor_pos, int match_start_point, int max_return_elements, CompletionResult &result); diff --git a/lldb/include/lldb/Utility/Connection.h b/lldb/include/lldb/Utility/Connection.h index 8459ed1..a525d7f 100644 --- a/lldb/include/lldb/Utility/Connection.h +++ b/lldb/include/lldb/Utility/Connection.h @@ -29,7 +29,6 @@ template <typename Ratio> class Timeout; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Connection Connection.h "lldb/Utility/Connection.h" /// A communication connection class. /// @@ -41,21 +40,15 @@ namespace lldb_private { /// Instances can be instantiated and given to a Communication class to /// perform communications where clients can listen for broadcasts, and /// perform other higher level communications. -//---------------------------------------------------------------------- class Connection { public: - //------------------------------------------------------------------ /// Default constructor - //------------------------------------------------------------------ Connection() = default; - //------------------------------------------------------------------ /// Virtual destructor since this class gets subclassed and handed to a /// Communication object. - //------------------------------------------------------------------ virtual ~Connection(); - //------------------------------------------------------------------ /// Connect using the connect string \a url. /// /// \param[in] url @@ -73,11 +66,9 @@ public: /// appropriate value based on the result of this function. /// /// \see Status& Communication::GetError (); - //------------------------------------------------------------------ virtual lldb::ConnectionStatus Connect(llvm::StringRef url, Status *error_ptr) = 0; - //------------------------------------------------------------------ /// Disconnect the communications connection if one is currently connected. /// /// \param[out] error_ptr @@ -91,19 +82,15 @@ public: /// appropriate value based on the result of this function. /// /// \see Status& Communication::GetError (); - //------------------------------------------------------------------ virtual lldb::ConnectionStatus Disconnect(Status *error_ptr) = 0; - //------------------------------------------------------------------ /// Check if the connection is valid. /// /// \return /// \b True if this object is currently connected, \b false /// otherwise. - //------------------------------------------------------------------ virtual bool IsConnected() const = 0; - //------------------------------------------------------------------ /// The read function that attempts to read from the connection. /// /// \param[in] dst @@ -130,12 +117,10 @@ public: /// The number of bytes actually read. /// /// \see size_t Communication::Read (void *, size_t, uint32_t); - //------------------------------------------------------------------ virtual size_t Read(void *dst, size_t dst_len, const Timeout<std::micro> &timeout, lldb::ConnectionStatus &status, Status *error_ptr) = 0; - //------------------------------------------------------------------ /// The actual write function that attempts to write to the communications /// protocol. /// @@ -156,21 +141,17 @@ public: /// /// \return /// The number of bytes actually Written. - //------------------------------------------------------------------ virtual size_t Write(const void *dst, size_t dst_len, lldb::ConnectionStatus &status, Status *error_ptr) = 0; - //------------------------------------------------------------------ /// Returns a URI that describes this connection object /// /// Subclasses may override this function. /// /// \return /// Returns URI or an empty string if disconnecteds - //------------------------------------------------------------------ virtual std::string GetURI() = 0; - //------------------------------------------------------------------ /// Interrupts an ongoing Read() operation. /// /// If there is an ongoing read operation in another thread, this operation @@ -182,10 +163,8 @@ public: /// /// \return /// Returns true is the interrupt request was successful. - //------------------------------------------------------------------ virtual bool InterruptRead() = 0; - //------------------------------------------------------------------ /// Returns the underlying IOObject used by the Connection. /// /// The IOObject can be used to wait for data to become available on the @@ -194,13 +173,10 @@ public: /// /// \return /// The underlying IOObject used for reading. - //------------------------------------------------------------------ virtual lldb::IOObjectSP GetReadObject() { return lldb::IOObjectSP(); } private: - //------------------------------------------------------------------ // For Connection only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(Connection); }; diff --git a/lldb/include/lldb/Utility/ConstString.h b/lldb/include/lldb/Utility/ConstString.h index 4cab5ed..c707082 100644 --- a/lldb/include/lldb/Utility/ConstString.h +++ b/lldb/include/lldb/Utility/ConstString.h @@ -23,7 +23,6 @@ class raw_ostream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class ConstString ConstString.h "lldb/Utility/ConstString.h" /// A uniqued constant string class. /// @@ -36,29 +35,23 @@ namespace lldb_private { /// No reference counting is done on strings that are added to the string /// pool, once strings are added they are in the string pool for the life of /// the program. -//---------------------------------------------------------------------- class ConstString { public: - //------------------------------------------------------------------ /// Default constructor /// /// Initializes the string to an empty string. - //------------------------------------------------------------------ ConstString() : m_string(nullptr) {} - //------------------------------------------------------------------ /// Copy constructor /// /// Copies the string value in \a rhs into this object. /// /// \param[in] rhs /// Another string object to copy. - //------------------------------------------------------------------ ConstString(const ConstString &rhs) : m_string(rhs.m_string) {} explicit ConstString(const llvm::StringRef &s); - //------------------------------------------------------------------ /// Construct with C String value /// /// Constructs this object with a C string by looking to see if the @@ -67,10 +60,8 @@ public: /// /// \param[in] cstr /// A NULL terminated C string to add to the string pool. - //------------------------------------------------------------------ explicit ConstString(const char *cstr); - //------------------------------------------------------------------ /// Construct with C String value with max length /// /// Constructs this object with a C string with a length. If \a max_cstr_len @@ -91,23 +82,17 @@ public: /// truncated. If the string length of \a cstr is greater than /// \a max_cstr_len, then only max_cstr_len bytes will be used /// from \a cstr. - //------------------------------------------------------------------ explicit ConstString(const char *cstr, size_t max_cstr_len); - //------------------------------------------------------------------ /// Destructor /// /// Since constant string values are currently not reference counted, there /// isn't much to do here. - //------------------------------------------------------------------ ~ConstString() = default; - //---------------------------------------------------------------------- /// C string equality binary predicate function object for ConstString /// objects. - //---------------------------------------------------------------------- struct StringIsEqual { - //-------------------------------------------------------------- /// C equality test. /// /// Two C strings are equal when they are contained in ConstString objects @@ -116,13 +101,11 @@ public: /// \return /// Returns \b true if the C string in \a lhs is equal to /// the C string value in \a rhs, \b false otherwise. - //-------------------------------------------------------------- bool operator()(const char *lhs, const char *rhs) const { return lhs == rhs; } }; - //------------------------------------------------------------------ /// Convert to bool operator. /// /// This allows code to check a ConstString object to see if it contains a @@ -137,10 +120,8 @@ public: /// \return /// /b True this object contains a valid non-empty C string, \b /// false otherwise. - //------------------------------------------------------------------ explicit operator bool() const { return !IsEmpty(); } - //------------------------------------------------------------------ /// Assignment operator /// /// Assigns the string in this object with the value from \a rhs. @@ -150,13 +131,11 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ ConstString operator=(ConstString rhs) { m_string = rhs.m_string; return *this; } - //------------------------------------------------------------------ /// Equal to operator /// /// Returns true if this string is equal to the string in \a rhs. This @@ -169,14 +148,12 @@ public: /// \return /// \li \b true if this object is equal to \a rhs. /// \li \b false if this object is not equal to \a rhs. - //------------------------------------------------------------------ bool operator==(ConstString rhs) const { // We can do a pointer compare to compare these strings since they must // come from the same pool in order to be equal. return m_string == rhs.m_string; } - //------------------------------------------------------------------ /// Not equal to operator /// /// Returns true if this string is not equal to the string in \a rhs. This @@ -189,14 +166,12 @@ public: /// \return /// \li \b true if this object is not equal to \a rhs. /// \li \b false if this object is equal to \a rhs. - //------------------------------------------------------------------ bool operator!=(ConstString rhs) const { return m_string != rhs.m_string; } bool operator<(ConstString rhs) const; - //------------------------------------------------------------------ /// Get the string value as a C string. /// /// Get the value of the contained string as a NULL terminated C string @@ -207,23 +182,19 @@ public: /// \return /// Returns \a value_if_empty if the string is empty, otherwise /// the C string value contained in this object. - //------------------------------------------------------------------ const char *AsCString(const char *value_if_empty = nullptr) const { return (IsEmpty() ? value_if_empty : m_string); } - //------------------------------------------------------------------ /// Get the string value as a llvm::StringRef /// /// \return /// Returns a new llvm::StringRef object filled in with the /// needed data. - //------------------------------------------------------------------ llvm::StringRef GetStringRef() const { return llvm::StringRef(m_string, GetLength()); } - //------------------------------------------------------------------ /// Get the string value as a C string. /// /// Get the value of the contained string as a NULL terminated C string @@ -234,10 +205,8 @@ public: /// \return /// Returns nullptr the string is invalid, otherwise the C string /// value contained in this object. - //------------------------------------------------------------------ const char *GetCString() const { return m_string; } - //------------------------------------------------------------------ /// Get the length in bytes of string value. /// /// The string pool stores the length of the string, so we can avoid calling @@ -246,18 +215,14 @@ public: /// \return /// Returns the number of bytes that this string occupies in /// memory, not including the NULL termination byte. - //------------------------------------------------------------------ size_t GetLength() const; - //------------------------------------------------------------------ /// Clear this object's state. /// /// Clear any contained string and reset the value to the empty string /// value. - //------------------------------------------------------------------ void Clear() { m_string = nullptr; } - //------------------------------------------------------------------ /// Equal to operator /// /// Returns true if this string is equal to the string in \a rhs. If case @@ -278,11 +243,9 @@ public: /// \return /// \li \b true if this object is equal to \a rhs. /// \li \b false if this object is not equal to \a rhs. - //------------------------------------------------------------------ static bool Equals(ConstString lhs, ConstString rhs, const bool case_sensitive = true); - //------------------------------------------------------------------ /// Compare two string objects. /// /// Compares the C string values contained in \a lhs and \a rhs and returns @@ -307,11 +270,9 @@ public: /// \li -1 if lhs < rhs /// \li 0 if lhs == rhs /// \li 1 if lhs > rhs - //------------------------------------------------------------------ static int Compare(ConstString lhs, ConstString rhs, const bool case_sensitive = true); - //------------------------------------------------------------------ /// Dump the object description to a stream. /// /// Dump the string value to the stream \a s. If the contained string is @@ -324,36 +285,28 @@ public: /// \param[in] value_if_empty /// The value to dump if the string is empty. If nullptr, nothing /// will be output to the stream. - //------------------------------------------------------------------ void Dump(Stream *s, const char *value_if_empty = nullptr) const; - //------------------------------------------------------------------ /// Dump the object debug description to a stream. /// /// \param[in] s /// The stream that will be used to dump the object description. - //------------------------------------------------------------------ void DumpDebug(Stream *s) const; - //------------------------------------------------------------------ /// Test for empty string. /// /// \return /// \li \b true if the contained string is empty. /// \li \b false if the contained string is not empty. - //------------------------------------------------------------------ bool IsEmpty() const { return m_string == nullptr || m_string[0] == '\0'; } - //------------------------------------------------------------------ /// Test for null string. /// /// \return /// \li \b true if there is no string associated with this instance. /// \li \b false if there is a string associated with this instance. - //------------------------------------------------------------------ bool IsNull() const { return m_string == nullptr; } - //------------------------------------------------------------------ /// Set the C string value. /// /// Set the string value in the object by uniquing the \a cstr string value @@ -365,12 +318,10 @@ public: /// /// \param[in] cstr /// A NULL terminated C string to add to the string pool. - //------------------------------------------------------------------ void SetCString(const char *cstr); void SetString(const llvm::StringRef &s); - //------------------------------------------------------------------ /// Set the C string value and its mangled counterpart. /// /// Object files and debug symbols often use mangled string to represent the @@ -386,11 +337,9 @@ public: /// \param[in] mangled /// The already uniqued mangled ConstString to correlate the /// soon to be uniqued version of \a demangled. - //------------------------------------------------------------------ void SetStringWithMangledCounterpart(llvm::StringRef demangled, ConstString mangled); - //------------------------------------------------------------------ /// Retrieve the mangled or demangled counterpart for a mangled or demangled /// ConstString. /// @@ -408,10 +357,8 @@ public: /// \return /// /b True if \a counterpart was filled in with the counterpart /// /b false otherwise. - //------------------------------------------------------------------ bool GetMangledCounterpart(ConstString &counterpart) const; - //------------------------------------------------------------------ /// Set the C string value with length. /// /// Set the string value in the object by uniquing \a cstr_len bytes @@ -428,18 +375,14 @@ public: /// /// \param[in] cstr_len /// The maximum length of the C string. - //------------------------------------------------------------------ void SetCStringWithLength(const char *cstr, size_t cstr_len); - //------------------------------------------------------------------ /// Set the C string value with the minimum length between \a fixed_cstr_len /// and the actual length of the C string. This can be used for data /// structures that have a fixed length to store a C string where the string /// might not be NULL terminated if the string takes the entire buffer. - //------------------------------------------------------------------ void SetTrimmedCStringWithLength(const char *cstr, size_t fixed_cstr_len); - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// Return the size in bytes that this object takes in memory. This returns @@ -450,10 +393,8 @@ public: /// The number of bytes that this object occupies in memory. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ size_t MemorySize() const { return sizeof(ConstString); } - //------------------------------------------------------------------ /// Get the size in bytes of the current global string pool. /// /// Reports the size in bytes of all shared C string values, containers and @@ -462,19 +403,14 @@ public: /// \return /// The number of bytes that the global string pool occupies /// in memory. - //------------------------------------------------------------------ static size_t StaticMemorySize(); protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ const char *m_string; }; -//------------------------------------------------------------------ /// Stream the string value \a str to the stream \a s -//------------------------------------------------------------------ Stream &operator<<(Stream &s, ConstString str); } // namespace lldb_private diff --git a/lldb/include/lldb/Utility/DataBuffer.h b/lldb/include/lldb/Utility/DataBuffer.h index abf8462..5235693 100644 --- a/lldb/include/lldb/Utility/DataBuffer.h +++ b/lldb/include/lldb/Utility/DataBuffer.h @@ -19,7 +19,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class DataBuffer DataBuffer.h "lldb/Core/DataBuffer.h" /// A pure virtual protocol class for abstracted data buffers. /// @@ -41,43 +40,34 @@ namespace lldb_private { /// This class currently expects all data to be available without any extra /// calls being made, but we can modify it to optionally get data on demand /// with some extra function calls to load the data before it gets accessed. -//---------------------------------------------------------------------- class DataBuffer { public: - //------------------------------------------------------------------ /// Destructor /// /// The destructor is virtual as other classes will inherit from this class /// and be downcast to the DataBuffer pure virtual interface. The virtual /// destructor ensures that destructing the base class will destruct the /// class that inherited from it correctly. - //------------------------------------------------------------------ virtual ~DataBuffer() {} - //------------------------------------------------------------------ /// Get a pointer to the data. /// /// \return /// A pointer to the bytes owned by this object, or NULL if the /// object contains no bytes. - //------------------------------------------------------------------ virtual uint8_t *GetBytes() = 0; - //------------------------------------------------------------------ /// Get a const pointer to the data. /// /// \return /// A const pointer to the bytes owned by this object, or NULL /// if the object contains no bytes. - //------------------------------------------------------------------ virtual const uint8_t *GetBytes() const = 0; - //------------------------------------------------------------------ /// Get the number of bytes in the data buffer. /// /// \return /// The number of bytes this object currently contains. - //------------------------------------------------------------------ virtual lldb::offset_t GetByteSize() const = 0; llvm::ArrayRef<uint8_t> GetData() const { diff --git a/lldb/include/lldb/Utility/DataBufferHeap.h b/lldb/include/lldb/Utility/DataBufferHeap.h index 304dbd2..2a64694 100644 --- a/lldb/include/lldb/Utility/DataBufferHeap.h +++ b/lldb/include/lldb/Utility/DataBufferHeap.h @@ -18,7 +18,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class DataBufferHeap DataBufferHeap.h "lldb/Core/DataBufferHeap.h" /// A subclass of DataBuffer that stores a data buffer on the heap. /// @@ -28,17 +27,13 @@ namespace lldb_private { /// pages in. Large amounts of data that comes from files should probably use /// DataBufferLLVM, which can intelligently determine when memory mapping is /// optimal. -//---------------------------------------------------------------------- class DataBufferHeap : public DataBuffer { public: - //------------------------------------------------------------------ /// Default constructor /// /// Initializes the heap based buffer with no bytes. - //------------------------------------------------------------------ DataBufferHeap(); - //------------------------------------------------------------------ /// Construct with size \a n and fill with \a ch. /// /// Initialize this class with \a n bytes and fills the buffer with \a ch. @@ -48,10 +43,8 @@ public: /// /// \param[in] ch /// The character to use when filling the buffer initially. - //------------------------------------------------------------------ DataBufferHeap(lldb::offset_t n, uint8_t ch); - //------------------------------------------------------------------ /// Construct by making a copy of \a src_len bytes from \a src. /// /// \param[in] src @@ -59,33 +52,23 @@ public: /// /// \param[in] src_len /// The number of bytes in \a src to copy. - //------------------------------------------------------------------ DataBufferHeap(const void *src, lldb::offset_t src_len); - //------------------------------------------------------------------ /// Destructor. /// /// Virtual destructor since this class inherits from a pure virtual base /// class #DataBuffer. - //------------------------------------------------------------------ ~DataBufferHeap() override; - //------------------------------------------------------------------ /// \copydoc DataBuffer::GetBytes() - //------------------------------------------------------------------ uint8_t *GetBytes() override; - //------------------------------------------------------------------ /// \copydoc DataBuffer::GetBytes() const - //------------------------------------------------------------------ const uint8_t *GetBytes() const override; - //------------------------------------------------------------------ /// \copydoc DataBuffer::GetByteSize() const - //------------------------------------------------------------------ lldb::offset_t GetByteSize() const override; - //------------------------------------------------------------------ /// Set the number of bytes in the data buffer. /// /// Sets the number of bytes that this object should be able to contain. @@ -99,10 +82,8 @@ public: /// \return /// The size in bytes after that this heap buffer was /// successfully resized to. - //------------------------------------------------------------------ lldb::offset_t SetByteSize(lldb::offset_t byte_size); - //------------------------------------------------------------------ /// Makes a copy of the \a src_len bytes in \a src. /// /// Copies the data in \a src into an internal buffer. @@ -112,7 +93,6 @@ public: /// /// \param[in] src_len /// The number of bytes in \a src to copy. - //------------------------------------------------------------------ void CopyData(const void *src, lldb::offset_t src_len); void CopyData(llvm::StringRef src) { CopyData(src.data(), src.size()); } @@ -121,10 +101,8 @@ public: void Clear(); private: - //------------------------------------------------------------------ // This object uses a std::vector<uint8_t> to store its data. This takes care // of free the data when the object is deleted. - //------------------------------------------------------------------ typedef std::vector<uint8_t> buffer_t; ///< Buffer type buffer_t m_data; ///< The heap based buffer where data is stored }; diff --git a/lldb/include/lldb/Utility/DataEncoder.h b/lldb/include/lldb/Utility/DataEncoder.h index ede91e6..19b7cef 100644 --- a/lldb/include/lldb/Utility/DataEncoder.h +++ b/lldb/include/lldb/Utility/DataEncoder.h @@ -21,7 +21,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class DataEncoder DataEncoder.h "lldb/Core/DataEncoder.h" An binary data /// encoding class. /// @@ -30,17 +29,13 @@ namespace lldb_private { /// that can be shared between multiple DataEncoder or DataEncoder instances. /// /// \see DataBuffer -//---------------------------------------------------------------------- class DataEncoder { public: - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize all members to a default empty state. - //------------------------------------------------------------------ DataEncoder(); - //------------------------------------------------------------------ /// Construct with a buffer that is owned by the caller. /// /// This constructor allows us to use data that is owned by the caller. The @@ -57,11 +52,9 @@ public: /// /// \param[in] addr_size /// A new address byte size value. - //------------------------------------------------------------------ DataEncoder(void *data, uint32_t data_length, lldb::ByteOrder byte_order, uint8_t addr_size); - //------------------------------------------------------------------ /// Construct with shared data. /// /// Copies the data shared pointer which adds a reference to the contained @@ -77,57 +70,45 @@ public: /// /// \param[in] addr_size /// A new address byte size value. - //------------------------------------------------------------------ DataEncoder(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order, uint8_t addr_size); - //------------------------------------------------------------------ /// Destructor /// /// If this object contains a valid shared data reference, the reference /// count on the data will be decremented, and if zero, the data will be /// freed. - //------------------------------------------------------------------ ~DataEncoder(); - //------------------------------------------------------------------ /// Clears the object state. /// /// Clears the object contents back to a default invalid state, and release /// any references to shared data that this object may contain. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Get the current address size. /// /// Return the size in bytes of any address values this object will extract. /// /// \return /// The size in bytes of address values that will be extracted. - //------------------------------------------------------------------ uint8_t GetAddressByteSize() const { return m_addr_size; } - //------------------------------------------------------------------ /// Get the number of bytes contained in this object. /// /// \return /// The total number of bytes of data this object refers to. - //------------------------------------------------------------------ size_t GetByteSize() const { return m_end - m_start; } - //------------------------------------------------------------------ /// Get the data end pointer. /// /// \return /// Returns a pointer to the next byte contained in this /// object's data, or NULL of there is no data in this object. - //------------------------------------------------------------------ uint8_t *GetDataEnd() { return m_end; } const uint8_t *GetDataEnd() const { return m_end; } - //------------------------------------------------------------------ /// Get the shared data offset. /// /// Get the offset of the first byte of data in the shared data (if any). @@ -135,30 +116,24 @@ public: /// \return /// If this object contains shared data, this function returns /// the offset in bytes into that shared data, zero otherwise. - //------------------------------------------------------------------ size_t GetSharedDataOffset() const; - //------------------------------------------------------------------ /// Get the current byte order value. /// /// \return /// The current byte order value from this object's internal /// state. - //------------------------------------------------------------------ lldb::ByteOrder GetByteOrder() const { return m_byte_order; } - //------------------------------------------------------------------ /// Get the data start pointer. /// /// \return /// Returns a pointer to the first byte contained in this /// object's data, or NULL of there is no data in this object. - //------------------------------------------------------------------ uint8_t *GetDataStart() { return m_start; } const uint8_t *GetDataStart() const { return m_start; } - //------------------------------------------------------------------ /// Encode unsigned integer values into the data at \a offset. /// /// \param[in] offset @@ -171,7 +146,6 @@ public: /// \return /// The next offset in the bytes of this data if the data /// was successfully encoded, UINT32_MAX if the encoding failed. - //------------------------------------------------------------------ uint32_t PutU8(uint32_t offset, uint8_t value); uint32_t PutU16(uint32_t offset, uint16_t value); @@ -180,7 +154,6 @@ public: uint32_t PutU64(uint32_t offset, uint64_t value); - //------------------------------------------------------------------ /// Encode an unsigned integer of size \a byte_size to \a offset. /// /// Encode a single integer value at \a offset and return the offset that @@ -203,10 +176,8 @@ public: /// \return /// The next offset in the bytes of this data if the integer /// was successfully encoded, UINT32_MAX if the encoding failed. - //------------------------------------------------------------------ uint32_t PutMaxU64(uint32_t offset, uint32_t byte_size, uint64_t value); - //------------------------------------------------------------------ /// Encode an arbitrary number of bytes. /// /// \param[in] offset @@ -222,10 +193,8 @@ public: /// \return /// The next valid offset within data if the put operation /// was successful, else UINT32_MAX to indicate the put failed. - //------------------------------------------------------------------ uint32_t PutData(uint32_t offset, const void *src, uint32_t src_len); - //------------------------------------------------------------------ /// Encode an address in the existing buffer at \a offset bytes into the /// buffer. /// @@ -245,10 +214,8 @@ public: /// \return /// The next valid offset within data if the put operation /// was successful, else UINT32_MAX to indicate the put failed. - //------------------------------------------------------------------ uint32_t PutAddress(uint32_t offset, lldb::addr_t addr); - //------------------------------------------------------------------ /// Put a C string to \a offset. /// /// Encodes a C string into the existing data including the terminating @@ -265,12 +232,10 @@ public: /// pointed to by \a offset_ptr is out of bounds, or if the /// offset plus the length of the C string is out of bounds, /// NULL will be returned. - //------------------------------------------------------------------ uint32_t PutCString(uint32_t offset_ptr, const char *cstr); lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; } - //------------------------------------------------------------------ /// Set the address byte size. /// /// Set the size in bytes that will be used when extracting any address and @@ -278,10 +243,8 @@ public: /// /// \param[in] addr_size /// The size in bytes to use when extracting addresses. - //------------------------------------------------------------------ void SetAddressByteSize(uint8_t addr_size) { m_addr_size = addr_size; } - //------------------------------------------------------------------ /// Set data with a buffer that is caller owned. /// /// Use data that is owned by the caller when extracting values. The data @@ -300,10 +263,8 @@ public: /// /// \return /// The number of bytes that this object now contains. - //------------------------------------------------------------------ uint32_t SetData(void *bytes, uint32_t length, lldb::ByteOrder byte_order); - //------------------------------------------------------------------ /// Adopt a subset of shared data in \a data_sp. /// /// Copies the data shared pointer which adds a reference to the contained @@ -326,11 +287,9 @@ public: /// /// \return /// The number of bytes that this object now contains. - //------------------------------------------------------------------ uint32_t SetData(const lldb::DataBufferSP &data_sp, uint32_t offset = 0, uint32_t length = UINT32_MAX); - //------------------------------------------------------------------ /// Set the byte_order value. /// /// Sets the byte order of the data to extract. Extracted values will be @@ -338,25 +297,20 @@ public: /// /// \param[in] byte_order /// The byte order value to use when extracting data. - //------------------------------------------------------------------ void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; } - //------------------------------------------------------------------ /// Test the validity of \a offset. /// /// \return /// \b true if \a offset is a valid offset into the data in this /// object, \b false otherwise. - //------------------------------------------------------------------ bool ValidOffset(uint32_t offset) const { return offset < GetByteSize(); } - //------------------------------------------------------------------ /// Test the availability of \a length bytes of data from \a offset. /// /// \return /// \b true if \a offset is a valid offset and there are \a /// length bytes available at that offset, \b false otherwise. - //------------------------------------------------------------------ bool ValidOffsetForDataOfSize(uint32_t offset, uint32_t length) const { return length <= BytesLeft(offset); } @@ -369,9 +323,7 @@ public: } protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ uint8_t *m_start; ///< A pointer to the first byte of data. uint8_t *m_end; ///< A pointer to the byte that is past the end of the data. lldb::ByteOrder diff --git a/lldb/include/lldb/Utility/DataExtractor.h b/lldb/include/lldb/Utility/DataExtractor.h index 81b68ea..3555004 100644 --- a/lldb/include/lldb/Utility/DataExtractor.h +++ b/lldb/include/lldb/Utility/DataExtractor.h @@ -32,7 +32,6 @@ template <typename T> class SmallVectorImpl; namespace lldb_private { -//---------------------------------------------------------------------- /// \class DataExtractor DataExtractor.h "lldb/Core/DataExtractor.h" An data /// extractor class. /// @@ -45,13 +44,10 @@ namespace lldb_private { /// offsets. /// /// \see DataBuffer -//---------------------------------------------------------------------- class DataExtractor { public: - //------------------------------------------------------------------ /// \typedef DataExtractor::Type /// Type enumerations used in the dump routines. - //------------------------------------------------------------------ typedef enum { TypeUInt8, ///< Format output as unsigned 8 bit integers TypeChar, ///< Format output as characters @@ -63,14 +59,11 @@ public: TypeSLEB128 ///< Format output as SLEB128 numbers } Type; - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize all members to a default empty state. - //------------------------------------------------------------------ DataExtractor(); - //------------------------------------------------------------------ /// Construct with a buffer that is owned by the caller. /// /// This constructor allows us to use data that is owned by the caller. The @@ -90,12 +83,10 @@ public: /// /// \param[in] target_byte_size /// A size of a target byte in 8-bit host bytes - //------------------------------------------------------------------ DataExtractor(const void *data, lldb::offset_t data_length, lldb::ByteOrder byte_order, uint32_t addr_size, uint32_t target_byte_size = 1); - //------------------------------------------------------------------ /// Construct with shared data. /// /// Copies the data shared pointer which adds a reference to the contained @@ -114,11 +105,9 @@ public: /// /// \param[in] target_byte_size /// A size of a target byte in 8-bit host bytes - //------------------------------------------------------------------ DataExtractor(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order, uint32_t addr_size, uint32_t target_byte_size = 1); - //------------------------------------------------------------------ /// Construct with a subset of \a data. /// /// Initialize this object with a subset of the data bytes in \a data. If \a @@ -141,13 +130,11 @@ public: /// /// \param[in] target_byte_size /// A size of a target byte in 8-bit host bytes - //------------------------------------------------------------------ DataExtractor(const DataExtractor &data, lldb::offset_t offset, lldb::offset_t length, uint32_t target_byte_size = 1); DataExtractor(const DataExtractor &rhs); - //------------------------------------------------------------------ /// Assignment operator. /// /// Copies all data, byte order and address size settings from \a rhs into @@ -159,29 +146,23 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ const DataExtractor &operator=(const DataExtractor &rhs); - //------------------------------------------------------------------ /// Destructor /// /// If this object contains a valid shared data reference, the reference /// count on the data will be decremented, and if zero, the data will be /// freed. - //------------------------------------------------------------------ virtual ~DataExtractor(); uint32_t getTargetByteSize() const { return m_target_byte_size; } - //------------------------------------------------------------------ /// Clears the object state. /// /// Clears the object contents back to a default invalid state, and release /// any references to shared data that this object may contain. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Dumps the binary data as \a type objects to stream \a s (or to Log() if /// \a s is nullptr) starting \a offset bytes into the data and stopping /// after dumping \a length bytes. The offset into the data is displayed at @@ -215,13 +196,11 @@ public: /// /// \return /// The offset at which dumping ended. - //------------------------------------------------------------------ lldb::offset_t PutToLog(Log *log, lldb::offset_t offset, lldb::offset_t length, uint64_t base_addr, uint32_t num_per_line, Type type, const char *type_format = nullptr) const; - //------------------------------------------------------------------ /// Extract an arbitrary number of bytes in the specified byte order. /// /// Attemps to extract \a length bytes starting at \a offset bytes into this @@ -247,11 +226,9 @@ public: /// The number of bytes that were extracted which will be \a /// length when the value is successfully extracted, or zero /// if there aren't enough bytes at the specified offset. - //------------------------------------------------------------------ size_t ExtractBytes(lldb::offset_t offset, lldb::offset_t length, lldb::ByteOrder dst_byte_order, void *dst) const; - //------------------------------------------------------------------ /// Extract an address from \a *offset_ptr. /// /// Extract a single address from the data and update the offset pointed to @@ -268,30 +245,24 @@ public: /// /// \return /// The extracted address value. - //------------------------------------------------------------------ uint64_t GetAddress(lldb::offset_t *offset_ptr) const; uint64_t GetAddress_unchecked(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Get the current address size. /// /// Return the size in bytes of any address values this object will extract. /// /// \return /// The size in bytes of address values that will be extracted. - //------------------------------------------------------------------ uint32_t GetAddressByteSize() const { return m_addr_size; } - //------------------------------------------------------------------ /// Get the number of bytes contained in this object. /// /// \return /// The total number of bytes of data this object refers to. - //------------------------------------------------------------------ uint64_t GetByteSize() const { return m_end - m_start; } - //------------------------------------------------------------------ /// Extract a C string from \a *offset_ptr. /// /// Returns a pointer to a C String from the data at the offset pointed to @@ -311,10 +282,8 @@ public: /// pointed to by \a offset_ptr is out of bounds, or if the /// offset plus the length of the C string is out of bounds, /// nullptr will be returned. - //------------------------------------------------------------------ const char *GetCStr(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract a C string from \a *offset_ptr with field size \a len. /// /// Returns a pointer to a C String from the data at the offset pointed to @@ -338,7 +307,6 @@ public: /// be returned. const char *GetCStr(lldb::offset_t *offset_ptr, lldb::offset_t len) const; - //------------------------------------------------------------------ /// Extract \a length bytes from \a *offset_ptr. /// /// Returns a pointer to a bytes in this object's data at the offset pointed @@ -360,7 +328,6 @@ public: /// \return /// A pointer to the bytes in this object's data if the offset /// and length are valid, or nullptr otherwise. - //------------------------------------------------------------------ const void *GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const { const uint8_t *ptr = PeekData(*offset_ptr, length); if (ptr) @@ -368,7 +335,6 @@ public: return ptr; } - //------------------------------------------------------------------ /// Copy \a length bytes from \a *offset, without swapping bytes. /// /// \param[in] offset @@ -383,11 +349,9 @@ public: /// \return /// Returns the number of bytes that were copied, or zero if /// anything goes wrong. - //------------------------------------------------------------------ lldb::offset_t CopyData(lldb::offset_t offset, lldb::offset_t length, void *dst) const; - //------------------------------------------------------------------ /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied data is /// treated as a value that can be swapped to match the specified byte /// order. @@ -424,22 +388,18 @@ public: /// \return /// Returns the number of bytes that were copied, or zero if /// anything goes wrong. - //------------------------------------------------------------------ lldb::offset_t CopyByteOrderedData(lldb::offset_t src_offset, lldb::offset_t src_len, void *dst, lldb::offset_t dst_len, lldb::ByteOrder dst_byte_order) const; - //------------------------------------------------------------------ /// Get the data end pointer. /// /// \return /// Returns a pointer to the next byte contained in this /// object's data, or nullptr of there is no data in this object. - //------------------------------------------------------------------ const uint8_t *GetDataEnd() const { return m_end; } - //------------------------------------------------------------------ /// Get the shared data offset. /// /// Get the offset of the first byte of data in the shared data (if any). @@ -447,19 +407,15 @@ public: /// \return /// If this object contains shared data, this function returns /// the offset in bytes into that shared data, zero otherwise. - //------------------------------------------------------------------ size_t GetSharedDataOffset() const; - //------------------------------------------------------------------ /// Get the data start pointer. /// /// \return /// Returns a pointer to the first byte contained in this /// object's data, or nullptr of there is no data in this object. - //------------------------------------------------------------------ const uint8_t *GetDataStart() const { return m_start; } - //------------------------------------------------------------------ /// Extract a float from \a *offset_ptr. /// /// Extract a single float value. @@ -473,14 +429,12 @@ public: /// /// \return /// The floating value that was extracted, or zero on failure. - //------------------------------------------------------------------ float GetFloat(lldb::offset_t *offset_ptr) const; double GetDouble(lldb::offset_t *offset_ptr) const; long double GetLongDouble(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract an integer of size \a byte_size from \a *offset_ptr. /// /// Extract a single integer value and update the offset pointed to by \a @@ -500,10 +454,8 @@ public: /// /// \return /// The integer value that was extracted, or zero on failure. - //------------------------------------------------------------------ uint32_t GetMaxU32(lldb::offset_t *offset_ptr, size_t byte_size) const; - //------------------------------------------------------------------ /// Extract an unsigned integer of size \a byte_size from \a *offset_ptr. /// /// Extract a single unsigned integer value and update the offset pointed to @@ -525,13 +477,11 @@ public: /// \return /// The unsigned integer value that was extracted, or zero on /// failure. - //------------------------------------------------------------------ uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const; uint64_t GetMaxU64_unchecked(lldb::offset_t *offset_ptr, size_t byte_size) const; - //------------------------------------------------------------------ /// Extract an signed integer of size \a byte_size from \a *offset_ptr. /// /// Extract a single signed integer value (sign extending if required) and @@ -553,10 +503,8 @@ public: /// \return /// The sign extended signed integer value that was extracted, /// or zero on failure. - //------------------------------------------------------------------ int64_t GetMaxS64(lldb::offset_t *offset_ptr, size_t byte_size) const; - //------------------------------------------------------------------ /// Extract an unsigned integer of size \a byte_size from \a *offset_ptr, /// then extract the bitfield from this value if \a bitfield_bit_size is /// non-zero. @@ -591,12 +539,10 @@ public: /// \return /// The unsigned bitfield integer value that was extracted, or /// zero on failure. - //------------------------------------------------------------------ uint64_t GetMaxU64Bitfield(lldb::offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const; - //------------------------------------------------------------------ /// Extract an signed integer of size \a byte_size from \a *offset_ptr, then /// extract and signe extend the bitfield from this value if \a /// bitfield_bit_size is non-zero. @@ -631,12 +577,10 @@ public: /// \return /// The signed bitfield integer value that was extracted, or /// zero on failure. - //------------------------------------------------------------------ int64_t GetMaxS64Bitfield(lldb::offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const; - //------------------------------------------------------------------ /// Extract an pointer from \a *offset_ptr. /// /// Extract a single pointer from the data and update the offset pointed to @@ -653,19 +597,15 @@ public: /// /// \return /// The extracted pointer value as a 64 integer. - //------------------------------------------------------------------ uint64_t GetPointer(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Get the current byte order value. /// /// \return /// The current byte order value from this object's internal /// state. - //------------------------------------------------------------------ lldb::ByteOrder GetByteOrder() const { return m_byte_order; } - //------------------------------------------------------------------ /// Extract a uint8_t value from \a *offset_ptr. /// /// Extract a single uint8_t from the binary data at the offset pointed to @@ -680,7 +620,6 @@ public: /// /// \return /// The extracted uint8_t value. - //------------------------------------------------------------------ uint8_t GetU8(lldb::offset_t *offset_ptr) const; uint8_t GetU8_unchecked(lldb::offset_t *offset_ptr) const { @@ -694,7 +633,6 @@ public: uint32_t GetU32_unchecked(lldb::offset_t *offset_ptr) const; uint64_t GetU64_unchecked(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract \a count uint8_t values from \a *offset_ptr. /// /// Extract \a count uint8_t values from the binary data at the offset @@ -718,10 +656,8 @@ public: /// \return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. - //------------------------------------------------------------------ void *GetU8(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; - //------------------------------------------------------------------ /// Extract a uint16_t value from \a *offset_ptr. /// /// Extract a single uint16_t from the binary data at the offset pointed to @@ -736,10 +672,8 @@ public: /// /// \return /// The extracted uint16_t value. - //------------------------------------------------------------------ uint16_t GetU16(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract \a count uint16_t values from \a *offset_ptr. /// /// Extract \a count uint16_t values from the binary data at the offset @@ -763,10 +697,8 @@ public: /// \return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. - //------------------------------------------------------------------ void *GetU16(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; - //------------------------------------------------------------------ /// Extract a uint32_t value from \a *offset_ptr. /// /// Extract a single uint32_t from the binary data at the offset pointed to @@ -781,10 +713,8 @@ public: /// /// \return /// The extracted uint32_t value. - //------------------------------------------------------------------ uint32_t GetU32(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract \a count uint32_t values from \a *offset_ptr. /// /// Extract \a count uint32_t values from the binary data at the offset @@ -808,10 +738,8 @@ public: /// \return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. - //------------------------------------------------------------------ void *GetU32(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; - //------------------------------------------------------------------ /// Extract a uint64_t value from \a *offset_ptr. /// /// Extract a single uint64_t from the binary data at the offset pointed to @@ -826,10 +754,8 @@ public: /// /// \return /// The extracted uint64_t value. - //------------------------------------------------------------------ uint64_t GetU64(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract \a count uint64_t values from \a *offset_ptr. /// /// Extract \a count uint64_t values from the binary data at the offset @@ -853,10 +779,8 @@ public: /// \return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. - //------------------------------------------------------------------ void *GetU64(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; - //------------------------------------------------------------------ /// Extract a signed LEB128 value from \a *offset_ptr. /// /// Extracts an signed LEB128 number from this object's data starting at the @@ -873,10 +797,8 @@ public: /// /// \return /// The extracted signed integer value. - //------------------------------------------------------------------ int64_t GetSLEB128(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Extract a unsigned LEB128 value from \a *offset_ptr. /// /// Extracts an unsigned LEB128 number from this object's data starting at @@ -893,12 +815,10 @@ public: /// /// \return /// The extracted unsigned integer value. - //------------------------------------------------------------------ uint64_t GetULEB128(lldb::offset_t *offset_ptr) const; lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; } - //------------------------------------------------------------------ /// Peek at a C string at \a offset. /// /// Peeks at a string in the contained data. No verification is done to make @@ -911,10 +831,8 @@ public: /// \return /// A non-nullptr C string pointer if \a offset is a valid offset, /// nullptr otherwise. - //------------------------------------------------------------------ const char *PeekCStr(lldb::offset_t offset) const; - //------------------------------------------------------------------ /// Peek at a bytes at \a offset. /// /// Returns a pointer to \a length bytes at \a offset as long as there are @@ -924,14 +842,12 @@ public: /// A non-nullptr data pointer if \a offset is a valid offset and /// there are \a length bytes available at that offset, nullptr /// otherwise. - //------------------------------------------------------------------ const uint8_t *PeekData(lldb::offset_t offset, lldb::offset_t length) const { if (ValidOffsetForDataOfSize(offset, length)) return m_start + offset; return nullptr; } - //------------------------------------------------------------------ /// Set the address byte size. /// /// Set the size in bytes that will be used when extracting any address and @@ -939,7 +855,6 @@ public: /// /// \param[in] addr_size /// The size in bytes to use when extracting addresses. - //------------------------------------------------------------------ void SetAddressByteSize(uint32_t addr_size) { #ifdef LLDB_CONFIGURATION_DEBUG assert(addr_size == 4 || addr_size == 8); @@ -947,7 +862,6 @@ public: m_addr_size = addr_size; } - //------------------------------------------------------------------ /// Set data with a buffer that is caller owned. /// /// Use data that is owned by the caller when extracting values. The data @@ -966,11 +880,9 @@ public: /// /// \return /// The number of bytes that this object now contains. - //------------------------------------------------------------------ lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order); - //------------------------------------------------------------------ /// Adopt a subset of \a data. /// /// Set this object's data to be a subset of the data bytes in \a data. If @@ -993,11 +905,9 @@ public: /// /// \return /// The number of bytes that this object now contains. - //------------------------------------------------------------------ lldb::offset_t SetData(const DataExtractor &data, lldb::offset_t offset, lldb::offset_t length); - //------------------------------------------------------------------ /// Adopt a subset of shared data in \a data_sp. /// /// Copies the data shared pointer which adds a reference to the contained @@ -1020,12 +930,10 @@ public: /// /// \return /// The number of bytes that this object now contains. - //------------------------------------------------------------------ lldb::offset_t SetData(const lldb::DataBufferSP &data_sp, lldb::offset_t offset = 0, lldb::offset_t length = LLDB_INVALID_OFFSET); - //------------------------------------------------------------------ /// Set the byte_order value. /// /// Sets the byte order of the data to extract. Extracted values will be @@ -1033,10 +941,8 @@ public: /// /// \param[in] byte_order /// The byte order value to use when extracting data. - //------------------------------------------------------------------ void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; } - //------------------------------------------------------------------ /// Skip an LEB128 number at \a *offset_ptr. /// /// Skips a LEB128 number (signed or unsigned) from this object's data @@ -1053,27 +959,22 @@ public: /// /// \return // The number of bytes consumed during the extraction. - //------------------------------------------------------------------ uint32_t Skip_LEB128(lldb::offset_t *offset_ptr) const; - //------------------------------------------------------------------ /// Test the validity of \a offset. /// /// \return /// \b true if \a offset is a valid offset into the data in this /// object, \b false otherwise. - //------------------------------------------------------------------ bool ValidOffset(lldb::offset_t offset) const { return offset < GetByteSize(); } - //------------------------------------------------------------------ /// Test the availability of \a length bytes of data from \a offset. /// /// \return /// \b true if \a offset is a valid offset and there are \a /// length bytes available at that offset, \b false otherwise. - //------------------------------------------------------------------ bool ValidOffsetForDataOfSize(lldb::offset_t offset, lldb::offset_t length) const { return length <= BytesLeft(offset); @@ -1099,9 +1000,7 @@ public: } protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ const uint8_t *m_start; ///< A pointer to the first byte of data. const uint8_t *m_end; ///< A pointer to the byte that is past the end of the data. diff --git a/lldb/include/lldb/Utility/Event.h b/lldb/include/lldb/Utility/Event.h index c97b26f..c0e4e97 100644 --- a/lldb/include/lldb/Utility/Event.h +++ b/lldb/include/lldb/Utility/Event.h @@ -34,9 +34,7 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- // lldb::EventData -//---------------------------------------------------------------------- class EventData { friend class Event; @@ -55,14 +53,10 @@ private: DISALLOW_COPY_AND_ASSIGN(EventData); }; -//---------------------------------------------------------------------- // lldb::EventDataBytes -//---------------------------------------------------------------------- class EventDataBytes : public EventData { public: - //------------------------------------------------------------------ // Constructors - //------------------------------------------------------------------ EventDataBytes(); EventDataBytes(const char *cstr); @@ -73,9 +67,7 @@ public: ~EventDataBytes() override; - //------------------------------------------------------------------ // Member functions - //------------------------------------------------------------------ ConstString GetFlavor() const override; void Dump(Stream *s) const override; @@ -90,9 +82,7 @@ public: void SetBytesFromCString(const char *cstr); - //------------------------------------------------------------------ // Static functions - //------------------------------------------------------------------ static const EventDataBytes *GetEventDataFromEvent(const Event *event_ptr); static const void *GetBytesFromEvent(const Event *event_ptr); @@ -132,16 +122,12 @@ private: } }; -//---------------------------------------------------------------------- /// This class handles one or more StructuredData::Dictionary entries /// that are raised for structured data events. -//---------------------------------------------------------------------- class EventDataStructuredData : public EventData { public: - //------------------------------------------------------------------ // Constructors - //------------------------------------------------------------------ EventDataStructuredData(); EventDataStructuredData(const lldb::ProcessSP &process_sp, @@ -150,9 +136,7 @@ public: ~EventDataStructuredData() override; - //------------------------------------------------------------------ // Member functions - //------------------------------------------------------------------ ConstString GetFlavor() const override; void Dump(Stream *s) const override; @@ -169,9 +153,7 @@ public: void SetStructuredDataPlugin(const lldb::StructuredDataPluginSP &plugin_sp); - //------------------------------------------------------------------ // Static functions - //------------------------------------------------------------------ static const EventDataStructuredData * GetEventDataFromEvent(const Event *event_ptr); @@ -192,9 +174,7 @@ private: DISALLOW_COPY_AND_ASSIGN(EventDataStructuredData); }; -//---------------------------------------------------------------------- // lldb::Event -//---------------------------------------------------------------------- class Event { friend class Listener; friend class EventData; diff --git a/lldb/include/lldb/Utility/FileSpec.h b/lldb/include/lldb/Utility/FileSpec.h index 058235e2..9677000 100644 --- a/lldb/include/lldb/Utility/FileSpec.h +++ b/lldb/include/lldb/Utility/FileSpec.h @@ -37,7 +37,6 @@ template <typename T> class SmallVectorImpl; namespace lldb_private { -//---------------------------------------------------------------------- /// \class FileSpec FileSpec.h "lldb/Host/FileSpec.h" /// A file utility class. /// @@ -53,14 +52,12 @@ namespace lldb_private { /// are already split up, it makes it easy for us to compare only the /// basenames of a lot of file specifications without having to split up the /// file path each time to get to the basename. -//---------------------------------------------------------------------- class FileSpec { public: using Style = llvm::sys::path::Style; FileSpec(); - //------------------------------------------------------------------ /// Constructor with path. /// /// Takes a path to a file which can be just a filename, or a full path. If @@ -74,22 +71,18 @@ public: /// The style of the path /// /// \see FileSpec::SetFile (const char *path) - //------------------------------------------------------------------ explicit FileSpec(llvm::StringRef path, Style style = Style::native); explicit FileSpec(llvm::StringRef path, const llvm::Triple &Triple); - //------------------------------------------------------------------ /// Copy constructor /// /// Makes a copy of the uniqued directory and filename strings from \a rhs. /// /// \param[in] rhs /// A const FileSpec object reference to copy. - //------------------------------------------------------------------ FileSpec(const FileSpec &rhs); - //------------------------------------------------------------------ /// Copy constructor /// /// Makes a copy of the uniqued directory and filename strings from \a rhs @@ -97,19 +90,15 @@ public: /// /// \param[in] rhs /// A const FileSpec object pointer to copy if non-nullptr. - //------------------------------------------------------------------ FileSpec(const FileSpec *rhs); - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~FileSpec(); bool DirectoryEquals(const FileSpec &other) const; bool FileEquals(const FileSpec &other) const; - //------------------------------------------------------------------ /// Assignment operator. /// /// Makes a copy of the uniqued directory and filename strings from \a rhs. @@ -119,10 +108,8 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ const FileSpec &operator=(const FileSpec &rhs); - //------------------------------------------------------------------ /// Equal to operator /// /// Tests if this object is equal to \a rhs. @@ -134,10 +121,8 @@ public: /// \return /// \b true if this object is equal to \a rhs, \b false /// otherwise. - //------------------------------------------------------------------ bool operator==(const FileSpec &rhs) const; - //------------------------------------------------------------------ /// Not equal to operator /// /// Tests if this object is not equal to \a rhs. @@ -149,10 +134,8 @@ public: /// \return /// \b true if this object is equal to \a rhs, \b false /// otherwise. - //------------------------------------------------------------------ bool operator!=(const FileSpec &rhs) const; - //------------------------------------------------------------------ /// Less than to operator /// /// Tests if this object is less than \a rhs. @@ -164,10 +147,8 @@ public: /// \return /// \b true if this object is less than \a rhs, \b false /// otherwise. - //------------------------------------------------------------------ bool operator<(const FileSpec &rhs) const; - //------------------------------------------------------------------ /// Convert to pointer operator. /// /// This allows code to check a FileSpec object to see if it contains @@ -182,10 +163,8 @@ public: /// \return /// A pointer to this object if either the directory or filename /// is valid, nullptr otherwise. - //------------------------------------------------------------------ explicit operator bool() const; - //------------------------------------------------------------------ /// Logical NOT operator. /// /// This allows code to check a FileSpec object to see if it is invalid @@ -200,18 +179,14 @@ public: /// \return /// Returns \b true if the object has an empty directory and /// filename, \b false otherwise. - //------------------------------------------------------------------ bool operator!() const; - //------------------------------------------------------------------ /// Clears the object state. /// /// Clear this object by releasing both the directory and filename string /// values and reverting them to empty strings. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Compare two FileSpec objects. /// /// If \a full is true, then both the directory and the filename must match. @@ -237,7 +212,6 @@ public: /// \li -1 if \a lhs is less than \a rhs /// \li 0 if \a lhs is equal to \a rhs /// \li 1 if \a lhs is greater than \a rhs - //------------------------------------------------------------------ static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full); static bool Equal(const FileSpec &a, const FileSpec &b, bool full); @@ -249,16 +223,13 @@ public: /// unreliable (e.g. "c:\foo.txt" is a valid relative posix path). static llvm::Optional<Style> GuessPathStyle(llvm::StringRef absolute_path); - //------------------------------------------------------------------ /// Case sensitivity of path. /// /// \return /// \b true if the file path is case sensitive (POSIX), false /// if case insensitive (Windows). - //------------------------------------------------------------------ bool IsCaseSensitive() const { return m_style != Style::windows; } - //------------------------------------------------------------------ /// Dump this object to a Stream. /// /// Dump the object to the supplied stream \a s. If the object contains a @@ -267,69 +238,54 @@ public: /// /// \param[in] s /// The stream to which to dump the object description. - //------------------------------------------------------------------ void Dump(Stream *s) const; Style GetPathStyle() const; - //------------------------------------------------------------------ /// Directory string get accessor. /// /// \return /// A reference to the directory string object. - //------------------------------------------------------------------ ConstString &GetDirectory(); - //------------------------------------------------------------------ /// Directory string const get accessor. /// /// \return /// A const reference to the directory string object. - //------------------------------------------------------------------ ConstString GetDirectory() const; - //------------------------------------------------------------------ /// Filename string get accessor. /// /// \return /// A reference to the filename string object. - //------------------------------------------------------------------ ConstString &GetFilename(); - //------------------------------------------------------------------ /// Filename string const get accessor. /// /// \return /// A const reference to the filename string object. - //------------------------------------------------------------------ ConstString GetFilename() const; - //------------------------------------------------------------------ /// Returns true if the filespec represents an implementation source file /// (files with a ".c", ".cpp", ".m", ".mm" (many more) extension). /// /// \return /// \b true if the filespec represents an implementation source /// file, \b false otherwise. - //------------------------------------------------------------------ bool IsSourceImplementationFile() const; - //------------------------------------------------------------------ /// Returns true if the filespec represents a relative path. /// /// \return /// \b true if the filespec represents a relative path, /// \b false otherwise. - //------------------------------------------------------------------ bool IsRelative() const; - //------------------------------------------------------------------ /// Returns true if the filespec represents an absolute path. /// /// \return /// \b true if the filespec represents an absolute path, /// \b false otherwise. - //------------------------------------------------------------------ bool IsAbsolute() const; /// Make the FileSpec absolute by treating it relative to \a dir. Absolute @@ -339,7 +295,6 @@ public: /// Temporary helper for FileSystem change. void SetPath(llvm::StringRef p) { SetFile(p); } - //------------------------------------------------------------------ /// Extract the full path to the file. /// /// Extract the directory and path into a fixed buffer. This is needed as @@ -358,11 +313,9 @@ public: /// properly copied and terminated. If the return value is /// >= \a max_path_length, then the path was truncated (but is /// still NULL terminated). - //------------------------------------------------------------------ size_t GetPath(char *path, size_t max_path_length, bool denormalize = true) const; - //------------------------------------------------------------------ /// Extract the full path to the file. /// /// Extract the directory and path into a std::string, which is returned. @@ -370,12 +323,10 @@ public: /// \return /// Returns a std::string with the directory and filename /// concatenated. - //------------------------------------------------------------------ std::string GetPath(bool denormalize = true) const; const char *GetCString(bool denormalize = true) const; - //------------------------------------------------------------------ /// Extract the full path to the file. /// /// Extract the directory and path into an llvm::SmallVectorImpl<> @@ -383,11 +334,9 @@ public: /// \return /// Returns a std::string with the directory and filename /// concatenated. - //------------------------------------------------------------------ void GetPath(llvm::SmallVectorImpl<char> &path, bool denormalize = true) const; - //------------------------------------------------------------------ /// Extract the extension of the file. /// /// Returns a ConstString that represents the extension of the filename for @@ -397,10 +346,8 @@ public: /// /// \return /// Returns the extension of the file as a ConstString object. - //------------------------------------------------------------------ ConstString GetFileNameExtension() const; - //------------------------------------------------------------------ /// Return the filename without the extension part /// /// Returns a ConstString that represents the filename of this object @@ -410,10 +357,8 @@ public: /// \return /// Returns the filename without extension /// as a ConstString object. - //------------------------------------------------------------------ ConstString GetFileNameStrippingExtension() const; - //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// Return the size in bytes that this object takes in memory. This returns @@ -424,10 +369,8 @@ public: /// The number of bytes that this object occupies in memory. /// /// \see ConstString::StaticMemorySize () - //------------------------------------------------------------------ size_t MemorySize() const; - //------------------------------------------------------------------ /// Change the file specified with a new path. /// /// Update the contents of this object with a new path. The path will be @@ -440,14 +383,12 @@ public: /// \param[in] resolve_path /// If \b true, then we will try to resolve links the path using /// the static FileSpec::Resolve. - //------------------------------------------------------------------ void SetFile(llvm::StringRef path, Style style); void SetFile(llvm::StringRef path, const llvm::Triple &Triple); bool IsResolved() const { return m_is_resolved; } - //------------------------------------------------------------------ /// Set if the file path has been resolved or not. /// /// If you know a file path is already resolved and avoided passing a \b @@ -459,7 +400,6 @@ public: /// \param[in] is_resolved /// A boolean value that will replace the current value that /// indicates if the paths in this object have been resolved. - //------------------------------------------------------------------ void SetIsResolved(bool is_resolved) { m_is_resolved = is_resolved; } FileSpec CopyByAppendingPathComponent(llvm::StringRef component) const; @@ -471,35 +411,27 @@ public: void AppendPathComponent(llvm::StringRef component); void AppendPathComponent(const FileSpec &new_path); - //------------------------------------------------------------------ /// Removes the last path component by replacing the current path with its /// parent. When the current path has no parent, this is a no-op. /// /// \return /// A boolean value indicating whether the path was updated. - //------------------------------------------------------------------ bool RemoveLastPathComponent(); ConstString GetLastPathComponent() const; protected: - //------------------------------------------------------------------ // Convenience method for setting the file without changing the style. - //------------------------------------------------------------------ void SetFile(llvm::StringRef path); - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ ConstString m_directory; ///< The uniqued directory path ConstString m_filename; ///< The uniqued filename path mutable bool m_is_resolved = false; ///< True if this path has been resolved. Style m_style; ///< The syntax that this path uses (e.g. Windows / Posix) }; -//---------------------------------------------------------------------- /// Dump a FileSpec object to a stream -//---------------------------------------------------------------------- Stream &operator<<(Stream &s, const FileSpec &f); } // namespace lldb_private diff --git a/lldb/include/lldb/Utility/Flags.h b/lldb/include/lldb/Utility/Flags.h index dacc9de..6b8a458 100644 --- a/lldb/include/lldb/Utility/Flags.h +++ b/lldb/include/lldb/Utility/Flags.h @@ -14,21 +14,16 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Flags Flags.h "lldb/Utility/Flags.h" /// A class to manage flags. /// /// The Flags class managed flag bits and allows testing and modification of /// individual or multiple flag bits. -//---------------------------------------------------------------------- class Flags { public: - //---------------------------------------------------------------------- /// The value type for flags is a 32 bit unsigned integer type. - //---------------------------------------------------------------------- typedef uint32_t ValueType; - //---------------------------------------------------------------------- /// Construct with initial flag bit values. /// /// Constructs this object with \a mask as the initial value for all of the @@ -36,49 +31,37 @@ public: /// /// \param[in] mask /// The initial value for all flags. - //---------------------------------------------------------------------- Flags(ValueType flags = 0) : m_flags(flags) {} - //---------------------------------------------------------------------- /// Copy constructor. /// /// Construct and copy the flags from \a rhs. /// /// \param[in] rhs /// A const Flags object reference to copy. - //---------------------------------------------------------------------- Flags(const Flags &rhs) : m_flags(rhs.m_flags) {} - //---------------------------------------------------------------------- /// Destructor. - //---------------------------------------------------------------------- ~Flags() {} - //---------------------------------------------------------------------- /// Get accessor for all flags. /// /// \return /// Returns all of the flags as a Flags::ValueType. - //---------------------------------------------------------------------- ValueType Get() const { return m_flags; } - //---------------------------------------------------------------------- /// Return the number of flags that can be represented in this object. /// /// \return /// The maximum number bits in this flag object. - //---------------------------------------------------------------------- size_t GetBitSize() const { return sizeof(ValueType) * 8; } - //---------------------------------------------------------------------- /// Set accessor for all flags. /// /// \param[in] flags /// The bits with which to replace all of the current flags. - //---------------------------------------------------------------------- void Reset(ValueType flags) { m_flags = flags; } - //---------------------------------------------------------------------- /// Clear one or more flags. /// /// \param[in] mask @@ -86,13 +69,11 @@ public: /// /// \return /// The new flags after clearing all bits from \a mask. - //---------------------------------------------------------------------- ValueType Clear(ValueType mask = ~(ValueType)0) { m_flags &= ~mask; return m_flags; } - //---------------------------------------------------------------------- /// Set one or more flags by logical OR'ing \a mask with the current flags. /// /// \param[in] mask @@ -100,63 +81,50 @@ public: /// /// \return /// The new flags after setting all bits from \a mask. - //---------------------------------------------------------------------- ValueType Set(ValueType mask) { m_flags |= mask; return m_flags; } - //---------------------------------------------------------------------- /// Test if all bits in \a mask are 1 in the current flags /// /// \return /// \b true if all flags in \a mask are 1, \b false /// otherwise. - //---------------------------------------------------------------------- bool AllSet(ValueType mask) const { return (m_flags & mask) == mask; } - //---------------------------------------------------------------------- /// Test one or more flags. /// /// \return /// \b true if any flags in \a mask are 1, \b false /// otherwise. - //---------------------------------------------------------------------- bool AnySet(ValueType mask) const { return (m_flags & mask) != 0; } - //---------------------------------------------------------------------- /// Test a single flag bit. /// /// \return /// \b true if \a bit is set, \b false otherwise. - //---------------------------------------------------------------------- bool Test(ValueType bit) const { return (m_flags & bit) != 0; } - //---------------------------------------------------------------------- /// Test if all bits in \a mask are clear. /// /// \return /// \b true if \b all flags in \a mask are clear, \b false /// otherwise. - //---------------------------------------------------------------------- bool AllClear(ValueType mask) const { return (m_flags & mask) == 0; } bool AnyClear(ValueType mask) const { return (m_flags & mask) != mask; } - //---------------------------------------------------------------------- /// Test a single flag bit to see if it is clear (zero). /// /// \return /// \b true if \a bit is 0, \b false otherwise. - //---------------------------------------------------------------------- bool IsClear(ValueType bit) const { return (m_flags & bit) == 0; } - //---------------------------------------------------------------------- /// Get the number of zero bits in \a m_flags. /// /// \return /// The number of bits that are set to 0 in the current flags. - //---------------------------------------------------------------------- size_t ClearCount() const { size_t count = 0; for (ValueType shift = 0; shift < sizeof(ValueType) * 8; ++shift) { @@ -166,12 +134,10 @@ public: return count; } - //---------------------------------------------------------------------- /// Get the number of one bits in \a m_flags. /// /// \return /// The number of bits that are set to 1 in the current flags. - //---------------------------------------------------------------------- size_t SetCount() const { size_t count = 0; for (ValueType mask = m_flags; mask; mask >>= 1) { diff --git a/lldb/include/lldb/Utility/Listener.h b/lldb/include/lldb/Utility/Listener.h index 97c1b9f..21fb0b3 100644 --- a/lldb/include/lldb/Utility/Listener.h +++ b/lldb/include/lldb/Utility/Listener.h @@ -42,9 +42,7 @@ public: friend class Broadcaster; friend class BroadcasterManager; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ // // Listeners have to be constructed into shared pointers - at least if you // want them to listen to Broadcasters, @@ -99,9 +97,7 @@ public: size_t HandleBroadcastEvent(lldb::EventSP &event_sp); private: - //------------------------------------------------------------------ // Classes that inherit from Listener can see and modify these - //------------------------------------------------------------------ struct BroadcasterInfo { BroadcasterInfo(uint32_t mask, HandleBroadcastCallback cb = nullptr, void *ud = nullptr) @@ -149,9 +145,7 @@ private: // uint32_t event_mask, // bool exact); - //------------------------------------------------------------------ // For Listener only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(Listener); }; diff --git a/lldb/include/lldb/Utility/Log.h b/lldb/include/lldb/Utility/Log.h index 5abc01c..977f00f 100644 --- a/lldb/include/lldb/Utility/Log.h +++ b/lldb/include/lldb/Utility/Log.h @@ -31,9 +31,7 @@ namespace llvm { class raw_ostream; } -//---------------------------------------------------------------------- // Logging Options -//---------------------------------------------------------------------- #define LLDB_LOG_OPTION_THREADSAFE (1u << 0) #define LLDB_LOG_OPTION_VERBOSE (1u << 1) #define LLDB_LOG_OPTION_PREPEND_SEQUENCE (1u << 3) @@ -44,9 +42,7 @@ class raw_ostream; #define LLDB_LOG_OPTION_APPEND (1U << 8) #define LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION (1U << 9) -//---------------------------------------------------------------------- // Logging Functions -//---------------------------------------------------------------------- namespace lldb_private { class Log final { @@ -99,9 +95,7 @@ public: static void Initialize(); - //------------------------------------------------------------------ // Static accessors for logging channels - //------------------------------------------------------------------ static void Register(llvm::StringRef name, Channel &channel); static void Unregister(llvm::StringRef name); @@ -122,13 +116,11 @@ public: static void ListAllLogChannels(llvm::raw_ostream &stream); - //------------------------------------------------------------------ // Member functions // // These functions are safe to call at any time you have a Log* obtained from // the Channel class. If logging is disabled between you obtaining the Log // object and writing to it, the output will be silently discarded. - //------------------------------------------------------------------ Log(Channel &channel) : m_channel(channel) {} ~Log() = default; diff --git a/lldb/include/lldb/Utility/Logging.h b/lldb/include/lldb/Utility/Logging.h index 26146a8..34ece8e 100644 --- a/lldb/include/lldb/Utility/Logging.h +++ b/lldb/include/lldb/Utility/Logging.h @@ -11,9 +11,7 @@ #include <cstdint> -//---------------------------------------------------------------------- // Log Bits specific to logging in lldb -//---------------------------------------------------------------------- #define LIBLLDB_LOG_PROCESS (1u << 1) #define LIBLLDB_LOG_THREAD (1u << 2) #define LIBLLDB_LOG_DYNAMIC_LOADER (1u << 3) diff --git a/lldb/include/lldb/Utility/Predicate.h b/lldb/include/lldb/Utility/Predicate.h index 898e7a2..87298a9 100644 --- a/lldb/include/lldb/Utility/Predicate.h +++ b/lldb/include/lldb/Utility/Predicate.h @@ -20,9 +20,7 @@ //#define DB_PTHREAD_LOG_EVENTS -//---------------------------------------------------------------------- /// Enumerations for broadcasting. -//---------------------------------------------------------------------- namespace lldb_private { typedef enum { @@ -32,7 +30,6 @@ typedef enum { /// modified. } PredicateBroadcastType; -//---------------------------------------------------------------------- /// \class Predicate Predicate.h "lldb/Utility/Predicate.h" /// A C++ wrapper class for providing threaded access to a value of /// type T. @@ -41,18 +38,14 @@ typedef enum { /// of type T. Threads can efficiently wait for bits within T to be set /// or reset, or wait for T to be set to be equal/not equal to a /// specified values. -//---------------------------------------------------------------------- template <class T> class Predicate { public: - //------------------------------------------------------------------ /// Default constructor. /// /// Initializes the mutex, condition and value with their default /// constructors. - //------------------------------------------------------------------ Predicate() : m_value(), m_mutex(), m_condition() {} - //------------------------------------------------------------------ /// Construct with initial T value \a initial_value. /// /// Initializes the mutex and condition with their default @@ -60,18 +53,14 @@ public: /// /// \param[in] initial_value /// The initial value for our T object. - //------------------------------------------------------------------ Predicate(T initial_value) : m_value(initial_value), m_mutex(), m_condition() {} - //------------------------------------------------------------------ /// Destructor. /// /// Destroy the condition, mutex, and T objects. - //------------------------------------------------------------------ ~Predicate() = default; - //------------------------------------------------------------------ /// Value get accessor. /// /// Copies the current \a m_value in a thread safe manor and returns @@ -79,14 +68,12 @@ public: /// /// \return /// A copy of the current value. - //------------------------------------------------------------------ T GetValue() const { std::lock_guard<std::mutex> guard(m_mutex); T value = m_value; return value; } - //------------------------------------------------------------------ /// Value set accessor. /// /// Set the contained \a m_value to \a new_value in a thread safe @@ -100,7 +87,6 @@ public: /// PredicateBroadcastType enumeration for details. /// /// \see Predicate::Broadcast() - //------------------------------------------------------------------ void SetValue(T value, PredicateBroadcastType broadcast_type) { std::lock_guard<std::mutex> guard(m_mutex); #ifdef DB_PTHREAD_LOG_EVENTS @@ -113,7 +99,6 @@ public: Broadcast(old_value, broadcast_type); } - //------------------------------------------------------------------ /// Wait for Cond(m_value) to be true. /// /// Waits in a thread safe way for Cond(m_value) to be true. If Cond(m_value) @@ -134,7 +119,6 @@ public: /// \return /// \li m_value if Cond(m_value) is true. /// \li None otherwise (timeout occurred). - //------------------------------------------------------------------ template <typename C> llvm::Optional<T> WaitFor(C Cond, const Timeout<std::micro> &timeout) { std::unique_lock<std::mutex> lock(m_mutex); @@ -147,7 +131,6 @@ public: return m_value; return llvm::None; } - //------------------------------------------------------------------ /// Wait for \a m_value to be equal to \a value. /// /// Waits in a thread safe way for \a m_value to be equal to \a @@ -170,14 +153,12 @@ public: /// \return /// \li \b true if the \a m_value is equal to \a value /// \li \b false otherwise (timeout occurred) - //------------------------------------------------------------------ bool WaitForValueEqualTo(T value, const Timeout<std::micro> &timeout = llvm::None) { return WaitFor([&value](T current) { return value == current; }, timeout) != llvm::None; } - //------------------------------------------------------------------ /// Wait for \a m_value to not be equal to \a value. /// /// Waits in a thread safe way for \a m_value to not be equal to \a @@ -200,7 +181,6 @@ public: /// \return /// \li m_value if m_value != value /// \li None otherwise (timeout occurred). - //------------------------------------------------------------------ llvm::Optional<T> WaitForValueNotEqualTo(T value, const Timeout<std::micro> &timeout = llvm::None) { @@ -208,10 +188,8 @@ public: } protected: - //---------------------------------------------------------------------- // pthread condition and mutex variable to control access and allow blocking // between the main thread and the spotlight index thread. - //---------------------------------------------------------------------- T m_value; ///< The templatized value T that we are protecting access to mutable std::mutex m_mutex; ///< The mutex to use when accessing the data std::condition_variable m_condition; ///< The pthread condition variable to @@ -219,7 +197,6 @@ protected: /// or changed. private: - //------------------------------------------------------------------ /// Broadcast if needed. /// /// Check to see if we need to broadcast to our condition variable @@ -233,7 +210,6 @@ private: /// /// If \a broadcast_type is eBroadcastOnChange, the condition /// variable be broadcast if the owned value changes. - //------------------------------------------------------------------ void Broadcast(T old_value, PredicateBroadcastType broadcast_type) { bool broadcast = (broadcast_type == eBroadcastAlways) || diff --git a/lldb/include/lldb/Utility/ProcessInfo.h b/lldb/include/lldb/Utility/ProcessInfo.h index 41161ef..a25c06c 100644 --- a/lldb/include/lldb/Utility/ProcessInfo.h +++ b/lldb/include/lldb/Utility/ProcessInfo.h @@ -22,14 +22,12 @@ namespace lldb_private { class UserIDResolver; -//---------------------------------------------------------------------- // ProcessInfo // // A base class for information for a process. This can be used to fill // out information for a process prior to launching it, or it can be used for // an instance of a process and can be filled in with the existing values for // that process. -//---------------------------------------------------------------------- class ProcessInfo { public: ProcessInfo(); @@ -103,12 +101,10 @@ protected: lldb::pid_t m_pid; }; -//---------------------------------------------------------------------- // ProcessInstanceInfo // // Describes an existing process and any discoverable information that pertains // to that process. -//---------------------------------------------------------------------- class ProcessInstanceInfo : public ProcessInfo { public: ProcessInstanceInfo() @@ -199,11 +195,9 @@ protected: std::vector<ProcessInstanceInfo> m_infos; }; -//---------------------------------------------------------------------- // ProcessInstanceInfoMatch // // A class to help matching one ProcessInstanceInfo to another. -//---------------------------------------------------------------------- class ProcessInstanceInfoMatch { public: diff --git a/lldb/include/lldb/Utility/RangeMap.h b/lldb/include/lldb/Utility/RangeMap.h index f55be02..bea08d3 100644 --- a/lldb/include/lldb/Utility/RangeMap.h +++ b/lldb/include/lldb/Utility/RangeMap.h @@ -21,15 +21,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- // Templatized classes for dealing with generic ranges and also collections of // ranges, or collections of ranges that have associated data. -//---------------------------------------------------------------------- -//---------------------------------------------------------------------- // A simple range class where you get to define the type of the range // base "B", and the type used for the range byte size "S". -//---------------------------------------------------------------------- template <typename B, typename S> struct Range { typedef B BaseType; typedef S SizeType; @@ -126,10 +122,8 @@ template <typename B, typename S> struct Range { } }; -//---------------------------------------------------------------------- // A range array class where you get to define the type of the ranges // that the collection contains. -//---------------------------------------------------------------------- template <typename B, typename S, unsigned N> class RangeArray { public: @@ -591,11 +585,9 @@ protected: Collection m_entries; }; -//---------------------------------------------------------------------- // A simple range with data class where you get to define the type of // the range base "B", the type used for the range byte size "S", and the type // for the associated data "T". -//---------------------------------------------------------------------- template <typename B, typename S, typename T> struct RangeData : public Range<B, S> { typedef T DataType; @@ -824,11 +816,9 @@ protected: Collection m_entries; }; -//---------------------------------------------------------------------- // A simple range with data class where you get to define the type of // the range base "B", the type used for the range byte size "S", and the type // for the associated data "T". -//---------------------------------------------------------------------- template <typename B, typename T> struct AddressData { typedef B BaseType; typedef T DataType; diff --git a/lldb/include/lldb/Utility/RegularExpression.h b/lldb/include/lldb/Utility/RegularExpression.h index a35c0d9..54f3dd8 100644 --- a/lldb/include/lldb/Utility/RegularExpression.h +++ b/lldb/include/lldb/Utility/RegularExpression.h @@ -48,7 +48,6 @@ class StringRef; namespace lldb_private { -//---------------------------------------------------------------------- /// \class RegularExpression RegularExpression.h /// "lldb/Utility/RegularExpression.h" /// A C++ wrapper class for regex. @@ -56,7 +55,6 @@ namespace lldb_private { /// This regular expression class wraps the posix regex functions \c /// regcomp(), \c regerror(), \c regexec(), and \c regfree() from the header /// file in \c /usr/include/regex\.h. -//---------------------------------------------------------------------- class RegularExpression { public: class Match { @@ -94,29 +92,24 @@ public: m_matches; ///< Where parenthesized subexpressions results are stored }; - //------------------------------------------------------------------ /// Default constructor. /// /// The default constructor that initializes the object state such that it /// contains no compiled regular expression. - //------------------------------------------------------------------ RegularExpression(); explicit RegularExpression(llvm::StringRef string); - //------------------------------------------------------------------ /// Destructor. /// /// Any previously compiled regular expression contained in this object will /// be freed. - //------------------------------------------------------------------ ~RegularExpression(); RegularExpression(const RegularExpression &rhs); const RegularExpression &operator=(const RegularExpression &rhs); - //------------------------------------------------------------------ /// Compile a regular expression. /// /// Compile a regular expression using the supplied regular expression text. @@ -132,11 +125,9 @@ public: /// \return /// \b true if the regular expression compiles successfully, /// \b false otherwise. - //------------------------------------------------------------------ bool Compile(llvm::StringRef string); bool Compile(const char *) = delete; - //------------------------------------------------------------------ /// Executes a regular expression. /// /// Execute a regular expression match using the compiled regular expression @@ -156,21 +147,17 @@ public: /// \return /// \b true if \a string matches the compiled regular /// expression, \b false otherwise. - //------------------------------------------------------------------ bool Execute(llvm::StringRef string, Match *match = nullptr) const; bool Execute(const char *, Match * = nullptr) = delete; size_t GetErrorAsCString(char *err_str, size_t err_str_max_len) const; - //------------------------------------------------------------------ /// Free the compiled regular expression. /// /// If this object contains a valid compiled regular expression, this /// function will free any resources it was consuming. - //------------------------------------------------------------------ void Free(); - //------------------------------------------------------------------ /// Access the regular expression text. /// /// Returns the text that was used to compile the current regular @@ -179,10 +166,8 @@ public: /// \return /// The NULL terminated C string that was used to compile the /// current regular expression - //------------------------------------------------------------------ llvm::StringRef GetText() const; - //------------------------------------------------------------------ /// Test if valid. /// /// Test if this object contains a valid regular expression. @@ -190,7 +175,6 @@ public: /// \return /// \b true if the regular expression compiled and is ready /// for execution, \b false otherwise. - //------------------------------------------------------------------ bool IsValid() const; void Clear() { @@ -204,9 +188,7 @@ public: bool operator<(const RegularExpression &rhs) const; private: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ std::string m_re; ///< A copy of the original regular expression text int m_comp_err; ///< Status code for the regular expression compilation regex_t m_preg; ///< The compiled regular expression diff --git a/lldb/include/lldb/Utility/Scalar.h b/lldb/include/lldb/Utility/Scalar.h index ac8cf0a..633bfeb 100644 --- a/lldb/include/lldb/Utility/Scalar.h +++ b/lldb/include/lldb/Utility/Scalar.h @@ -32,12 +32,10 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- // A class designed to hold onto values and their corresponding types. // Operators are defined and Scalar objects will correctly promote their types // and values before performing these operations. Type promotion currently // follows the ANSI C type promotion rules. -//---------------------------------------------------------------------- class Scalar { public: enum Type { @@ -59,9 +57,7 @@ public: e_long_double }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ Scalar(); Scalar(int v) : m_type(e_sint), m_float((float)0) { m_integer = llvm::APInt(sizeof(int) * 8, v, true); @@ -171,12 +167,10 @@ public: static Scalar::Type GetValueTypeForFloatWithByteSize(size_t byte_size); - //---------------------------------------------------------------------- // All operators can benefits from the implicit conversions that will happen // automagically by the compiler, so no temporary objects will need to be // created. As a result, we currently don't need a variety of overloaded set // value accessors. - //---------------------------------------------------------------------- Scalar &operator=(const int i); Scalar &operator=(unsigned int v); Scalar &operator=(long v); @@ -193,41 +187,29 @@ public: Scalar &operator>>=(const Scalar &rhs); // Shift right (arithmetic) Scalar &operator&=(const Scalar &rhs); - //---------------------------------------------------------------------- // Shifts the current value to the right without maintaining the current sign // of the value (if it is signed). - //---------------------------------------------------------------------- bool ShiftRightLogical(const Scalar &rhs); // Returns true on success - //---------------------------------------------------------------------- // Takes the absolute value of the current value if it is signed, else the // value remains unchanged. Returns false if the contained value has a void // type. - //---------------------------------------------------------------------- bool AbsoluteValue(); // Returns true on success - //---------------------------------------------------------------------- // Negates the current value (even for unsigned values). Returns false if the // contained value has a void type. - //---------------------------------------------------------------------- bool UnaryNegate(); // Returns true on success - //---------------------------------------------------------------------- // Inverts all bits in the current value as long as it isn't void or a // float/double/long double type. Returns false if the contained value has a // void/float/double/long double type, else the value is inverted and true is // returned. - //---------------------------------------------------------------------- bool OnesComplement(); // Returns true on success - //---------------------------------------------------------------------- // Access the type of the current value. - //---------------------------------------------------------------------- Scalar::Type GetType() const { return m_type; } - //---------------------------------------------------------------------- // Returns a casted value of the current contained data without modifying the // current value. FAIL_VALUE will be returned if the type of the value is // void or invalid. - //---------------------------------------------------------------------- int SInt(int fail_value = 0) const; unsigned char UChar(unsigned char fail_value = 0) const; @@ -302,9 +284,7 @@ protected: typedef double double_t; typedef long double long_double_t; - //------------------------------------------------------------------ // Classes that inherit from Scalar can see and modify these - //------------------------------------------------------------------ Scalar::Type m_type; llvm::APInt m_integer; llvm::APFloat m_float; @@ -329,7 +309,6 @@ private: friend bool operator>=(const Scalar &lhs, const Scalar &rhs); }; -//---------------------------------------------------------------------- // Split out the operators into a format where the compiler will be able to // implicitly convert numbers into Scalar objects. // @@ -343,7 +322,6 @@ private: // Item 19 of "Effective C++ Second Edition" by Scott Meyers // Differentiate among members functions, non-member functions, and // friend functions -//---------------------------------------------------------------------- const Scalar operator+(const Scalar &lhs, const Scalar &rhs); const Scalar operator-(const Scalar &lhs, const Scalar &rhs); const Scalar operator/(const Scalar &lhs, const Scalar &rhs); diff --git a/lldb/include/lldb/Utility/State.h b/lldb/include/lldb/Utility/State.h index 75258ed..9ff755f 100644 --- a/lldb/include/lldb/Utility/State.h +++ b/lldb/include/lldb/Utility/State.h @@ -17,7 +17,6 @@ namespace lldb_private { -//------------------------------------------------------------------ /// Converts a StateType to a C string. /// /// \param[in] state @@ -27,10 +26,8 @@ namespace lldb_private { /// A NULL terminated C string that describes \a state. The /// returned string comes from constant string buffers and does /// not need to be freed. -//------------------------------------------------------------------ const char *StateAsCString(lldb::StateType state); -//------------------------------------------------------------------ /// Check if a state represents a state where the process or thread /// is running. /// @@ -40,10 +37,8 @@ const char *StateAsCString(lldb::StateType state); /// \return /// \b true if the state represents a process or thread state /// where the process or thread is running, \b false otherwise. -//------------------------------------------------------------------ bool StateIsRunningState(lldb::StateType state); -//------------------------------------------------------------------ /// Check if a state represents a state where the process or thread /// is stopped. Stopped can mean stopped when the process is still /// around, or stopped when the process has exited or doesn't exist @@ -63,7 +58,6 @@ bool StateIsRunningState(lldb::StateType state); /// \b true, then the process can't be exited or unloaded, /// otherwise exited and unloaded or other states where the /// process no longer exists are considered to be stopped. -//------------------------------------------------------------------ bool StateIsStoppedState(lldb::StateType state, bool must_exist); const char *GetPermissionsAsCString(uint32_t permissions); diff --git a/lldb/include/lldb/Utility/Status.h b/lldb/include/lldb/Utility/Status.h index f960631..e8fae8a 100644 --- a/lldb/include/lldb/Utility/Status.h +++ b/lldb/include/lldb/Utility/Status.h @@ -26,7 +26,6 @@ class raw_ostream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class Status Status.h "lldb/Utility/Status.h" An error handling class. /// /// This class is designed to be able to hold any error code that can be @@ -42,16 +41,12 @@ namespace lldb_private { /// of themselves for printing results and error codes. The string value will /// be fetched on demand and its string value will be cached until the error /// is cleared of the value of the error changes. -//---------------------------------------------------------------------- class Status { public: - //------------------------------------------------------------------ /// Every error value that this object can contain needs to be able to fit /// into ValueType. - //------------------------------------------------------------------ typedef uint32_t ValueType; - //------------------------------------------------------------------ /// Default constructor. /// /// Initialize the error object with a generic success value. @@ -61,7 +56,6 @@ public: /// /// \param[in] type /// The type for \a err. - //------------------------------------------------------------------ Status(); explicit Status(ValueType err, @@ -73,7 +67,6 @@ public: __attribute__((format(printf, 2, 3))); Status(const Status &rhs); - //------------------------------------------------------------------ /// Assignment operator. /// /// \param[in] err @@ -81,7 +74,6 @@ public: /// /// \return /// A const reference to this object. - //------------------------------------------------------------------ const Status &operator=(const Status &rhs); ~Status(); @@ -91,7 +83,6 @@ public: const Status &operator=(llvm::Error error); llvm::Error ToError() const; - //------------------------------------------------------------------ /// Get the error string associated with the current error. // /// Gets the error value as a NULL terminated C string. The error string @@ -103,43 +94,33 @@ public: /// The error as a NULL terminated C string value if the error /// is valid and is able to be converted to a string value, /// NULL otherwise. - //------------------------------------------------------------------ const char *AsCString(const char *default_error_str = "unknown error") const; - //------------------------------------------------------------------ /// Clear the object state. /// /// Reverts the state of this object to contain a generic success value and /// frees any cached error string value. - //------------------------------------------------------------------ void Clear(); - //------------------------------------------------------------------ /// Test for error condition. /// /// \return /// \b true if this object contains an error, \b false /// otherwise. - //------------------------------------------------------------------ bool Fail() const; - //------------------------------------------------------------------ /// Access the error value. /// /// \return /// The error value. - //------------------------------------------------------------------ ValueType GetError() const; - //------------------------------------------------------------------ /// Access the error type. /// /// \return /// The error type enumeration value. - //------------------------------------------------------------------ lldb::ErrorType GetType() const; - //------------------------------------------------------------------ /// Set accessor from a kern_return_t. /// /// Set accesssor for the error value to \a err and the error type to \c @@ -147,7 +128,6 @@ public: /// /// \param[in] err /// A mach error code. - //------------------------------------------------------------------ void SetMachError(uint32_t err); void SetExpressionError(lldb::ExpressionResults, const char *mssg); @@ -155,7 +135,6 @@ public: int SetExpressionErrorWithFormat(lldb::ExpressionResults, const char *format, ...) __attribute__((format(printf, 3, 4))); - //------------------------------------------------------------------ /// Set accesssor with an error value and type. /// /// Set accesssor for the error value to \a err and the error type to \a @@ -166,26 +145,20 @@ public: /// /// \param[in] type /// The type for \a err. - //------------------------------------------------------------------ void SetError(ValueType err, lldb::ErrorType type); - //------------------------------------------------------------------ /// Set the current error to errno. /// /// Update the error value to be \c errno and update the type to be \c /// Status::POSIX. - //------------------------------------------------------------------ void SetErrorToErrno(); - //------------------------------------------------------------------ /// Set the current error to a generic error. /// /// Update the error value to be \c LLDB_GENERIC_ERROR and update the type /// to be \c Status::Generic. - //------------------------------------------------------------------ void SetErrorToGenericError(); - //------------------------------------------------------------------ /// Set the current error string to \a err_str. /// /// Set accessor for the error string value for a generic errors, or to @@ -197,15 +170,12 @@ public: /// /// \param err_str /// The new custom error string to copy and cache. - //------------------------------------------------------------------ void SetErrorString(llvm::StringRef err_str); - //------------------------------------------------------------------ /// Set the current error string to a formatted error string. /// /// \param format /// A printf style format string - //------------------------------------------------------------------ int SetErrorStringWithFormat(const char *format, ...) __attribute__((format(printf, 2, 3))); @@ -216,7 +186,6 @@ public: SetErrorString(llvm::formatv(format, std::forward<Args>(args)...).str()); } - //------------------------------------------------------------------ /// Test for success condition. /// /// Returns true if the error code in this object is considered a successful @@ -225,10 +194,8 @@ public: /// \return /// \b true if this object contains an value that describes /// success (non-erro), \b false otherwise. - //------------------------------------------------------------------ bool Success() const; - //------------------------------------------------------------------ /// Test for a failure due to a generic interrupt. /// /// Returns true if the error code in this object was caused by an @@ -237,13 +204,10 @@ public: /// \return /// \b true if this object contains an value that describes /// failure due to interrupt, \b false otherwise. - //------------------------------------------------------------------ bool WasInterrupted() const; protected: - //------------------------------------------------------------------ /// Member variables - //------------------------------------------------------------------ ValueType m_code; ///< Status code as an integer value. lldb::ErrorType m_type; ///< The type of the above error code. mutable std::string m_string; ///< A string representation of the error code. diff --git a/lldb/include/lldb/Utility/Stream.h b/lldb/include/lldb/Utility/Stream.h index 4608459..b24d4e4 100644 --- a/lldb/include/lldb/Utility/Stream.h +++ b/lldb/include/lldb/Utility/Stream.h @@ -23,15 +23,11 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class Stream Stream.h "lldb/Utility/Stream.h" /// A stream class that can stream formatted output to a file. -//---------------------------------------------------------------------- class Stream { public: - //------------------------------------------------------------------ /// \a m_flags bit values. - //------------------------------------------------------------------ enum { eBinary = (1 << 0) ///< Get and put data as binary instead of as the default /// string mode. @@ -56,19 +52,15 @@ public: size_t operator*() const { return m_stream->GetWrittenBytes() - m_start; } }; - //------------------------------------------------------------------ /// Construct with flags and address size and byte order. /// /// Construct with dump flags \a flags and the default address size. \a /// flags can be any of the above enumeration logical OR'ed together. - //------------------------------------------------------------------ Stream(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); - //------------------------------------------------------------------ /// Construct a default Stream, not binary, host byte order and host addr /// size. /// - //------------------------------------------------------------------ Stream(); // FIXME: Streams should not be copyable. @@ -82,24 +74,17 @@ public: return *this; } - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ virtual ~Stream(); - //------------------------------------------------------------------ // Subclasses must override these methods - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Flush the stream. /// /// Subclasses should flush the stream to make any output appear if the /// stream has any buffering. - //------------------------------------------------------------------ virtual void Flush() = 0; - //------------------------------------------------------------------ /// Output character bytes to the stream. /// /// Appends \a src_len characters from the buffer \a src to the stream. @@ -112,7 +97,6 @@ public: /// /// \return /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ size_t Write(const void *src, size_t src_len) { size_t appended_byte_count = WriteImpl(src, src_len); m_bytes_written += appended_byte_count; @@ -121,12 +105,9 @@ public: size_t GetWrittenBytes() const { return m_bytes_written; } - //------------------------------------------------------------------ // Member functions - //------------------------------------------------------------------ size_t PutChar(char ch); - //------------------------------------------------------------------ /// Set the byte_order value. /// /// Sets the byte order of the data to extract. Extracted values will be @@ -137,10 +118,8 @@ public: /// /// \return /// The old byte order value. - //------------------------------------------------------------------ lldb::ByteOrder SetByteOrder(lldb::ByteOrder byte_order); - //------------------------------------------------------------------ /// Format a C string from a printf style format and variable arguments and /// encode and append the resulting C string as hex bytes. /// @@ -152,11 +131,9 @@ public: /// /// \return /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ size_t PrintfAsRawHex8(const char *format, ...) __attribute__((__format__(__printf__, 2, 3))); - //------------------------------------------------------------------ /// Append an uint8_t value in the hexadecimal format to the stream. /// /// \param[in] uvalue @@ -164,7 +141,6 @@ public: /// /// \return /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ size_t PutHex8(uint8_t uvalue); size_t PutNHex8(size_t n, uint8_t uvalue); @@ -205,7 +181,6 @@ public: size_t PutStringAsRawHex8(llvm::StringRef s); - //------------------------------------------------------------------ /// Output a NULL terminated C string \a cstr to the stream \a s. /// /// \param[in] cstr @@ -214,12 +189,10 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(const char *cstr); Stream &operator<<(llvm::StringRef str); - //------------------------------------------------------------------ /// Output a pointer value \a p to the stream \a s. /// /// \param[in] p @@ -228,10 +201,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(const void *p); - //------------------------------------------------------------------ /// Output a character \a ch to the stream \a s. /// /// \param[in] ch @@ -240,10 +211,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(char ch); - //------------------------------------------------------------------ /// Output a uint8_t \a uval to the stream \a s. /// /// \param[in] uval @@ -252,10 +221,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(uint8_t uval); - //------------------------------------------------------------------ /// Output a uint16_t \a uval to the stream \a s. /// /// \param[in] uval @@ -264,10 +231,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(uint16_t uval); - //------------------------------------------------------------------ /// Output a uint32_t \a uval to the stream \a s. /// /// \param[in] uval @@ -276,10 +241,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(uint32_t uval); - //------------------------------------------------------------------ /// Output a uint64_t \a uval to the stream \a s. /// /// \param[in] uval @@ -288,10 +251,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(uint64_t uval); - //------------------------------------------------------------------ /// Output a int8_t \a sval to the stream \a s. /// /// \param[in] sval @@ -300,10 +261,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(int8_t sval); - //------------------------------------------------------------------ /// Output a int16_t \a sval to the stream \a s. /// /// \param[in] sval @@ -312,10 +271,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(int16_t sval); - //------------------------------------------------------------------ /// Output a int32_t \a sval to the stream \a s. /// /// \param[in] sval @@ -324,10 +281,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(int32_t sval); - //------------------------------------------------------------------ /// Output a int64_t \a sval to the stream \a s. /// /// \param[in] sval @@ -336,10 +291,8 @@ public: /// \return /// A reference to this class so multiple things can be streamed /// in one statement. - //------------------------------------------------------------------ Stream &operator<<(int64_t sval); - //------------------------------------------------------------------ /// Output an address value to this stream. /// /// Put an address \a addr out to the stream with optional \a prefix and \a @@ -356,11 +309,9 @@ public: /// /// \param[in] suffix /// A suffix C string. If nullptr, no suffix will be output. - //------------------------------------------------------------------ void Address(uint64_t addr, uint32_t addr_size, const char *prefix = nullptr, const char *suffix = nullptr); - //------------------------------------------------------------------ /// Output an address range to this stream. /// /// Put an address range \a lo_addr - \a hi_addr out to the stream with @@ -380,67 +331,51 @@ public: /// /// \param[in] suffix /// A suffix C string. If nullptr, no suffix will be output. - //------------------------------------------------------------------ void AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix = nullptr, const char *suffix = nullptr); - //------------------------------------------------------------------ /// Output a C string to the stream. /// /// Print a C string \a cstr to the stream. /// /// \param[in] cstr /// The string to be output to the stream. - //------------------------------------------------------------------ size_t PutCString(llvm::StringRef cstr); - //------------------------------------------------------------------ /// Output and End of Line character to the stream. - //------------------------------------------------------------------ size_t EOL(); - //------------------------------------------------------------------ /// Get the address size in bytes. /// /// \return /// The size of an address in bytes that is used when outputting /// address and pointer values to the stream. - //------------------------------------------------------------------ uint32_t GetAddressByteSize() const; - //------------------------------------------------------------------ /// The flags accessor. /// /// \return /// A reference to the Flags member variable. - //------------------------------------------------------------------ Flags &GetFlags(); - //------------------------------------------------------------------ /// The flags const accessor. /// /// \return /// A const reference to the Flags member variable. - //------------------------------------------------------------------ const Flags &GetFlags() const; - //------------------------------------------------------------------ //// The byte order accessor. //// //// \return //// The byte order. - //------------------------------------------------------------------ lldb::ByteOrder GetByteOrder() const; - //------------------------------------------------------------------ /// Get the current indentation level. /// /// \return /// The current indentation level as an integer. - //------------------------------------------------------------------ int GetIndentLevel() const; - //------------------------------------------------------------------ /// Indent the current line in the stream. /// /// Indent the current line using the current indentation level and print an @@ -449,21 +384,15 @@ public: /// \param[in] s /// A C string to print following the indentation. If nullptr, just /// output the indentation characters. - //------------------------------------------------------------------ size_t Indent(const char *s = nullptr); size_t Indent(llvm::StringRef s); - //------------------------------------------------------------------ /// Decrement the current indentation level. - //------------------------------------------------------------------ void IndentLess(int amount = 2); - //------------------------------------------------------------------ /// Increment the current indentation level. - //------------------------------------------------------------------ void IndentMore(int amount = 2); - //------------------------------------------------------------------ /// Output an offset value. /// /// Put an offset \a uval out to the stream using the printf format in \a @@ -474,10 +403,8 @@ public: /// /// \param[in] format /// The printf style format to use when outputting the offset. - //------------------------------------------------------------------ void Offset(uint32_t offset, const char *format = "0x%8.8x: "); - //------------------------------------------------------------------ /// Output printf formatted output to the stream. /// /// Print some formatted output to the stream. @@ -488,7 +415,6 @@ public: /// \param[in] ... /// Variable arguments that are needed for the printf style /// format string \a format. - //------------------------------------------------------------------ size_t Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); size_t PrintfVarArg(const char *format, va_list args); @@ -497,7 +423,6 @@ public: PutCString(llvm::formatv(format, std::forward<Args>(args)...).str()); } - //------------------------------------------------------------------ /// Output a quoted C string value to the stream. /// /// Print a double quoted NULL terminated C string to the stream using the @@ -508,27 +433,21 @@ public: /// /// \param[in] format /// The optional C string format that can be overridden. - //------------------------------------------------------------------ void QuotedCString(const char *cstr, const char *format = "\"%s\""); - //------------------------------------------------------------------ /// Set the address size in bytes. /// /// \param[in] addr_size /// The new size in bytes of an address to use when outputting /// address and pointer values. - //------------------------------------------------------------------ void SetAddressByteSize(uint32_t addr_size); - //------------------------------------------------------------------ /// Set the current indentation level. /// /// \param[in] level /// The new indentation level. - //------------------------------------------------------------------ void SetIndentLevel(int level); - //------------------------------------------------------------------ /// Output a SLEB128 number to the stream. /// /// Put an SLEB128 \a uval out to the stream using the printf format in \a @@ -536,10 +455,8 @@ public: /// /// \param[in] uval /// A uint64_t value that was extracted as a SLEB128 value. - //------------------------------------------------------------------ size_t PutSLEB128(int64_t uval); - //------------------------------------------------------------------ /// Output a ULEB128 number to the stream. /// /// Put an ULEB128 \a uval out to the stream using the printf format in \a @@ -547,20 +464,15 @@ public: /// /// \param[in] uval /// A uint64_t value that was extracted as a ULEB128 value. - //------------------------------------------------------------------ size_t PutULEB128(uint64_t uval); - //------------------------------------------------------------------ /// Returns a raw_ostream that forwards the data to this Stream object. - //------------------------------------------------------------------ llvm::raw_ostream &AsRawOstream() { return m_forwarder; } protected: - //------------------------------------------------------------------ // Member variables - //------------------------------------------------------------------ Flags m_flags; ///< Dump flags. uint32_t m_addr_size; ///< Size of an address in bytes. lldb::ByteOrder @@ -570,7 +482,6 @@ protected: void _PutHex8(uint8_t uvalue, bool add_prefix); - //------------------------------------------------------------------ /// Output character bytes to the stream. /// /// Appends \a src_len characters from the buffer \a src to the stream. @@ -583,15 +494,12 @@ protected: /// /// \return /// The number of bytes that were appended to the stream. - //------------------------------------------------------------------ virtual size_t WriteImpl(const void *src, size_t src_len) = 0; - //---------------------------------------------------------------------- /// \class RawOstreamForward Stream.h "lldb/Utility/Stream.h" /// This is a wrapper class that exposes a raw_ostream interface that just /// forwards to an LLDB stream, allowing to reuse LLVM algorithms that take /// a raw_ostream within the LLDB code base. - //---------------------------------------------------------------------- class RawOstreamForward : public llvm::raw_ostream { // Note: This stream must *not* maintain its own buffer, but instead // directly write everything to the internal Stream class. Without this, diff --git a/lldb/include/lldb/Utility/StreamGDBRemote.h b/lldb/include/lldb/Utility/StreamGDBRemote.h index 465135e..dd0ea31 100644 --- a/lldb/include/lldb/Utility/StreamGDBRemote.h +++ b/lldb/include/lldb/Utility/StreamGDBRemote.h @@ -26,7 +26,6 @@ public: ~StreamGDBRemote() override; - //------------------------------------------------------------------ /// Output a block of data to the stream performing GDB-remote escaping. /// /// \param[in] s @@ -37,7 +36,6 @@ public: /// /// \return /// Number of bytes written. - //------------------------------------------------------------------ // TODO: Convert this function to take ArrayRef<uint8_t> int PutEscapedBytes(const void *s, size_t src_len); }; diff --git a/lldb/include/lldb/Utility/StringExtractor.h b/lldb/include/lldb/Utility/StringExtractor.h index c815ea9..6d5579e 100644 --- a/lldb/include/lldb/Utility/StringExtractor.h +++ b/lldb/include/lldb/Utility/StringExtractor.h @@ -19,18 +19,14 @@ class StringExtractor { public: enum { BigEndian = 0, LittleEndian = 1 }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StringExtractor(); StringExtractor(llvm::StringRef packet_str); StringExtractor(const char *packet_cstr); StringExtractor(const StringExtractor &rhs); virtual ~StringExtractor(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const StringExtractor &operator=(const StringExtractor &rhs); void Reset(llvm::StringRef str) { @@ -121,9 +117,7 @@ protected: m_index = UINT64_MAX; return false; } - //------------------------------------------------------------------ // For StringExtractor only - //------------------------------------------------------------------ std::string m_packet; // The string in which to extract data. uint64_t m_index; // When extracting data from a packet, this index // will march along as things get extracted. If set to diff --git a/lldb/include/lldb/Utility/StructuredData.h b/lldb/include/lldb/Utility/StructuredData.h index 80b9ea0..7e8569c 100644 --- a/lldb/include/lldb/Utility/StructuredData.h +++ b/lldb/include/lldb/Utility/StructuredData.h @@ -35,7 +35,6 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class StructuredData StructuredData.h "lldb/Utility/StructuredData.h" /// A class which can hold structured data /// @@ -48,7 +47,6 @@ namespace lldb_private { /// data it is holding; it can parse JSON data, for instance, and other parts /// of lldb can iterate through the parsed data set to find keys and values /// that may be present. -//---------------------------------------------------------------------- class StructuredData { public: diff --git a/lldb/include/lldb/Utility/Timer.h b/lldb/include/lldb/Utility/Timer.h index 1c6e007..0d2e8d8 100644 --- a/lldb/include/lldb/Utility/Timer.h +++ b/lldb/include/lldb/Utility/Timer.h @@ -17,10 +17,8 @@ namespace lldb_private { class Stream; -//---------------------------------------------------------------------- /// \class Timer Timer.h "lldb/Utility/Timer.h" /// A timer class that simplifies common timing metrics. -//---------------------------------------------------------------------- class Timer { public: @@ -37,15 +35,11 @@ public: DISALLOW_COPY_AND_ASSIGN(Category); }; - //-------------------------------------------------------------- /// Default constructor. - //-------------------------------------------------------------- Timer(Category &category, const char *format, ...) __attribute__((format(printf, 3, 4))); - //-------------------------------------------------------------- /// Destructor - //-------------------------------------------------------------- ~Timer(); void Dump(); diff --git a/lldb/include/lldb/Utility/UUID.h b/lldb/include/lldb/Utility/UUID.h index f412c66..dbeb9db 100644 --- a/lldb/include/lldb/Utility/UUID.h +++ b/lldb/include/lldb/Utility/UUID.h @@ -76,7 +76,6 @@ public: // Decode as many UUID bytes (up to 16) as possible from the C string "cstr" // This is used for auto completion where a partial UUID might have been // typed in. It - //------------------------------------------------------------------ /// Decode as many UUID bytes (up to 16) as possible from the C /// string \a cstr. /// @@ -91,7 +90,6 @@ public: /// /// \return /// The original string, with all decoded bytes removed. - //------------------------------------------------------------------ static llvm::StringRef DecodeUUIDBytesFromString(llvm::StringRef str, llvm::SmallVectorImpl<uint8_t> &uuid_bytes, diff --git a/lldb/include/lldb/Utility/UserID.h b/lldb/include/lldb/Utility/UserID.h index 71342bc..802f7ac 100644 --- a/lldb/include/lldb/Utility/UserID.h +++ b/lldb/include/lldb/Utility/UserID.h @@ -17,7 +17,6 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- /// \class UserID UserID.h "lldb/Core/UserID.h" /// A mix in class that contains a generic user ID. /// @@ -31,42 +30,30 @@ namespace lldb_private { /// Symbol table entries can use this to store the original symbol table /// index, functions can use it to store the symbol table index or the /// DWARF offset. -//---------------------------------------------------------------------- struct UserID { - //------------------------------------------------------------------ /// Construct with optional user ID. - //------------------------------------------------------------------ UserID(lldb::user_id_t uid = LLDB_INVALID_UID) : m_uid(uid) {} - //------------------------------------------------------------------ /// Destructor. - //------------------------------------------------------------------ ~UserID() {} - //------------------------------------------------------------------ /// Clears the object state. /// /// Clears the object contents back to a default invalid state. - //------------------------------------------------------------------ void Clear() { m_uid = LLDB_INVALID_UID; } - //------------------------------------------------------------------ /// Get accessor for the user ID. /// /// \return /// The user ID. - //------------------------------------------------------------------ lldb::user_id_t GetID() const { return m_uid; } - //------------------------------------------------------------------ /// Set accessor for the user ID. /// /// \param[in] uid /// The new user ID. - //------------------------------------------------------------------ void SetID(lldb::user_id_t uid) { m_uid = uid; } - //------------------------------------------------------------------ /// Unary predicate function object that can search for a matching user ID. /// /// Function object that can be used on any class that inherits from UserID: @@ -74,30 +61,21 @@ struct UserID { /// iterator pos; /// pos = std::find_if (coll.begin(), coll.end(), UserID::IDMatches(blockID)); /// \endcode - //------------------------------------------------------------------ class IDMatches { public: - //-------------------------------------------------------------- /// Construct with the user ID to look for. - //-------------------------------------------------------------- IDMatches(lldb::user_id_t uid) : m_uid(uid) {} - //-------------------------------------------------------------- /// Unary predicate function object callback. - //-------------------------------------------------------------- bool operator()(const UserID &rhs) const { return m_uid == rhs.GetID(); } private: - //-------------------------------------------------------------- // Member variables. - //-------------------------------------------------------------- const lldb::user_id_t m_uid; ///< The user ID we are looking for }; protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ lldb::user_id_t m_uid; ///< The user ID that uniquely identifies an object. }; @@ -109,9 +87,7 @@ inline bool operator!=(const UserID &lhs, const UserID &rhs) { return lhs.GetID() != rhs.GetID(); } -//-------------------------------------------------------------- /// Stream the UserID object to a Stream. -//-------------------------------------------------------------- Stream &operator<<(Stream &strm, const UserID &uid); } // namespace lldb_private diff --git a/lldb/include/lldb/Utility/VMRange.h b/lldb/include/lldb/Utility/VMRange.h index 7a9a6b3..9c2f9d0 100644 --- a/lldb/include/lldb/Utility/VMRange.h +++ b/lldb/include/lldb/Utility/VMRange.h @@ -21,10 +21,8 @@ class Stream; namespace lldb_private { -//---------------------------------------------------------------------- // A vm address range. These can represent offsets ranges or actual // addresses. -//---------------------------------------------------------------------- class VMRange { public: typedef std::vector<VMRange> collection; diff --git a/lldb/include/lldb/lldb-defines.h b/lldb/include/lldb/lldb-defines.h index 4fe5676..b879644 100644 --- a/lldb/include/lldb/lldb-defines.h +++ b/lldb/include/lldb/lldb-defines.h @@ -35,31 +35,23 @@ #define UINT64_MAX 18446744073709551615ULL #endif -//---------------------------------------------------------------------- // LLDB version // // A build script phase can modify this version number if needed. -//---------------------------------------------------------------------- //#define LLDB_VERSION //#define LLDB_REVISION //#define LLDB_VERSION_STRING -//---------------------------------------------------------------------- // LLDB defines -//---------------------------------------------------------------------- #define LLDB_GENERIC_ERROR UINT32_MAX -//---------------------------------------------------------------------- // Breakpoints -//---------------------------------------------------------------------- #define LLDB_INVALID_BREAK_ID 0 #define LLDB_DEFAULT_BREAK_SIZE 0 #define LLDB_BREAK_ID_IS_VALID(bid) ((bid) != (LLDB_INVALID_BREAK_ID)) #define LLDB_BREAK_ID_IS_INTERNAL(bid) ((bid) < 0) -//---------------------------------------------------------------------- // Watchpoints -//---------------------------------------------------------------------- #define LLDB_INVALID_WATCH_ID 0 #define LLDB_WATCH_ID_IS_VALID(uid) ((uid) != (LLDB_INVALID_WATCH_ID)) #define LLDB_WATCH_TYPE_READ (1u << 0) @@ -67,9 +59,7 @@ #define LLDB_WATCH_TYPE_IS_VALID(type) \ ((type | LLDB_WATCH_TYPE_READ) || (type | LLDB_WATCH_TYPE_WRITE)) -//---------------------------------------------------------------------- // Generic Register Numbers -//---------------------------------------------------------------------- #define LLDB_REGNUM_GENERIC_PC 0 // Program Counter #define LLDB_REGNUM_GENERIC_SP 1 // Stack Pointer #define LLDB_REGNUM_GENERIC_FP 2 // Frame Pointer @@ -91,9 +81,7 @@ 11 // The register that would contain pointer size or less argument 7 (if any) #define LLDB_REGNUM_GENERIC_ARG8 \ 12 // The register that would contain pointer size or less argument 8 (if any) -//--------------------------------------------------------------------- /// Invalid value definitions -//---------------------------------------------------------------------- #define LLDB_INVALID_ADDRESS UINT64_MAX #define LLDB_INVALID_INDEX32 UINT32_MAX #define LLDB_INVALID_IVAR_OFFSET UINT32_MAX @@ -109,17 +97,13 @@ #define LLDB_INVALID_LINE_NUMBER UINT32_MAX #define LLDB_INVALID_QUEUE_ID 0 -//---------------------------------------------------------------------- /// CPU Type definitions -//---------------------------------------------------------------------- #define LLDB_ARCH_DEFAULT "systemArch" #define LLDB_ARCH_DEFAULT_32BIT "systemArch32" #define LLDB_ARCH_DEFAULT_64BIT "systemArch64" #define LLDB_INVALID_CPUTYPE (0xFFFFFFFEu) -//---------------------------------------------------------------------- /// Option Set definitions -//---------------------------------------------------------------------- // FIXME: I'm sure there's some #define magic that can create all 32 sets on the // fly. That would have the added benefit of making this unreadable. #define LLDB_MAX_NUM_OPTION_SETS 32 @@ -151,11 +135,9 @@ #if defined(__cplusplus) -//---------------------------------------------------------------------- /// \def DISALLOW_COPY_AND_ASSIGN(TypeName) /// Macro definition for easily disallowing copy constructor and /// assignment operators in C++ classes. -//---------------------------------------------------------------------- #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName &) = delete; \ const TypeName &operator=(const TypeName &) = delete diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 671f0ab..0920bdf 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -69,9 +69,7 @@ namespace lldb { -//---------------------------------------------------------------------- // Process and Thread States -//---------------------------------------------------------------------- enum StateType { eStateInvalid = 0, eStateUnloaded, ///< Process is object is valid, but not currently loaded @@ -95,9 +93,7 @@ enum StateType { kLastStateType = eStateSuspended }; -//---------------------------------------------------------------------- // Launch Flags -//---------------------------------------------------------------------- FLAGS_ENUM(LaunchFlags){ eLaunchFlagNone = 0u, eLaunchFlagExec = (1u << 0), ///< Exec when launching and turn the calling @@ -130,14 +126,10 @@ FLAGS_ENUM(LaunchFlags){ eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit }; -//---------------------------------------------------------------------- // Thread Run Modes -//---------------------------------------------------------------------- enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping }; -//---------------------------------------------------------------------- // Byte ordering definitions -//---------------------------------------------------------------------- enum ByteOrder { eByteOrderInvalid = 0, eByteOrderBig = 1, @@ -145,9 +137,7 @@ enum ByteOrder { eByteOrderLittle = 4 }; -//---------------------------------------------------------------------- // Register encoding definitions -//---------------------------------------------------------------------- enum Encoding { eEncodingInvalid = 0, eEncodingUint, // unsigned integer @@ -156,9 +146,7 @@ enum Encoding { eEncodingVector // vector registers }; -//---------------------------------------------------------------------- // Display format definitions -//---------------------------------------------------------------------- enum Format { eFormatDefault = 0, eFormatInvalid = 0, @@ -208,10 +196,8 @@ enum Format { kNumFormats }; -//---------------------------------------------------------------------- // Description levels for "void GetDescription(Stream *, DescriptionLevel)" // calls -//---------------------------------------------------------------------- enum DescriptionLevel { eDescriptionLevelBrief = 0, eDescriptionLevelFull, @@ -220,9 +206,7 @@ enum DescriptionLevel { kNumDescriptionLevels }; -//---------------------------------------------------------------------- // Script interpreter types -//---------------------------------------------------------------------- enum ScriptLanguage { eScriptLanguageNone, eScriptLanguagePython, @@ -230,11 +214,9 @@ enum ScriptLanguage { eScriptLanguageUnknown }; -//---------------------------------------------------------------------- // Register numbering types // See RegisterContext::ConvertRegisterKindToRegisterNumber to convert any of // these to the lldb internal register numbering scheme (eRegisterKindLLDB). -//---------------------------------------------------------------------- enum RegisterKind { eRegisterKindEHFrame = 0, // the register numbers seen in eh_frame eRegisterKindDWARF, // the register numbers seen DWARF @@ -246,9 +228,7 @@ enum RegisterKind { kNumRegisterKinds }; -//---------------------------------------------------------------------- // Thread stop reasons -//---------------------------------------------------------------------- enum StopReason { eStopReasonInvalid = 0, eStopReasonNone, @@ -263,9 +243,7 @@ enum StopReason { eStopReasonInstrumentation }; -//---------------------------------------------------------------------- // Command Return Status Types -//---------------------------------------------------------------------- enum ReturnStatus { eReturnStatusInvalid, eReturnStatusSuccessFinishNoResult, @@ -277,9 +255,7 @@ enum ReturnStatus { eReturnStatusQuit }; -//---------------------------------------------------------------------- // The results of expression evaluation: -//---------------------------------------------------------------------- enum ExpressionResults { eExpressionCompleted = 0, eExpressionSetupError, @@ -303,9 +279,7 @@ enum SearchDepth { kLastSearchDepthKind = eSearchDepthAddress }; -//---------------------------------------------------------------------- // Connection Status Types -//---------------------------------------------------------------------- enum ConnectionStatus { eConnectionStatusSuccess, // Success eConnectionStatusEndOfFile, // End-of-file encountered @@ -338,9 +312,7 @@ enum ValueType { eValueTypeVariableThreadLocal = 8 // thread local storage variable }; -//---------------------------------------------------------------------- // Token size/granularities for Input Readers -//---------------------------------------------------------------------- enum InputReaderGranularity { eInputReaderGranularityInvalid = 0, @@ -350,7 +322,6 @@ enum InputReaderGranularity { eInputReaderGranularityAll }; -//------------------------------------------------------------------ /// These mask bits allow a common interface for queries that can /// limit the amount of information that gets parsed to only the /// information that is requested. These bits also can indicate what @@ -359,7 +330,6 @@ enum InputReaderGranularity { /// Each definition corresponds to a one of the member variables /// in this class, and requests that that item be resolved, or /// indicates that the member did get resolved. -//------------------------------------------------------------------ FLAGS_ENUM(SymbolContextItem){ eSymbolContextTarget = (1u << 0), ///< Set when \a target is requested from /// a query, or was located in query @@ -446,14 +416,12 @@ FLAGS_ENUM(WatchpointEventType){ eWatchpointEventTypeThreadChanged = (1u << 11), eWatchpointEventTypeTypeChanged = (1u << 12)}; -//---------------------------------------------------------------------- /// Programming language type. /// /// These enumerations use the same language enumerations as the DWARF /// specification for ease of use and consistency. /// The enum -> string code is in Language.cpp, don't change this /// table without updating that code as well. -//---------------------------------------------------------------------- enum LanguageType { eLanguageTypeUnknown = 0x0000, ///< Unknown or invalid language value. eLanguageTypeC89 = 0x0001, ///< ISO C:1989. @@ -623,9 +591,7 @@ enum CommandArgumentType { // enumeration!! }; -//---------------------------------------------------------------------- // Symbol types -//---------------------------------------------------------------------- enum SymbolType { eSymbolTypeAny = 0, eSymbolTypeInvalid = 0, @@ -747,9 +713,7 @@ FLAGS_ENUM(FunctionNameType){ }; LLDB_MARK_AS_BITMASK_ENUM(FunctionNameType) -//---------------------------------------------------------------------- // Basic types enumeration for the public API SBType::GetBasicType() -//---------------------------------------------------------------------- enum BasicType { eBasicTypeInvalid = 0, eBasicTypeVoid = 1, @@ -834,10 +798,8 @@ enum TemplateArgumentKind { eTemplateArgumentKindNullPtr, }; -//---------------------------------------------------------------------- // Options that can be set for a formatter to alter its behavior Not all of // these are applicable to all formatter types -//---------------------------------------------------------------------- FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u), eTypeOptionCascade = (1u << 0), eTypeOptionSkipPointers = (1u << 1), @@ -851,7 +813,6 @@ FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u), eTypeOptionFrontEndWantsDereference = (1u << 9) }; -//---------------------------------------------------------------------- // This is the return value for frame comparisons. If you are comparing frame // A to frame B the following cases arise: 1) When frame A pushes frame B (or a // frame that ends up pushing B) A is Older than B. 2) When frame A pushed @@ -863,7 +824,6 @@ FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u), // 5) If the two frames are on different threads or processes the comparison is // Invalid 6) If for some reason we can't figure out what went on, we return // Unknown. -//---------------------------------------------------------------------- enum FrameComparison { eFrameCompareInvalid, eFrameCompareUnknown, @@ -873,12 +833,10 @@ enum FrameComparison { eFrameCompareOlder }; -//---------------------------------------------------------------------- // File Permissions // // Designed to mimic the unix file permission bits so they can be used with // functions that set 'mode_t' to certain values for permissions. -//---------------------------------------------------------------------- FLAGS_ENUM(FilePermissions){ eFilePermissionsUserRead = (1u << 8), eFilePermissionsUserWrite = (1u << 7), eFilePermissionsUserExecute = (1u << 6), @@ -934,35 +892,29 @@ FLAGS_ENUM(FilePermissions){ eFilePermissionsDirectoryDefault = eFilePermissionsUserRWX, }; -//---------------------------------------------------------------------- // Queue work item types // // The different types of work that can be enqueued on a libdispatch aka Grand // Central Dispatch (GCD) queue. -//---------------------------------------------------------------------- enum QueueItemKind { eQueueItemKindUnknown = 0, eQueueItemKindFunction, eQueueItemKindBlock }; -//---------------------------------------------------------------------- // Queue type // libdispatch aka Grand Central Dispatch (GCD) queues can be either serial // (executing on one thread) or concurrent (executing on multiple threads). -//---------------------------------------------------------------------- enum QueueKind { eQueueKindUnknown = 0, eQueueKindSerial, eQueueKindConcurrent }; -//---------------------------------------------------------------------- // Expression Evaluation Stages // These are the cancellable stages of expression evaluation, passed to the // expression evaluation callback, so that you can interrupt expression // evaluation at the various points in its lifecycle. -//---------------------------------------------------------------------- enum ExpressionEvaluationPhase { eExpressionEvaluationParse = 0, eExpressionEvaluationIRGen, @@ -970,11 +922,9 @@ enum ExpressionEvaluationPhase { eExpressionEvaluationComplete }; -//---------------------------------------------------------------------- // Watchpoint Kind // Indicates what types of events cause the watchpoint to fire. Used by Native // *Protocol-related classes. -//---------------------------------------------------------------------- FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0), eWatchpointKindRead = (1u << 1)}; @@ -987,11 +937,9 @@ enum GdbSignal { eGdbSignalBreakpoint = 0x96 }; -//---------------------------------------------------------------------- // Used with SBHost::GetPath (lldb::PathType) to find files that are related to // LLDB on the current host machine. Most files are relative to LLDB or are in // known locations. -//---------------------------------------------------------------------- enum PathType { ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB // mach-o file in LLDB.framework (MacOSX) exists @@ -1008,10 +956,8 @@ enum PathType { ePathTypeClangDir // Find path to Clang builtin headers }; -//---------------------------------------------------------------------- // Kind of member function // Used by the type system -//---------------------------------------------------------------------- enum MemberFunctionKind { eMemberFunctionKindUnknown = 0, // Not sure what the type of this is eMemberFunctionKindConstructor, // A function used to create instances @@ -1023,14 +969,10 @@ enum MemberFunctionKind { // than any instance }; -//---------------------------------------------------------------------- // String matching algorithm used by SBTarget -//---------------------------------------------------------------------- enum MatchType { eMatchTypeNormal, eMatchTypeRegex, eMatchTypeStartsWith }; -//---------------------------------------------------------------------- // Bitmask that describes details about a type -//---------------------------------------------------------------------- FLAGS_ENUM(TypeFlags){ eTypeHasChildren = (1u << 0), eTypeHasValue = (1u << 1), eTypeIsArray = (1u << 2), eTypeIsBlock = (1u << 3), @@ -1046,7 +988,6 @@ FLAGS_ENUM(TypeFlags){ eTypeInstanceIsPointer = (1u << 22)}; FLAGS_ENUM(CommandFlags){ - //---------------------------------------------------------------------- // eCommandRequiresTarget // // Ensures a valid target is contained in m_exe_ctx prior to executing the @@ -1054,9 +995,7 @@ FLAGS_ENUM(CommandFlags){ // and CommandObject::GetInvalidTargetDescription() will be returned as the // error. CommandObject subclasses can override the virtual function for // GetInvalidTargetDescription() to provide custom strings when needed. - //---------------------------------------------------------------------- eCommandRequiresTarget = (1u << 0), - //---------------------------------------------------------------------- // eCommandRequiresProcess // // Ensures a valid process is contained in m_exe_ctx prior to executing the @@ -1065,9 +1004,7 @@ FLAGS_ENUM(CommandFlags){ // the error. CommandObject subclasses can override the virtual function // for GetInvalidProcessDescription() to provide custom strings when // needed. - //---------------------------------------------------------------------- eCommandRequiresProcess = (1u << 1), - //---------------------------------------------------------------------- // eCommandRequiresThread // // Ensures a valid thread is contained in m_exe_ctx prior to executing the @@ -1075,9 +1012,7 @@ FLAGS_ENUM(CommandFlags){ // and CommandObject::GetInvalidThreadDescription() will be returned as the // error. CommandObject subclasses can override the virtual function for // GetInvalidThreadDescription() to provide custom strings when needed. - //---------------------------------------------------------------------- eCommandRequiresThread = (1u << 2), - //---------------------------------------------------------------------- // eCommandRequiresFrame // // Ensures a valid frame is contained in m_exe_ctx prior to executing the @@ -1085,9 +1020,7 @@ FLAGS_ENUM(CommandFlags){ // and CommandObject::GetInvalidFrameDescription() will be returned as the // error. CommandObject subclasses can override the virtual function for // GetInvalidFrameDescription() to provide custom strings when needed. - //---------------------------------------------------------------------- eCommandRequiresFrame = (1u << 3), - //---------------------------------------------------------------------- // eCommandRequiresRegContext // // Ensures a valid register context (from the selected frame if there is a @@ -1097,34 +1030,25 @@ FLAGS_ENUM(CommandFlags){ // CommandObject::GetInvalidRegContextDescription() will be returned as the // error. CommandObject subclasses can override the virtual function for // GetInvalidRegContextDescription() to provide custom strings when needed. - //---------------------------------------------------------------------- eCommandRequiresRegContext = (1u << 4), - //---------------------------------------------------------------------- // eCommandTryTargetAPILock // // Attempts to acquire the target lock if a target is selected in the // command interpreter. If the command object fails to acquire the API // lock, the command will fail with an appropriate error message. - //---------------------------------------------------------------------- eCommandTryTargetAPILock = (1u << 5), - //---------------------------------------------------------------------- // eCommandProcessMustBeLaunched // // Verifies that there is a launched process in m_exe_ctx, if there isn't, // the command will fail with an appropriate error message. - //---------------------------------------------------------------------- eCommandProcessMustBeLaunched = (1u << 6), - //---------------------------------------------------------------------- // eCommandProcessMustBePaused // // Verifies that there is a paused process in m_exe_ctx, if there isn't, // the command will fail with an appropriate error message. - //---------------------------------------------------------------------- eCommandProcessMustBePaused = (1u << 7)}; -//---------------------------------------------------------------------- // Whether a summary should cap how much data it returns to users or not -//---------------------------------------------------------------------- enum TypeSummaryCapping { eTypeSummaryCapped = true, eTypeSummaryUncapped = false diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index ab13820..93a38b3 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -13,9 +13,7 @@ #include "lldb/Utility/SharingPtr.h" -//---------------------------------------------------------------------- // lldb forward declarations -//---------------------------------------------------------------------- namespace lldb_private { class ABI; @@ -301,9 +299,7 @@ struct LineEntry; } // namespace lldb_private -//---------------------------------------------------------------------- // lldb forward declarations -//---------------------------------------------------------------------- namespace lldb { typedef std::shared_ptr<lldb_private::ABI> ABISP; @@ -492,9 +488,7 @@ typedef std::shared_ptr<lldb_private::Watchpoint> WatchpointSP; } // namespace lldb -//---------------------------------------------------------------------- // llvm forward declarations -//---------------------------------------------------------------------- namespace llvm { struct ItaniumPartialDemangler; diff --git a/lldb/include/lldb/lldb-private-enumerations.h b/lldb/include/lldb/lldb-private-enumerations.h index 9b4134b..e494ea8 100644 --- a/lldb/include/lldb/lldb-private-enumerations.h +++ b/lldb/include/lldb/lldb-private-enumerations.h @@ -15,9 +15,7 @@ namespace lldb_private { -//---------------------------------------------------------------------- // Thread Step Types -//---------------------------------------------------------------------- typedef enum StepType { eStepTypeNone, eStepTypeTrace, ///< Single step one instruction. @@ -28,9 +26,7 @@ typedef enum StepType { eStepTypeScripted ///< A step type implemented by the script interpreter. } StepType; -//---------------------------------------------------------------------- // Address Types -//---------------------------------------------------------------------- typedef enum AddressType { eAddressTypeInvalid = 0, eAddressTypeFile, ///< Address is an address as found in an object or symbol @@ -41,7 +37,6 @@ typedef enum AddressType { ///this code } AddressType; -//---------------------------------------------------------------------- // Address Class // // A way of classifying an address used for disassembling and setting @@ -50,7 +45,6 @@ typedef enum AddressType { // beyond just looking at the section types. For example, code might contain PC // relative data and the object file might be able to tell us that an address // in code is data. -//---------------------------------------------------------------------- enum class AddressClass { eInvalid, eUnknown, @@ -61,9 +55,7 @@ enum class AddressClass { eRuntime }; -//---------------------------------------------------------------------- // Votes - Need a tri-state, yes, no, no opinion... -//---------------------------------------------------------------------- typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote; typedef enum ArchitectureType { @@ -74,10 +66,8 @@ typedef enum ArchitectureType { kNumArchTypes } ArchitectureType; -//---------------------------------------------------------------------- /// Settable state variable types. /// -//---------------------------------------------------------------------- // typedef enum SettableVariableType //{ @@ -123,20 +113,16 @@ typedef enum SortOrder { eSortOrderByName } SortOrder; -//---------------------------------------------------------------------- // LazyBool is for boolean values that need to be calculated lazily. Values // start off set to eLazyBoolCalculate, and then they can be calculated once // and set to eLazyBoolNo or eLazyBoolYes. -//---------------------------------------------------------------------- typedef enum LazyBool { eLazyBoolCalculate = -1, eLazyBoolNo = 0, eLazyBoolYes = 1 } LazyBool; -//------------------------------------------------------------------ /// Instruction types -//------------------------------------------------------------------ typedef enum InstructionType { eInstructionTypeAny, // Support for any instructions at all (at least one) eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions @@ -148,9 +134,7 @@ typedef enum InstructionType { } InstructionType; -//------------------------------------------------------------------ /// Format category entry types -//------------------------------------------------------------------ typedef enum FormatCategoryItem { eFormatCategoryItemSummary = 0x0001, eFormatCategoryItemRegexSummary = 0x0002, @@ -164,9 +148,7 @@ typedef enum FormatCategoryItem { eFormatCategoryItemRegexValidator = 0x0200 } FormatCategoryItem; -//------------------------------------------------------------------ /// Expression execution policies -//------------------------------------------------------------------ typedef enum { eExecutionPolicyOnlyWhenNeeded, eExecutionPolicyNever, @@ -174,9 +156,7 @@ typedef enum { eExecutionPolicyTopLevel // used for top-level code } ExecutionPolicy; -//---------------------------------------------------------------------- // Ways that the FormatManager picks a particular format for a type -//---------------------------------------------------------------------- typedef enum FormatterChoiceCriterion { eFormatterChoiceCriterionDirectChoice = 0x00000000, eFormatterChoiceCriterionStrippedPointerReference = 0x00000001, @@ -188,9 +168,7 @@ typedef enum FormatterChoiceCriterion { eFormatterChoiceCriterionWentToStaticValue = 0x00000020 } FormatterChoiceCriterion; -//---------------------------------------------------------------------- // Synchronicity behavior of scripted commands -//---------------------------------------------------------------------- typedef enum ScriptedCommandSynchronicity { eScriptedCommandSynchronicitySynchronous, eScriptedCommandSynchronicityAsynchronous, @@ -198,9 +176,7 @@ typedef enum ScriptedCommandSynchronicity { // synchronicity is } ScriptedCommandSynchronicity; -//---------------------------------------------------------------------- // Verbosity mode of "po" output -//---------------------------------------------------------------------- typedef enum LanguageRuntimeDescriptionDisplayVerbosity { eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the // description string, if @@ -209,18 +185,14 @@ typedef enum LanguageRuntimeDescriptionDisplayVerbosity { // output } LanguageRuntimeDescriptionDisplayVerbosity; -//---------------------------------------------------------------------- // Loading modules from memory -//---------------------------------------------------------------------- typedef enum MemoryModuleLoadLevel { eMemoryModuleLoadLevelMinimal, // Load sections only eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols eMemoryModuleLoadLevelComplete, // Load sections and all symbols } MemoryModuleLoadLevel; -//---------------------------------------------------------------------- // Result enums for when reading multiple lines from IOHandlers -//---------------------------------------------------------------------- enum class LineStatus { Success, // The line that was just edited if good and should be added to the // lines @@ -230,14 +202,10 @@ enum class LineStatus { Done // Lines are complete }; -//---------------------------------------------------------------------- // Boolean result of running a Type Validator -//---------------------------------------------------------------------- enum class TypeValidatorResult : bool { Success = true, Failure = false }; -//---------------------------------------------------------------------- // Enumerations that can be used to specify scopes types when looking up types. -//---------------------------------------------------------------------- enum class CompilerContextKind { Invalid = 0, TranslationUnit, @@ -252,10 +220,8 @@ enum class CompilerContextKind { Typedef }; -//---------------------------------------------------------------------- // Enumerations that can be used to specify the kind of metric we're looking at // when collecting stats. -//---------------------------------------------------------------------- enum StatisticKind { ExpressionSuccessful = 0, ExpressionFailure = 1, diff --git a/lldb/include/lldb/lldb-private-forward.h b/lldb/include/lldb/lldb-private-forward.h index ff160bf..3300707 100644 --- a/lldb/include/lldb/lldb-private-forward.h +++ b/lldb/include/lldb/lldb-private-forward.h @@ -10,9 +10,7 @@ #define LLDB_lldb_private_forward_h_ namespace lldb_private { -// --------------------------------------------------------------- Class // forward decls. -// --------------------------------------------------------------- class NativeProcessProtocol; class NativeRegisterContext; class NativeThreadProtocol; diff --git a/lldb/include/lldb/lldb-private-types.h b/lldb/include/lldb/lldb-private-types.h index 0e8537c..bff4711 100644 --- a/lldb/include/lldb/lldb-private-types.h +++ b/lldb/include/lldb/lldb-private-types.h @@ -28,10 +28,8 @@ class ExecutionContext; typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)( const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error); -//---------------------------------------------------------------------- // Every register is described in detail including its name, alternate name // (optional), encoding, size in bytes and the default display format. -//---------------------------------------------------------------------- struct RegisterInfo { const char *name; // Name of this register, can't be NULL const char *alt_name; // Alternate name of this register, can be NULL @@ -73,9 +71,7 @@ struct RegisterInfo { } }; -//---------------------------------------------------------------------- // Registers are grouped into register sets -//---------------------------------------------------------------------- struct RegisterSet { const char *name; // Name of this register set const char *short_name; // A short name for this register set diff --git a/lldb/include/lldb/lldb-types.h b/lldb/include/lldb/lldb-types.h index 90767e1..414a9f3 100644 --- a/lldb/include/lldb/lldb-types.h +++ b/lldb/include/lldb/lldb-types.h @@ -14,7 +14,6 @@ #include <stdint.h> -//---------------------------------------------------------------------- // All host systems must define: // lldb::thread_t The native thread type for spawned threads on the // system @@ -27,7 +26,6 @@ // #define LLDB_INVALID_PROCESS_ID ... // #define LLDB_INVALID_THREAD_ID ... // #define LLDB_INVALID_HOST_THREAD ... -//---------------------------------------------------------------------- // TODO: Add a bunch of ifdefs to determine the host system and what // things should be defined. Currently MacOSX is being assumed by default since @@ -54,9 +52,7 @@ typedef void *pipe_t; // Host pipe type is HANDLE #include <pthread.h> namespace lldb { -//---------------------------------------------------------------------- // MacOSX Types -//---------------------------------------------------------------------- typedef pthread_rwlock_t rwlock_t; typedef uint64_t process_t; // Process type is just a pid. typedef pthread_t thread_t; // Host thread type diff --git a/lldb/include/lldb/lldb-versioning.h b/lldb/include/lldb/lldb-versioning.h index f3cfd14..702ebd1 100644 --- a/lldb/include/lldb/lldb-versioning.h +++ b/lldb/include/lldb/lldb-versioning.h @@ -10,9 +10,7 @@ #ifndef LLDB_lldb_versioning_h_ #define LLDB_lldb_versioning_h_ -//---------------------------------------------------------------------- // LLDB API version -//---------------------------------------------------------------------- #define LLDB_API_MAJOR_VERSION 1 #define LLDB_API_MINOR_VERSION 0 diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp index 7113efa..8502aad 100644 --- a/lldb/source/API/SBInstruction.cpp +++ b/lldb/source/API/SBInstruction.cpp @@ -29,7 +29,6 @@ #include <memory> -//---------------------------------------------------------------------- // We recently fixed a leak in one of the Instruction subclasses where the // instruction will only hold a weak reference to the disassembler to avoid a // cycle that was keeping both objects alive (leak) and we need the @@ -48,7 +47,6 @@ // objects that are given out have a strong reference to the disassembler and // the instruction so that the object can live and successfully respond to all // queries. -//---------------------------------------------------------------------- class InstructionImpl { public: InstructionImpl(const lldb::DisassemblerSP &disasm_sp, diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp index 8a91bfb..235c37a 100644 --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -26,9 +26,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // PlatformConnectOptions -//---------------------------------------------------------------------- struct PlatformConnectOptions { PlatformConnectOptions(const char *url = NULL) : m_url(), m_rsync_options(), m_rsync_remote_path_prefix(), @@ -48,9 +46,7 @@ struct PlatformConnectOptions { ConstString m_local_cache_directory; }; -//---------------------------------------------------------------------- // PlatformShellCommand -//---------------------------------------------------------------------- struct PlatformShellCommand { PlatformShellCommand(const char *shell_command = NULL) : m_command(), m_working_dir(), m_status(0), m_signo(0) { @@ -67,9 +63,7 @@ struct PlatformShellCommand { int m_signo; Timeout<std::ratio<1>> m_timeout = llvm::None; }; -//---------------------------------------------------------------------- // SBPlatformConnectOptions -//---------------------------------------------------------------------- SBPlatformConnectOptions::SBPlatformConnectOptions(const char *url) : m_opaque_ptr(new PlatformConnectOptions(url)) { LLDB_RECORD_CONSTRUCTOR(SBPlatformConnectOptions, (const char *), url); @@ -164,9 +158,7 @@ void SBPlatformConnectOptions::SetLocalCacheDirectory(const char *path) { m_opaque_ptr->m_local_cache_directory = ConstString(); } -//---------------------------------------------------------------------- // SBPlatformShellCommand -//---------------------------------------------------------------------- SBPlatformShellCommand::SBPlatformShellCommand(const char *shell_command) : m_opaque_ptr(new PlatformShellCommand(shell_command)) { LLDB_RECORD_CONSTRUCTOR(SBPlatformShellCommand, (const char *), @@ -268,9 +260,7 @@ const char *SBPlatformShellCommand::GetOutput() { return m_opaque_ptr->m_output.c_str(); } -//---------------------------------------------------------------------- // SBPlatform -//---------------------------------------------------------------------- SBPlatform::SBPlatform() : m_opaque_sp() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBPlatform); } diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index 0259d3d..d97494b3 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -53,9 +53,7 @@ SBProcess::SBProcess() : m_opaque_wp() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBProcess); } -//---------------------------------------------------------------------- // SBProcess constructor -//---------------------------------------------------------------------- SBProcess::SBProcess(const SBProcess &rhs) : m_opaque_wp(rhs.m_opaque_wp) { LLDB_RECORD_CONSTRUCTOR(SBProcess, (const lldb::SBProcess &), rhs); @@ -75,9 +73,7 @@ const SBProcess &SBProcess::operator=(const SBProcess &rhs) { return LLDB_RECORD_RESULT(*this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SBProcess::~SBProcess() {} const char *SBProcess::GetBroadcasterClassName() { diff --git a/lldb/source/API/SBQueueItem.cpp b/lldb/source/API/SBQueueItem.cpp index 1594fbc..edb2580 100644 --- a/lldb/source/API/SBQueueItem.cpp +++ b/lldb/source/API/SBQueueItem.cpp @@ -20,9 +20,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructors -//---------------------------------------------------------------------- SBQueueItem::SBQueueItem() : m_queue_item_sp() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBQueueItem); } @@ -33,9 +31,7 @@ SBQueueItem::SBQueueItem(const QueueItemSP &queue_item_sp) queue_item_sp); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SBQueueItem::~SBQueueItem() { m_queue_item_sp.reset(); } bool SBQueueItem::IsValid() const { diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index fefc70a..ee0897e 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -97,9 +97,7 @@ Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target) { } // namespace -//---------------------------------------------------------------------- // SBTarget constructor -//---------------------------------------------------------------------- SBTarget::SBTarget() : m_opaque_sp() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBTarget); } @@ -121,9 +119,7 @@ const SBTarget &SBTarget::operator=(const SBTarget &rhs) { return LLDB_RECORD_RESULT(*this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SBTarget::~SBTarget() {} bool SBTarget::EventIsTargetEvent(const SBEvent &event) { diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 3ec03f2..5f4f69f 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -56,9 +56,7 @@ const char *SBThread::GetBroadcasterClassName() { return Thread::GetStaticBroadcasterClass().AsCString(); } -//---------------------------------------------------------------------- // Constructors -//---------------------------------------------------------------------- SBThread::SBThread() : m_opaque_sp(new ExecutionContextRef()) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBThread); } @@ -74,9 +72,7 @@ SBThread::SBThread(const SBThread &rhs) : m_opaque_sp() { m_opaque_sp = clone(rhs.m_opaque_sp); } -//---------------------------------------------------------------------- // Assignment operator -//---------------------------------------------------------------------- const lldb::SBThread &SBThread::operator=(const SBThread &rhs) { LLDB_RECORD_METHOD(const lldb::SBThread &, @@ -87,9 +83,7 @@ const lldb::SBThread &SBThread::operator=(const SBThread &rhs) { return LLDB_RECORD_RESULT(*this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SBThread::~SBThread() {} lldb::SBQueue SBThread::GetQueue() const { diff --git a/lldb/source/API/SBThreadPlan.cpp b/lldb/source/API/SBThreadPlan.cpp index d1db5c0..ecb1a4f 100644 --- a/lldb/source/API/SBThreadPlan.cpp +++ b/lldb/source/API/SBThreadPlan.cpp @@ -47,9 +47,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructors -//---------------------------------------------------------------------- SBThreadPlan::SBThreadPlan() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBThreadPlan); } SBThreadPlan::SBThreadPlan(const ThreadPlanSP &lldb_object_sp) @@ -72,9 +70,7 @@ SBThreadPlan::SBThreadPlan(lldb::SBThread &sb_thread, const char *class_name) { m_opaque_sp = std::make_shared<ThreadPlanPython>(*thread, class_name); } -//---------------------------------------------------------------------- // Assignment operator -//---------------------------------------------------------------------- const lldb::SBThreadPlan &SBThreadPlan::operator=(const SBThreadPlan &rhs) { LLDB_RECORD_METHOD(const lldb::SBThreadPlan &, @@ -84,9 +80,7 @@ const lldb::SBThreadPlan &SBThreadPlan::operator=(const SBThreadPlan &rhs) { m_opaque_sp = rhs.m_opaque_sp; return LLDB_RECORD_RESULT(*this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SBThreadPlan::~SBThreadPlan() {} lldb_private::ThreadPlan *SBThreadPlan::get() { return m_opaque_sp.get(); } diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp index 4897de6..18f2b7d 100644 --- a/lldb/source/API/SystemInitializerFull.cpp +++ b/lldb/source/API/SystemInitializerFull.cpp @@ -232,9 +232,7 @@ llvm::Error SystemInitializerFull::Initialize() { // shouldn't be limited to __APPLE__. StructuredDataDarwinLog::Initialize(); - //---------------------------------------------------------------------- // Platform agnostic plugins - //---------------------------------------------------------------------- platform_gdb_server::PlatformRemoteGDBServer::Initialize(); process_gdb_remote::ProcessGDBRemote::Initialize(); diff --git a/lldb/source/API/SystemInitializerFull.h b/lldb/source/API/SystemInitializerFull.h index a194afe..cd88bae 100644 --- a/lldb/source/API/SystemInitializerFull.h +++ b/lldb/source/API/SystemInitializerFull.h @@ -12,14 +12,12 @@ #include "lldb/Initialization/SystemInitializerCommon.h" namespace lldb_private { -//------------------------------------------------------------------ /// Initializes lldb. /// /// This class is responsible for initializing all of lldb system /// services needed to use the full LLDB application. This class is /// not intended to be used externally, but is instead used /// internally by SBDebugger to initialize the system. -//------------------------------------------------------------------ class SystemInitializerFull : public SystemInitializerCommon { public: SystemInitializerFull(); diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp index d6cbe3f..0ebba59 100644 --- a/lldb/source/Breakpoint/Breakpoint.cpp +++ b/lldb/source/Breakpoint/Breakpoint.cpp @@ -43,9 +43,7 @@ ConstString Breakpoint::GetEventIdentifier() { const char *Breakpoint::g_option_names[static_cast<uint32_t>( Breakpoint::OptionNames::LastOptionName)]{"Names", "Hardware"}; -//---------------------------------------------------------------------- // Breakpoint constructor -//---------------------------------------------------------------------- Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, BreakpointResolverSP &resolver_sp, bool hardware, bool resolve_indirect_symbols) @@ -68,14 +66,10 @@ Breakpoint::Breakpoint(Target &new_target, Breakpoint &source_bp) m_filter_sp = source_bp.m_filter_sp->CopyForBreakpoint(*this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Breakpoint::~Breakpoint() = default; -//---------------------------------------------------------------------- // Serialization -//---------------------------------------------------------------------- StructuredData::ObjectSP Breakpoint::SerializeToStructuredData() { // Serialize the resolver: StructuredData::DictionarySP breakpoint_dict_sp( @@ -496,9 +490,7 @@ void Breakpoint::ClearAllBreakpointSites() { m_locations.ClearAllBreakpointSites(); } -//---------------------------------------------------------------------- // ModulesChanged: Pass in a list of new modules, and -//---------------------------------------------------------------------- void Breakpoint::ModulesChanged(ModuleList &module_list, bool load, bool delete_locations) { diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp index d86e238..1e695fa 100644 --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // class BreakpointIDList -//---------------------------------------------------------------------- BreakpointIDList::BreakpointIDList() : m_invalid_id(LLDB_INVALID_BREAK_ID, LLDB_INVALID_BREAK_ID) {} diff --git a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp index 0651ca0..76084ad 100644 --- a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp +++ b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp @@ -16,15 +16,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // BreakpointLocationCollection constructor -//---------------------------------------------------------------------- BreakpointLocationCollection::BreakpointLocationCollection() : m_break_loc_collection(), m_collection_mutex() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- BreakpointLocationCollection::~BreakpointLocationCollection() {} void BreakpointLocationCollection::Add(const BreakpointLocationSP &bp_loc) { diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index 112c712..98b0b57 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -119,9 +119,7 @@ bool BreakpointOptions::NullCallback(void *baton, return true; } -//---------------------------------------------------------------------- // BreakpointOptions constructor -//---------------------------------------------------------------------- BreakpointOptions::BreakpointOptions(bool all_flags_set) : m_callback(BreakpointOptions::NullCallback), m_callback_baton_sp(), m_baton_is_command_baton(false), m_callback_is_synchronous(false), @@ -147,9 +145,7 @@ BreakpointOptions::BreakpointOptions(const char *condition, bool enabled, } } -//---------------------------------------------------------------------- // BreakpointOptions copy constructor -//---------------------------------------------------------------------- BreakpointOptions::BreakpointOptions(const BreakpointOptions &rhs) : m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp), m_baton_is_command_baton(rhs.m_baton_is_command_baton), @@ -163,9 +159,7 @@ BreakpointOptions::BreakpointOptions(const BreakpointOptions &rhs) m_condition_text_hash = rhs.m_condition_text_hash; } -//---------------------------------------------------------------------- // BreakpointOptions assignment operator -//---------------------------------------------------------------------- const BreakpointOptions &BreakpointOptions:: operator=(const BreakpointOptions &rhs) { m_callback = rhs.m_callback; @@ -236,9 +230,7 @@ void BreakpointOptions::CopyOverSetOptions(const BreakpointOptions &incoming) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- BreakpointOptions::~BreakpointOptions() = default; std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData( @@ -406,9 +398,7 @@ StructuredData::ObjectSP BreakpointOptions::SerializeToStructuredData() { return options_dict_sp; } -//------------------------------------------------------------------ // Callbacks -//------------------------------------------------------------------ void BreakpointOptions::SetCallback(BreakpointHitCallback callback, const lldb::BatonSP &callback_baton_sp, bool callback_is_synchronous) { diff --git a/lldb/source/Breakpoint/BreakpointResolver.cpp b/lldb/source/Breakpoint/BreakpointResolver.cpp index 53131ff..b3224aa 100644 --- a/lldb/source/Breakpoint/BreakpointResolver.cpp +++ b/lldb/source/Breakpoint/BreakpointResolver.cpp @@ -31,9 +31,7 @@ using namespace lldb_private; using namespace lldb; -//---------------------------------------------------------------------- // BreakpointResolver: -//---------------------------------------------------------------------- const char *BreakpointResolver::g_ty_to_name[] = {"FileAndLine", "Address", "SymbolName", "SourceRegex", "Exception", "Unknown"}; diff --git a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp index 09ad45d..d361098 100644 --- a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp @@ -20,9 +20,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // BreakpointResolverAddress: -//---------------------------------------------------------------------- BreakpointResolverAddress::BreakpointResolverAddress( Breakpoint *bkpt, const Address &addr, const FileSpec &module_spec) : BreakpointResolver(bkpt, BreakpointResolver::AddressResolver), diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp index b328eb5..494b4c7 100644 --- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // BreakpointResolverFileLine: -//---------------------------------------------------------------------- BreakpointResolverFileLine::BreakpointResolverFileLine( Breakpoint *bkpt, const FileSpec &file_spec, uint32_t line_no, uint32_t column, lldb::addr_t offset, bool check_inlines, diff --git a/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp b/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp index 583a709..c17dcb8 100644 --- a/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // BreakpointResolverFileRegex: -//---------------------------------------------------------------------- BreakpointResolverFileRegex::BreakpointResolverFileRegex( Breakpoint *bkpt, RegularExpression ®ex, const std::unordered_set<std::string> &func_names, bool exact_match) diff --git a/lldb/source/Breakpoint/BreakpointResolverScripted.cpp b/lldb/source/Breakpoint/BreakpointResolverScripted.cpp index 330cee8..e28f179 100644 --- a/lldb/source/Breakpoint/BreakpointResolverScripted.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverScripted.cpp @@ -24,9 +24,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // BreakpointResolverScripted: -//---------------------------------------------------------------------- BreakpointResolverScripted::BreakpointResolverScripted( Breakpoint *bkpt, const llvm::StringRef class_name, diff --git a/lldb/source/Breakpoint/Stoppoint.cpp b/lldb/source/Breakpoint/Stoppoint.cpp index 681877e..4cab975 100644 --- a/lldb/source/Breakpoint/Stoppoint.cpp +++ b/lldb/source/Breakpoint/Stoppoint.cpp @@ -13,14 +13,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Stoppoint constructor -//---------------------------------------------------------------------- Stoppoint::Stoppoint() : m_bid(LLDB_INVALID_BREAK_ID) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Stoppoint::~Stoppoint() {} break_id_t Stoppoint::GetID() const { return m_bid; } diff --git a/lldb/source/Breakpoint/StoppointLocation.cpp b/lldb/source/Breakpoint/StoppointLocation.cpp index a7f4aab..8cc6791 100644 --- a/lldb/source/Breakpoint/StoppointLocation.cpp +++ b/lldb/source/Breakpoint/StoppointLocation.cpp @@ -12,9 +12,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // StoppointLocation constructor -//---------------------------------------------------------------------- StoppointLocation::StoppointLocation(break_id_t bid, addr_t addr, bool hardware) : m_loc_id(bid), m_addr(addr), m_hardware(hardware), m_hardware_index(LLDB_INVALID_INDEX32), m_byte_size(0), m_hit_count(0) {} @@ -25,9 +23,7 @@ StoppointLocation::StoppointLocation(break_id_t bid, addr_t addr, m_hardware_index(LLDB_INVALID_INDEX32), m_byte_size(byte_size), m_hit_count(0) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- StoppointLocation::~StoppointLocation() {} void StoppointLocation::DecrementHitCount() { diff --git a/lldb/source/Breakpoint/WatchpointOptions.cpp b/lldb/source/Breakpoint/WatchpointOptions.cpp index 842cbc2..7dd130a 100644 --- a/lldb/source/Breakpoint/WatchpointOptions.cpp +++ b/lldb/source/Breakpoint/WatchpointOptions.cpp @@ -25,16 +25,12 @@ bool WatchpointOptions::NullCallback(void *baton, return true; } -//---------------------------------------------------------------------- // WatchpointOptions constructor -//---------------------------------------------------------------------- WatchpointOptions::WatchpointOptions() : m_callback(WatchpointOptions::NullCallback), m_callback_baton_sp(), m_callback_is_synchronous(false), m_thread_spec_up() {} -//---------------------------------------------------------------------- // WatchpointOptions copy constructor -//---------------------------------------------------------------------- WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs) : m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp), m_callback_is_synchronous(rhs.m_callback_is_synchronous), @@ -43,9 +39,7 @@ WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs) m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up)); } -//---------------------------------------------------------------------- // WatchpointOptions assignment operator -//---------------------------------------------------------------------- const WatchpointOptions &WatchpointOptions:: operator=(const WatchpointOptions &rhs) { m_callback = rhs.m_callback; @@ -70,14 +64,10 @@ WatchpointOptions::CopyOptionsNoCallback(WatchpointOptions &orig) { return ret_val; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- WatchpointOptions::~WatchpointOptions() = default; -//------------------------------------------------------------------ // Callbacks -//------------------------------------------------------------------ void WatchpointOptions::SetCallback(WatchpointHitCallback callback, const BatonSP &callback_baton_sp, bool callback_is_synchronous) { diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp index 4add544..5d2fb3d 100644 --- a/lldb/source/Commands/CommandCompletions.cpp +++ b/lldb/source/Commands/CommandCompletions.cpp @@ -349,9 +349,7 @@ CommandCompletions::Completer::Completer(CommandInterpreter &interpreter, CommandCompletions::Completer::~Completer() = default; -//---------------------------------------------------------------------- // SourceFileCompleter -//---------------------------------------------------------------------- CommandCompletions::SourceFileCompleter::SourceFileCompleter( CommandInterpreter &interpreter, bool include_support_files, @@ -424,9 +422,7 @@ CommandCompletions::SourceFileCompleter::DoCompletion(SearchFilter *filter) { return m_request.GetNumberOfMatches(); } -//---------------------------------------------------------------------- // SymbolCompleter -//---------------------------------------------------------------------- static bool regex_chars(const char comp) { return (comp == '[' || comp == ']' || comp == '(' || comp == ')' || @@ -492,9 +488,7 @@ size_t CommandCompletions::SymbolCompleter::DoCompletion(SearchFilter *filter) { return m_request.GetNumberOfMatches(); } -//---------------------------------------------------------------------- // ModuleCompleter -//---------------------------------------------------------------------- CommandCompletions::ModuleCompleter::ModuleCompleter( CommandInterpreter &interpreter, CompletionRequest &request) : CommandCompletions::Completer(interpreter, request) { diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp index eba052d..0ee47c8 100644 --- a/lldb/source/Commands/CommandObjectApropos.cpp +++ b/lldb/source/Commands/CommandObjectApropos.cpp @@ -17,9 +17,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectApropos -//------------------------------------------------------------------------- CommandObjectApropos::CommandObjectApropos(CommandInterpreter &interpreter) : CommandObjectParsed( diff --git a/lldb/source/Commands/CommandObjectApropos.h b/lldb/source/Commands/CommandObjectApropos.h index e64de22..37d86b1 100644 --- a/lldb/source/Commands/CommandObjectApropos.h +++ b/lldb/source/Commands/CommandObjectApropos.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectApropos -//------------------------------------------------------------------------- class CommandObjectApropos : public CommandObjectParsed { public: diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index b9b0cb5..82b3fc3 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -42,9 +42,7 @@ static void AddBreakpointDescription(Stream *s, Breakpoint *bp, s->EOL(); } -//------------------------------------------------------------------------- // Modifiable Breakpoint Options -//------------------------------------------------------------------------- #pragma mark Modify::CommandOptions static constexpr OptionDefinition g_breakpoint_modify_options[] = { // clang-format off @@ -322,9 +320,7 @@ static constexpr OptionDefinition g_breakpoint_set_options[] = { // clang-format on }; -//------------------------------------------------------------------------- // CommandObjectBreakpointSet -//------------------------------------------------------------------------- class CommandObjectBreakpointSet : public CommandObjectParsed { public: @@ -962,9 +958,7 @@ private: OptionGroupOptions m_all_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointModify -//------------------------------------------------------------------------- #pragma mark Modify class CommandObjectBreakpointModify : public CommandObjectParsed { @@ -1046,9 +1040,7 @@ private: OptionGroupOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointEnable -//------------------------------------------------------------------------- #pragma mark Enable class CommandObjectBreakpointEnable : public CommandObjectParsed { @@ -1137,9 +1129,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectBreakpointDisable -//------------------------------------------------------------------------- #pragma mark Disable class CommandObjectBreakpointDisable : public CommandObjectParsed { @@ -1252,9 +1242,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectBreakpointList -//------------------------------------------------------------------------- #pragma mark List::CommandOptions static constexpr OptionDefinition g_breakpoint_list_options[] = { @@ -1418,9 +1406,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointClear -//------------------------------------------------------------------------- #pragma mark Clear::CommandOptions static constexpr OptionDefinition g_breakpoint_clear_options[] = { @@ -1578,9 +1564,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointDelete -//------------------------------------------------------------------------- static constexpr OptionDefinition g_breakpoint_delete_options[] = { // clang-format off { LLDB_OPT_SET_1, false, "force", 'f', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Delete all breakpoints without querying for confirmation." }, @@ -1734,9 +1718,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointName -//------------------------------------------------------------------------- static constexpr OptionDefinition g_breakpoint_name_options[] = { // clang-format off @@ -2245,9 +2227,7 @@ private: OptionGroupOptions m_option_group; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointName -//------------------------------------------------------------------------- class CommandObjectBreakpointName : public CommandObjectMultiword { public: CommandObjectBreakpointName(CommandInterpreter &interpreter) @@ -2272,9 +2252,7 @@ public: ~CommandObjectBreakpointName() override = default; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointRead -//------------------------------------------------------------------------- #pragma mark Read::CommandOptions static constexpr OptionDefinition g_breakpoint_read_options[] = { // clang-format off @@ -2403,9 +2381,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointWrite -//------------------------------------------------------------------------- #pragma mark Write::CommandOptions static constexpr OptionDefinition g_breakpoint_write_options[] = { // clang-format off @@ -2517,9 +2493,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectMultiwordBreakpoint -//------------------------------------------------------------------------- #pragma mark MultiwordBreakpoint CommandObjectMultiwordBreakpoint::CommandObjectMultiwordBreakpoint( diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h index c58a3c9..cba1f3f 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.h +++ b/lldb/source/Commands/CommandObjectBreakpoint.h @@ -23,9 +23,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordBreakpoint -//------------------------------------------------------------------------- class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 9cd30c1..411c9ef 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -26,9 +26,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectBreakpointCommandAdd -//------------------------------------------------------------------------- // FIXME: "script-type" needs to have its contents determined dynamically, so // somebody can add a new scripting @@ -469,9 +467,7 @@ private: const char *CommandObjectBreakpointCommandAdd::g_reader_instructions = "Enter your debugger command(s). Type 'DONE' to end.\n"; -//------------------------------------------------------------------------- // CommandObjectBreakpointCommandDelete -//------------------------------------------------------------------------- static constexpr OptionDefinition g_breakpoint_delete_options[] = { // clang-format off @@ -606,9 +602,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectBreakpointCommandList -//------------------------------------------------------------------------- class CommandObjectBreakpointCommandList : public CommandObjectParsed { public: @@ -726,9 +720,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectBreakpointCommand -//------------------------------------------------------------------------- CommandObjectBreakpointCommand::CommandObjectBreakpointCommand( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.h b/lldb/source/Commands/CommandObjectBreakpointCommand.h index 9280889..b18e003 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.h +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.h @@ -19,9 +19,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordBreakpoint -//------------------------------------------------------------------------- class CommandObjectBreakpointCommand : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectBugreport.cpp b/lldb/source/Commands/CommandObjectBugreport.cpp index 511af7c..abad6f8 100644 --- a/lldb/source/Commands/CommandObjectBugreport.cpp +++ b/lldb/source/Commands/CommandObjectBugreport.cpp @@ -19,9 +19,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // "bugreport unwind" -//------------------------------------------------------------------------- class CommandObjectBugreportUnwind : public CommandObjectParsed { public: @@ -109,9 +107,7 @@ private: #pragma mark CommandObjectMultiwordBugreport -//------------------------------------------------------------------------- // CommandObjectMultiwordBugreport -//------------------------------------------------------------------------- CommandObjectMultiwordBugreport::CommandObjectMultiwordBugreport( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectBugreport.h b/lldb/source/Commands/CommandObjectBugreport.h index 2615bcb..24ce6d2 100644 --- a/lldb/source/Commands/CommandObjectBugreport.h +++ b/lldb/source/Commands/CommandObjectBugreport.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordBugreport -//------------------------------------------------------------------------- class CommandObjectMultiwordBugreport : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 662da8a..dabc5c80 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -29,9 +29,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectCommandsSource -//------------------------------------------------------------------------- static constexpr OptionDefinition g_history_options[] = { // clang-format off @@ -188,9 +186,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectCommandsSource -//------------------------------------------------------------------------- static constexpr OptionDefinition g_source_options[] = { // clang-format off @@ -339,9 +335,7 @@ protected: }; #pragma mark CommandObjectCommandsAlias -//------------------------------------------------------------------------- // CommandObjectCommandsAlias -//------------------------------------------------------------------------- static constexpr OptionDefinition g_alias_options[] = { // clang-format off @@ -765,9 +759,7 @@ protected: }; #pragma mark CommandObjectCommandsUnalias -//------------------------------------------------------------------------- // CommandObjectCommandsUnalias -//------------------------------------------------------------------------- class CommandObjectCommandsUnalias : public CommandObjectParsed { public: @@ -848,9 +840,7 @@ protected: }; #pragma mark CommandObjectCommandsDelete -//------------------------------------------------------------------------- // CommandObjectCommandsDelete -//------------------------------------------------------------------------- class CommandObjectCommandsDelete : public CommandObjectParsed { public: @@ -913,9 +903,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectCommandsAddRegex -//------------------------------------------------------------------------- static constexpr OptionDefinition g_regex_options[] = { // clang-format off @@ -1393,9 +1381,7 @@ private: bool m_fetched_help_long : 1; }; -//------------------------------------------------------------------------- // CommandObjectCommandsScriptImport -//------------------------------------------------------------------------- static constexpr OptionDefinition g_script_import_options[] = { // clang-format off @@ -1519,9 +1505,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectCommandsScriptAdd -//------------------------------------------------------------------------- static constexpr OptionEnumValueElement g_script_synchro_type[] = { {eScriptedCommandSynchronicitySynchronous, "synchronous", "Run synchronous"}, @@ -1766,9 +1750,7 @@ protected: ScriptedCommandSynchronicity m_synchronicity; }; -//------------------------------------------------------------------------- // CommandObjectCommandsScriptList -//------------------------------------------------------------------------- class CommandObjectCommandsScriptList : public CommandObjectParsed { public: @@ -1787,9 +1769,7 @@ public: } }; -//------------------------------------------------------------------------- // CommandObjectCommandsScriptClear -//------------------------------------------------------------------------- class CommandObjectCommandsScriptClear : public CommandObjectParsed { public: @@ -1809,9 +1789,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectCommandsScriptDelete -//------------------------------------------------------------------------- class CommandObjectCommandsScriptDelete : public CommandObjectParsed { public: @@ -1861,9 +1839,7 @@ protected: #pragma mark CommandObjectMultiwordCommandsScript -//------------------------------------------------------------------------- // CommandObjectMultiwordCommandsScript -//------------------------------------------------------------------------- class CommandObjectMultiwordCommandsScript : public CommandObjectMultiword { public: @@ -1893,9 +1869,7 @@ public: #pragma mark CommandObjectMultiwordCommands -//------------------------------------------------------------------------- // CommandObjectMultiwordCommands -//------------------------------------------------------------------------- CommandObjectMultiwordCommands::CommandObjectMultiwordCommands( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectCommands.h b/lldb/source/Commands/CommandObjectCommands.h index f7be73d..468ee53 100644 --- a/lldb/source/Commands/CommandObjectCommands.h +++ b/lldb/source/Commands/CommandObjectCommands.h @@ -16,9 +16,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordCommands -//------------------------------------------------------------------------- class CommandObjectMultiwordCommands : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 73adbc7..b32d849 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -229,9 +229,7 @@ CommandObjectDisassemble::CommandOptions::GetDefinitions() { return llvm::makeArrayRef(g_disassemble_options); } -//------------------------------------------------------------------------- // CommandObjectDisassemble -//------------------------------------------------------------------------- CommandObjectDisassemble::CommandObjectDisassemble( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectDisassemble.h b/lldb/source/Commands/CommandObjectDisassemble.h index f4d99a4..70193e9 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.h +++ b/lldb/source/Commands/CommandObjectDisassemble.h @@ -15,9 +15,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectDisassemble -//------------------------------------------------------------------------- class CommandObjectDisassemble : public CommandObjectParsed { public: diff --git a/lldb/source/Commands/CommandObjectExpression.h b/lldb/source/Commands/CommandObjectExpression.h index 18a9509..5bd8384 100644 --- a/lldb/source/Commands/CommandObjectExpression.h +++ b/lldb/source/Commands/CommandObjectExpression.h @@ -57,9 +57,7 @@ public: int HandleCompletion(CompletionRequest &request) override; protected: - //------------------------------------------------------------------ // IOHandler::Delegate functions - //------------------------------------------------------------------ void IOHandlerInputComplete(IOHandler &io_handler, std::string &line) override; diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 3b4259b..9d82d75 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -50,13 +50,9 @@ using namespace lldb_private; #pragma mark CommandObjectFrameDiagnose -//------------------------------------------------------------------------- // CommandObjectFrameInfo -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- // CommandObjectFrameDiagnose -//------------------------------------------------------------------------- static constexpr OptionDefinition g_frame_diag_options[] = { // clang-format off @@ -216,9 +212,7 @@ protected: #pragma mark CommandObjectFrameInfo -//------------------------------------------------------------------------- // CommandObjectFrameInfo -//------------------------------------------------------------------------- class CommandObjectFrameInfo : public CommandObjectParsed { public: @@ -242,9 +236,7 @@ protected: #pragma mark CommandObjectFrameSelect -//------------------------------------------------------------------------- // CommandObjectFrameSelect -//------------------------------------------------------------------------- static OptionDefinition g_frame_select_options[] = { // clang-format off @@ -412,9 +404,7 @@ protected: }; #pragma mark CommandObjectFrameVariable -//---------------------------------------------------------------------- // List images with associated information -//---------------------------------------------------------------------- class CommandObjectFrameVariable : public CommandObjectParsed { public: CommandObjectFrameVariable(CommandInterpreter &interpreter) @@ -1118,9 +1108,7 @@ class CommandObjectFrameRecognizer : public CommandObjectMultiword { #pragma mark CommandObjectMultiwordFrame -//------------------------------------------------------------------------- // CommandObjectMultiwordFrame -//------------------------------------------------------------------------- CommandObjectMultiwordFrame::CommandObjectMultiwordFrame( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectFrame.h b/lldb/source/Commands/CommandObjectFrame.h index 9adc723..46a59f7 100644 --- a/lldb/source/Commands/CommandObjectFrame.h +++ b/lldb/source/Commands/CommandObjectFrame.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordFrame -//------------------------------------------------------------------------- class CommandObjectMultiwordFrame : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectGUI.cpp b/lldb/source/Commands/CommandObjectGUI.cpp index db1cf6d..48046cd 100644 --- a/lldb/source/Commands/CommandObjectGUI.cpp +++ b/lldb/source/Commands/CommandObjectGUI.cpp @@ -15,9 +15,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectGUI -//------------------------------------------------------------------------- CommandObjectGUI::CommandObjectGUI(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "gui", diff --git a/lldb/source/Commands/CommandObjectGUI.h b/lldb/source/Commands/CommandObjectGUI.h index 3719d53..a19aad1 100644 --- a/lldb/source/Commands/CommandObjectGUI.h +++ b/lldb/source/Commands/CommandObjectGUI.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectGUI -//------------------------------------------------------------------------- class CommandObjectGUI : public CommandObjectParsed { public: diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index 3804bbe..4e663c7 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -15,9 +15,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectHelp -//------------------------------------------------------------------------- void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage( Stream *s, llvm::StringRef command, llvm::StringRef prefix, diff --git a/lldb/source/Commands/CommandObjectHelp.h b/lldb/source/Commands/CommandObjectHelp.h index e4dd7af..a641b19 100644 --- a/lldb/source/Commands/CommandObjectHelp.h +++ b/lldb/source/Commands/CommandObjectHelp.h @@ -15,9 +15,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectHelp -//------------------------------------------------------------------------- class CommandObjectHelp : public CommandObjectParsed { public: diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index db41162..1add4b2 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -48,9 +48,7 @@ static constexpr OptionDefinition g_log_options[] = { class CommandObjectLogEnable : public CommandObjectParsed { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectLogEnable(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "log enable", "Enable logging for a single log channel.", @@ -187,9 +185,7 @@ protected: class CommandObjectLogDisable : public CommandObjectParsed { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectLogDisable(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "log disable", "Disable one or more log channel categories.", @@ -247,9 +243,7 @@ protected: class CommandObjectLogList : public CommandObjectParsed { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectLogList(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "log list", "List the log categories for one or more log " @@ -294,9 +288,7 @@ protected: class CommandObjectLogTimer : public CommandObjectParsed { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectLogTimer(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "log timers", "Enable, disable, dump, and reset LLDB internal " diff --git a/lldb/source/Commands/CommandObjectLog.h b/lldb/source/Commands/CommandObjectLog.h index df3db87..b2da900 100644 --- a/lldb/source/Commands/CommandObjectLog.h +++ b/lldb/source/Commands/CommandObjectLog.h @@ -16,23 +16,17 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectLog -//------------------------------------------------------------------------- class CommandObjectLog : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectLog(CommandInterpreter &interpreter); ~CommandObjectLog() override; private: - //------------------------------------------------------------------ // For CommandObjectLog only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommandObjectLog); }; diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 1f4a369..6225ee9 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -287,9 +287,7 @@ public: OptionValueUInt64 m_offset; }; -//---------------------------------------------------------------------- // Read memory from the inferior process -//---------------------------------------------------------------------- class CommandObjectMemoryRead : public CommandObjectParsed { public: CommandObjectMemoryRead(CommandInterpreter &interpreter) @@ -891,9 +889,7 @@ static constexpr OptionDefinition g_memory_find_option_table[] = { // clang-format on }; -//---------------------------------------------------------------------- // Find the specified data in memory -//---------------------------------------------------------------------- class CommandObjectMemoryFind : public CommandObjectParsed { public: class OptionGroupFindMemory : public OptionGroup { @@ -1188,9 +1184,7 @@ static constexpr OptionDefinition g_memory_write_option_table[] = { // clang-format on }; -//---------------------------------------------------------------------- // Write memory to the inferior process -//---------------------------------------------------------------------- class CommandObjectMemoryWrite : public CommandObjectParsed { public: class OptionGroupWriteMemory : public OptionGroup { @@ -1597,9 +1591,7 @@ protected: OptionGroupWriteMemory m_memory_options; }; -//---------------------------------------------------------------------- // Get malloc/free history of a memory address. -//---------------------------------------------------------------------- class CommandObjectMemoryHistory : public CommandObjectParsed { public: CommandObjectMemoryHistory(CommandInterpreter &interpreter) @@ -1679,9 +1671,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectMemoryRegion -//------------------------------------------------------------------------- #pragma mark CommandObjectMemoryRegion class CommandObjectMemoryRegion : public CommandObjectParsed { @@ -1772,9 +1762,7 @@ protected: lldb::addr_t m_prev_end_addr; }; -//------------------------------------------------------------------------- // CommandObjectMemory -//------------------------------------------------------------------------- CommandObjectMemory::CommandObjectMemory(CommandInterpreter &interpreter) : CommandObjectMultiword( diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index f71df5d..4011cce 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -15,9 +15,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectMultiword -//------------------------------------------------------------------------- CommandObjectMultiword::CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 8bb88f9..b5812df 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -153,9 +153,7 @@ private: DISALLOW_COPY_AND_ASSIGN(OptionPermissions); }; -//---------------------------------------------------------------------- // "platform select <platform-name>" -//---------------------------------------------------------------------- class CommandObjectPlatformSelect : public CommandObjectParsed { public: CommandObjectPlatformSelect(CommandInterpreter &interpreter) @@ -218,9 +216,7 @@ protected: OptionGroupPlatform m_platform_options; }; -//---------------------------------------------------------------------- // "platform list" -//---------------------------------------------------------------------- class CommandObjectPlatformList : public CommandObjectParsed { public: CommandObjectPlatformList(CommandInterpreter &interpreter) @@ -261,9 +257,7 @@ protected: } }; -//---------------------------------------------------------------------- // "platform status" -//---------------------------------------------------------------------- class CommandObjectPlatformStatus : public CommandObjectParsed { public: CommandObjectPlatformStatus(CommandInterpreter &interpreter) @@ -297,9 +291,7 @@ protected: } }; -//---------------------------------------------------------------------- // "platform connect <connect-url>" -//---------------------------------------------------------------------- class CommandObjectPlatformConnect : public CommandObjectParsed { public: CommandObjectPlatformConnect(CommandInterpreter &interpreter) @@ -352,9 +344,7 @@ protected: } }; -//---------------------------------------------------------------------- // "platform disconnect" -//---------------------------------------------------------------------- class CommandObjectPlatformDisconnect : public CommandObjectParsed { public: CommandObjectPlatformDisconnect(CommandInterpreter &interpreter) @@ -414,9 +404,7 @@ protected: } }; -//---------------------------------------------------------------------- // "platform settings" -//---------------------------------------------------------------------- class CommandObjectPlatformSettings : public CommandObjectParsed { public: CommandObjectPlatformSettings(CommandInterpreter &interpreter) @@ -459,9 +447,7 @@ protected: OptionGroupFile m_option_working_dir; }; -//---------------------------------------------------------------------- // "platform mkdir" -//---------------------------------------------------------------------- class CommandObjectPlatformMkDir : public CommandObjectParsed { public: CommandObjectPlatformMkDir(CommandInterpreter &interpreter) @@ -511,9 +497,7 @@ public: OptionGroupOptions m_options; }; -//---------------------------------------------------------------------- // "platform fopen" -//---------------------------------------------------------------------- class CommandObjectPlatformFOpen : public CommandObjectParsed { public: CommandObjectPlatformFOpen(CommandInterpreter &interpreter) @@ -568,9 +552,7 @@ public: OptionGroupOptions m_options; }; -//---------------------------------------------------------------------- // "platform fclose" -//---------------------------------------------------------------------- class CommandObjectPlatformFClose : public CommandObjectParsed { public: CommandObjectPlatformFClose(CommandInterpreter &interpreter) @@ -604,9 +586,7 @@ public: } }; -//---------------------------------------------------------------------- // "platform fread" -//---------------------------------------------------------------------- static constexpr OptionDefinition g_platform_fread_options[] = { // clang-format off @@ -699,9 +679,7 @@ protected: CommandOptions m_options; }; -//---------------------------------------------------------------------- // "platform fwrite" -//---------------------------------------------------------------------- static constexpr OptionDefinition g_platform_fwrite_options[] = { // clang-format off @@ -793,9 +771,7 @@ protected: class CommandObjectPlatformFile : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectPlatformFile(CommandInterpreter &interpreter) : CommandObjectMultiword( interpreter, "platform file", @@ -814,15 +790,11 @@ public: ~CommandObjectPlatformFile() override = default; private: - //------------------------------------------------------------------ // For CommandObjectPlatform only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommandObjectPlatformFile); }; -//---------------------------------------------------------------------- // "platform get-file remote-file-path host-file-path" -//---------------------------------------------------------------------- class CommandObjectPlatformGetFile : public CommandObjectParsed { public: CommandObjectPlatformGetFile(CommandInterpreter &interpreter) @@ -897,9 +869,7 @@ public: } }; -//---------------------------------------------------------------------- // "platform get-size remote-file-path" -//---------------------------------------------------------------------- class CommandObjectPlatformGetSize : public CommandObjectParsed { public: CommandObjectPlatformGetSize(CommandInterpreter &interpreter) @@ -963,9 +933,7 @@ public: } }; -//---------------------------------------------------------------------- // "platform put-file" -//---------------------------------------------------------------------- class CommandObjectPlatformPutFile : public CommandObjectParsed { public: CommandObjectPlatformPutFile(CommandInterpreter &interpreter) @@ -1002,9 +970,7 @@ public: } }; -//---------------------------------------------------------------------- // "platform process launch" -//---------------------------------------------------------------------- class CommandObjectPlatformProcessLaunch : public CommandObjectParsed { public: CommandObjectPlatformProcessLaunch(CommandInterpreter &interpreter) @@ -1092,9 +1058,7 @@ protected: ProcessLaunchCommandOptions m_options; }; -//---------------------------------------------------------------------- // "platform process list" -//---------------------------------------------------------------------- static OptionDefinition g_platform_process_list_options[] = { // clang-format off @@ -1393,9 +1357,7 @@ protected: CommandOptions m_options; }; -//---------------------------------------------------------------------- // "platform process info" -//---------------------------------------------------------------------- class CommandObjectPlatformProcessInfo : public CommandObjectParsed { public: CommandObjectPlatformProcessInfo(CommandInterpreter &interpreter) @@ -1633,9 +1595,7 @@ protected: class CommandObjectPlatformProcess : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectPlatformProcess(CommandInterpreter &interpreter) : CommandObjectMultiword(interpreter, "platform process", "Commands to query, launch and attach to " @@ -1656,15 +1616,11 @@ public: ~CommandObjectPlatformProcess() override = default; private: - //------------------------------------------------------------------ // For CommandObjectPlatform only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommandObjectPlatformProcess); }; -//---------------------------------------------------------------------- // "platform shell" -//---------------------------------------------------------------------- static constexpr OptionDefinition g_platform_shell_options[] = { // clang-format off { LLDB_OPT_SET_ALL, false, "timeout", 't', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeValue, "Seconds to wait for the remote host to finish running the command." }, @@ -1788,9 +1744,7 @@ public: CommandOptions m_options; }; -//---------------------------------------------------------------------- // "platform install" - install a target to a remote end -//---------------------------------------------------------------------- class CommandObjectPlatformInstall : public CommandObjectParsed { public: CommandObjectPlatformInstall(CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectPlatform.h b/lldb/source/Commands/CommandObjectPlatform.h index 88e3070..c94d2ea 100644 --- a/lldb/source/Commands/CommandObjectPlatform.h +++ b/lldb/source/Commands/CommandObjectPlatform.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectPlatform -//------------------------------------------------------------------------- class CommandObjectPlatform : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index e98688b..53d8176 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -100,9 +100,7 @@ protected: std::string m_new_process_action; }; -//------------------------------------------------------------------------- // CommandObjectProcessLaunch -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessLaunch class CommandObjectProcessLaunch : public CommandObjectProcessLaunchOrAttach { public: @@ -295,9 +293,7 @@ protected: //#undef SET2 //#undef SET3 -//------------------------------------------------------------------------- // CommandObjectProcessAttach -//------------------------------------------------------------------------- static constexpr OptionDefinition g_process_attach_options[] = { // clang-format off @@ -547,9 +543,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectProcessContinue -//------------------------------------------------------------------------- static constexpr OptionDefinition g_process_continue_options[] = { // clang-format off @@ -711,9 +705,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectProcessDetach -//------------------------------------------------------------------------- static constexpr OptionDefinition g_process_detach_options[] = { // clang-format off { LLDB_OPT_SET_1, false, "keep-stopped", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "Whether or not the process should be kept stopped on detach (if possible)." }, @@ -809,9 +801,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectProcessConnect -//------------------------------------------------------------------------- static constexpr OptionDefinition g_process_connect_options[] = { // clang-format off @@ -915,9 +905,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectProcessPlugin -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessPlugin class CommandObjectProcessPlugin : public CommandObjectProxy { @@ -938,9 +926,7 @@ public: } }; -//------------------------------------------------------------------------- // CommandObjectProcessLoad -//------------------------------------------------------------------------- static constexpr OptionDefinition g_process_load_options[] = { // clang-format off @@ -1054,9 +1040,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectProcessUnload -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessUnload class CommandObjectProcessUnload : public CommandObjectParsed { @@ -1102,9 +1086,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectProcessSignal -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessSignal class CommandObjectProcessSignal : public CommandObjectParsed { @@ -1169,9 +1151,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectProcessInterrupt -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessInterrupt class CommandObjectProcessInterrupt : public CommandObjectParsed { @@ -1213,9 +1193,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectProcessKill -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessKill class CommandObjectProcessKill : public CommandObjectParsed { @@ -1256,9 +1234,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectProcessSaveCore -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessSaveCore class CommandObjectProcessSaveCore : public CommandObjectParsed { @@ -1302,9 +1278,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectProcessStatus -//------------------------------------------------------------------------- #pragma mark CommandObjectProcessStatus class CommandObjectProcessStatus : public CommandObjectParsed { @@ -1336,9 +1310,7 @@ public: } }; -//------------------------------------------------------------------------- // CommandObjectProcessHandle -//------------------------------------------------------------------------- static constexpr OptionDefinition g_process_handle_options[] = { // clang-format off @@ -1595,9 +1567,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectMultiwordProcess -//------------------------------------------------------------------------- CommandObjectMultiwordProcess::CommandObjectMultiwordProcess( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectProcess.h b/lldb/source/Commands/CommandObjectProcess.h index 4be391f..3b1ff26 100644 --- a/lldb/source/Commands/CommandObjectProcess.h +++ b/lldb/source/Commands/CommandObjectProcess.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordProcess -//------------------------------------------------------------------------- class CommandObjectMultiwordProcess : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectQuit.cpp b/lldb/source/Commands/CommandObjectQuit.cpp index 9b71945..70ee336 100644 --- a/lldb/source/Commands/CommandObjectQuit.cpp +++ b/lldb/source/Commands/CommandObjectQuit.cpp @@ -16,9 +16,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectQuit -//------------------------------------------------------------------------- CommandObjectQuit::CommandObjectQuit(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "quit", "Quit the LLDB debugger.", diff --git a/lldb/source/Commands/CommandObjectQuit.h b/lldb/source/Commands/CommandObjectQuit.h index c3f4284..458ef24 100644 --- a/lldb/source/Commands/CommandObjectQuit.h +++ b/lldb/source/Commands/CommandObjectQuit.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectQuit -//------------------------------------------------------------------------- class CommandObjectQuit : public CommandObjectParsed { public: diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index d1555cc..34482a8 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -31,9 +31,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // "register read" -//---------------------------------------------------------------------- static constexpr OptionDefinition g_register_read_options[] = { // clang-format off @@ -298,9 +296,7 @@ protected: CommandOptions m_command_options; }; -//---------------------------------------------------------------------- // "register write" -//---------------------------------------------------------------------- class CommandObjectRegisterWrite : public CommandObjectParsed { public: CommandObjectRegisterWrite(CommandInterpreter &interpreter) @@ -393,9 +389,7 @@ protected: } }; -//---------------------------------------------------------------------- // CommandObjectRegister constructor -//---------------------------------------------------------------------- CommandObjectRegister::CommandObjectRegister(CommandInterpreter &interpreter) : CommandObjectMultiword(interpreter, "register", "Commands to access registers for the current " diff --git a/lldb/source/Commands/CommandObjectRegister.h b/lldb/source/Commands/CommandObjectRegister.h index 6b6d6c3..6fc47cf 100644 --- a/lldb/source/Commands/CommandObjectRegister.h +++ b/lldb/source/Commands/CommandObjectRegister.h @@ -13,23 +13,17 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectRegister -//------------------------------------------------------------------------- class CommandObjectRegister : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectRegister(CommandInterpreter &interpreter); ~CommandObjectRegister() override; private: - //------------------------------------------------------------------ // For CommandObjectRegister only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommandObjectRegister); }; diff --git a/lldb/source/Commands/CommandObjectReproducer.h b/lldb/source/Commands/CommandObjectReproducer.h index f52d8f1..ad37724 100644 --- a/lldb/source/Commands/CommandObjectReproducer.h +++ b/lldb/source/Commands/CommandObjectReproducer.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectReproducer -//------------------------------------------------------------------------- class CommandObjectReproducer : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index eea94df..e7f8d2a 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -19,9 +19,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectSettingsSet -//------------------------------------------------------------------------- static constexpr OptionDefinition g_settings_set_options[] = { // clang-format off @@ -253,9 +251,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectSettingsShow -- Show current values -//------------------------------------------------------------------------- class CommandObjectSettingsShow : public CommandObjectParsed { public: @@ -315,9 +311,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingsWrite -- Write settings to file -//------------------------------------------------------------------------- static constexpr OptionDefinition g_settings_write_options[] = { // clang-format off @@ -442,9 +436,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectSettingsRead -- Read settings from file -//------------------------------------------------------------------------- static constexpr OptionDefinition g_settings_read_options[] = { // clang-format off @@ -519,9 +511,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectSettingsList -- List settable variables -//------------------------------------------------------------------------- class CommandObjectSettingsList : public CommandObjectParsed { public: @@ -596,9 +586,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingsRemove -//------------------------------------------------------------------------- class CommandObjectSettingsRemove : public CommandObjectRaw { public: @@ -696,9 +684,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingsReplace -//------------------------------------------------------------------------- class CommandObjectSettingsReplace : public CommandObjectRaw { public: @@ -800,9 +786,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingsInsertBefore -//------------------------------------------------------------------------- class CommandObjectSettingsInsertBefore : public CommandObjectRaw { public: @@ -906,9 +890,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingInsertAfter -//------------------------------------------------------------------------- class CommandObjectSettingsInsertAfter : public CommandObjectRaw { public: @@ -1011,9 +993,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingsAppend -//------------------------------------------------------------------------- class CommandObjectSettingsAppend : public CommandObjectRaw { public: @@ -1107,9 +1087,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectSettingsClear -//------------------------------------------------------------------------- class CommandObjectSettingsClear : public CommandObjectParsed { public: @@ -1177,9 +1155,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectMultiwordSettings -//------------------------------------------------------------------------- CommandObjectMultiwordSettings::CommandObjectMultiwordSettings( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectSettings.h b/lldb/source/Commands/CommandObjectSettings.h index 056810a..7304259 100644 --- a/lldb/source/Commands/CommandObjectSettings.h +++ b/lldb/source/Commands/CommandObjectSettings.h @@ -15,9 +15,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordSettings -//------------------------------------------------------------------------- class CommandObjectMultiwordSettings : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index abcf601..2afb012f 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -32,9 +32,7 @@ using namespace lldb; using namespace lldb_private; #pragma mark CommandObjectSourceInfo -//---------------------------------------------------------------------- // CommandObjectSourceInfo - debug line entries dumping command -//---------------------------------------------------------------------- static constexpr OptionDefinition g_source_info_options[] = { // clang-format off @@ -644,9 +642,7 @@ protected: }; #pragma mark CommandObjectSourceList -//------------------------------------------------------------------------- // CommandObjectSourceList -//------------------------------------------------------------------------- static constexpr OptionDefinition g_source_list_options[] = { // clang-format off @@ -1292,9 +1288,7 @@ protected: }; #pragma mark CommandObjectMultiwordSource -//------------------------------------------------------------------------- // CommandObjectMultiwordSource -//------------------------------------------------------------------------- CommandObjectMultiwordSource::CommandObjectMultiwordSource( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectSource.h b/lldb/source/Commands/CommandObjectSource.h index 909bafa..d72122d 100644 --- a/lldb/source/Commands/CommandObjectSource.h +++ b/lldb/source/Commands/CommandObjectSource.h @@ -16,9 +16,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordSource -//------------------------------------------------------------------------- class CommandObjectMultiwordSource : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index a76fb9b..25dd125 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -201,9 +201,7 @@ private: #pragma mark CommandObjectTargetCreate -//------------------------------------------------------------------------- // "target create" -//------------------------------------------------------------------------- class CommandObjectTargetCreate : public CommandObjectParsed { public: @@ -476,9 +474,7 @@ private: #pragma mark CommandObjectTargetList -//---------------------------------------------------------------------- // "target list" -//---------------------------------------------------------------------- class CommandObjectTargetList : public CommandObjectParsed { public: @@ -511,9 +507,7 @@ protected: #pragma mark CommandObjectTargetSelect -//---------------------------------------------------------------------- // "target select" -//---------------------------------------------------------------------- class CommandObjectTargetSelect : public CommandObjectParsed { public: @@ -576,9 +570,7 @@ protected: #pragma mark CommandObjectTargetSelect -//---------------------------------------------------------------------- // "target delete" -//---------------------------------------------------------------------- class CommandObjectTargetDelete : public CommandObjectParsed { public: @@ -689,9 +681,7 @@ protected: #pragma mark CommandObjectTargetVariable -//---------------------------------------------------------------------- // "target variable" -//---------------------------------------------------------------------- class CommandObjectTargetVariable : public CommandObjectParsed { static const uint32_t SHORT_OPTION_FILE = 0x66696c65; // 'file' @@ -1317,9 +1307,7 @@ protected: } }; -//---------------------------------------------------------------------- // Static Helper functions -//---------------------------------------------------------------------- static void DumpModuleArchitecture(Stream &strm, Module *module, bool full_triple, uint32_t width) { if (module) { @@ -1829,10 +1817,8 @@ static size_t FindModulesByName(Target *target, const char *module_name, #pragma mark CommandObjectTargetModulesModuleAutoComplete -//---------------------------------------------------------------------- // A base command object class that can auto complete with module file // paths -//---------------------------------------------------------------------- class CommandObjectTargetModulesModuleAutoComplete : public CommandObjectParsed { @@ -1871,10 +1857,8 @@ public: #pragma mark CommandObjectTargetModulesSourceFileAutoComplete -//---------------------------------------------------------------------- // A base command object class that can auto complete with module source // file paths -//---------------------------------------------------------------------- class CommandObjectTargetModulesSourceFileAutoComplete : public CommandObjectParsed { @@ -2126,9 +2110,7 @@ protected: #pragma mark CommandObjectTargetModulesDumpSections -//---------------------------------------------------------------------- // Image section dumping command -//---------------------------------------------------------------------- class CommandObjectTargetModulesDumpSections : public CommandObjectTargetModulesModuleAutoComplete { @@ -2221,9 +2203,7 @@ protected: #pragma mark CommandObjectTargetModulesDumpSections -//---------------------------------------------------------------------- // Clang AST dumping command -//---------------------------------------------------------------------- class CommandObjectTargetModulesDumpClangAST : public CommandObjectTargetModulesModuleAutoComplete { @@ -2300,9 +2280,7 @@ protected: #pragma mark CommandObjectTargetModulesDumpSymfile -//---------------------------------------------------------------------- // Image debug symbol dumping command -//---------------------------------------------------------------------- class CommandObjectTargetModulesDumpSymfile : public CommandObjectTargetModulesModuleAutoComplete { @@ -2391,9 +2369,7 @@ protected: #pragma mark CommandObjectTargetModulesDumpLineTable -//---------------------------------------------------------------------- // Image debug line table dumping command -//---------------------------------------------------------------------- class CommandObjectTargetModulesDumpLineTable : public CommandObjectTargetModulesSourceFileAutoComplete { @@ -2503,15 +2479,11 @@ protected: #pragma mark CommandObjectTargetModulesDump -//---------------------------------------------------------------------- // Dump multi-word command for target modules -//---------------------------------------------------------------------- class CommandObjectTargetModulesDump : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectTargetModulesDump(CommandInterpreter &interpreter) : CommandObjectMultiword( interpreter, "target modules dump", @@ -2997,9 +2969,7 @@ protected: OptionGroupUInt64 m_slide_option; }; -//---------------------------------------------------------------------- // List images with associated information -//---------------------------------------------------------------------- static constexpr OptionDefinition g_target_modules_list_options[] = { // clang-format off @@ -3363,9 +3333,7 @@ protected: #pragma mark CommandObjectTargetModulesShowUnwind -//---------------------------------------------------------------------- // Lookup unwind information in images -//---------------------------------------------------------------------- static constexpr OptionDefinition g_target_modules_show_unwind_options[] = { // clang-format off @@ -3668,9 +3636,7 @@ protected: CommandOptions m_options; }; -//---------------------------------------------------------------------- // Lookup information in images -//---------------------------------------------------------------------- static constexpr OptionDefinition g_target_modules_lookup_options[] = { // clang-format off @@ -4056,9 +4022,7 @@ protected: #pragma mark CommandObjectMultiwordImageSearchPaths -//------------------------------------------------------------------------- // CommandObjectMultiwordImageSearchPaths -//------------------------------------------------------------------------- class CommandObjectTargetModulesImageSearchPaths : public CommandObjectMultiword { @@ -4091,15 +4055,11 @@ public: #pragma mark CommandObjectTargetModules -//------------------------------------------------------------------------- // CommandObjectTargetModules -//------------------------------------------------------------------------- class CommandObjectTargetModules : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectTargetModules(CommandInterpreter &interpreter) : CommandObjectMultiword(interpreter, "target modules", "Commands for accessing information for one or " @@ -4128,9 +4088,7 @@ public: ~CommandObjectTargetModules() override = default; private: - //------------------------------------------------------------------ // For CommandObjectTargetModules only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommandObjectTargetModules); }; @@ -4523,15 +4481,11 @@ protected: #pragma mark CommandObjectTargetSymbols -//------------------------------------------------------------------------- // CommandObjectTargetSymbols -//------------------------------------------------------------------------- class CommandObjectTargetSymbols : public CommandObjectMultiword { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommandObjectTargetSymbols(CommandInterpreter &interpreter) : CommandObjectMultiword( interpreter, "target symbols", @@ -4544,17 +4498,13 @@ public: ~CommandObjectTargetSymbols() override = default; private: - //------------------------------------------------------------------ // For CommandObjectTargetModules only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommandObjectTargetSymbols); }; #pragma mark CommandObjectTargetStopHookAdd -//------------------------------------------------------------------------- // CommandObjectTargetStopHookAdd -//------------------------------------------------------------------------- static constexpr OptionDefinition g_target_stop_hook_add_options[] = { // clang-format off @@ -4884,9 +4834,7 @@ private: #pragma mark CommandObjectTargetStopHookDelete -//------------------------------------------------------------------------- // CommandObjectTargetStopHookDelete -//------------------------------------------------------------------------- class CommandObjectTargetStopHookDelete : public CommandObjectParsed { public: @@ -4942,9 +4890,7 @@ protected: #pragma mark CommandObjectTargetStopHookEnableDisable -//------------------------------------------------------------------------- // CommandObjectTargetStopHookEnableDisable -//------------------------------------------------------------------------- class CommandObjectTargetStopHookEnableDisable : public CommandObjectParsed { public: @@ -4999,9 +4945,7 @@ private: #pragma mark CommandObjectTargetStopHookList -//------------------------------------------------------------------------- // CommandObjectTargetStopHookList -//------------------------------------------------------------------------- class CommandObjectTargetStopHookList : public CommandObjectParsed { public: @@ -5040,9 +4984,7 @@ protected: #pragma mark CommandObjectMultiwordTargetStopHooks -//------------------------------------------------------------------------- // CommandObjectMultiwordTargetStopHooks -//------------------------------------------------------------------------- class CommandObjectMultiwordTargetStopHooks : public CommandObjectMultiword { public: @@ -5073,9 +5015,7 @@ public: #pragma mark CommandObjectMultiwordTarget -//------------------------------------------------------------------------- // CommandObjectMultiwordTarget -//------------------------------------------------------------------------- CommandObjectMultiwordTarget::CommandObjectMultiwordTarget( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectTarget.h b/lldb/source/Commands/CommandObjectTarget.h index 4ab2da4..86d554c 100644 --- a/lldb/source/Commands/CommandObjectTarget.h +++ b/lldb/source/Commands/CommandObjectTarget.h @@ -14,9 +14,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordTarget -//------------------------------------------------------------------------- class CommandObjectMultiwordTarget : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 90926a0..1552d1a 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -37,9 +37,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectIterateOverThreads -//------------------------------------------------------------------------- class CommandObjectIterateOverThreads : public CommandObjectParsed { @@ -238,9 +236,7 @@ protected: bool m_add_return = true; }; -//------------------------------------------------------------------------- // CommandObjectThreadBacktrace -//------------------------------------------------------------------------- static constexpr OptionDefinition g_thread_backtrace_options[] = { // clang-format off @@ -807,9 +803,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectThreadContinue -//------------------------------------------------------------------------- class CommandObjectThreadContinue : public CommandObjectParsed { public: @@ -987,9 +981,7 @@ public: } }; -//------------------------------------------------------------------------- // CommandObjectThreadUntil -//------------------------------------------------------------------------- static constexpr OptionEnumValueElement g_duo_running_mode[] = { {eOnlyThisThread, "this-thread", "Run only this thread"}, @@ -1328,9 +1320,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectThreadSelect -//------------------------------------------------------------------------- class CommandObjectThreadSelect : public CommandObjectParsed { public: @@ -1391,9 +1381,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectThreadList -//------------------------------------------------------------------------- class CommandObjectThreadList : public CommandObjectParsed { public: @@ -1423,9 +1411,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectThreadInfo -//------------------------------------------------------------------------- static constexpr OptionDefinition g_thread_info_options[] = { // clang-format off @@ -1518,9 +1504,7 @@ public: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectThreadException -//------------------------------------------------------------------------- class CommandObjectThreadException : public CommandObjectIterateOverThreads { public: @@ -1563,9 +1547,7 @@ class CommandObjectThreadException : public CommandObjectIterateOverThreads { } }; -//------------------------------------------------------------------------- // CommandObjectThreadReturn -//------------------------------------------------------------------------- static constexpr OptionDefinition g_thread_return_options[] = { // clang-format off @@ -1741,9 +1723,7 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectThreadJump -//------------------------------------------------------------------------- static constexpr OptionDefinition g_thread_jump_options[] = { // clang-format off @@ -1889,13 +1869,9 @@ protected: CommandOptions m_options; }; -//------------------------------------------------------------------------- // Next are the subcommands of CommandObjectMultiwordThreadPlan -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- // CommandObjectThreadPlanList -//------------------------------------------------------------------------- static constexpr OptionDefinition g_thread_plan_list_options[] = { // clang-format off @@ -2061,9 +2037,7 @@ public: } }; -//------------------------------------------------------------------------- // CommandObjectMultiwordThreadPlan -//------------------------------------------------------------------------- class CommandObjectMultiwordThreadPlan : public CommandObjectMultiword { public: @@ -2082,9 +2056,7 @@ public: ~CommandObjectMultiwordThreadPlan() override = default; }; -//------------------------------------------------------------------------- // CommandObjectMultiwordThread -//------------------------------------------------------------------------- CommandObjectMultiwordThread::CommandObjectMultiwordThread( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 4df172e..9f0770a 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -523,9 +523,7 @@ public: Status *error); }; -//------------------------------------------------------------------------- // CommandObjectTypeFormatAdd -//------------------------------------------------------------------------- static constexpr OptionDefinition g_type_format_add_options[] = { // clang-format off @@ -980,9 +978,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeFormatDelete -//------------------------------------------------------------------------- class CommandObjectTypeFormatDelete : public CommandObjectTypeFormatterDelete { public: @@ -996,9 +992,7 @@ public: ~CommandObjectTypeFormatDelete() override = default; }; -//------------------------------------------------------------------------- // CommandObjectTypeFormatClear -//------------------------------------------------------------------------- class CommandObjectTypeFormatClear : public CommandObjectTypeFormatterClear { public: @@ -1222,9 +1216,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeFormatList -//------------------------------------------------------------------------- class CommandObjectTypeFormatList : public CommandObjectTypeFormatterList<TypeFormatImpl> { @@ -1236,9 +1228,7 @@ public: #ifndef LLDB_DISABLE_PYTHON -//------------------------------------------------------------------------- // CommandObjectTypeSummaryAdd -//------------------------------------------------------------------------- #endif // LLDB_DISABLE_PYTHON @@ -1713,9 +1703,7 @@ bool CommandObjectTypeSummaryAdd::AddSummary(ConstString type_name, } } -//------------------------------------------------------------------------- // CommandObjectTypeSummaryDelete -//------------------------------------------------------------------------- class CommandObjectTypeSummaryDelete : public CommandObjectTypeFormatterDelete { public: @@ -1749,9 +1737,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeSummaryList -//------------------------------------------------------------------------- class CommandObjectTypeSummaryList : public CommandObjectTypeFormatterList<TypeSummaryImpl> { @@ -1778,9 +1764,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeCategoryDefine -//------------------------------------------------------------------------- static constexpr OptionDefinition g_type_category_define_options[] = { // clang-format off @@ -1885,9 +1869,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeCategoryEnable -//------------------------------------------------------------------------- static constexpr OptionDefinition g_type_category_enable_options[] = { // clang-format off @@ -2002,9 +1984,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeCategoryDelete -//------------------------------------------------------------------------- class CommandObjectTypeCategoryDelete : public CommandObjectParsed { public: @@ -2062,9 +2042,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeCategoryDisable -//------------------------------------------------------------------------- OptionDefinition constexpr g_type_category_disable_options[] = { // clang-format off @@ -2174,9 +2152,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeCategoryList -//------------------------------------------------------------------------- class CommandObjectTypeCategoryList : public CommandObjectParsed { public: @@ -2245,9 +2221,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectTypeFilterList -//------------------------------------------------------------------------- class CommandObjectTypeFilterList : public CommandObjectTypeFormatterList<TypeFilterImpl> { @@ -2259,9 +2233,7 @@ public: #ifndef LLDB_DISABLE_PYTHON -//------------------------------------------------------------------------- // CommandObjectTypeSynthList -//------------------------------------------------------------------------- class CommandObjectTypeSynthList : public CommandObjectTypeFormatterList<SyntheticChildren> { @@ -2274,9 +2246,7 @@ public: #endif // LLDB_DISABLE_PYTHON -//------------------------------------------------------------------------- // CommandObjectTypeFilterDelete -//------------------------------------------------------------------------- class CommandObjectTypeFilterDelete : public CommandObjectTypeFormatterDelete { public: @@ -2291,9 +2261,7 @@ public: #ifndef LLDB_DISABLE_PYTHON -//------------------------------------------------------------------------- // CommandObjectTypeSynthDelete -//------------------------------------------------------------------------- class CommandObjectTypeSynthDelete : public CommandObjectTypeFormatterDelete { public: @@ -2309,9 +2277,7 @@ public: #endif // LLDB_DISABLE_PYTHON -//------------------------------------------------------------------------- // CommandObjectTypeFilterClear -//------------------------------------------------------------------------- class CommandObjectTypeFilterClear : public CommandObjectTypeFormatterClear { public: @@ -2323,9 +2289,7 @@ public: }; #ifndef LLDB_DISABLE_PYTHON -//------------------------------------------------------------------------- // CommandObjectTypeSynthClear -//------------------------------------------------------------------------- class CommandObjectTypeSynthClear : public CommandObjectTypeFormatterClear { public: @@ -2742,9 +2706,7 @@ protected: } }; -//---------------------------------------------------------------------- // "type lookup" -//---------------------------------------------------------------------- static constexpr OptionDefinition g_type_lookup_options[] = { // clang-format off { LLDB_OPT_SET_ALL, false, "show-help", 'h', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Display available help for types" }, @@ -3168,9 +3130,7 @@ public: ~CommandObjectTypeSummary() override = default; }; -//------------------------------------------------------------------------- // CommandObjectType -//------------------------------------------------------------------------- CommandObjectType::CommandObjectType(CommandInterpreter &interpreter) : CommandObjectMultiword(interpreter, "type", diff --git a/lldb/source/Commands/CommandObjectVersion.cpp b/lldb/source/Commands/CommandObjectVersion.cpp index 6f5264f..904baf5 100644 --- a/lldb/source/Commands/CommandObjectVersion.cpp +++ b/lldb/source/Commands/CommandObjectVersion.cpp @@ -15,9 +15,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectVersion -//------------------------------------------------------------------------- CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "version", diff --git a/lldb/source/Commands/CommandObjectVersion.h b/lldb/source/Commands/CommandObjectVersion.h index 5fc5499..30f44ae 100644 --- a/lldb/source/Commands/CommandObjectVersion.h +++ b/lldb/source/Commands/CommandObjectVersion.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectVersion -//------------------------------------------------------------------------- class CommandObjectVersion : public CommandObjectParsed { public: diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index fb4a4e2..6c38320 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -142,13 +142,9 @@ bool CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( return !in_range; } -//------------------------------------------------------------------------- // CommandObjectWatchpointList -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- // CommandObjectWatchpointList::Options -//------------------------------------------------------------------------- #pragma mark List::CommandOptions static constexpr OptionDefinition g_watchpoint_list_options[] = { @@ -295,9 +291,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointEnable -//------------------------------------------------------------------------- #pragma mark Enable class CommandObjectWatchpointEnable : public CommandObjectParsed { @@ -366,9 +360,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointDisable -//------------------------------------------------------------------------- #pragma mark Disable class CommandObjectWatchpointDisable : public CommandObjectParsed { @@ -441,9 +433,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointDelete -//------------------------------------------------------------------------- #pragma mark Delete class CommandObjectWatchpointDelete : public CommandObjectParsed { @@ -517,9 +507,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointIgnore -//------------------------------------------------------------------------- #pragma mark Ignore::CommandOptions static constexpr OptionDefinition g_watchpoint_ignore_options[] = { @@ -638,9 +626,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointModify -//------------------------------------------------------------------------- #pragma mark Modify::CommandOptions @@ -769,9 +755,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointSetVariable -//------------------------------------------------------------------------- #pragma mark SetVariable class CommandObjectWatchpointSetVariable : public CommandObjectParsed { @@ -959,9 +943,7 @@ private: OptionGroupWatchpoint m_option_watchpoint; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointSetExpression -//------------------------------------------------------------------------- #pragma mark Set class CommandObjectWatchpointSetExpression : public CommandObjectRaw { @@ -1127,9 +1109,7 @@ private: OptionGroupWatchpoint m_option_watchpoint; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointSet -//------------------------------------------------------------------------- #pragma mark Set class CommandObjectWatchpointSet : public CommandObjectMultiword { @@ -1150,9 +1130,7 @@ public: ~CommandObjectWatchpointSet() override = default; }; -//------------------------------------------------------------------------- // CommandObjectMultiwordWatchpoint -//------------------------------------------------------------------------- #pragma mark MultiwordWatchpoint CommandObjectMultiwordWatchpoint::CommandObjectMultiwordWatchpoint( diff --git a/lldb/source/Commands/CommandObjectWatchpoint.h b/lldb/source/Commands/CommandObjectWatchpoint.h index 2973bd8..f21796e 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.h +++ b/lldb/source/Commands/CommandObjectWatchpoint.h @@ -16,9 +16,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordWatchpoint -//------------------------------------------------------------------------- class CommandObjectMultiwordWatchpoint : public CommandObjectMultiword { public: diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index 9b5fb4c..29c8592 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -24,9 +24,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectWatchpointCommandAdd -//------------------------------------------------------------------------- // FIXME: "script-type" needs to have its contents determined dynamically, so // somebody can add a new scripting @@ -478,9 +476,7 @@ private: CommandOptions m_options; }; -//------------------------------------------------------------------------- // CommandObjectWatchpointCommandDelete -//------------------------------------------------------------------------- class CommandObjectWatchpointCommandDelete : public CommandObjectParsed { public: @@ -558,9 +554,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointCommandList -//------------------------------------------------------------------------- class CommandObjectWatchpointCommandList : public CommandObjectParsed { public: @@ -658,9 +652,7 @@ protected: } }; -//------------------------------------------------------------------------- // CommandObjectWatchpointCommand -//------------------------------------------------------------------------- CommandObjectWatchpointCommand::CommandObjectWatchpointCommand( CommandInterpreter &interpreter) diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.h b/lldb/source/Commands/CommandObjectWatchpointCommand.h index 22eea24..f2f15ef 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.h +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.h @@ -17,9 +17,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectMultiwordWatchpoint -//------------------------------------------------------------------------- class CommandObjectWatchpointCommand : public CommandObjectMultiword { public: diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index 0efe071..9520e43 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -927,7 +927,6 @@ size_t Address::MemorySize() const { return sizeof(Address); } -//---------------------------------------------------------------------- // NOTE: Be careful using this operator. It can correctly compare two // addresses from the same Module correctly. It can't compare two addresses // from different modules in any meaningful way, but it will compare the module @@ -939,7 +938,6 @@ size_t Address::MemorySize() const { // address results to make much sense // // This basically lets Address objects be used in ordered collection classes. -//---------------------------------------------------------------------- bool lldb_private::operator<(const Address &lhs, const Address &rhs) { ModuleSP lhs_module_sp(lhs.GetModule()); diff --git a/lldb/source/Core/AddressResolver.cpp b/lldb/source/Core/AddressResolver.cpp index c2580c2..974d99b 100644 --- a/lldb/source/Core/AddressResolver.cpp +++ b/lldb/source/Core/AddressResolver.cpp @@ -16,9 +16,7 @@ class ModuleList; using namespace lldb_private; -//---------------------------------------------------------------------- // AddressResolver: -//---------------------------------------------------------------------- AddressResolver::AddressResolver() {} AddressResolver::~AddressResolver() {} diff --git a/lldb/source/Core/AddressResolverFileLine.cpp b/lldb/source/Core/AddressResolverFileLine.cpp index 5fd1da6..24c0222 100644 --- a/lldb/source/Core/AddressResolverFileLine.cpp +++ b/lldb/source/Core/AddressResolverFileLine.cpp @@ -27,9 +27,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // AddressResolverFileLine: -//---------------------------------------------------------------------- AddressResolverFileLine::AddressResolverFileLine(const FileSpec &file_spec, uint32_t line_no, bool check_inlines) diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index c170274..3ff9232 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -824,7 +824,6 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton) Debugger::~Debugger() { Clear(); } void Debugger::Clear() { - //---------------------------------------------------------------------- // Make sure we call this function only once. With the C++ global destructor // chain having a list of debuggers and with code that can be running on // other threads, we need to ensure this doesn't happen multiple times. @@ -833,7 +832,6 @@ void Debugger::Clear() { // Debugger::~Debugger(); // static void Debugger::Destroy(lldb::DebuggerSP &debugger_sp); // static void Debugger::Terminate(); - //---------------------------------------------------------------------- llvm::call_once(m_clear_once, [this]() { ClearIOHandlers(); StopIOHandlerThread(); diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index f5cfcf2..74f66b5 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -1237,9 +1237,7 @@ size_t Disassembler::ParseInstructions(const ExecutionContext *exe_ctx, return m_instruction_list.GetSize(); } -//---------------------------------------------------------------------- // Disassembler copy constructor -//---------------------------------------------------------------------- Disassembler::Disassembler(const ArchSpec &arch, const char *flavor) : m_arch(arch), m_instruction_list(), m_base_addr(LLDB_INVALID_ADDRESS), m_flavor() { @@ -1271,9 +1269,7 @@ const InstructionList &Disassembler::GetInstructionList() const { return m_instruction_list; } -//---------------------------------------------------------------------- // Class PseudoInstruction -//---------------------------------------------------------------------- PseudoInstruction::PseudoInstruction() : Instruction(Address(), AddressClass::eUnknown), m_description() {} diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp index c773caa..57130d6 100644 --- a/lldb/source/Core/DynamicLoader.cpp +++ b/lldb/source/Core/DynamicLoader.cpp @@ -62,10 +62,8 @@ DynamicLoader::DynamicLoader(Process *process) : m_process(process) {} DynamicLoader::~DynamicLoader() = default; -//---------------------------------------------------------------------- // Accessosors to the global setting as to whether to stop at image (shared // library) loading/unloading. -//---------------------------------------------------------------------- bool DynamicLoader::GetStopWhenImagesChange() const { return m_process->GetStopOnSharedLibraryEvents(); diff --git a/lldb/source/Core/FileLineResolver.cpp b/lldb/source/Core/FileLineResolver.cpp index 949a4c9..3cba1c7 100644 --- a/lldb/source/Core/FileLineResolver.cpp +++ b/lldb/source/Core/FileLineResolver.cpp @@ -23,9 +23,7 @@ class Address; using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // FileLineResolver: -//---------------------------------------------------------------------- FileLineResolver::FileLineResolver(const FileSpec &file_spec, uint32_t line_no, bool check_inlines) : Searcher(), m_file_spec(file_spec), m_line_number(line_no), diff --git a/lldb/source/Core/FileSpecList.cpp b/lldb/source/Core/FileSpecList.cpp index fc8c6d7..95133fa 100644 --- a/lldb/source/Core/FileSpecList.cpp +++ b/lldb/source/Core/FileSpecList.cpp @@ -22,19 +22,15 @@ FileSpecList::FileSpecList() : m_files() {} FileSpecList::~FileSpecList() = default; -//------------------------------------------------------------------ // Append the "file_spec" to the end of the file spec list. -//------------------------------------------------------------------ void FileSpecList::Append(const FileSpec &file_spec) { m_files.push_back(file_spec); } -//------------------------------------------------------------------ // Only append the "file_spec" if this list doesn't already contain it. // // Returns true if "file_spec" was added, false if this list already contained // a copy of "file_spec". -//------------------------------------------------------------------ bool FileSpecList::AppendIfUnique(const FileSpec &file_spec) { collection::iterator end = m_files.end(); if (find(m_files.begin(), end, file_spec) == end) { @@ -44,14 +40,10 @@ bool FileSpecList::AppendIfUnique(const FileSpec &file_spec) { return false; } -//------------------------------------------------------------------ // Clears the file list. -//------------------------------------------------------------------ void FileSpecList::Clear() { m_files.clear(); } -//------------------------------------------------------------------ // Dumps the file list to the supplied stream pointer "s". -//------------------------------------------------------------------ void FileSpecList::Dump(Stream *s, const char *separator_cstr) const { collection::const_iterator pos, end = m_files.end(); for (pos = m_files.begin(); pos != end; ++pos) { @@ -61,13 +53,11 @@ void FileSpecList::Dump(Stream *s, const char *separator_cstr) const { } } -//------------------------------------------------------------------ // Find the index of the file in the file spec list that matches "file_spec" // starting "start_idx" entries into the file spec list. // // Returns the valid index of the file that matches "file_spec" if it is found, // else std::numeric_limits<uint32_t>::max() is returned. -//------------------------------------------------------------------ size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec, bool full) const { const size_t num_files = m_files.size(); @@ -92,10 +82,8 @@ size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec, return UINT32_MAX; } -//------------------------------------------------------------------ // Returns the FileSpec object at index "idx". If "idx" is out of range, then // an empty FileSpec object will be returned. -//------------------------------------------------------------------ const FileSpec &FileSpecList::GetFileSpecAtIndex(size_t idx) const { if (idx < m_files.size()) return m_files[idx]; @@ -109,12 +97,10 @@ const FileSpec *FileSpecList::GetFileSpecPointerAtIndex(size_t idx) const { return nullptr; } -//------------------------------------------------------------------ // Return the size in bytes that this object takes in memory. This returns the // size in bytes of this object's member variables and any FileSpec objects its // member variables contain, the result doesn't not include the string values // for the directories any filenames as those are in shared string pools. -//------------------------------------------------------------------ size_t FileSpecList::MemorySize() const { size_t mem_size = sizeof(FileSpecList); collection::const_iterator pos, end = m_files.end(); @@ -125,9 +111,7 @@ size_t FileSpecList::MemorySize() const { return mem_size; } -//------------------------------------------------------------------ // Return the number of files in the file spec list. -//------------------------------------------------------------------ size_t FileSpecList::GetSize() const { return m_files.size(); } size_t FileSpecList::GetFilesMatchingPartialPath(const char *path, diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp index 257db46..3a7a75e8 100644 --- a/lldb/source/Core/IOHandler.cpp +++ b/lldb/source/Core/IOHandler.cpp @@ -1078,9 +1078,7 @@ public: operator WINDOW *() { return m_window; } - //---------------------------------------------------------------------- // Window drawing utilities - //---------------------------------------------------------------------- void DrawTitleBox(const char *title, const char *bottom_message = nullptr) { attr_t attr = 0; if (IsActive()) diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index e3b3721..608ea89 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -124,15 +124,11 @@ get_demangled_name_without_arguments(ConstString mangled, } #pragma mark Mangled -//---------------------------------------------------------------------- // Default constructor -//---------------------------------------------------------------------- Mangled::Mangled() : m_mangled(), m_demangled() {} -//---------------------------------------------------------------------- // Constructor with an optional string and a boolean indicating if it is the // mangled version. -//---------------------------------------------------------------------- Mangled::Mangled(ConstString s, bool mangled) : m_mangled(), m_demangled() { if (s) @@ -154,54 +150,42 @@ Mangled::Mangled(llvm::StringRef name) { SetValue(ConstString(name)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Mangled::~Mangled() {} -//---------------------------------------------------------------------- // Convert to pointer operator. This allows code to check any Mangled objects // to see if they contain anything valid using code such as: // // Mangled mangled(...); // if (mangled) // { ... -//---------------------------------------------------------------------- Mangled::operator void *() const { return (m_mangled) ? const_cast<Mangled *>(this) : NULL; } -//---------------------------------------------------------------------- // Logical NOT operator. This allows code to check any Mangled objects to see // if they are invalid using code such as: // // Mangled mangled(...); // if (!file_spec) // { ... -//---------------------------------------------------------------------- bool Mangled::operator!() const { return !m_mangled; } -//---------------------------------------------------------------------- // Clear the mangled and demangled values. -//---------------------------------------------------------------------- void Mangled::Clear() { m_mangled.Clear(); m_demangled.Clear(); } -//---------------------------------------------------------------------- // Compare the string values. -//---------------------------------------------------------------------- int Mangled::Compare(const Mangled &a, const Mangled &b) { return ConstString::Compare( a.GetName(lldb::eLanguageTypeUnknown, ePreferMangled), b.GetName(lldb::eLanguageTypeUnknown, ePreferMangled)); } -//---------------------------------------------------------------------- // Set the string value in this objects. If "mangled" is true, then the mangled // named is set with the new value in "s", else the demangled name is set. -//---------------------------------------------------------------------- void Mangled::SetValue(ConstString s, bool mangled) { if (s) { if (mangled) { @@ -232,9 +216,7 @@ void Mangled::SetValue(ConstString name) { } } -//---------------------------------------------------------------------- // Local helpers for different demangling implementations. -//---------------------------------------------------------------------- static char *GetMSVCDemangledStr(const char *M) { #if defined(_MSC_VER) const size_t demangled_length = 2048; @@ -287,10 +269,8 @@ static char *GetItaniumDemangledStr(const char *M) { return demangled_cstr; } -//---------------------------------------------------------------------- // Explicit demangling for scheduled requests during batch processing. This // makes use of ItaniumPartialDemangler's rich demangle info -//---------------------------------------------------------------------- bool Mangled::DemangleWithRichManglingInfo( RichManglingContext &context, SkipMangledNameFn *skip_mangled_name) { // We need to generate and cache the demangled name. @@ -356,12 +336,10 @@ bool Mangled::DemangleWithRichManglingInfo( llvm_unreachable("Fully covered switch above!"); } -//---------------------------------------------------------------------- // Generate the demangled name on demand using this accessor. Code in this // class will need to use this accessor if it wishes to decode the demangled // name. The result is cached and will be kept until a new string value is // supplied to this object, or until the end of the object's lifetime. -//---------------------------------------------------------------------- ConstString Mangled::GetDemangledName(lldb::LanguageType language) const { // Check to make sure we have a valid mangled name and that we haven't @@ -421,9 +399,7 @@ bool Mangled::NameMatches(const RegularExpression ®ex, return demangled && regex.Execute(demangled.AsCString()); } -//---------------------------------------------------------------------- // Get the demangled name if there is one, else return the mangled name. -//---------------------------------------------------------------------- ConstString Mangled::GetName(lldb::LanguageType language, Mangled::NamePreference preference) const { if (preference == ePreferMangled && m_mangled) @@ -444,10 +420,8 @@ ConstString Mangled::GetName(lldb::LanguageType language, return demangled; } -//---------------------------------------------------------------------- // Dump a Mangled object to stream "s". We don't force our demangled name to be // computed currently (we don't use the accessor). -//---------------------------------------------------------------------- void Mangled::Dump(Stream *s) const { if (m_mangled) { *s << ", mangled = " << m_mangled; @@ -458,10 +432,8 @@ void Mangled::Dump(Stream *s) const { } } -//---------------------------------------------------------------------- // Dumps a debug version of this string with extra object and state information // to stream "s". -//---------------------------------------------------------------------- void Mangled::DumpDebug(Stream *s) const { s->Printf("%*p: Mangled mangled = ", static_cast<int>(sizeof(void *) * 2), static_cast<const void *>(this)); @@ -470,23 +442,19 @@ void Mangled::DumpDebug(Stream *s) const { m_demangled.DumpDebug(s); } -//---------------------------------------------------------------------- // Return the size in byte that this object takes in memory. The size includes // the size of the objects it owns, and not the strings that it references // because they are shared strings. -//---------------------------------------------------------------------- size_t Mangled::MemorySize() const { return m_mangled.MemorySize() + m_demangled.MemorySize(); } -//---------------------------------------------------------------------- // We "guess" the language because we can't determine a symbol's language from // it's name. For example, a Pascal symbol can be mangled using the C++ // Itanium scheme, and defined in a compilation unit within the same module as // other C++ units. In addition, different targets could have different ways // of mangling names from a given language, likewise the compilation units // within those targets. -//---------------------------------------------------------------------- lldb::LanguageType Mangled::GuessLanguage() const { ConstString mangled = GetMangledName(); if (mangled) { @@ -507,9 +475,7 @@ lldb::LanguageType Mangled::GuessLanguage() const { return lldb::eLanguageTypeUnknown; } -//---------------------------------------------------------------------- // Dump OBJ to the supplied stream S. -//---------------------------------------------------------------------- Stream &operator<<(Stream &s, const Mangled &obj) { if (obj.GetMangledName()) s << "mangled = '" << obj.GetMangledName() << "'"; diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp index 07121da..f69610c 100644 --- a/lldb/source/Core/PluginManager.cpp +++ b/lldb/source/Core/PluginManager.cpp @@ -1539,9 +1539,7 @@ lldb::ScriptInterpreterSP PluginManager::GetScriptInterpreterForLanguage( #pragma mark - #pragma mark StructuredDataPlugin -// ----------------------------------------------------------------------------- // StructuredDataPlugin -// ----------------------------------------------------------------------------- struct StructuredDataPluginInstance { StructuredDataPluginInstance() diff --git a/lldb/source/Core/RichManglingContext.cpp b/lldb/source/Core/RichManglingContext.cpp index 5957a2b..3d1941e 100644 --- a/lldb/source/Core/RichManglingContext.cpp +++ b/lldb/source/Core/RichManglingContext.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RichManglingContext -//---------------------------------------------------------------------- void RichManglingContext::ResetProvider(InfoProvider new_provider) { // If we want to support parsers for other languages some day, we need a // switch here to delete the correct parser type. diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp index 55589b8..2f6b16f 100644 --- a/lldb/source/Core/SearchFilter.cpp +++ b/lldb/source/Core/SearchFilter.cpp @@ -171,9 +171,7 @@ lldb::SearchFilterSP SearchFilter::CopyForBreakpoint(Breakpoint &breakpoint) { return ret_sp; } -//---------------------------------------------------------------------- // Helper functions for serialization. -//---------------------------------------------------------------------- StructuredData::DictionarySP SearchFilter::WrapOptionsDict(StructuredData::DictionarySP options_dict_sp) { @@ -204,10 +202,8 @@ void SearchFilter::SerializeFileSpecList( options_dict_sp->AddItem(GetKey(name), module_array_sp); } -//---------------------------------------------------------------------- // UTILITY Functions to help iterate down through the elements of the // SymbolContext. -//---------------------------------------------------------------------- void SearchFilter::Search(Searcher &searcher) { SymbolContext empty_sc; @@ -363,11 +359,9 @@ Searcher::CallbackReturn SearchFilter::DoFunctionIteration( return Searcher::eCallbackReturnContinue; } -//---------------------------------------------------------------------- // SearchFilterForUnconstrainedSearches: // Selects a shared library matching a given file spec, consulting the targets // "black list". -//---------------------------------------------------------------------- SearchFilterSP SearchFilterForUnconstrainedSearches::CreateFromStructuredData( Target &target, const StructuredData::Dictionary &data_dict, Status &error) { @@ -403,10 +397,8 @@ lldb::SearchFilterSP SearchFilterForUnconstrainedSearches::DoCopyForBreakpoint( return std::make_shared<SearchFilterForUnconstrainedSearches>(*this); } -//---------------------------------------------------------------------- // SearchFilterByModule: // Selects a shared library matching a given file spec -//---------------------------------------------------------------------- SearchFilterByModule::SearchFilterByModule(const lldb::TargetSP &target_sp, const FileSpec &module) @@ -533,10 +525,8 @@ StructuredData::ObjectSP SearchFilterByModule::SerializeToStructuredData() { return WrapOptionsDict(options_dict_sp); } -//---------------------------------------------------------------------- // SearchFilterByModuleList: // Selects a shared library matching a given file spec -//---------------------------------------------------------------------- SearchFilterByModuleList::SearchFilterByModuleList( const lldb::TargetSP &target_sp, const FileSpecList &module_list) @@ -687,10 +677,8 @@ StructuredData::ObjectSP SearchFilterByModuleList::SerializeToStructuredData() { return WrapOptionsDict(options_dict_sp); } -//---------------------------------------------------------------------- // SearchFilterByModuleListAndCU: // Selects a shared library matching a given file spec -//---------------------------------------------------------------------- SearchFilterByModuleListAndCU::SearchFilterByModuleListAndCU( const lldb::TargetSP &target_sp, const FileSpecList &module_list, diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 1fa5a8c..05d1468 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -381,9 +381,7 @@ bool Section::Slide(addr_t slide_amount, bool slide_children) { return false; } -//------------------------------------------------------------------ /// Get the permissions as OR'ed bits from lldb::Permissions -//------------------------------------------------------------------ uint32_t Section::GetPermissions() const { uint32_t permissions = 0; if (m_readable) @@ -395,9 +393,7 @@ uint32_t Section::GetPermissions() const { return permissions; } -//------------------------------------------------------------------ /// Set the permissions using bits OR'ed from lldb::Permissions -//------------------------------------------------------------------ void Section::SetPermissions(uint32_t permissions) { m_readable = (permissions & ePermissionsReadable) != 0; m_writable = (permissions & ePermissionsWritable) != 0; diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp index 8b5cb26..9cd9ac1 100644 --- a/lldb/source/Core/SourceManager.cpp +++ b/lldb/source/Core/SourceManager.cpp @@ -49,9 +49,7 @@ using namespace lldb_private; static inline bool is_newline_char(char ch) { return ch == '\n' || ch == '\r'; } -//---------------------------------------------------------------------- // SourceManager constructor -//---------------------------------------------------------------------- SourceManager::SourceManager(const TargetSP &target_sp) : m_last_file_sp(), m_last_line(0), m_last_count(0), m_default_set(false), m_target_wp(target_sp), @@ -61,9 +59,7 @@ SourceManager::SourceManager(const DebuggerSP &debugger_sp) : m_last_file_sp(), m_last_line(0), m_last_count(0), m_default_set(false), m_target_wp(), m_debugger_wp(debugger_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SourceManager::~SourceManager() {} SourceManager::FileSP SourceManager::GetFile(const FileSpec &file_spec) { diff --git a/lldb/source/Core/StreamFile.cpp b/lldb/source/Core/StreamFile.cpp index db184df..ce6e1ea 100644 --- a/lldb/source/Core/StreamFile.cpp +++ b/lldb/source/Core/StreamFile.cpp @@ -14,9 +14,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // StreamFile constructor -//---------------------------------------------------------------------- StreamFile::StreamFile() : Stream(), m_file() {} StreamFile::StreamFile(uint32_t flags, uint32_t addr_size, ByteOrder byte_order) diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index e749315..1d9d7d4 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -77,9 +77,7 @@ using namespace lldb_utility; static user_id_t g_value_obj_uid = 0; -//---------------------------------------------------------------------- // ValueObject constructor -//---------------------------------------------------------------------- ValueObject::ValueObject(ValueObject &parent) : UserID(++g_value_obj_uid), // Unique identifier for every value object m_parent(&parent), m_root(NULL), m_update_point(parent.GetUpdatePoint()), @@ -105,9 +103,7 @@ ValueObject::ValueObject(ValueObject &parent) m_manager->ManageObject(this); } -//---------------------------------------------------------------------- // ValueObject constructor -//---------------------------------------------------------------------- ValueObject::ValueObject(ExecutionContextScope *exe_scope, AddressType child_ptr_or_ref_addr_type) : UserID(++g_value_obj_uid), // Unique identifier for every value object @@ -134,9 +130,7 @@ ValueObject::ValueObject(ExecutionContextScope *exe_scope, m_manager->ManageObject(this); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ValueObject::~ValueObject() {} bool ValueObject::UpdateValueIfNeeded(bool update_format) { diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index 2596a7b..17841bb 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -50,9 +50,7 @@ ReadAddressFromDebugAddrSection(const DWARFUnit *dwarf_cu, &offset, index_size); } -//---------------------------------------------------------------------- // DWARFExpression constructor -//---------------------------------------------------------------------- DWARFExpression::DWARFExpression(DWARFUnit *dwarf_cu) : m_module_wp(), m_data(), m_dwarf_cu(dwarf_cu), m_reg_kind(eRegisterKindDWARF), m_loclist_slide(LLDB_INVALID_ADDRESS) {} @@ -74,9 +72,7 @@ DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp, m_module_wp = module_sp; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DWARFExpression::~DWARFExpression() {} bool DWARFExpression::IsValid() const { return m_data.GetByteSize() > 0; } @@ -1379,10 +1375,8 @@ bool DWARFExpression::Evaluate( } switch (op) { - //---------------------------------------------------------------------- // The DW_OP_addr operation has a single operand that encodes a machine // address and whose size is the size of an address on the target machine. - //---------------------------------------------------------------------- case DW_OP_addr: stack.push_back(Scalar(opcodes.GetAddress(&offset))); stack.back().SetValueType(Value::eValueTypeFileAddress); @@ -1393,7 +1387,6 @@ bool DWARFExpression::Evaluate( frame->CalculateTarget().get()); break; - //---------------------------------------------------------------------- // The DW_OP_addr_sect_offset4 is used for any location expressions in // shared libraries that have a location like: // DW_OP_addr(0x1000) @@ -1402,7 +1395,6 @@ bool DWARFExpression::Evaluate( // process where shared libraries have been slid. To account for this, this // new address type where we can store the section pointer and a 4 byte // offset. - //---------------------------------------------------------------------- // case DW_OP_addr_sect_offset4: // { // result_type = eResultTypeFileAddress; @@ -1432,14 +1424,12 @@ bool DWARFExpression::Evaluate( // } // break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_deref // OPERANDS: none // DESCRIPTION: Pops the top stack entry and treats it as an address. // The value retrieved from that address is pushed. The size of the data // retrieved from the dereferenced address is the size of an address on the // target machine. - //---------------------------------------------------------------------- case DW_OP_deref: { if (stack.empty()) { if (error_ptr) @@ -1521,7 +1511,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_deref_size // OPERANDS: 1 // 1 - uint8_t that specifies the size of the data to dereference. @@ -1534,7 +1523,6 @@ bool DWARFExpression::Evaluate( // address on the target machine. The data retrieved is zero extended to // the size of an address on the target machine before being pushed on the // expression stack. - //---------------------------------------------------------------------- case DW_OP_deref_size: { if (stack.empty()) { if (error_ptr) @@ -1643,7 +1631,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_xderef_size // OPERANDS: 1 // 1 - uint8_t that specifies the size of the data to dereference. @@ -1659,12 +1646,10 @@ bool DWARFExpression::Evaluate( // the size of an address on the target machine. The data retrieved is zero // extended to the size of an address on the target machine before being // pushed on the expression stack. - //---------------------------------------------------------------------- case DW_OP_xderef_size: if (error_ptr) error_ptr->SetErrorString("Unimplemented opcode: DW_OP_xderef_size."); return false; - //---------------------------------------------------------------------- // OPCODE: DW_OP_xderef // OPERANDS: none // DESCRIPTION: Provides an extended dereference mechanism. The entry at @@ -1675,17 +1660,14 @@ bool DWARFExpression::Evaluate( // calculation and pushed as the new stack top. The size of the data // retrieved from the dereferenced address is the size of an address on the // target machine. - //---------------------------------------------------------------------- case DW_OP_xderef: if (error_ptr) error_ptr->SetErrorString("Unimplemented opcode: DW_OP_xderef."); return false; - //---------------------------------------------------------------------- // All DW_OP_constXXX opcodes have a single operand as noted below: // // Opcode Operand 1 - // --------------- ---------------------------------------------------- // DW_OP_const1u 1-byte unsigned integer constant DW_OP_const1s // 1-byte signed integer constant DW_OP_const2u 2-byte unsigned integer // constant DW_OP_const2s 2-byte signed integer constant DW_OP_const4u @@ -1693,7 +1675,6 @@ bool DWARFExpression::Evaluate( // constant DW_OP_const8u 8-byte unsigned integer constant DW_OP_const8s // 8-byte signed integer constant DW_OP_constu unsigned LEB128 integer // constant DW_OP_consts signed LEB128 integer constant - //---------------------------------------------------------------------- case DW_OP_const1u: stack.push_back(Scalar((uint8_t)opcodes.GetU8(&offset))); break; @@ -1725,11 +1706,9 @@ bool DWARFExpression::Evaluate( stack.push_back(Scalar(opcodes.GetSLEB128(&offset))); break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_dup // OPERANDS: none // DESCRIPTION: duplicates the value at the top of the stack - //---------------------------------------------------------------------- case DW_OP_dup: if (stack.empty()) { if (error_ptr) @@ -1739,11 +1718,9 @@ bool DWARFExpression::Evaluate( stack.push_back(stack.back()); break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_drop // OPERANDS: none // DESCRIPTION: pops the value at the top of the stack - //---------------------------------------------------------------------- case DW_OP_drop: if (stack.empty()) { if (error_ptr) @@ -1753,12 +1730,10 @@ bool DWARFExpression::Evaluate( stack.pop_back(); break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_over // OPERANDS: none // DESCRIPTION: Duplicates the entry currently second in the stack at // the top of the stack. - //---------------------------------------------------------------------- case DW_OP_over: if (stack.size() < 2) { if (error_ptr) @@ -1769,12 +1744,10 @@ bool DWARFExpression::Evaluate( stack.push_back(stack[stack.size() - 2]); break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_pick // OPERANDS: uint8_t index into the current stack // DESCRIPTION: The stack entry with the specified index (0 through 255, // inclusive) is pushed on the stack - //---------------------------------------------------------------------- case DW_OP_pick: { uint8_t pick_idx = opcodes.GetU8(&offset); if (pick_idx < stack.size()) @@ -1787,13 +1760,11 @@ bool DWARFExpression::Evaluate( } } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_swap // OPERANDS: none // DESCRIPTION: swaps the top two stack entries. The entry at the top // of the stack becomes the second stack entry, and the second entry // becomes the top of the stack - //---------------------------------------------------------------------- case DW_OP_swap: if (stack.size() < 2) { if (error_ptr) @@ -1807,14 +1778,12 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_rot // OPERANDS: none // DESCRIPTION: Rotates the first three stack entries. The entry at // the top of the stack becomes the third stack entry, the second entry // becomes the top of the stack, and the third entry becomes the second // entry. - //---------------------------------------------------------------------- case DW_OP_rot: if (stack.size() < 3) { if (error_ptr) @@ -1830,13 +1799,11 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_abs // OPERANDS: none // DESCRIPTION: pops the top stack entry, interprets it as a signed // value and pushes its absolute value. If the absolute value can not be // represented, the result is undefined. - //---------------------------------------------------------------------- case DW_OP_abs: if (stack.empty()) { if (error_ptr) @@ -1851,12 +1818,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_and // OPERANDS: none // DESCRIPTION: pops the top two stack values, performs a bitwise and // operation on the two, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_and: if (stack.size() < 2) { if (error_ptr) @@ -1871,13 +1836,11 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_div // OPERANDS: none // DESCRIPTION: pops the top two stack values, divides the former second // entry by the former top of the stack using signed division, and pushes // the result. - //---------------------------------------------------------------------- case DW_OP_div: if (stack.size() < 2) { if (error_ptr) @@ -1903,12 +1866,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_minus // OPERANDS: none // DESCRIPTION: pops the top two stack values, subtracts the former top // of the stack from the former second entry, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_minus: if (stack.size() < 2) { if (error_ptr) @@ -1923,13 +1884,11 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_mod // OPERANDS: none // DESCRIPTION: pops the top two stack values and pushes the result of // the calculation: former second stack entry modulo the former top of the // stack. - //---------------------------------------------------------------------- case DW_OP_mod: if (stack.size() < 2) { if (error_ptr) @@ -1944,12 +1903,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_mul // OPERANDS: none // DESCRIPTION: pops the top two stack entries, multiplies them // together, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_mul: if (stack.size() < 2) { if (error_ptr) @@ -1964,11 +1921,9 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_neg // OPERANDS: none // DESCRIPTION: pops the top stack entry, and pushes its negation. - //---------------------------------------------------------------------- case DW_OP_neg: if (stack.empty()) { if (error_ptr) @@ -1984,12 +1939,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_not // OPERANDS: none // DESCRIPTION: pops the top stack entry, and pushes its bitwise // complement - //---------------------------------------------------------------------- case DW_OP_not: if (stack.empty()) { if (error_ptr) @@ -2005,12 +1958,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_or // OPERANDS: none // DESCRIPTION: pops the top two stack entries, performs a bitwise or // operation on the two, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_or: if (stack.size() < 2) { if (error_ptr) @@ -2025,12 +1976,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_plus // OPERANDS: none // DESCRIPTION: pops the top two stack entries, adds them together, and // pushes the result. - //---------------------------------------------------------------------- case DW_OP_plus: if (stack.size() < 2) { if (error_ptr) @@ -2044,12 +1993,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_plus_uconst // OPERANDS: none // DESCRIPTION: pops the top stack entry, adds it to the unsigned LEB128 // constant operand and pushes the result. - //---------------------------------------------------------------------- case DW_OP_plus_uconst: if (stack.empty()) { if (error_ptr) @@ -2068,13 +2015,11 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_shl // OPERANDS: none // DESCRIPTION: pops the top two stack entries, shifts the former // second entry left by the number of bits specified by the former top of // the stack, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_shl: if (stack.size() < 2) { if (error_ptr) @@ -2088,13 +2033,11 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_shr // OPERANDS: none // DESCRIPTION: pops the top two stack entries, shifts the former second // entry right logically (filling with zero bits) by the number of bits // specified by the former top of the stack, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_shr: if (stack.size() < 2) { if (error_ptr) @@ -2113,14 +2056,12 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_shra // OPERANDS: none // DESCRIPTION: pops the top two stack entries, shifts the former second // entry right arithmetically (divide the magnitude by 2, keep the same // sign for the result) by the number of bits specified by the former top // of the stack, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_shra: if (stack.size() < 2) { if (error_ptr) @@ -2134,12 +2075,10 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_xor // OPERANDS: none // DESCRIPTION: pops the top two stack entries, performs the bitwise // exclusive-or operation on the two, and pushes the result. - //---------------------------------------------------------------------- case DW_OP_xor: if (stack.size() < 2) { if (error_ptr) @@ -2154,14 +2093,12 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_skip // OPERANDS: int16_t // DESCRIPTION: An unconditional branch. Its single operand is a 2-byte // signed integer constant. The 2-byte constant is the number of bytes of // the DWARF expression to skip forward or backward from the current // operation, beginning after the 2-byte constant. - //---------------------------------------------------------------------- case DW_OP_skip: { int16_t skip_offset = (int16_t)opcodes.GetU16(&offset); lldb::offset_t new_offset = offset + skip_offset; @@ -2174,7 +2111,6 @@ bool DWARFExpression::Evaluate( } } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_bra // OPERANDS: int16_t // DESCRIPTION: A conditional branch. Its single operand is a 2-byte @@ -2182,7 +2118,6 @@ bool DWARFExpression::Evaluate( // value popped is not the constant 0, the 2-byte constant operand is the // number of bytes of the DWARF expression to skip forward or backward from // the current operation, beginning after the 2-byte constant. - //---------------------------------------------------------------------- case DW_OP_bra: if (stack.empty()) { if (error_ptr) @@ -2207,7 +2142,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_eq // OPERANDS: none // DESCRIPTION: pops the top two stack values, compares using the @@ -2215,7 +2149,6 @@ bool DWARFExpression::Evaluate( // STACK RESULT: push the constant value 1 onto the stack if the result // of the operation is true or the constant value 0 if the result of the // operation is false. - //---------------------------------------------------------------------- case DW_OP_eq: if (stack.size() < 2) { if (error_ptr) @@ -2230,7 +2163,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_ge // OPERANDS: none // DESCRIPTION: pops the top two stack values, compares using the @@ -2238,7 +2170,6 @@ bool DWARFExpression::Evaluate( // STACK RESULT: push the constant value 1 onto the stack if the result // of the operation is true or the constant value 0 if the result of the // operation is false. - //---------------------------------------------------------------------- case DW_OP_ge: if (stack.size() < 2) { if (error_ptr) @@ -2253,7 +2184,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_gt // OPERANDS: none // DESCRIPTION: pops the top two stack values, compares using the @@ -2261,7 +2191,6 @@ bool DWARFExpression::Evaluate( // STACK RESULT: push the constant value 1 onto the stack if the result // of the operation is true or the constant value 0 if the result of the // operation is false. - //---------------------------------------------------------------------- case DW_OP_gt: if (stack.size() < 2) { if (error_ptr) @@ -2276,7 +2205,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_le // OPERANDS: none // DESCRIPTION: pops the top two stack values, compares using the @@ -2284,7 +2212,6 @@ bool DWARFExpression::Evaluate( // STACK RESULT: push the constant value 1 onto the stack if the result // of the operation is true or the constant value 0 if the result of the // operation is false. - //---------------------------------------------------------------------- case DW_OP_le: if (stack.size() < 2) { if (error_ptr) @@ -2299,7 +2226,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_lt // OPERANDS: none // DESCRIPTION: pops the top two stack values, compares using the @@ -2307,7 +2233,6 @@ bool DWARFExpression::Evaluate( // STACK RESULT: push the constant value 1 onto the stack if the result // of the operation is true or the constant value 0 if the result of the // operation is false. - //---------------------------------------------------------------------- case DW_OP_lt: if (stack.size() < 2) { if (error_ptr) @@ -2322,7 +2247,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_ne // OPERANDS: none // DESCRIPTION: pops the top two stack values, compares using the @@ -2330,7 +2254,6 @@ bool DWARFExpression::Evaluate( // STACK RESULT: push the constant value 1 onto the stack if the result // of the operation is true or the constant value 0 if the result of the // operation is false. - //---------------------------------------------------------------------- case DW_OP_ne: if (stack.size() < 2) { if (error_ptr) @@ -2345,13 +2268,11 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_litn // OPERANDS: none // DESCRIPTION: encode the unsigned literal values from 0 through 31. // STACK RESULT: push the unsigned literal constant value onto the top // of the stack. - //---------------------------------------------------------------------- case DW_OP_lit0: case DW_OP_lit1: case DW_OP_lit2: @@ -2387,11 +2308,9 @@ bool DWARFExpression::Evaluate( stack.push_back(Scalar((uint64_t)(op - DW_OP_lit0))); break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_regN // OPERANDS: none // DESCRIPTION: Push the value in register n on the top of the stack. - //---------------------------------------------------------------------- case DW_OP_reg0: case DW_OP_reg1: case DW_OP_reg2: @@ -2431,12 +2350,10 @@ bool DWARFExpression::Evaluate( else return false; } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_regx // OPERANDS: // ULEB128 literal operand that encodes the register. // DESCRIPTION: Push the value in register on the top of the stack. - //---------------------------------------------------------------------- case DW_OP_regx: { reg_num = opcodes.GetULEB128(&offset); if (ReadRegisterValueAsScalar(reg_ctx, reg_kind, reg_num, error_ptr, tmp)) @@ -2445,13 +2362,11 @@ bool DWARFExpression::Evaluate( return false; } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_bregN // OPERANDS: // SLEB128 offset from register N // DESCRIPTION: Value is in memory at the address specified by register // N plus an offset. - //---------------------------------------------------------------------- case DW_OP_breg0: case DW_OP_breg1: case DW_OP_breg2: @@ -2496,14 +2411,12 @@ bool DWARFExpression::Evaluate( } else return false; } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_bregx // OPERANDS: 2 // ULEB128 literal operand that encodes the register. // SLEB128 offset from register N // DESCRIPTION: Value is in memory at the address specified by register // N plus an offset. - //---------------------------------------------------------------------- case DW_OP_bregx: { reg_num = opcodes.GetULEB128(&offset); @@ -2544,16 +2457,13 @@ bool DWARFExpression::Evaluate( break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_nop // OPERANDS: none // DESCRIPTION: A place holder. It has no effect on the location stack // or any of its values. - //---------------------------------------------------------------------- case DW_OP_nop: break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_piece // OPERANDS: 1 // ULEB128: byte size of the piece @@ -2567,7 +2477,6 @@ bool DWARFExpression::Evaluate( // variable partially in memory and partially in registers. DW_OP_piece // provides a way of describing how large a part of a variable a particular // DWARF expression refers to. - //---------------------------------------------------------------------- case DW_OP_piece: { const uint64_t piece_byte_size = opcodes.GetULEB128(&offset); @@ -2744,7 +2653,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_push_object_address // OPERANDS: none // DESCRIPTION: Pushes the address of the object currently being @@ -2753,7 +2661,6 @@ bool DWARFExpression::Evaluate( // DIE or it may be a component of an array, structure, or class whose // address has been dynamically determined by an earlier step during user // expression evaluation. - //---------------------------------------------------------------------- case DW_OP_push_object_address: if (object_address_ptr) stack.push_back(*object_address_ptr); @@ -2765,7 +2672,6 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_call2 // OPERANDS: // uint16_t compile unit relative offset of a DIE @@ -2784,12 +2690,10 @@ bool DWARFExpression::Evaluate( // may be used as parameters by the called expression and values left on // the stack by the called expression may be used as return values by prior // agreement between the calling and called expressions. - //---------------------------------------------------------------------- case DW_OP_call2: if (error_ptr) error_ptr->SetErrorString("Unimplemented opcode DW_OP_call2."); return false; - //---------------------------------------------------------------------- // OPCODE: DW_OP_call4 // OPERANDS: 1 // uint32_t compile unit relative offset of a DIE @@ -2809,30 +2713,25 @@ bool DWARFExpression::Evaluate( // may be used as parameters by the called expression and values left on // the stack by the called expression may be used as return values by prior // agreement between the calling and called expressions. - //---------------------------------------------------------------------- case DW_OP_call4: if (error_ptr) error_ptr->SetErrorString("Unimplemented opcode DW_OP_call4."); return false; - //---------------------------------------------------------------------- // OPCODE: DW_OP_stack_value // OPERANDS: None // DESCRIPTION: Specifies that the object does not exist in memory but // rather is a constant value. The value from the top of the stack is the // value to be used. This is the actual object value and not the location. - //---------------------------------------------------------------------- case DW_OP_stack_value: stack.back().SetValueType(Value::eValueTypeScalar); break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_call_frame_cfa // OPERANDS: None // DESCRIPTION: Specifies a DWARF expression that pushes the value of // the canonical frame address consistent with the call frame information // located in .debug_frame (or in the FDEs of the eh_frame section). - //---------------------------------------------------------------------- case DW_OP_call_frame_cfa: if (frame) { // Note that we don't have to parse FDEs because this DWARF expression @@ -2854,14 +2753,12 @@ bool DWARFExpression::Evaluate( } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_form_tls_address (or the old pre-DWARFv3 vendor extension // opcode, DW_OP_GNU_push_tls_address) // OPERANDS: none // DESCRIPTION: Pops a TLS offset from the stack, converts it to // an address in the current thread's thread-local storage block, and // pushes it on the stack. - //---------------------------------------------------------------------- case DW_OP_form_tls_address: case DW_OP_GNU_push_tls_address: { if (stack.size() < 1) { @@ -2906,14 +2803,12 @@ bool DWARFExpression::Evaluate( stack.back().SetValueType(Value::eValueTypeLoadAddress); } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_addrx (DW_OP_GNU_addr_index is the legacy name.) // OPERANDS: 1 // ULEB128: index to the .debug_addr section // DESCRIPTION: Pushes an address to the stack from the .debug_addr // section with the base address specified by the DW_AT_addr_base attribute // and the 0 based index is the ULEB128 encoded index. - //---------------------------------------------------------------------- case DW_OP_addrx: case DW_OP_GNU_addr_index: { if (!dwarf_cu) { @@ -2933,7 +2828,6 @@ bool DWARFExpression::Evaluate( stack.back().SetValueType(Value::eValueTypeFileAddress); } break; - //---------------------------------------------------------------------- // OPCODE: DW_OP_GNU_const_index // OPERANDS: 1 // ULEB128: index to the .debug_addr section @@ -2941,7 +2835,6 @@ bool DWARFExpression::Evaluate( // the stack from the .debug_addr section with the base address specified // by the DW_AT_addr_base attribute and the 0 based index is the ULEB128 // encoded index. - //---------------------------------------------------------------------- case DW_OP_GNU_const_index: { if (!dwarf_cu) { if (error_ptr) diff --git a/lldb/source/Expression/FunctionCaller.cpp b/lldb/source/Expression/FunctionCaller.cpp index fa156dc..5f5e3b8 100644 --- a/lldb/source/Expression/FunctionCaller.cpp +++ b/lldb/source/Expression/FunctionCaller.cpp @@ -29,9 +29,7 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // FunctionCaller constructor -//---------------------------------------------------------------------- FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &functionAddress, @@ -51,9 +49,7 @@ FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope, assert(m_jit_process_wp.lock()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- FunctionCaller::~FunctionCaller() { lldb::ProcessSP process_sp(m_jit_process_wp.lock()); if (process_sp) { diff --git a/lldb/source/Expression/IRDynamicChecks.cpp b/lldb/source/Expression/IRDynamicChecks.cpp index 354df5a..0f10ff4 100644 --- a/lldb/source/Expression/IRDynamicChecks.cpp +++ b/lldb/source/Expression/IRDynamicChecks.cpp @@ -102,7 +102,6 @@ static std::string PrintValue(llvm::Value *V, bool truncate = false) { return s; } -//---------------------------------------------------------------------- /// \class Instrumenter IRDynamicChecks.cpp /// Finds and instruments individual LLVM IR instructions /// @@ -129,22 +128,18 @@ static std::string PrintValue(llvm::Value *V, bool truncate = false) { /// /// - InspectFunction [default: iterates through the basic blocks in a /// function calling InspectBasicBlock] -//---------------------------------------------------------------------- class Instrumenter { public: - //------------------------------------------------------------------ /// Constructor /// /// \param[in] module /// The module being instrumented. - //------------------------------------------------------------------ Instrumenter(llvm::Module &module, DynamicCheckerFunctions &checker_functions) : m_module(module), m_checker_functions(checker_functions), m_i8ptr_ty(nullptr), m_intptr_ty(nullptr) {} virtual ~Instrumenter() = default; - //------------------------------------------------------------------ /// Inspect a function to find instructions to instrument /// /// \param[in] function @@ -152,15 +147,12 @@ public: /// /// \return /// True on success; false on error. - //------------------------------------------------------------------ bool Inspect(llvm::Function &function) { return InspectFunction(function); } - //------------------------------------------------------------------ /// Instrument all the instructions found by Inspect() /// /// \return /// True on success; false on error. - //------------------------------------------------------------------ bool Instrument() { for (InstIterator ii = m_to_instrument.begin(), last_ii = m_to_instrument.end(); @@ -173,7 +165,6 @@ public: } protected: - //------------------------------------------------------------------ /// Add instrumentation to a single instruction /// /// \param[in] inst @@ -181,20 +172,16 @@ protected: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ virtual bool InstrumentInstruction(llvm::Instruction *inst) = 0; - //------------------------------------------------------------------ /// Register a single instruction to be instrumented /// /// \param[in] inst /// The instruction to be instrumented. - //------------------------------------------------------------------ void RegisterInstruction(llvm::Instruction &i) { m_to_instrument.push_back(&i); } - //------------------------------------------------------------------ /// Determine whether a single instruction is interesting to instrument, /// and, if so, call RegisterInstruction /// @@ -203,10 +190,8 @@ protected: /// /// \return /// False if there was an error scanning; true otherwise. - //------------------------------------------------------------------ virtual bool InspectInstruction(llvm::Instruction &i) { return true; } - //------------------------------------------------------------------ /// Scan a basic block to see if any instructions are interesting /// /// \param[in] bb @@ -214,7 +199,6 @@ protected: /// /// \return /// False if there was an error scanning; true otherwise. - //------------------------------------------------------------------ virtual bool InspectBasicBlock(llvm::BasicBlock &bb) { for (llvm::BasicBlock::iterator ii = bb.begin(), last_ii = bb.end(); ii != last_ii; ++ii) { @@ -225,7 +209,6 @@ protected: return true; } - //------------------------------------------------------------------ /// Scan a function to see if any instructions are interesting /// /// \param[in] f @@ -233,7 +216,6 @@ protected: /// /// \return /// False if there was an error scanning; true otherwise. - //------------------------------------------------------------------ virtual bool InspectFunction(llvm::Function &f) { for (llvm::Function::iterator bbi = f.begin(), last_bbi = f.end(); bbi != last_bbi; ++bbi) { @@ -244,7 +226,6 @@ protected: return true; } - //------------------------------------------------------------------ /// Build a function pointer for a function with signature void /// (*)(uint8_t*) with a given address /// @@ -253,7 +234,6 @@ protected: /// /// \return /// The function pointer, for use in a CallInst. - //------------------------------------------------------------------ llvm::FunctionCallee BuildPointerValidatorFunc(lldb::addr_t start_address) { llvm::Type *param_array[1]; @@ -269,7 +249,6 @@ protected: return {fun_ty, ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty)}; } - //------------------------------------------------------------------ /// Build a function pointer for a function with signature void /// (*)(uint8_t*, uint8_t*) with a given address /// @@ -278,7 +257,6 @@ protected: /// /// \return /// The function pointer, for use in a CallInst. - //------------------------------------------------------------------ llvm::FunctionCallee BuildObjectCheckerFunc(lldb::addr_t start_address) { llvm::Type *param_array[2]; diff --git a/lldb/source/Expression/UtilityFunction.cpp b/lldb/source/Expression/UtilityFunction.cpp index 7c83930..eeaeca1 100644 --- a/lldb/source/Expression/UtilityFunction.cpp +++ b/lldb/source/Expression/UtilityFunction.cpp @@ -29,7 +29,6 @@ using namespace lldb_private; using namespace lldb; -//------------------------------------------------------------------ /// Constructor /// /// \param[in] text @@ -37,7 +36,6 @@ using namespace lldb; /// /// \param[in] name /// The name of the function, as used in the text. -//------------------------------------------------------------------ UtilityFunction::UtilityFunction(ExecutionContextScope &exe_scope, const char *text, const char *name, ExpressionKind kind) diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 54e690d..c9cc5c0 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -260,9 +260,7 @@ protected: } } -//------------------------------------------------------------------ // Editline private methods -//------------------------------------------------------------------ void Editline::SetBaseLineNumber(int line_number) { std::stringstream line_number_stream; @@ -856,10 +854,8 @@ unsigned char Editline::BufferEndCommand(int ch) { return CC_NEWLINE; } -//------------------------------------------------------------------------------ /// Prints completions and their descriptions to the given file. Only the /// completions in the interval [start, end) are printed. -//------------------------------------------------------------------------------ static void PrintCompletion(FILE *output_file, size_t start, size_t end, StringList &completions, StringList &descriptions) { // This is an 'int' because of printf. @@ -1144,9 +1140,7 @@ void Editline::ConfigureEditor(bool multiline) { } } -//------------------------------------------------------------------ // Editline public methods -//------------------------------------------------------------------ Editline *Editline::InstanceFor(EditLine *editline) { Editline *editor; diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp index bf46213..85e625c 100644 --- a/lldb/source/Host/common/File.cpp +++ b/lldb/source/Host/common/File.cpp @@ -621,9 +621,7 @@ Status File::Write(const void *buf, size_t &num_bytes, off_t &offset) { return error; } -//------------------------------------------------------------------ // Print some formatted output to the stream. -//------------------------------------------------------------------ size_t File::Printf(const char *format, ...) { va_list args; va_start(args, format); @@ -632,9 +630,7 @@ size_t File::Printf(const char *format, ...) { return result; } -//------------------------------------------------------------------ // Print some formatted output to the stream. -//------------------------------------------------------------------ size_t File::PrintfVarArg(const char *format, va_list args) { size_t result = 0; if (DescriptorIsValid()) { diff --git a/lldb/source/Host/common/FileAction.cpp b/lldb/source/Host/common/FileAction.cpp index 9736704..3268d95 100644 --- a/lldb/source/Host/common/FileAction.cpp +++ b/lldb/source/Host/common/FileAction.cpp @@ -14,9 +14,7 @@ using namespace lldb_private; -//---------------------------------------------------------------------------- // FileAction member functions -//---------------------------------------------------------------------------- FileAction::FileAction() : m_action(eFileActionNone), m_fd(-1), m_arg(-1), m_file_spec() {} diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 2906fe8..1cb1c90 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -116,10 +116,8 @@ HostThread Host::StartMonitoringChildProcess( } #ifndef __linux__ -//------------------------------------------------------------------ // Scoped class that will disable thread canceling when it is constructed, and // exception safely restore the previous value it when it goes out of scope. -//------------------------------------------------------------------ class ScopedPThreadCancelDisabler { public: ScopedPThreadCancelDisabler() { diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp index 388f767..130f0eb 100644 --- a/lldb/source/Host/common/HostInfoBase.cpp +++ b/lldb/source/Host/common/HostInfoBase.cpp @@ -31,13 +31,11 @@ using namespace lldb; using namespace lldb_private; namespace { -//---------------------------------------------------------------------- // The HostInfoBaseFields is a work around for windows not supporting static // variables correctly in a thread safe way. Really each of the variables in // HostInfoBaseFields should live in the functions in which they are used and // each one should be static, but the work around is in place to avoid this // restriction. Ick. -//---------------------------------------------------------------------- struct HostInfoBaseFields { ~HostInfoBaseFields() { diff --git a/lldb/source/Host/common/NativeProcessProtocol.cpp b/lldb/source/Host/common/NativeProcessProtocol.cpp index ac460d5..90272cb 100644 --- a/lldb/source/Host/common/NativeProcessProtocol.cpp +++ b/lldb/source/Host/common/NativeProcessProtocol.cpp @@ -19,9 +19,7 @@ using namespace lldb; using namespace lldb_private; -// ----------------------------------------------------------------------------- // NativeProcessProtocol Members -// ----------------------------------------------------------------------------- NativeProcessProtocol::NativeProcessProtocol(lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate) diff --git a/lldb/source/Host/common/NativeRegisterContext.cpp b/lldb/source/Host/common/NativeRegisterContext.cpp index 5b5d717..2f30d52 100644 --- a/lldb/source/Host/common/NativeRegisterContext.cpp +++ b/lldb/source/Host/common/NativeRegisterContext.cpp @@ -21,9 +21,7 @@ using namespace lldb_private; NativeRegisterContext::NativeRegisterContext(NativeThreadProtocol &thread) : m_thread(thread) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- NativeRegisterContext::~NativeRegisterContext() {} // FIXME revisit invalidation, process stop ids, etc. Right now we don't diff --git a/lldb/source/Host/common/ProcessLaunchInfo.cpp b/lldb/source/Host/common/ProcessLaunchInfo.cpp index 443f00e..ac8a41b 100644 --- a/lldb/source/Host/common/ProcessLaunchInfo.cpp +++ b/lldb/source/Host/common/ProcessLaunchInfo.cpp @@ -26,9 +26,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------------- // ProcessLaunchInfo member functions -//---------------------------------------------------------------------------- ProcessLaunchInfo::ProcessLaunchInfo() : ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(0), diff --git a/lldb/source/Host/common/PseudoTerminal.cpp b/lldb/source/Host/common/PseudoTerminal.cpp index c95c1aa..85e54f4 100644 --- a/lldb/source/Host/common/PseudoTerminal.cpp +++ b/lldb/source/Host/common/PseudoTerminal.cpp @@ -26,36 +26,28 @@ int posix_openpt(int flags); using namespace lldb_private; -//---------------------------------------------------------------------- // Write string describing error number -//---------------------------------------------------------------------- static void ErrnoToStr(char *error_str, size_t error_len) { std::string strerror = llvm::sys::StrError(); ::snprintf(error_str, error_len, "%s", strerror.c_str()); } -//---------------------------------------------------------------------- // PseudoTerminal constructor -//---------------------------------------------------------------------- PseudoTerminal::PseudoTerminal() : m_master_fd(invalid_fd), m_slave_fd(invalid_fd) {} -//---------------------------------------------------------------------- // Destructor // // The destructor will close the master and slave file descriptors if they are // valid and ownership has not been released using the // ReleaseMasterFileDescriptor() or the ReleaseSaveFileDescriptor() member // functions. -//---------------------------------------------------------------------- PseudoTerminal::~PseudoTerminal() { CloseMasterFileDescriptor(); CloseSlaveFileDescriptor(); } -//---------------------------------------------------------------------- // Close the master file descriptor if it is valid. -//---------------------------------------------------------------------- void PseudoTerminal::CloseMasterFileDescriptor() { if (m_master_fd >= 0) { ::close(m_master_fd); @@ -63,9 +55,7 @@ void PseudoTerminal::CloseMasterFileDescriptor() { } } -//---------------------------------------------------------------------- // Close the slave file descriptor if it is valid. -//---------------------------------------------------------------------- void PseudoTerminal::CloseSlaveFileDescriptor() { if (m_slave_fd >= 0) { ::close(m_slave_fd); @@ -73,7 +63,6 @@ void PseudoTerminal::CloseSlaveFileDescriptor() { } } -//---------------------------------------------------------------------- // Open the first available pseudo terminal with OFLAG as the permissions. The // file descriptor is stored in this object and can be accessed with the // MasterFileDescriptor() accessor. The ownership of the master file descriptor @@ -85,7 +74,6 @@ void PseudoTerminal::CloseSlaveFileDescriptor() { // // RETURNS: // True when successful, false indicating an error occurred. -//---------------------------------------------------------------------- bool PseudoTerminal::OpenFirstAvailableMaster(int oflag, char *error_str, size_t error_len) { if (error_str) @@ -124,7 +112,6 @@ bool PseudoTerminal::OpenFirstAvailableMaster(int oflag, char *error_str, #endif } -//---------------------------------------------------------------------- // Open the slave pseudo terminal for the current master pseudo terminal. A // master pseudo terminal should already be valid prior to calling this // function (see OpenFirstAvailableMaster()). The file descriptor is stored @@ -134,7 +121,6 @@ bool PseudoTerminal::OpenFirstAvailableMaster(int oflag, char *error_str, // // RETURNS: // True when successful, false indicating an error occurred. -//---------------------------------------------------------------------- bool PseudoTerminal::OpenSlave(int oflag, char *error_str, size_t error_len) { if (error_str) error_str[0] = '\0'; @@ -158,7 +144,6 @@ bool PseudoTerminal::OpenSlave(int oflag, char *error_str, size_t error_len) { return true; } -//---------------------------------------------------------------------- // Get the name of the slave pseudo terminal. A master pseudo terminal should // already be valid prior to calling this function (see // OpenFirstAvailableMaster()). @@ -168,7 +153,6 @@ bool PseudoTerminal::OpenSlave(int oflag, char *error_str, size_t error_len) { // The name of the slave pseudo terminal as a NULL terminated C string // that comes from static memory, so a copy of the string should be // made as subsequent calls can change this value. -//---------------------------------------------------------------------- const char *PseudoTerminal::GetSlaveName(char *error_str, size_t error_len) const { if (error_str) @@ -188,7 +172,6 @@ const char *PseudoTerminal::GetSlaveName(char *error_str, return slave_name; } -//---------------------------------------------------------------------- // Fork a child process and have its stdio routed to a pseudo terminal. // // In the parent process when a valid pid is returned, the master file @@ -206,7 +189,6 @@ const char *PseudoTerminal::GetSlaveName(char *error_str, // RETURNS: // in the parent process: the pid of the child, or -1 if fork fails // in the child process: zero -//---------------------------------------------------------------------- lldb::pid_t PseudoTerminal::Fork(char *error_str, size_t error_len) { if (error_str) error_str[0] = '\0'; @@ -265,7 +247,6 @@ lldb::pid_t PseudoTerminal::Fork(char *error_str, size_t error_len) { return pid; } -//---------------------------------------------------------------------- // The master file descriptor accessor. This object retains ownership of the // master file descriptor when this accessor is used. Use // ReleaseMasterFileDescriptor() if you wish this object to release ownership @@ -273,23 +254,18 @@ lldb::pid_t PseudoTerminal::Fork(char *error_str, size_t error_len) { // // Returns the master file descriptor, or -1 if the master file descriptor is // not currently valid. -//---------------------------------------------------------------------- int PseudoTerminal::GetMasterFileDescriptor() const { return m_master_fd; } -//---------------------------------------------------------------------- // The slave file descriptor accessor. // // Returns the slave file descriptor, or -1 if the slave file descriptor is not // currently valid. -//---------------------------------------------------------------------- int PseudoTerminal::GetSlaveFileDescriptor() const { return m_slave_fd; } -//---------------------------------------------------------------------- // Release ownership of the master pseudo terminal file descriptor without // closing it. The destructor for this class will close the master file // descriptor if the ownership isn't released using this call and the master // file descriptor has been opened. -//---------------------------------------------------------------------- int PseudoTerminal::ReleaseMasterFileDescriptor() { // Release ownership of the master pseudo terminal file descriptor without // closing it. (the destructor for this class will close it otherwise!) @@ -298,12 +274,10 @@ int PseudoTerminal::ReleaseMasterFileDescriptor() { return fd; } -//---------------------------------------------------------------------- // Release ownership of the slave pseudo terminal file descriptor without // closing it. The destructor for this class will close the slave file // descriptor if the ownership isn't released using this call and the slave // file descriptor has been opened. -//---------------------------------------------------------------------- int PseudoTerminal::ReleaseSlaveFileDescriptor() { // Release ownership of the slave pseudo terminal file descriptor without // closing it (the destructor for this class will close it otherwise!) diff --git a/lldb/source/Host/common/SocketAddress.cpp b/lldb/source/Host/common/SocketAddress.cpp index 0868c34..46c0639 100644 --- a/lldb/source/Host/common/SocketAddress.cpp +++ b/lldb/source/Host/common/SocketAddress.cpp @@ -71,9 +71,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size) { using namespace lldb_private; -//---------------------------------------------------------------------- // SocketAddress constructor -//---------------------------------------------------------------------- SocketAddress::SocketAddress() { Clear(); } SocketAddress::SocketAddress(const struct sockaddr &s) { m_socket_addr.sa = s; } @@ -94,15 +92,11 @@ SocketAddress::SocketAddress(const struct addrinfo *addr_info) { *this = addr_info; } -//---------------------------------------------------------------------- // SocketAddress copy constructor -//---------------------------------------------------------------------- SocketAddress::SocketAddress(const SocketAddress &rhs) : m_socket_addr(rhs.m_socket_addr) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SocketAddress::~SocketAddress() {} void SocketAddress::Clear() { @@ -183,9 +177,7 @@ bool SocketAddress::SetPort(uint16_t port) { return false; } -//---------------------------------------------------------------------- // SocketAddress assignment operator -//---------------------------------------------------------------------- const SocketAddress &SocketAddress::operator=(const SocketAddress &rhs) { if (this != &rhs) m_socket_addr = rhs.m_socket_addr; diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp index aa3d0e6..9c60f0d 100644 --- a/lldb/source/Host/common/Terminal.cpp +++ b/lldb/source/Host/common/Terminal.cpp @@ -81,9 +81,7 @@ bool Terminal::SetCanonical(bool enabled) { return false; } -//---------------------------------------------------------------------- // Default constructor -//---------------------------------------------------------------------- TerminalState::TerminalState() : m_tty(), m_tflags(-1), #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED @@ -92,9 +90,7 @@ TerminalState::TerminalState() m_process_group(-1) { } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- TerminalState::~TerminalState() {} void TerminalState::Clear() { @@ -106,11 +102,9 @@ void TerminalState::Clear() { m_process_group = -1; } -//---------------------------------------------------------------------- // Save the current state of the TTY for the file descriptor "fd" and if // "save_process_group" is true, attempt to save the process group info for the // TTY. -//---------------------------------------------------------------------- bool TerminalState::Save(int fd, bool save_process_group) { m_tty.SetFileDescriptor(fd); if (m_tty.IsATerminal()) { @@ -141,10 +135,8 @@ bool TerminalState::Save(int fd, bool save_process_group) { return IsValid(); } -//---------------------------------------------------------------------- // Restore the state of the TTY using the cached values from a previous call to // Save(). -//---------------------------------------------------------------------- bool TerminalState::Restore() const { #ifndef LLDB_DISABLE_POSIX if (IsValid()) { @@ -172,23 +164,17 @@ bool TerminalState::Restore() const { return false; } -//---------------------------------------------------------------------- // Returns true if this object has valid saved TTY state settings that can be // used to restore a previous state. -//---------------------------------------------------------------------- bool TerminalState::IsValid() const { return m_tty.FileDescriptorIsValid() && (TFlagsIsValid() || TTYStateIsValid()); } -//---------------------------------------------------------------------- // Returns true if m_tflags is valid -//---------------------------------------------------------------------- bool TerminalState::TFlagsIsValid() const { return m_tflags != -1; } -//---------------------------------------------------------------------- // Returns true if m_ttystate is valid -//---------------------------------------------------------------------- bool TerminalState::TTYStateIsValid() const { #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED return m_termios_up != 0; @@ -197,35 +183,25 @@ bool TerminalState::TTYStateIsValid() const { #endif } -//---------------------------------------------------------------------- // Returns true if m_process_group is valid -//---------------------------------------------------------------------- bool TerminalState::ProcessGroupIsValid() const { return static_cast<int32_t>(m_process_group) != -1; } -//------------------------------------------------------------------ // Constructor -//------------------------------------------------------------------ TerminalStateSwitcher::TerminalStateSwitcher() : m_currentState(UINT32_MAX) {} -//------------------------------------------------------------------ // Destructor -//------------------------------------------------------------------ TerminalStateSwitcher::~TerminalStateSwitcher() {} -//------------------------------------------------------------------ // Returns the number of states that this switcher contains -//------------------------------------------------------------------ uint32_t TerminalStateSwitcher::GetNumberOfStates() const { return llvm::array_lengthof(m_ttystates); } -//------------------------------------------------------------------ // Restore the state at index "idx". // // Returns true if the restore was successful, false otherwise. -//------------------------------------------------------------------ bool TerminalStateSwitcher::Restore(uint32_t idx) const { const uint32_t num_states = GetNumberOfStates(); if (idx >= num_states) @@ -247,12 +223,10 @@ bool TerminalStateSwitcher::Restore(uint32_t idx) const { return false; } -//------------------------------------------------------------------ // Save the state at index "idx" for file descriptor "fd" and save the process // group if requested. // // Returns true if the restore was successful, false otherwise. -//------------------------------------------------------------------ bool TerminalStateSwitcher::Save(uint32_t idx, int fd, bool save_process_group) { const uint32_t num_states = GetNumberOfStates(); diff --git a/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp b/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp index 06057b5..0ca2c00 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCBundle.cpp @@ -9,9 +9,7 @@ #include "CFCBundle.h" #include "CFCString.h" -//---------------------------------------------------------------------- // CFCBundle constructor -//---------------------------------------------------------------------- CFCBundle::CFCBundle(const char *path) : CFCReleaser<CFBundleRef>() { if (path && path[0]) SetPath(path); @@ -20,14 +18,10 @@ CFCBundle::CFCBundle(const char *path) : CFCReleaser<CFBundleRef>() { CFCBundle::CFCBundle(CFURLRef url) : CFCReleaser<CFBundleRef>(url ? CFBundleCreate(NULL, url) : NULL) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCBundle::~CFCBundle() {} -//---------------------------------------------------------------------- // Set the path for a bundle by supplying a -//---------------------------------------------------------------------- bool CFCBundle::SetPath(const char *path) { CFAllocatorRef alloc = kCFAllocatorDefault; // Release our old bundle and URL diff --git a/lldb/source/Host/macosx/cfcpp/CFCBundle.h b/lldb/source/Host/macosx/cfcpp/CFCBundle.h index 1251604..9ff58fb 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCBundle.h +++ b/lldb/source/Host/macosx/cfcpp/CFCBundle.h @@ -13,9 +13,7 @@ class CFCBundle : public CFCReleaser<CFBundleRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCBundle(const char *path = NULL); CFCBundle(CFURLRef url); diff --git a/lldb/source/Host/macosx/cfcpp/CFCData.cpp b/lldb/source/Host/macosx/cfcpp/CFCData.cpp index c3deeca..191f473 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCData.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCData.cpp @@ -8,19 +8,13 @@ #include "CFCData.h" -//---------------------------------------------------------------------- // CFCData constructor -//---------------------------------------------------------------------- CFCData::CFCData(CFDataRef data) : CFCReleaser<CFDataRef>(data) {} -//---------------------------------------------------------------------- // CFCData copy constructor -//---------------------------------------------------------------------- CFCData::CFCData(const CFCData &rhs) : CFCReleaser<CFDataRef>(rhs) {} -//---------------------------------------------------------------------- // CFCData copy constructor -//---------------------------------------------------------------------- CFCData &CFCData::operator=(const CFCData &rhs) { @@ -29,9 +23,7 @@ CFCData &CFCData::operator=(const CFCData &rhs) return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCData::~CFCData() {} CFIndex CFCData::GetLength() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCData.h b/lldb/source/Host/macosx/cfcpp/CFCData.h index b0b2523..33fcf53 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCData.h +++ b/lldb/source/Host/macosx/cfcpp/CFCData.h @@ -13,9 +13,7 @@ class CFCData : public CFCReleaser<CFDataRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCData(CFDataRef data = NULL); CFCData(const CFCData &rhs); CFCData &operator=(const CFCData &rhs); @@ -26,9 +24,7 @@ public: CFIndex GetLength() const; protected: - //------------------------------------------------------------------ // Classes that inherit from CFCData can see and modify these - //------------------------------------------------------------------ }; #endif // #ifndef CoreFoundationCPP_CFData_h_ diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp index 75bc12d..a2172c2 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp @@ -9,24 +9,18 @@ #include "CFCMutableArray.h" #include "CFCString.h" -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCMutableArray::CFCMutableArray(CFMutableArrayRef s) : CFCReleaser<CFMutableArrayRef>(s) {} -//---------------------------------------------------------------------- // CFCMutableArray copy constructor -//---------------------------------------------------------------------- CFCMutableArray::CFCMutableArray(const CFCMutableArray &rhs) : CFCReleaser<CFMutableArrayRef>(rhs) // NOTE: this won't make a copy of the // array, just add a new reference to // it {} -//---------------------------------------------------------------------- // CFCMutableArray copy constructor -//---------------------------------------------------------------------- CFCMutableArray &CFCMutableArray::operator=(const CFCMutableArray &rhs) { if (this != &rhs) *this = rhs; // NOTE: this operator won't make a copy of the array, just add @@ -34,9 +28,7 @@ CFCMutableArray &CFCMutableArray::operator=(const CFCMutableArray &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCMutableArray::~CFCMutableArray() {} CFIndex CFCMutableArray::GetCount() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h index ba12301..46c5b91 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableArray.h @@ -13,9 +13,7 @@ class CFCMutableArray : public CFCReleaser<CFMutableArrayRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCMutableArray(CFMutableArrayRef array = NULL); CFCMutableArray(const CFCMutableArray &rhs); // This will copy the array // contents into a new array diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp index 9309416..66d572d 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp @@ -8,21 +8,15 @@ #include "CFCMutableDictionary.h" #include "CFCString.h" -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCMutableDictionary::CFCMutableDictionary(CFMutableDictionaryRef s) : CFCReleaser<CFMutableDictionaryRef>(s) {} -//---------------------------------------------------------------------- // CFCMutableDictionary copy constructor -//---------------------------------------------------------------------- CFCMutableDictionary::CFCMutableDictionary(const CFCMutableDictionary &rhs) : CFCReleaser<CFMutableDictionaryRef>(rhs) {} -//---------------------------------------------------------------------- // CFCMutableDictionary copy constructor -//---------------------------------------------------------------------- const CFCMutableDictionary &CFCMutableDictionary:: operator=(const CFCMutableDictionary &rhs) { if (this != &rhs) @@ -30,9 +24,7 @@ operator=(const CFCMutableDictionary &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCMutableDictionary::~CFCMutableDictionary() {} CFIndex CFCMutableDictionary::GetCount() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h index 99849f4..e9b494a 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableDictionary.h @@ -13,16 +13,12 @@ class CFCMutableDictionary : public CFCReleaser<CFMutableDictionaryRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCMutableDictionary(CFMutableDictionaryRef s = NULL); CFCMutableDictionary(const CFCMutableDictionary &rhs); virtual ~CFCMutableDictionary(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const CFCMutableDictionary &operator=(const CFCMutableDictionary &rhs); CFIndex GetCount() const; @@ -61,14 +57,10 @@ public: CFMutableDictionaryRef Dictionary(bool can_create); protected: - //------------------------------------------------------------------ // Classes that inherit from CFCMutableDictionary can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For CFCMutableDictionary only - //------------------------------------------------------------------ }; #endif // CoreFoundationCPP_CFMutableDictionary_h_ diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp index bcfa7ce..a6517fa 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.cpp @@ -9,30 +9,22 @@ #include "CFCMutableSet.h" -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCMutableSet::CFCMutableSet(CFMutableSetRef s) : CFCReleaser<CFMutableSetRef>(s) {} -//---------------------------------------------------------------------- // CFCMutableSet copy constructor -//---------------------------------------------------------------------- CFCMutableSet::CFCMutableSet(const CFCMutableSet &rhs) : CFCReleaser<CFMutableSetRef>(rhs) {} -//---------------------------------------------------------------------- // CFCMutableSet copy constructor -//---------------------------------------------------------------------- const CFCMutableSet &CFCMutableSet::operator=(const CFCMutableSet &rhs) { if (this != &rhs) *this = rhs; return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCMutableSet::~CFCMutableSet() {} CFIndex CFCMutableSet::GetCount() const { diff --git a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h index 5aabaff..a55d646 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h +++ b/lldb/source/Host/macosx/cfcpp/CFCMutableSet.h @@ -13,16 +13,12 @@ class CFCMutableSet : public CFCReleaser<CFMutableSetRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCMutableSet(CFMutableSetRef s = NULL); CFCMutableSet(const CFCMutableSet &rhs); virtual ~CFCMutableSet(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const CFCMutableSet &operator=(const CFCMutableSet &rhs); CFIndex GetCount() const; @@ -33,14 +29,10 @@ public: void RemoveAllValues(); protected: - //------------------------------------------------------------------ // Classes that inherit from CFCMutableSet can see and modify these - //------------------------------------------------------------------ private: - //------------------------------------------------------------------ // For CFCMutableSet only - //------------------------------------------------------------------ }; #endif // CoreFoundationCPP_CFMutableSet_h_ diff --git a/lldb/source/Host/macosx/cfcpp/CFCReleaser.h b/lldb/source/Host/macosx/cfcpp/CFCReleaser.h index 816dba8..8a29f39 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCReleaser.h +++ b/lldb/source/Host/macosx/cfcpp/CFCReleaser.h @@ -15,7 +15,6 @@ #include <assert.h> -//---------------------------------------------------------------------- // Templatized CF helper class that can own any CF pointer and will // call CFRelease() on any valid pointer it owns unless that pointer is // explicitly released using the release() member function. This class @@ -24,42 +23,33 @@ // CFCReleaser<T>::release() function won't actually CFRelease any owned // pointer, it is designed to relinquish ownership of the pointer just // like std:auto_ptr<T>::release() does. -//---------------------------------------------------------------------- template <class T> class CFCReleaser { public: - //---------------------------------------------------------- // Constructor that takes a pointer to a CF object that is // to be released when this object goes out of scope - //---------------------------------------------------------- CFCReleaser(T ptr = NULL) : _ptr(ptr) {} - //---------------------------------------------------------- // Copy constructor // // Note that copying a CFCReleaser will not transfer // ownership of the contained pointer, but it will bump its // reference count. This is where this class differs from // std::auto_ptr. - //---------------------------------------------------------- CFCReleaser(const CFCReleaser &rhs) : _ptr(rhs.get()) { if (get()) ::CFRetain(get()); } - //---------------------------------------------------------- // The destructor will release the pointer that it contains // if it has a valid pointer. - //---------------------------------------------------------- virtual ~CFCReleaser() { reset(); } - //---------------------------------------------------------- // Assignment operator. // // Note that assigning one CFCReleaser to another will // not transfer ownership of the contained pointer, but it // will bump its reference count. This is where this class // differs from std::auto_ptr. - //---------------------------------------------------------- CFCReleaser &operator=(const CFCReleaser<T> &rhs) { if (this != &rhs) { // Replace our owned pointer with the new one @@ -71,7 +61,6 @@ public: return *this; } - //---------------------------------------------------------- // Get the address of the contained type in case it needs // to be passed to a function that will fill in a pointer // value. The function currently will assert if _ptr is not @@ -83,36 +72,29 @@ public: // sure any owned objects has CFRelease called on it. // I had to add the "enforce_null" bool here because some // API's require the pointer address even though they don't change it. - //---------------------------------------------------------- T *ptr_address(bool enforce_null = true) { if (enforce_null) assert(_ptr == NULL); return &_ptr; } - //---------------------------------------------------------- // Access the pointer itself - //---------------------------------------------------------- T get() { return _ptr; } const T get() const { return _ptr; } - //---------------------------------------------------------- // Set a new value for the pointer and CFRelease our old // value if we had a valid one. - //---------------------------------------------------------- void reset(T ptr = NULL) { if ((_ptr != NULL) && (ptr != _ptr)) ::CFRelease(_ptr); _ptr = ptr; } - //---------------------------------------------------------- // Release ownership without calling CFRelease. This class // is designed to mimic std::auto_ptr<T>, so the release // method releases ownership of the contained pointer // and does NOT call CFRelease. - //---------------------------------------------------------- T release() { T tmp = _ptr; _ptr = NULL; diff --git a/lldb/source/Host/macosx/cfcpp/CFCString.cpp b/lldb/source/Host/macosx/cfcpp/CFCString.cpp index a076875..fbd33fc 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCString.cpp +++ b/lldb/source/Host/macosx/cfcpp/CFCString.cpp @@ -10,19 +10,13 @@ #include <glob.h> #include <string> -//---------------------------------------------------------------------- // CFCString constructor -//---------------------------------------------------------------------- CFCString::CFCString(CFStringRef s) : CFCReleaser<CFStringRef>(s) {} -//---------------------------------------------------------------------- // CFCString copy constructor -//---------------------------------------------------------------------- CFCString::CFCString(const CFCString &rhs) : CFCReleaser<CFStringRef>(rhs) {} -//---------------------------------------------------------------------- // CFCString copy constructor -//---------------------------------------------------------------------- CFCString &CFCString::operator=(const CFCString &rhs) { if (this != &rhs) *this = rhs; @@ -37,9 +31,7 @@ CFCString::CFCString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFCString::~CFCString() {} const char *CFCString::GetFileSystemRepresentation(std::string &s) { diff --git a/lldb/source/Host/macosx/cfcpp/CFCString.h b/lldb/source/Host/macosx/cfcpp/CFCString.h index 2ed860f..300b1c4 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCString.h +++ b/lldb/source/Host/macosx/cfcpp/CFCString.h @@ -15,9 +15,7 @@ class CFCString : public CFCReleaser<CFStringRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFCString(CFStringRef cf_str = NULL); CFCString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); CFCString(const CFCString &rhs); diff --git a/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h b/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h index 5a2e399..0c2b82a 100644 --- a/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h +++ b/lldb/source/Host/macosx/cfcpp/CoreFoundationCPP.h @@ -5,7 +5,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -//---------------------------------------------------------------------- // // CoreFoundationCPP.h // CoreFoundationCPP @@ -13,7 +12,6 @@ // Created by Greg Clayton on 4/23/09. // // -//---------------------------------------------------------------------- #ifndef CoreFoundationCPP_CoreFoundationCPP_H_ #define CoreFoundationCPP_CoreFoundationCPP_H_ diff --git a/lldb/source/Initialization/SystemInitializerCommon.cpp b/lldb/source/Initialization/SystemInitializerCommon.cpp index e0d76c1..7ada756 100644 --- a/lldb/source/Initialization/SystemInitializerCommon.cpp +++ b/lldb/source/Initialization/SystemInitializerCommon.cpp @@ -108,9 +108,7 @@ llvm::Error SystemInitializerCommon::Initialize() { EmulateInstructionMIPS::Initialize(); EmulateInstructionMIPS64::Initialize(); - //---------------------------------------------------------------------- // Apple/Darwin hosted plugins - //---------------------------------------------------------------------- ObjectContainerUniversalMachO::Initialize(); #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 4533c5f..1016d72 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -35,9 +35,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObject -//------------------------------------------------------------------------- CommandObject::CommandObject(CommandInterpreter &interpreter, llvm::StringRef name, llvm::StringRef help, llvm::StringRef syntax, uint32_t flags) diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp index 63afd47..19335b9 100644 --- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp +++ b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp @@ -14,9 +14,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // CommandObjectRegexCommand constructor -//---------------------------------------------------------------------- CommandObjectRegexCommand::CommandObjectRegexCommand( CommandInterpreter &interpreter, llvm::StringRef name, llvm::StringRef help, llvm::StringRef syntax, uint32_t max_matches, uint32_t completion_type_mask, @@ -25,9 +23,7 @@ CommandObjectRegexCommand::CommandObjectRegexCommand( m_max_matches(max_matches), m_completion_type_mask(completion_type_mask), m_entries(), m_is_removable(is_removable) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CommandObjectRegexCommand::~CommandObjectRegexCommand() {} bool CommandObjectRegexCommand::DoExecute(llvm::StringRef command, diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Interpreter/CommandObjectScript.cpp index 539449c..758dddc 100644 --- a/lldb/source/Interpreter/CommandObjectScript.cpp +++ b/lldb/source/Interpreter/CommandObjectScript.cpp @@ -21,9 +21,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // CommandObjectScript -//------------------------------------------------------------------------- CommandObjectScript::CommandObjectScript(CommandInterpreter &interpreter, ScriptLanguage script_lang) diff --git a/lldb/source/Interpreter/CommandObjectScript.h b/lldb/source/Interpreter/CommandObjectScript.h index d899bd6..4f7a912 100644 --- a/lldb/source/Interpreter/CommandObjectScript.h +++ b/lldb/source/Interpreter/CommandObjectScript.h @@ -13,9 +13,7 @@ namespace lldb_private { -//------------------------------------------------------------------------- // CommandObjectScript -//------------------------------------------------------------------------- class CommandObjectScript : public CommandObjectRaw { public: diff --git a/lldb/source/Interpreter/OptionValue.cpp b/lldb/source/Interpreter/OptionValue.cpp index 2503d16..f45109f 100644 --- a/lldb/source/Interpreter/OptionValue.cpp +++ b/lldb/source/Interpreter/OptionValue.cpp @@ -14,10 +14,8 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // Get this value as a uint64_t value if it is encoded as a boolean, uint64_t // or int64_t. Other types will cause "fail_value" to be returned -//------------------------------------------------------------------------- uint64_t OptionValue::GetUInt64Value(uint64_t fail_value, bool *success_ptr) { if (success_ptr) *success_ptr = true; diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index a6c0b49..4ee9c4d 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -24,9 +24,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------------- // Options -//------------------------------------------------------------------------- Options::Options() : m_getopt_table() { BuildValidOptionSets(); } Options::~Options() {} diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp index de1f7d9..362a80b 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp @@ -1316,9 +1316,7 @@ ABIMacOSX_arm::GetRegisterInfoArray(uint32_t &count) { size_t ABIMacOSX_arm::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABIMacOSX_arm::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) { @@ -2045,9 +2043,7 @@ lldb_private::ConstString ABIMacOSX_arm::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABIMacOSX_arm::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h index 74eadae..ac9ba00 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h @@ -63,9 +63,7 @@ public: bool IsArmv7kProcess() const; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -75,9 +73,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp index 6f952ff..368e372 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -1657,9 +1657,7 @@ ABIMacOSX_arm64::GetRegisterInfoArray(uint32_t &count) { size_t ABIMacOSX_arm64::GetRedZoneSize() const { return 128; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) { @@ -2439,9 +2437,7 @@ void ABIMacOSX_arm64::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString ABIMacOSX_arm64::GetPluginNameStatic() { static ConstString g_plugin_name("ABIMacOSX_arm64"); diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h index 15b1b8d..bfacbcd 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -65,9 +65,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -75,9 +73,7 @@ public: static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static lldb_private::ConstString GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp index 48fca5d..67371b4 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp @@ -703,9 +703,7 @@ ABIMacOSX_i386::GetRegisterInfoArray(uint32_t &count) { size_t ABIMacOSX_i386::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABIMacOSX_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1123,9 +1121,7 @@ lldb_private::ConstString ABIMacOSX_i386::GetPluginNameStatic() { return g_short_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABIMacOSX_i386::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h index 20117c4..57def68 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h @@ -68,9 +68,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -78,9 +76,7 @@ public: static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static lldb_private::ConstString GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp index 11f2d54..c97c76c 100644 --- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp @@ -1317,9 +1317,7 @@ ABISysV_arm::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_arm::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_arm::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -2149,9 +2147,7 @@ lldb_private::ConstString ABISysV_arm::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_arm::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h index 586dc63..a0f00c8f 100644 --- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h +++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h @@ -63,9 +63,7 @@ public: bool IsArmHardFloat(lldb_private::Thread &thread) const; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -75,9 +73,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp index a3daaef..1d54712 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp @@ -1660,9 +1660,7 @@ bool ABISysV_arm64::GetPointerReturnRegister(const char *&name) { size_t ABISysV_arm64::GetRedZoneSize() const { return 128; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_arm64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -2412,9 +2410,7 @@ lldb_private::ConstString ABISysV_arm64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString ABISysV_arm64::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h index f12b727..1fbdc79 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h @@ -70,9 +70,7 @@ public: bool GetPointerReturnRegister(const char *&name) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -82,9 +80,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp index 402808a..9364756 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -1009,9 +1009,7 @@ ABISysV_hexagon::GetRegisterInfoArray(uint32_t &count) { */ size_t ABISysV_hexagon::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_hexagon::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1294,9 +1292,7 @@ lldb_private::ConstString ABISysV_hexagon::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_hexagon::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h index 46f913f..459b631 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h @@ -71,9 +71,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -83,9 +81,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp index d823c27..05f5dba 100644 --- a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp +++ b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp @@ -192,9 +192,7 @@ ABISysV_i386::GetRegisterInfoArray(uint32_t &count) { return g_register_infos; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -839,9 +837,7 @@ void ABISysV_i386::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_i386::GetPluginNameStatic() { static ConstString g_name("sysv-i386"); diff --git a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h index 9e8fea4..982bdd6 100644 --- a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h +++ b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h @@ -76,9 +76,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -86,9 +84,7 @@ public: static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static lldb_private::ConstString GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp index dee5d26..121c730 100644 --- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp +++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp @@ -549,9 +549,7 @@ ABISysV_mips::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_mips::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_mips::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1062,9 +1060,7 @@ lldb_private::ConstString ABISysV_mips::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_mips::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h index 5964a44..6cd9c19 100644 --- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h +++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h @@ -61,9 +61,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -73,9 +71,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp index e9be1c8..b7a9fe1 100644 --- a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp +++ b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp @@ -549,9 +549,7 @@ ABISysV_mips64::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_mips64::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1213,9 +1211,7 @@ lldb_private::ConstString ABISysV_mips64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_mips64::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h index faa0108..7da71b3 100644 --- a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h +++ b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h @@ -74,9 +74,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -86,9 +84,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp index 15762f8..faa9950 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp @@ -213,9 +213,7 @@ ABISysV_ppc::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_ppc::GetRedZoneSize() const { return 224; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_ppc::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -975,9 +973,7 @@ lldb_private::ConstString ABISysV_ppc::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_ppc::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h index ab649340..3b19985 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h +++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h @@ -70,9 +70,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -82,9 +80,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp index 50e280d..1648cd3 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp @@ -64,9 +64,7 @@ lldb::ByteOrder ABISysV_ppc64::GetByteOrder() const { return GetProcessSP()->GetByteOrder(); } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp, @@ -1086,9 +1084,7 @@ lldb_private::ConstString ABISysV_ppc64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_ppc64::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h index b832e360..d5fb09e 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h @@ -70,9 +70,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -82,9 +80,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp index 6159820..abe847b 100644 --- a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp +++ b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp @@ -195,9 +195,7 @@ ABISysV_s390x::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_s390x::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_s390x::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -742,9 +740,7 @@ lldb_private::ConstString ABISysV_s390x::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_s390x::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h index 026545b..13df477 100644 --- a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h +++ b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h @@ -62,9 +62,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -74,9 +72,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index e20aad7..69d4d40 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -1084,9 +1084,7 @@ bool ABISysV_x86_64::GetPointerReturnRegister(const char *&name) { size_t ABISysV_x86_64::GetRedZoneSize() const { return 128; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1897,9 +1895,7 @@ lldb_private::ConstString ABISysV_x86_64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_x86_64::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h index 6d21894..f6704af 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h @@ -72,9 +72,7 @@ public: bool GetPointerReturnRegister(const char *&name) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -84,9 +82,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h index be23f8f..dc663b8 100644 --- a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h +++ b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h @@ -24,10 +24,8 @@ public: void OverrideStopInfo(Thread &thread) const override {} - //------------------------------------------------------------------ /// This method compares current address with current function's /// local entry point, returning the bytes to skip if they match. - //------------------------------------------------------------------ size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const override; void AdjustBreakpointAddress(const Symbol &func, diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 49fd1d8..99ba9aa 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -1433,9 +1433,7 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr, return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString DisassemblerLLVMC::GetPluginName() { return GetPluginNameStatic(); } uint32_t DisassemblerLLVMC::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h index 9af873f..fd57750 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h @@ -26,9 +26,7 @@ public: ~DisassemblerLLVMC() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -43,9 +41,7 @@ public: lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 45f6d49..b377c23 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -119,11 +119,9 @@ static const DynamicLoaderDarwinKernelPropertiesSP &GetGlobalProperties() { return g_settings_sp; } -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process, bool force) { if (!force) { @@ -194,11 +192,9 @@ DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process *process) { return kernel_load_address; } -//---------------------------------------------------------------------- // Check if the kernel binary is loaded in memory without a slide. First verify // that the ExecutableModule is a kernel before we proceed. Returns the address // of the kernel if one was found, else LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) { Module *exe_module = process->GetTarget().GetExecutableModulePointer(); @@ -224,11 +220,9 @@ DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // If the debug flag is included in the boot-args nvram setting, the kernel's // load address will be noted in the lowglo page at a fixed address Returns the // address of the kernel if one was found, else LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) { if (GetGlobalProperties()->GetScanType() == eKASLRScanNone) @@ -275,13 +269,11 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // If the kernel is currently executing when lldb attaches, and we don't have a // better way of finding the kernel's load address, try searching backwards // from the current pc value looking for the kernel's Mach header in memory. // Returns the address of the kernel if one was found, else // LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) { if (GetGlobalProperties()->GetScanType() == eKASLRScanNone || @@ -336,12 +328,10 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // Scan through the valid address range for a kernel binary. This is uselessly // slow in 64-bit environments so we don't even try it. This scan is not // enabled by default even for 32-bit targets. Returns the address of the // kernel if one was found, else LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch( Process *process) { if (GetGlobalProperties()->GetScanType() != eKASLRScanExhaustiveScan) { @@ -381,12 +371,10 @@ lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch( return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // Read the mach_header struct out of memory and return it. // Returns true if the mach_header was successfully read, // Returns false if there was a problem reading the header, or it was not // a Mach-O header. -//---------------------------------------------------------------------- bool DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::MachO::mach_header &header, @@ -427,12 +415,10 @@ DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::M return true; } -//---------------------------------------------------------------------- // Given an address in memory, look to see if there is a kernel image at that // address. // Returns a UUID; if a kernel was not found at that address, UUID.IsValid() // will be false. -//---------------------------------------------------------------------- lldb_private::UUID DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr, Process *process, @@ -504,9 +490,7 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr, return UUID(); } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process, lldb::addr_t kernel_addr) : DynamicLoader(process), m_kernel_load_address(kernel_addr), m_kernel(), @@ -524,40 +508,32 @@ DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process, } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderDarwinKernel::~DynamicLoaderDarwinKernel() { Clear(true); } void DynamicLoaderDarwinKernel::UpdateIfNeeded() { LoadKernelModuleIfNeeded(); SetNotificationBreakpointIfNeeded(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwinKernel::DidAttach() { PrivateInitialize(m_process); UpdateIfNeeded(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwinKernel::DidLaunch() { PrivateInitialize(m_process); UpdateIfNeeded(); } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::Clear(bool clear_process) { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -985,11 +961,9 @@ DynamicLoaderDarwinKernel::KextImageInfo::GetArchitecture() const { return lldb_private::ArchSpec(); } -//---------------------------------------------------------------------- // Load the kernel module and initialize the "m_kernel" member. Return true // _only_ if the kernel is loaded the first time through (subsequent calls to // this function should return false after the kernel has been already loaded). -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() { if (!m_kext_summary_header_ptr_addr.IsValid()) { m_kernel.Clear(); @@ -1064,12 +1038,10 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() { } } -//---------------------------------------------------------------------- // Static callback function that gets called when our DYLD notification // breakpoint gets hit. We update all of our image infos and then let our super // class DynamicLoader class decide if we should stop or not (based on global // preference). -//---------------------------------------------------------------------- bool DynamicLoaderDarwinKernel::BreakpointHitCallback( void *baton, StoppointCallbackContext *context, user_id_t break_id, user_id_t break_loc_id) { @@ -1439,9 +1411,7 @@ bool DynamicLoaderDarwinKernel::ReadAllKextSummaries() { return false; } -//---------------------------------------------------------------------- // Dump an image info structure to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const { if (m_load_address == LLDB_INVALID_ADDRESS) { LLDB_LOG(log, "uuid={0} name=\"{1}\" (UNLOADED)", m_uuid.GetAsString(), @@ -1452,10 +1422,8 @@ void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const { } } -//---------------------------------------------------------------------- // Dump the _dyld_all_image_infos members and all current image infos that we // have parsed to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::PutToLog(Log *log) const { if (log == NULL) return; @@ -1507,9 +1475,7 @@ void DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded() { } } -//---------------------------------------------------------------------- // Member function that gets called when the process state changes. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::PrivateProcessStateChanged(Process *process, StateType state) { DEBUG_PRINTF("DynamicLoaderDarwinKernel::%s(%s)\n", __FUNCTION__, @@ -1586,9 +1552,7 @@ const char *DynamicLoaderDarwinKernel::GetPluginDescriptionStatic() { "in the MacOSX kernel."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderDarwinKernel::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h index edcecd1..67734a3 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h @@ -28,9 +28,7 @@ public: ~DynamicLoaderDarwinKernel() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -46,12 +44,10 @@ public: static lldb::addr_t SearchForDarwinKernel(lldb_private::Process *process); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; @@ -61,9 +57,7 @@ public: lldb_private::Status CanLoadImage() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h index b9b0a93..c171513 100644 --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h @@ -31,9 +31,7 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ // DynamicLoader protocol - //------------------------------------------------------------------ void DidAttach() override; @@ -48,9 +46,7 @@ public: const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp index 086169d..39440fd 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp @@ -51,46 +51,36 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderDarwin::DynamicLoaderDarwin(Process *process) : DynamicLoader(process), m_dyld_module_wp(), m_libpthread_module_wp(), m_pthread_getspecific_addr(), m_tid_to_tls_map(), m_dyld_image_infos(), m_dyld_image_infos_stop_id(UINT32_MAX), m_dyld(), m_mutex() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderDarwin::~DynamicLoaderDarwin() {} -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwin::DidAttach() { PrivateInitialize(m_process); DoInitialImageFetch(); SetNotificationBreakpoint(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwin::DidLaunch() { PrivateInitialize(m_process); DoInitialImageFetch(); SetNotificationBreakpoint(); } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::Clear(bool clear_process) { std::lock_guard<std::recursive_mutex> guard(m_mutex); if (clear_process) @@ -220,10 +210,8 @@ void DynamicLoaderDarwin::UnloadAllImages() { } } -//---------------------------------------------------------------------- // Update the load addresses for all segments in MODULE using the updated INFO // that is passed in. -//---------------------------------------------------------------------- bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module, ImageInfo &info) { bool changed = false; @@ -300,9 +288,7 @@ bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module, return changed; } -//---------------------------------------------------------------------- // Unload the segments in MODULE using the INFO that is passed in. -//---------------------------------------------------------------------- bool DynamicLoaderDarwin::UnloadModuleSections(Module *module, ImageInfo &info) { bool changed = false; @@ -683,7 +669,6 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos( return true; } -//---------------------------------------------------------------------- // On Mac OS X libobjc (the Objective-C runtime) has several critical dispatch // functions written in hand-written assembly, and also have hand-written // unwind information in the eh_frame section. Normally we prefer analyzing @@ -695,7 +680,6 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos( // extensible so they could have an Apple-specific flag) which indicates that // the instructions are asynchronous -- accurate at every instruction, instead // of our normal default assumption that they are not. -//---------------------------------------------------------------------- bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) { ModuleSP module_sp; @@ -713,9 +697,7 @@ bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) { return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp); } -//---------------------------------------------------------------------- // Dump a Segment to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::Segment::PutToLog(Log *log, lldb::addr_t slide) const { if (log) { @@ -740,9 +722,7 @@ DynamicLoaderDarwin::ImageInfo::FindSegment(ConstString name) const { return NULL; } -//---------------------------------------------------------------------- // Dump an image info structure to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::ImageInfo::PutToLog(Log *log) const { if (!log) return; @@ -765,9 +745,7 @@ void DynamicLoaderDarwin::PrivateInitialize(Process *process) { m_process->GetTarget().ClearAllLoadedSections(); } -//---------------------------------------------------------------------- // Member function that gets called when the process state changes. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::PrivateProcessStateChanged(Process *process, StateType state) { DEBUG_PRINTF("DynamicLoaderDarwin::%s(%s)\n", __FUNCTION__, diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h index 298e75c..8f4c65d 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h @@ -30,12 +30,10 @@ public: virtual ~DynamicLoaderDarwin() override; - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp index 27ccb89..53a9371 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp @@ -27,11 +27,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process, bool force) { bool create = force; @@ -73,17 +71,13 @@ DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process, return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderMacOS::DynamicLoaderMacOS(Process *process) : DynamicLoaderDarwin(process), m_image_infos_stop_id(UINT32_MAX), m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(), m_maybe_image_infos_address(LLDB_INVALID_ADDRESS) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderMacOS::~DynamicLoaderMacOS() { if (LLDB_BREAK_ID_IS_VALID(m_break_id)) m_process->GetTarget().RemoveBreakpointByID(m_break_id); @@ -133,9 +127,7 @@ bool DynamicLoaderMacOS::ProcessDidExec() { return did_exec; } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderMacOS::DoClear() { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -145,9 +137,7 @@ void DynamicLoaderMacOS::DoClear() { m_break_id = LLDB_INVALID_BREAK_ID; } -//---------------------------------------------------------------------- // Check if we have found DYLD yet -//---------------------------------------------------------------------- bool DynamicLoaderMacOS::DidSetNotificationBreakpoint() { return LLDB_BREAK_ID_IS_VALID(m_break_id); } @@ -159,12 +149,10 @@ void DynamicLoaderMacOS::ClearNotificationBreakpoint() { } } -//---------------------------------------------------------------------- // Try and figure out where dyld is by first asking the Process if it knows // (which currently calls down in the lldb::Process to get the DYLD info // (available on SnowLeopard only). If that fails, then check in the default // addresses. -//---------------------------------------------------------------------- void DynamicLoaderMacOS::DoInitialImageFetch() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); @@ -200,12 +188,10 @@ void DynamicLoaderMacOS::DoInitialImageFetch() { bool DynamicLoaderMacOS::NeedToDoInitialImageFetch() { return true; } -//---------------------------------------------------------------------- // Static callback function that gets called when our DYLD notification // breakpoint gets hit. We update all of our image infos and then let our super // class DynamicLoader class decide if we should stop or not (based on global // preference). -//---------------------------------------------------------------------- bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, @@ -347,7 +333,6 @@ void DynamicLoaderMacOS::AddBinaries( // Dump the _dyld_all_image_infos members and all current image infos that we // have parsed to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderMacOS::PutToLog(Log *log) const { if (log == NULL) return; @@ -537,9 +522,7 @@ const char *DynamicLoaderMacOS::GetPluginDescriptionStatic() { "in MacOSX user processes."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderMacOS::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h index 77645e3..1e965a5 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h @@ -34,9 +34,7 @@ public: virtual ~DynamicLoaderMacOS() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -48,12 +46,10 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ bool ProcessDidExec() override; lldb_private::Status CanLoadImage() override; @@ -63,9 +59,7 @@ public: lldb_private::LazyBool &using_shared_cache, lldb_private::LazyBool &private_shared_cache) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 58c46d8..f4c50b8 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -47,11 +47,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process, bool force) { bool create = force; @@ -93,9 +91,7 @@ DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process, return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderMacOSXDYLD::DynamicLoaderMacOSXDYLD(Process *process) : DynamicLoaderDarwin(process), m_dyld_all_image_infos_addr(LLDB_INVALID_ADDRESS), @@ -103,9 +99,7 @@ DynamicLoaderMacOSXDYLD::DynamicLoaderMacOSXDYLD(Process *process) m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(), m_process_image_addr_is_all_images_infos(false) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderMacOSXDYLD::~DynamicLoaderMacOSXDYLD() { if (LLDB_BREAK_ID_IS_VALID(m_break_id)) m_process->GetTarget().RemoveBreakpointByID(m_break_id); @@ -158,9 +152,7 @@ bool DynamicLoaderMacOSXDYLD::ProcessDidExec() { return did_exec; } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::DoClear() { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -172,9 +164,7 @@ void DynamicLoaderMacOSXDYLD::DoClear() { m_break_id = LLDB_INVALID_BREAK_ID; } -//---------------------------------------------------------------------- // Check if we have found DYLD yet -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::DidSetNotificationBreakpoint() { return LLDB_BREAK_ID_IS_VALID(m_break_id); } @@ -185,12 +175,10 @@ void DynamicLoaderMacOSXDYLD::ClearNotificationBreakpoint() { } } -//---------------------------------------------------------------------- // Try and figure out where dyld is by first asking the Process if it knows // (which currently calls down in the lldb::Process to get the DYLD info // (available on SnowLeopard only). If that fails, then check in the default // addresses. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() { if (m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS) { // Check the image info addr as it might point to the mach header for dyld, @@ -254,9 +242,7 @@ void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() { return; } -//---------------------------------------------------------------------- // Assume that dyld is in memory at ADDR and try to parse it's load commands -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback( lldb::addr_t addr) { std::lock_guard<std::recursive_mutex> baseclass_guard(GetMutex()); @@ -312,12 +298,10 @@ bool DynamicLoaderMacOSXDYLD::NeedToDoInitialImageFetch() { return m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // Static callback function that gets called when our DYLD notification // breakpoint gets hit. We update all of our image infos and then let our super // class DynamicLoader class decide if we should stop or not (based on global // preference). -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::NotifyBreakpointHit( void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) { @@ -701,12 +685,10 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos( } } -//---------------------------------------------------------------------- // If we have found where the "_dyld_all_image_infos" lives in memory, read the // current info from it, and then update all image load addresses (or lack // thereof). Only do this if this is the first time we're reading the dyld // infos. Return true if we actually read anything, and false otherwise. -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); @@ -768,12 +750,10 @@ bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() { return false; } -//---------------------------------------------------------------------- // Read a mach_header at ADDR into HEADER, and also fill in the load command // data into LOAD_COMMAND_DATA if it is non-NULL. // // Returns true if we succeed, false if we fail for any reason. -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr, llvm::MachO::mach_header *header, DataExtractor *load_command_data) { @@ -840,9 +820,7 @@ bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr, return false; // We failed the read the mach_header } -//---------------------------------------------------------------------- // Parse the load commands for an image -//---------------------------------------------------------------------- uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data, ImageInfo &dylib_info, FileSpec *lc_id_dylinker) { @@ -929,10 +907,8 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data, return cmd_idx; } -//---------------------------------------------------------------------- // Read the mach_header and load commands for each image that the // _dyld_all_image_infos structure points to and cache the results. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands( ImageInfo::collection &image_infos, uint32_t infos_count, @@ -990,10 +966,8 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands( } } -//---------------------------------------------------------------------- // Dump the _dyld_all_image_infos members and all current image infos that we // have parsed to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::PutToLog(Log *log) const { if (log == NULL) return; @@ -1159,9 +1133,7 @@ const char *DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() { "in MacOSX user processes."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderMacOSXDYLD::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h index 10a3f31..656a204 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h @@ -38,9 +38,7 @@ public: virtual ~DynamicLoaderMacOSXDYLD() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -52,12 +50,10 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ bool ProcessDidExec() override; lldb_private::Status CanLoadImage() override; @@ -67,9 +63,7 @@ public: lldb_private::LazyBool &using_shared_cache, lldb_private::LazyBool &private_shared_cache) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h index 1a2d400..d61f156 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h @@ -36,9 +36,7 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ // DynamicLoader protocol - //------------------------------------------------------------------ void DidAttach() override; @@ -53,9 +51,7 @@ public: const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp index 2d3d7ea..88ca2e2 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp @@ -17,11 +17,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process, bool force) { bool create = force; @@ -48,31 +46,23 @@ DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process, return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderStatic::DynamicLoaderStatic(Process *process) : DynamicLoader(process) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderStatic::~DynamicLoaderStatic() {} -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderStatic::DidAttach() { LoadAllImagesAtFileAddresses(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderStatic::DidLaunch() { LoadAllImagesAtFileAddresses(); } void DynamicLoaderStatic::LoadAllImagesAtFileAddresses() { @@ -156,9 +146,7 @@ const char *DynamicLoaderStatic::GetPluginDescriptionStatic() { "addresses contained in each image."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderStatic::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h index 9075df683..fa9aded 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h @@ -20,9 +20,7 @@ public: ~DynamicLoaderStatic() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -34,12 +32,10 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; @@ -49,9 +45,7 @@ public: lldb_private::Status CanLoadImage() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h index b5242af..670ba6d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h @@ -15,7 +15,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ASTResultSynthesizer ASTResultSynthesizer.h /// "lldb/Expression/ASTResultSynthesizer.h" Adds a result variable /// declaration to the ASTs for an expression. @@ -28,10 +27,8 @@ namespace lldb_private { /// ASTResultSynthesizer's job is to add the variable and its initialization /// to the ASTs for the expression, and it does so by acting as a SemaConsumer /// for Clang. -//---------------------------------------------------------------------- class ASTResultSynthesizer : public clang::SemaConsumer { public: - //---------------------------------------------------------------------- /// Constructor /// /// \param[in] passthrough @@ -47,25 +44,19 @@ public: /// \param[in] target /// The target, which contains the persistent variable store and the /// AST importer. - //---------------------------------------------------------------------- ASTResultSynthesizer(clang::ASTConsumer *passthrough, bool top_level, Target &target); - //---------------------------------------------------------------------- /// Destructor - //---------------------------------------------------------------------- ~ASTResultSynthesizer() override; - //---------------------------------------------------------------------- /// Link this consumer with a particular AST context /// /// \param[in] Context /// This AST context will be used for types and identifiers, and also /// forwarded to the passthrough consumer, if one exists. - //---------------------------------------------------------------------- void Initialize(clang::ASTContext &Context) override; - //---------------------------------------------------------------------- /// Examine a list of Decls to find the function $__lldb_expr and transform /// its code /// @@ -73,82 +64,58 @@ public: /// The list of Decls to search. These may contain LinkageSpecDecls, /// which need to be searched recursively. That job falls to /// TransformTopLevelDecl. - //---------------------------------------------------------------------- bool HandleTopLevelDecl(clang::DeclGroupRef D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTranslationUnit(clang::ASTContext &Ctx) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTagDeclDefinition(clang::TagDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void CompleteTentativeDefinition(clang::VarDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleVTable(clang::CXXRecordDecl *RD) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void PrintStats() override; - //---------------------------------------------------------------------- /// Set the Sema object to use when performing transforms, and pass it on /// /// \param[in] S /// The Sema to use. Because Sema isn't externally visible, this class /// casts it to an Action for actual use. - //---------------------------------------------------------------------- void InitializeSema(clang::Sema &S) override; - //---------------------------------------------------------------------- /// Reset the Sema to NULL now that transformations are done - //---------------------------------------------------------------------- void ForgetSema() override; - //---------------------------------------------------------------------- /// The parse has succeeded, so record its persistent decls - //---------------------------------------------------------------------- void CommitPersistentDecls(); private: - //---------------------------------------------------------------------- /// Hunt the given Decl for FunctionDecls named $__lldb_expr, recursing as /// necessary through LinkageSpecDecls, and calling SynthesizeResult on /// anything that was found /// /// \param[in] D /// The Decl to hunt. - //---------------------------------------------------------------------- void TransformTopLevelDecl(clang::Decl *D); - //---------------------------------------------------------------------- /// Process an Objective-C method and produce the result variable and /// initialization /// /// \param[in] MethodDecl /// The method to process. - //---------------------------------------------------------------------- bool SynthesizeObjCMethodResult(clang::ObjCMethodDecl *MethodDecl); - //---------------------------------------------------------------------- /// Process a function and produce the result variable and initialization /// /// \param[in] FunDecl /// The function to process. - //---------------------------------------------------------------------- bool SynthesizeFunctionResult(clang::FunctionDecl *FunDecl); - //---------------------------------------------------------------------- /// Process a function body and produce the result variable and /// initialization /// @@ -158,35 +125,28 @@ private: /// \param[in] DC /// The DeclContext of the function, into which the result variable /// is inserted. - //---------------------------------------------------------------------- bool SynthesizeBodyResult(clang::CompoundStmt *Body, clang::DeclContext *DC); - //---------------------------------------------------------------------- /// Given a DeclContext for a function or method, find all types declared in /// the context and record any persistent types found. /// /// \param[in] FunDeclCtx /// The context for the function to process. - //---------------------------------------------------------------------- void RecordPersistentTypes(clang::DeclContext *FunDeclCtx); - //---------------------------------------------------------------------- /// Given a TypeDecl, if it declares a type whose name starts with a dollar /// sign, register it as a pointer type in the target's scratch /// AST context. /// /// \param[in] Body /// The body of the function. - //---------------------------------------------------------------------- void MaybeRecordPersistentType(clang::TypeDecl *D); - //---------------------------------------------------------------------- /// Given a NamedDecl, register it as a pointer type in the target's scratch /// AST context. /// /// \param[in] Body /// The body of the function. - //---------------------------------------------------------------------- void RecordPersistentDecl(clang::NamedDecl *D); clang::ASTContext diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h index 33c0670..7aef2e2 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h @@ -17,7 +17,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ASTStructExtractor ASTStructExtractor.h /// "lldb/Expression/ASTStructExtractor.h" Extracts and describes the argument /// structure for a wrapped function. @@ -32,10 +31,8 @@ namespace lldb_private { /// The definition of this struct is itself in the body of the wrapper /// function, so Clang does the structure layout itself. ASTStructExtractor /// reads through the AST for the wrapper function and finds the struct. -//---------------------------------------------------------------------- class ASTStructExtractor : public clang::SemaConsumer { public: - //---------------------------------------------------------------------- /// Constructor /// /// \param[in] passthrough @@ -52,25 +49,19 @@ public: /// about the argument struct. ClangFunctionCaller friends /// ASTStructExtractor /// for this purpose. - //---------------------------------------------------------------------- ASTStructExtractor(clang::ASTConsumer *passthrough, const char *struct_name, ClangFunctionCaller &function); - //---------------------------------------------------------------------- /// Destructor - //---------------------------------------------------------------------- ~ASTStructExtractor() override; - //---------------------------------------------------------------------- /// Link this consumer with a particular AST context /// /// \param[in] Context /// This AST context will be used for types and identifiers, and also /// forwarded to the passthrough consumer, if one exists. - //---------------------------------------------------------------------- void Initialize(clang::ASTContext &Context) override; - //---------------------------------------------------------------------- /// Examine a list of Decls to find the function $__lldb_expr and transform /// its code /// @@ -78,66 +69,47 @@ public: /// The list of Decls to search. These may contain LinkageSpecDecls, /// which need to be searched recursively. That job falls to /// TransformTopLevelDecl. - //---------------------------------------------------------------------- bool HandleTopLevelDecl(clang::DeclGroupRef D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTranslationUnit(clang::ASTContext &Ctx) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTagDeclDefinition(clang::TagDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void CompleteTentativeDefinition(clang::VarDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleVTable(clang::CXXRecordDecl *RD) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void PrintStats() override; - //---------------------------------------------------------------------- /// Set the Sema object to use when performing transforms, and pass it on /// /// \param[in] S /// The Sema to use. Because Sema isn't externally visible, this class /// casts it to an Action for actual use. - //---------------------------------------------------------------------- void InitializeSema(clang::Sema &S) override; - //---------------------------------------------------------------------- /// Reset the Sema to NULL now that transformations are done - //---------------------------------------------------------------------- void ForgetSema() override; private: - //---------------------------------------------------------------------- /// Hunt the given FunctionDecl for the argument struct and place /// information about it into m_function /// /// \param[in] F /// The FunctionDecl to hunt. - //---------------------------------------------------------------------- void ExtractFromFunctionDecl(clang::FunctionDecl *F); - //---------------------------------------------------------------------- /// Hunt the given Decl for FunctionDecls named the same as the wrapper /// function name, recursing as necessary through LinkageSpecDecls, and /// calling ExtractFromFunctionDecl on anything that was found /// /// \param[in] D /// The Decl to hunt. - //---------------------------------------------------------------------- void ExtractFromTopLevelDecl(clang::Decl *D); clang::ASTContext diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index 1c8e3c7..8d96dbb 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -32,10 +32,8 @@ using namespace clang; using namespace lldb_private; -//------------------------------------------------------------------ // Scoped class that will remove an active lexical decl from the set when it // goes out of scope. -//------------------------------------------------------------------ namespace { class ScopedLexicalDeclEraser { public: diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h index e12f1c5..09d08d5 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangASTSource ClangASTSource.h "lldb/Expression/ClangASTSource.h" /// Provider for named objects defined in the debug info for Clang /// @@ -31,28 +30,21 @@ namespace lldb_private { /// knows the name it is looking for, but nothing else. The ExternalSemaSource /// class provides Decls (VarDecl, FunDecl, TypeDecl) to Clang for these /// names, consulting the ClangExpressionDeclMap to do the actual lookups. -//---------------------------------------------------------------------- class ClangASTSource : public ClangExternalASTSourceCommon, public ClangASTImporter::MapCompleter { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. /// /// \param[in] target /// A reference to the target containing debug information to use. - //------------------------------------------------------------------ ClangASTSource(const lldb::TargetSP &target); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~ClangASTSource() override; - //------------------------------------------------------------------ /// Interface stubs. - //------------------------------------------------------------------ clang::Decl *GetExternalDecl(uint32_t) override { return NULL; } clang::Stmt *GetExternalDeclStmt(uint64_t) override { return NULL; } clang::Selector GetExternalSelector(uint32_t) override { @@ -73,7 +65,6 @@ public: // APIs for ExternalASTSource // - //------------------------------------------------------------------ /// Look up all Decls that match a particular name. Only handles /// Identifiers and DeclContexts that are either NamespaceDecls or /// TranslationUnitDecls. Calls SetExternalVisibleDeclsForName with the @@ -90,11 +81,9 @@ public: /// /// \return /// Whatever SetExternalVisibleDeclsForName returns. - //------------------------------------------------------------------ bool FindExternalVisibleDeclsByName(const clang::DeclContext *DC, clang::DeclarationName Name) override; - //------------------------------------------------------------------ /// Enumerate all Decls in a given lexical context. /// /// \param[in] DC @@ -106,13 +95,11 @@ public: /// /// \param[in] Decls /// A vector that is filled in with matching Decls. - //------------------------------------------------------------------ void FindExternalLexicalDecls( const clang::DeclContext *DC, llvm::function_ref<bool(clang::Decl::Kind)> IsKindWeWant, llvm::SmallVectorImpl<clang::Decl *> &Decls) override; - //------------------------------------------------------------------ /// Specify the layout of the contents of a RecordDecl. /// /// \param[in] Record @@ -144,7 +131,6 @@ public: /// /// \return /// True <=> the layout is valid. - //----------------------------------------------------------------- bool layoutRecordType( const clang::RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap<const clang::FieldDecl *, uint64_t> &FieldOffsets, @@ -153,37 +139,30 @@ public: llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &VirtualBaseOffsets) override; - //------------------------------------------------------------------ /// Complete a TagDecl. /// /// \param[in] Tag /// The Decl to be completed in place. - //------------------------------------------------------------------ void CompleteType(clang::TagDecl *Tag) override; - //------------------------------------------------------------------ /// Complete an ObjCInterfaceDecl. /// /// \param[in] Class /// The Decl to be completed in place. - //------------------------------------------------------------------ void CompleteType(clang::ObjCInterfaceDecl *Class) override; - //------------------------------------------------------------------ /// Called on entering a translation unit. Tells Clang by calling /// setHasExternalVisibleStorage() and setHasExternalLexicalStorage() that /// this object has something to say about undefined names. /// /// \param[in] ASTConsumer /// Unused. - //------------------------------------------------------------------ void StartTranslationUnit(clang::ASTConsumer *Consumer) override; // // APIs for NamespaceMapCompleter // - //------------------------------------------------------------------ /// Look up the modules containing a given namespace and put the appropriate /// entries in the namespace map. /// @@ -196,7 +175,6 @@ public: /// \param[in] parent_map /// The map for the namespace's parent namespace, if there is /// one. - //------------------------------------------------------------------ void CompleteNamespaceMap( ClangASTImporter::NamespaceMapSP &namespace_map, ConstString name, ClangASTImporter::NamespaceMapSP &parent_map) const override; @@ -209,12 +187,10 @@ public: AddNamespace(NameSearchContext &context, ClangASTImporter::NamespaceMapSP &namespace_decls); - //------------------------------------------------------------------ /// The worker function for FindExternalVisibleDeclsByName. /// /// \param[in] context /// The NameSearchContext to use when filing results. - //------------------------------------------------------------------ virtual void FindExternalVisibleDecls(NameSearchContext &context); void SetImportInProgress(bool import_in_progress) { @@ -227,13 +203,11 @@ public: } bool GetLookupsEnabled() { return m_lookups_enabled; } - //---------------------------------------------------------------------- /// \class ClangASTSourceProxy ClangASTSource.h /// "lldb/Expression/ClangASTSource.h" Proxy for ClangASTSource /// /// Clang AST contexts like to own their AST sources, so this is a state- /// free proxy object. - //---------------------------------------------------------------------- class ClangASTSourceProxy : public ClangExternalASTSourceCommon { public: ClangASTSourceProxy(ClangASTSource &original) : m_original(original) {} @@ -294,7 +268,6 @@ public: } protected: - //------------------------------------------------------------------ /// Look for the complete version of an Objective-C interface, and return it /// if found. /// @@ -304,11 +277,9 @@ protected: /// \return /// NULL if the complete interface couldn't be found; /// the complete interface otherwise. - //------------------------------------------------------------------ clang::ObjCInterfaceDecl * GetCompleteObjCInterface(const clang::ObjCInterfaceDecl *interface_decl); - //------------------------------------------------------------------ /// Find all entities matching a given name in a given module, using a /// NameSearchContext to make Decls for them. /// @@ -324,33 +295,27 @@ protected: /// \param[in] current_id /// The ID for the current FindExternalVisibleDecls invocation, /// for logging purposes. - //------------------------------------------------------------------ void FindExternalVisibleDecls(NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl, unsigned int current_id); - //------------------------------------------------------------------ /// Find all Objective-C methods matching a given selector. /// /// \param[in] context /// The NameSearchContext that can construct Decls for this name. /// Its m_decl_name contains the selector and its m_decl_context /// is the containing object. - //------------------------------------------------------------------ void FindObjCMethodDecls(NameSearchContext &context); - //------------------------------------------------------------------ /// Find all Objective-C properties and ivars with a given name. /// /// \param[in] context /// The NameSearchContext that can construct Decls for this name. /// Its m_decl_name contains the name and its m_decl_context /// is the containing object. - //------------------------------------------------------------------ void FindObjCPropertyAndIvarDecls(NameSearchContext &context); - //------------------------------------------------------------------ /// A wrapper for ClangASTContext::CopyType that sets a flag that /// indicates that we should not respond to queries during import. /// @@ -366,11 +331,9 @@ protected: /// /// \return /// The imported type. - //------------------------------------------------------------------ CompilerType GuardedCopyType(const CompilerType &src_type); public: - //------------------------------------------------------------------ /// Returns true if a name should be ignored by name lookup. /// /// \param[in] name @@ -382,11 +345,9 @@ public: /// \return /// True if the name is one of a class of names that are ignored by /// global lookup for performance reasons. - //------------------------------------------------------------------ bool IgnoreName(const ConstString name, bool ignore_all_dollar_names); public: - //------------------------------------------------------------------ /// Copies a single Decl into the parser's AST context. /// /// \param[in] src_decl @@ -394,10 +355,8 @@ public: /// /// \return /// A copy of the Decl in m_ast_context, or NULL if the copy failed. - //------------------------------------------------------------------ clang::Decl *CopyDecl(clang::Decl *src_decl); - //------------------------------------------------------------------ /// Copies a single Type to the target of the given ExternalASTMerger. /// /// \param[in] src_context @@ -412,12 +371,10 @@ public: /// /// \return /// A copy of the Type in the merger's target context. - //------------------------------------------------------------------ clang::QualType CopyTypeWithMerger(clang::ASTContext &src_context, clang::ExternalASTMerger &merger, clang::QualType type); - //------------------------------------------------------------------ /// Determined the origin of a single Decl, if it can be found. /// /// \param[in] decl @@ -431,20 +388,15 @@ public: /// /// \return /// True if lookup succeeded; false otherwise. - //------------------------------------------------------------------ bool ResolveDeclOrigin(const clang::Decl *decl, clang::Decl **original_decl, clang::ASTContext **original_ctx); - //------------------------------------------------------------------ /// Returns m_merger_up. Only call this if the target is configured to use /// modern lookup, - //------------------------------------------------------------------ clang::ExternalASTMerger &GetMergerUnchecked(); - //------------------------------------------------------------------ /// Returns true if there is a merger. This only occurs if the target is /// using modern lookup. - //------------------------------------------------------------------ bool HasMerger() { return (bool)m_merger_up; } protected: @@ -470,7 +422,6 @@ protected: std::set<const char *> m_active_lookups; }; -//---------------------------------------------------------------------- /// \class NameSearchContext ClangASTSource.h /// "lldb/Expression/ClangASTSource.h" Container for all objects relevant to a /// single name lookup @@ -478,7 +429,6 @@ protected: /// LLDB needs to create Decls for entities it finds. This class communicates /// what name is being searched for and provides helper functions to construct /// Decls given appropriate type information. -//---------------------------------------------------------------------- struct NameSearchContext { ClangASTSource &m_ast_source; ///< The AST source making the request llvm::SmallVectorImpl<clang::NamedDecl *> @@ -503,7 +453,6 @@ struct NameSearchContext { bool type : 1; } m_found; - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -520,7 +469,6 @@ struct NameSearchContext { /// /// \param[in] dc /// The DeclContext to register Decls in. - //------------------------------------------------------------------ NameSearchContext(ClangASTSource &astSource, llvm::SmallVectorImpl<clang::NamedDecl *> &decls, clang::DeclarationName &name, const clang::DeclContext *dc) @@ -529,16 +477,13 @@ struct NameSearchContext { memset(&m_found, 0, sizeof(m_found)); } - //------------------------------------------------------------------ /// Create a VarDecl with the name being searched for and the provided type /// and register it in the right places. /// /// \param[in] type /// The opaque QualType for the VarDecl being registered. - //------------------------------------------------------------------ clang::NamedDecl *AddVarDecl(const CompilerType &type); - //------------------------------------------------------------------ /// Create a FunDecl with the name being searched for and the provided type /// and register it in the right places. /// @@ -547,41 +492,32 @@ struct NameSearchContext { /// /// \param[in] extern_c /// If true, build an extern "C" linkage specification for this. - //------------------------------------------------------------------ clang::NamedDecl *AddFunDecl(const CompilerType &type, bool extern_c = false); - //------------------------------------------------------------------ /// Create a FunDecl with the name being searched for and generic type (i.e. /// intptr_t NAME_GOES_HERE(...)) and register it in the right places. - //------------------------------------------------------------------ clang::NamedDecl *AddGenericFunDecl(); - //------------------------------------------------------------------ /// Create a TypeDecl with the name being searched for and the provided type /// and register it in the right places. /// /// \param[in] compiler_type /// The opaque QualType for the TypeDecl being registered. - //------------------------------------------------------------------ clang::NamedDecl *AddTypeDecl(const CompilerType &compiler_type); - //------------------------------------------------------------------ /// Add Decls from the provided DeclContextLookupResult to the list of /// results. /// /// \param[in] result /// The DeclContextLookupResult, usually returned as the result /// of querying a DeclContext. - //------------------------------------------------------------------ void AddLookupResult(clang::DeclContextLookupResult result); - //------------------------------------------------------------------ /// Add a NamedDecl to the list of results. /// /// \param[in] decl /// The NamedDecl, usually returned as the result /// of querying a DeclContext. - //------------------------------------------------------------------ void AddNamedDecl(clang::NamedDecl *decl); }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h index 9d2dd22..a7e2ced 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -29,7 +29,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangExpressionDeclMap ClangExpressionDeclMap.h /// "lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are /// defined in LLDB's debug information. @@ -53,10 +52,8 @@ namespace lldb_private { /// /// Fourth and finally, it "dematerializes" the struct after the JITted code /// has has executed, placing the new values back where it found the old ones. -//---------------------------------------------------------------------- class ClangExpressionDeclMap : public ClangASTSource { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -76,19 +73,15 @@ public: /// \param[in] ctx_obj /// If not empty, then expression is evaluated in context of this object. /// See the comment to `UserExpression::Evaluate` for details. - //------------------------------------------------------------------ ClangExpressionDeclMap( bool keep_result_in_memory, Materializer::PersistentVariableDelegate *result_delegate, ExecutionContext &exe_ctx, ValueObject *ctx_obj); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~ClangExpressionDeclMap() override; - //------------------------------------------------------------------ /// Enable the state needed for parsing and IR transformation. /// /// \param[in] exe_ctx @@ -101,26 +94,20 @@ public: /// /// \return /// True if parsing is possible; false if it is unsafe to continue. - //------------------------------------------------------------------ bool WillParse(ExecutionContext &exe_ctx, Materializer *materializer); void InstallCodeGenerator(clang::ASTConsumer *code_gen); - //------------------------------------------------------------------ /// [Used by ClangExpressionParser] For each variable that had an unknown /// type at the beginning of parsing, determine its final type now. /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool ResolveUnknownTypes(); - //------------------------------------------------------------------ /// Disable the state needed for parsing and IR transformation. - //------------------------------------------------------------------ void DidParse(); - //------------------------------------------------------------------ /// [Used by IRForTarget] Add a variable to the list of persistent /// variables for the process. /// @@ -136,12 +123,10 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool AddPersistentVariable(const clang::NamedDecl *decl, ConstString name, TypeFromParser type, bool is_result, bool is_lvalue); - //------------------------------------------------------------------ /// [Used by IRForTarget] Add a variable to the struct that needs to /// be materialized each time the expression runs. /// @@ -162,21 +147,17 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool AddValueToStruct(const clang::NamedDecl *decl, ConstString name, llvm::Value *value, size_t size, lldb::offset_t alignment); - //------------------------------------------------------------------ /// [Used by IRForTarget] Finalize the struct, laying out the position of /// each object in it. /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool DoStructLayout(); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get general information about the laid-out struct /// after DoStructLayout() has been called. /// @@ -191,11 +172,9 @@ public: /// /// \return /// True if the information could be retrieved; false otherwise. - //------------------------------------------------------------------ bool GetStructInfo(uint32_t &num_elements, size_t &size, lldb::offset_t &alignment); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get specific information about one field of the /// laid-out struct after DoStructLayout() has been called. /// @@ -225,12 +204,10 @@ public: /// /// \return /// True if the information could be retrieved; false otherwise. - //------------------------------------------------------------------ bool GetStructElement(const clang::NamedDecl *&decl, llvm::Value *&value, lldb::offset_t &offset, ConstString &name, uint32_t index); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get information about a function given its Decl. /// /// \param[in] decl @@ -242,10 +219,8 @@ public: /// /// \return /// True if the information could be retrieved; false otherwise. - //------------------------------------------------------------------ bool GetFunctionInfo(const clang::NamedDecl *decl, uint64_t &ptr); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get the address of a symbol given nothing but its /// name. /// @@ -266,7 +241,6 @@ public: /// /// \return /// Valid load address for the symbol - //------------------------------------------------------------------ lldb::addr_t GetSymbolAddress(Target &target, Process *process, ConstString name, lldb::SymbolType symbol_type, @@ -275,7 +249,6 @@ public: lldb::addr_t GetSymbolAddress(ConstString name, lldb::SymbolType symbol_type); - //------------------------------------------------------------------ /// [Used by IRInterpreter] Get basic target information. /// /// \param[out] byte_order @@ -287,7 +260,6 @@ public: /// \return /// True if the information could be determined; false /// otherwise. - //------------------------------------------------------------------ struct TargetInfo { lldb::ByteOrder byte_order; size_t address_byte_size; @@ -300,7 +272,6 @@ public: }; TargetInfo GetTargetInfo(); - //------------------------------------------------------------------ /// [Used by ClangASTSource] Find all entities matching a given name, using /// a NameSearchContext to make Decls for them. /// @@ -309,10 +280,8 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ void FindExternalVisibleDecls(NameSearchContext &context) override; - //------------------------------------------------------------------ /// Find all entities matching a given name in a given module/namespace, /// using a NameSearchContext to make Decls for them. /// @@ -331,7 +300,6 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ void FindExternalVisibleDecls(NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl, @@ -353,9 +321,7 @@ private: ///For details see the comment to ///`UserExpression::Evaluate`. - //---------------------------------------------------------------------- /// The following values should not live beyond parsing - //---------------------------------------------------------------------- class ParserVars { public: ParserVars() {} @@ -388,23 +354,17 @@ private: std::unique_ptr<ParserVars> m_parser_vars; - //---------------------------------------------------------------------- /// Activate parser-specific variables - //---------------------------------------------------------------------- void EnableParserVars() { if (!m_parser_vars.get()) m_parser_vars = llvm::make_unique<ParserVars>(); } - //---------------------------------------------------------------------- /// Deallocate parser-specific variables - //---------------------------------------------------------------------- void DisableParserVars() { m_parser_vars.reset(); } - //---------------------------------------------------------------------- /// The following values contain layout information for the materialized /// struct, but are not specific to a single materialization - //---------------------------------------------------------------------- struct StructVars { StructVars() : m_struct_alignment(0), m_struct_size(0), m_struct_laid_out(false), @@ -424,26 +384,19 @@ private: std::unique_ptr<StructVars> m_struct_vars; - //---------------------------------------------------------------------- /// Activate struct variables - //---------------------------------------------------------------------- void EnableStructVars() { if (!m_struct_vars.get()) m_struct_vars.reset(new struct StructVars); } - //---------------------------------------------------------------------- /// Deallocate struct variables - //---------------------------------------------------------------------- void DisableStructVars() { m_struct_vars.reset(); } - //---------------------------------------------------------------------- /// Get this parser's ID for use in extracting parser- and JIT-specific data /// from persistent variables. - //---------------------------------------------------------------------- uint64_t GetParserID() { return (uint64_t) this; } - //------------------------------------------------------------------ /// Given a target, find a variable that matches the given name and type. /// /// \param[in] target @@ -465,13 +418,11 @@ private: /// /// \return /// The LLDB Variable found, or NULL if none was found. - //------------------------------------------------------------------ lldb::VariableSP FindGlobalVariable(Target &target, lldb::ModuleSP &module, ConstString name, CompilerDeclContext *namespace_decl, TypeFromUser *type = NULL); - //------------------------------------------------------------------ /// Get the value of a variable in a given execution context and return the /// associated Types if needed. /// @@ -496,13 +447,11 @@ private: /// /// \return /// Return true if the value was successfully filled in. - //------------------------------------------------------------------ bool GetVariableValue(lldb::VariableSP &var, lldb_private::Value &var_location, TypeFromUser *found_type = NULL, TypeFromParser *parser_type = NULL); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given LLDB /// Variable, and put it in the Tuple list. /// @@ -514,11 +463,9 @@ private: /// /// \param[in] valobj /// The LLDB ValueObject for that variable. - //------------------------------------------------------------------ void AddOneVariable(NameSearchContext &context, lldb::VariableSP var, lldb::ValueObjectSP valobj, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given persistent /// variable, and put it in the list of found entities. /// @@ -531,12 +478,10 @@ private: /// \param[in] current_id /// The ID of the current invocation of FindExternalVisibleDecls /// for logging purposes. - //------------------------------------------------------------------ void AddOneVariable(NameSearchContext &context, lldb::ExpressionVariableSP &pvar_sp, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given LLDB symbol /// (treated as a variable), and put it in the list of found entities. /// @@ -545,11 +490,9 @@ private: /// /// \param[in] var /// The LLDB Variable that needs a Decl. - //------------------------------------------------------------------ void AddOneGenericVariable(NameSearchContext &context, const Symbol &symbol, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given function. /// (Functions are not placed in the Tuple list.) Can handle both fully /// typed functions and generic functions. @@ -564,11 +507,9 @@ private: /// \param[in] sym /// The Symbol that corresponds to a function that needs to be /// created with generic type (unitptr_t foo(...)). - //------------------------------------------------------------------ void AddOneFunction(NameSearchContext &context, Function *fun, Symbol *sym, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given register. /// /// \param[in] context @@ -576,11 +517,9 @@ private: /// /// \param[in] reg_info /// The information corresponding to that register. - //------------------------------------------------------------------ void AddOneRegister(NameSearchContext &context, const RegisterInfo *reg_info, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given type. (Types /// are not placed in the Tuple list.) /// @@ -589,11 +528,9 @@ private: /// /// \param[in] type /// The type that needs to be created. - //------------------------------------------------------------------ void AddOneType(NameSearchContext &context, const TypeFromUser &type, unsigned int current_id); - //------------------------------------------------------------------ /// Generate a Decl for "*this" and add a member function declaration to it /// for the expression, then report it. /// @@ -602,11 +539,9 @@ private: /// /// \param[in] type /// The type for *this. - //------------------------------------------------------------------ void AddThisType(NameSearchContext &context, const TypeFromUser &type, unsigned int current_id); - //------------------------------------------------------------------ /// Move a type out of the current ASTContext into another, but make sure to /// export all components of the type also. /// @@ -619,7 +554,6 @@ private: /// /// \return /// Returns the moved type, or an empty type if there was a problem. - //------------------------------------------------------------------ TypeFromUser DeportType(ClangASTContext &target, ClangASTContext &source, TypeFromParser parser_type); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h index 40e5663..48da5ab 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h @@ -23,9 +23,7 @@ namespace lldb_private { class RecordingMemoryManager; -//---------------------------------------------------------------------- // ClangExpressionHelper -//---------------------------------------------------------------------- class ClangExpressionHelper : public ExpressionTypeSystemHelper { public: static bool classof(const ExpressionTypeSystemHelper *ts) { @@ -36,25 +34,19 @@ public: : ExpressionTypeSystemHelper( ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper) {} - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ virtual ~ClangExpressionHelper() {} - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ virtual ClangExpressionDeclMap *DeclMap() = 0; - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. /// May be NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ virtual clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) = 0; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index f9ddb75..46b711d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -613,13 +613,11 @@ ClangExpressionParser::~ClangExpressionParser() {} namespace { -//---------------------------------------------------------------------- /// \class CodeComplete /// /// A code completion consumer for the clang Sema that is responsible for /// creating the completion suggestions when a user requests completion /// of an incomplete `expr` invocation. -//---------------------------------------------------------------------- class CodeComplete : public CodeCompleteConsumer { CodeCompletionTUInfo m_info; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h index 610008e..a42c219 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h @@ -27,7 +27,6 @@ namespace lldb_private { class IRExecutionUnit; -//---------------------------------------------------------------------- /// \class ClangExpressionParser ClangExpressionParser.h /// "lldb/Expression/ClangExpressionParser.h" Encapsulates an instance of /// Clang that can parse expressions. @@ -37,10 +36,8 @@ class IRExecutionUnit; /// as a glorified parameter list, performing the required parsing and /// conversion to formats (DWARF bytecode, or JIT compiled machine code) that /// can be executed. -//---------------------------------------------------------------------- class ClangExpressionParser : public ExpressionParser { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -56,20 +53,16 @@ public: /// @param[in] include_directories /// List of include directories that should be used when parsing the /// expression. - //------------------------------------------------------------------ ClangExpressionParser(ExecutionContextScope *exe_scope, Expression &expr, bool generate_debug_info, std::vector<ConstString> include_directories = {}); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~ClangExpressionParser() override; bool Complete(CompletionRequest &request, unsigned line, unsigned pos, unsigned typed_pos) override; - //------------------------------------------------------------------ /// Parse a single expression and convert it to IR using Clang. Don't wrap /// the expression in anything at all. /// @@ -79,12 +72,10 @@ public: /// \return /// The number of errors encountered during parsing. 0 means /// success. - //------------------------------------------------------------------ unsigned Parse(DiagnosticManager &diagnostic_manager) override; bool RewriteExpression(DiagnosticManager &diagnostic_manager) override; - //------------------------------------------------------------------ /// Ready an already-parsed expression for execution, possibly evaluating it /// statically. /// @@ -120,14 +111,12 @@ public: /// \return /// An error code indicating the success or failure of the operation. /// Test with Success(). - //------------------------------------------------------------------ Status PrepareForExecution(lldb::addr_t &func_addr, lldb::addr_t &func_end, lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx, bool &can_interpret, lldb_private::ExecutionPolicy execution_policy) override; - //------------------------------------------------------------------ /// Run all static initializers for an execution unit. /// /// \param[in] execution_unit_sp @@ -138,11 +127,9 @@ public: /// /// \return /// The error code indicating the - //------------------------------------------------------------------ Status RunStaticInitializers(lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx); - //------------------------------------------------------------------ /// Returns a string representing current ABI. /// /// \param[in] target_arch @@ -150,11 +137,9 @@ public: /// /// \return /// A string representing target ABI for the current architecture. - //------------------------------------------------------------------- std::string GetClangTargetABI(const ArchSpec &target_arch); private: - //------------------------------------------------------------------ /// Parses the expression. /// /// \param[in] diagnostic_manager @@ -175,7 +160,6 @@ private: /// /// \return /// The number of parsing errors. - //------------------------------------------------------------------- unsigned ParseInternal(DiagnosticManager &diagnostic_manager, clang::CodeCompleteConsumer *completion = nullptr, unsigned completion_line = 0, diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h index a81f42d..bb5e6e7 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h @@ -34,7 +34,6 @@ namespace lldb_private { class ValueObjectConstResult; -//---------------------------------------------------------------------- /// \class ClangExpressionVariable ClangExpressionVariable.h /// "lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for /// the expression parser. @@ -55,7 +54,6 @@ class ValueObjectConstResult; /// /// This class supports all of these use cases using simple type polymorphism, /// and provides necessary support methods. Its interface is RTTI-neutral. -//---------------------------------------------------------------------- class ClangExpressionVariable : public ExpressionVariable { public: ClangExpressionVariable(ExecutionContextScope *exe_scope, @@ -71,12 +69,9 @@ public: const TypeFromUser &user_type, lldb::ByteOrder byte_order, uint32_t addr_byte_size); - //---------------------------------------------------------------------- /// Utility functions for dealing with ExpressionVariableLists in Clang- /// specific ways - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- /// Finds a variable by NamedDecl in the list. /// /// \param[in] name @@ -84,7 +79,6 @@ public: /// /// \return /// The variable requested, or NULL if that variable is not in the list. - //---------------------------------------------------------------------- static ClangExpressionVariable * FindVariableInList(ExpressionVariableList &list, const clang::NamedDecl *decl, uint64_t parser_id) { @@ -104,7 +98,6 @@ public: return nullptr; } - //---------------------------------------------------------------------- /// If the variable contains its own data, make a Value point at it. If \a /// exe_ctx in not NULL, the value will be resolved in with that execution /// context. @@ -118,12 +111,9 @@ public: /// \return /// True on success; false otherwise (in particular, if this variable /// does not contain its own data). - //---------------------------------------------------------------------- bool PointValueAtData(Value &value, ExecutionContext *exe_ctx); - //---------------------------------------------------------------------- /// The following values should not live beyond parsing - //---------------------------------------------------------------------- class ParserVars { public: ParserVars() @@ -148,22 +138,16 @@ private: ParserVarMap m_parser_vars; public: - //---------------------------------------------------------------------- /// Make this variable usable by the parser by allocating space for parser- /// specific variables - //---------------------------------------------------------------------- void EnableParserVars(uint64_t parser_id) { m_parser_vars.insert(std::make_pair(parser_id, ParserVars())); } - //---------------------------------------------------------------------- /// Deallocate parser-specific variables - //---------------------------------------------------------------------- void DisableParserVars(uint64_t parser_id) { m_parser_vars.erase(parser_id); } - //---------------------------------------------------------------------- /// Access parser-specific variables - //---------------------------------------------------------------------- ParserVars *GetParserVars(uint64_t parser_id) { ParserVarMap::iterator i = m_parser_vars.find(parser_id); @@ -173,9 +157,7 @@ public: return &i->second; } - //---------------------------------------------------------------------- /// The following values are valid if the variable is used by JIT code - //---------------------------------------------------------------------- struct JITVars { JITVars() : m_alignment(0), m_size(0), m_offset(0) {} @@ -191,17 +173,13 @@ private: JITVarMap m_jit_vars; public: - //---------------------------------------------------------------------- /// Make this variable usable for materializing for the JIT by allocating /// space for JIT-specific variables - //---------------------------------------------------------------------- void EnableJITVars(uint64_t parser_id) { m_jit_vars.insert(std::make_pair(parser_id, JITVars())); } - //---------------------------------------------------------------------- /// Deallocate JIT-specific variables - //---------------------------------------------------------------------- void DisableJITVars(uint64_t parser_id) { m_jit_vars.erase(parser_id); } JITVars *GetJITVars(uint64_t parser_id) { @@ -215,16 +193,12 @@ public: TypeFromUser GetTypeFromUser(); - //------------------------------------------------------------------ // llvm casting support - //------------------------------------------------------------------ static bool classof(const ExpressionVariable *ev) { return ev->getKind() == ExpressionVariable::eKindClang; } - //---------------------------------------------------------------------- /// Members - //---------------------------------------------------------------------- DISALLOW_COPY_AND_ASSIGN(ClangExpressionVariable); }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp index 2767207..eabc96a 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp @@ -42,9 +42,7 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // ClangFunctionCaller constructor -//---------------------------------------------------------------------- ClangFunctionCaller::ClangFunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &functionAddress, @@ -58,9 +56,7 @@ ClangFunctionCaller::ClangFunctionCaller(ExecutionContextScope &exe_scope, assert(m_jit_process_wp.lock()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ClangFunctionCaller::~ClangFunctionCaller() {} unsigned diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h index 4b0e586..bdcead2 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h @@ -24,7 +24,6 @@ namespace lldb_private { class ASTStructExtractor; class ClangExpressionParser; -//---------------------------------------------------------------------- /// \class ClangFunctionCaller ClangFunctionCaller.h /// "lldb/Expression/ClangFunctionCaller.h" Encapsulates a function that can /// be called. @@ -57,7 +56,6 @@ class ClangExpressionParser; /// /// Any of the methods that take arg_addr_ptr can be passed NULL, and the /// argument space will be managed for you. -//---------------------------------------------------------------------- class ClangFunctionCaller : public FunctionCaller { friend class ASTStructExtractor; @@ -72,20 +70,16 @@ class ClangFunctionCaller : public FunctionCaller { ~ClangFunctionCallerHelper() override = default; - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ ClangExpressionDeclMap *DeclMap() override { return NULL; } - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. May be /// NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) override; @@ -98,7 +92,6 @@ class ClangFunctionCaller : public FunctionCaller { }; public: - //------------------------------------------------------------------ /// Constructor /// /// \param[in] exe_scope @@ -118,7 +111,6 @@ public: /// \param[in] arg_value_list /// The default values to use when calling this function. Can /// be overridden using WriteFunctionArguments(). - //------------------------------------------------------------------ ClangFunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &function_address, @@ -126,7 +118,6 @@ public: ~ClangFunctionCaller() override; - //------------------------------------------------------------------ /// Compile the wrapper function /// /// \param[in] thread_to_use_sp @@ -139,7 +130,6 @@ public: /// /// \return /// The number of errors. - //------------------------------------------------------------------ unsigned CompileFunction(lldb::ThreadSP thread_to_use_sp, DiagnosticManager &diagnostic_manager) override; @@ -151,9 +141,7 @@ protected: const char *GetWrapperStructName() { return m_wrapper_struct_name.c_str(); } private: - //------------------------------------------------------------------ // For ClangFunctionCaller only - //------------------------------------------------------------------ // Note: the parser needs to be destructed before the execution unit, so // declare the execution unit first. diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h index 1885087..d5c8757 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h @@ -21,9 +21,7 @@ namespace lldb_private { class ClangModulesDeclVendor : public DeclVendor { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ClangModulesDeclVendor(); ~ClangModulesDeclVendor() override; @@ -34,7 +32,6 @@ public: typedef uintptr_t ModuleID; typedef std::vector<ModuleID> ModuleVector; - //------------------------------------------------------------------ /// Add a module to the list of modules to search. /// /// \param[in] module @@ -53,12 +50,10 @@ public: /// True if the module could be loaded; false if not. If the /// compiler encountered a fatal error during a previous module /// load, then this will always return false for this ModuleImporter. - //------------------------------------------------------------------ virtual bool AddModule(const SourceModule &module, ModuleVector *exported_modules, Stream &error_stream) = 0; - //------------------------------------------------------------------ /// Add all modules referred to in a given compilation unit to the list /// of modules to search. /// @@ -78,12 +73,10 @@ public: /// loaded; false if one could not be loaded. If the compiler /// encountered a fatal error during a previous module /// load, then this will always return false for this ModuleImporter. - //------------------------------------------------------------------ virtual bool AddModulesForCompileUnit(CompileUnit &cu, ModuleVector &exported_modules, Stream &error_stream) = 0; - //------------------------------------------------------------------ /// Enumerate all the macros that are defined by a given set of modules /// that are already imported. /// @@ -97,12 +90,10 @@ public: /// #define directive). #undef directives are not included; we simply /// elide any corresponding #define. If this function returns true, /// we stop the iteration immediately. - //------------------------------------------------------------------ virtual void ForEachMacro(const ModuleVector &modules, std::function<bool(const std::string &)> handler) = 0; - //------------------------------------------------------------------ /// Query whether Clang supports modules for a particular language. /// LLDB uses this to decide whether to try to find the modules loaded /// by a given compile unit. @@ -112,7 +103,6 @@ public: /// /// \return /// True if Clang has modules for the given language. - //------------------------------------------------------------------ static bool LanguageSupportsClangModules(lldb::LanguageType language); }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h index 77ecbe7..9a8108d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h @@ -18,7 +18,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangPersistentVariables ClangPersistentVariables.h /// "lldb/Expression/ClangPersistentVariables.h" Manages persistent values /// that need to be preserved between expression invocations. @@ -26,16 +25,13 @@ namespace lldb_private { /// A list of variables that can be accessed and updated by any expression. See /// ClangPersistentVariable for more discussion. Also provides an increasing, /// 0-based counter for naming result variables. -//---------------------------------------------------------------------- class ClangPersistentVariables : public PersistentExpressionState { public: ClangPersistentVariables(); ~ClangPersistentVariables() override = default; - //------------------------------------------------------------------ // llvm casting support - //------------------------------------------------------------------ static bool classof(const PersistentExpressionState *pv) { return pv->getKind() == PersistentExpressionState::eKindClang; } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp index adad54ad..42de8c4 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -686,7 +686,6 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager, return true; } -//------------------------------------------------------------------ /// Converts an absolute position inside a given code string into /// a column/line pair. /// @@ -704,7 +703,6 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager, /// \param[out] column /// The column in the line that contains the absolute position. /// The first character in a line is indexed as 0. -//------------------------------------------------------------------ static void AbsPosToLineColumnPos(size_t abs_pos, llvm::StringRef code, unsigned &line, unsigned &column) { // Reset to code position to beginning of the file. diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h index 3bfb952..7cf1553 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h @@ -28,7 +28,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangUserExpression ClangUserExpression.h /// "lldb/Expression/ClangUserExpression.h" Encapsulates a single expression /// for use with Clang @@ -37,7 +36,6 @@ namespace lldb_private { /// and as a backend for the expr command. ClangUserExpression encapsulates /// the objects needed to parse and interpret or JIT an expression. It uses /// the Clang parser to produce LLVM IR from the expression. -//---------------------------------------------------------------------- class ClangUserExpression : public LLVMUserExpression { public: /// LLVM-style RTTI support. @@ -54,10 +52,8 @@ public: ~ClangUserExpressionHelper() override = default; - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ ClangExpressionDeclMap *DeclMap() override { return m_expr_decl_map_up.get(); } @@ -69,14 +65,12 @@ public: bool keep_result_in_memory, ValueObject *ctx_obj); - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. May be /// NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) override; @@ -93,7 +87,6 @@ public: bool m_top_level; }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] expr @@ -116,7 +109,6 @@ public: /// The object (if any) in which context the expression /// must be evaluated. For details see the comment to /// `UserExpression::Evaluate`. - //------------------------------------------------------------------ ClangUserExpression(ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, @@ -125,7 +117,6 @@ public: ~ClangUserExpression() override; - //------------------------------------------------------------------ /// Parse the expression /// /// \param[in] diagnostic_manager @@ -145,7 +136,6 @@ public: /// /// \return /// True on success (no errors); false otherwise. - //------------------------------------------------------------------ bool Parse(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info) override; @@ -175,10 +165,8 @@ public: bool DidImportCxxModules() const { return m_imported_cpp_modules; } private: - //------------------------------------------------------------------ /// Populate m_in_cplusplus_method and m_in_objectivec_method based on the /// environment. - //------------------------------------------------------------------ void ScanContext(ExecutionContext &exe_ctx, lldb_private::Status &err) override; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp index 780aefd..684cffd 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp @@ -29,7 +29,6 @@ using namespace lldb_private; -//------------------------------------------------------------------ /// Constructor /// /// \param[in] text @@ -37,7 +36,6 @@ using namespace lldb_private; /// /// \param[in] name /// The name of the function, as used in the text. -//------------------------------------------------------------------ ClangUtilityFunction::ClangUtilityFunction(ExecutionContextScope &exe_scope, const char *text, const char *name) : UtilityFunction(exe_scope, text, name, eKindClangUtilityFunction) { @@ -48,7 +46,6 @@ ClangUtilityFunction::ClangUtilityFunction(ExecutionContextScope &exe_scope, ClangUtilityFunction::~ClangUtilityFunction() {} -//------------------------------------------------------------------ /// Install the utility function into a process /// /// \param[in] diagnostic_manager @@ -59,7 +56,6 @@ ClangUtilityFunction::~ClangUtilityFunction() {} /// /// \return /// True on success (no errors); false otherwise. -//------------------------------------------------------------------ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) { if (m_jit_start_addr != LLDB_INVALID_ADDRESS) { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h index d676956..70ebb2f 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangUtilityFunction ClangUtilityFunction.h /// "lldb/Expression/ClangUtilityFunction.h" Encapsulates a single expression /// for use with Clang @@ -33,7 +32,6 @@ namespace lldb_private { /// functions can perform error-checking for ClangUserExpressions, or can /// simply provide a way to push a function into the target for the debugger /// to call later on. -//---------------------------------------------------------------------- class ClangUtilityFunction : public UtilityFunction { public: /// LLVM-style RTTI support. @@ -47,10 +45,8 @@ public: ~ClangUtilityFunctionHelper() override {} - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ ClangExpressionDeclMap *DeclMap() override { return m_expr_decl_map_up.get(); } @@ -59,14 +55,12 @@ public: void ResetDeclMap(ExecutionContext &exe_ctx, bool keep_result_in_memory); - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. May be /// NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) override { return nullptr; @@ -75,7 +69,6 @@ public: private: std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map_up; }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] text @@ -83,7 +76,6 @@ public: /// /// \param[in] name /// The name of the function, as used in the text. - //------------------------------------------------------------------ ClangUtilityFunction(ExecutionContextScope &exe_scope, const char *text, const char *name); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h index de3e145..f87fd8a 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h @@ -43,7 +43,6 @@ class IRExecutionUnit; class IRMemoryMap; } -//---------------------------------------------------------------------- /// \class IRForTarget IRForTarget.h "lldb/Expression/IRForTarget.h" /// Transforms the IR for a function to run in the target /// @@ -55,12 +54,10 @@ class IRMemoryMap; /// transformations to the IR which make it relocatable. These /// transformations are discussed in more detail next to their relevant /// functions. -//---------------------------------------------------------------------- class IRForTarget : public llvm::ModulePass { public: enum class LookupResult { Success, Fail, Ignore }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] decl_map @@ -90,18 +87,14 @@ public: /// /// \param[in] func_name /// The name of the function to prepare for execution in the target. - //------------------------------------------------------------------ IRForTarget(lldb_private::ClangExpressionDeclMap *decl_map, bool resolve_vars, lldb_private::IRExecutionUnit &execution_unit, lldb_private::Stream &error_stream, const char *func_name = "$__lldb_expr"); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~IRForTarget() override; - //------------------------------------------------------------------ /// Run this IR transformer on a single module /// /// Implementation of the llvm::ModulePass::runOnModule() function. @@ -117,28 +110,22 @@ public: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool runOnModule(llvm::Module &llvm_module) override; - //------------------------------------------------------------------ /// Interface stub /// /// Implementation of the llvm::ModulePass::assignPassManager() function. - //------------------------------------------------------------------ void assignPassManager(llvm::PMStack &pass_mgr_stack, llvm::PassManagerType pass_mgr_type = llvm::PMT_ModulePassManager) override; - //------------------------------------------------------------------ /// Returns PMT_ModulePassManager /// /// Implementation of the llvm::ModulePass::getPotentialPassManagerType() /// function. - //------------------------------------------------------------------ llvm::PassManagerType getPotentialPassManagerType() const override; private: - //------------------------------------------------------------------ /// Ensures that the current function's linkage is set to external. /// Otherwise the JIT may not return an address for it. /// @@ -147,15 +134,11 @@ private: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool FixFunctionLinkage(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A module-level pass to replace all function pointers with their /// integer equivalents. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] llvm_module @@ -166,15 +149,11 @@ private: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool HasSideEffects(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A function-level pass to check whether the function has side /// effects. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Get the address of a function, and a location to put the complete Value /// of the function if one is available. /// @@ -193,18 +172,14 @@ private: /// /// \return /// The pointer. - //------------------------------------------------------------------ LookupResult GetFunctionAddress(llvm::Function *function, uint64_t &ptr, lldb_private::ConstString &name, llvm::Constant **&value_ptr); - //------------------------------------------------------------------ /// A function-level pass to take the generated global value /// $__lldb_expr_result and make it into a persistent variable. Also see /// ASTResultSynthesizer. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Find the NamedDecl corresponding to a Value. This interface is exposed /// for the IR interpreter. /// @@ -216,7 +191,6 @@ private: /// /// \return /// The corresponding variable declaration - //------------------------------------------------------------------ public: static clang::NamedDecl *DeclForGlobal(const llvm::GlobalValue *global_val, llvm::Module *module); @@ -224,7 +198,6 @@ public: private: clang::NamedDecl *DeclForGlobal(llvm::GlobalValue *global); - //------------------------------------------------------------------ /// Set the constant result variable m_const_result to the provided /// constant, assuming it can be evaluated. The result variable will be /// reset to NULL later if the expression has side effects. @@ -237,22 +210,18 @@ private: /// /// \param[in] type /// The Clang type of the result variable. - //------------------------------------------------------------------ void MaybeSetConstantResult(llvm::Constant *initializer, lldb_private::ConstString name, lldb_private::TypeFromParser type); - //------------------------------------------------------------------ /// If the IR represents a cast of a variable, set m_const_result to the /// result of the cast. The result variable will be reset to /// NULL latger if the expression has side effects. /// /// \param[in] type /// The Clang type of the result variable. - //------------------------------------------------------------------ void MaybeSetCastResult(lldb_private::TypeFromParser type); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] llvm_function @@ -260,15 +229,11 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool CreateResultVariable(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A module-level pass to find Objective-C constant strings and /// transform them to calls to CFStringCreateWithBytes. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Rewrite a single Objective-C constant string. /// /// \param[in] NSStr @@ -280,19 +245,15 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCConstString(llvm::GlobalVariable *NSStr, llvm::GlobalVariable *CStr); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCConstStrings(); - //------------------------------------------------------------------ /// A basic block-level pass to find all Objective-C method calls and /// rewrite them to use sel_registerName instead of statically allocated /// selectors. The reason is that the selectors are created on the @@ -300,9 +261,7 @@ private: /// section and prepare them. This doesn't happen when code is copied into /// the target, though, and there's no easy way to induce the runtime to /// scan them. So instead we get our selectors from sel_registerName. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Replace a single selector reference /// /// \param[in] selector_load @@ -310,10 +269,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCSelector(llvm::Instruction *selector_load); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -321,16 +278,12 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCSelectors(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A basic block-level pass to find all Objective-C class references that /// use the old-style Objective-C runtime and rewrite them to use /// class_getClass instead of statically allocated class references. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Replace a single old-style class reference /// /// \param[in] selector_load @@ -338,10 +291,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCClassReference(llvm::Instruction *class_load); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -349,10 +300,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCClassReferences(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A basic block-level pass to find all newly-declared persistent /// variables and register them with the ClangExprDeclMap. This allows them /// to be materialized and dematerialized like normal external variables. @@ -360,9 +309,7 @@ private: /// locals, so they have an allocation. This pass excises these allocations /// and makes references look like external references where they will be /// resolved -- like all other external references -- by ResolveExternals(). - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Handle a single allocation of a persistent variable /// /// \param[in] persistent_alloc @@ -370,26 +317,20 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewritePersistentAlloc(llvm::Instruction *persistent_alloc); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block /// The basic block currently being processed. - //------------------------------------------------------------------ bool RewritePersistentAllocs(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A function-level pass to find all external variables and functions /// used in the IR. Each found external variable is added to the struct, /// and each external function is resolved in place, its call replaced with /// a call to a function pointer whose value is the address of the function /// in the target process. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Write an initializer to a memory array of assumed sufficient size. /// /// \param[in] data @@ -400,10 +341,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaterializeInitializer(uint8_t *data, llvm::Constant *initializer); - //------------------------------------------------------------------ /// Move an internal variable into the static allocation section. /// /// \param[in] global_variable @@ -411,10 +350,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaterializeInternalVariable(llvm::GlobalVariable *global_variable); - //------------------------------------------------------------------ /// Handle a single externally-defined variable /// /// \param[in] value @@ -422,10 +359,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaybeHandleVariable(llvm::Value *value); - //------------------------------------------------------------------ /// Handle a single externally-defined symbol /// /// \param[in] symbol @@ -433,10 +368,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool HandleSymbol(llvm::Value *symbol); - //------------------------------------------------------------------ /// Handle a single externally-defined Objective-C class /// /// \param[in] classlist_reference @@ -445,10 +378,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool HandleObjCClass(llvm::Value *classlist_reference); - //------------------------------------------------------------------ /// Handle all the arguments to a function call /// /// \param[in] C @@ -456,10 +387,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaybeHandleCallArguments(llvm::CallInst *call_inst); - //------------------------------------------------------------------ /// Resolve variable references in calls to external functions /// /// \param[in] basic_block @@ -467,10 +396,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool ResolveCalls(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// Remove calls to __cxa_atexit, which should never be generated by /// expressions. /// @@ -480,10 +407,8 @@ private: /// \return /// True if the scan was successful; false if some operation /// failed - //------------------------------------------------------------------ bool RemoveCXAAtExit(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -491,25 +416,19 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool ResolveExternals(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A basic block-level pass to excise guard variables from the code. /// The result for the function is passed through Clang as a static /// variable. Static variables normally have guard variables to ensure that /// they are only initialized once. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Rewrite a load to a guard variable to return constant 0. /// /// \param[in] guard_load /// The load instruction to zero out. - //------------------------------------------------------------------ void TurnGuardLoadIntoZero(llvm::Instruction *guard_load); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -517,17 +436,13 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RemoveGuards(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A function-level pass to make all external variable references /// point at the correct offsets from the void* passed into the function. /// ClangExpressionDeclMap::DoStructLayout() must be called beforehand, so /// that the offsets are valid. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] llvm_function @@ -535,7 +450,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool ReplaceVariables(llvm::Function &llvm_function); /// Flags @@ -585,7 +499,6 @@ private: ///final /// location of the static allocation. - //------------------------------------------------------------------ /// UnfoldConstant operates on a constant [Old] which has just been replaced /// with a value [New]. We assume that new_value has been properly placed /// early in the function, in front of the first instruction in the entry @@ -603,7 +516,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ class FunctionValueCache { public: @@ -627,7 +539,6 @@ private: FunctionValueCache &entry_instruction_finder, lldb_private::Stream &error_stream); - //------------------------------------------------------------------ /// Construct a reference to m_reloc_placeholder with a given type and /// offset. This typically happens after inserting data into /// m_data_allocator. @@ -640,10 +551,8 @@ private: /// /// \return /// The Constant for the reference, usually a ConstantExpr. - //------------------------------------------------------------------ llvm::Constant *BuildRelocation(llvm::Type *type, uint64_t offset); - //------------------------------------------------------------------ /// Commit the allocation in m_data_allocator and use its final location to /// replace m_reloc_placeholder. /// @@ -652,7 +561,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool CompleteDataAllocation(); }; diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp index 86f5cef..46252b9 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -36,11 +36,9 @@ using namespace lldb_private; #define AlignPC(pc_val) (pc_val & 0xFFFFFFFC) -//---------------------------------------------------------------------- // // ITSession implementation // -//---------------------------------------------------------------------- static bool GetARMDWARFRegisterInfo(unsigned reg_num, RegisterInfo ®_info) { ::memset(®_info, 0, sizeof(RegisterInfo)); @@ -709,11 +707,9 @@ uint32_t ITSession::GetCond() { #define VFPv2_ABOVE (VFPv2 | VFPv3 | AdvancedSIMD) #define VFPv2v3 (VFPv2 | VFPv3) -//---------------------------------------------------------------------- // // EmulateInstructionARM implementation // -//---------------------------------------------------------------------- void EmulateInstructionARM::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), @@ -12852,9 +12848,7 @@ EmulateInstructionARM::ARMOpcode * EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, uint32_t arm_isa) { static ARMOpcode g_arm_opcodes[] = { - //---------------------------------------------------------------------- // Prologue instructions - //---------------------------------------------------------------------- // push register(s) {0x0fff0000, 0x092d0000, ARMvAll, eEncodingA1, No_VFP, eSize32, @@ -12893,9 +12887,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, {0x0fbf0f00, 0x0d2d0a00, ARMV6T2_ABOVE, eEncodingA2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPUSH, "vpush.32 <list>"}, - //---------------------------------------------------------------------- // Epilogue instructions - //---------------------------------------------------------------------- {0x0fff0000, 0x08bd0000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulatePOP, "pop <registers>"}, @@ -12906,15 +12898,11 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, {0x0fbf0f00, 0x0cbd0a00, ARMV6T2_ABOVE, eEncodingA2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPOP, "vpop.32 <list>"}, - //---------------------------------------------------------------------- // Supervisor Call (previously Software Interrupt) - //---------------------------------------------------------------------- {0x0f000000, 0x0f000000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSVC, "svc #imm24"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- // To resolve ambiguity, "blx <label>" should come before "b #imm24" and // "bl <label>". {0xfe000000, 0xfa000000, ARMV5_ABOVE, eEncodingA2, No_VFP, eSize32, @@ -12932,9 +12920,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, {0x0ffffff0, 0x012fff20, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateBXJRm, "bxj <Rm>"}, - //---------------------------------------------------------------------- // Data-processing instructions - //---------------------------------------------------------------------- // adc (immediate) {0x0fe00000, 0x02a00000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADCImm, "adc{s}<c> <Rd>, <Rn>, #const"}, @@ -13098,9 +13084,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateSUBSPcLrEtc, "<opc>S<c> PC,<Rn>,<Rm{,<shift>}"}, - //---------------------------------------------------------------------- // Load instructions - //---------------------------------------------------------------------- {0x0fd00000, 0x08900000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDM, "ldm<c> <Rn>{!} <registers>"}, {0x0fd00000, 0x08100000, ARMvAll, eEncodingA1, No_VFP, eSize32, @@ -13165,9 +13149,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVLD1SingleAll, "vld1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Store instructions - //---------------------------------------------------------------------- {0x0fd00000, 0x08800000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTM, "stm<c> <Rn>{!} <registers>"}, {0x0fd00000, 0x08000000, ARMvAll, eEncodingA1, No_VFP, eSize32, @@ -13211,9 +13193,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVST1Single, "vst1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Other instructions - //---------------------------------------------------------------------- {0x0fff00f0, 0x06af00f0, ARMV6_ABOVE, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSXTB, "sxtb<c> <Rd>,<Rm>{,<rotation>}"}, {0x0fff00f0, 0x06bf0070, ARMV6_ABOVE, eEncodingA1, No_VFP, eSize32, @@ -13241,9 +13221,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, uint32_t arm_isa) { static ARMOpcode g_thumb_opcodes[] = { - //---------------------------------------------------------------------- // Prologue instructions - //---------------------------------------------------------------------- // push register(s) {0xfffffe00, 0x0000b400, ARMvAll, eEncodingT1, No_VFP, eSize16, @@ -13287,9 +13265,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffbf0f00, 0xed2d0a00, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPUSH, "vpush.32 <list>"}, - //---------------------------------------------------------------------- // Epilogue instructions - //---------------------------------------------------------------------- {0xfffff800, 0x0000a800, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateADDSPImm, "add<c> <Rd>, sp, #imm"}, @@ -13306,15 +13282,11 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffbf0f00, 0xecbd0a00, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPOP, "vpop.32 <list>"}, - //---------------------------------------------------------------------- // Supervisor Call (previously Software Interrupt) - //---------------------------------------------------------------------- {0xffffff00, 0x0000df00, ARMvAll, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateSVC, "svc #imm8"}, - //---------------------------------------------------------------------- // If Then makes up to four following instructions conditional. - //---------------------------------------------------------------------- // The next 5 opcode _must_ come before the if then instruction {0xffffffff, 0x0000bf00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateNop, "nop"}, @@ -13329,9 +13301,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffffff00, 0x0000bf00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateIT, "it{<x>{<y>{<z>}}} <firstcond>"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- // To resolve ambiguity, "b<c> #imm8" should come after "svc #imm8". {0xfffff000, 0x0000d000, ARMvAll, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateB, "b<c> #imm8 (outside IT)"}, @@ -13366,9 +13336,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xfff0fff0, 0xe8d0f010, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateTB, "tbh<c> <Rn>, <Rm>, lsl #1"}, - //---------------------------------------------------------------------- // Data-processing instructions - //---------------------------------------------------------------------- // adc (immediate) {0xfbe08000, 0xf1400000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADCImm, "adc{s}<c> <Rd>, <Rn>, #<const>"}, @@ -13596,20 +13564,16 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffffff00, 0xf3de8f00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSUBSPcLrEtc, "SUBS<c> PC, LR, #<imm8>"}, - //---------------------------------------------------------------------- // 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<c> <Rn>{!}"}, {0xffd0ffff, 0xe990c000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfe{ia}<c> <Rn>{!}"}, - //---------------------------------------------------------------------- // Load instructions - //---------------------------------------------------------------------- {0xfffff800, 0x0000c800, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateLDM, "ldm<c> <Rn>{!} <registers>"}, {0xffd02000, 0xe8900000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, @@ -13717,9 +13681,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVLD1SingleAll, "vld1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Store instructions - //---------------------------------------------------------------------- {0xfffff800, 0x0000c000, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateSTM, "stm<c> <Rn>{!} <registers>"}, {0xffd00000, 0xe8800000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, @@ -13776,9 +13738,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVST1Single, "vst1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Other instructions - //---------------------------------------------------------------------- {0xffffffc0, 0x0000b240, ARMV6_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateSXTB, "sxtb<c> <Rd>,<Rm>"}, {0xfffff080, 0xfa4ff080, ARMV6_ABOVE, eEncodingT2, No_VFP, eSize32, diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp index 978eab1..c30d9bc 100644 --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -117,11 +117,9 @@ ConstrainUnpredictable(EmulateInstructionARM64::Unpredictable which) { return result; } -//---------------------------------------------------------------------- // // EmulateInstructionARM implementation // -//---------------------------------------------------------------------- void EmulateInstructionARM64::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), @@ -207,9 +205,7 @@ bool EmulateInstructionARM64::GetRegisterInfo(RegisterKind reg_kind, EmulateInstructionARM64::Opcode * EmulateInstructionARM64::GetOpcodeForInstruction(const uint32_t opcode) { static EmulateInstructionARM64::Opcode g_opcodes[] = { - //---------------------------------------------------------------------- // Prologue instructions - //---------------------------------------------------------------------- // push register(s) {0xff000000, 0xd1000000, No_VFP, diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp index b1fbe32..b5a6578 100644 --- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -42,11 +42,9 @@ using namespace lldb_private; #define UInt(x) ((uint64_t)x) #define integer int64_t -//---------------------------------------------------------------------- // // EmulateInstructionMIPS implementation // -//---------------------------------------------------------------------- #ifdef __mips__ extern "C" { @@ -677,9 +675,7 @@ bool EmulateInstructionMIPS::GetRegisterInfo(RegisterKind reg_kind, EmulateInstructionMIPS::MipsOpcode * EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { static EmulateInstructionMIPS::MipsOpcode g_opcodes[] = { - //---------------------------------------------------------------------- // Prologue/Epilogue instructions - //---------------------------------------------------------------------- {"ADDiu", &EmulateInstructionMIPS::Emulate_ADDiu, "ADDIU rt, rs, immediate"}, {"SW", &EmulateInstructionMIPS::Emulate_SW, "SW rt, offset(rs)"}, @@ -688,9 +684,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"ADDU", &EmulateInstructionMIPS::Emulate_SUBU_ADDU, "ADDU rd, rs, rt"}, {"LUI", &EmulateInstructionMIPS::Emulate_LUI, "LUI rt, immediate"}, - //---------------------------------------------------------------------- // MicroMIPS Prologue/Epilogue instructions - //---------------------------------------------------------------------- {"ADDIUSP_MM", &EmulateInstructionMIPS::Emulate_ADDIUSP, "ADDIU immediate"}, {"ADDIUS5_MM", &EmulateInstructionMIPS::Emulate_ADDIUS5, @@ -711,10 +705,8 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { "LWP rd,offset(base)"}, {"JRADDIUSP", &EmulateInstructionMIPS::Emulate_JRADDIUSP, "JRADDIUSP immediate"}, - //---------------------------------------------------------------------- // Load/Store instructions - //---------------------------------------------------------------------- /* Following list of emulated instructions are required by implementation of hardware watchpoint for MIPS in lldb. As we just need the address accessed by instructions, @@ -834,9 +826,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"SCDX", &EmulateInstructionMIPS::Emulate_LDST_Imm, "SCDX rt, offset(base)"}, - //---------------------------------------------------------------------- // MicroMIPS Load/Store instructions - //---------------------------------------------------------------------- {"LBU16_MM", &EmulateInstructionMIPS::Emulate_LDST_Imm, "LBU16 rt, decoded_offset(base)"}, {"LHU16_MM", &EmulateInstructionMIPS::Emulate_LDST_Imm, @@ -854,9 +844,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"SB16_MM", &EmulateInstructionMIPS::Emulate_LDST_Imm, "SB16 rt, offset(base)"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- {"BEQ", &EmulateInstructionMIPS::Emulate_BXX_3ops, "BEQ rs,rt,offset"}, {"BNE", &EmulateInstructionMIPS::Emulate_BXX_3ops, "BNE rs,rt,offset"}, {"BEQL", &EmulateInstructionMIPS::Emulate_BXX_3ops, "BEQL rs,rt,offset"}, @@ -948,9 +936,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"BNZ_V", &EmulateInstructionMIPS::Emulate_BNZV, "BNZ.V wt,s16"}, {"BZ_V", &EmulateInstructionMIPS::Emulate_BZV, "BZ.V wt,s16"}, - //---------------------------------------------------------------------- // MicroMIPS Branch instructions - //---------------------------------------------------------------------- {"B16_MM", &EmulateInstructionMIPS::Emulate_B16_MM, "B16 offset"}, {"BEQZ16_MM", &EmulateInstructionMIPS::Emulate_Branch_MM, "BEQZ16 rs, offset"}, diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp index 3eacb66..7c1044c 100644 --- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -42,11 +42,9 @@ using namespace lldb_private; #define UInt(x) ((uint64_t)x) #define integer int64_t -//---------------------------------------------------------------------- // // EmulateInstructionMIPS64 implementation // -//---------------------------------------------------------------------- #ifdef __mips__ extern "C" { @@ -664,9 +662,7 @@ bool EmulateInstructionMIPS64::GetRegisterInfo(RegisterKind reg_kind, EmulateInstructionMIPS64::MipsOpcode * EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) { static EmulateInstructionMIPS64::MipsOpcode g_opcodes[] = { - //---------------------------------------------------------------------- // Prologue/Epilogue instructions - //---------------------------------------------------------------------- {"DADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, "DADDIU rt, rs, immediate"}, {"ADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, @@ -683,9 +679,7 @@ EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) { "ADDU rd, rs, rt"}, {"LUI", &EmulateInstructionMIPS64::Emulate_LUI, "LUI rt, immediate"}, - //---------------------------------------------------------------------- // Load/Store instructions - //---------------------------------------------------------------------- /* Following list of emulated instructions are required by implementation of hardware watchpoint for MIPS in lldb. As we just need the address accessed by instructions, @@ -791,9 +785,7 @@ EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) { {"SWXC1", &EmulateInstructionMIPS64::Emulate_LDST_Reg, "SWXC1 fs, index (base)"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- {"BEQ", &EmulateInstructionMIPS64::Emulate_BXX_3ops, "BEQ rs,rt,offset"}, {"BEQ64", &EmulateInstructionMIPS64::Emulate_BXX_3ops, "BEQ rs,rt,offset"}, {"BNE", &EmulateInstructionMIPS64::Emulate_BXX_3ops, "BNE rs,rt,offset"}, diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp index a98f860..4fbdd22 100644 --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -34,9 +34,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Debug Interface Structures -//------------------------------------------------------------------ typedef enum { JIT_NOACTION = 0, JIT_REGISTER_FN, @@ -177,9 +175,7 @@ void JITLoaderGDB::ModulesDidLoad(ModuleList &module_list) { SetJITBreakpoint(module_list); } -//------------------------------------------------------------------ // Setup the JIT Breakpoint -//------------------------------------------------------------------ void JITLoaderGDB::SetJITBreakpoint(lldb_private::ModuleList &module_list) { if (DidSetJITBreakpoint()) return; @@ -405,9 +401,7 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) { return false; // Continue Running. } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString JITLoaderGDB::GetPluginNameStatic() { static ConstString g_name("gdb"); return g_name; diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h index e9938d4..2a2537c 100644 --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h @@ -20,9 +20,7 @@ public: ~JITLoaderGDB() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -36,16 +34,12 @@ public: static void DebuggerInitialize(lldb_private::Debugger &debugger); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // JITLoader interface - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 3256245..d7232bd 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -56,9 +56,7 @@ lldb_private::ConstString CPlusPlusLanguage::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString CPlusPlusLanguage::GetPluginName() { return GetPluginNameStatic(); @@ -66,9 +64,7 @@ lldb_private::ConstString CPlusPlusLanguage::GetPluginName() { uint32_t CPlusPlusLanguage::GetPluginVersion() { return 1; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ Language *CPlusPlusLanguage::CreateInstance(lldb::LanguageType language) { if (Language::LanguageIsCPlusPlus(language)) diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h index c6792e9..d30e560 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h @@ -92,9 +92,7 @@ public: const Highlighter *GetHighlighter() const override { return &m_highlighter; } - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -127,9 +125,7 @@ public: FindAlternateFunctionManglings(const ConstString mangled, std::set<ConstString> &candidates); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp index 762d917..ad295341 100644 --- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp +++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp @@ -48,9 +48,7 @@ lldb_private::ConstString ObjCLanguage::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjCLanguage::GetPluginName() { return GetPluginNameStatic(); @@ -58,9 +56,7 @@ lldb_private::ConstString ObjCLanguage::GetPluginName() { uint32_t ObjCLanguage::GetPluginVersion() { return 1; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ Language *ObjCLanguage::CreateInstance(lldb::LanguageType language) { switch (language) { diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h index aed867e..8699060 100644 --- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h +++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h @@ -123,9 +123,7 @@ public: const Highlighter *GetHighlighter() const override { return &m_highlighter; } - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -154,9 +152,7 @@ public: return false; } - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp index 69e8251..81b3c58 100644 --- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp @@ -38,18 +38,14 @@ lldb_private::ConstString ObjCPlusPlusLanguage::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjCPlusPlusLanguage::GetPluginName() { return GetPluginNameStatic(); } uint32_t ObjCPlusPlusLanguage::GetPluginVersion() { return 1; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ Language *ObjCPlusPlusLanguage::CreateInstance(lldb::LanguageType language) { switch (language) { case lldb::eLanguageTypeObjC_plus_plus: diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h index 6f801d0..6224a3f 100644 --- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h +++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h @@ -31,9 +31,7 @@ public: const Highlighter *GetHighlighter() const override { return &m_highlighter; } - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -42,9 +40,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index d702f7c..66278ca 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -313,9 +313,7 @@ bool ItaniumABILanguageRuntime::IsVTableName(const char *name) { return strstr(name, "_vptr$") == name; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ LanguageRuntime * ItaniumABILanguageRuntime::CreateInstance(Process *process, lldb::LanguageType language) { @@ -427,9 +425,7 @@ lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h index 1507da9..80b53ef 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h @@ -26,9 +26,7 @@ class ItaniumABILanguageRuntime : public lldb_private::CPPLanguageRuntime { public: ~ItaniumABILanguageRuntime() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -68,9 +66,7 @@ public: lldb::ValueObjectSP GetExceptionObjectForThread( lldb::ThreadSP thread_sp) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 96addf4..419f209 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -343,9 +343,7 @@ ThreadPlanSP AppleObjCRuntime::GetStepThroughTrampolinePlan(Thread &thread, return thread_plan_sp; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ObjCLanguageRuntime::ObjCRuntimeVersions AppleObjCRuntime::GetObjCVersion(Process *process, ModuleSP &objc_module_sp) { if (!process) diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h index bd72cd7..fe716bb 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h @@ -23,9 +23,7 @@ class AppleObjCRuntime : public lldb_private::ObjCLanguageRuntime { public: ~AppleObjCRuntime() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ // Note there is no CreateInstance, Initialize & Terminate functions here, // because // you can't make an instance of this generic runtime. diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 1b17782..116f4d7 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -61,9 +61,7 @@ bool AppleObjCRuntimeV1::GetDynamicTypeAndAddress( return !class_type_or_name.IsEmpty(); } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ lldb_private::LanguageRuntime * AppleObjCRuntimeV1::CreateInstance(Process *process, lldb::LanguageType language) { @@ -97,9 +95,7 @@ lldb_private::ConstString AppleObjCRuntimeV1::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString AppleObjCRuntimeV1::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h index 47214ff..8536496 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h @@ -19,9 +19,7 @@ class AppleObjCRuntimeV1 : public AppleObjCRuntime { public: ~AppleObjCRuntimeV1() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -99,9 +97,7 @@ public: UtilityFunction *CreateObjectChecker(const char *) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 1264b63..49e3e87 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -453,9 +453,7 @@ bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress( return !class_type_or_name.IsEmpty(); } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ LanguageRuntime *AppleObjCRuntimeV2::CreateInstance(Process *process, LanguageType language) { // FIXME: This should be a MacOS or iOS process, and we need to look for the @@ -785,9 +783,7 @@ lldb_private::ConstString AppleObjCRuntimeV2::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString AppleObjCRuntimeV2::GetPluginName() { return GetPluginNameStatic(); } @@ -868,20 +864,16 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type, const char *class_name = parent_ast_type.GetConstTypeName().AsCString(); if (class_name && class_name[0] && ivar_name && ivar_name[0]) { - //---------------------------------------------------------------------- // Make the objective C V2 mangled name for the ivar offset from the class // name and ivar name - //---------------------------------------------------------------------- std::string buffer("OBJC_IVAR_$_"); buffer.append(class_name); buffer.push_back('.'); buffer.append(ivar_name); ConstString ivar_const_str(buffer.c_str()); - //---------------------------------------------------------------------- // Try to get the ivar offset address from the symbol table first using the // name we created above - //---------------------------------------------------------------------- SymbolContextList sc_list; Target &target = m_process->GetTarget(); target.GetImages().FindSymbolsWithNameAndType(ivar_const_str, @@ -898,10 +890,8 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type, ivar_offset_symbol.symbol->GetLoadAddress(&target); } - //---------------------------------------------------------------------- // If we didn't get the ivar offset address from the symbol table, fall // back to getting it from the runtime - //---------------------------------------------------------------------- if (ivar_offset_address == LLDB_INVALID_ADDRESS) ivar_offset_address = LookupRuntimeSymbol(ivar_const_str); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h index 5a4fc69..dc58852 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -25,9 +25,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime { public: ~AppleObjCRuntimeV2() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -55,9 +53,7 @@ public: UtilityFunction *CreateObjectChecker(const char *) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp index bbfd807..3436464 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp @@ -1,5 +1,4 @@ //===-- AppleThreadPlanStepThroughObjCTrampoline.cpp -//--------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -26,9 +25,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepThroughObjCTrampoline constructor -//---------------------------------------------------------------------- AppleThreadPlanStepThroughObjCTrampoline:: AppleThreadPlanStepThroughObjCTrampoline( Thread &thread, AppleObjCTrampolineHandler *trampoline_handler, @@ -42,9 +39,7 @@ AppleThreadPlanStepThroughObjCTrampoline:: m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(NULL), m_stop_others(stop_others) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- AppleThreadPlanStepThroughObjCTrampoline:: ~AppleThreadPlanStepThroughObjCTrampoline() {} diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 81551e7..0ea4d91 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -790,9 +790,7 @@ const uint32_t RenderScriptRuntime::AllocationDetails::RSTypeToFormat[][3] = { // RS_TYPE_MATRIX_2X2 {eFormatVectorOfFloat32, eFormatVectorOfFloat32, sizeof(float) * 4}}; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ LanguageRuntime * RenderScriptRuntime::CreateInstance(Process *process, lldb::LanguageType language) { @@ -1030,9 +1028,7 @@ void RenderScriptRuntime::ModulesDidLoad(const ModuleList &module_list) { } } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString RenderScriptRuntime::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h index d416b92..c3114b9 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -301,9 +301,7 @@ public: ~RenderScriptRuntime() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -395,9 +393,7 @@ public: return false; } - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index a52c001..c364dd0 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -436,9 +436,7 @@ ObjectFileSP ObjectContainerBSDArchive::GetObjectFile(const FileSpec *file) { return ObjectFileSP(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectContainerBSDArchive::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h index 13afb98..84ddd05 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -31,9 +31,7 @@ public: ~ObjectContainerBSDArchive() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -56,9 +54,7 @@ public: static bool MagicBytesMatch(const lldb_private::DataExtractor &data); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; size_t GetNumObjects() const override { @@ -71,9 +67,7 @@ public: lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; @@ -153,9 +147,7 @@ protected: protected: typedef lldb_private::UniqueCStringMap<uint32_t> ObjectNameToIndexMap; - //---------------------------------------------------------------------- // Member Variables - //---------------------------------------------------------------------- lldb_private::ArchSpec m_arch; llvm::sys::TimePoint<> m_time; lldb::offset_t m_file_offset; diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index 9e4dc5a..c392add 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -202,9 +202,7 @@ ObjectContainerUniversalMachO::GetObjectFile(const FileSpec *file) { return ObjectFileSP(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectContainerUniversalMachO::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h index e2377fd..5130497 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h @@ -23,9 +23,7 @@ public: ~ObjectContainerUniversalMachO() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -48,9 +46,7 @@ public: static bool MagicBytesMatch(const lldb_private::DataExtractor &data); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; void Dump(lldb_private::Stream *s) const override; @@ -62,9 +58,7 @@ public: lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h index 1593081..e8885e0 100644 --- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h +++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h @@ -17,9 +17,7 @@ namespace breakpad { class ObjectFileBreakpad : public ObjectFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -45,16 +43,12 @@ public: lldb::offset_t length, ModuleSpecList &specs); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------------ // ObjectFile Protocol. - //------------------------------------------------------------------ bool ParseHeader() override; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp index 13d85d1..7f9665a 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp @@ -18,7 +18,6 @@ using namespace elf; using namespace lldb; using namespace llvm::ELF; -//------------------------------------------------------------------------------ // Static utility functions. // // GetMaxU64 and GetMaxS64 wrap the similarly named methods from DataExtractor @@ -67,7 +66,6 @@ static bool GetMaxS64(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFHeader ELFHeader::ELFHeader() { memset(this, 0, sizeof(ELFHeader)); } @@ -215,7 +213,6 @@ unsigned ELFHeader::GetRelocationJumpSlotType() const { return slot; } -//------------------------------------------------------------------------------ // ELFSectionHeader ELFSectionHeader::ELFSectionHeader() { @@ -249,7 +246,6 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFSymbol ELFSymbol::ELFSymbol() { memset(this, 0, sizeof(ELFSymbol)); } @@ -357,7 +353,6 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFProgramHeader ELFProgramHeader::ELFProgramHeader() { @@ -398,7 +393,6 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFDynamic ELFDynamic::ELFDynamic() { memset(this, 0, sizeof(ELFDynamic)); } @@ -409,7 +403,6 @@ bool ELFDynamic::Parse(const lldb_private::DataExtractor &data, return GetMaxS64(data, offset, &d_tag, byte_size, 2); } -//------------------------------------------------------------------------------ // ELFRel ELFRel::ELFRel() { memset(this, 0, sizeof(ELFRel)); } @@ -422,7 +415,6 @@ bool ELFRel::Parse(const lldb_private::DataExtractor &data, return GetMaxU64(data, offset, &r_offset, byte_size, 2) != false; } -//------------------------------------------------------------------------------ // ELFRela ELFRela::ELFRela() { memset(this, 0, sizeof(ELFRela)); } diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h index 2a2b132..bb228e2 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h @@ -31,7 +31,6 @@ class DataExtractor; namespace elf { -//------------------------------------------------------------------------------ /// \name ELF type definitions. /// /// Types used to represent the various components of ELF structures. All @@ -49,7 +48,6 @@ typedef uint64_t elf_xword; typedef int64_t elf_sxword; //@} -//------------------------------------------------------------------------------ /// \class ELFHeader /// Generic representation of an ELF file header. /// @@ -80,7 +78,6 @@ struct ELFHeader { ELFHeader(); - //-------------------------------------------------------------------------- /// Returns true if this is a 32 bit ELF file header. /// /// \return @@ -89,7 +86,6 @@ struct ELFHeader { return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS32; } - //-------------------------------------------------------------------------- /// Returns true if this is a 64 bit ELF file header. /// /// \return @@ -98,18 +94,15 @@ struct ELFHeader { return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS64; } - //-------------------------------------------------------------------------- /// The byte order of this ELF file header. /// /// \return /// The byte order of this ELF file as described by the header. lldb::ByteOrder GetByteOrder() const; - //-------------------------------------------------------------------------- /// The jump slot relocation type of this ELF. unsigned GetRelocationJumpSlotType() const; - //-------------------------------------------------------------------------- /// Check if there should be header extension in section header #0 /// /// \return @@ -117,7 +110,6 @@ struct ELFHeader { /// and false otherwise. bool HasHeaderExtension() const; - //-------------------------------------------------------------------------- /// Parse an ELFHeader entry starting at position \p offset and update the /// data extractor with the address size and byte order attributes as /// defined by the header. @@ -135,7 +127,6 @@ struct ELFHeader { /// otherwise. bool Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset); - //-------------------------------------------------------------------------- /// Examines at most EI_NIDENT bytes starting from the given pointer and /// determines if the magic ELF identification exists. /// @@ -143,7 +134,6 @@ struct ELFHeader { /// True if the given sequence of bytes identifies an ELF file. static bool MagicBytesMatch(const uint8_t *magic); - //-------------------------------------------------------------------------- /// Examines at most EI_NIDENT bytes starting from the given address and /// determines the address size of the underlying ELF file. This function /// should only be called on an pointer for which MagicBytesMatch returns @@ -156,7 +146,6 @@ struct ELFHeader { private: - //-------------------------------------------------------------------------- /// Parse an ELFHeader header extension entry. This method is called by /// Parse(). /// @@ -165,7 +154,6 @@ private: void ParseHeaderExtension(lldb_private::DataExtractor &data); }; -//------------------------------------------------------------------------------ /// \class ELFSectionHeader /// Generic representation of an ELF section header. struct ELFSectionHeader { @@ -182,7 +170,6 @@ struct ELFSectionHeader { ELFSectionHeader(); - //-------------------------------------------------------------------------- /// Parse an ELFSectionHeader entry from the given DataExtracter starting at /// position \p offset. /// @@ -200,7 +187,6 @@ struct ELFSectionHeader { bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); }; -//------------------------------------------------------------------------------ /// \class ELFProgramHeader /// Generic representation of an ELF program header. struct ELFProgramHeader { @@ -233,7 +219,6 @@ struct ELFProgramHeader { bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); }; -//------------------------------------------------------------------------------ /// \class ELFSymbol /// Represents a symbol within an ELF symbol table. struct ELFSymbol { @@ -286,7 +271,6 @@ struct ELFSymbol { const lldb_private::SectionList *section_list); }; -//------------------------------------------------------------------------------ /// \class ELFDynamic /// Represents an entry in an ELF dynamic table. struct ELFDynamic { @@ -316,7 +300,6 @@ struct ELFDynamic { bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); }; -//------------------------------------------------------------------------------ /// \class ELFRel /// Represents a relocation entry with an implicit addend. struct ELFRel { @@ -358,7 +341,6 @@ struct ELFRel { static unsigned RelocSymbol64(const ELFRel &rel) { return rel.r_info >> 32; } }; -//------------------------------------------------------------------------------ /// \class ELFRela /// Represents a relocation entry with an explicit addend. struct ELFRela { diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d3a7823..ac9642b 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -336,9 +336,7 @@ static uint32_t subTypeFromElfHeader(const elf::ELFHeader &header) { // Arbitrary constant used as UUID prefix for core files. const uint32_t ObjectFileELF::g_core_uuid_magic(0xE210C); -//------------------------------------------------------------------ // Static methods. -//------------------------------------------------------------------ void ObjectFileELF::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance, @@ -711,17 +709,13 @@ size_t ObjectFileELF::GetModuleSpecifications( return specs.GetSize() - initial_count; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectFileELF::GetPluginName() { return GetPluginNameStatic(); } uint32_t ObjectFileELF::GetPluginVersion() { return m_plugin_version; } -//------------------------------------------------------------------ // ObjectFile protocol -//------------------------------------------------------------------ ObjectFileELF::ObjectFileELF(const lldb::ModuleSP &module_sp, DataBufferSP &data_sp, lldb::offset_t data_offset, @@ -1009,9 +1003,7 @@ Address ObjectFileELF::GetBaseAddress() { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // ParseDependentModules -//---------------------------------------------------------------------- size_t ObjectFileELF::ParseDependentModules() { if (m_filespec_up) return m_filespec_up->GetSize(); @@ -1070,9 +1062,7 @@ size_t ObjectFileELF::ParseDependentModules() { return m_filespec_up->GetSize(); } -//---------------------------------------------------------------------- // GetProgramHeaderInfo -//---------------------------------------------------------------------- size_t ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers, DataExtractor &object_data, const ELFHeader &header) { @@ -1107,9 +1097,7 @@ size_t ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers, return program_headers.size(); } -//---------------------------------------------------------------------- // ParseProgramHeaders -//---------------------------------------------------------------------- bool ObjectFileELF::ParseProgramHeaders() { return GetProgramHeaderInfo(m_program_headers, m_data, m_header) != 0; } @@ -1302,8 +1290,6 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data, // the contents look like this in a 64 bit ELF core file: count = // 0x000000000000000a (10) page_size = 0x0000000000001000 (4096) Index // start end file_ofs path ===== - // ------------------ ------------------ ------------------ - // ------------------------------------- [ 0] 0x0000000000400000 // 0x0000000000401000 0x0000000000000000 /tmp/a.out [ 1] // 0x0000000000600000 0x0000000000601000 0x0000000000000000 /tmp/a.out [ // 2] 0x0000000000601000 0x0000000000602000 0x0000000000000001 /tmp/a.out @@ -1427,9 +1413,7 @@ void ObjectFileELF::ParseARMAttributes(DataExtractor &data, uint64_t length, } } -//---------------------------------------------------------------------- // GetSectionHeaderInfo -//---------------------------------------------------------------------- size_t ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, DataExtractor &object_data, const elf::ELFHeader &header, @@ -1662,9 +1646,7 @@ ObjectFileELF::StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const { return symbol_name.substr(0, pos); } -//---------------------------------------------------------------------- // ParseSectionHeaders -//---------------------------------------------------------------------- size_t ObjectFileELF::ParseSectionHeaders() { return GetSectionHeaderInfo(m_section_headers, m_data, m_header, m_uuid, m_gnu_debuglink_file, m_gnu_debuglink_crc, @@ -2932,7 +2914,6 @@ bool ObjectFileELF::IsStripped() { // // Dump the specifics of the runtime file container (such as any headers // segments, sections, etc). -//---------------------------------------------------------------------- void ObjectFileELF::Dump(Stream *s) { ModuleSP module_sp(GetModule()); if (!module_sp) { @@ -2966,11 +2947,9 @@ void ObjectFileELF::Dump(Stream *s) { s->EOL(); } -//---------------------------------------------------------------------- // DumpELFHeader // // Dump the ELF header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFHeader(Stream *s, const ELFHeader &header) { s->PutCString("ELF Header\n"); s->Printf("e_ident[EI_MAG0 ] = 0x%2.2x\n", header.e_ident[EI_MAG0]); @@ -3003,11 +2982,9 @@ void ObjectFileELF::DumpELFHeader(Stream *s, const ELFHeader &header) { s->Printf("e_shstrndx = 0x%8.8x\n", header.e_shstrndx); } -//---------------------------------------------------------------------- // DumpELFHeader_e_type // // Dump an token value for the ELF header member e_type -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFHeader_e_type(Stream *s, elf_half e_type) { switch (e_type) { case ET_NONE: @@ -3030,11 +3007,9 @@ void ObjectFileELF::DumpELFHeader_e_type(Stream *s, elf_half e_type) { } } -//---------------------------------------------------------------------- // DumpELFHeader_e_ident_EI_DATA // // Dump an token value for the ELF header member e_ident[EI_DATA] -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA(Stream *s, unsigned char ei_data) { switch (ei_data) { @@ -3052,11 +3027,9 @@ void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA(Stream *s, } } -//---------------------------------------------------------------------- // DumpELFProgramHeader // // Dump a single ELF program header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeader(Stream *s, const ELFProgramHeader &ph) { DumpELFProgramHeader_p_type(s, ph.p_type); @@ -3069,12 +3042,10 @@ void ObjectFileELF::DumpELFProgramHeader(Stream *s, s->Printf(") %8.8" PRIx64, ph.p_align); } -//---------------------------------------------------------------------- // DumpELFProgramHeader_p_type // // Dump an token value for the ELF program header member p_type which describes // the type of the program header -// ---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) { const int kStrWidth = 15; switch (p_type) { @@ -3093,11 +3064,9 @@ void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) { } } -//---------------------------------------------------------------------- // DumpELFProgramHeader_p_flags // // Dump an token value for the ELF program header member p_flags -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeader_p_flags(Stream *s, elf_word p_flags) { *s << ((p_flags & PF_X) ? "PF_X" : " ") << (((p_flags & PF_X) && (p_flags & PF_W)) ? '+' : ' ') @@ -3106,11 +3075,9 @@ void ObjectFileELF::DumpELFProgramHeader_p_flags(Stream *s, elf_word p_flags) { << ((p_flags & PF_R) ? "PF_R" : " "); } -//---------------------------------------------------------------------- // DumpELFProgramHeaders // // Dump all of the ELF program header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeaders(Stream *s) { if (!ParseProgramHeaders()) return; @@ -3128,11 +3095,9 @@ void ObjectFileELF::DumpELFProgramHeaders(Stream *s) { } } -//---------------------------------------------------------------------- // DumpELFSectionHeader // // Dump a single ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeader(Stream *s, const ELFSectionHeaderInfo &sh) { s->Printf("%8.8x ", sh.sh_name); @@ -3145,12 +3110,10 @@ void ObjectFileELF::DumpELFSectionHeader(Stream *s, s->Printf(" %8.8" PRIx64 " %8.8" PRIx64, sh.sh_addralign, sh.sh_entsize); } -//---------------------------------------------------------------------- // DumpELFSectionHeader_sh_type // // Dump an token value for the ELF section header member sh_type which // describes the type of the section -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) { const int kStrWidth = 12; switch (sh_type) { @@ -3176,11 +3139,9 @@ void ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) { } } -//---------------------------------------------------------------------- // DumpELFSectionHeader_sh_flags // // Dump an token value for the ELF section header member sh_flags -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, elf_xword sh_flags) { *s << ((sh_flags & SHF_WRITE) ? "WRITE" : " ") @@ -3190,11 +3151,9 @@ void ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, << ((sh_flags & SHF_EXECINSTR) ? "EXECINSTR" : " "); } -//---------------------------------------------------------------------- // DumpELFSectionHeaders // // Dump all of the ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeaders(Stream *s) { if (!ParseSectionHeaders()) return; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index b11a4bd..b63a5d1 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -49,7 +49,6 @@ struct ELFNote { } }; -//------------------------------------------------------------------------------ /// \class ObjectFileELF /// Generic ELF object file reader. /// @@ -59,9 +58,7 @@ class ObjectFileELF : public lldb_private::ObjectFile { public: ~ObjectFileELF() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -89,16 +86,12 @@ public: static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // ObjectFile Protocol. - //------------------------------------------------------------------ bool ParseHeader() override; bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp index 6dd72a3c..ad15f96 100644 --- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -194,9 +194,7 @@ ArchSpec ObjectFileJIT::GetArchitecture() { return ArchSpec(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectFileJIT::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h index 694bbcd..9924112 100644 --- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h +++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h @@ -12,10 +12,8 @@ #include "lldb/Core/Address.h" #include "lldb/Symbol/ObjectFile.h" -//---------------------------------------------------------------------- // This class needs to be hidden as eventually belongs in a plugin that // will export the ObjectFile protocol -//---------------------------------------------------------------------- class ObjectFileJIT : public lldb_private::ObjectFile { public: ObjectFileJIT(const lldb::ModuleSP &module_sp, @@ -23,9 +21,7 @@ public: ~ObjectFileJIT() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -50,9 +46,7 @@ public: lldb::offset_t length, lldb_private::ModuleSpecList &specs); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, @@ -94,9 +88,7 @@ public: ObjectFile::Strata CalculateStrata() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index bdc4e19..b6db8d7 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -3104,9 +3104,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLocal; break; - //---------------------------------------------------------------------- // INCL scopes - //---------------------------------------------------------------------- case N_BINCL: // include file beginning: name,,NO_SECT,0,sum We use // the current number of symbols in the symbol table @@ -3167,9 +3165,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLineEntry; break; - //---------------------------------------------------------------------- // Left and Right Braces - //---------------------------------------------------------------------- case N_LBRAC: // left bracket: 0,,NO_SECT,nesting level,address We // use the current number of symbols in the symbol @@ -3204,9 +3200,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeHeaderFile; break; - //---------------------------------------------------------------------- // COMM scopes - //---------------------------------------------------------------------- case N_BCOMM: // begin common: name,,NO_SECT,0,0 // We use the current number of symbols in the symbol @@ -4052,9 +4046,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLocal; break; - //---------------------------------------------------------------------- // INCL scopes - //---------------------------------------------------------------------- case N_BINCL: // include file beginning: name,,NO_SECT,0,sum We use the current // number of symbols in the symbol table in lieu of using nlist_idx @@ -4112,9 +4104,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLineEntry; break; - //---------------------------------------------------------------------- // Left and Right Braces - //---------------------------------------------------------------------- case N_LBRAC: // left bracket: 0,,NO_SECT,nesting level,address We use the // current number of symbols in the symbol table in lieu of using @@ -4146,9 +4136,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeHeaderFile; break; - //---------------------------------------------------------------------- // COMM scopes - //---------------------------------------------------------------------- case N_BCOMM: // begin common: name,,NO_SECT,0,0 // We use the current number of symbols in the symbol table in lieu @@ -5966,9 +5954,7 @@ bool ObjectFileMachO::AllowAssemblyEmulationUnwindPlans() { return m_allow_assembly_emulation_unwind_plans; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectFileMachO::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h index 527acae..ca4f302 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -17,10 +17,8 @@ #include "lldb/Utility/RangeMap.h" #include "lldb/Utility/UUID.h" -//---------------------------------------------------------------------- // This class needs to be hidden as eventually belongs in a plugin that // will export the ObjectFile protocol -//---------------------------------------------------------------------- class ObjectFileMachO : public lldb_private::ObjectFile { public: ObjectFileMachO(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, @@ -33,9 +31,7 @@ public: ~ObjectFileMachO() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -67,9 +63,7 @@ public: static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, @@ -132,9 +126,7 @@ public: bool AllowAssemblyEmulationUnwindPlans() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 91ed1a5..74bb222 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -303,12 +303,10 @@ uint32_t ObjectFilePECOFF::GetAddressByteSize() const { return 4; } -//---------------------------------------------------------------------- // NeedsEndianSwap // // Return true if an endian swap needs to occur when extracting data from this // file. -//---------------------------------------------------------------------- bool ObjectFilePECOFF::NeedsEndianSwap() const { #if defined(__LITTLE_ENDIAN__) return false; @@ -316,9 +314,7 @@ bool ObjectFilePECOFF::NeedsEndianSwap() const { return true; #endif } -//---------------------------------------------------------------------- // ParseDOSHeader -//---------------------------------------------------------------------- bool ObjectFilePECOFF::ParseDOSHeader(DataExtractor &data, dos_header_t &dos_header) { bool success = false; @@ -377,9 +373,7 @@ bool ObjectFilePECOFF::ParseDOSHeader(DataExtractor &data, return success; } -//---------------------------------------------------------------------- // ParserCOFFHeader -//---------------------------------------------------------------------- bool ObjectFilePECOFF::ParseCOFFHeader(DataExtractor &data, lldb::offset_t *offset_ptr, coff_header_t &coff_header) { @@ -489,9 +483,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) { return data; } -//---------------------------------------------------------------------- // ParseSectionHeaders -//---------------------------------------------------------------------- bool ObjectFilePECOFF::ParseSectionHeaders( uint32_t section_header_data_offset) { const uint32_t nsects = m_coff_header.nsects; @@ -544,9 +536,7 @@ llvm::StringRef ObjectFilePECOFF::GetSectionName(const section_header_t §) { return hdr_name; } -//---------------------------------------------------------------------- // GetNListSymtab -//---------------------------------------------------------------------- Symtab *ObjectFilePECOFF::GetSymtab() { ModuleSP module_sp(GetModule()); if (module_sp) { @@ -930,12 +920,10 @@ Address ObjectFilePECOFF::GetBaseAddress() { return Address(GetSectionList()->GetSectionAtIndex(0), 0); } -//---------------------------------------------------------------------- // Dump // // Dump the specifics of the runtime file container (such as any headers // segments, sections, etc). -//---------------------------------------------------------------------- void ObjectFilePECOFF::Dump(Stream *s) { ModuleSP module_sp(GetModule()); if (module_sp) { @@ -972,11 +960,9 @@ void ObjectFilePECOFF::Dump(Stream *s) { } } -//---------------------------------------------------------------------- // DumpDOSHeader // // Dump the MS-DOS header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpDOSHeader(Stream *s, const dos_header_t &header) { s->PutCString("MSDOS Header\n"); s->Printf(" e_magic = 0x%4.4x\n", header.e_magic); @@ -1006,11 +992,9 @@ void ObjectFilePECOFF::DumpDOSHeader(Stream *s, const dos_header_t &header) { s->Printf(" e_lfanew = 0x%8.8x\n", header.e_lfanew); } -//---------------------------------------------------------------------- // DumpCOFFHeader // // Dump the COFF header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpCOFFHeader(Stream *s, const coff_header_t &header) { s->PutCString("COFF Header\n"); s->Printf(" machine = 0x%4.4x\n", header.machine); @@ -1021,11 +1005,9 @@ void ObjectFilePECOFF::DumpCOFFHeader(Stream *s, const coff_header_t &header) { s->Printf(" hdrsize = 0x%4.4x\n", header.hdrsize); } -//---------------------------------------------------------------------- // DumpOptCOFFHeader // // Dump the optional COFF header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpOptCOFFHeader(Stream *s, const coff_opt_header_t &header) { s->PutCString("Optional COFF Header\n"); @@ -1079,11 +1061,9 @@ void ObjectFilePECOFF::DumpOptCOFFHeader(Stream *s, header.data_dirs[i].vmaddr, header.data_dirs[i].vmsize); } } -//---------------------------------------------------------------------- // DumpSectionHeader // // Dump a single ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpSectionHeader(Stream *s, const section_header_t &sh) { std::string name = GetSectionName(sh); @@ -1093,11 +1073,9 @@ void ObjectFilePECOFF::DumpSectionHeader(Stream *s, sh.lineoff, sh.nreloc, sh.nline, sh.flags); } -//---------------------------------------------------------------------- // DumpSectionHeaders // // Dump all of the ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpSectionHeaders(Stream *s) { s->PutCString("Section Headers\n"); @@ -1115,11 +1093,9 @@ void ObjectFilePECOFF::DumpSectionHeaders(Stream *s) { } } -//---------------------------------------------------------------------- // DumpDependentModules // // Dump all of the dependent modules to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpDependentModules(lldb_private::Stream *s) { auto num_modules = ParseDependentModules(); if (num_modules > 0) { @@ -1179,9 +1155,7 @@ ObjectFile::Type ObjectFilePECOFF::CalculateType() { ObjectFile::Strata ObjectFilePECOFF::CalculateStrata() { return eStrataUser; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString ObjectFilePECOFF::GetPluginName() { return GetPluginNameStatic(); } uint32_t ObjectFilePECOFF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h index d6cc14e..a9faf73 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h @@ -52,9 +52,7 @@ public: ~ObjectFilePECOFF() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -123,9 +121,7 @@ public: ObjectFile::Strata CalculateStrata() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index be7e984..ddf33bf 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -139,9 +139,7 @@ DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() { return m_register_info_up.get(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString OperatingSystemPython::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h index b577909..e76227d 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h @@ -27,9 +27,7 @@ public: ~OperatingSystemPython() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static lldb_private::OperatingSystem * CreateInstance(lldb_private::Process *process, bool force); @@ -41,16 +39,12 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // lldb_private::PluginInterface Methods - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // lldb_private::OperatingSystem Methods - //------------------------------------------------------------------ bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &real_thread_list, lldb_private::ThreadList &new_thread_list) override; @@ -64,9 +58,7 @@ public: lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread) override; - //------------------------------------------------------------------ // Method for lazy creation of threads on demand - //------------------------------------------------------------------ lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override; protected: diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.h b/lldb/source/Plugins/Platform/Android/PlatformAndroid.h index 2d00441..b710a7f 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.h +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.h @@ -29,9 +29,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -42,9 +40,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ Status ConnectRemote(Args &args) override; diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp index 4df466a..7d8f43a 100644 --- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@ -38,7 +38,6 @@ using namespace lldb_private::platform_freebsd; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformFreeBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -119,9 +118,7 @@ void PlatformFreeBSD::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformFreeBSD::PlatformFreeBSD(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h index 30c95dc..e3a3aa7 100644 --- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h +++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp index 87a7e51..11e3ade 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -36,7 +36,6 @@ using namespace lldb_private::platform_linux; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformLinux::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -118,9 +117,7 @@ void PlatformLinux::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformLinux::PlatformLinux(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.h b/lldb/source/Plugins/Platform/Linux/PlatformLinux.h index 56c9ed3..a843558 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.h +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp index f8df85d..12a63f0 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp @@ -28,26 +28,20 @@ using namespace lldb_private; #define UNSUPPORTED_ERROR ("Apple simulators aren't supported on this platform") #endif -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformAppleSimulator::Initialize() { PlatformDarwin::Initialize(); } void PlatformAppleSimulator::Terminate() { PlatformDarwin::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformAppleSimulator::PlatformAppleSimulator() : PlatformDarwin(true), m_core_sim_path_mutex(), m_core_simulator_framework_path(), m_device() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformAppleSimulator::~PlatformAppleSimulator() {} lldb_private::Status PlatformAppleSimulator::LaunchProcess( diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h index 705d563..ec5f157 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h @@ -19,16 +19,12 @@ class PlatformAppleSimulator : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static void Initialize(); static void Terminate(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformAppleSimulator(); virtual ~PlatformAppleSimulator(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp index 81dc1ed..6fc9d38 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp @@ -32,14 +32,10 @@ namespace lldb_private { class Process; } -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformAppleTVSimulator::Initialize() { PlatformDarwin::Initialize(); @@ -147,18 +143,14 @@ const char *PlatformAppleTVSimulator::GetDescriptionStatic() { return "Apple TV simulator platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformAppleTVSimulator::PlatformAppleTVSimulator() : PlatformDarwin(true), m_sdk_dir_mutex(), m_sdk_directory() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformAppleTVSimulator::~PlatformAppleTVSimulator() {} void PlatformAppleTVSimulator::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h index 534bfef..0005eab 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h @@ -13,9 +13,7 @@ class PlatformAppleTVSimulator : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -27,25 +25,19 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformAppleTVSimulator(); virtual ~PlatformAppleTVSimulator(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp index 51a88e6..7f271a0 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp @@ -30,14 +30,10 @@ namespace lldb_private { class Process; } -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformAppleWatchSimulator::Initialize() { PlatformDarwin::Initialize(); @@ -147,18 +143,14 @@ const char *PlatformAppleWatchSimulator::GetDescriptionStatic() { return "Apple Watch simulator platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformAppleWatchSimulator::PlatformAppleWatchSimulator() : PlatformDarwin(true), m_sdk_directory() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformAppleWatchSimulator::~PlatformAppleWatchSimulator() {} void PlatformAppleWatchSimulator::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h index 463dc2c..d8ffa05 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h @@ -13,9 +13,7 @@ class PlatformAppleWatchSimulator : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -27,25 +25,19 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformAppleWatchSimulator(); virtual ~PlatformAppleWatchSimulator(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 692b451..8e07095 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -46,19 +46,15 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformDarwin::PlatformDarwin(bool is_host) : PlatformPOSIX(is_host), // This is the local host platform m_developer_directory() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformDarwin::~PlatformDarwin() {} FileSpecList PlatformDarwin::LocateExecutableScriptingResources( diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h index 78259c0..ccf6853 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h @@ -25,9 +25,7 @@ public: ~PlatformDarwin() override; - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveSymbolFile(lldb_private::Target &target, const lldb_private::ModuleSpec &sym_spec, diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 8aa1d14..f67ddda 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -42,14 +42,10 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformDarwinKernel::Initialize() { PlatformDarwin::Initialize(); @@ -180,9 +176,7 @@ const char *PlatformDarwinKernel::GetDescriptionStatic() { return "Darwin Kernel platform plug-in."; } -//------------------------------------------------------------------ /// Code to handle the PlatformDarwinKernel settings -//------------------------------------------------------------------ static constexpr PropertyDefinition g_properties[] = { {"search-locally-for-kexts", OptionValue::eTypeBoolean, true, true, NULL, @@ -246,9 +240,7 @@ void PlatformDarwinKernel::DebuggerInitialize( } } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformDarwinKernel::PlatformDarwinKernel( lldb_private::LazyBool is_ios_debug_session) : PlatformDarwin(false), // This is a remote platform @@ -265,12 +257,10 @@ PlatformDarwinKernel::PlatformDarwinKernel( } } -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformDarwinKernel::~PlatformDarwinKernel() {} void PlatformDarwinKernel::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h index bf965c0..31c13d2 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h @@ -22,9 +22,7 @@ class PlatformDarwinKernel : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -38,25 +36,19 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformDarwinKernel(lldb_private::LazyBool is_ios_debug_session); virtual ~PlatformDarwinKernel(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } void GetStatus(lldb_private::Stream &strm) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index 6eba38f..8edcb8e 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -146,17 +146,13 @@ const char *PlatformMacOSX::GetDescriptionStatic(bool is_host) { return "Remote Mac OS X user platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformMacOSX::PlatformMacOSX(bool is_host) : PlatformDarwin(is_host) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformMacOSX::~PlatformMacOSX() {} ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h index 2475fcd..5e942f0 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h @@ -17,9 +17,7 @@ public: ~PlatformMacOSX() override; - //------------------------------------------------------------ // Class functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -31,9 +29,7 @@ public: static const char *GetDescriptionStatic(bool is_host); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp index ff61ced..8b45a86 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp @@ -27,20 +27,14 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteAppleBridge::PlatformRemoteAppleBridge() : PlatformRemoteDarwinDevice () {} -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteAppleBridge::Initialize() { PlatformDarwin::Initialize(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h index 339c3c8..3ecd20f 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h @@ -23,9 +23,7 @@ public: ~PlatformRemoteAppleBridge() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -37,18 +35,14 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } @@ -57,9 +51,7 @@ public: protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp index 586db67..5b50acd 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp @@ -28,20 +28,14 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteAppleTV::PlatformRemoteAppleTV() : PlatformRemoteDarwinDevice () {} -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteAppleTV::Initialize() { PlatformDarwin::Initialize(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h index c302f78..ce2e164 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h @@ -23,9 +23,7 @@ public: ~PlatformRemoteAppleTV() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -37,18 +35,14 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } @@ -57,9 +51,7 @@ public: protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp index 7ab9a46..5dec3a0 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -28,14 +28,10 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteAppleWatch::Initialize() { PlatformDarwin::Initialize(); @@ -149,9 +145,7 @@ const char *PlatformRemoteAppleWatch::GetDescriptionStatic() { return "Remote Apple Watch platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteAppleWatch::PlatformRemoteAppleWatch() : PlatformRemoteDarwinDevice() {} diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h index 2c3462a..6cd470d 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h @@ -24,9 +24,7 @@ public: ~PlatformRemoteAppleWatch() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -38,33 +36,25 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ bool GetSupportedArchitectureAtIndex(uint32_t idx, lldb_private::ArchSpec &arch) override; protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp index 59bf483..b77a549 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp @@ -34,9 +34,7 @@ PlatformRemoteDarwinDevice::SDKDirectoryInfo::SDKDirectoryInfo( build.SetString(build_str); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteDarwinDevice::PlatformRemoteDarwinDevice() : PlatformDarwin(false), // This is a remote platform m_sdk_directory_infos(), m_device_support_directory(), @@ -44,12 +42,10 @@ PlatformRemoteDarwinDevice::PlatformRemoteDarwinDevice() m_last_module_sdk_idx(UINT32_MAX), m_connected_module_sdk_idx(UINT32_MAX) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformRemoteDarwinDevice::~PlatformRemoteDarwinDevice() {} void PlatformRemoteDarwinDevice::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h index b0a0459..5e0b7d9 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h @@ -22,9 +22,7 @@ public: ~PlatformRemoteDarwinDevice() override; - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index 9e4c2b6..9e916d8 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -25,14 +25,10 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteiOS::Initialize() { PlatformDarwin::Initialize(); @@ -136,9 +132,7 @@ const char *PlatformRemoteiOS::GetDescriptionStatic() { return "Remote iOS platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteiOS::PlatformRemoteiOS() : PlatformRemoteDarwinDevice() {} diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h index 4a739f8..a0eb523 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h @@ -22,9 +22,7 @@ public: ~PlatformRemoteiOS() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -36,15 +34,11 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } @@ -56,9 +50,7 @@ public: protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp index 6acaa5a..e455edd 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -33,14 +33,10 @@ namespace lldb_private { class Process; } -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformiOSSimulator::Initialize() { PlatformAppleSimulator::Initialize(); @@ -151,19 +147,15 @@ const char *PlatformiOSSimulator::GetDescriptionStatic() { return "iOS simulator platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformiOSSimulator::PlatformiOSSimulator() : PlatformAppleSimulator(), m_sdk_dir_mutex(), m_sdk_directory(), m_build_update() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformiOSSimulator::~PlatformiOSSimulator() {} void PlatformiOSSimulator::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h index 5e415fc..d766929 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h @@ -20,9 +20,7 @@ public: ~PlatformiOSSimulator() override; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -34,18 +32,14 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp index 294eddb..f741f4a 100644 --- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -36,7 +36,6 @@ using namespace lldb_private::platform_netbsd; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -111,9 +110,7 @@ void PlatformNetBSD::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformNetBSD::PlatformNetBSD(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h index 8558f3c2..0584d92 100644 --- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h +++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp index 5497129..9dfb884 100644 --- a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp +++ b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp @@ -36,7 +36,6 @@ using namespace lldb_private::platform_openbsd; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformOpenBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -117,9 +116,7 @@ void PlatformOpenBSD::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformOpenBSD::PlatformOpenBSD(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h index 5c4c7a2..3cb724f 100644 --- a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h +++ b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp index b815e89..4b5a985 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp @@ -36,21 +36,17 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformPOSIX::PlatformPOSIX(bool is_host) : RemoteAwarePlatform(is_host), // This is the local host platform m_option_group_platform_rsync(new OptionGroupPlatformRSync()), m_option_group_platform_ssh(new OptionGroupPlatformSSH()), m_option_group_platform_caching(new OptionGroupPlatformCaching()) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformPOSIX::~PlatformPOSIX() {} lldb_private::OptionGroupOptions *PlatformPOSIX::GetConnectionOptions( diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h index 11d5bf9..5858f990 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h @@ -21,9 +21,7 @@ public: ~PlatformPOSIX() override; - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::OptionGroupOptions * GetConnectionOptions(lldb_private::CommandInterpreter &interpreter) override; diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp index df48d15..c18939f 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -147,17 +147,13 @@ void PlatformWindows::Terminate() { Platform::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformWindows::PlatformWindows(bool is_host) : RemoteAwarePlatform(is_host) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformWindows::~PlatformWindows() = default; Status PlatformWindows::ResolveExecutable( diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.h b/lldb/source/Plugins/Platform/Windows/PlatformWindows.h index 3027b4f..5740001 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.h +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.h @@ -23,9 +23,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ Status ResolveExecutable(const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index c73e29e..dea7ccf 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -195,19 +195,15 @@ Status PlatformRemoteGDBServer::GetFileWithUUID(const FileSpec &platform_file, return Status(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteGDBServer::PlatformRemoteGDBServer() : Platform(false), // This is a remote platform m_gdb_client() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformRemoteGDBServer::~PlatformRemoteGDBServer() {} bool PlatformRemoteGDBServer::GetSupportedArchitectureAtIndex(uint32_t idx, diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h index d67cfc2..94d61bb 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h @@ -35,16 +35,12 @@ public: virtual ~PlatformRemoteGDBServer(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ Status ResolveExecutable(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Process/Darwin/CFBundle.cpp b/lldb/source/Plugins/Process/Darwin/CFBundle.cpp index 9bdc6f5..3cdd2fa 100644 --- a/lldb/source/Plugins/Process/Darwin/CFBundle.cpp +++ b/lldb/source/Plugins/Process/Darwin/CFBundle.cpp @@ -13,37 +13,27 @@ #include "CFBundle.h" #include "CFString.h" -//---------------------------------------------------------------------- // CFBundle constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const char *path) : CFReleaser<CFBundleRef>(), m_bundle_url() { if (path && path[0]) SetPath(path); } -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const CFBundle &rhs) : CFReleaser<CFBundleRef>(rhs), m_bundle_url(rhs.m_bundle_url) {} -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle &CFBundle::operator=(const CFBundle &rhs) { *this = rhs; return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFBundle::~CFBundle() {} -//---------------------------------------------------------------------- // Set the path for a bundle by supplying a -//---------------------------------------------------------------------- bool CFBundle::SetPath(const char *path) { CFAllocatorRef alloc = kCFAllocatorDefault; // Release our old bundle and ULR diff --git a/lldb/source/Plugins/Process/Darwin/CFBundle.h b/lldb/source/Plugins/Process/Darwin/CFBundle.h index c56edee..f49dc30 100644 --- a/lldb/source/Plugins/Process/Darwin/CFBundle.h +++ b/lldb/source/Plugins/Process/Darwin/CFBundle.h @@ -17,9 +17,7 @@ class CFBundle : public CFReleaser<CFBundleRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFBundle(const char *path = NULL); CFBundle(const CFBundle &rhs); CFBundle &operator=(const CFBundle &rhs); diff --git a/lldb/source/Plugins/Process/Darwin/CFString.cpp b/lldb/source/Plugins/Process/Darwin/CFString.cpp index 21b3a04..4dcc05c 100644 --- a/lldb/source/Plugins/Process/Darwin/CFString.cpp +++ b/lldb/source/Plugins/Process/Darwin/CFString.cpp @@ -14,19 +14,13 @@ #include <glob.h> #include <string> -//---------------------------------------------------------------------- // CFString constructor -//---------------------------------------------------------------------- CFString::CFString(CFStringRef s) : CFReleaser<CFStringRef>(s) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString::CFString(const CFString &rhs) : CFReleaser<CFStringRef>(rhs) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString &CFString::operator=(const CFString &rhs) { if (this != &rhs) *this = rhs; @@ -41,9 +35,7 @@ CFString::CFString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFString::~CFString() {} const char *CFString::GetFileSystemRepresentation(std::string &s) { diff --git a/lldb/source/Plugins/Process/Darwin/CFString.h b/lldb/source/Plugins/Process/Darwin/CFString.h index 47db507..d1bd568 100644 --- a/lldb/source/Plugins/Process/Darwin/CFString.h +++ b/lldb/source/Plugins/Process/Darwin/CFString.h @@ -18,9 +18,7 @@ class CFString : public CFReleaser<CFStringRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFString(CFStringRef cf_str = NULL); CFString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); CFString(const CFString &rhs); diff --git a/lldb/source/Plugins/Process/Darwin/CFUtils.h b/lldb/source/Plugins/Process/Darwin/CFUtils.h index 9dae406..b567524 100644 --- a/lldb/source/Plugins/Process/Darwin/CFUtils.h +++ b/lldb/source/Plugins/Process/Darwin/CFUtils.h @@ -17,11 +17,9 @@ #ifdef __cplusplus -//---------------------------------------------------------------------- // Templatized CF helper class that can own any CF pointer and will // call CFRelease() on any valid pointer it owns unless that pointer is // explicitly released using the release() member function. -//---------------------------------------------------------------------- template <class T> class CFReleaser { public: // Type names for the avlue diff --git a/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp b/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp index c72def3..3ec410f 100644 --- a/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp +++ b/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp @@ -148,17 +148,13 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[], memset(fork_error, 0, sizeof(fork_error)); *pid = static_cast<::pid_t>(pty.Fork(fork_error, sizeof(fork_error))); if (*pid < 0) { - //-------------------------------------------------------------- // Status during fork. - //-------------------------------------------------------------- *pid = static_cast<::pid_t>(LLDB_INVALID_PROCESS_ID); error.SetErrorStringWithFormat("%s(): fork failed: %s", __FUNCTION__, fork_error); return error; } else if (pid == 0) { - //-------------------------------------------------------------- // Child process - //-------------------------------------------------------------- // Debug this process. ::ptrace(PT_TRACE_ME, 0, 0, 0); @@ -186,9 +182,7 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[], // call and if the exec fails it will exit the child process below. ::exit(127); } else { - //-------------------------------------------------------------- // Parent process - //-------------------------------------------------------------- // Let the child have its own process group. We need to execute this call // in both the child and parent to avoid a race condition between the two // processes. diff --git a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp index 17116e8..1d7851d 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -37,9 +37,7 @@ using namespace lldb_private; using namespace lldb_private::process_darwin; using namespace lldb_private::darwin_process_launcher; -// ----------------------------------------------------------------------------- // Hidden Impl -// ----------------------------------------------------------------------------- namespace { struct hack_task_dyld_info { @@ -48,9 +46,7 @@ struct hack_task_dyld_info { }; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- Status NativeProcessProtocol::Launch( ProcessLaunchInfo &launch_info, @@ -153,9 +149,7 @@ Status NativeProcessProtocol::Attach( return error; } -// ----------------------------------------------------------------------------- // ctor/dtor -// ----------------------------------------------------------------------------- NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) : NativeProcessProtocol(pid), m_task(TASK_NULL), m_did_exec(false), @@ -170,9 +164,7 @@ NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) NativeProcessDarwin::~NativeProcessDarwin() {} -// ----------------------------------------------------------------------------- // Instance methods -// ----------------------------------------------------------------------------- Status NativeProcessDarwin::FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop) { @@ -1547,9 +1539,7 @@ Status NativeProcessDarwin::GetFileLoadAddress(const llvm::StringRef &file_name, return error; } -// ----------------------------------------------------------------- // NativeProcessProtocol protected interface -// ----------------------------------------------------------------- Status NativeProcessDarwin::GetSoftwareBreakpointTrapOpcode( size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) { diff --git a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h index 1b50a8c..6741d4dd 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h @@ -59,9 +59,7 @@ class NativeProcessDarwin : public NativeProcessProtocol { public: ~NativeProcessDarwin() override; - // ----------------------------------------------------------------- // NativeProcessProtocol Interface - // ----------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -112,9 +110,7 @@ public: task_t GetTask() const { return m_task; } - // ----------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // ----------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, void *data = nullptr, size_t data_size = 0, long *result = nullptr); @@ -122,18 +118,14 @@ public: bool SupportHardwareSingleStepping() const; protected: - // ----------------------------------------------------------------- // NativeProcessProtocol protected interface - // ----------------------------------------------------------------- Status GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) override; private: - // ----------------------------------------------------------------- /// Mach task-related Member Variables - // ----------------------------------------------------------------- // The task port for the inferior process. mutable task_t m_task; @@ -145,9 +137,7 @@ private: // The CPU type of this process. mutable cpu_type_t m_cpu_type; - // ----------------------------------------------------------------- /// Exception/Signal Handling Member Variables - // ----------------------------------------------------------------- // Exception port on which we will receive child exceptions mach_port_t m_exception_port; @@ -175,15 +165,11 @@ private: // interrupt signal (if this is non-zero). int m_auto_resume_signo; - // ----------------------------------------------------------------- /// Thread-related Member Variables - // ----------------------------------------------------------------- NativeThreadListDarwin m_thread_list; ResumeActionList m_thread_actions; - // ----------------------------------------------------------------- /// Process Lifetime Member Variable - // ----------------------------------------------------------------- // The pipe over which the waitpid thread and the main loop will // communicate. @@ -195,12 +181,9 @@ private: // waitpid reader callback handle. MainLoop::ReadHandleUP m_waitpid_reader_handle; - // ----------------------------------------------------------------- // Private Instance Methods - // ----------------------------------------------------------------- NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd); - // ----------------------------------------------------------------- /// Finalize the launch. /// /// This method associates the NativeProcessDarwin instance with the host @@ -220,7 +203,6 @@ private: /// Any error that occurred during the aforementioned /// operations. Failure here will force termination of the /// launched process and debugging session. - // ----------------------------------------------------------------- Status FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop); Status SaveExceptionPortInfo(); diff --git a/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h b/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h index 9f53643..616a9a7 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h +++ b/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h @@ -45,9 +45,7 @@ public: lldb::tid_t unique_thread_id = 0, ::thread_t mach_thread_port = 0); - // ----------------------------------------------------------------- // NativeThreadProtocol Interface - // ----------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -62,15 +60,11 @@ public: Status RemoveWatchpoint(lldb::addr_t addr) override; - // ----------------------------------------------------------------- // New methods that are fine for others to call. - // ----------------------------------------------------------------- void Dump(Stream &stream) const; private: - // ----------------------------------------------------------------- // Interface for friend classes - // ----------------------------------------------------------------- /// Resumes the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. @@ -118,20 +112,16 @@ private: Status RequestStop(); - // ------------------------------------------------------------------------- /// Return the mach thread port number for this thread. /// /// \return /// The mach port number for this thread. Returns NULL_THREAD /// when the thread is invalid. - // ------------------------------------------------------------------------- thread_t GetMachPortNumber() const { return m_mach_thread_port; } static bool MachPortNumberIsValid(::thread_t thread); - // --------------------------------------------------------------------- // Private interface - // --------------------------------------------------------------------- bool GetIdentifierInfo(); void MaybeLogStateChange(lldb::StateType new_state); @@ -144,9 +134,7 @@ private: inline void MaybeCleanupSingleStepWorkaround(); - // ----------------------------------------------------------------- // Member Variables - // ----------------------------------------------------------------- // The mach thread port for the thread. ::thread_t m_mach_thread_port; diff --git a/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp index 499db58..89de92a 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp @@ -548,7 +548,6 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) { return (uint32_t)m_threads.size(); } -//---------------------------------------------------------------------- // Check each thread in our thread list to see if we should notify our client // of the current halt in execution. // @@ -558,7 +557,6 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) { // RETURNS // true if we should stop and notify our clients // false if we should resume our child process and skip notification -//---------------------------------------------------------------------- bool NativeThreadListDarwin::ShouldStop(bool &step_more) { std::lock_guard<std::recursive_mutex> locker(m_threads_mutex); for (auto thread_sp : m_threads) { diff --git a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h index 92faee7..6d3c253 100644 --- a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h +++ b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h @@ -19,14 +19,11 @@ class ProcessMessage; class ProcessMonitor; class POSIXBreakpointProtocol; -//------------------------------------------------------------------------------ // @class FreeBSDThread // Abstraction of a FreeBSD thread. class FreeBSDThread : public lldb_private::Thread { public: - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ FreeBSDThread(lldb_private::Process &process, lldb::tid_t tid); virtual ~FreeBSDThread(); @@ -50,7 +47,6 @@ public: lldb::addr_t GetThreadPointer() override; - //-------------------------------------------------------------------------- // These functions provide a mapping from the register offset // back to the register index or name for use in debugging or log // output. @@ -61,14 +57,12 @@ public: const char *GetRegisterNameFromOffset(unsigned offset); - //-------------------------------------------------------------------------- // These methods form a specialized interface to POSIX threads. // bool Resume(); void Notify(const ProcessMessage &message); - //-------------------------------------------------------------------------- // These methods provide an interface to watchpoints // bool EnableHardwareWatchpoint(lldb_private::Watchpoint *wp); @@ -110,7 +104,6 @@ protected: lldb_private::Unwind *GetUnwinder() override; - //-------------------------------------------------------------------------- // FreeBSDThread internal API. // POSIXThread override diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index d985a52..efd8cad 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -64,7 +64,6 @@ UnixSignalsSP &GetFreeBSDSignals() { } } -//------------------------------------------------------------------------------ // Static functions. lldb::ProcessSP @@ -96,7 +95,6 @@ const char *ProcessFreeBSD::GetPluginDescriptionStatic() { return "Process plugin for FreeBSD"; } -//------------------------------------------------------------------------------ // ProcessInterface protocol. lldb_private::ConstString ProcessFreeBSD::GetPluginName() { @@ -250,7 +248,6 @@ void ProcessFreeBSD::SendMessage(const ProcessMessage &message) { m_message_queue.push(message); } -//------------------------------------------------------------------------------ // Constructors and destructors. ProcessFreeBSD::ProcessFreeBSD(lldb::TargetSP target_sp, @@ -269,7 +266,6 @@ ProcessFreeBSD::ProcessFreeBSD(lldb::TargetSP target_sp, ProcessFreeBSD::~ProcessFreeBSD() { delete m_monitor; } -//------------------------------------------------------------------------------ // Process protocol. void ProcessFreeBSD::Finalize() { Process::Finalize(); @@ -835,7 +831,6 @@ size_t ProcessFreeBSD::PutSTDIN(const char *buf, size_t len, Status &error) { return status; } -//------------------------------------------------------------------------------ // Utility functions. bool ProcessFreeBSD::HasExited() { diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h index e8a0cd9..293f7b8 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h @@ -23,9 +23,7 @@ class FreeBSDThread; class ProcessFreeBSD : public lldb_private::Process { public: - //------------------------------------------------------------------ // Static functions. - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -38,9 +36,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ ProcessFreeBSD(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, lldb::UnixSignalsSP &unix_signals_sp); @@ -48,17 +44,13 @@ public: virtual lldb_private::Status WillResume() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ virtual lldb_private::ConstString GetPluginName() override; virtual uint32_t GetPluginVersion() override; public: - //------------------------------------------------------------------ // Process protocol. - //------------------------------------------------------------------ void Finalize() override; bool CanDebug(lldb::TargetSP target_sp, @@ -137,7 +129,6 @@ public: const lldb::DataBufferSP GetAuxvData() override; - //-------------------------------------------------------------------------- // ProcessFreeBSD internal API. /// Registers the given message with this process. diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index 959e5f0..09a898c 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -140,7 +140,6 @@ extern long PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data) { PtraceWrapper((req), (pid), (addr), (data)) #endif -//------------------------------------------------------------------------------ // Static implementations of ProcessMonitor::ReadMemory and // ProcessMonitor::WriteMemory. This enables mutual recursion between these // functions without needed to go thru the thread funnel. @@ -195,7 +194,6 @@ static bool EnsureFDFlags(int fd, int flags, Status &error) { return true; } -//------------------------------------------------------------------------------ /// \class Operation /// Represents a ProcessMonitor operation. /// @@ -213,7 +211,6 @@ public: virtual void Execute(ProcessMonitor *monitor) = 0; }; -//------------------------------------------------------------------------------ /// \class ReadOperation /// Implements ProcessMonitor::ReadMemory. class ReadOperation : public Operation { @@ -239,7 +236,6 @@ void ReadOperation::Execute(ProcessMonitor *monitor) { m_result = DoReadMemory(pid, m_addr, m_buff, m_size, m_error); } -//------------------------------------------------------------------------------ /// \class WriteOperation /// Implements ProcessMonitor::WriteMemory. class WriteOperation : public Operation { @@ -265,7 +261,6 @@ void WriteOperation::Execute(ProcessMonitor *monitor) { m_result = DoWriteMemory(pid, m_addr, m_buff, m_size, m_error); } -//------------------------------------------------------------------------------ /// \class ReadRegOperation /// Implements ProcessMonitor::ReadRegisterValue. class ReadRegOperation : public Operation { @@ -305,7 +300,6 @@ void ReadRegOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class WriteRegOperation /// Implements ProcessMonitor::WriteRegisterValue. class WriteRegOperation : public Operation { @@ -338,7 +332,6 @@ void WriteRegOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadDebugRegOperation /// Implements ProcessMonitor::ReadDebugRegisterValue. class ReadDebugRegOperation : public Operation { @@ -373,7 +366,6 @@ void ReadDebugRegOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class WriteDebugRegOperation /// Implements ProcessMonitor::WriteDebugRegisterValue. class WriteDebugRegOperation : public Operation { @@ -406,7 +398,6 @@ void WriteDebugRegOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadGPROperation /// Implements ProcessMonitor::ReadGPR. class ReadGPROperation : public Operation { @@ -433,7 +424,6 @@ void ReadGPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadFPROperation /// Implements ProcessMonitor::ReadFPR. class ReadFPROperation : public Operation { @@ -456,7 +446,6 @@ void ReadFPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class WriteGPROperation /// Implements ProcessMonitor::WriteGPR. class WriteGPROperation : public Operation { @@ -479,7 +468,6 @@ void WriteGPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class WriteFPROperation /// Implements ProcessMonitor::WriteFPR. class WriteFPROperation : public Operation { @@ -502,7 +490,6 @@ void WriteFPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ResumeOperation /// Implements ProcessMonitor::Resume. class ResumeOperation : public Operation { @@ -533,7 +520,6 @@ void ResumeOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class SingleStepOperation /// Implements ProcessMonitor::SingleStep. class SingleStepOperation : public Operation { @@ -561,7 +547,6 @@ void SingleStepOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class LwpInfoOperation /// Implements ProcessMonitor::GetLwpInfo. class LwpInfoOperation : public Operation { @@ -590,7 +575,6 @@ void LwpInfoOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class ThreadSuspendOperation /// Implements ProcessMonitor::ThreadSuspend. class ThreadSuspendOperation : public Operation { @@ -610,7 +594,6 @@ void ThreadSuspendOperation::Execute(ProcessMonitor *monitor) { m_result = !PTRACE(m_suspend ? PT_SUSPEND : PT_RESUME, m_tid, NULL, 0); } -//------------------------------------------------------------------------------ /// \class EventMessageOperation /// Implements ProcessMonitor::GetEventMessage. class EventMessageOperation : public Operation { @@ -640,7 +623,6 @@ void EventMessageOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class KillOperation /// Implements ProcessMonitor::Kill. class KillOperation : public Operation { @@ -662,7 +644,6 @@ void KillOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class DetachOperation /// Implements ProcessMonitor::Detach. class DetachOperation : public Operation { @@ -708,7 +689,6 @@ ProcessMonitor::AttachArgs::AttachArgs(ProcessMonitor *monitor, lldb::pid_t pid) ProcessMonitor::AttachArgs::~AttachArgs() {} -//------------------------------------------------------------------------------ /// The basic design of the ProcessMonitor is built around two threads. /// /// One thread (@see SignalThread) simply blocks on a call to waitpid() @@ -805,7 +785,6 @@ ProcessMonitor::ProcessMonitor(ProcessFreeBSD *process, lldb::pid_t pid, ProcessMonitor::~ProcessMonitor() { StopMonitor(); } -//------------------------------------------------------------------------------ // Thread setup and tear down. void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status &error) { static const char *g_thread_name = "lldb.process.freebsd.operation"; diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h index c9bfe09..cf52a06 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h @@ -13,7 +13,6 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Utility/ArchSpec.h" -//------------------------------------------------------------------------------ /// \class POSIXBreakpointProtocol /// /// Extends RegisterClass with a few virtual operations useful on POSIX. diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index bab2a71..d85ec21 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -206,9 +206,7 @@ static Status EnsureFDFlags(int fd, int flags) { return error; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info, @@ -284,9 +282,7 @@ NativeProcessLinux::Factory::Attach( pid, -1, native_delegate, Info.GetArchitecture(), mainloop, *tids_or)); } -// ----------------------------------------------------------------------------- // Public Instance Methods -// ----------------------------------------------------------------------------- NativeProcessLinux::NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h index 044f167..006ae00 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h @@ -49,9 +49,7 @@ public: MainLoop &mainloop) const override; }; - // --------------------------------------------------------------------- // NativeProcessProtocol Interface - // --------------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -120,9 +118,7 @@ public: Status GetTraceConfig(lldb::user_id_t traceid, TraceOptions &config) override; - // --------------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // --------------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, void *data = nullptr, size_t data_size = 0, long *result = nullptr); @@ -146,9 +142,7 @@ private: // the relevan breakpoint std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint; - // --------------------------------------------------------------------- // Private Instance Methods - // --------------------------------------------------------------------- NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, MainLoop &mainloop, llvm::ArrayRef<::pid_t> tids); diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h index b7d7740..d64bcdc 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h @@ -40,9 +40,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware breakpoints/watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h index 57af505..005843e 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h @@ -40,9 +40,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware breakpoints/watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 590e807..3ca9b43 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -87,9 +87,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( (GetRegisterInfoInterface().GetGPRSize() + sizeof(FPR_linux_mips) + \ sizeof(MSA_linux_mips)) -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_mips64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h index ff3a740..37f9f5f 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h @@ -47,9 +47,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareWatchpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp index f556589..5d13557 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp @@ -25,9 +25,7 @@ using namespace lldb_private; using namespace lldb_private::process_linux; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // s390x 64-bit general purpose registers. @@ -89,9 +87,7 @@ static const RegisterSet g_reg_sets_s390x[k_num_register_sets] = { #define REG_CONTEXT_SIZE (sizeof(s390_regs) + sizeof(s390_fp_regs) + 4) -// ---------------------------------------------------------------------------- // Required ptrace defines. -// ---------------------------------------------------------------------------- #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ @@ -103,9 +99,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( native_thread); } -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_s390x members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp index b7d5b6b..ad2d432 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -24,9 +24,7 @@ using namespace lldb_private; using namespace lldb_private::process_linux; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // x86 32-bit general purpose registers. @@ -207,9 +205,7 @@ static const RegisterSet g_reg_sets_x86_64[k_num_register_sets] = { #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize() + sizeof(FPR)) -// ---------------------------------------------------------------------------- // Required ptrace defines. -// ---------------------------------------------------------------------------- // Support ptrace extensions even when compiled without required kernel support #ifndef NT_X86_XSTATE @@ -225,18 +221,14 @@ static inline unsigned int fxsr_regset(const ArchSpec &arch) { return arch.GetAddressByteSize() == 8 ? NT_PRFPREG : NT_PRXFPREG; } -// ---------------------------------------------------------------------------- // Required MPX define. -// ---------------------------------------------------------------------------- // Support MPX extensions also if compiled with compiler without MPX support. #ifndef bit_MPX #define bit_MPX 0x4000 #endif -// ---------------------------------------------------------------------------- // XCR0 extended register sets masks. -// ---------------------------------------------------------------------------- #define mask_XSTATE_AVX (1ULL << 2) #define mask_XSTATE_BNDREGS (1ULL << 3) #define mask_XSTATE_BNDCFG (1ULL << 4) @@ -249,9 +241,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( new NativeRegisterContextLinux_x86_64(target_arch, native_thread)); } -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_x86_64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h index e92908b..fd43c89 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h @@ -30,9 +30,7 @@ class NativeThreadLinux : public NativeThreadProtocol { public: NativeThreadLinux(NativeProcessLinux &process, lldb::tid_t tid); - // --------------------------------------------------------------------- // NativeThreadProtocol Interface - // --------------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -54,9 +52,7 @@ public: Status RemoveHardwareBreakpoint(lldb::addr_t addr) override; private: - // --------------------------------------------------------------------- // Interface for friend classes - // --------------------------------------------------------------------- /// Resumes the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. @@ -91,18 +87,14 @@ private: Status RequestStop(); - // --------------------------------------------------------------------- // Private interface - // --------------------------------------------------------------------- void MaybeLogStateChange(lldb::StateType new_state); NativeProcessLinux &GetProcess(); void SetStopped(); - // --------------------------------------------------------------------- // Member Variables - // --------------------------------------------------------------------- lldb::StateType m_state; ThreadStopInfo m_stop_info; std::unique_ptr<NativeRegisterContextLinux> m_reg_context_up; diff --git a/lldb/source/Plugins/Process/Linux/ProcessorTrace.h b/lldb/source/Plugins/Process/Linux/ProcessorTrace.h index d105555..de9bd8c 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessorTrace.h +++ b/lldb/source/Plugins/Process/Linux/ProcessorTrace.h @@ -23,7 +23,6 @@ namespace lldb_private { namespace process_linux { -// --------------------------------------------------------------------- // This class keeps track of one tracing instance of // Intel(R) Processor Trace on Linux OS. There is a map keeping track // of different tracing instances on each thread, which enables trace @@ -36,7 +35,6 @@ namespace process_linux { // The trace id could map to trace instances for a group of threads // (spanning to all the threads in the process) or a single thread. // The kernel interface for us is the perf_event_open. -// --------------------------------------------------------------------- class ProcessorTraceMonitor; typedef std::unique_ptr<ProcessorTraceMonitor> ProcessorTraceMonitorUP; @@ -115,7 +113,6 @@ public: Status GetTraceConfig(TraceOptions &config) const; - // --------------------------------------------------------------------- /// Read data from a cyclic buffer /// /// \param[in] [out] buf @@ -130,7 +127,6 @@ public: /// /// \param[in] offset /// The offset to begin reading the data in the cyclic buffer. - // --------------------------------------------------------------------- static void ReadCyclicBuffer(llvm::MutableArrayRef<uint8_t> &dst, llvm::MutableArrayRef<uint8_t> src, size_t src_cyc_index, size_t offset); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 5da835d..ded0983 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // CommunicationKDP constructor -//---------------------------------------------------------------------- CommunicationKDP::CommunicationKDP(const char *comm_name) : Communication(comm_name), m_addr_byte_size(4), m_byte_order(eByteOrderLittle), m_packet_timeout(5), m_sequence_mutex(), @@ -39,9 +37,7 @@ CommunicationKDP::CommunicationKDP(const char *comm_name) m_kdp_version_feature(0u), m_kdp_hostinfo_cpu_mask(0u), m_kdp_hostinfo_cpu_type(0u), m_kdp_hostinfo_cpu_subtype(0u) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CommunicationKDP::~CommunicationKDP() { if (IsConnected()) { Disconnect(); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h index b5aa146..fed6128 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h @@ -76,9 +76,7 @@ public: ePacketTypeMask = 0x80u, eCommandTypeMask = 0x7fu } PacketType; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommunicationKDP(const char *comm_name); virtual ~CommunicationKDP(); @@ -96,14 +94,12 @@ public: lldb_private::DataExtractor &packet); bool IsRunning() const { return m_is_running.GetValue(); } - //------------------------------------------------------------------ // Set the global packet timeout. // // For clients, this is the timeout that gets used when sending // packets and waiting for responses. For servers, this might not // get used, and if it doesn't this should be moved to the // CommunicationKDPClient. - //------------------------------------------------------------------ std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout) { const auto old_packet_timeout = m_packet_timeout; m_packet_timeout = packet_timeout; @@ -112,9 +108,7 @@ public: std::chrono::seconds GetPacketTimeout() const { return m_packet_timeout; } - //------------------------------------------------------------------ // Public Request Packets - //------------------------------------------------------------------ bool SendRequestConnect(uint16_t reply_port, uint16_t exc_port, const char *greeting); @@ -188,10 +182,8 @@ protected: PacketStreamType &request_packet, uint16_t request_length); - //------------------------------------------------------------------ // Protected Request Packets (use public accessors which will cache // results. - //------------------------------------------------------------------ bool SendRequestVersion(); bool SendRequestHostInfo(); @@ -228,9 +220,7 @@ protected: bool SendRequestAndGetReply(const CommandType command, const PacketStreamType &request_packet, lldb_private::DataExtractor &reply_packet); - //------------------------------------------------------------------ // Classes that inherit from CommunicationKDP can see and modify these - //------------------------------------------------------------------ uint32_t m_addr_byte_size; lldb::ByteOrder m_byte_order; std::chrono::seconds m_packet_timeout; @@ -250,9 +240,7 @@ protected: // hang the KDP connection... lldb::addr_t m_last_read_memory_addr; // Last memory read address for logging private: - //------------------------------------------------------------------ // For CommunicationKDP only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommunicationKDP); }; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 605194d..c9e024f 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -143,9 +143,7 @@ bool ProcessKDP::CanDebug(TargetSP target_sp, bool plugin_specified_by_name) { return false; } -//---------------------------------------------------------------------- // ProcessKDP constructor -//---------------------------------------------------------------------- ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp) : Process(target_sp, listener_sp), m_comm("lldb.process.kdp-remote.communication"), @@ -162,9 +160,7 @@ ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp) m_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessKDP::~ProcessKDP() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -174,9 +170,7 @@ ProcessKDP::~ProcessKDP() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- lldb_private::ConstString ProcessKDP::GetPluginName() { return GetPluginNameStatic(); } @@ -369,9 +363,7 @@ Status ProcessKDP::DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { return error; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessKDP::DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) { Status error; @@ -595,17 +587,13 @@ Status ProcessKDP::DoDestroy() { return DoDetach(keep_stopped); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessKDP::IsAlive() { return m_comm.IsConnected() && Process::IsAlive(); } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessKDP::DoReadMemory(addr_t addr, void *buf, size_t size, Status &error) { uint8_t *data_buffer = (uint8_t *)buf; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h index 31de54c..a7f8466 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h @@ -30,9 +30,7 @@ class ThreadKDP; class ProcessKDP : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -47,23 +45,17 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessKDP(lldb::TargetSP target_sp, lldb::ListenerSP listener); ~ProcessKDP() override; - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; lldb_private::CommandObject *GetPluginCommandObject() override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status WillLaunch(lldb_private::Module *module) override; lldb_private::Status @@ -93,16 +85,12 @@ public: lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status WillResume() override; lldb_private::Status DoResume() override; @@ -117,14 +105,10 @@ public: void RefreshStateAfterStop() override; - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -136,18 +120,14 @@ public: lldb_private::Status DoDeallocateMemory(lldb::addr_t ptr) override; - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- lldb_private::Status EnableBreakpointSite(lldb_private::BreakpointSite *bp_site) override; lldb_private::Status DisableBreakpointSite(lldb_private::BreakpointSite *bp_site) override; - //---------------------------------------------------------------------- // Process Watchpoints - //---------------------------------------------------------------------- lldb_private::Status EnableWatchpoint(lldb_private::Watchpoint *wp, bool notify = true) override; @@ -160,9 +140,7 @@ protected: friend class ThreadKDP; friend class CommunicationKDP; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- bool IsRunning(lldb::StateType state) { return state == lldb::eStateRunning || IsStepping(state); } @@ -191,9 +169,7 @@ protected: lldb::ThreadSP GetKernelThread(); - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ CommunicationKDP m_comm; lldb_private::Broadcaster m_async_broadcaster; lldb_private::HostThread m_async_thread; @@ -209,9 +185,7 @@ protected: static void *AsyncThread(void *arg); private: - //------------------------------------------------------------------ // For ProcessKDP only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ProcessKDP); }; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp index 341c632..77361ef 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -34,9 +34,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadKDP::ThreadKDP(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h index e7330f2..9971ea7 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h @@ -60,16 +60,12 @@ public: protected: friend class ProcessKDP; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; std::string m_dispatch_queue_name; lldb::addr_t m_thread_dispatch_qaddr; lldb::StopInfoSP m_cached_stop_info_sp; - //------------------------------------------------------------------ // Protected member functions. - //------------------------------------------------------------------ virtual bool CalculateStopInfo(); }; diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index e9eceb0..5179f83 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -54,9 +54,7 @@ static Status EnsureFDFlags(int fd, int flags) { return error; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info, @@ -136,9 +134,7 @@ NativeProcessNetBSD::Factory::Attach( return std::move(process_up); } -// ----------------------------------------------------------------------------- // Public Instance Methods -// ----------------------------------------------------------------------------- NativeProcessNetBSD::NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h index 2e7b62d..e85ca3b 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h @@ -38,9 +38,7 @@ public: MainLoop &mainloop) const override; }; - // --------------------------------------------------------------------- // NativeProcessProtocol Interface - // --------------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -83,9 +81,7 @@ public: llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> GetAuxvData() const override; - // --------------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // --------------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, int data = 0, int *result = nullptr); @@ -95,9 +91,7 @@ private: LazyBool m_supports_mem_region = eLazyBoolCalculate; std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache; - // --------------------------------------------------------------------- // Private Instance Methods - // --------------------------------------------------------------------- NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, MainLoop &mainloop); diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp index 8c8e265..2c9eaaa 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp @@ -31,9 +31,7 @@ using namespace lldb_private; using namespace lldb_private::process_netbsd; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // x86 64-bit general purpose registers. @@ -152,9 +150,7 @@ NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD( return new NativeRegisterContextNetBSD_x86_64(target_arch, native_thread); } -// ---------------------------------------------------------------------------- // NativeRegisterContextNetBSD_x86_64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h index 01d169d..015d899 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h +++ b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h @@ -26,9 +26,7 @@ class NativeThreadNetBSD : public NativeThreadProtocol { public: NativeThreadNetBSD(NativeProcessNetBSD &process, lldb::tid_t tid); - // --------------------------------------------------------------------- // NativeThreadProtocol Interface - // --------------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -48,9 +46,7 @@ public: Status RemoveHardwareBreakpoint(lldb::addr_t addr) override; private: - // --------------------------------------------------------------------- // Interface for friend classes - // --------------------------------------------------------------------- void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr); void SetStoppedByBreakpoint(); @@ -61,9 +57,7 @@ private: void SetRunning(); void SetStepping(); - // --------------------------------------------------------------------- // Member Variables - // --------------------------------------------------------------------- lldb::StateType m_state; ThreadStopInfo m_stop_info; std::unique_ptr<NativeRegisterContext> m_reg_context_up; diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h index 116224a..aacf547 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h @@ -64,9 +64,7 @@ public: void Clear(); protected: - //------------------------------------------------------------------ // Classes that inherit from DynamicRegisterInfo can see and modify these - //------------------------------------------------------------------ typedef std::vector<lldb_private::RegisterInfo> reg_collection; typedef std::vector<lldb_private::RegisterSet> set_collection; typedef std::vector<uint32_t> reg_num_collection; diff --git a/lldb/source/Plugins/Process/Utility/HistoryThread.h b/lldb/source/Plugins/Process/Utility/HistoryThread.h index cbbb3fc..2345d85 100644 --- a/lldb/source/Plugins/Process/Utility/HistoryThread.h +++ b/lldb/source/Plugins/Process/Utility/HistoryThread.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class HistoryThread HistoryThread.h "HistoryThread.h" /// A thread object representing a backtrace from a previous point in the /// process execution @@ -31,7 +30,6 @@ namespace lldb_private { /// process execution. It is given a backtrace list of pc addresses and /// optionally a stop_id of when those pc addresses were collected, and it /// will create stack frames for them. -//---------------------------------------------------------------------- class HistoryThread : public lldb_private::Thread { public: diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp index 10609ce8..ea950ce 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp @@ -960,11 +960,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -984,9 +982,7 @@ const RegisterSet *RegisterContextDarwin_arm::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for 32 bit i386. -//---------------------------------------------------------------------- int RegisterContextDarwin_arm::GetSetForNativeRegNum(int reg) { if (reg < fpu_s0) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp index 0f9e1e6..c264831 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp @@ -67,9 +67,7 @@ using namespace lldb_private; sizeof(RegisterContextDarwin_arm64::FPU) + \ sizeof(RegisterContextDarwin_arm64::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM64_STRUCT #include "RegisterInfos_arm64.h" #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT @@ -140,11 +138,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -164,9 +160,7 @@ const RegisterSet *RegisterContextDarwin_arm64::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for arm64 -//---------------------------------------------------------------------- int RegisterContextDarwin_arm64::GetSetForNativeRegNum(int reg) { if (reg < fpu_v0) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp index 161af9f..130a267 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp @@ -460,11 +460,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -484,9 +482,7 @@ const RegisterSet *RegisterContextDarwin_i386::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for 32 bit i386. -//---------------------------------------------------------------------- int RegisterContextDarwin_i386::GetSetForNativeRegNum(int reg_num) { if (reg_num < fpu_fcw) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp index c611f62..4a37454 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp @@ -521,11 +521,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h index 70d8423..bdaa221 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h @@ -51,9 +51,7 @@ public: uint32_t num) override; private: - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only) lldb_private::RegisterInfo m_pc_reg_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp index 41896615..1c3f33d2 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp @@ -53,9 +53,7 @@ struct UserArea { #define DR_SIZE sizeof(uint32_t) #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp index 7c186ad..4331ef5 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp @@ -79,10 +79,8 @@ typedef struct _GPR { uint64_t dummy; } GPR_freebsd_mips; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips64 to declare our g_register_infos_mips64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT #include "RegisterInfos_mips64.h" #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp index d1b9e59..a0c3146 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp @@ -168,10 +168,8 @@ typedef struct _VMX { uint32_t vscr; } VMX; -//--------------------------------------------------------------------------- // Include RegisterInfos_powerpc to declare our g_register_infos_powerpc // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_POWERPC_STRUCT #include "RegisterInfos_powerpc.h" #undef DECLARE_REGISTER_INFOS_POWERPC_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp index eedfdbb..bcf3951 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp @@ -61,10 +61,8 @@ struct UserArea { #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT @@ -88,10 +86,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]); -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to update the g_register_infos structure // with x86_64 offsets. -//--------------------------------------------------------------------------- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h index 8c29f1f..952e426 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h @@ -51,9 +51,7 @@ public: uint32_t num) override; private: - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only) lldb_private::RegisterInfo m_pc_reg_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h index 0610016..64dd394 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h @@ -110,7 +110,6 @@ private: // user somehow. bool IsSkipFrame() const; - //------------------------------------------------------------------ /// Determines if a SymbolContext is a trap handler or not /// /// Given a SymbolContext, determines if this is a trap handler function @@ -118,7 +117,6 @@ private: /// /// \return /// Returns true if the SymbolContext is a trap handler. - //------------------------------------------------------------------ bool IsTrapHandlerSymbol(lldb_private::Process *process, const lldb_private::SymbolContext &m_sym_ctx) const; @@ -154,7 +152,6 @@ private: const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value); - //------------------------------------------------------------------ /// If the unwind has to the caller frame has failed, try something else /// /// If lldb is using an assembly language based UnwindPlan for a frame and @@ -165,10 +162,8 @@ private: /// /// \return /// Returns true if a fallback unwindplan was found & was installed. - //------------------------------------------------------------------ bool TryFallbackUnwindPlan(); - //------------------------------------------------------------------ /// Switch to the fallback unwind plan unconditionally without any safety /// checks that it is providing better results than the normal unwind plan. /// @@ -176,7 +171,6 @@ private: /// found to be fundamentally incorrect/impossible. /// /// Returns true if it was able to install the fallback unwind plan. - //------------------------------------------------------------------ bool ForceSwitchToFallbackUnwindPlan(); // Get the contents of a general purpose (address-size) register for this @@ -249,9 +243,7 @@ private: lldb_private::UnwindLLDB &m_parent_unwind; // The UnwindLLDB that is creating // this RegisterContextLLDB - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(RegisterContextLLDB); }; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp index 5b9f69a..1210a7e 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp @@ -81,9 +81,7 @@ struct UserArea { #define DR_OFFSET(reg_index) (DR_0_OFFSET + (reg_index * 4)) #define FPR_SIZE(reg) sizeof(((FPR_i386 *)NULL)->reg) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp index c2e3d95..4797afb 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp @@ -21,9 +21,7 @@ using namespace lldb_private; using namespace lldb; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips to declare our g_register_infos_mips structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS_STRUCT #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp index 9eab9cf..3927883 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp @@ -22,19 +22,15 @@ using namespace lldb; using namespace lldb_private; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips64 to declare our g_register_infos_mips64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT #define LINUX_MIPS64 #include "RegisterInfos_mips64.h" #undef LINUX_MIPS64 #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT -//--------------------------------------------------------------------------- // Include RegisterInfos_mips to declare our g_register_infos_mips structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS_STRUCT #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp index 672567a..d6401d7 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp @@ -12,9 +12,7 @@ using namespace lldb_private; using namespace lldb; -//--------------------------------------------------------------------------- // Include RegisterInfos_s390x to declare our g_register_infos_s390x structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_S390X_STRUCT #include "RegisterInfos_s390x.h" #undef DECLARE_REGISTER_INFOS_S390X_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp index 5a6e766..6f78f84 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp @@ -75,10 +75,8 @@ struct UserArea { (LLVM_EXTENSION offsetof(UserArea, dbg) + \ LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT @@ -102,10 +100,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]); -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to update the g_register_infos structure // with x86_64 offsets. -//--------------------------------------------------------------------------- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp index e60a03a..bc78c1d 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp @@ -19,18 +19,14 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RegisterContextMacOSXFrameBackchain constructor -//---------------------------------------------------------------------- RegisterContextMacOSXFrameBackchain::RegisterContextMacOSXFrameBackchain( Thread &thread, uint32_t concrete_frame_idx, const UnwindMacOSXFrameBackchain::Cursor &cursor) : RegisterContext(thread, concrete_frame_idx), m_cursor(cursor), m_cursor_is_valid(true) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RegisterContextMacOSXFrameBackchain::~RegisterContextMacOSXFrameBackchain() {} void RegisterContextMacOSXFrameBackchain::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp index 533bcb4..946d4fa 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RegisterContextMemory constructor -//---------------------------------------------------------------------- RegisterContextMemory::RegisterContextMemory(Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo ®_infos, @@ -40,9 +38,7 @@ RegisterContextMemory::RegisterContextMemory(Thread &thread, m_reg_data.SetData(reg_data_sp); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RegisterContextMemory::~RegisterContextMemory() {} void RegisterContextMemory::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h index 072e8b3..68223ea 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h @@ -39,13 +39,11 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ // If all of the thread register are in a contiguous buffer in // memory, then the default ReadRegister/WriteRegister and // ReadAllRegisterValues/WriteAllRegisterValues will work. If thread // registers are not contiguous, clients will want to subclass this // class and modify the read/write functions as needed. - //------------------------------------------------------------------ bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue ®_value) override; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp index d0dc0be..e620ff6 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp @@ -77,10 +77,8 @@ struct UserArea { LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp index 6d2bc1a..c1f141c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp @@ -50,9 +50,7 @@ struct UserArea { #define DR_SIZE sizeof(uint32_t) #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp index a2e82cc..e210196 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp @@ -58,10 +58,8 @@ struct UserArea { #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h index dbb3e6f..1a21a71 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h @@ -16,9 +16,7 @@ class ProcessMonitor; -// --------------------------------------------------------------------------- // Internal codes for all powerpc registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_powerpc, gpr_r0_powerpc = k_first_gpr_powerpc, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h index 1642d52..932f97b 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h @@ -50,9 +50,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //--------------------------------------------------------------------------- // Note: prefer kernel definitions over user-land - //--------------------------------------------------------------------------- enum FPRType { eNotValid = 0, eFSAVE, // TODO diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp index 9cc90f0..c21c02f 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp @@ -54,9 +54,7 @@ void RegisterContextThreadMemory::UpdateRegisterContext() { } } -//------------------------------------------------------------------ // Subclasses must override these functions -//------------------------------------------------------------------ void RegisterContextThreadMemory::InvalidateAllRegisters() { UpdateRegisterContext(); if (m_reg_ctx_sp) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h b/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h index 87e7b7d..2cf39e9 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h @@ -9,9 +9,7 @@ #ifndef liblldb_RegisterContext_s390x_h_ #define liblldb_RegisterContext_s390x_h_ -//--------------------------------------------------------------------------- // SystemZ ehframe, dwarf regnums -//--------------------------------------------------------------------------- // EHFrame and DWARF Register numbers (eRegisterKindEHFrame & // eRegisterKindDWARF) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h index ad004c8..c3b1cab 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h @@ -16,9 +16,7 @@ #include "llvm/Support/Compiler.h" namespace lldb_private { -//--------------------------------------------------------------------------- // i386 ehframe, dwarf regnums -//--------------------------------------------------------------------------- // Register numbers seen in eh_frame (eRegisterKindEHFrame) on i386 systems // (non-Darwin) @@ -131,9 +129,7 @@ enum { dwarf_bnd3_i386, }; -//--------------------------------------------------------------------------- // AMD x86_64, AMD64, Intel EM64T, or Intel 64 ehframe, dwarf regnums -//--------------------------------------------------------------------------- // EHFrame and DWARF Register numbers (eRegisterKindEHFrame & // eRegisterKindDWARF) @@ -241,9 +237,7 @@ enum { // dwarf_k7_x86_64, }; -//--------------------------------------------------------------------------- // Generic floating-point registers -//--------------------------------------------------------------------------- struct MMSReg { uint8_t bytes[10]; @@ -282,9 +276,7 @@ struct FXSAVE { uint8_t padding2[40]; }; -//--------------------------------------------------------------------------- // Extended floating-point registers -//--------------------------------------------------------------------------- struct YMMHReg { uint8_t bytes[16]; // 16 * 8 bits for the high bytes of each YMM register diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h b/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h index 3d87875..4b58e74 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h @@ -15,11 +15,9 @@ namespace lldb_private { -///------------------------------------------------------------------------------ /// \class RegisterInfoInterface /// /// RegisterInfo interface to patch RegisterInfo structure for archs. -///------------------------------------------------------------------------------ class RegisterInfoInterface { public: RegisterInfoInterface(const lldb_private::ArchSpec &target_arch) diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp index 1355c65..118c9ff 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp @@ -43,9 +43,7 @@ using namespace lldb_private; (sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) + \ sizeof(RegisterInfoPOSIX_arm::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm to declare our g_register_infos_arm structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM_STRUCT #include "RegisterInfos_arm.h" #undef DECLARE_REGISTER_INFOS_ARM_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp index e422bef4..14d1119 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp @@ -48,9 +48,7 @@ sizeof(RegisterInfoPOSIX_arm64::FPU) + \ sizeof(RegisterInfoPOSIX_arm64::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM64_STRUCT #include "RegisterInfos_arm64.h" #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp index a0da646..63d35c2 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp @@ -15,9 +15,7 @@ #include "RegisterInfoPOSIX_ppc64le.h" -//----------------------------------------------------------------------------- // Include RegisterInfoPOSIX_ppc64le to declare our g_register_infos_ppc64le -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT #include "RegisterInfos_ppc64le.h" #undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h index 7fa2e0f..74c0581 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h @@ -17,9 +17,7 @@ namespace lldb_private { class StopInfoMachException : public StopInfo { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StopInfoMachException(Thread &thread, uint32_t exc_type, uint32_t exc_data_count, uint64_t exc_code, uint64_t exc_subcode) diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h index 808ef94..c512929 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h @@ -93,7 +93,6 @@ protected: uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, uint32_t starting_frame_num, bool pc_register); - //------------------------------------------------------------------ /// Provide the list of user-specified trap handler functions /// /// The Platform is one source of trap handler function names; that @@ -104,7 +103,6 @@ protected: /// \return /// Vector of ConstStrings of trap handler function names. May be /// empty. - //------------------------------------------------------------------ const std::vector<ConstString> &GetUserSpecifiedTrapHandlerFunctionNames() { return m_user_supplied_trap_handler_functions; } @@ -138,12 +136,10 @@ private: std::vector<ConstString> m_user_supplied_trap_handler_functions; - //----------------------------------------------------------------- // Check if Full UnwindPlan of First frame is valid or not. // If not then try Fallback UnwindPlan of the frame. If Fallback // UnwindPlan succeeds then update the Full UnwindPlan with the // Fallback UnwindPlan. - //----------------------------------------------------------------- void UpdateUnwindPlanForFirstFrameIfInvalid(ABI *abi); CursorSP GetOneMoreFrame(ABI *abi); @@ -152,9 +148,7 @@ private: bool AddFirstFrame(); - //------------------------------------------------------------------ // For UnwindLLDB only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(UnwindLLDB); }; diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h index 573b6be..2208bcc 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h +++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h @@ -46,9 +46,7 @@ private: size_t GetStackFrameData_x86_64(const lldb_private::ExecutionContext &exe_ctx); - //------------------------------------------------------------------ // For UnwindMacOSXFrameBackchain only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(UnwindMacOSXFrameBackchain); }; diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h index 969449d..39cbf01 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all ARM registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_arm = 0, gpr_r0_arm = k_first_gpr_arm, diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h index ea60db7..cc414dc 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all ARM64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_arm64, gpr_x0_arm64 = k_first_gpr_arm64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h index 42bc4b5..d97f771 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all mips registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips64, gpr_zero_mips64 = k_first_gpr_mips64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h index 92a1e6e..2f68b80 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h @@ -13,9 +13,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all mips registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips, gpr_zero_mips = k_first_gpr_mips, @@ -148,9 +146,7 @@ enum { k_num_msa_registers_mips }; -//--------------------------------------------------------------------------- // Internal codes for all mips64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips64, gpr_zero_mips64 = k_first_gpr_mips64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h index fb7eb267..6edf7ee 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h @@ -11,9 +11,7 @@ // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -// --------------------------------------------------------------------------- // Internal codes for all ppc64 registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_ppc64, gpr_r0_ppc64 = k_first_gpr_ppc64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h index 11b22f4..0c381a5 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h @@ -11,9 +11,7 @@ // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -// --------------------------------------------------------------------------- // Internal codes for all ppc64le registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_ppc64le, gpr_r0_ppc64le = k_first_gpr_ppc64le, diff --git a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h index 97baf81..bd66261 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all s390x registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_s390x, lldb_r0_s390x = k_first_gpr_s390x, diff --git a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h index 760aa27..0d2149c 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all i386 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_i386, lldb_eax_i386 = k_first_gpr_i386, @@ -135,9 +133,7 @@ enum { k_num_mpx_registers_i386, }; -//--------------------------------------------------------------------------- // Internal codes for all x86_64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_x86_64, lldb_rax_x86_64 = k_first_gpr_x86_64, diff --git a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h index 04da093..5670130 100644 --- a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h +++ b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h @@ -20,12 +20,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- // DebuggerThread // // Debugs a single process, notifying listeners as appropriate when interesting // things occur. -//---------------------------------------------------------------------- class DebuggerThread : public std::enable_shared_from_this<DebuggerThread> { public: DebuggerThread(DebugDelegateSP debug_delegate); diff --git a/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h b/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h index bc03b97..dcff8d3 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h +++ b/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h @@ -18,12 +18,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- // ExceptionRecord // // ExceptionRecord defines an interface which allows implementors to receive // notification of events that happen in a debugged process. -//---------------------------------------------------------------------- class ExceptionRecord { public: ExceptionRecord(const EXCEPTION_RECORD &record, lldb::tid_t thread_id) { diff --git a/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h b/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h index 59f5cd9..aff2dd6 100644 --- a/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h @@ -18,12 +18,10 @@ namespace lldb_private { class Status; class HostThread; -//---------------------------------------------------------------------- // IDebugDelegate // // IDebugDelegate defines an interface which allows implementors to receive // notification of events that happen in a debugged process. -//---------------------------------------------------------------------- class IDebugDelegate { public: virtual ~IDebugDelegate() {} diff --git a/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h b/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h index 305ba9e..7494dbb 100644 --- a/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h @@ -20,7 +20,6 @@ namespace lldb_private { class ProcessWindows; typedef std::shared_ptr<ProcessWindows> ProcessWindowsSP; -//---------------------------------------------------------------------- // LocalDebugDelegate // // LocalDebugDelegate creates a connection between a ProcessWindows and the @@ -39,7 +38,6 @@ typedef std::shared_ptr<ProcessWindows> ProcessWindowsSP; // a ProcessSP (which is exactly what we are trying to decouple from the // driver), so this adapter serves as a way to transparently hold the // ProcessSP while still keeping it decoupled from the driver. -//---------------------------------------------------------------------- class LocalDebugDelegate : public IDebugDelegate { public: explicit LocalDebugDelegate(lldb::ProcessWP process); diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index e9146b5..e891f6c 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -136,7 +136,6 @@ const char *ProcessWindows::GetPluginDescriptionStatic() { return "Process plugin for Windows"; } -//------------------------------------------------------------------------------ // Constructors and destructors. ProcessWindows::ProcessWindows(lldb::TargetSP target_sp, @@ -161,7 +160,6 @@ size_t ProcessWindows::PutSTDIN(const char *buf, size_t buf_size, return 0; } -//------------------------------------------------------------------------------ // ProcessInterface protocol. lldb_private::ConstString ProcessWindows::GetPluginName() { diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h index 3ef6d56..1b1f173a 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h @@ -25,9 +25,7 @@ class ProcessWindowsData; class ProcessWindows : public Process, public IDebugDelegate { public: - //------------------------------------------------------------------ // Static functions. - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *); @@ -40,9 +38,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ ProcessWindows(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp); ~ProcessWindows(); diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp index 8ca1b5c..d46d338 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp @@ -23,9 +23,7 @@ using namespace lldb_private; const DWORD kWinContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows::RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx) : RegisterContext(thread, concrete_frame_idx), m_context(), @@ -78,9 +76,7 @@ uint32_t RegisterContextWindows::ConvertRegisterKindToRegisterNumber( return LLDB_INVALID_REGNUM; } -//------------------------------------------------------------------ // Subclasses can these functions if desired -//------------------------------------------------------------------ uint32_t RegisterContextWindows::NumSupportedHardwareBreakpoints() { // Support for hardware breakpoints not yet implemented. return 0; diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h index e269af9..916f9f3 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows : public lldb_private::RegisterContext { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ void InvalidateAllRegisters() override; bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; @@ -37,9 +33,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ // Subclasses can override these functions if desired - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp index 6c92d09..9b0e1d4 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp @@ -172,9 +172,7 @@ RegisterSet g_register_sets[] = { }; } -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows_x64::RegisterContextWindows_x64( Thread &thread, uint32_t concrete_frame_idx) : RegisterContextWindows(thread, concrete_frame_idx) {} diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h index 68793bf..5f252e1 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows_x64 : public RegisterContextWindows { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows_x64(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows_x64(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ size_t GetRegisterCount() override; const RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp index b2c64a9..0c25853 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp @@ -142,9 +142,7 @@ RegisterSet g_register_sets[] = { }; } -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows_x86::RegisterContextWindows_x86( Thread &thread, uint32_t concrete_frame_idx) : RegisterContextWindows(thread, concrete_frame_idx) {} diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h index 7823ff9..8dca1dc 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows_x86 : public RegisterContextWindows { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows_x86(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows_x86(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ size_t GetRegisterCount() override; const RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index 21c9be55..25074f85 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -90,17 +90,13 @@ bool ProcessElfCore::CanDebug(lldb::TargetSP target_sp, return false; } -//---------------------------------------------------------------------- // ProcessElfCore constructor -//---------------------------------------------------------------------- ProcessElfCore::ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec &core_file) : Process(target_sp, listener_sp), m_core_file(core_file) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessElfCore::~ProcessElfCore() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -110,9 +106,7 @@ ProcessElfCore::~ProcessElfCore() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessElfCore::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessElfCore::GetPluginVersion() { return 1; } @@ -146,9 +140,7 @@ lldb::addr_t ProcessElfCore::AddAddressRangeFromLoadSegment( return addr; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessElfCore::DoLoadCore() { Status error; if (!m_core_module_sp) { @@ -279,15 +271,11 @@ void ProcessElfCore::RefreshStateAfterStop() {} Status ProcessElfCore::DoDestroy() { return Status(); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessElfCore::IsAlive() { return true; } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessElfCore::ReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h index 328474e..6828f5a 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h @@ -30,9 +30,7 @@ struct ThreadData; class ProcessElfCore : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -45,37 +43,27 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec &core_file); ~ProcessElfCore() override; - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status DoLoadCore() override; lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status DoDestroy() override; void RefreshStateAfterStop() override; @@ -88,16 +76,12 @@ public: return error; } - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; bool WarnBeforeDetach() const override { return false; } - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -131,9 +115,7 @@ private: lldb_private::ConstString path; }; - //------------------------------------------------------------------ // For ProcessElfCore only - //------------------------------------------------------------------ typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange> VMRangeToFileOffset; diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp index 948f52c..a5d1fc4 100644 --- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp @@ -43,9 +43,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Construct a Thread object with given data -//---------------------------------------------------------------------- ThreadElfCore::ThreadElfCore(Process &process, const ThreadData &td) : Thread(process, td.tid), m_thread_name(td.name), m_thread_reg_ctx_sp(), m_signo(td.signo), m_gpregset_data(td.gpregset), m_notes(td.notes) {} @@ -248,9 +246,7 @@ bool ThreadElfCore::CalculateStopInfo() { return false; } -//---------------------------------------------------------------- // Parse PRSTATUS from NOTE entry -//---------------------------------------------------------------- ELFLinuxPrStatus::ELFLinuxPrStatus() { memset(this, 0, sizeof(ELFLinuxPrStatus)); } @@ -324,9 +320,7 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } -//---------------------------------------------------------------- // Parse PRPSINFO from NOTE entry -//---------------------------------------------------------------- ELFLinuxPrPsInfo::ELFLinuxPrPsInfo() { memset(this, 0, sizeof(ELFLinuxPrPsInfo)); } @@ -402,9 +396,7 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data, return error; } -//---------------------------------------------------------------- // Parse SIGINFO from NOTE entry -//---------------------------------------------------------------- ELFLinuxSigInfo::ELFLinuxSigInfo() { memset(this, 0, sizeof(ELFLinuxSigInfo)); } size_t ELFLinuxSigInfo::GetSize(const lldb_private::ArchSpec &arch) { diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h index f0cc4da..13291d5 100644 --- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h +++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h @@ -161,9 +161,7 @@ public: } protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; lldb::RegisterContextSP m_thread_reg_ctx_sp; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 228b797..c5a4497 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -53,9 +53,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteCommunication constructor -//---------------------------------------------------------------------- GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name, const char *listener_name) : Communication(comm_name), @@ -69,9 +67,7 @@ GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name, m_listen_url() { } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunication::~GDBRemoteCommunication() { if (IsConnected()) { Disconnect(); @@ -300,7 +296,6 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, case eConnectionStatusTimedOut: case eConnectionStatusInterrupted: if (sync_on_timeout) { - //------------------------------------------------------------------ /// Sync the remote GDB server and make sure we get a response that /// corresponds to what we send. /// @@ -323,7 +318,6 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, /// packets. So if we timeout, we need to ensure that we can get /// back on track. If we can't get back on track, we must /// disconnect. - //------------------------------------------------------------------ bool sync_success = false; bool got_actual_response = false; // We timed out, we need to sync back up with the diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index 4ef2224..e3dc9d2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -109,13 +109,11 @@ public: bool GetSendAcks() { return m_send_acks; } - //------------------------------------------------------------------ // Set the global packet timeout. // // For clients, this is the timeout that gets used when sending // packets and waiting for responses. For servers, this is used when waiting // for ACKs. - //------------------------------------------------------------------ std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout) { const auto old_packet_timeout = m_packet_timeout; m_packet_timeout = packet_timeout; @@ -124,10 +122,8 @@ public: std::chrono::seconds GetPacketTimeout() const { return m_packet_timeout; } - //------------------------------------------------------------------ // Start a debugserver instance on the current host using the // supplied connection URL. - //------------------------------------------------------------------ Status StartDebugserverProcess( const char *url, Platform *platform, // If non nullptr, then check with the platform for diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 60d33cc..5e310aa 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -48,9 +48,7 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; using namespace std::chrono; -//---------------------------------------------------------------------- // GDBRemoteCommunicationClient constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() : GDBRemoteClientBase("gdb-remote.client", "gdb-remote.client.rx_packet"), m_supports_not_sending_acks(eLazyBoolCalculate), @@ -105,9 +103,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() m_supported_async_json_packets_sp(), m_qXfer_memory_map(), m_qXfer_memory_map_loaded(false) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient() { if (IsConnected()) Disconnect(); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 6cbb44d..0210aac 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -33,10 +33,8 @@ public: ~GDBRemoteCommunicationClient() override; - //------------------------------------------------------------------ // After connecting, send the handshake to the server to make sure // we are communicating with it. - //------------------------------------------------------------------ bool HandshakeWithServer(Status *error_ptr); // For packets which specify a range of output to be returned, @@ -84,7 +82,6 @@ public: bool KillSpawnedProcess(lldb::pid_t pid); - //------------------------------------------------------------------ /// Sends a GDB remote protocol 'A' packet that delivers program /// arguments to the remote server. /// @@ -97,10 +94,8 @@ public: /// the response was "Exx" where xx are two hex digits, or /// -1 if the call is unsupported or any other unexpected /// response was received. - //------------------------------------------------------------------ int SendArgumentsPacket(const ProcessLaunchInfo &launch_info); - //------------------------------------------------------------------ /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the /// environment that will get used when launching an application /// in conjunction with the 'A' packet. This function can be called @@ -116,7 +111,6 @@ public: /// the response was "Exx" where xx are two hex digits, or /// -1 if the call is unsupported or any other unexpected /// response was received. - //------------------------------------------------------------------ int SendEnvironmentPacket(char const *name_equal_value); int SendEnvironment(const Environment &env); @@ -125,7 +119,6 @@ public: int SendLaunchEventDataPacket(const char *data, bool *was_supported = nullptr); - //------------------------------------------------------------------ /// Sends a "vAttach:PID" where PID is in hex. /// /// \param[in] pid @@ -139,10 +132,8 @@ public: /// \return /// Zero if the attach was successful, or an error indicating /// an error code. - //------------------------------------------------------------------ int SendAttach(lldb::pid_t pid, StringExtractorGDBRemote &response); - //------------------------------------------------------------------ /// Sends a GDB remote protocol 'I' packet that delivers stdin /// data to the remote process. /// @@ -155,10 +146,8 @@ public: /// \return /// Zero if the attach was successful, or an error indicating /// an error code. - //------------------------------------------------------------------ int SendStdinNotification(const char *data, size_t data_len); - //------------------------------------------------------------------ /// Sets the path to use for stdin/out/err for a process /// that will be launched with the 'A' packet. /// @@ -167,12 +156,10 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetSTDIN(const FileSpec &file_spec); int SetSTDOUT(const FileSpec &file_spec); int SetSTDERR(const FileSpec &file_spec); - //------------------------------------------------------------------ /// Sets the disable ASLR flag to \a enable for a process that will /// be launched with the 'A' packet. /// @@ -181,10 +168,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetDisableASLR(bool enable); - //------------------------------------------------------------------ /// Sets the DetachOnError flag to \a enable for the process controlled by the /// stub. /// @@ -193,10 +178,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetDetachOnError(bool enable); - //------------------------------------------------------------------ /// Sets the working directory to \a path for a process that will /// be launched with the 'A' packet for non platform based /// connections. If this packet is sent to a GDB server that @@ -208,10 +191,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetWorkingDir(const FileSpec &working_dir); - //------------------------------------------------------------------ /// Gets the current working directory of a remote platform GDB /// server. /// @@ -220,7 +201,6 @@ public: /// /// \return /// Boolean for success - //------------------------------------------------------------------ bool GetWorkingDir(FileSpec &working_dir); lldb::addr_t AllocateMemory(size_t size, uint32_t permissions); @@ -455,7 +435,6 @@ public: // Sends QPassSignals packet to the server with given signals to ignore. Status SendSignalsToIgnore(llvm::ArrayRef<int32_t> signals); - //------------------------------------------------------------------ /// Return the feature set supported by the gdb-remote server. /// /// This method returns the remote side's response to the qSupported @@ -464,12 +443,10 @@ public: /// /// \return /// The string returned by the server to the qSupported query. - //------------------------------------------------------------------ const std::string &GetServerSupportedFeatures() const { return m_qSupported_response; } - //------------------------------------------------------------------ /// Return the array of async JSON packet types supported by the remote. /// /// This method returns the remote side's array of supported JSON @@ -487,14 +464,11 @@ public: /// /// \return /// The string returned by the server to the qSupported query. - //------------------------------------------------------------------ lldb_private::StructuredData::Array *GetSupportedStructuredDataPlugins(); - //------------------------------------------------------------------ /// Configure a StructuredData feature on the remote end. /// /// \see \b Process::ConfigureStructuredData(...) for details. - //------------------------------------------------------------------ Status ConfigureRemoteStructuredData(ConstString type_name, const StructuredData::ObjectSP &config_sp); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 5bc0c25..3e8fb9f 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -55,9 +55,7 @@ const static uint32_t g_default_packet_timeout_sec = 20; // seconds const static uint32_t g_default_packet_timeout_sec = 0; // not specified #endif -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerCommon constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon( const char *comm_name, const char *listener_name) : GDBRemoteCommunicationServer(comm_name, listener_name), @@ -176,9 +174,7 @@ GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon( &GDBRemoteCommunicationServerCommon::Handle_vFile_unlink); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerCommon::~GDBRemoteCommunicationServerCommon() {} GDBRemoteCommunication::PacketResult diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h index d061586..bc32211 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h @@ -131,7 +131,6 @@ protected: }); } - //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar @@ -141,7 +140,6 @@ protected: /// \return /// An Status object indicating the success or failure of the /// launch. - //------------------------------------------------------------------ virtual Status LaunchProcess() = 0; virtual FileSpec FindModuleFile(const std::string &module_path, diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index c4b5c69..045f4b4 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -51,9 +51,7 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; using namespace llvm; -//---------------------------------------------------------------------- // GDBRemote Errors -//---------------------------------------------------------------------- namespace { enum GDBRemoteServerError { @@ -65,9 +63,7 @@ enum GDBRemoteServerError { }; } -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerLLGS constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory) : GDBRemoteCommunicationServerCommon("gdb-remote.server", diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index 786910e..1609174 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -31,16 +31,13 @@ class GDBRemoteCommunicationServerLLGS : public GDBRemoteCommunicationServerCommon, public NativeProcessProtocol::NativeDelegate { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory); void SetLaunchInfo(const ProcessLaunchInfo &info); - //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar @@ -50,10 +47,8 @@ public: /// \return /// An Status object indicating the success or failure of the /// launch. - //------------------------------------------------------------------ Status LaunchProcess() override; - //------------------------------------------------------------------ /// Attach to a process. /// /// This method supports attaching llgs to a process accessible via the @@ -62,12 +57,9 @@ public: /// \return /// An Status object indicating the success or failure of the /// attach operation. - //------------------------------------------------------------------ Status AttachToProcess(lldb::pid_t pid); - //------------------------------------------------------------------ // NativeProcessProtocol::NativeDelegate overrides - //------------------------------------------------------------------ void InitializeDelegate(NativeProcessProtocol *process) override; void ProcessStateChanged(NativeProcessProtocol *process, @@ -222,9 +214,7 @@ private: void StopSTDIOForwarding(); - //------------------------------------------------------------------ // For GDBRemoteCommunicationServerLLGS only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServerLLGS); }; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index e19eb23..32e4452 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -40,9 +40,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerPlatform constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( const Socket::SocketProtocol socket_protocol, const char *socket_scheme) : GDBRemoteCommunicationServerCommon("gdb-remote.server", @@ -86,9 +84,7 @@ GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( }); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerPlatform::~GDBRemoteCommunicationServerPlatform() {} Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer( diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h index f0ee77d..eacc99a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h @@ -35,7 +35,6 @@ public: // a port chosen by the OS. void SetPortMap(PortMap &&port_map); - //---------------------------------------------------------------------- // If we are using a port map where we can only use certain ports, // get the next available port. // @@ -43,7 +42,6 @@ public: // // If we aren't using a port map, return 0 to indicate we should bind to // port 0 and then figure out which port we used. - //---------------------------------------------------------------------- uint16_t GetNextAvailablePort(); bool AssociatePortWithProcess(uint16_t port, lldb::pid_t pid); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index a51c693..56ee0a1 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteRegisterContext constructor -//---------------------------------------------------------------------- GDBRemoteRegisterContext::GDBRemoteRegisterContext( ThreadGDBRemote &thread, uint32_t concrete_frame_idx, GDBRemoteDynamicRegisterInfo ®_info, bool read_all_at_once) @@ -48,9 +46,7 @@ GDBRemoteRegisterContext::GDBRemoteRegisterContext( m_reg_data.SetByteOrder(thread.GetProcess()->GetByteOrder()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteRegisterContext::~GDBRemoteRegisterContext() {} void GDBRemoteRegisterContext::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a5efbc0..15975f68 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -288,9 +288,7 @@ bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp, return true; } -//---------------------------------------------------------------------- // ProcessGDBRemote constructor -//---------------------------------------------------------------------- ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, ListenerSP listener_sp) : Process(target_sp, listener_sp), @@ -353,9 +351,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, m_gdb_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessGDBRemote::~ProcessGDBRemote() { // m_mach_process.UnregisterNotificationCallbacks (this); Clear(); @@ -373,9 +369,7 @@ ProcessGDBRemote::~ProcessGDBRemote() { KillDebugserverProcess(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessGDBRemote::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessGDBRemote::GetPluginVersion() { return 1; } @@ -809,9 +803,7 @@ Status ProcessGDBRemote::WillLaunchOrAttach() { return error; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module, ProcessLaunchInfo &launch_info) { Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); @@ -2724,9 +2716,7 @@ void ProcessGDBRemote::SetUnixSignals(const UnixSignalsSP &signals_sp) { Process::SetUnixSignals(std::make_shared<GDBRemoteSignals>(signals_sp)); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessGDBRemote::IsAlive() { return m_gdb_comm.IsConnected() && Process::IsAlive(); @@ -2770,9 +2760,7 @@ void ProcessGDBRemote::WillPublicStop() { } } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessGDBRemote::DoReadMemory(addr_t addr, void *buf, size_t size, Status &error) { GetMaxMemorySize(); @@ -3133,9 +3121,7 @@ Status ProcessGDBRemote::DoDeallocateMemory(lldb::addr_t addr) { return error; } -//------------------------------------------------------------------ // Process STDIO -//------------------------------------------------------------------ size_t ProcessGDBRemote::PutSTDIN(const char *src, size_t src_len, Status &error) { if (m_stdio_communication.IsConnected()) { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index efa7d28..a82b095 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -67,17 +67,13 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; CommandObject *GetPluginCommandObject() override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ Status WillLaunch(Module *module) override; Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) override; @@ -102,16 +98,12 @@ public: void DidAttach(ArchSpec &process_arch) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ Status WillResume() override; Status DoResume() override; @@ -130,18 +122,14 @@ public: void SetUnixSignals(const lldb::UnixSignalsSP &signals_sp); - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; lldb::addr_t GetImageInfoAddress() override; void WillPublicStop() override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) override; @@ -159,21 +147,15 @@ public: Status DoDeallocateMemory(lldb::addr_t ptr) override; - //------------------------------------------------------------------ // Process STDIO - //------------------------------------------------------------------ size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) override; - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- Status EnableBreakpointSite(BreakpointSite *bp_site) override; Status DisableBreakpointSite(BreakpointSite *bp_site) override; - //---------------------------------------------------------------------- // Process Watchpoints - //---------------------------------------------------------------------- Status EnableWatchpoint(Watchpoint *wp, bool notify = true) override; Status DisableWatchpoint(Watchpoint *wp, bool notify = true) override; @@ -205,9 +187,7 @@ public: Status SendEventData(const char *data) override; - //---------------------------------------------------------------------- // Override DidExit so we can disconnect from the remote GDB server - //---------------------------------------------------------------------- void DidExit() override; void SetUserSpecifiedMaxMemoryTransferSize(uint64_t user_specified_max); @@ -255,9 +235,7 @@ protected: friend class GDBRemoteCommunicationClient; friend class GDBRemoteRegisterContext; - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitAsyncContinue = (1 << 0), eBroadcastBitAsyncThreadShouldExit = (1 << 1), @@ -312,9 +290,7 @@ protected: using FlashRange = FlashRangeVector::Entry; FlashRangeVector m_erased_flash_ranges; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- bool IsRunning(lldb::StateType state) { return state == lldb::eStateRunning || IsStepping(state); } @@ -427,9 +403,7 @@ protected: bool HasErased(FlashRange range); private: - //------------------------------------------------------------------ // For ProcessGDBRemote only - //------------------------------------------------------------------ std::string m_partial_profile_data; std::map<uint64_t, uint32_t> m_thread_id_to_used_usec_map; uint64_t m_last_signals_version = 0; @@ -439,9 +413,7 @@ private: lldb::user_id_t break_id, lldb::user_id_t break_loc_id); - //------------------------------------------------------------------ // ContinueDelegate interface - //------------------------------------------------------------------ void HandleAsyncStdout(llvm::StringRef out) override; void HandleAsyncMisc(llvm::StringRef data) override; void HandleStopReply() override; diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 9f9fcca..6607bce 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -31,9 +31,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadGDBRemote::ThreadGDBRemote(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp index ed2cb7f..f27c80b 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -104,9 +104,7 @@ bool ProcessMachCore::CanDebug(lldb::TargetSP target_sp, return false; } -//---------------------------------------------------------------------- // ProcessMachCore constructor -//---------------------------------------------------------------------- ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp, ListenerSP listener_sp, const FileSpec &core_file) @@ -115,9 +113,7 @@ ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp, m_dyld_addr(LLDB_INVALID_ADDRESS), m_mach_kernel_addr(LLDB_INVALID_ADDRESS), m_dyld_plugin_name() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessMachCore::~ProcessMachCore() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -127,9 +123,7 @@ ProcessMachCore::~ProcessMachCore() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessMachCore::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessMachCore::GetPluginVersion() { return 1; } @@ -191,9 +185,7 @@ bool ProcessMachCore::GetDynamicLoaderAddress(lldb::addr_t addr) { return false; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessMachCore::DoLoadCore() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_PROCESS)); @@ -493,17 +485,13 @@ void ProcessMachCore::RefreshStateAfterStop() { Status ProcessMachCore::DoDestroy() { return Status(); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessMachCore::IsAlive() { return true; } bool ProcessMachCore::WarnBeforeDetach() const { return false; } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessMachCore::ReadMemory(addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since @@ -517,7 +505,6 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, size_t bytes_read = 0; if (core_objfile) { - //---------------------------------------------------------------------- // Segments are not always contiguous in mach-o core files. We have core // files that have segments like: // Address Size File off File size @@ -534,7 +521,6 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, // We would attempt to read 32 bytes from 0xf6ff0 but would only get 16 // unless we loop through consecutive memory ranges that are contiguous in // the address space, but not in the file data. - //---------------------------------------------------------------------- while (bytes_read < size) { const addr_t curr_addr = addr + bytes_read; const VMRangeToFileOffset::Entry *core_memory_entry = diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h index e973679..3e446f6 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h @@ -20,9 +20,7 @@ class ThreadKDP; class ProcessMachCore : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessMachCore(lldb::TargetSP target_sp, lldb::ListenerSP listener, const lldb_private::FileSpec &core_file); @@ -40,43 +38,31 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status DoLoadCore() override; lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status DoDestroy() override; void RefreshStateAfterStop() override; - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; bool WarnBeforeDetach() const override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -107,7 +93,6 @@ private: eKernelCorefile } CorefilePreferences; - //------------------------------------------------------------------ /// If a core file can be interpreted multiple ways, this establishes /// which style wins. /// @@ -117,7 +102,6 @@ private: /// memory. Or it could be a user process coredump of lldb while doing /// kernel debugging - so a copy of the kernel is in its heap. This /// should become a setting so it can be over-ridden when necessary. - //------------------------------------------------------------------ CorefilePreference GetCorefilePreference() { // For now, if both user process and kernel binaries a present, // assume this is a kernel coredump which has a copy of a user @@ -125,9 +109,7 @@ private: return eKernelCorefile; } - //------------------------------------------------------------------ // For ProcessMachCore only - //------------------------------------------------------------------ typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange> VMRangeToFileOffset; diff --git a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp index 3b128db..b71e484 100644 --- a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadMachCore::ThreadMachCore(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h index baaec42..ac5957e 100644 --- a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h @@ -52,17 +52,13 @@ public: protected: friend class ProcessMachCore; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; std::string m_dispatch_queue_name; lldb::addr_t m_thread_dispatch_qaddr; lldb::RegisterContextSP m_thread_reg_ctx_sp; - //------------------------------------------------------------------ // Protected member functions. - //------------------------------------------------------------------ bool CalculateStopInfo() override; }; diff --git a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h index 2b0e272..23a8473 100644 --- a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h +++ b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h @@ -25,9 +25,7 @@ public: void ExecuteInterpreterLoop() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -39,9 +37,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index f11192b..ef4f738 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -33,9 +33,7 @@ void StructuredPythonObject::Dump(Stream &s, bool pretty_print) const { s << "Python Obj: 0x" << GetValue(); } -//---------------------------------------------------------------------- // PythonObject -//---------------------------------------------------------------------- void PythonObject::Dump(Stream &strm) const { if (m_py_obj) { @@ -202,9 +200,7 @@ StructuredData::ObjectSP PythonObject::CreateStructuredObject() const { } } -//---------------------------------------------------------------------- // PythonString -//---------------------------------------------------------------------- PythonBytes::PythonBytes() : PythonObject() {} PythonBytes::PythonBytes(llvm::ArrayRef<uint8_t> bytes) : PythonObject() { @@ -338,9 +334,7 @@ StructuredData::StringSP PythonByteArray::CreateStructuredString() const { return result; } -//---------------------------------------------------------------------- // PythonString -//---------------------------------------------------------------------- PythonString::PythonString(PyRefType type, PyObject *py_obj) : PythonObject() { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string @@ -438,9 +432,7 @@ StructuredData::StringSP PythonString::CreateStructuredString() const { return result; } -//---------------------------------------------------------------------- // PythonInteger -//---------------------------------------------------------------------- PythonInteger::PythonInteger() : PythonObject() {} @@ -530,9 +522,7 @@ StructuredData::IntegerSP PythonInteger::CreateStructuredInteger() const { return result; } -//---------------------------------------------------------------------- // PythonBoolean -//---------------------------------------------------------------------- PythonBoolean::PythonBoolean(PyRefType type, PyObject *py_obj) : PythonObject() { @@ -579,9 +569,7 @@ StructuredData::BooleanSP PythonBoolean::CreateStructuredBoolean() const { return result; } -//---------------------------------------------------------------------- // PythonList -//---------------------------------------------------------------------- PythonList::PythonList(PyInitialValue value) : PythonObject() { if (value == PyInitialValue::Empty) @@ -660,9 +648,7 @@ StructuredData::ArraySP PythonList::CreateStructuredArray() const { return result; } -//---------------------------------------------------------------------- // PythonTuple -//---------------------------------------------------------------------- PythonTuple::PythonTuple(PyInitialValue value) : PythonObject() { if (value == PyInitialValue::Empty) @@ -756,9 +742,7 @@ StructuredData::ArraySP PythonTuple::CreateStructuredArray() const { return result; } -//---------------------------------------------------------------------- // PythonDictionary -//---------------------------------------------------------------------- PythonDictionary::PythonDictionary(PyInitialValue value) : PythonObject() { if (value == PyInitialValue::Empty) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index d30855d..7a0cf74 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -267,9 +267,7 @@ public: m_command_thread_state = s; } - //---------------------------------------------------------------------- // IOHandlerDelegate - //---------------------------------------------------------------------- void IOHandlerActivated(IOHandler &io_handler, bool interactive) override; void IOHandlerInputComplete(IOHandler &io_handler, @@ -278,9 +276,7 @@ public: static lldb::ScriptInterpreterSP CreateInstance(CommandInterpreter &interpreter); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp index 3ab5061..3994dd0 100644 --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -39,9 +39,7 @@ using namespace lldb_private; #pragma mark - #pragma mark Anonymous Namespace -// ----------------------------------------------------------------------------- // Anonymous namespace -// ----------------------------------------------------------------------------- namespace sddarwinlog_private { const uint64_t NANOS_PER_MICRO = 1000; @@ -52,13 +50,11 @@ const uint64_t NANOS_PER_HOUR = NANOS_PER_MINUTE * 60; static bool DEFAULT_FILTER_FALLTHROUGH_ACCEPTS = true; -//------------------------------------------------------------------ /// Global, sticky enable switch. If true, the user has explicitly /// run the enable command. When a process launches or is attached to, /// we will enable DarwinLog if either the settings for auto-enable is /// on, or if the user had explicitly run enable at some point prior /// to the launch/attach. -//------------------------------------------------------------------ static bool s_is_explicitly_enabled; class EnableOptions; @@ -106,9 +102,7 @@ void SetGlobalEnableOptions(const DebuggerSP &debugger_sp, #pragma mark - #pragma mark Settings Handling -//------------------------------------------------------------------ /// Code to handle the StructuredDataDarwinLog settings -//------------------------------------------------------------------ static constexpr PropertyDefinition g_properties[] = { { @@ -391,12 +385,10 @@ static void RegisterFilterOperations() { // Commands // ========================================================================= -// ------------------------------------------------------------------------- /// Provides the main on-off switch for enabling darwin logging. /// /// It is valid to run the enable command when logging is already enabled. /// This resets the logging with whatever settings are currently set. -// ------------------------------------------------------------------------- static constexpr OptionDefinition g_enable_option_table[] = { // Source stream include/exclude options (the first-level filter). This one @@ -890,9 +882,7 @@ private: EnableOptionsSP m_options_sp; }; -// ------------------------------------------------------------------------- /// Provides the status command. -// ------------------------------------------------------------------------- class StatusCommand : public CommandObjectParsed { public: StatusCommand(CommandInterpreter &interpreter) @@ -968,9 +958,7 @@ protected: } }; -// ------------------------------------------------------------------------- /// Provides the darwin-log base command -// ------------------------------------------------------------------------- class BaseCommand : public CommandObjectMultiword { public: BaseCommand(CommandInterpreter &interpreter) @@ -1082,9 +1070,7 @@ using namespace sddarwinlog_private; #pragma mark - #pragma mark Public static API -// ----------------------------------------------------------------------------- // Public static API -// ----------------------------------------------------------------------------- void StructuredDataDarwinLog::Initialize() { RegisterFilterOperations(); @@ -1105,9 +1091,7 @@ ConstString StructuredDataDarwinLog::GetStaticPluginName() { #pragma mark - #pragma mark PluginInterface API -// ----------------------------------------------------------------------------- // PluginInterface API -// ----------------------------------------------------------------------------- ConstString StructuredDataDarwinLog::GetPluginName() { return GetStaticPluginName(); @@ -1118,9 +1102,7 @@ uint32_t StructuredDataDarwinLog::GetPluginVersion() { return 1; } #pragma mark - #pragma mark StructuredDataPlugin API -// ----------------------------------------------------------------------------- // StructuredDataPlugin API -// ----------------------------------------------------------------------------- bool StructuredDataDarwinLog::SupportsStructuredDataType( ConstString type_name) { @@ -1370,9 +1352,7 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process, EnableNow(); } -// ----------------------------------------------------------------------------- // public destructor -// ----------------------------------------------------------------------------- StructuredDataDarwinLog::~StructuredDataDarwinLog() { if (m_breakpoint_id != LLDB_INVALID_BREAK_ID) { @@ -1387,9 +1367,7 @@ StructuredDataDarwinLog::~StructuredDataDarwinLog() { #pragma mark - #pragma mark Private instance methods -// ----------------------------------------------------------------------------- // Private constructors -// ----------------------------------------------------------------------------- StructuredDataDarwinLog::StructuredDataDarwinLog(const ProcessWP &process_wp) : StructuredDataPlugin(process_wp), m_recorded_first_timestamp(false), @@ -1397,9 +1375,7 @@ StructuredDataDarwinLog::StructuredDataDarwinLog(const ProcessWP &process_wp) m_added_breakpoint_mutex(), m_added_breakpoint(), m_breakpoint_id(LLDB_INVALID_BREAK_ID) {} -// ----------------------------------------------------------------------------- // Private static methods -// ----------------------------------------------------------------------------- StructuredDataPluginSP StructuredDataDarwinLog::CreateInstance(Process &process) { diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h index d17e3cb..7ff3721 100644 --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h @@ -24,9 +24,7 @@ class StructuredDataDarwinLog : public StructuredDataPlugin { friend sddarwinlog_private::EnableCommand; public: - // ------------------------------------------------------------------------- // Public static API - // ------------------------------------------------------------------------- static void Initialize(); @@ -34,7 +32,6 @@ public: static ConstString GetStaticPluginName(); - // ------------------------------------------------------------------------- /// Return whether the DarwinLog functionality is enabled. /// /// The DarwinLog functionality is enabled if the user expicitly enabled @@ -45,20 +42,15 @@ public: /// \return /// True if DarwinLog support is/will be enabled for existing or /// newly launched/attached processes. - // ------------------------------------------------------------------------- static bool IsEnabled(); - // ------------------------------------------------------------------------- // PluginInterface API - // ------------------------------------------------------------------------- ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - // ------------------------------------------------------------------------- // StructuredDataPlugin API - // ------------------------------------------------------------------------- bool SupportsStructuredDataType(ConstString type_name) override; @@ -76,15 +68,11 @@ public: ~StructuredDataDarwinLog(); private: - // ------------------------------------------------------------------------- // Private constructors - // ------------------------------------------------------------------------- StructuredDataDarwinLog(const lldb::ProcessWP &process_wp); - // ------------------------------------------------------------------------- // Private static methods - // ------------------------------------------------------------------------- static lldb::StructuredDataPluginSP CreateInstance(Process &process); @@ -98,16 +86,12 @@ private: static Status FilterLaunchInfo(ProcessLaunchInfo &launch_info, Target *target); - // ------------------------------------------------------------------------- // Internal helper methods used by friend classes - // ------------------------------------------------------------------------- void SetEnabled(bool enabled); void AddInitCompletionHook(Process &process); - // ------------------------------------------------------------------------- // Private methods - // ------------------------------------------------------------------------- void DumpTimestamp(Stream &stream, uint64_t timestamp); @@ -116,16 +100,12 @@ private: size_t HandleDisplayOfEvent(const StructuredData::Dictionary &event, Stream &stream); - // ------------------------------------------------------------------------- /// Call the enable command again, using whatever settings were initially /// made. - // ------------------------------------------------------------------------- void EnableNow(); - // ------------------------------------------------------------------------- // Private data - // ------------------------------------------------------------------------- bool m_recorded_first_timestamp; uint64_t m_first_timestamp_seen; bool m_is_enabled; diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h index 42bb118..2760a5a 100644 --- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h +++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h @@ -20,9 +20,7 @@ namespace breakpad { class SymbolFileBreakpad : public SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static void DebuggerInitialize(Debugger &debugger) {} @@ -36,9 +34,7 @@ public: return new SymbolFileBreakpad(obj_file); } - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileBreakpad(ObjectFile *object_file) : SymbolFile(object_file) {} ~SymbolFileBreakpad() override {} @@ -47,9 +43,7 @@ public: void InitializeObject() override {} - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp index 626d1a9..fd6f66b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp @@ -51,14 +51,12 @@ DIERef::DIERef(const DWARFFormValue &form_value) } lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf) const { - //---------------------------------------------------------------------- // Each SymbolFileDWARF will set its ID to what is expected. // // SymbolFileDWARF, when used for DWARF with .o files on MacOSX, has the // ID set to the compile unit index. // // SymbolFileDWARFDwo sets the ID to the compile unit offset. - //---------------------------------------------------------------------- if (dwarf && die_offset != DW_INVALID_OFFSET) return dwarf->GetID() | die_offset; else diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h index a867a5f..b2bb4de 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h @@ -20,22 +20,18 @@ struct DIERef { DIERef(dw_offset_t c, dw_offset_t d) : cu_offset(c), die_offset(d) {} - //---------------------------------------------------------------------- // In order to properly decode a lldb::user_id_t back into a DIERef we // need the DWARF file since it knows if DWARF in .o files is being used // (MacOSX) or if DWO files are being used. The encoding of the user ID // differs between the two types of DWARF. - //---------------------------------------------------------------------- explicit DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf); explicit DIERef(const DWARFFormValue &form_value); - //---------------------------------------------------------------------- // In order to properly encode a DIERef unto a lldb::user_id_t we need // the DWARF file since it knows if DWARF in .o files is being used // (MacOSX) or if DWO files are being used. The encoding of the user ID // differs between the two types of DWARF. - //---------------------------------------------------------------------- lldb::user_id_t GetUID(SymbolFileDWARF *dwarf) const; bool operator<(const DIERef &ref) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 63617c2..360c1249 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2115,7 +2115,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die, return false; #if defined LLDB_CONFIGURATION_DEBUG - //---------------------------------------------------------------------- // For debugging purposes, the LLDB_DWARF_DONT_COMPLETE_TYPENAMES environment // variable can be set with one or more typenames separated by ';' // characters. This will cause this function to not complete any types whose @@ -2125,7 +2124,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die, // // LLDB_DWARF_DONT_COMPLETE_TYPENAMES=Foo // LLDB_DWARF_DONT_COMPLETE_TYPENAMES=Foo;Bar;Baz - //---------------------------------------------------------------------- const char *dont_complete_typenames_cstr = getenv("LLDB_DWARF_DONT_COMPLETE_TYPENAMES"); if (dont_complete_typenames_cstr && dont_complete_typenames_cstr[0]) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h index 38cd0bf..e561ac5 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h @@ -128,10 +128,8 @@ protected: lldb::TypeSP ParseTypeFromDWO(const DWARFDIE &die, lldb_private::Log *log); - //---------------------------------------------------------------------- // Return true if this type is a declaration to a type in an external // module. - //---------------------------------------------------------------------- lldb::ModuleSP GetModuleForType(const DWARFDIE &die); typedef llvm::SmallPtrSet<const DWARFDebugInfoEntry *, 4> DIEPointerSet; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h index 486572a..278c2b6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h @@ -37,9 +37,7 @@ public: : m_cu(const_cast<DWARFUnit *>(cu)), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {} - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- explicit operator bool() const { return IsValid(); } bool IsValid() const { return m_cu && m_die; } @@ -48,9 +46,7 @@ public: bool Supports_DW_AT_APPLE_objc_complete_type() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- SymbolFileDWARF *GetDWARF() const; DWARFUnit *GetCU() const { return m_cu; } @@ -77,31 +73,25 @@ public: m_die = nullptr; } - //---------------------------------------------------------------------- // Get the data that contains the attribute values for this DIE. Support // for .debug_types means that any DIE can have its data either in the // .debug_info or the .debug_types section; this method will return the // correct section data. // // Clients must validate that this object is valid before calling this. - //---------------------------------------------------------------------- const lldb_private::DWARFDataExtractor &GetData() const; - //---------------------------------------------------------------------- // Accessing information about a DIE - //---------------------------------------------------------------------- dw_tag_t Tag() const; const char *GetTagAsCString() const; dw_offset_t GetOffset() const; - //---------------------------------------------------------------------- // Get the LLDB user ID for this DIE. This is often just the DIE offset, // but it might have a SymbolFileDWARF::GetID() in the high 32 bits if // we are doing Darwin DWARF in .o file, or DWARF stand alone debug // info. - //---------------------------------------------------------------------- lldb::user_id_t GetID() const; const char *GetName() const; @@ -112,13 +102,11 @@ public: lldb_private::CompileUnit *GetLLDBCompileUnit() const; - //---------------------------------------------------------------------- // Getting attribute values from the DIE. // // GetAttributeValueAsXXX() functions should only be used if you are // looking for one or two attributes on a DIE. If you are trying to // parse all attributes, use GetAttributes (...) instead - //---------------------------------------------------------------------- const char *GetAttributeValueAsString(const dw_attr_t attr, const char *fail_value) const; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index dce99fb..b191ecb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -20,22 +20,18 @@ public: lldb::offset_t *offset_ptr); void Dump(lldb_private::Stream *s) const override; - //------------------------------------------------------------------ /// Get the data that contains the DIE information for this unit. /// /// \return /// The correct data (.debug_types for DWARF 4 and earlier, and /// .debug_info for DWARF 5 and later) for the DIE information in /// this unit. - //------------------------------------------------------------------ const lldb_private::DWARFDataExtractor &GetData() const override; - //------------------------------------------------------------------ /// Get the size in bytes of the header. /// /// \return /// Byte size of the compile unit header - //------------------------------------------------------------------ uint32_t GetHeaderByteSize() const override; private: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h index af3323e..854e054 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h @@ -16,24 +16,18 @@ class DWARFDIE : public DWARFBaseDIE { public: using DWARFBaseDIE::DWARFBaseDIE; - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- bool IsStructUnionOrClass() const; bool IsMethod() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- lldb::ModuleSP GetContainingDWOModule() const; DWARFDIE GetContainingDWOModuleDIE() const; - //---------------------------------------------------------------------- // Accessing information about a DIE - //---------------------------------------------------------------------- const char *GetMangledName() const; const char *GetPubname() const; @@ -42,14 +36,10 @@ public: lldb_private::Type *ResolveType() const; - //---------------------------------------------------------------------- // Resolve a type by UID using this DIE's DWARF file - //---------------------------------------------------------------------- lldb_private::Type *ResolveTypeUID(const DIERef &die_ref) const; - //---------------------------------------------------------------------- // Functions for obtaining DIE relations and references - //---------------------------------------------------------------------- DWARFDIE GetParent() const; @@ -63,11 +53,9 @@ public: DWARFDIE GetReferencedDIE(const dw_attr_t attr) const; - //---------------------------------------------------------------------- // Get a another DIE from the same DWARF file as this DIE. This will // check the current DIE's compile unit first to see if "die_offset" is // in the same compile unit, and fall back to checking the DWARF file. - //---------------------------------------------------------------------- DWARFDIE GetDIE(dw_offset_t die_offset) const; using DWARFBaseDIE::GetDIE; @@ -78,9 +66,7 @@ public: DWARFDIE GetParentDeclContextDIE() const; - //---------------------------------------------------------------------- // DeclContext related functions - //---------------------------------------------------------------------- std::vector<DWARFDIE> GetDeclContextDIEs() const; void GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const; @@ -90,13 +76,11 @@ public: void GetDeclContext(std::vector<lldb_private::CompilerContext> &context) const; - //---------------------------------------------------------------------- // Getting attribute values from the DIE. // // GetAttributeValueAsXXX() functions should only be used if you are // looking for one or two attributes on a DIE. If you are trying to // parse all attributes, use GetAttributes (...) instead - //---------------------------------------------------------------------- DWARFDIE GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const; @@ -106,9 +90,7 @@ public: int &call_line, int &call_column, lldb_private::DWARFExpression *frame_base) const; - //---------------------------------------------------------------------- // CompilerDecl related functions - //---------------------------------------------------------------------- lldb_private::CompilerDecl GetDecl() const; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp index 17a55a2..25d64d4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp @@ -14,17 +14,13 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::Clear() -//---------------------------------------------------------------------- void DWARFAbbreviationDeclarationSet::Clear() { m_idx_offset = 0; m_decls.clear(); } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::Extract() -//---------------------------------------------------------------------- llvm::Error DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data, lldb::offset_t *offset_ptr) { @@ -54,9 +50,7 @@ DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data, return llvm::ErrorSuccess(); } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration() -//---------------------------------------------------------------------- const DWARFAbbreviationDeclaration * DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration( dw_uleb128_t abbrCode) const { @@ -76,9 +70,7 @@ DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration( } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::GetUnsupportedForms() -//---------------------------------------------------------------------- void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( std::set<dw_form_t> &invalid_forms) const { for (const auto &abbr_decl : m_decls) { @@ -91,13 +83,11 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( } } -//---------------------------------------------------------------------- // Encode // // Encode the abbreviation table onto the end of the buffer provided into a // byte representation as would be found in a ".debug_abbrev" debug information // section. -//---------------------------------------------------------------------- // void // DWARFAbbreviationDeclarationSet::Encode(BinaryStreamBuf& debug_abbrev_buf) // const @@ -109,15 +99,11 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( // debug_abbrev_buf.Append8(0); //} -//---------------------------------------------------------------------- // DWARFDebugAbbrev constructor -//---------------------------------------------------------------------- DWARFDebugAbbrev::DWARFDebugAbbrev() : m_abbrevCollMap(), m_prev_abbr_offset_pos(m_abbrevCollMap.end()) {} -//---------------------------------------------------------------------- // DWARFDebugAbbrev::Parse() -//---------------------------------------------------------------------- llvm::Error DWARFDebugAbbrev::parse(const DWARFDataExtractor &data) { lldb::offset_t offset = 0; @@ -135,9 +121,7 @@ llvm::Error DWARFDebugAbbrev::parse(const DWARFDataExtractor &data) { return llvm::ErrorSuccess(); } -//---------------------------------------------------------------------- // DWARFDebugAbbrev::GetAbbreviationDeclarationSet() -//---------------------------------------------------------------------- const DWARFAbbreviationDeclarationSet * DWARFDebugAbbrev::GetAbbreviationDeclarationSet( dw_offset_t cu_abbr_offset) const { @@ -156,9 +140,7 @@ DWARFDebugAbbrev::GetAbbreviationDeclarationSet( return NULL; } -//---------------------------------------------------------------------- // DWARFDebugAbbrev::GetUnsupportedForms() -//---------------------------------------------------------------------- void DWARFDebugAbbrev::GetUnsupportedForms( std::set<dw_form_t> &invalid_forms) const { for (const auto &pair : m_abbrevCollMap) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index f00b97c..fcacf59 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -24,14 +24,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DWARFDebugAranges::DWARFDebugAranges() : m_aranges() {} -//---------------------------------------------------------------------- // CountArangeDescriptors -//---------------------------------------------------------------------- class CountArangeDescriptors { public: CountArangeDescriptors(uint32_t &count_ref) : count(count_ref) { @@ -43,9 +39,7 @@ public: uint32_t &count; }; -//---------------------------------------------------------------------- // Extract -//---------------------------------------------------------------------- llvm::Error DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) { assert(debug_aranges_data.ValidOffset(0)); @@ -103,9 +97,7 @@ void DWARFDebugAranges::Sort(bool minimize) { m_aranges.CombineConsecutiveEntriesWithEqualData(); } -//---------------------------------------------------------------------- // FindAddress -//---------------------------------------------------------------------- dw_offset_t DWARFDebugAranges::FindAddress(dw_addr_t address) const { const RangeToDIE::Entry *entry = m_aranges.FindEntryThatContains(address); if (entry) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 9f235ff..a85e621 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -27,16 +27,12 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DWARFDebugInfo::DWARFDebugInfo(lldb_private::DWARFContext &context) : m_dwarf2Data(NULL), m_context(context), m_compile_units(), m_cu_aranges_up() {} -//---------------------------------------------------------------------- // SetDwarfData -//---------------------------------------------------------------------- void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) { m_dwarf2Data = dwarf2Data; m_compile_units.clear(); @@ -201,11 +197,9 @@ DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) { return DWARFDIE(); } -//---------------------------------------------------------------------- // GetDIE() // // Get the DIE (Debug Information Entry) with the specified offset. -//---------------------------------------------------------------------- DWARFDIE DWARFDebugInfo::GetDIE(const DIERef &die_ref) { DWARFUnit *cu = GetCompileUnit(die_ref); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index a29e3b1..4c8e070 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -62,9 +62,7 @@ protected: typedef std::vector<DWARFUnitSP> CompileUnitColl; - //---------------------------------------------------------------------- // Member variables - //---------------------------------------------------------------------- SymbolFileDWARF *m_dwarf2Data; lldb_private::DWARFContext &m_context; CompileUnitColl m_compile_units; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 5de245d..13b5399 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -199,13 +199,11 @@ bool DWARFDebugInfoEntry::FastExtract( return false; } -//---------------------------------------------------------------------- // Extract // // Extract a debug info entry for a given compile unit from the .debug_info and // .debug_abbrev data within the SymbolFileDWARF class starting at the given // offset -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::Extract(const DWARFUnit *cu, lldb::offset_t *offset_ptr) { const DWARFDataExtractor &debug_info_data = cu->GetData(); @@ -370,12 +368,10 @@ static dw_offset_t GetRangesOffset(const DWARFDebugRangesBase *debug_ranges, return form_value.Unsigned(); } -//---------------------------------------------------------------------- // GetDIENamesAndRanges // // Gets the valid address ranges for a given DIE by looking for a // DW_AT_low_pc/DW_AT_high_pc pair, DW_AT_entry_pc, or DW_AT_ranges attributes. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetDIENamesAndRanges( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &ranges, int &decl_file, @@ -572,12 +568,10 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges( return !ranges.IsEmpty(); } -//---------------------------------------------------------------------- // Dump // // Dumps a debug information entry and all of it's attributes to the specified // stream. -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, Stream &s, uint32_t recurse_depth) const { @@ -630,13 +624,11 @@ void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, } } -//---------------------------------------------------------------------- // DumpAttribute // // Dumps a debug information entry attribute along with it's form. Any special // display of attributes is done (disassemble location lists, show enumeration // values for attributes, etc). -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::DumpAttribute( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, @@ -731,12 +723,10 @@ void DWARFDebugInfoEntry::DumpAttribute( s.PutCString(" )\n"); } -//---------------------------------------------------------------------- // Get all attribute values for a given DIE, including following any // specification or abstract origin attributes and including those in the // results. Any duplicate attributes will have the first instance take // precedence (this can happen for declaration attributes). -//---------------------------------------------------------------------- size_t DWARFDebugInfoEntry::GetAttributes( const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, DWARFAttributes &attributes, uint32_t curr_depth) const { @@ -809,14 +799,12 @@ size_t DWARFDebugInfoEntry::GetAttributes( return attributes.Size(); } -//---------------------------------------------------------------------- // GetAttributeValue // // Get the value of an attribute and return the .debug_info offset of the // attribute if it was properly extracted into form_value, or zero if we fail // since an offset of zero is invalid for an attribute (it would be a compile // unit header). -//---------------------------------------------------------------------- dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value, @@ -897,14 +885,12 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( check_specification_or_abstract_origin); } -//---------------------------------------------------------------------- // GetAttributeValueAsString // // Get the value of an attribute as a string return it. The resulting pointer // to the string data exists within the supplied SymbolFileDWARF and will only // be available as long as the SymbolFileDWARF is still around and it's content // doesn't change. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetAttributeValueAsString( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, @@ -916,11 +902,9 @@ const char *DWARFDebugInfoEntry::GetAttributeValueAsString( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeValueAsUnsigned // // Get the value of an attribute as unsigned and return it. -//---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, @@ -932,12 +916,10 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeValueAsReference // // Get the value of an attribute as reference and fix up and compile unit // relative offsets as needed. -//---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, @@ -960,14 +942,12 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeHighPC // // Get the hi_pc, adding hi_pc to lo_pc when specified as an <offset-from-low- // pc>. // // Returns the hi_pc or fail_value. -//---------------------------------------------------------------------- dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_specification_or_abstract_origin) const { @@ -985,14 +965,12 @@ dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeAddressRange // // Get the lo_pc and hi_pc, adding hi_pc to lo_pc when specified as an <offset- // from-low-pc>. // // Returns true or sets lo_pc and hi_pc to fail_value. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetAttributeAddressRange( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, @@ -1034,23 +1012,19 @@ size_t DWARFDebugInfoEntry::GetAttributeAddressRanges( return ranges.GetSize(); } -//---------------------------------------------------------------------- // GetName // // Get value of the DW_AT_name attribute and return it if one exists, else // return NULL. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu) const { return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true); } -//---------------------------------------------------------------------- // GetMangledName // // Get value of the DW_AT_MIPS_linkage_name attribute and return it if one // exists, else return the value of the DW_AT_name attribute -//---------------------------------------------------------------------- const char * DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, @@ -1074,12 +1048,10 @@ DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, return name; } -//---------------------------------------------------------------------- // GetPubname // // Get value the name for a DIE as it should appear for a .debug_pubnames or // .debug_pubtypes section. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu) const { const char *name = nullptr; @@ -1100,14 +1072,12 @@ const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, return name; } -//---------------------------------------------------------------------- // GetName // // Get value of the DW_AT_name attribute for a debug information entry that // exists at offset "die_offset" and place that value into the supplied stream // object. If the DIE is a NULL object "NULL" is placed into the stream, and if // no DW_AT_name attribute exists for the DIE then nothing is printed. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, Stream &s) { @@ -1134,13 +1104,11 @@ bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, return false; } -//---------------------------------------------------------------------- // AppendTypeName // // Follows the type name definition down through all needed tags to end up with // a fully qualified type name and dump the results to the supplied stream. // This is used to show the name of types given a type identifier. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, @@ -1266,9 +1234,7 @@ bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, return false; } -//---------------------------------------------------------------------- // BuildAddressRangeTable -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildAddressRangeTable( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { @@ -1292,14 +1258,12 @@ void DWARFDebugInfoEntry::BuildAddressRangeTable( } } -//---------------------------------------------------------------------- // BuildFunctionAddressRangeTable // // This function is very similar to the BuildAddressRangeTable function except // that the actual DIE offset for the function is placed in the table instead // of the compile unit offset (which is the way the standard .debug_aranges // section does it). -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { @@ -1478,9 +1442,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName( return storage.c_str(); } -//---------------------------------------------------------------------- // LookupAddress -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp index aae0b51..0a7a44a 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -27,12 +27,10 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // Parse // // Parse all information in the debug_line_data into an internal // representation. -//---------------------------------------------------------------------- void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data) { m_lineTableMap.clear(); lldb::offset_t offset = 0; @@ -61,9 +59,7 @@ void DWARFDebugLine::ParseIfNeeded(const DWARFDataExtractor &debug_line_data) { Parse(debug_line_data); } -//---------------------------------------------------------------------- // DWARFDebugLine::GetLineTable -//---------------------------------------------------------------------- DWARFDebugLine::LineTable::shared_ptr DWARFDebugLine::GetLineTable(const dw_offset_t offset) const { DWARFDebugLine::LineTable::shared_ptr line_table_shared_ptr; @@ -73,13 +69,11 @@ DWARFDebugLine::GetLineTable(const dw_offset_t offset) const { return line_table_shared_ptr; } -//---------------------------------------------------------------------- // Parse // // Parse the entire line table contents calling callback each time a new // prologue is parsed and every time a new row is to be added to the line // table. -//---------------------------------------------------------------------- void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data, DWARFDebugLine::State::Callback callback, void *userData) { @@ -111,9 +105,7 @@ ReadDescriptors(const DWARFDataExtractor &debug_line_data, } } // namespace -//---------------------------------------------------------------------- // DWARFDebugLine::ParsePrologue -//---------------------------------------------------------------------- bool DWARFDebugLine::ParsePrologue(const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, Prologue *prologue, DWARFUnit *dwarf_cu) { @@ -273,13 +265,11 @@ bool DWARFDebugLine::ParseSupportFiles( return true; } -//---------------------------------------------------------------------- // ParseStatementTable // // Parse a single line table (prologue and all rows) and call the callback // function once for the prologue (row in state will be zero) and each time a // row is to be added to the line table. -//---------------------------------------------------------------------- bool DWARFDebugLine::ParseStatementTable( const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, DWARFDebugLine::State::Callback callback, void *userData, DWARFUnit *dwarf_cu) { @@ -552,9 +542,7 @@ bool DWARFDebugLine::ParseStatementTable( return end_offset; } -//---------------------------------------------------------------------- // ParseStatementTableCallback -//---------------------------------------------------------------------- static void ParseStatementTableCallback(dw_offset_t offset, const DWARFDebugLine::State &state, void *userData) { @@ -571,12 +559,10 @@ static void ParseStatementTableCallback(dw_offset_t offset, } } -//---------------------------------------------------------------------- // ParseStatementTable // // Parse a line table at offset and populate the LineTable class with the // prologue and all rows. -//---------------------------------------------------------------------- bool DWARFDebugLine::ParseStatementTable( const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, LineTable *line_table, DWARFUnit *dwarf_cu) { @@ -588,9 +574,7 @@ inline bool DWARFDebugLine::Prologue::IsValid() const { return SymbolFileDWARF::SupportedVersion(version); } -//---------------------------------------------------------------------- // DWARFDebugLine::Prologue::Dump -//---------------------------------------------------------------------- void DWARFDebugLine::Prologue::Dump(Log *log) { uint32_t i; @@ -629,11 +613,9 @@ void DWARFDebugLine::Prologue::Dump(Log *log) { } } -//---------------------------------------------------------------------- // DWARFDebugLine::ParsePrologue::Append // // Append the contents of the prologue to the binary stream buffer -//---------------------------------------------------------------------- // void // DWARFDebugLine::Prologue::Append(BinaryStreamBuf& buff) const //{ @@ -695,18 +677,14 @@ void DWARFDebugLine::LineTable::AppendRow(const DWARFDebugLine::Row &state) { rows.push_back(state); } -//---------------------------------------------------------------------- // Compare function for the binary search in // DWARFDebugLine::LineTable::LookupAddress() -//---------------------------------------------------------------------- static bool FindMatchingAddress(const DWARFDebugLine::Row &row1, const DWARFDebugLine::Row &row2) { return row1.address < row2.address; } -//---------------------------------------------------------------------- // DWARFDebugLine::LineTable::LookupAddress -//---------------------------------------------------------------------- uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address, dw_addr_t cu_high_pc) const { uint32_t index = UINT32_MAX; @@ -739,26 +717,20 @@ uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address, return index; // Failed to find address } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Row -//---------------------------------------------------------------------- DWARFDebugLine::Row::Row(bool default_is_stmt) : address(0), line(1), column(0), file(1), is_stmt(default_is_stmt), basic_block(false), end_sequence(false), prologue_end(false), epilogue_begin(false), isa(0) {} -//---------------------------------------------------------------------- // Called after a row is appended to the matrix -//---------------------------------------------------------------------- void DWARFDebugLine::Row::PostAppend() { basic_block = false; prologue_end = false; epilogue_begin = false; } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Reset -//---------------------------------------------------------------------- void DWARFDebugLine::Row::Reset(bool default_is_stmt) { address = 0; line = 1; @@ -771,9 +743,7 @@ void DWARFDebugLine::Row::Reset(bool default_is_stmt) { epilogue_begin = false; isa = 0; } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Dump -//---------------------------------------------------------------------- void DWARFDebugLine::Row::Dump(Log *log) const { log->Printf("0x%16.16" PRIx64 " %6u %6u %6u %3u %s%s%s%s%s", address, line, column, file, isa, is_stmt ? " is_stmt" : "", @@ -783,9 +753,7 @@ void DWARFDebugLine::Row::Dump(Log *log) const { end_sequence ? " end_sequence" : ""); } -//---------------------------------------------------------------------- // Compare function LineTable structures -//---------------------------------------------------------------------- static bool AddressLessThan(const DWARFDebugLine::Row &a, const DWARFDebugLine::Row &b) { return a.address < b.address; @@ -825,9 +793,7 @@ void DWARFDebugLine::Row::Insert(Row::collection &state_coll, } } -//---------------------------------------------------------------------- // DWARFDebugLine::State::State -//---------------------------------------------------------------------- DWARFDebugLine::State::State(Prologue::shared_ptr &p, Log *l, DWARFDebugLine::State::Callback cb, void *userData) : Row(p->default_is_stmt), prologue(p), log(l), callback(cb), @@ -837,14 +803,10 @@ DWARFDebugLine::State::State(Prologue::shared_ptr &p, Log *l, callback(0, *this, callbackUserData); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::Reset -//---------------------------------------------------------------------- void DWARFDebugLine::State::Reset() { Row::Reset(prologue->default_is_stmt); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::AppendRowToMatrix -//---------------------------------------------------------------------- void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) { // Each time we are to add an entry into the line table matrix call the // callback function so that someone can do something with the current state @@ -864,9 +826,7 @@ void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) { PostAppend(); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::Finalize -//---------------------------------------------------------------------- void DWARFDebugLine::State::Finalize(dw_offset_t offset) { // Call the callback with a special row state when we are done parsing a line // table diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h index 4c4e0d33..9dc2d9b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -24,14 +24,10 @@ class DWARFUnit; class SymbolFileDWARF; -//---------------------------------------------------------------------- // DWARFDebugLine -//---------------------------------------------------------------------- class DWARFDebugLine { public: - //------------------------------------------------------------------ // FileNameEntry - //------------------------------------------------------------------ struct FileNameEntry { FileNameEntry() : name(nullptr), dir_idx(0), mod_time(0), length(0) {} @@ -42,9 +38,7 @@ public: llvm::MD5::MD5Result checksum; }; - //------------------------------------------------------------------ // Prologue - //------------------------------------------------------------------ struct Prologue { Prologue() @@ -145,9 +139,7 @@ public: // instruction set architecture for the current instruction. }; - //------------------------------------------------------------------ // LineTable - //------------------------------------------------------------------ struct LineTable { typedef std::shared_ptr<LineTable> shared_ptr; @@ -165,9 +157,7 @@ public: Row::collection rows; }; - //------------------------------------------------------------------ // State - //------------------------------------------------------------------ struct State : public Row { typedef void (*Callback)(dw_offset_t offset, const State &state, void *userData); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h index 240829e..9f5e28e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h @@ -14,13 +14,11 @@ #include "lldb/Utility/ConstString.h" #include "DWARFDefines.h" -//---------------------------------------------------------------------- // DWARFDeclContext // // A class that represents a declaration context all the way down to a // DIE. This is useful when trying to find a DIE in one DWARF to a DIE // in another DWARF file. -//---------------------------------------------------------------------- class DWARFDeclContext { public: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp index 7a16116..58744a7a1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -34,9 +34,7 @@ DWARFUnit::DWARFUnit(SymbolFileDWARF *dwarf) DWARFUnit::~DWARFUnit() {} -//---------------------------------------------------------------------- // Parses first DIE of a compile unit. -//---------------------------------------------------------------------- void DWARFUnit::ExtractUnitDIEIfNeeded() { { llvm::sys::ScopedReader lock(m_first_die_mutex); @@ -67,10 +65,8 @@ void DWARFUnit::ExtractUnitDIEIfNeeded() { } } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs if it hasn't already been done. // It will leave this compile unit extracted forever. -//---------------------------------------------------------------------- void DWARFUnit::ExtractDIEsIfNeeded() { m_cancel_scopes = true; @@ -86,13 +82,11 @@ void DWARFUnit::ExtractDIEsIfNeeded() { ExtractDIEsRWLocked(); } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs if it hasn't already been done. // It will clear this compile unit after returned instance gets out of scope, // no other ScopedExtractDIEs instance is running for this compile unit // and no ExtractDIEsIfNeeded() has been executed during this ScopedExtractDIEs // lifetime. -//---------------------------------------------------------------------- DWARFUnit::ScopedExtractDIEs DWARFUnit::ExtractDIEsScoped() { ScopedExtractDIEs scoped(this); @@ -145,10 +139,8 @@ DWARFUnit::ScopedExtractDIEs &DWARFUnit::ScopedExtractDIEs::operator=( return *this; } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs, m_die_array_mutex must be // held R/W and m_die_array must be empty. -//---------------------------------------------------------------------- void DWARFUnit::ExtractDIEsRWLocked() { llvm::sys::ScopedWriter first_die_lock(m_first_die_mutex); @@ -532,21 +524,17 @@ DWARFFormValue::FixedFormSizes DWARFUnit::GetFixedFormSizes() { void DWARFUnit::SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; } -//---------------------------------------------------------------------- // Compare function DWARFDebugAranges::Range structures -//---------------------------------------------------------------------- static bool CompareDIEOffset(const DWARFDebugInfoEntry &die, const dw_offset_t die_offset) { return die.GetOffset() < die_offset; } -//---------------------------------------------------------------------- // GetDIE() // // Get the DIE (Debug Information Entry) with the specified offset by first // checking if the DIE is contained within this compile unit and grabbing the // DIE from this compile unit. Otherwise we grab the DIE from the DWARF file. -//---------------------------------------------------------------------- DWARFDIE DWARFUnit::GetDIE(dw_offset_t die_offset) { if (die_offset != DW_INVALID_OFFSET) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h index 0ced579..e3418d8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h @@ -58,7 +58,6 @@ public: uint32_t depth = UINT32_MAX) const; bool Verify(lldb_private::Stream *s) const; virtual void Dump(lldb_private::Stream *s) const = 0; - //------------------------------------------------------------------ /// Get the data that contains the DIE information for this unit. /// /// This will return the correct bytes that contain the data for @@ -67,26 +66,21 @@ public: /// /// \return /// The correct data for the DIE information in this unit. - //------------------------------------------------------------------ virtual const lldb_private::DWARFDataExtractor &GetData() const = 0; - //------------------------------------------------------------------ /// Get the size in bytes of the compile unit header. /// /// \return /// Byte size of the compile unit header - //------------------------------------------------------------------ virtual uint32_t GetHeaderByteSize() const = 0; // Offset of the initial length field. dw_offset_t GetOffset() const { return m_offset; } lldb::user_id_t GetID() const; - //------------------------------------------------------------------ /// Get the size in bytes of the length field in the header. /// /// In DWARF32 this is just 4 bytes /// /// \return /// Byte size of the compile unit header length field - //------------------------------------------------------------------ size_t GetLengthByteSize() const { return 4; } bool ContainsDIEOffset(dw_offset_t die_offset) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp index 21242d1..b214fd9 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp @@ -43,10 +43,8 @@ void ManualDWARFIndex::Index() { std::vector<IndexSet> sets(units_to_index.size()); - //---------------------------------------------------------------------- // Keep memory down by clearing DIEs for any compile units if indexing // caused us to load the compile unit's DIEs. - //---------------------------------------------------------------------- std::vector<llvm::Optional<DWARFUnit::ScopedExtractDIEs>> clear_cu_dies( units_to_index.size()); auto parser_fn = [&](size_t cu_idx) { @@ -59,14 +57,12 @@ void ManualDWARFIndex::Index() { // Create a task runner that extracts dies for each DWARF compile unit in a // separate thread - //---------------------------------------------------------------------- // First figure out which compile units didn't have their DIEs already // parsed and remember this. If no DIEs were parsed prior to this index // function call, we are going to want to clear the CU dies after we are // done indexing to make sure we don't pull in all DWARF dies, but we need // to wait until all compile units have been indexed in case a DIE in one // compile unit refers to another and the indexes accesses those DIEs. - //---------------------------------------------------------------------- TaskMapOverInt(0, units_to_index.size(), extract_fn); // Now create a task runner that can index each DWARF compile unit in a diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 3952a39..5e6dd27 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -328,10 +328,8 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope, return num_types_added; } -//---------------------------------------------------------------------- // Gets the first parent that is a lexical block, function or inlined // subroutine, or compile unit. -//---------------------------------------------------------------------- DWARFDIE SymbolFileDWARF::GetParentSymbolContextDIE(const DWARFDIE &child_die) { DWARFDIE die; @@ -959,9 +957,7 @@ struct ParseDWARFLineTableCallbackInfo { lldb::addr_t addr_mask; }; -//---------------------------------------------------------------------- // ParseStatementTableCallback -//---------------------------------------------------------------------- static void ParseDWARFLineTableCallback(dw_offset_t offset, const DWARFDebugLine::State &state, void *userData) { @@ -2787,7 +2783,6 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE( return type_sp; } -//---------------------------------------------------------------------- // This function helps to ensure that the declaration contexts match for two // different DIEs. Often times debug information will refer to a forward // declaration of a type (the equivalent of "struct my_struct;". There will @@ -2797,7 +2792,6 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE( // type was in the same declaration context as the original DIE. This function // can efficiently compare two DIEs and will return true when the declaration // context matches, and false when they don't. -//---------------------------------------------------------------------- bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2) { if (die1 == die2) @@ -3788,9 +3782,7 @@ SymbolFileDWARF::ParseCallEdgesInFunction(UserID func_id) { return {}; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolFileDWARF::GetPluginName() { return GetPluginNameStatic(); } uint32_t SymbolFileDWARF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 0328e5f..42ae231 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -36,9 +36,7 @@ #include "DWARFIndex.h" #include "UniqueDWARFASTType.h" -//---------------------------------------------------------------------- // Forward Declarations for this DWARF plugin -//---------------------------------------------------------------------- class DebugMapModule; class DWARFAbbreviationDeclaration; class DWARFAbbreviationDeclarationSet; @@ -68,9 +66,7 @@ public: friend class DWARFDIE; friend class DWARFASTParserClang; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -86,9 +82,7 @@ public: static const lldb_private::FileSpecList &GetSymlinkPaths(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileDWARF(lldb_private::ObjectFile *ofile); @@ -98,9 +92,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; @@ -219,9 +211,7 @@ public: std::recursive_mutex &GetModuleMutex() const override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 5825656..e5bc63b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -1230,9 +1230,7 @@ void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s) { }); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolFileDWARFDebugMap::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 6f5dddc..b7dc2bc 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -24,9 +24,7 @@ class DWARFDeclContext; class SymbolFileDWARFDebugMap : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -38,18 +36,14 @@ public: static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileDWARFDebugMap(lldb_private::ObjectFile *ofile); ~SymbolFileDWARFDebugMap() override; uint32_t CalculateAbilities() override; void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; @@ -130,9 +124,7 @@ public: void DumpClangAST(lldb_private::Stream &s) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; @@ -157,9 +149,7 @@ protected: lldb::addr_t> FileRangeMap; - //------------------------------------------------------------------ // Class specific types - //------------------------------------------------------------------ struct CompileUnitInfo { lldb_private::FileSpec so_file; lldb_private::ConstString oso_path; @@ -182,9 +172,7 @@ protected: const FileRangeMap &GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile); }; - //------------------------------------------------------------------ // Protected Member Functions - //------------------------------------------------------------------ void InitOSO(); static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid) { @@ -271,9 +259,7 @@ protected: return m_unique_ast_type_map; } - //------------------------------------------------------------------ // OSOEntry - //------------------------------------------------------------------ class OSOEntry { public: OSOEntry() @@ -302,9 +288,7 @@ protected: typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, OSOEntry> DebugMap; - //------------------------------------------------------------------ // Member Variables - //------------------------------------------------------------------ std::bitset<kNumFlags> m_flags; std::vector<CompileUnitInfo> m_compile_unit_infos; std::vector<uint32_t> m_func_indexes; // Sorted by address @@ -316,24 +300,19 @@ protected: lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type; DebugMap m_debug_map; - //------------------------------------------------------------------ // When an object file from the debug map gets parsed in // SymbolFileDWARF, it needs to tell the debug map about the object // files addresses by calling this function once for each N_FUN, // N_GSYM and N_STSYM and after all entries in the debug map have // been matched up, FinalizeOSOFileRanges() should be called. - //------------------------------------------------------------------ bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size); - //------------------------------------------------------------------ // Called after calling AddOSOFileRange() for each object file debug // map entry to finalize the info for the unlinked compile unit. - //------------------------------------------------------------------ void FinalizeOSOFileRanges(CompileUnitInfo *cu_info); - //------------------------------------------------------------------ /// Convert \a addr from a .o file address, to an executable address. /// /// \param[in] addr @@ -342,10 +321,8 @@ protected: /// \return /// Returns true if \a addr was converted to be an executable /// section/offset address, false otherwise. - //------------------------------------------------------------------ bool LinkOSOAddress(lldb_private::Address &addr); - //------------------------------------------------------------------ /// Convert a .o file "file address" to an executable "file address". /// /// \param[in] oso_symfile @@ -358,11 +335,9 @@ protected: /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the /// linked executable, otherwise a valid "file address" from the /// linked executable that contains the debug map. - //------------------------------------------------------------------ lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr); - //------------------------------------------------------------------ /// Given a line table full of lines with "file addresses" that are /// for a .o file represented by \a oso_symfile, link a new line table /// and return it. @@ -377,7 +352,6 @@ protected: /// Returns a valid line table full of linked addresses, or NULL /// if none of the line table addresses exist in the main /// executable. - //------------------------------------------------------------------ lldb_private::LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, lldb_private::LineTable *line_table); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h index 06e1194..1269dba 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h @@ -18,9 +18,7 @@ class UniqueDWARFASTType { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration(), m_byte_size( diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h index 761d11b..60eece7 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h @@ -50,9 +50,7 @@ struct DeclStatus { class PdbAstBuilder { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ PdbAstBuilder(ObjectFile &obj, PdbIndex &index); clang::DeclContext &GetTranslationUnitDecl(); diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h index 54cb442..60dd7d4 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -44,9 +44,7 @@ class SymbolFileNativePDB : public SymbolFile { friend class UdtRecordCompleter; public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -59,9 +57,7 @@ public: static SymbolFile *CreateInstance(ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileNativePDB(ObjectFile *ofile); ~SymbolFileNativePDB() override; @@ -70,9 +66,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h b/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h index 48e4aed..2e9d138 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h +++ b/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h @@ -22,7 +22,6 @@ class PDBSymbolData; } } // namespace llvm -//------------------------------------------------------------------------------ /// Converts a location information from a PDB symbol to a DWARF expression /// /// \param[in] module @@ -40,7 +39,6 @@ class PDBSymbolData; /// /// \return /// The DWARF expression corresponding to the location data of \a symbol. -//------------------------------------------------------------------------------ lldb_private::DWARFExpression ConvertPDBLocationToDWARFExpression(lldb::ModuleSP module, const llvm::pdb::PDBSymbolData &symbol, diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h index 853624e..ba3099a 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h @@ -23,9 +23,7 @@ class PDBASTParser; class SymbolFilePDB : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -39,9 +37,7 @@ public: static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFilePDB(lldb_private::ObjectFile *ofile); ~SymbolFilePDB() override; @@ -50,9 +46,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp index d593e63..7fa3a1c 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -64,11 +64,9 @@ uint32_t SymbolFileSymtab::CalculateAbilities() { if (m_obj_file) { const Symtab *symtab = m_obj_file->GetSymtab(); if (symtab) { - //---------------------------------------------------------------------- // The snippet of code below will get the indexes the module symbol table // entries that are code, data, or function related (debug info), sort // them by value (address) and dump the sorted symbols. - //---------------------------------------------------------------------- if (symtab->AppendSymbolIndexesWithType(eSymbolTypeSourceFile, m_source_indexes)) { abilities |= CompileUnits; @@ -261,9 +259,7 @@ uint32_t SymbolFileSymtab::ResolveSymbolContext(const Address &so_addr, return resolved_flags; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolFileSymtab::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h index f2e90c9..bc9a531 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -17,16 +17,12 @@ class SymbolFileSymtab : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileSymtab(lldb_private::ObjectFile *obj_file); ~SymbolFileSymtab() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -40,9 +36,7 @@ public: uint32_t CalculateAbilities() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; @@ -85,9 +79,7 @@ public: lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp index fd49252..1efbeab 100644 --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -24,15 +24,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // SymbolVendorELF constructor -//---------------------------------------------------------------------- SymbolVendorELF::SymbolVendorELF(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SymbolVendorELF::~SymbolVendorELF() {} void SymbolVendorELF::Initialize() { @@ -54,13 +50,11 @@ const char *SymbolVendorELF::GetPluginDescriptionStatic() { "executables."; } -//---------------------------------------------------------------------- // CreateInstance // // Platforms can register a callback to use when creating symbol vendors to // allow for complex debug information file setups, and to also allow for // finding separate debug information files. -//---------------------------------------------------------------------- SymbolVendor * SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { @@ -162,9 +156,7 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolVendorELF::GetPluginName() { return GetPluginNameStatic(); } uint32_t SymbolVendorELF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h index 60d3021..0cd740d 100644 --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h @@ -14,16 +14,12 @@ class SymbolVendorELF : public lldb_private::SymbolVendor { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolVendorELF(const lldb::ModuleSP &module_sp); ~SymbolVendorELF() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -36,9 +32,7 @@ public: CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp index f61c09c..af9ea0a 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -25,15 +25,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // SymbolVendorMacOSX constructor -//---------------------------------------------------------------------- SymbolVendorMacOSX::SymbolVendorMacOSX(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SymbolVendorMacOSX::~SymbolVendorMacOSX() {} static bool UUIDsMatch(Module *module, ObjectFile *ofile, @@ -90,13 +86,11 @@ const char *SymbolVendorMacOSX::GetPluginDescriptionStatic() { "executables."; } -//---------------------------------------------------------------------- // CreateInstance // // Platforms can register a callback to use when creating symbol vendors to // allow for complex debug information file setups, and to also allow for // finding separate debug information files. -//---------------------------------------------------------------------- SymbolVendor * SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { @@ -312,9 +306,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp, return symbol_vendor; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolVendorMacOSX::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h index 100086b..01e33ff 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h @@ -14,9 +14,7 @@ class SymbolVendorMacOSX : public lldb_private::SymbolVendor { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -29,16 +27,12 @@ public: CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolVendorMacOSX(const lldb::ModuleSP &module_sp); virtual ~SymbolVendorMacOSX(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ virtual lldb_private::ConstString GetPluginName(); virtual uint32_t GetPluginVersion(); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h index c9c4282..318d674 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h @@ -55,7 +55,6 @@ public: : item_buffer_ptr(LLDB_INVALID_ADDRESS), item_buffer_size(0) {} }; - //---------------------------------------------------------- /// Get the information about a work item by calling /// __introspection_dispatch_queue_item_get_info. If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -86,7 +85,6 @@ public: /// failure of any kind while getting /// the information, the item_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetItemInfoReturnInfo GetItemInfo(Thread &thread, lldb::addr_t item, lldb::addr_t page_to_free, uint64_t page_to_free_size, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h index 4b59371..0780e3c 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h @@ -60,7 +60,6 @@ public: count(0) {} }; - //---------------------------------------------------------- /// Get the list of pending items for a given queue via a call to /// __introspection_dispatch_queue_get_pending_items. If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -90,7 +89,6 @@ public: /// failure of any kind while getting /// the information, the items_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetPendingItemsReturnInfo GetPendingItems(Thread &thread, lldb::addr_t queue, lldb::addr_t page_to_free, uint64_t page_to_free_size, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h index e1ff9e0..bd314f9 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h @@ -56,7 +56,6 @@ public: count(0) {} }; - //---------------------------------------------------------- /// Get the list of queues that exist (with any active or pending items) via /// a call to introspection_get_dispatch_queues(). If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -83,7 +82,6 @@ public: /// failure of any kind while getting /// the information, the queues_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetQueuesReturnInfo GetCurrentQueues(Thread &thread, lldb::addr_t page_to_free, uint64_t page_to_free_size, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h index 2c519db..b45314d 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h @@ -56,7 +56,6 @@ public: : item_buffer_ptr(LLDB_INVALID_ADDRESS), item_buffer_size(0) {} }; - //---------------------------------------------------------- /// Get the information about a work item by calling /// __introspection_dispatch_thread_get_item_info. If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -83,7 +82,6 @@ public: /// failure of any kind while getting /// the information, the item_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetThreadItemInfoReturnInfo GetThreadItemInfo(Thread &thread, lldb::tid_t thread_id, lldb::addr_t page_to_free, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp index 513bdb3..6b81ec8 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -34,11 +34,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) { bool create = false; if (!create) { @@ -75,9 +73,7 @@ SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) { return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- SystemRuntimeMacOSX::SystemRuntimeMacOSX(Process *process) : SystemRuntime(process), m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(), m_get_queues_handler(process), m_get_pending_items_handler(process), @@ -92,9 +88,7 @@ SystemRuntimeMacOSX::SystemRuntimeMacOSX(Process *process) m_dispatch_voucher_offsets_addr(LLDB_INVALID_ADDRESS), m_libdispatch_voucher_offsets() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SystemRuntimeMacOSX::~SystemRuntimeMacOSX() { Clear(true); } void SystemRuntimeMacOSX::Detach() { @@ -104,9 +98,7 @@ void SystemRuntimeMacOSX::Detach() { m_get_thread_item_info_handler.Detach(); } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void SystemRuntimeMacOSX::Clear(bool clear_process) { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -1012,9 +1004,7 @@ const char *SystemRuntimeMacOSX::GetPluginDescriptionStatic() { return "System runtime plugin for Mac OS X native libraries."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SystemRuntimeMacOSX::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h index c571bad..d6a18e2 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h @@ -34,9 +34,7 @@ public: ~SystemRuntimeMacOSX() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -48,9 +46,7 @@ public: static lldb_private::SystemRuntime * CreateInstance(lldb_private::Process *process); - //------------------------------------------------------------------ // instance methods - //------------------------------------------------------------------ void Clear(bool clear_process); @@ -101,9 +97,7 @@ public: bool SafeToCallFunctionsOnThisThread(lldb::ThreadSP thread_sp) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp index 53e3258..70c1318 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//----------------------------------------------------------------------------------------------- // UnwindAssemblyInstEmulation method definitions -//----------------------------------------------------------------------------------------------- bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly( AddressRange &range, Thread &thread, UnwindPlan &unwind_plan) { @@ -305,9 +303,7 @@ UnwindAssemblyInstEmulation::CreateInstance(const ArchSpec &arch) { return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol in UnwindAssemblyParser_x86 -//------------------------------------------------------------------ ConstString UnwindAssemblyInstEmulation::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h index 704865c..5232d08 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -47,9 +47,7 @@ public: static lldb_private::UnwindAssembly * CreateInstance(const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp index d8a820c..2157855 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -30,9 +30,7 @@ using namespace lldb; using namespace lldb_private; -//----------------------------------------------------------------------------------------------- // UnwindAssemblyParser_x86 method definitions -//----------------------------------------------------------------------------------------------- UnwindAssembly_x86::UnwindAssembly_x86(const ArchSpec &arch) : lldb_private::UnwindAssembly(arch), @@ -244,9 +242,7 @@ UnwindAssembly *UnwindAssembly_x86::CreateInstance(const ArchSpec &arch) { return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol in UnwindAssemblyParser_x86 -//------------------------------------------------------------------ ConstString UnwindAssembly_x86::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h index ffc8aa6..7c198bb 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h @@ -41,9 +41,7 @@ public: static lldb_private::UnwindAssembly * CreateInstance(const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 28b5a18..9a8de48 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -663,9 +663,7 @@ ClangASTContext::ClangASTContext(const char *target_triple) SetTargetTriple(target_triple); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ClangASTContext::~ClangASTContext() { Finalize(); } ConstString ClangASTContext::GetPluginNameStatic() { @@ -2435,17 +2433,13 @@ void ClangASTContext::DumpDeclHiearchy(clang::Decl *decl) { bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl, clang::Decl *rhs_decl) { if (lhs_decl && rhs_decl) { - //---------------------------------------------------------------------- // Make sure the decl kinds match first - //---------------------------------------------------------------------- const clang::Decl::Kind lhs_decl_kind = lhs_decl->getKind(); const clang::Decl::Kind rhs_decl_kind = rhs_decl->getKind(); if (lhs_decl_kind == rhs_decl_kind) { - //------------------------------------------------------------------ // Now check that the decl contexts kinds are all equivalent before we // have to check any names of the decl contexts... - //------------------------------------------------------------------ clang::DeclContext *lhs_decl_ctx = lhs_decl->getDeclContext(); clang::DeclContext *rhs_decl_ctx = rhs_decl->getDeclContext(); if (lhs_decl_ctx && rhs_decl_ctx) { @@ -2467,9 +2461,7 @@ bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl, return false; } - //-------------------------------------------------------------- // Now make sure the name of the decls match - //-------------------------------------------------------------- clang::NamedDecl *lhs_named_decl = llvm::dyn_cast<clang::NamedDecl>(lhs_decl); clang::NamedDecl *rhs_named_decl = @@ -2485,10 +2477,8 @@ bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl, } else return false; - //-------------------------------------------------------------- // We know that the decl context kinds all match, so now we need to // make sure the names match as well - //-------------------------------------------------------------- lhs_decl_ctx = lhs_decl->getDeclContext(); rhs_decl_ctx = rhs_decl->getDeclContext(); while (1) { @@ -2830,9 +2820,7 @@ ConvertAccessTypeToObjCIvarAccessControl(AccessType access) { return clang::ObjCIvarDecl::None; } -//---------------------------------------------------------------------- // Tests -//---------------------------------------------------------------------- bool ClangASTContext::IsAggregateType(lldb::opaque_compiler_type_t type) { clang::QualType qual_type(GetCanonicalQualType(type)); @@ -3994,9 +3982,7 @@ bool ClangASTContext::GetObjCClassName(const CompilerType &type, return false; } -//---------------------------------------------------------------------- // Type Completion -//---------------------------------------------------------------------- bool ClangASTContext::GetCompleteType(lldb::opaque_compiler_type_t type) { if (!type) @@ -4485,9 +4471,7 @@ unsigned ClangASTContext::GetTypeQualifiers(lldb::opaque_compiler_type_t type) { return 0; } -//---------------------------------------------------------------------- // Creating related types -//---------------------------------------------------------------------- CompilerType ClangASTContext::GetArrayElementType(lldb::opaque_compiler_type_t type, @@ -4999,16 +4983,12 @@ ClangASTContext::GetTypedefedType(lldb::opaque_compiler_type_t type) { return CompilerType(); } -//---------------------------------------------------------------------- // Create related types using the current type's AST -//---------------------------------------------------------------------- CompilerType ClangASTContext::GetBasicTypeFromAST(lldb::BasicType basic_type) { return ClangASTContext::GetBasicType(getASTContext(), basic_type); } -//---------------------------------------------------------------------- // Exploring the type -//---------------------------------------------------------------------- Optional<uint64_t> ClangASTContext::GetBitSize(lldb::opaque_compiler_type_t type, @@ -9081,9 +9061,7 @@ ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type, return 0; } -//---------------------------------------------------------------------- // Dumping types -//---------------------------------------------------------------------- #define DEPTH_INCREMENT 2 #ifndef NDEBUG @@ -9921,9 +9899,7 @@ bool ClangASTContext::LayoutRecordType( field_offsets, base_offsets, vbase_offsets); } -//---------------------------------------------------------------------- // CompilerDecl override functions -//---------------------------------------------------------------------- ConstString ClangASTContext::DeclGetName(void *opaque_decl) { if (opaque_decl) { @@ -10011,9 +9987,7 @@ CompilerType ClangASTContext::DeclGetFunctionArgumentType(void *opaque_decl, return CompilerType(); } -//---------------------------------------------------------------------- // CompilerDeclContext functions -//---------------------------------------------------------------------- std::vector<CompilerDecl> ClangASTContext::DeclContextFindDeclByName( void *opaque_decl_ctx, ConstString name, const bool ignore_using_decls) { diff --git a/lldb/source/Symbol/CompactUnwindInfo.cpp b/lldb/source/Symbol/CompactUnwindInfo.cpp index f28bb36..d2e176b 100644 --- a/lldb/source/Symbol/CompactUnwindInfo.cpp +++ b/lldb/source/Symbol/CompactUnwindInfo.cpp @@ -157,9 +157,7 @@ FLAGS_ANONYMOUS_ENUM(){ llvm::countTrailingZeros(static_cast<uint32_t>(mask), llvm::ZB_Width)) & \ (((1 << llvm::countPopulation(static_cast<uint32_t>(mask)))) - 1)) -//---------------------- // constructor -//---------------------- CompactUnwindInfo::CompactUnwindInfo(ObjectFile &objfile, SectionSP §ion_sp) : m_objfile(objfile), m_section_sp(section_sp), @@ -167,9 +165,7 @@ CompactUnwindInfo::CompactUnwindInfo(ObjectFile &objfile, SectionSP §ion_sp) m_indexes_computed(eLazyBoolCalculate), m_unwindinfo_data(), m_unwindinfo_data_computed(false), m_unwind_header() {} -//---------------------- // destructor -//---------------------- CompactUnwindInfo::~CompactUnwindInfo() {} diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index 561f7cc..ba9fd27 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -81,12 +81,10 @@ void CompileUnit::ForeachFunction( return; } -//---------------------------------------------------------------------- // Dump the current contents of this object. No functions that cause on demand // parsing of functions, globals, statics are called, so this is a good // function to call to get an idea of the current contents of the CompileUnit // object. -//---------------------------------------------------------------------- void CompileUnit::Dump(Stream *s, bool show_context) const { const char *language = Language::GetNameForLanguageType(m_language); @@ -116,14 +114,11 @@ void CompileUnit::Dump(Stream *s, bool show_context) const { } } -//---------------------------------------------------------------------- // Add a function to this compile unit -//---------------------------------------------------------------------- void CompileUnit::AddFunction(FunctionSP &funcSP) { m_functions_by_uid[funcSP->GetID()] = funcSP; } -//---------------------------------------------------------------------- // Find functions using the Mangled::Tokens token list. This function currently // implements an interactive approach designed to find all instances of certain // functions. It isn't designed to the quickest way to lookup functions as it @@ -145,7 +140,6 @@ void CompileUnit::AddFunction(FunctionSP &funcSP) { // method should be able to take advantage of any accelerator tables available // in the debug information (which is parsed by the SymbolFile parser plug-ins // and registered with each Module). -//---------------------------------------------------------------------- // void // CompileUnit::FindFunctions(const Mangled::Tokens& tokens) //{ diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp index de15fca..a727568 100644 --- a/lldb/source/Symbol/CompilerType.cpp +++ b/lldb/source/Symbol/CompilerType.cpp @@ -41,9 +41,7 @@ CompilerType::CompilerType(clang::ASTContext *ast, clang::QualType qual_type) CompilerType::~CompilerType() {} -//---------------------------------------------------------------------- // Tests -//---------------------------------------------------------------------- bool CompilerType::IsAggregateType() const { if (IsValid()) @@ -270,9 +268,7 @@ bool CompilerType::IsBeingDefined() const { return m_type_system->IsBeingDefined(m_type); } -//---------------------------------------------------------------------- // Type Completion -//---------------------------------------------------------------------- bool CompilerType::GetCompleteType() const { if (!IsValid()) @@ -280,9 +276,7 @@ bool CompilerType::GetCompleteType() const { return m_type_system->GetCompleteType(m_type); } -//---------------------------------------------------------------------- // AST related queries -//---------------------------------------------------------------------- size_t CompilerType::GetPointerByteSize() const { if (m_type_system) return m_type_system->GetPointerByteSize(); @@ -351,9 +345,7 @@ unsigned CompilerType::GetTypeQualifiers() const { return 0; } -//---------------------------------------------------------------------- // Creating related types -//---------------------------------------------------------------------- CompilerType CompilerType::GetArrayElementType(uint64_t *stride) const { if (IsValid()) { @@ -487,9 +479,7 @@ CompilerType CompilerType::GetTypedefedType() const { return CompilerType(); } -//---------------------------------------------------------------------- // Create related types using the current type's AST -//---------------------------------------------------------------------- CompilerType CompilerType::GetBasicTypeFromAST(lldb::BasicType basic_type) const { @@ -497,9 +487,7 @@ CompilerType::GetBasicTypeFromAST(lldb::BasicType basic_type) const { return m_type_system->GetBasicTypeFromAST(basic_type); return CompilerType(); } -//---------------------------------------------------------------------- // Exploring the type -//---------------------------------------------------------------------- llvm::Optional<uint64_t> CompilerType::GetBitSize(ExecutionContextScope *exe_scope) const { @@ -748,9 +736,7 @@ size_t CompilerType::ConvertStringToFloatValue(const char *s, uint8_t *dst, return 0; } -//---------------------------------------------------------------------- // Dumping types -//---------------------------------------------------------------------- #define DEPTH_INCREMENT 2 void CompilerType::DumpValue(ExecutionContext *exe_ctx, Stream *s, diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index cc9f791..5c556bd 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -23,12 +23,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // GetDwarfEHPtr // // Used for calls when the value type is specified by a DWARF EH Frame pointer // encoding. -//---------------------------------------------------------------------- static uint64_t GetGNUEHPointer(const DataExtractor &DE, offset_t *offset_ptr, uint32_t eh_ptr_enc, addr_t pc_rel_addr, addr_t text_addr, diff --git a/lldb/source/Symbol/FuncUnwinders.cpp b/lldb/source/Symbol/FuncUnwinders.cpp index 07b4f05..313f682 100644 --- a/lldb/source/Symbol/FuncUnwinders.cpp +++ b/lldb/source/Symbol/FuncUnwinders.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------ /// constructor -//------------------------------------------------ FuncUnwinders::FuncUnwinders(UnwindTable &unwind_table, AddressRange range) : m_unwind_table(unwind_table), m_range(range), m_mutex(), @@ -49,9 +47,7 @@ FuncUnwinders::FuncUnwinders(UnwindTable &unwind_table, AddressRange range) m_tried_unwind_arch_default_at_func_entry(false), m_first_non_prologue_insn() {} -//------------------------------------------------ /// destructor -//------------------------------------------------ FuncUnwinders::~FuncUnwinders() {} diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index d7df70b..7b3ea5b 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -24,10 +24,8 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Basic function information is contained in the FunctionInfo class. It is // designed to contain the name, linkage name, and declaration location. -//---------------------------------------------------------------------- FunctionInfo::FunctionInfo(const char *name, const Declaration *decl_ptr) : m_name(name), m_declaration(decl_ptr) {} @@ -129,9 +127,7 @@ size_t InlineFunctionInfo::MemorySize() const { return FunctionInfo::MemorySize() + m_mangled.MemorySize(); } -//---------------------------------------------------------------------- // -//---------------------------------------------------------------------- CallEdge::CallEdge(const char *symbol_name, lldb::addr_t return_pc) : return_pc(return_pc), resolved(false) { lazy_callee.symbol_name = symbol_name; @@ -182,9 +178,7 @@ lldb::addr_t CallEdge::GetReturnPCAddress(Function &caller, return base.GetLoadAddress(&target) + return_pc; } -//---------------------------------------------------------------------- // -//---------------------------------------------------------------------- Function::Function(CompileUnit *comp_unit, lldb::user_id_t func_uid, lldb::user_id_t type_uid, const Mangled &mangled, Type *type, const AddressRange &range) diff --git a/lldb/source/Symbol/LineTable.cpp b/lldb/source/Symbol/LineTable.cpp index bdd8be9..8d4d72c 100644 --- a/lldb/source/Symbol/LineTable.cpp +++ b/lldb/source/Symbol/LineTable.cpp @@ -17,15 +17,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // LineTable constructor -//---------------------------------------------------------------------- LineTable::LineTable(CompileUnit *comp_unit) : m_comp_unit(comp_unit), m_entries() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- LineTable::~LineTable() {} void LineTable::InsertLineEntry(lldb::addr_t file_addr, uint32_t line, @@ -136,7 +132,6 @@ void LineTable::InsertSequence(LineSequence *sequence) { m_entries.insert(pos, seq->m_entries.begin(), seq->m_entries.end()); } -//---------------------------------------------------------------------- LineTable::Entry::LessThanBinaryPredicate::LessThanBinaryPredicate( LineTable *line_table) : m_line_table(line_table) {} diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 211b96f..c1cf7e4 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -533,9 +533,7 @@ size_t ObjectFile::ReadSectionData(Section *section, return 0; } -//---------------------------------------------------------------------- // Get the section data the file on disk -//---------------------------------------------------------------------- size_t ObjectFile::ReadSectionData(Section *section, DataExtractor §ion_data) { // If some other objectfile owns this data, pass this to them. diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 292830e..2c14bb32 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -586,10 +586,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const { curr_block->GetContainingInlinedBlock() != nullptr) isInlinedblock = true; - //---------------------------------------------------------------------- // Find all types that match the current block if we have one and put them // first in the list. Keep iterating up through all blocks. - //---------------------------------------------------------------------- while (curr_block != nullptr && !isInlinedblock) { type_map.ForEach( [curr_block, &type_list](const lldb::TypeSP &type_sp) -> bool { @@ -607,10 +605,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const { }); curr_block = curr_block->GetParent(); } - //---------------------------------------------------------------------- // Find all types that match the current function, if we have onem, and put // them next in the list. - //---------------------------------------------------------------------- if (function != nullptr && !type_map.Empty()) { const size_t old_type_list_size = type_list.GetSize(); type_map.ForEach([this, &type_list](const lldb::TypeSP &type_sp) -> bool { @@ -628,10 +624,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const { type_map.Remove(type_list.GetTypeAtIndex(i)); } } - //---------------------------------------------------------------------- // Find all types that match the current compile unit, if we have one, and // put them next in the list. - //---------------------------------------------------------------------- if (comp_unit != nullptr && !type_map.Empty()) { const size_t old_type_list_size = type_list.GetSize(); @@ -650,10 +644,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const { type_map.Remove(type_list.GetTypeAtIndex(i)); } } - //---------------------------------------------------------------------- // Find all types that match the current module, if we have one, and put them // next in the list. - //---------------------------------------------------------------------- if (module_sp && !type_map.Empty()) { const size_t old_type_list_size = type_list.GetSize(); type_map.ForEach([this, &type_list](const lldb::TypeSP &type_sp) -> bool { @@ -670,9 +662,7 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const { type_map.Remove(type_list.GetTypeAtIndex(i)); } } - //---------------------------------------------------------------------- // Any types that are left get copied into the list an any order. - //---------------------------------------------------------------------- if (!type_map.Empty()) { type_map.ForEach([&type_list](const lldb::TypeSP &type_sp) -> bool { type_list.Insert(type_sp); @@ -949,11 +939,9 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) { } -//---------------------------------------------------------------------- // // SymbolContextSpecifier // -//---------------------------------------------------------------------- SymbolContextSpecifier::SymbolContextSpecifier(const TargetSP &target_sp) : m_target_sp(target_sp), m_module_spec(), m_module_sp(), m_file_spec_up(), @@ -1213,11 +1201,9 @@ void SymbolContextSpecifier::GetDescription( } } -//---------------------------------------------------------------------- // // SymbolContextList // -//---------------------------------------------------------------------- SymbolContextList::SymbolContextList() : m_symbol_contexts() {} diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index 112d487..b9f3a5f 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -18,13 +18,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // FindPlugin // // Platforms can register a callback to use when creating symbol vendors to // allow for complex debug information file setups, and to also allow for // finding separate debug information files. -//---------------------------------------------------------------------- SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { std::unique_ptr<SymbolVendor> instance_up; @@ -58,21 +56,15 @@ SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp, return instance_up.release(); } -//---------------------------------------------------------------------- // SymbolVendor constructor -//---------------------------------------------------------------------- SymbolVendor::SymbolVendor(const lldb::ModuleSP &module_sp) : ModuleChild(module_sp), m_type_list(), m_compile_units(), m_sym_file_up(), m_symtab() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SymbolVendor::~SymbolVendor() {} -//---------------------------------------------------------------------- // Add a representation given an object file. -//---------------------------------------------------------------------- void SymbolVendor::AddSymbolFileRepresentation(const ObjectFileSP &objfile_sp) { ModuleSP module_sp(GetModule()); if (module_sp) { @@ -488,9 +480,7 @@ void SymbolVendor::SectionFileAddressesChanged() { } } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolVendor::GetPluginName() { static ConstString g_name("vendor-default"); return g_name; diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp index b04028c..4670d77 100644 --- a/lldb/source/Symbol/Symtab.cpp +++ b/lldb/source/Symbol/Symtab.cpp @@ -216,9 +216,7 @@ const Symbol *Symtab::SymbolAtIndex(size_t idx) const { return nullptr; } -//---------------------------------------------------------------------- // InitNameIndexes -//---------------------------------------------------------------------- static bool lldb_skip_name(llvm::StringRef mangled, Mangled::ManglingScheme scheme) { switch (scheme) { diff --git a/lldb/source/Symbol/TypeList.cpp b/lldb/source/Symbol/TypeList.cpp index 480b553..1813e8e 100644 --- a/lldb/source/Symbol/TypeList.cpp +++ b/lldb/source/Symbol/TypeList.cpp @@ -21,9 +21,7 @@ using namespace lldb_private; TypeList::TypeList() : m_types() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- TypeList::~TypeList() {} void TypeList::Insert(const TypeSP &type_sp) { @@ -33,9 +31,7 @@ void TypeList::Insert(const TypeSP &type_sp) { m_types.push_back(type_sp); } -//---------------------------------------------------------------------- // Find a base type by its unique ID. -//---------------------------------------------------------------------- // TypeSP // TypeList::FindType(lldb::user_id_t uid) //{ @@ -45,9 +41,7 @@ void TypeList::Insert(const TypeSP &type_sp) { // return TypeSP(); //} -//---------------------------------------------------------------------- // Find a type by name. -//---------------------------------------------------------------------- // TypeList // TypeList::FindTypes (ConstString name) //{ diff --git a/lldb/source/Symbol/TypeMap.cpp b/lldb/source/Symbol/TypeMap.cpp index 010c937..bc6e272 100644 --- a/lldb/source/Symbol/TypeMap.cpp +++ b/lldb/source/Symbol/TypeMap.cpp @@ -34,9 +34,7 @@ using namespace clang; TypeMap::TypeMap() : m_types() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- TypeMap::~TypeMap() {} void TypeMap::Insert(const TypeSP &type_sp) { @@ -61,9 +59,7 @@ bool TypeMap::InsertUnique(const TypeSP &type_sp) { return true; } -//---------------------------------------------------------------------- // Find a base type by its unique ID. -//---------------------------------------------------------------------- // TypeSP // TypeMap::FindType(lldb::user_id_t uid) //{ @@ -73,9 +69,7 @@ bool TypeMap::InsertUnique(const TypeSP &type_sp) { // return TypeSP(); //} -//---------------------------------------------------------------------- // Find a type by name. -//---------------------------------------------------------------------- // TypeMap // TypeMap::FindTypes (ConstString name) //{ diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp index ceb127d..29a7a51 100644 --- a/lldb/source/Symbol/Variable.cpp +++ b/lldb/source/Symbol/Variable.cpp @@ -35,9 +35,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Variable constructor -//---------------------------------------------------------------------- Variable::Variable( lldb::user_id_t uid, const char *name, const char *mangled, // The mangled or fully qualified name of the variable. @@ -52,9 +50,7 @@ Variable::Variable( m_artificial(artificial), m_loc_is_const_data(false), m_static_member(static_member) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Variable::~Variable() {} lldb::LanguageType Variable::GetLanguage() const { diff --git a/lldb/source/Symbol/VariableList.cpp b/lldb/source/Symbol/VariableList.cpp index f8a7e7a..5131247 100644 --- a/lldb/source/Symbol/VariableList.cpp +++ b/lldb/source/Symbol/VariableList.cpp @@ -16,14 +16,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // VariableList constructor -//---------------------------------------------------------------------- VariableList::VariableList() : m_variables() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- VariableList::~VariableList() {} void VariableList::AddVariable(const VariableSP &var_sp) { diff --git a/lldb/source/Target/CPPLanguageRuntime.cpp b/lldb/source/Target/CPPLanguageRuntime.cpp index 38d95fa..dfc7ff8 100644 --- a/lldb/source/Target/CPPLanguageRuntime.cpp +++ b/lldb/source/Target/CPPLanguageRuntime.cpp @@ -1,5 +1,4 @@ //===-- CPPLanguageRuntime.cpp -//-------------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -32,9 +31,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CPPLanguageRuntime::~CPPLanguageRuntime() {} CPPLanguageRuntime::CPPLanguageRuntime(Process *process) diff --git a/lldb/source/Target/Language.cpp b/lldb/source/Target/Language.cpp index 0b70130..71a54b8 100644 --- a/lldb/source/Target/Language.cpp +++ b/lldb/source/Target/Language.cpp @@ -443,12 +443,8 @@ void Language::GetDefaultExceptionResolverDescription(bool catch_on, s.Printf("Exception breakpoint (catch: %s throw: %s)", catch_on ? "on" : "off", throw_on ? "on" : "off"); } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- Language::Language() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Language::~Language() {} diff --git a/lldb/source/Target/Memory.cpp b/lldb/source/Target/Memory.cpp index 7433317..31a3780 100644 --- a/lldb/source/Target/Memory.cpp +++ b/lldb/source/Target/Memory.cpp @@ -19,17 +19,13 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // MemoryCache constructor -//---------------------------------------------------------------------- MemoryCache::MemoryCache(Process &process) : m_mutex(), m_L1_cache(), m_L2_cache(), m_invalid_ranges(), m_process(process), m_L2_cache_line_byte_size(process.GetMemoryCacheLineSize()) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- MemoryCache::~MemoryCache() {} void MemoryCache::Clear(bool clear_invalid_ranges) { diff --git a/lldb/source/Target/ObjCLanguageRuntime.cpp b/lldb/source/Target/ObjCLanguageRuntime.cpp index cd97707..5ed545a 100644 --- a/lldb/source/Target/ObjCLanguageRuntime.cpp +++ b/lldb/source/Target/ObjCLanguageRuntime.cpp @@ -27,9 +27,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ObjCLanguageRuntime::~ObjCLanguageRuntime() {} ObjCLanguageRuntime::ObjCLanguageRuntime(Process *process) @@ -355,9 +353,7 @@ bool ObjCLanguageRuntime::GetTypeBitSize(const CompilerType &compiler_type, return found; } -//------------------------------------------------------------------ // Exception breakpoint Precondition class for ObjC: -//------------------------------------------------------------------ void ObjCLanguageRuntime::ObjCExceptionPrecondition::AddClassName( const char *class_name) { m_class_names.insert(class_name); diff --git a/lldb/source/Target/PathMappingList.cpp b/lldb/source/Target/PathMappingList.cpp index 3c07b80..58c2c43 100644 --- a/lldb/source/Target/PathMappingList.cpp +++ b/lldb/source/Target/PathMappingList.cpp @@ -36,9 +36,7 @@ namespace { return ConstString(FileSpec(path.GetStringRef()).GetPath()); } } -//---------------------------------------------------------------------- // PathMappingList constructor -//---------------------------------------------------------------------- PathMappingList::PathMappingList() : m_pairs(), m_callback(nullptr), m_callback_baton(nullptr), m_mod_id(0) {} diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 79ef638..710f82e 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -117,7 +117,6 @@ bool PlatformProperties::SetModuleCacheDirectory(const FileSpec &dir_spec) { nullptr, ePropertyModuleCacheDirectory, dir_spec); } -//------------------------------------------------------------------ /// Get the native host platform plug-in. /// /// There should only be one of these for each host that LLDB runs @@ -126,7 +125,6 @@ bool PlatformProperties::SetModuleCacheDirectory(const FileSpec &dir_spec) { /// /// This platform will be used as the default platform when launching /// or attaching to processes unless another platform is specified. -//------------------------------------------------------------------ PlatformSP Platform::GetHostPlatform() { return GetHostPlatformSP(); } static std::vector<PlatformSP> &GetPlatformList() { @@ -377,9 +375,7 @@ ArchSpec Platform::GetAugmentedArchSpec(Platform *platform, llvm::StringRef trip return HostInfo::GetAugmentedArchSpec(triple); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ Platform::Platform(bool is_host) : m_is_host(is_host), m_os_version_set_while_connected(false), m_system_arch_set_while_connected(false), m_sdk_sysroot(), m_sdk_build(), @@ -394,12 +390,10 @@ Platform::Platform(bool is_host) log->Printf("%p Platform::Platform()", static_cast<void *>(this)); } -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ Platform::~Platform() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT)); if (log) @@ -1198,10 +1192,8 @@ Platform::GetPlatformForArchitecture(const ArchSpec &arch, return platform_sp; } -//------------------------------------------------------------------ /// Lets a platform answer if it is compatible with a given /// architecture and the target triple contained within. -//------------------------------------------------------------------ bool Platform::IsCompatibleArchitecture(const ArchSpec &arch, bool exact_arch_match, ArchSpec *compatible_arch_ptr) { diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 35433b5..75566150 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3910,9 +3910,7 @@ thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) { return NULL; } -//------------------------------------------------------------------ // Process Event Data -//------------------------------------------------------------------ Process::ProcessEventData::ProcessEventData() : EventData(), m_process_wp(), m_state(eStateInvalid), m_restarted(false), @@ -4288,9 +4286,7 @@ size_t Process::GetAsyncProfileData(char *buf, size_t buf_size, Status &error) { return bytes_available; } -//------------------------------------------------------------------ // Process STDIO -//------------------------------------------------------------------ size_t Process::GetSTDOUT(char *buf, size_t buf_size, Status &error) { std::lock_guard<std::recursive_mutex> guard(m_stdio_communication_mutex); diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 215080f..f8b22d9 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -259,12 +259,10 @@ Block *StackFrame::GetFrameBlock() { return nullptr; } -//---------------------------------------------------------------------- // Get the symbol context if we already haven't done so by resolving the // PC address as much as possible. This way when we pass around a // StackFrame object, everyone will have as much information as possible and no // one will ever have to look things up manually. -//---------------------------------------------------------------------- const SymbolContext & StackFrame::GetSymbolContext(SymbolContextItem resolve_scope) { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -1453,7 +1451,6 @@ ValueObjectSP GetValueForDereferincingOffset(StackFrame &frame, return GetValueForOffset(frame, pointee, offset); } -//------------------------------------------------------------------ /// Attempt to reconstruct the ValueObject for the address contained in a /// given register plus an offset. /// @@ -1479,7 +1476,6 @@ ValueObjectSP GetValueForDereferincingOffset(StackFrame &frame, /// A string describing the base for the ExpressionPath. This could be a /// variable, a register value, an argument, or a function return value. /// The ValueObject if found. If valid, it has a valid ExpressionPath. -//------------------------------------------------------------------ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg, int64_t offset, Disassembler &disassembler, VariableList &variables, const Address &pc) { diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index de80ae7..5492dda 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -31,9 +31,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // StackFrameList constructor -//---------------------------------------------------------------------- StackFrameList::StackFrameList(Thread &thread, const lldb::StackFrameListSP &prev_frames_sp, bool show_inline_frames) diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp index bcab99b..8f0ab34 100644 --- a/lldb/source/Target/StopInfo.cpp +++ b/lldb/source/Target/StopInfo.cpp @@ -78,9 +78,7 @@ bool StopInfo::HasTargetRunSinceMe() { return false; } -//---------------------------------------------------------------------- // StopInfoBreakpoint -//---------------------------------------------------------------------- namespace lldb_private { class StopInfoBreakpoint : public StopInfo { @@ -575,9 +573,7 @@ private: bool m_was_one_shot; }; -//---------------------------------------------------------------------- // StopInfoWatchpoint -//---------------------------------------------------------------------- class StopInfoWatchpoint : public StopInfo { public: @@ -912,9 +908,7 @@ private: lldb::addr_t m_watch_hit_addr; }; -//---------------------------------------------------------------------- // StopInfoUnixSignal -//---------------------------------------------------------------------- class StopInfoUnixSignal : public StopInfo { public: @@ -989,9 +983,7 @@ public: } }; -//---------------------------------------------------------------------- // StopInfoTrace -//---------------------------------------------------------------------- class StopInfoTrace : public StopInfo { public: @@ -1009,9 +1001,7 @@ public: } }; -//---------------------------------------------------------------------- // StopInfoException -//---------------------------------------------------------------------- class StopInfoException : public StopInfo { public: @@ -1033,9 +1023,7 @@ public: } }; -//---------------------------------------------------------------------- // StopInfoThreadPlan -//---------------------------------------------------------------------- class StopInfoThreadPlan : public StopInfo { public: @@ -1078,9 +1066,7 @@ private: ExpressionVariableSP m_expression_variable_sp; }; -//---------------------------------------------------------------------- // StopInfoExec -//---------------------------------------------------------------------- class StopInfoExec : public StopInfo { public: diff --git a/lldb/source/Target/SystemRuntime.cpp b/lldb/source/Target/SystemRuntime.cpp index e53816a..286bea0 100644 --- a/lldb/source/Target/SystemRuntime.cpp +++ b/lldb/source/Target/SystemRuntime.cpp @@ -27,9 +27,7 @@ SystemRuntime *SystemRuntime::FindPlugin(Process *process) { return nullptr; } -//---------------------------------------------------------------------- // SystemRuntime constructor -//---------------------------------------------------------------------- SystemRuntime::SystemRuntime(Process *process) : m_process(process), m_types() {} diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index f382813..c05102a 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -3160,9 +3160,7 @@ void Target::FinalizeFileActions(ProcessLaunchInfo &info) { } } -//-------------------------------------------------------------- // Target::StopHook -//-------------------------------------------------------------- Target::StopHook::StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid) : UserID(uid), m_target_sp(target_sp), m_commands(), m_specifier_sp(), m_thread_spec_up() {} @@ -3229,9 +3227,7 @@ void Target::StopHook::GetDescription(Stream *s, s->SetIndentLevel(indent_level); } -//-------------------------------------------------------------- // class TargetProperties -//-------------------------------------------------------------- // clang-format off static constexpr OptionEnumValueElement g_dynamic_value_types[] = { @@ -3592,9 +3588,7 @@ protected: mutable bool m_got_host_env; }; -//---------------------------------------------------------------------- // TargetProperties -//---------------------------------------------------------------------- static constexpr PropertyDefinition g_experimental_properties[]{ {"inject-local-vars", OptionValue::eTypeBoolean, true, true, nullptr, {}, @@ -3620,9 +3614,7 @@ TargetExperimentalProperties::TargetExperimentalProperties() m_collection_sp->Initialize(g_experimental_properties); } -//---------------------------------------------------------------------- // TargetProperties -//---------------------------------------------------------------------- TargetProperties::TargetProperties(Target *target) : Properties(), m_launch_info() { if (target) { @@ -4220,9 +4212,7 @@ void TargetProperties::DisableSTDIOValueChangedCallback( this_->m_launch_info.GetFlags().Clear(lldb::eLaunchFlagDisableSTDIO); } -//---------------------------------------------------------------------- // Target::TargetEventData -//---------------------------------------------------------------------- Target::TargetEventData::TargetEventData(const lldb::TargetSP &target_sp) : EventData(), m_target_sp(target_sp), m_module_list() {} diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp index c0d0f91..8c77876 100644 --- a/lldb/source/Target/TargetList.cpp +++ b/lldb/source/Target/TargetList.cpp @@ -34,9 +34,7 @@ ConstString &TargetList::GetStaticBroadcasterClass() { return class_name; } -//---------------------------------------------------------------------- // TargetList constructor -//---------------------------------------------------------------------- TargetList::TargetList(Debugger &debugger) : Broadcaster(debugger.GetBroadcasterManager(), TargetList::GetStaticBroadcasterClass().AsCString()), @@ -44,9 +42,7 @@ TargetList::TargetList(Debugger &debugger) CheckInWithManager(); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- TargetList::~TargetList() { std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex); m_target_list.clear(); diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index baefff9..e08e3bb 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -171,9 +171,7 @@ uint64_t ThreadProperties::GetMaxBacktraceDepth() const { nullptr, idx, g_properties[idx].default_uint_value != 0); } -//------------------------------------------------------------------ // Thread Event Data -//------------------------------------------------------------------ ConstString Thread::ThreadEventData::GetFlavorString() { static ConstString g_flavor("Thread::ThreadEventData"); @@ -234,9 +232,7 @@ Thread::ThreadEventData::GetStackFrameFromEvent(const Event *event_ptr) { return frame_sp; } -//------------------------------------------------------------------ // Thread class -//------------------------------------------------------------------ ConstString &Thread::GetStaticBroadcasterClass() { static ConstString class_name("lldb.thread"); diff --git a/lldb/source/Target/ThreadPlan.cpp b/lldb/source/Target/ThreadPlan.cpp index 6570e1d..1d8cc18 100644 --- a/lldb/source/Target/ThreadPlan.cpp +++ b/lldb/source/Target/ThreadPlan.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlan constructor -//---------------------------------------------------------------------- ThreadPlan::ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, Vote stop_vote, Vote run_vote) : m_thread(thread), m_stop_vote(stop_vote), m_run_vote(run_vote), @@ -32,9 +30,7 @@ ThreadPlan::ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, SetID(GetNextID()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ThreadPlan::~ThreadPlan() = default; bool ThreadPlan::PlanExplainsStop(Event *event_ptr) { @@ -160,9 +156,7 @@ bool ThreadPlan::IsUsuallyUnexplainedStopReason(lldb::StopReason reason) { } } -//---------------------------------------------------------------------- // ThreadPlanNull -//---------------------------------------------------------------------- ThreadPlanNull::ThreadPlanNull(Thread &thread) : ThreadPlan(ThreadPlan::eKindNull, "Null Thread Plan", thread, diff --git a/lldb/source/Target/ThreadPlanBase.cpp b/lldb/source/Target/ThreadPlanBase.cpp index 2cce1e8..9cd4bcb 100644 --- a/lldb/source/Target/ThreadPlanBase.cpp +++ b/lldb/source/Target/ThreadPlanBase.cpp @@ -22,11 +22,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanBase: This one always stops, and never has anything particular to // do. // FIXME: The "signal handling" policies should probably go here. -//---------------------------------------------------------------------- ThreadPlanBase::ThreadPlanBase(Thread &thread) : ThreadPlan(ThreadPlan::eKindBase, "base plan", thread, eVoteYes, diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 0c488de..68d771c 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -29,9 +29,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanCallFunction: Plan to call a single function -//---------------------------------------------------------------------- bool ThreadPlanCallFunction::ConstructorSetup( Thread &thread, ABI *&abi, lldb::addr_t &start_load_addr, lldb::addr_t &function_load_addr) { diff --git a/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp b/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp index 8a7f2c7..3155e6f 100644 --- a/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp +++ b/lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp @@ -18,10 +18,8 @@ using namespace lldb; using namespace lldb_private; -//-------------------------------------------------------------------------------------------- // ThreadPlanCallFunctionUsingABI: Plan to call a single function using the ABI // instead of JIT -//------------------------------------------------------------------------------------------- ThreadPlanCallFunctionUsingABI::ThreadPlanCallFunctionUsingABI( Thread &thread, const Address &function, llvm::Type &prototype, llvm::Type &return_type, llvm::ArrayRef<ABI::CallArgument> args, diff --git a/lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp b/lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp index 13e9542..3330adc 100644 --- a/lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp +++ b/lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp @@ -40,9 +40,7 @@ void ThreadPlanCallOnFunctionExit::DidPush() { ); } -// ------------------------------------------------------------------------- // ThreadPlan API -// ------------------------------------------------------------------------- void ThreadPlanCallOnFunctionExit::GetDescription( Stream *s, lldb::DescriptionLevel level) { diff --git a/lldb/source/Target/ThreadPlanCallUserExpression.cpp b/lldb/source/Target/ThreadPlanCallUserExpression.cpp index fa83cf6..2998daa 100644 --- a/lldb/source/Target/ThreadPlanCallUserExpression.cpp +++ b/lldb/source/Target/ThreadPlanCallUserExpression.cpp @@ -29,9 +29,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanCallUserExpression: Plan to call a single function -//---------------------------------------------------------------------- ThreadPlanCallUserExpression::ThreadPlanCallUserExpression( Thread &thread, Address &function, llvm::ArrayRef<lldb::addr_t> args, diff --git a/lldb/source/Target/ThreadPlanPython.cpp b/lldb/source/Target/ThreadPlanPython.cpp index f9c85ed..baf49ed 100644 --- a/lldb/source/Target/ThreadPlanPython.cpp +++ b/lldb/source/Target/ThreadPlanPython.cpp @@ -23,9 +23,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanPython -//---------------------------------------------------------------------- ThreadPlanPython::ThreadPlanPython(Thread &thread, const char *class_name) : ThreadPlan(ThreadPlan::eKindPython, "Python based Thread Plan", thread, diff --git a/lldb/source/Target/ThreadPlanRunToAddress.cpp b/lldb/source/Target/ThreadPlanRunToAddress.cpp index 4c76955..a973bd11 100644 --- a/lldb/source/Target/ThreadPlanRunToAddress.cpp +++ b/lldb/source/Target/ThreadPlanRunToAddress.cpp @@ -17,9 +17,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanRunToAddress: Continue plan -//---------------------------------------------------------------------- ThreadPlanRunToAddress::ThreadPlanRunToAddress(Thread &thread, Address &address, bool stop_others) diff --git a/lldb/source/Target/ThreadPlanShouldStopHere.cpp b/lldb/source/Target/ThreadPlanShouldStopHere.cpp index 46088ff..111c5b4 100644 --- a/lldb/source/Target/ThreadPlanShouldStopHere.cpp +++ b/lldb/source/Target/ThreadPlanShouldStopHere.cpp @@ -15,9 +15,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanShouldStopHere constructor -//---------------------------------------------------------------------- ThreadPlanShouldStopHere::ThreadPlanShouldStopHere(ThreadPlan *owner) : m_callbacks(), m_baton(nullptr), m_owner(owner), m_flags(ThreadPlanShouldStopHere::eNone) { diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index 6e8fc98..2065fa5 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -28,10 +28,8 @@ using namespace lldb_private; uint32_t ThreadPlanStepInRange::s_default_flag_values = ThreadPlanShouldStopHere::eStepInAvoidNoDebug; -//---------------------------------------------------------------------- // ThreadPlanStepInRange: Step through a stack range, either stepping over or // into based on the value of \a type. -//---------------------------------------------------------------------- ThreadPlanStepInRange::ThreadPlanStepInRange( Thread &thread, const AddressRange &range, diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp index b790db5..a11b623 100644 --- a/lldb/source/Target/ThreadPlanStepInstruction.cpp +++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepInstruction: Step over the current instruction -//---------------------------------------------------------------------- ThreadPlanStepInstruction::ThreadPlanStepInstruction(Thread &thread, bool step_over, diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp index 2683ec3..3461be5 100644 --- a/lldb/source/Target/ThreadPlanStepOut.cpp +++ b/lldb/source/Target/ThreadPlanStepOut.cpp @@ -30,9 +30,7 @@ using namespace lldb_private; uint32_t ThreadPlanStepOut::s_default_flag_values = 0; -//---------------------------------------------------------------------- // ThreadPlanStepOut: Step out of the current frame -//---------------------------------------------------------------------- ThreadPlanStepOut::ThreadPlanStepOut( Thread &thread, SymbolContext *context, bool first_insn, bool stop_others, Vote stop_vote, Vote run_vote, uint32_t frame_idx, diff --git a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp index 644a976..4770b57 100644 --- a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp @@ -16,10 +16,8 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepOverBreakpoint: Single steps over a breakpoint bp_site_sp at // the pc. -//---------------------------------------------------------------------- ThreadPlanStepOverBreakpoint::ThreadPlanStepOverBreakpoint(Thread &thread) : ThreadPlan( diff --git a/lldb/source/Target/ThreadPlanStepOverRange.cpp b/lldb/source/Target/ThreadPlanStepOverRange.cpp index 47830bfd..3aaeac9 100644 --- a/lldb/source/Target/ThreadPlanStepOverRange.cpp +++ b/lldb/source/Target/ThreadPlanStepOverRange.cpp @@ -25,10 +25,8 @@ using namespace lldb; uint32_t ThreadPlanStepOverRange::s_default_flag_values = 0; -//---------------------------------------------------------------------- // ThreadPlanStepOverRange: Step through a stack range, either stepping over or // into based on the value of \a type. -//---------------------------------------------------------------------- ThreadPlanStepOverRange::ThreadPlanStepOverRange( Thread &thread, const AddressRange &range, diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 215b62d..7b0a588 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -25,10 +25,8 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepRange: Step through a stack range, either stepping over or // into based on the value of \a type. -//---------------------------------------------------------------------- ThreadPlanStepRange::ThreadPlanStepRange(ThreadPlanKind kind, const char *name, Thread &thread, diff --git a/lldb/source/Target/ThreadPlanStepThrough.cpp b/lldb/source/Target/ThreadPlanStepThrough.cpp index 6f49d15..d08d779 100644 --- a/lldb/source/Target/ThreadPlanStepThrough.cpp +++ b/lldb/source/Target/ThreadPlanStepThrough.cpp @@ -20,12 +20,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepThrough: If the current instruction is a trampoline, step // through it If it is the beginning of the prologue of a function, step // through that as well. // FIXME: At present only handles DYLD trampolines. -//---------------------------------------------------------------------- ThreadPlanStepThrough::ThreadPlanStepThrough(Thread &thread, StackID &m_stack_id, diff --git a/lldb/source/Target/ThreadPlanStepUntil.cpp b/lldb/source/Target/ThreadPlanStepUntil.cpp index 6bd543c..d4109c3 100644 --- a/lldb/source/Target/ThreadPlanStepUntil.cpp +++ b/lldb/source/Target/ThreadPlanStepUntil.cpp @@ -19,10 +19,8 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepUntil: Run until we reach a given line number or step out of // the current frame -//---------------------------------------------------------------------- ThreadPlanStepUntil::ThreadPlanStepUntil(Thread &thread, lldb::addr_t *address_list, diff --git a/lldb/source/Target/UnixSignals.cpp b/lldb/source/Target/UnixSignals.cpp index 9705103..33090a7 100644 --- a/lldb/source/Target/UnixSignals.cpp +++ b/lldb/source/Target/UnixSignals.cpp @@ -57,9 +57,7 @@ lldb::UnixSignalsSP UnixSignals::CreateForHost() { return s_unix_signals_sp; } -//---------------------------------------------------------------------- // UnixSignals constructor -//---------------------------------------------------------------------- UnixSignals::UnixSignals() { Reset(); } UnixSignals::UnixSignals(const UnixSignals &rhs) : m_signals(rhs.m_signals) {} diff --git a/lldb/source/Utility/Args.cpp b/lldb/source/Utility/Args.cpp index edcbf69..e002378 100644 --- a/lldb/source/Utility/Args.cpp +++ b/lldb/source/Utility/Args.cpp @@ -165,9 +165,7 @@ Args::ArgEntry::ArgEntry(llvm::StringRef str, char quote) : quote(quote) { ref = llvm::StringRef(c_str(), size); } -//---------------------------------------------------------------------- // Args constructor -//---------------------------------------------------------------------- Args::Args(llvm::StringRef command) { SetCommandString(command); } Args::Args(const Args &rhs) { *this = rhs; } @@ -190,9 +188,7 @@ Args &Args::operator=(const Args &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- Args::~Args() {} void Args::Dump(Stream &s, const char *label_name) const { diff --git a/lldb/source/Utility/ConstString.cpp b/lldb/source/Utility/ConstString.cpp index 9a6e625..277a3ce 100644 --- a/lldb/source/Utility/ConstString.cpp +++ b/lldb/source/Utility/ConstString.cpp @@ -149,10 +149,8 @@ public: return nullptr; } - //------------------------------------------------------------------ // Return the size in bytes that this object and any items in its collection // of uniqued strings + data count values takes in memory. - //------------------------------------------------------------------ size_t MemorySize() const { size_t mem_size = sizeof(Pool); for (const auto &pool : m_string_pools) { @@ -177,7 +175,6 @@ protected: std::array<PoolEntry, 256> m_string_pools; }; -//---------------------------------------------------------------------- // Frameworks and dylibs aren't supposed to have global C++ initializers so we // hide the string pool in a static function so that it will get initialized on // the first call to this static function. @@ -186,7 +183,6 @@ protected: // can't guarantee that some objects won't get destroyed after the global // destructor chain is run, and trying to make sure no destructors touch // ConstStrings is difficult. So we leak the pool instead. -//---------------------------------------------------------------------- static Pool &StringPool() { static llvm::once_flag g_pool_initialization_flag; static Pool *g_string_pool = nullptr; diff --git a/lldb/source/Utility/DataBufferHeap.cpp b/lldb/source/Utility/DataBufferHeap.cpp index 5406cb9..baefe41 100644 --- a/lldb/source/Utility/DataBufferHeap.cpp +++ b/lldb/source/Utility/DataBufferHeap.cpp @@ -11,57 +11,41 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // Default constructor -//---------------------------------------------------------------------- DataBufferHeap::DataBufferHeap() : m_data() {} -//---------------------------------------------------------------------- // Initialize this class with "n" characters and fill the buffer with "ch". -//---------------------------------------------------------------------- DataBufferHeap::DataBufferHeap(lldb::offset_t n, uint8_t ch) : m_data() { if (n < m_data.max_size()) m_data.assign(n, ch); } -//---------------------------------------------------------------------- // Initialize this class with a copy of the "n" bytes from the "bytes" buffer. -//---------------------------------------------------------------------- DataBufferHeap::DataBufferHeap(const void *src, lldb::offset_t src_len) : m_data() { CopyData(src, src_len); } -//---------------------------------------------------------------------- // Virtual destructor since this class inherits from a pure virtual base class. -//---------------------------------------------------------------------- DataBufferHeap::~DataBufferHeap() = default; -//---------------------------------------------------------------------- // Return a pointer to the bytes owned by this object, or nullptr if the object // contains no bytes. -//---------------------------------------------------------------------- uint8_t *DataBufferHeap::GetBytes() { return (m_data.empty() ? nullptr : m_data.data()); } -//---------------------------------------------------------------------- // Return a const pointer to the bytes owned by this object, or nullptr if the // object contains no bytes. -//---------------------------------------------------------------------- const uint8_t *DataBufferHeap::GetBytes() const { return (m_data.empty() ? nullptr : m_data.data()); } -//---------------------------------------------------------------------- // Return the number of bytes this object currently contains. -//---------------------------------------------------------------------- uint64_t DataBufferHeap::GetByteSize() const { return m_data.size(); } -//---------------------------------------------------------------------- // Sets the number of bytes that this object should be able to contain. This // can be used prior to copying data into the buffer. -//---------------------------------------------------------------------- uint64_t DataBufferHeap::SetByteSize(uint64_t new_size) { m_data.resize(new_size); return m_data.size(); diff --git a/lldb/source/Utility/DataEncoder.cpp b/lldb/source/Utility/DataEncoder.cpp index 66a128f..cf4e0cd 100644 --- a/lldb/source/Utility/DataEncoder.cpp +++ b/lldb/source/Utility/DataEncoder.cpp @@ -24,29 +24,23 @@ using namespace lldb; using namespace lldb_private; using namespace llvm::support::endian; -//---------------------------------------------------------------------- // Default constructor. -//---------------------------------------------------------------------- DataEncoder::DataEncoder() : m_start(nullptr), m_end(nullptr), m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)), m_data_sp() {} -//---------------------------------------------------------------------- // This constructor allows us to use data that is owned by someone else. The // data must stay around as long as this object is valid. -//---------------------------------------------------------------------- DataEncoder::DataEncoder(void *data, uint32_t length, ByteOrder endian, uint8_t addr_size) : m_start((uint8_t *)data), m_end((uint8_t *)data + length), m_byte_order(endian), m_addr_size(addr_size), m_data_sp() {} -//---------------------------------------------------------------------- // Make a shared pointer reference to the shared data in "data_sp" and set the // endian swapping setting to "swap", and the address size to "addr_size". The // shared data reference will ensure the data lives as long as any DataEncoder // objects exist that have a reference to this data. -//---------------------------------------------------------------------- DataEncoder::DataEncoder(const DataBufferSP &data_sp, ByteOrder endian, uint8_t addr_size) : m_start(nullptr), m_end(nullptr), m_byte_order(endian), @@ -56,10 +50,8 @@ DataEncoder::DataEncoder(const DataBufferSP &data_sp, ByteOrder endian, DataEncoder::~DataEncoder() = default; -//------------------------------------------------------------------ // Clears the object contents back to a default invalid state, and release any // references to shared data that this object may contain. -//------------------------------------------------------------------ void DataEncoder::Clear() { m_start = nullptr; m_end = nullptr; @@ -68,10 +60,8 @@ void DataEncoder::Clear() { m_data_sp.reset(); } -//------------------------------------------------------------------ // If this object contains shared data, this function returns the offset into // that shared data. Else zero is returned. -//------------------------------------------------------------------ size_t DataEncoder::GetSharedDataOffset() const { if (m_start != nullptr) { const DataBuffer *data = m_data_sp.get(); @@ -86,7 +76,6 @@ size_t DataEncoder::GetSharedDataOffset() const { return 0; } -//---------------------------------------------------------------------- // Set the data with which this object will extract from to data starting at // BYTES and set the length of the data to LENGTH bytes long. The data is // externally owned must be around at least as long as this object points to @@ -94,7 +83,6 @@ size_t DataEncoder::GetSharedDataOffset() const { // and can extract from it. If this object refers to any shared data upon // entry, the reference to that data will be released. Is SWAP is set to true, // any data extracted will be endian swapped. -//---------------------------------------------------------------------- uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) { m_byte_order = endian; m_data_sp.reset(); @@ -108,7 +96,6 @@ uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) { return GetByteSize(); } -//---------------------------------------------------------------------- // Assign the data for this object to be a subrange of the shared data in // "data_sp" starting "data_offset" bytes into "data_sp" and ending // "data_length" bytes later. If "data_offset" is not a valid offset into @@ -120,7 +107,6 @@ uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) { // starting at "data_offset") to ensure the data stays around as long as it is // needed. The address size and endian swap settings will remain unchanged from // their current settings. -//---------------------------------------------------------------------- uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset, uint32_t data_length) { m_start = m_end = nullptr; @@ -152,12 +138,10 @@ uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset, return new_size; } -//---------------------------------------------------------------------- // Extract a single unsigned char from the binary data and update the offset // pointed to by "offset_ptr". // // RETURNS the byte that was extracted, or zero on failure. -//---------------------------------------------------------------------- uint32_t DataEncoder::PutU8(uint32_t offset, uint8_t value) { if (ValidOffset(offset)) { m_start[offset] = value; @@ -202,7 +186,6 @@ uint32_t DataEncoder::PutU64(uint32_t offset, uint64_t value) { return UINT32_MAX; } -//---------------------------------------------------------------------- // Extract a single integer value from the data and update the offset pointed // to by "offset_ptr". The size of the extracted integer is specified by the // "byte_size" argument. "byte_size" should have a value >= 1 and <= 8 since @@ -211,7 +194,6 @@ uint32_t DataEncoder::PutU64(uint32_t offset, uint64_t value) { // returned. // // RETURNS the integer value that was extracted, or zero on failure. -//---------------------------------------------------------------------- uint32_t DataEncoder::PutMaxU64(uint32_t offset, uint32_t byte_size, uint64_t value) { switch (byte_size) { diff --git a/lldb/source/Utility/DataExtractor.cpp b/lldb/source/Utility/DataExtractor.cpp index bc1af65..61aacf4 100644 --- a/lldb/source/Utility/DataExtractor.cpp +++ b/lldb/source/Utility/DataExtractor.cpp @@ -124,10 +124,8 @@ DataExtractor::DataExtractor() m_byte_order(endian::InlHostByteOrder()), m_addr_size(sizeof(void *)), m_data_sp(), m_target_byte_size(1) {} -//---------------------------------------------------------------------- // This constructor allows us to use data that is owned by someone else. The // data must stay around as long as this object is valid. -//---------------------------------------------------------------------- DataExtractor::DataExtractor(const void *data, offset_t length, ByteOrder endian, uint32_t addr_size, uint32_t target_byte_size /*=1*/) @@ -139,12 +137,10 @@ DataExtractor::DataExtractor(const void *data, offset_t length, assert(addr_size == 4 || addr_size == 8); } -//---------------------------------------------------------------------- // Make a shared pointer reference to the shared data in "data_sp" and set the // endian swapping setting to "swap", and the address size to "addr_size". The // shared data reference will ensure the data lives as long as any // DataExtractor objects exist that have a reference to this data. -//---------------------------------------------------------------------- DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian, uint32_t addr_size, uint32_t target_byte_size /*=1*/) @@ -155,13 +151,11 @@ DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian, SetData(data_sp); } -//---------------------------------------------------------------------- // Initialize this object with a subset of the data bytes in "data". If "data" // contains shared data, then a reference to this shared data will added and // the shared data will stay around as long as any object contains a reference // to that data. The endian swap and address size settings are copied from // "data". -//---------------------------------------------------------------------- DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset, offset_t length, uint32_t target_byte_size /*=1*/) : m_start(nullptr), m_end(nullptr), m_byte_order(data.m_byte_order), @@ -183,9 +177,7 @@ DataExtractor::DataExtractor(const DataExtractor &rhs) assert(m_addr_size == 4 || m_addr_size == 8); } -//---------------------------------------------------------------------- // Assignment operator -//---------------------------------------------------------------------- const DataExtractor &DataExtractor::operator=(const DataExtractor &rhs) { if (this != &rhs) { m_start = rhs.m_start; @@ -199,10 +191,8 @@ const DataExtractor &DataExtractor::operator=(const DataExtractor &rhs) { DataExtractor::~DataExtractor() = default; -//------------------------------------------------------------------ // Clears the object contents back to a default invalid state, and release any // references to shared data that this object may contain. -//------------------------------------------------------------------ void DataExtractor::Clear() { m_start = nullptr; m_end = nullptr; @@ -211,10 +201,8 @@ void DataExtractor::Clear() { m_data_sp.reset(); } -//------------------------------------------------------------------ // If this object contains shared data, this function returns the offset into // that shared data. Else zero is returned. -//------------------------------------------------------------------ size_t DataExtractor::GetSharedDataOffset() const { if (m_start != nullptr) { const DataBuffer *data = m_data_sp.get(); @@ -229,7 +217,6 @@ size_t DataExtractor::GetSharedDataOffset() const { return 0; } -//---------------------------------------------------------------------- // Set the data with which this object will extract from to data starting at // BYTES and set the length of the data to LENGTH bytes long. The data is // externally owned must be around at least as long as this object points to @@ -237,7 +224,6 @@ size_t DataExtractor::GetSharedDataOffset() const { // and can extract from it. If this object refers to any shared data upon // entry, the reference to that data will be released. Is SWAP is set to true, // any data extracted will be endian swapped. -//---------------------------------------------------------------------- lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length, ByteOrder endian) { m_byte_order = endian; @@ -252,7 +238,6 @@ lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length, return GetByteSize(); } -//---------------------------------------------------------------------- // Assign the data for this object to be a subrange in "data" starting // "data_offset" bytes into "data" and ending "data_length" bytes later. If // "data_offset" is not a valid offset into "data", then this object will @@ -263,7 +248,6 @@ lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length, // a shared pointer to data, then the bytes referred to in "data" will need to // exist at least as long as this object refers to those bytes. The address // size and endian swap settings are copied from the current values in "data". -//---------------------------------------------------------------------- lldb::offset_t DataExtractor::SetData(const DataExtractor &data, offset_t data_offset, offset_t data_length) { @@ -286,7 +270,6 @@ lldb::offset_t DataExtractor::SetData(const DataExtractor &data, return 0; } -//---------------------------------------------------------------------- // Assign the data for this object to be a subrange of the shared data in // "data_sp" starting "data_offset" bytes into "data_sp" and ending // "data_length" bytes later. If "data_offset" is not a valid offset into @@ -298,7 +281,6 @@ lldb::offset_t DataExtractor::SetData(const DataExtractor &data, // starting at "data_offset") to ensure the data stays around as long as it is // needed. The address size and endian swap settings will remain unchanged from // their current settings. -//---------------------------------------------------------------------- lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp, offset_t data_offset, offset_t data_length) { @@ -331,12 +313,10 @@ lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp, return new_size; } -//---------------------------------------------------------------------- // Extract a single unsigned char from the binary data and update the offset // pointed to by "offset_ptr". // // RETURNS the byte that was extracted, or zero on failure. -//---------------------------------------------------------------------- uint8_t DataExtractor::GetU8(offset_t *offset_ptr) const { const uint8_t *data = (const uint8_t *)GetData(offset_ptr, 1); if (data) @@ -344,14 +324,12 @@ uint8_t DataExtractor::GetU8(offset_t *offset_ptr) const { return 0; } -//---------------------------------------------------------------------- // Extract "count" unsigned chars from the binary data and update the offset // pointed to by "offset_ptr". The extracted data is copied into "dst". // // RETURNS the non-nullptr buffer pointer upon successful extraction of // all the requested bytes, or nullptr when the data is not available in the // buffer due to being out of bounds, or insufficient data. -//---------------------------------------------------------------------- void *DataExtractor::GetU8(offset_t *offset_ptr, void *dst, uint32_t count) const { const uint8_t *data = (const uint8_t *)GetData(offset_ptr, count); @@ -365,12 +343,10 @@ void *DataExtractor::GetU8(offset_t *offset_ptr, void *dst, return nullptr; } -//---------------------------------------------------------------------- // Extract a single uint16_t from the data and update the offset pointed to by // "offset_ptr". // // RETURNS the uint16_t that was extracted, or zero on failure. -//---------------------------------------------------------------------- uint16_t DataExtractor::GetU16(offset_t *offset_ptr) const { uint16_t val = 0; const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val)); @@ -413,14 +389,12 @@ uint64_t DataExtractor::GetU64_unchecked(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Extract "count" uint16_t values from the binary data and update the offset // pointed to by "offset_ptr". The extracted data is copied into "dst". // // RETURNS the non-nullptr buffer pointer upon successful extraction of // all the requested bytes, or nullptr when the data is not available in the // buffer due to being out of bounds, or insufficient data. -//---------------------------------------------------------------------- void *DataExtractor::GetU16(offset_t *offset_ptr, void *void_dst, uint32_t count) const { const size_t src_size = sizeof(uint16_t) * count; @@ -445,12 +419,10 @@ void *DataExtractor::GetU16(offset_t *offset_ptr, void *void_dst, return nullptr; } -//---------------------------------------------------------------------- // Extract a single uint32_t from the data and update the offset pointed to by // "offset_ptr". // // RETURNS the uint32_t that was extracted, or zero on failure. -//---------------------------------------------------------------------- uint32_t DataExtractor::GetU32(offset_t *offset_ptr) const { uint32_t val = 0; const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val)); @@ -464,14 +436,12 @@ uint32_t DataExtractor::GetU32(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Extract "count" uint32_t values from the binary data and update the offset // pointed to by "offset_ptr". The extracted data is copied into "dst". // // RETURNS the non-nullptr buffer pointer upon successful extraction of // all the requested bytes, or nullptr when the data is not available in the // buffer due to being out of bounds, or insufficient data. -//---------------------------------------------------------------------- void *DataExtractor::GetU32(offset_t *offset_ptr, void *void_dst, uint32_t count) const { const size_t src_size = sizeof(uint32_t) * count; @@ -496,12 +466,10 @@ void *DataExtractor::GetU32(offset_t *offset_ptr, void *void_dst, return nullptr; } -//---------------------------------------------------------------------- // Extract a single uint64_t from the data and update the offset pointed to by // "offset_ptr". // // RETURNS the uint64_t that was extracted, or zero on failure. -//---------------------------------------------------------------------- uint64_t DataExtractor::GetU64(offset_t *offset_ptr) const { uint64_t val = 0; const uint8_t *data = (const uint8_t *)GetData(offset_ptr, sizeof(val)); @@ -515,13 +483,11 @@ uint64_t DataExtractor::GetU64(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // GetU64 // // Get multiple consecutive 64 bit values. Return true if the entire read // succeeds and increment the offset pointed to by offset_ptr, else return // false and leave the offset pointed to by offset_ptr unchanged. -//---------------------------------------------------------------------- void *DataExtractor::GetU64(offset_t *offset_ptr, void *void_dst, uint32_t count) const { const size_t src_size = sizeof(uint64_t) * count; @@ -687,14 +653,12 @@ long double DataExtractor::GetLongDouble(offset_t *offset_ptr) const { return val; } -//------------------------------------------------------------------ // Extract a single address from the data and update the offset pointed to by // "offset_ptr". The size of the extracted address comes from the // "this->m_addr_size" member variable and should be set correctly prior to // extracting any address values. // // RETURNS the address that was extracted, or zero on failure. -//------------------------------------------------------------------ uint64_t DataExtractor::GetAddress(offset_t *offset_ptr) const { assert(m_addr_size == 4 || m_addr_size == 8); return GetMaxU64(offset_ptr, m_addr_size); @@ -705,14 +669,12 @@ uint64_t DataExtractor::GetAddress_unchecked(offset_t *offset_ptr) const { return GetMaxU64_unchecked(offset_ptr, m_addr_size); } -//------------------------------------------------------------------ // Extract a single pointer from the data and update the offset pointed to by // "offset_ptr". The size of the extracted pointer comes from the // "this->m_addr_size" member variable and should be set correctly prior to // extracting any pointer values. // // RETURNS the pointer that was extracted, or zero on failure. -//------------------------------------------------------------------ uint64_t DataExtractor::GetPointer(offset_t *offset_ptr) const { assert(m_addr_size == 4 || m_addr_size == 8); return GetMaxU64(offset_ptr, m_addr_size); @@ -836,7 +798,6 @@ DataExtractor::CopyByteOrderedData(offset_t src_offset, offset_t src_len, return 0; } -//---------------------------------------------------------------------- // Extracts a variable length NULL terminated C string from the data at the // offset pointed to by "offset_ptr". The "offset_ptr" will be updated with // the offset of the byte that follows the NULL terminator byte. @@ -844,7 +805,6 @@ DataExtractor::CopyByteOrderedData(offset_t src_offset, offset_t src_len, // If the offset pointed to by "offset_ptr" is out of bounds, or if "length" is // non-zero and there aren't enough available bytes, nullptr will be returned // and "offset_ptr" will not be updated. -//---------------------------------------------------------------------- const char *DataExtractor::GetCStr(offset_t *offset_ptr) const { const char *cstr = (const char *)PeekData(*offset_ptr, 1); if (cstr) { @@ -868,7 +828,6 @@ const char *DataExtractor::GetCStr(offset_t *offset_ptr) const { return nullptr; } -//---------------------------------------------------------------------- // Extracts a NULL terminated C string from the fixed length field of length // "len" at the offset pointed to by "offset_ptr". The "offset_ptr" will be // updated with the offset of the byte that follows the fixed length field. @@ -877,7 +836,6 @@ const char *DataExtractor::GetCStr(offset_t *offset_ptr) const { // plus the length of the field is out of bounds, or if the field does not // contain a NULL terminator byte, nullptr will be returned and "offset_ptr" // will not be updated. -//---------------------------------------------------------------------- const char *DataExtractor::GetCStr(offset_t *offset_ptr, offset_t len) const { const char *cstr = (const char *)PeekData(*offset_ptr, len); if (cstr != nullptr) { @@ -890,26 +848,22 @@ const char *DataExtractor::GetCStr(offset_t *offset_ptr, offset_t len) const { return nullptr; } -//------------------------------------------------------------------ // Peeks at a string in the contained data. No verification is done to make // sure the entire string lies within the bounds of this object's data, only // "offset" is verified to be a valid offset. // // Returns a valid C string pointer if "offset" is a valid offset in this // object's data, else nullptr is returned. -//------------------------------------------------------------------ const char *DataExtractor::PeekCStr(offset_t offset) const { return (const char *)PeekData(offset, 1); } -//---------------------------------------------------------------------- // Extracts an unsigned LEB128 number from this object's data starting at the // offset pointed to by "offset_ptr". The offset pointed to by "offset_ptr" // will be updated with the offset of the byte following the last extracted // byte. // // Returned the extracted integer value. -//---------------------------------------------------------------------- uint64_t DataExtractor::GetULEB128(offset_t *offset_ptr) const { const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1); if (src == nullptr) @@ -937,14 +891,12 @@ uint64_t DataExtractor::GetULEB128(offset_t *offset_ptr) const { return 0; } -//---------------------------------------------------------------------- // Extracts an signed LEB128 number from this object's data starting at the // offset pointed to by "offset_ptr". The offset pointed to by "offset_ptr" // will be updated with the offset of the byte following the last extracted // byte. // // Returned the extracted integer value. -//---------------------------------------------------------------------- int64_t DataExtractor::GetSLEB128(offset_t *offset_ptr) const { const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1); if (src == nullptr) @@ -979,14 +931,12 @@ int64_t DataExtractor::GetSLEB128(offset_t *offset_ptr) const { return 0; } -//---------------------------------------------------------------------- // Skips a ULEB128 number (signed or unsigned) from this object's data starting // at the offset pointed to by "offset_ptr". The offset pointed to by // "offset_ptr" will be updated with the offset of the byte following the last // extracted byte. // // Returns the number of bytes consumed during the extraction. -//---------------------------------------------------------------------- uint32_t DataExtractor::Skip_LEB128(offset_t *offset_ptr) const { uint32_t bytes_consumed = 0; const uint8_t *src = (const uint8_t *)PeekData(*offset_ptr, 1); @@ -1004,7 +954,6 @@ uint32_t DataExtractor::Skip_LEB128(offset_t *offset_ptr) const { return bytes_consumed; } -//---------------------------------------------------------------------- // Dumps bytes from this object's data to the stream "s" starting // "start_offset" bytes into this data, and ending with the byte before // "end_offset". "base_addr" will be added to the offset into the dumped data @@ -1014,7 +963,6 @@ uint32_t DataExtractor::Skip_LEB128(offset_t *offset_ptr) const { // printf style formatting string. If "type_format" is nullptr, then an // appropriate format string will be used for the supplied "type". If the // stream "s" is nullptr, then the output will be send to Log(). -//---------------------------------------------------------------------- lldb::offset_t DataExtractor::PutToLog(Log *log, offset_t start_offset, offset_t length, uint64_t base_addr, uint32_t num_per_line, diff --git a/lldb/source/Utility/Event.cpp b/lldb/source/Utility/Event.cpp index 9e293db..811594f 100644 --- a/lldb/source/Utility/Event.cpp +++ b/lldb/source/Utility/Event.cpp @@ -25,9 +25,7 @@ using namespace lldb_private; #pragma mark - #pragma mark Event -//------------------------------------------------------------------ // Event functions -//------------------------------------------------------------------ Event::Event(Broadcaster *broadcaster, uint32_t event_type, EventData *data) : m_broadcaster_wp(broadcaster->GetBroadcasterImpl()), m_type(event_type), @@ -87,9 +85,7 @@ void Event::DoOnRemoval() { #pragma mark - #pragma mark EventData -//------------------------------------------------------------------ // EventData functions -//------------------------------------------------------------------ EventData::EventData() = default; @@ -100,9 +96,7 @@ void EventData::Dump(Stream *s) const { s->PutCString("Generic Event Data"); } #pragma mark - #pragma mark EventDataBytes -//------------------------------------------------------------------ // EventDataBytes functions -//------------------------------------------------------------------ EventDataBytes::EventDataBytes() : m_bytes() {} @@ -193,9 +187,7 @@ void EventDataBytes::SwapBytes(std::string &new_bytes) { #pragma mark - #pragma mark EventStructuredData -//------------------------------------------------------------------ // EventDataStructuredData definitions -//------------------------------------------------------------------ EventDataStructuredData::EventDataStructuredData() : EventData(), m_process_sp(), m_object_sp(), m_plugin_sp() {} @@ -208,9 +200,7 @@ EventDataStructuredData::EventDataStructuredData( EventDataStructuredData::~EventDataStructuredData() {} -//------------------------------------------------------------------ // EventDataStructuredData member functions -//------------------------------------------------------------------ ConstString EventDataStructuredData::GetFlavor() const { return EventDataStructuredData::GetFlavorString(); @@ -251,9 +241,7 @@ void EventDataStructuredData::SetStructuredDataPlugin( m_plugin_sp = plugin_sp; } -//------------------------------------------------------------------ // EventDataStructuredData static functions -//------------------------------------------------------------------ const EventDataStructuredData * EventDataStructuredData::GetEventDataFromEvent(const Event *event_ptr) { diff --git a/lldb/source/Utility/FileSpec.cpp b/lldb/source/Utility/FileSpec.cpp index 72101f9..e679056 100644 --- a/lldb/source/Utility/FileSpec.cpp +++ b/lldb/source/Utility/FileSpec.cpp @@ -67,9 +67,7 @@ void Denormalize(llvm::SmallVectorImpl<char> &path, FileSpec::Style style) { FileSpec::FileSpec() : m_style(GetNativeStyle()) {} -//------------------------------------------------------------------ // Default constructor that can take an optional full path to a file on disk. -//------------------------------------------------------------------ FileSpec::FileSpec(llvm::StringRef path, Style style) : m_style(style) { SetFile(path, style); } @@ -77,28 +75,21 @@ FileSpec::FileSpec(llvm::StringRef path, Style style) : m_style(style) { FileSpec::FileSpec(llvm::StringRef path, const llvm::Triple &Triple) : FileSpec{path, Triple.isOSWindows() ? Style::windows : Style::posix} {} -//------------------------------------------------------------------ // Copy constructor -//------------------------------------------------------------------ FileSpec::FileSpec(const FileSpec &rhs) : m_directory(rhs.m_directory), m_filename(rhs.m_filename), m_is_resolved(rhs.m_is_resolved), m_style(rhs.m_style) {} -//------------------------------------------------------------------ // Copy constructor -//------------------------------------------------------------------ FileSpec::FileSpec(const FileSpec *rhs) : m_directory(), m_filename() { if (rhs) *this = *rhs; } -//------------------------------------------------------------------ // Virtual destructor in case anyone inherits from this class. -//------------------------------------------------------------------ FileSpec::~FileSpec() {} namespace { -//------------------------------------------------------------------ /// Safely get a character at the specified index. /// /// \param[in] path @@ -110,14 +101,12 @@ namespace { /// \return /// The character at index \a i if the index is valid, or 0 if /// the index is not valid. -//------------------------------------------------------------------ inline char safeCharAtIndex(const llvm::StringRef &path, size_t i) { if (i < path.size()) return path[i]; return 0; } -//------------------------------------------------------------------ /// Check if a path needs to be normalized. /// /// Check if a path needs to be normalized. We currently consider a @@ -135,7 +124,6 @@ inline char safeCharAtIndex(const llvm::StringRef &path, size_t i) { /// /// \return /// Returns \b true if the path needs to be normalized. -//------------------------------------------------------------------ bool needsNormalization(const llvm::StringRef &path) { if (path.empty()) return false; @@ -191,9 +179,7 @@ bool needsNormalization(const llvm::StringRef &path) { } -//------------------------------------------------------------------ // Assignment operator. -//------------------------------------------------------------------ const FileSpec &FileSpec::operator=(const FileSpec &rhs) { if (this != &rhs) { m_directory = rhs.m_directory; @@ -206,11 +192,9 @@ const FileSpec &FileSpec::operator=(const FileSpec &rhs) { void FileSpec::SetFile(llvm::StringRef pathname) { SetFile(pathname, m_style); } -//------------------------------------------------------------------ // Update the contents of this object with a new path. The path will be split // up into a directory and filename and stored as uniqued string values for // quick comparison and efficient memory usage. -//------------------------------------------------------------------ void FileSpec::SetFile(llvm::StringRef pathname, Style style) { m_filename.Clear(); m_directory.Clear(); @@ -253,22 +237,18 @@ void FileSpec::SetFile(llvm::StringRef path, const llvm::Triple &Triple) { return SetFile(path, Triple.isOSWindows() ? Style::windows : Style::posix); } -//---------------------------------------------------------------------- // Convert to pointer operator. This allows code to check any FileSpec objects // to see if they contain anything valid using code such as: // // if (file_spec) // {} -//---------------------------------------------------------------------- FileSpec::operator bool() const { return m_filename || m_directory; } -//---------------------------------------------------------------------- // Logical NOT operator. This allows code to check any FileSpec objects to see // if they are invalid using code such as: // // if (!file_spec) // {} -//---------------------------------------------------------------------- bool FileSpec::operator!() const { return !m_directory && !m_filename; } bool FileSpec::DirectoryEquals(const FileSpec &rhs) const { @@ -281,43 +261,32 @@ bool FileSpec::FileEquals(const FileSpec &rhs) const { return ConstString::Equals(m_filename, rhs.m_filename, case_sensitive); } -//------------------------------------------------------------------ // Equal to operator -//------------------------------------------------------------------ bool FileSpec::operator==(const FileSpec &rhs) const { return FileEquals(rhs) && DirectoryEquals(rhs); } -//------------------------------------------------------------------ // Not equal to operator -//------------------------------------------------------------------ bool FileSpec::operator!=(const FileSpec &rhs) const { return !(*this == rhs); } -//------------------------------------------------------------------ // Less than operator -//------------------------------------------------------------------ bool FileSpec::operator<(const FileSpec &rhs) const { return FileSpec::Compare(*this, rhs, true) < 0; } -//------------------------------------------------------------------ // Dump a FileSpec object to a stream -//------------------------------------------------------------------ Stream &lldb_private::operator<<(Stream &s, const FileSpec &f) { f.Dump(&s); return s; } -//------------------------------------------------------------------ // Clear this object by releasing both the directory and filename string values // and making them both the empty string. -//------------------------------------------------------------------ void FileSpec::Clear() { m_directory.Clear(); m_filename.Clear(); } -//------------------------------------------------------------------ // Compare two FileSpec objects. If "full" is true, then both the directory and // the filename must match. If "full" is false, then the directory names for // "a" and "b" are only compared if they are both non-empty. This allows a @@ -326,7 +295,6 @@ void FileSpec::Clear() { // // Return -1 if the "a" is less than "b", 0 if "a" is equal to "b" and "1" if // "a" is greater than "b". -//------------------------------------------------------------------ int FileSpec::Compare(const FileSpec &a, const FileSpec &b, bool full) { int result = 0; @@ -376,11 +344,9 @@ llvm::Optional<FileSpec::Style> FileSpec::GuessPathStyle(llvm::StringRef absolut return llvm::None; } -//------------------------------------------------------------------ // Dump the object to the supplied stream. If the object contains a valid // directory name, it will be displayed followed by a directory delimiter, and // the filename. -//------------------------------------------------------------------ void FileSpec::Dump(Stream *s) const { if (s) { std::string path{GetPath(true)}; @@ -393,30 +359,20 @@ void FileSpec::Dump(Stream *s) const { FileSpec::Style FileSpec::GetPathStyle() const { return m_style; } -//------------------------------------------------------------------ // Directory string get accessor. -//------------------------------------------------------------------ ConstString &FileSpec::GetDirectory() { return m_directory; } -//------------------------------------------------------------------ // Directory string const get accessor. -//------------------------------------------------------------------ ConstString FileSpec::GetDirectory() const { return m_directory; } -//------------------------------------------------------------------ // Filename string get accessor. -//------------------------------------------------------------------ ConstString &FileSpec::GetFilename() { return m_filename; } -//------------------------------------------------------------------ // Filename string const get accessor. -//------------------------------------------------------------------ ConstString FileSpec::GetFilename() const { return m_filename; } -//------------------------------------------------------------------ // Extract the directory and path into a fixed buffer. This is needed as the // directory and path are stored in separate string values. -//------------------------------------------------------------------ size_t FileSpec::GetPath(char *path, size_t path_max_len, bool denormalize) const { if (!path) @@ -462,10 +418,8 @@ ConstString FileSpec::GetFileNameStrippingExtension() const { return ConstString(llvm::sys::path::stem(m_filename.GetStringRef(), m_style)); } -//------------------------------------------------------------------ // Return the size in bytes that this object takes in memory. This returns the // size in bytes of this object, not any shared string values it may refer to. -//------------------------------------------------------------------ size_t FileSpec::MemorySize() const { return m_filename.MemorySize() + m_directory.MemorySize(); } @@ -526,7 +480,6 @@ bool FileSpec::RemoveLastPathComponent() { } return false; } -//------------------------------------------------------------------ /// Returns true if the filespec represents an implementation source /// file (files with a ".c", ".cpp", ".m", ".mm" (many more) /// extension). @@ -534,7 +487,6 @@ bool FileSpec::RemoveLastPathComponent() { /// \return /// \b true if the filespec represents an implementation source /// file, \b false otherwise. -//------------------------------------------------------------------ bool FileSpec::IsSourceImplementationFile() const { ConstString extension(GetFileNameExtension()); if (!extension) diff --git a/lldb/source/Utility/Log.cpp b/lldb/source/Utility/Log.cpp index e7c6a85..217b0d2 100644 --- a/lldb/source/Utility/Log.cpp +++ b/lldb/source/Utility/Log.cpp @@ -109,9 +109,7 @@ const Flags Log::GetMask() const { void Log::PutCString(const char *cstr) { Printf("%s", cstr); } void Log::PutString(llvm::StringRef str) { PutCString(str.str().c_str()); } -//---------------------------------------------------------------------- // Simple variable argument logging with flags. -//---------------------------------------------------------------------- void Log::Printf(const char *format, ...) { va_list args; va_start(args, format); @@ -119,11 +117,9 @@ void Log::Printf(const char *format, ...) { va_end(args); } -//---------------------------------------------------------------------- // All logging eventually boils down to this function call. If we have a // callback registered, then we call the logging callback. If we have a valid // file handle, we also log to the file. -//---------------------------------------------------------------------- void Log::VAPrintf(const char *format, va_list args) { llvm::SmallString<64> FinalMessage; llvm::raw_svector_ostream Stream(FinalMessage); @@ -137,9 +133,7 @@ void Log::VAPrintf(const char *format, va_list args) { WriteMessage(FinalMessage.str()); } -//---------------------------------------------------------------------- // Printing of errors that are not fatal. -//---------------------------------------------------------------------- void Log::Error(const char *format, ...) { va_list args; va_start(args, format); @@ -154,9 +148,7 @@ void Log::VAError(const char *format, va_list args) { Printf("error: %s", Content.c_str()); } -//---------------------------------------------------------------------- // Printing of warnings that are not fatal only if verbose mode is enabled. -//---------------------------------------------------------------------- void Log::Verbose(const char *format, ...) { if (!GetVerbose()) return; @@ -167,9 +159,7 @@ void Log::Verbose(const char *format, ...) { va_end(args); } -//---------------------------------------------------------------------- // Printing of warnings that are not fatal. -//---------------------------------------------------------------------- void Log::Warning(const char *format, ...) { llvm::SmallString<64> Content; va_list args; diff --git a/lldb/source/Utility/RegularExpression.cpp b/lldb/source/Utility/RegularExpression.cpp index bfbd1016..71fe301 100644 --- a/lldb/source/Utility/RegularExpression.cpp +++ b/lldb/source/Utility/RegularExpression.cpp @@ -12,10 +12,8 @@ #include <string> -//---------------------------------------------------------------------- // Enable enhanced mode if it is available. This allows for things like \d for // digit, \s for space, and many more, but it isn't available everywhere. -//---------------------------------------------------------------------- #if defined(REG_ENHANCED) #define DEFAULT_COMPILE_FLAGS (REG_ENHANCED | REG_EXTENDED) #else @@ -28,10 +26,8 @@ RegularExpression::RegularExpression() : m_re(), m_comp_err(1), m_preg() { memset(&m_preg, 0, sizeof(m_preg)); } -//---------------------------------------------------------------------- // Constructor that compiles "re" using "flags" and stores the resulting // compiled regular expression into this object. -//---------------------------------------------------------------------- RegularExpression::RegularExpression(llvm::StringRef str) : m_re(), m_comp_err(1), m_preg() { memset(&m_preg, 0, sizeof(m_preg)); @@ -50,15 +46,12 @@ operator=(const RegularExpression &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor // // Any previously compiled regular expression contained in this object will be // freed. -//---------------------------------------------------------------------- RegularExpression::~RegularExpression() { Free(); } -//---------------------------------------------------------------------- // Compile a regular expression using the supplied regular expression text and // flags. The compiled regular expression lives in this object so that it can // be readily used for regular expression matches. Execute() can be called @@ -68,7 +61,6 @@ RegularExpression::~RegularExpression() { Free(); } // RETURNS // True if the regular expression compiles successfully, false // otherwise. -//---------------------------------------------------------------------- bool RegularExpression::Compile(llvm::StringRef str) { Free(); @@ -79,13 +71,11 @@ bool RegularExpression::Compile(llvm::StringRef str) { return m_comp_err == 0; } -//---------------------------------------------------------------------- // Execute a regular expression match using the compiled regular expression // that is already in this object against the match string "s". If any parens // are used for regular expression matches "match_count" should indicate the // number of regmatch_t values that are present in "match_ptr". The regular // expression will be executed using the "execute_flags". -//--------------------------------------------------------------------- bool RegularExpression::Execute(llvm::StringRef str, Match *match) const { int err = 1; if (m_comp_err == 0) { @@ -154,19 +144,13 @@ bool RegularExpression::Match::GetMatchSpanningIndices( return false; } -//---------------------------------------------------------------------- // Returns true if the regular expression compiled and is ready for execution. -//---------------------------------------------------------------------- bool RegularExpression::IsValid() const { return m_comp_err == 0; } -//---------------------------------------------------------------------- // Returns the text that was used to compile the current regular expression. -//---------------------------------------------------------------------- llvm::StringRef RegularExpression::GetText() const { return m_re; } -//---------------------------------------------------------------------- // Free any contained compiled regular expressions. -//---------------------------------------------------------------------- void RegularExpression::Free() { if (m_comp_err == 0) { m_re.clear(); diff --git a/lldb/source/Utility/Scalar.cpp b/lldb/source/Utility/Scalar.cpp index b56a6d0..2b5753e 100644 --- a/lldb/source/Utility/Scalar.cpp +++ b/lldb/source/Utility/Scalar.cpp @@ -22,10 +22,8 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Promote to max type currently follows the ANSI C rule for type promotion in // expressions. -//---------------------------------------------------------------------- static Scalar::Type PromoteToMaxType( const Scalar &lhs, // The const left hand side object const Scalar &rhs, // The const right hand side object diff --git a/lldb/source/Utility/SelectHelper.cpp b/lldb/source/Utility/SelectHelper.cpp index 3b61fce..5b60dea 100644 --- a/lldb/source/Utility/SelectHelper.cpp +++ b/lldb/source/Utility/SelectHelper.cpp @@ -132,9 +132,7 @@ lldb_private::Status SelectHelper::Select() { fd_set *read_fdset_ptr = nullptr; fd_set *write_fdset_ptr = nullptr; fd_set *error_fdset_ptr = nullptr; -//---------------------------------------------------------------------- // Initialize and zero out the fdsets -//---------------------------------------------------------------------- #if defined(__APPLE__) llvm::SmallVector<fd_set, 1> read_fdset; llvm::SmallVector<fd_set, 1> write_fdset; @@ -176,9 +174,7 @@ lldb_private::Status SelectHelper::Select() { error_fdset_ptr = &error_fdset; } #endif - //---------------------------------------------------------------------- // Set the FD bits in the fdsets for read/write/error - //---------------------------------------------------------------------- for (auto &pair : m_fd_map) { const lldb::socket_t fd = pair.first; @@ -192,17 +188,13 @@ lldb_private::Status SelectHelper::Select() { FD_SET(fd, error_fdset_ptr); } - //---------------------------------------------------------------------- // Setup our timeout time value if needed - //---------------------------------------------------------------------- struct timeval *tv_ptr = nullptr; struct timeval tv = {0, 0}; while (1) { using namespace std::chrono; - //------------------------------------------------------------------ // Setup out relative timeout based on the end time if we have one - //------------------------------------------------------------------ if (m_end_time.hasValue()) { tv_ptr = &tv; const auto remaining_dur = duration_cast<microseconds>( diff --git a/lldb/source/Utility/Status.cpp b/lldb/source/Utility/Status.cpp index ef25387..95e2b14 100644 --- a/lldb/source/Utility/Status.cpp +++ b/lldb/source/Utility/Status.cpp @@ -95,9 +95,7 @@ llvm::Error Status::ToError() const { llvm::inconvertibleErrorCode()); } -//---------------------------------------------------------------------- // Assignment operator -//---------------------------------------------------------------------- const Status &Status::operator=(const Status &rhs) { if (this != &rhs) { m_code = rhs.m_code; @@ -126,11 +124,9 @@ static std::string RetrieveWin32ErrorString(uint32_t error_code) { } #endif -//---------------------------------------------------------------------- // Get the error value as a NULL C string. The error string will be fetched and // cached on demand. The cached error string value will remain until the error // value is changed or cleared. -//---------------------------------------------------------------------- const char *Status::AsCString(const char *default_error_str) const { if (Success()) return nullptr; @@ -167,35 +163,25 @@ const char *Status::AsCString(const char *default_error_str) const { return m_string.c_str(); } -//---------------------------------------------------------------------- // Clear the error and any cached error string that it might contain. -//---------------------------------------------------------------------- void Status::Clear() { m_code = 0; m_type = eErrorTypeInvalid; m_string.clear(); } -//---------------------------------------------------------------------- // Access the error value. -//---------------------------------------------------------------------- Status::ValueType Status::GetError() const { return m_code; } -//---------------------------------------------------------------------- // Access the error type. -//---------------------------------------------------------------------- ErrorType Status::GetType() const { return m_type; } -//---------------------------------------------------------------------- // Returns true if this object contains a value that describes an error or // otherwise non-success result. -//---------------------------------------------------------------------- bool Status::Fail() const { return m_code != 0; } -//---------------------------------------------------------------------- // Set accessor for the error value to "err" and the type to // "eErrorTypeMachKernel" -//---------------------------------------------------------------------- void Status::SetMachError(uint32_t err) { m_code = err; m_type = eErrorTypeMachKernel; @@ -226,40 +212,32 @@ int Status::SetExpressionErrorWithFormat(lldb::ExpressionResults result, return length; } -//---------------------------------------------------------------------- // Set accessor for the error value and type. -//---------------------------------------------------------------------- void Status::SetError(ValueType err, ErrorType type) { m_code = err; m_type = type; m_string.clear(); } -//---------------------------------------------------------------------- // Update the error value to be "errno" and update the type to be "POSIX". -//---------------------------------------------------------------------- void Status::SetErrorToErrno() { m_code = errno; m_type = eErrorTypePOSIX; m_string.clear(); } -//---------------------------------------------------------------------- // Update the error value to be LLDB_GENERIC_ERROR and update the type to be // "Generic". -//---------------------------------------------------------------------- void Status::SetErrorToGenericError() { m_code = LLDB_GENERIC_ERROR; m_type = eErrorTypeGeneric; m_string.clear(); } -//---------------------------------------------------------------------- // Set accessor for the error string value for a specific error. This allows // any string to be supplied as an error explanation. The error string value // will remain until the error value is cleared or a new error value/type is // assigned. -//---------------------------------------------------------------------- void Status::SetErrorString(llvm::StringRef err_str) { if (!err_str.empty()) { // If we have an error string, we should always at least have an error set @@ -270,12 +248,10 @@ void Status::SetErrorString(llvm::StringRef err_str) { m_string = err_str; } -//------------------------------------------------------------------ /// Set the current error string to a formatted error string. /// /// \param format /// A printf style format string -//------------------------------------------------------------------ int Status::SetErrorStringWithFormat(const char *format, ...) { if (format != nullptr && format[0]) { va_list args; @@ -306,10 +282,8 @@ int Status::SetErrorStringWithVarArg(const char *format, va_list args) { return 0; } -//---------------------------------------------------------------------- // Returns true if the error code in this object is considered a successful // return value. -//---------------------------------------------------------------------- bool Status::Success() const { return m_code == 0; } bool Status::WasInterrupted() const { diff --git a/lldb/source/Utility/Stream.cpp b/lldb/source/Utility/Stream.cpp index 69a48d6..a867be9 100644 --- a/lldb/source/Utility/Stream.cpp +++ b/lldb/source/Utility/Stream.cpp @@ -29,9 +29,7 @@ Stream::Stream() : m_flags(0), m_addr_size(4), m_byte_order(endian::InlHostByteOrder()), m_indent_level(0), m_forwarder(*this) {} -//------------------------------------------------------------------ // Destructor -//------------------------------------------------------------------ Stream::~Stream() {} ByteOrder Stream::SetByteOrder(ByteOrder byte_order) { @@ -40,14 +38,10 @@ ByteOrder Stream::SetByteOrder(ByteOrder byte_order) { return old_byte_order; } -//------------------------------------------------------------------ // Put an offset "uval" out to the stream using the printf format in "format". -//------------------------------------------------------------------ void Stream::Offset(uint32_t uval, const char *format) { Printf(format, uval); } -//------------------------------------------------------------------ // Put an SLEB128 "uval" out to the stream using the printf format in "format". -//------------------------------------------------------------------ size_t Stream::PutSLEB128(int64_t sval) { if (m_flags.Test(eBinary)) return llvm::encodeSLEB128(sval, m_forwarder); @@ -55,9 +49,7 @@ size_t Stream::PutSLEB128(int64_t sval) { return Printf("0x%" PRIi64, sval); } -//------------------------------------------------------------------ // Put an ULEB128 "uval" out to the stream using the printf format in "format". -//------------------------------------------------------------------ size_t Stream::PutULEB128(uint64_t uval) { if (m_flags.Test(eBinary)) return llvm::encodeULEB128(uval, m_forwarder); @@ -65,9 +57,7 @@ size_t Stream::PutULEB128(uint64_t uval) { return Printf("0x%" PRIx64, uval); } -//------------------------------------------------------------------ // Print a raw NULL terminated C string to the stream. -//------------------------------------------------------------------ size_t Stream::PutCString(llvm::StringRef str) { size_t bytes_written = 0; bytes_written = Write(str.data(), str.size()); @@ -78,18 +68,14 @@ size_t Stream::PutCString(llvm::StringRef str) { return bytes_written; } -//------------------------------------------------------------------ // Print a double quoted NULL terminated C string to the stream using the // printf format in "format". -//------------------------------------------------------------------ void Stream::QuotedCString(const char *cstr, const char *format) { Printf(format, cstr); } -//------------------------------------------------------------------ // Put an address "addr" out to the stream with optional prefix and suffix // strings. -//------------------------------------------------------------------ void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix, const char *suffix) { if (prefix == nullptr) @@ -101,10 +87,8 @@ void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix, Printf("%s0x%0*" PRIx64 "%s", prefix, addr_size * 2, (uint64_t)addr, suffix); } -//------------------------------------------------------------------ // Put an address range out to the stream with optional prefix and suffix // strings. -//------------------------------------------------------------------ void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix, const char *suffix) { @@ -118,9 +102,7 @@ void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, size_t Stream::PutChar(char ch) { return Write(&ch, 1); } -//------------------------------------------------------------------ // Print some formatted output to the stream. -//------------------------------------------------------------------ size_t Stream::Printf(const char *format, ...) { va_list args; va_start(args, format); @@ -129,9 +111,7 @@ size_t Stream::Printf(const char *format, ...) { return result; } -//------------------------------------------------------------------ // Print some formatted output to the stream. -//------------------------------------------------------------------ size_t Stream::PrintfVarArg(const char *format, va_list args) { llvm::SmallString<1024> buf; VASprintf(buf, format, args); @@ -143,15 +123,11 @@ size_t Stream::PrintfVarArg(const char *format, va_list args) { return Write(buf.c_str(), length); } -//------------------------------------------------------------------ // Print and End of Line character to the stream -//------------------------------------------------------------------ size_t Stream::EOL() { return PutChar('\n'); } -//------------------------------------------------------------------ // Indent the current line using the current indentation level and print an // optional string following the indentation spaces. -//------------------------------------------------------------------ size_t Stream::Indent(const char *s) { return Printf("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : ""); } @@ -161,17 +137,13 @@ size_t Stream::Indent(llvm::StringRef str) { str.str().c_str()); } -//------------------------------------------------------------------ // Stream a character "ch" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(char ch) { PutChar(ch); return *this; } -//------------------------------------------------------------------ // Stream the NULL terminated C string out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(const char *s) { Printf("%s", s); return *this; @@ -182,96 +154,70 @@ Stream &Stream::operator<<(llvm::StringRef str) { return *this; } -//------------------------------------------------------------------ // Stream the pointer value out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(const void *p) { Printf("0x%.*tx", (int)sizeof(const void *) * 2, (ptrdiff_t)p); return *this; } -//------------------------------------------------------------------ // Stream a uint8_t "uval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(uint8_t uval) { PutHex8(uval); return *this; } -//------------------------------------------------------------------ // Stream a uint16_t "uval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(uint16_t uval) { PutHex16(uval, m_byte_order); return *this; } -//------------------------------------------------------------------ // Stream a uint32_t "uval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(uint32_t uval) { PutHex32(uval, m_byte_order); return *this; } -//------------------------------------------------------------------ // Stream a uint64_t "uval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(uint64_t uval) { PutHex64(uval, m_byte_order); return *this; } -//------------------------------------------------------------------ // Stream a int8_t "sval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(int8_t sval) { Printf("%i", (int)sval); return *this; } -//------------------------------------------------------------------ // Stream a int16_t "sval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(int16_t sval) { Printf("%i", (int)sval); return *this; } -//------------------------------------------------------------------ // Stream a int32_t "sval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(int32_t sval) { Printf("%i", (int)sval); return *this; } -//------------------------------------------------------------------ // Stream a int64_t "sval" out to this stream. -//------------------------------------------------------------------ Stream &Stream::operator<<(int64_t sval) { Printf("%" PRIi64, sval); return *this; } -//------------------------------------------------------------------ // Get the current indentation level -//------------------------------------------------------------------ int Stream::GetIndentLevel() const { return m_indent_level; } -//------------------------------------------------------------------ // Set the current indentation level -//------------------------------------------------------------------ void Stream::SetIndentLevel(int indent_level) { m_indent_level = indent_level; } -//------------------------------------------------------------------ // Increment the current indentation level -//------------------------------------------------------------------ void Stream::IndentMore(int amount) { m_indent_level += amount; } -//------------------------------------------------------------------ // Decrement the current indentation level -//------------------------------------------------------------------ void Stream::IndentLess(int amount) { if (m_indent_level >= amount) m_indent_level -= amount; @@ -279,29 +225,19 @@ void Stream::IndentLess(int amount) { m_indent_level = 0; } -//------------------------------------------------------------------ // Get the address size in bytes -//------------------------------------------------------------------ uint32_t Stream::GetAddressByteSize() const { return m_addr_size; } -//------------------------------------------------------------------ // Set the address size in bytes -//------------------------------------------------------------------ void Stream::SetAddressByteSize(uint32_t addr_size) { m_addr_size = addr_size; } -//------------------------------------------------------------------ // The flags get accessor -//------------------------------------------------------------------ Flags &Stream::GetFlags() { return m_flags; } -//------------------------------------------------------------------ // The flags const get accessor -//------------------------------------------------------------------ const Flags &Stream::GetFlags() const { return m_flags; } -//------------------------------------------------------------------ // The byte order get accessor -//------------------------------------------------------------------ lldb::ByteOrder Stream::GetByteOrder() const { return m_byte_order; } diff --git a/lldb/source/Utility/StringExtractor.cpp b/lldb/source/Utility/StringExtractor.cpp index f0f6ad1..e455310 100644 --- a/lldb/source/Utility/StringExtractor.cpp +++ b/lldb/source/Utility/StringExtractor.cpp @@ -24,9 +24,7 @@ static inline int xdigit_to_sint(char ch) { return -1; } -//---------------------------------------------------------------------- // StringExtractor constructor -//---------------------------------------------------------------------- StringExtractor::StringExtractor() : m_packet(), m_index(0) {} StringExtractor::StringExtractor(llvm::StringRef packet_str) @@ -40,15 +38,11 @@ StringExtractor::StringExtractor(const char *packet_cstr) m_packet.assign(packet_cstr); } -//---------------------------------------------------------------------- // StringExtractor copy constructor -//---------------------------------------------------------------------- StringExtractor::StringExtractor(const StringExtractor &rhs) : m_packet(rhs.m_packet), m_index(rhs.m_index) {} -//---------------------------------------------------------------------- // StringExtractor assignment operator -//---------------------------------------------------------------------- const StringExtractor &StringExtractor::operator=(const StringExtractor &rhs) { if (this != &rhs) { m_packet = rhs.m_packet; @@ -57,9 +51,7 @@ const StringExtractor &StringExtractor::operator=(const StringExtractor &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- StringExtractor::~StringExtractor() {} char StringExtractor::GetChar(char fail_value) { @@ -72,13 +64,11 @@ char StringExtractor::GetChar(char fail_value) { return fail_value; } -//---------------------------------------------------------------------- // If a pair of valid hex digits exist at the head of the StringExtractor they // are decoded into an unsigned byte and returned by this function // // If there is not a pair of valid hex digits at the head of the // StringExtractor, it is left unchanged and -1 is returned -//---------------------------------------------------------------------- int StringExtractor::DecodeHexU8() { SkipSpaces(); if (GetBytesLeft() < 2) { @@ -93,10 +83,8 @@ int StringExtractor::DecodeHexU8() { return (uint8_t)((hi_nibble << 4) + lo_nibble); } -//---------------------------------------------------------------------- // Extract an unsigned character from two hex ASCII chars in the packet string, // or return fail_value on failure -//---------------------------------------------------------------------- uint8_t StringExtractor::GetHexU8(uint8_t fail_value, bool set_eof_on_fail) { // On success, fail_value will be overwritten with the next character in the // stream @@ -304,12 +292,10 @@ size_t StringExtractor::GetHexBytes(llvm::MutableArrayRef<uint8_t> dest, return bytes_extracted; } -//---------------------------------------------------------------------- // Decodes all valid hex encoded bytes at the head of the StringExtractor, // limited by dst_len. // // Returns the number of bytes successfully decoded -//---------------------------------------------------------------------- size_t StringExtractor::GetHexBytesAvail(llvm::MutableArrayRef<uint8_t> dest) { size_t bytes_extracted = 0; while (!dest.empty()) { diff --git a/lldb/source/Utility/StructuredData.cpp b/lldb/source/Utility/StructuredData.cpp index b4bfe03..c486913 100644 --- a/lldb/source/Utility/StructuredData.cpp +++ b/lldb/source/Utility/StructuredData.cpp @@ -22,9 +22,7 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // Functions that use a JSONParser to parse JSON into StructuredData -//---------------------------------------------------------------------- static StructuredData::ObjectSP ParseJSONValue(JSONParser &json_parser); static StructuredData::ObjectSP ParseJSONObject(JSONParser &json_parser); static StructuredData::ObjectSP ParseJSONArray(JSONParser &json_parser); diff --git a/lldb/source/Utility/UriParser.cpp b/lldb/source/Utility/UriParser.cpp index 282c3c6..b446958 100644 --- a/lldb/source/Utility/UriParser.cpp +++ b/lldb/source/Utility/UriParser.cpp @@ -15,9 +15,7 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // UriParser::Parse -//---------------------------------------------------------------------- bool UriParser::Parse(llvm::StringRef uri, llvm::StringRef &scheme, llvm::StringRef &hostname, int &port, llvm::StringRef &path) { diff --git a/lldb/tools/darwin-debug/darwin-debug.cpp b/lldb/tools/darwin-debug/darwin-debug.cpp index 3c9d025..ef90e79 100644 --- a/lldb/tools/darwin-debug/darwin-debug.cpp +++ b/lldb/tools/darwin-debug/darwin-debug.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -//---------------------------------------------------------------------- // Darwin launch helper // // This program was written to allow programs to be launched in a new @@ -20,7 +19,6 @@ // // Since it uses darwin specific flags this code should not be compiled // on other systems. -//---------------------------------------------------------------------- #if defined(__APPLE__) #include <crt_externs.h> diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp index 6b57d48..cb02ee0 100644 --- a/lldb/tools/debugserver/source/DNB.cpp +++ b/lldb/tools/debugserver/source/DNB.cpp @@ -62,12 +62,10 @@ static size_t GetAllInfosMatchingName(const char *process_name, std::vector<struct kinfo_proc> &matching_proc_infos); -//---------------------------------------------------------------------- // A Thread safe singleton to get a process map pointer. // // Returns a pointer to the existing process map, or a pointer to a // newly created process map if CAN_CREATE is non-zero. -//---------------------------------------------------------------------- static ProcessMap *GetProcessMap(bool can_create) { static ProcessMap *g_process_map_ptr = NULL; @@ -80,13 +78,11 @@ static ProcessMap *GetProcessMap(bool can_create) { return g_process_map_ptr; } -//---------------------------------------------------------------------- // Add PID to the shared process pointer map. // // Return non-zero value if we succeed in adding the process to the map. // The only time this should fail is if we run out of memory and can't // allocate a ProcessMap. -//---------------------------------------------------------------------- static nub_bool_t AddProcessToMap(nub_process_t pid, MachProcessSP &procSP) { ProcessMap *process_map = GetProcessMap(true); if (process_map) { @@ -96,11 +92,9 @@ static nub_bool_t AddProcessToMap(nub_process_t pid, MachProcessSP &procSP) { return false; } -//---------------------------------------------------------------------- // Remove the shared pointer for PID from the process map. // // Returns the number of items removed from the process map. -//---------------------------------------------------------------------- // static size_t // RemoveProcessFromMap (nub_process_t pid) //{ @@ -112,12 +106,10 @@ static nub_bool_t AddProcessToMap(nub_process_t pid, MachProcessSP &procSP) { // return 0; //} -//---------------------------------------------------------------------- // Get the shared pointer for PID from the existing process map. // // Returns true if we successfully find a shared pointer to a // MachProcess object. -//---------------------------------------------------------------------- static nub_bool_t GetProcessSP(nub_process_t pid, MachProcessSP &procSP) { ProcessMap *process_map = GetProcessMap(false); if (process_map != NULL) { @@ -811,9 +803,7 @@ nub_bool_t DNBProcessIsAlive(nub_process_t pid) { return eStateInvalid; } -//---------------------------------------------------------------------- // Process and Thread state information -//---------------------------------------------------------------------- nub_state_t DNBProcessGetState(nub_process_t pid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) { @@ -822,9 +812,7 @@ nub_state_t DNBProcessGetState(nub_process_t pid) { return eStateInvalid; } -//---------------------------------------------------------------------- // Process and Thread state information -//---------------------------------------------------------------------- nub_bool_t DNBProcessGetExitStatus(nub_process_t pid, int *status) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) { @@ -1031,9 +1019,7 @@ const char *DNBProcessGetArgumentAtIndex(nub_process_t pid, nub_size_t idx) { return NULL; } -//---------------------------------------------------------------------- // Execution control -//---------------------------------------------------------------------- nub_bool_t DNBProcessResume(nub_process_t pid, const DNBThreadResumeAction *actions, size_t num_actions) { @@ -1128,9 +1114,7 @@ nub_bool_t DNBBreakpointClear(nub_process_t pid, nub_addr_t addr) { return false; // Failed } -//---------------------------------------------------------------------- // Watchpoints -//---------------------------------------------------------------------- nub_bool_t DNBWatchpointSet(nub_process_t pid, nub_addr_t addr, nub_size_t size, uint32_t watch_flags, nub_bool_t hardware) { MachProcessSP procSP; @@ -1146,9 +1130,7 @@ nub_bool_t DNBWatchpointClear(nub_process_t pid, nub_addr_t addr) { return false; // Failed } -//---------------------------------------------------------------------- // Return the number of supported hardware watchpoints. -//---------------------------------------------------------------------- uint32_t DNBWatchpointGetNumSupportedHWP(nub_process_t pid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1156,13 +1138,11 @@ uint32_t DNBWatchpointGetNumSupportedHWP(nub_process_t pid) { return 0; } -//---------------------------------------------------------------------- // Read memory in the address space of process PID. This call will take // care of setting and restoring permissions and breaking up the memory // read into multiple chunks as required. // // RETURNS: number of bytes actually read -//---------------------------------------------------------------------- nub_size_t DNBProcessMemoryRead(nub_process_t pid, nub_addr_t addr, nub_size_t size, void *buf) { MachProcessSP procSP; @@ -1246,13 +1226,11 @@ std::string DNBProcessMemoryReadCStringFixed(nub_process_t pid, nub_addr_t addr, return cstr; } -//---------------------------------------------------------------------- // Write memory to the address space of process PID. This call will take // care of setting and restoring permissions and breaking up the memory // write into multiple chunks as required. // // RETURNS: number of bytes actually written -//---------------------------------------------------------------------- nub_size_t DNBProcessMemoryWrite(nub_process_t pid, nub_addr_t addr, nub_size_t size, const void *buf) { MachProcessSP procSP; @@ -1276,7 +1254,6 @@ nub_bool_t DNBProcessMemoryDeallocate(nub_process_t pid, nub_addr_t addr) { return 0; } -//---------------------------------------------------------------------- // Find attributes of the memory region that contains ADDR for process PID, // if possible, and return a string describing those attributes. // @@ -1289,7 +1266,6 @@ nub_bool_t DNBProcessMemoryDeallocate(nub_process_t pid, nub_addr_t addr) { // Returns -1 if this platform cannot look up information about memory regions // or if we do not yet have a valid launched process. // -//---------------------------------------------------------------------- int DNBProcessMemoryRegionInfo(nub_process_t pid, nub_addr_t addr, DNBRegionInfo *region_info) { MachProcessSP procSP; @@ -1321,9 +1297,7 @@ nub_bool_t DNBProcessSetEnableAsyncProfiling(nub_process_t pid, return false; } -//---------------------------------------------------------------------- // Get the number of threads for the specified process. -//---------------------------------------------------------------------- nub_size_t DNBProcessGetNumThreads(nub_process_t pid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1331,9 +1305,7 @@ nub_size_t DNBProcessGetNumThreads(nub_process_t pid) { return 0; } -//---------------------------------------------------------------------- // Get the thread ID of the current thread. -//---------------------------------------------------------------------- nub_thread_t DNBProcessGetCurrentThread(nub_process_t pid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1341,9 +1313,7 @@ nub_thread_t DNBProcessGetCurrentThread(nub_process_t pid) { return 0; } -//---------------------------------------------------------------------- // Get the mach port number of the current thread. -//---------------------------------------------------------------------- nub_thread_t DNBProcessGetCurrentThreadMachPort(nub_process_t pid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1351,9 +1321,7 @@ nub_thread_t DNBProcessGetCurrentThreadMachPort(nub_process_t pid) { return 0; } -//---------------------------------------------------------------------- // Change the current thread. -//---------------------------------------------------------------------- nub_thread_t DNBProcessSetCurrentThread(nub_process_t pid, nub_thread_t tid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1361,10 +1329,8 @@ nub_thread_t DNBProcessSetCurrentThread(nub_process_t pid, nub_thread_t tid) { return INVALID_NUB_THREAD; } -//---------------------------------------------------------------------- // Dump a string describing a thread's stop reason to the specified file // handle -//---------------------------------------------------------------------- nub_bool_t DNBThreadGetStopReason(nub_process_t pid, nub_thread_t tid, struct DNBThreadStopInfo *stop_info) { MachProcessSP procSP; @@ -1373,13 +1339,11 @@ nub_bool_t DNBThreadGetStopReason(nub_process_t pid, nub_thread_t tid, return false; } -//---------------------------------------------------------------------- // Return string description for the specified thread. // // RETURNS: NULL if the thread isn't valid, else a NULL terminated C // string from a static buffer that must be copied prior to subsequent // calls. -//---------------------------------------------------------------------- const char *DNBThreadGetInfo(nub_process_t pid, nub_thread_t tid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1387,9 +1351,7 @@ const char *DNBThreadGetInfo(nub_process_t pid, nub_thread_t tid) { return NULL; } -//---------------------------------------------------------------------- // Get the thread ID given a thread index. -//---------------------------------------------------------------------- nub_thread_t DNBProcessGetThreadAtIndex(nub_process_t pid, size_t thread_idx) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1397,10 +1359,8 @@ nub_thread_t DNBProcessGetThreadAtIndex(nub_process_t pid, size_t thread_idx) { return INVALID_NUB_THREAD; } -//---------------------------------------------------------------------- // Do whatever is needed to sync the thread's register state with it's kernel // values. -//---------------------------------------------------------------------- nub_bool_t DNBProcessSyncThreadState(nub_process_t pid, nub_thread_t tid) { MachProcessSP procSP; if (GetProcessSP(pid, procSP)) @@ -1440,11 +1400,9 @@ const char *DNBGetDeploymentInfo(nub_process_t pid, } -//---------------------------------------------------------------------- // Get the current shared library information for a process. Only return // the shared libraries that have changed since the last shared library // state changed event if only_changed is non-zero. -//---------------------------------------------------------------------- nub_size_t DNBProcessGetSharedLibraryInfo(nub_process_t pid, nub_bool_t only_changed, struct DNBExecutableImageInfo **image_infos) { @@ -1461,16 +1419,12 @@ DNBProcessGetSharedLibraryInfo(nub_process_t pid, nub_bool_t only_changed, uint32_t DNBGetRegisterCPUType() { return DNBArchProtocol::GetRegisterCPUType(); } -//---------------------------------------------------------------------- // Get the register set information for a specific thread. -//---------------------------------------------------------------------- const DNBRegisterSetInfo *DNBGetRegisterSetInfo(nub_size_t *num_reg_sets) { return DNBArchProtocol::GetRegisterSetInfo(num_reg_sets); } -//---------------------------------------------------------------------- // Read a register value by register set and register index. -//---------------------------------------------------------------------- nub_bool_t DNBThreadGetRegisterValueByID(nub_process_t pid, nub_thread_t tid, uint32_t set, uint32_t reg, DNBRegisterValue *value) { @@ -1533,9 +1487,7 @@ nub_bool_t DNBThreadRestoreRegisterState(nub_process_t pid, nub_thread_t tid, return false; } -//---------------------------------------------------------------------- // Read a register value by name. -//---------------------------------------------------------------------- nub_bool_t DNBThreadGetRegisterValueByName(nub_process_t pid, nub_thread_t tid, uint32_t reg_set, const char *reg_name, @@ -1567,9 +1519,7 @@ nub_bool_t DNBThreadGetRegisterValueByName(nub_process_t pid, nub_thread_t tid, return false; } -//---------------------------------------------------------------------- // Read a register set and register number from the register name. -//---------------------------------------------------------------------- nub_bool_t DNBGetRegisterInfoByName(const char *reg_name, DNBRegisterInfo *info) { const struct DNBRegisterSetInfo *set_info; @@ -1604,10 +1554,8 @@ nub_bool_t DNBGetRegisterInfoByName(const char *reg_name, return false; } -//---------------------------------------------------------------------- // Set the name to address callback function that this nub can use // for any name to address lookups that are needed. -//---------------------------------------------------------------------- nub_bool_t DNBProcessSetNameToAddressCallback(nub_process_t pid, DNBCallbackNameToAddress callback, void *baton) { @@ -1619,10 +1567,8 @@ nub_bool_t DNBProcessSetNameToAddressCallback(nub_process_t pid, return false; } -//---------------------------------------------------------------------- // Set the name to address callback function that this nub can use // for any name to address lookups that are needed. -//---------------------------------------------------------------------- nub_bool_t DNBProcessSetSharedLibraryInfoCallback( nub_process_t pid, DNBCallbackCopyExecutableImageInfos callback, void *baton) { diff --git a/lldb/tools/debugserver/source/DNB.h b/lldb/tools/debugserver/source/DNB.h index d32040b4..074d0aa 100644 --- a/lldb/tools/debugserver/source/DNB.h +++ b/lldb/tools/debugserver/source/DNB.h @@ -34,9 +34,7 @@ void DNBTerminate(); nub_bool_t DNBSetArchitecture(const char *arch); -//---------------------------------------------------------------------- // Process control -//---------------------------------------------------------------------- nub_process_t DNBProcessLaunch( const char *path, char const *argv[], const char *envp[], const char *working_directory, // NULL => don't change, non-NULL => set @@ -102,9 +100,7 @@ DNBProcessSetEnableAsyncProfiling(nub_process_t pid, nub_bool_t enable, DNBProfileDataScanType scan_type) DNB_EXPORT; DarwinLogEventVector DNBProcessGetAvailableDarwinLogEvents(nub_process_t pid); -//---------------------------------------------------------------------- // Process status -//---------------------------------------------------------------------- nub_bool_t DNBProcessIsAlive(nub_process_t pid) DNB_EXPORT; nub_state_t DNBProcessGetState(nub_process_t pid) DNB_EXPORT; nub_bool_t DNBProcessGetExitStatus(nub_process_t pid, int *status) DNB_EXPORT; @@ -149,24 +145,18 @@ nub_size_t DNBProcessGetAvailableProfileData(nub_process_t pid, char *buf, nub_size_t DNBProcessGetStopCount(nub_process_t pid) DNB_EXPORT; uint32_t DNBProcessGetCPUType(nub_process_t pid) DNB_EXPORT; -//---------------------------------------------------------------------- // Process executable and arguments -//---------------------------------------------------------------------- const char *DNBProcessGetExecutablePath(nub_process_t pid); const char *DNBProcessGetArgumentAtIndex(nub_process_t pid, nub_size_t idx); nub_size_t DNBProcessGetArgumentCount(nub_process_t pid); -//---------------------------------------------------------------------- // Process events -//---------------------------------------------------------------------- nub_event_t DNBProcessWaitForEvents(nub_process_t pid, nub_event_t event_mask, bool wait_for_set, struct timespec *timeout); void DNBProcessResetEvents(nub_process_t pid, nub_event_t event_mask); -//---------------------------------------------------------------------- // Thread functions -//---------------------------------------------------------------------- const char *DNBThreadGetName(nub_process_t pid, nub_thread_t tid); nub_bool_t DNBThreadGetIdentifierInfo(nub_process_t pid, nub_thread_t tid, @@ -215,16 +205,12 @@ DNBGetLibrariesInfoForAddresses(nub_process_t pid, JSONGenerator::ObjectSP DNBGetSharedCacheInfo(nub_process_t pid); // -//---------------------------------------------------------------------- // Breakpoint functions -//---------------------------------------------------------------------- nub_bool_t DNBBreakpointSet(nub_process_t pid, nub_addr_t addr, nub_size_t size, nub_bool_t hardware); nub_bool_t DNBBreakpointClear(nub_process_t pid, nub_addr_t addr); -//---------------------------------------------------------------------- // Watchpoint functions -//---------------------------------------------------------------------- nub_bool_t DNBWatchpointSet(nub_process_t pid, nub_addr_t addr, nub_size_t size, uint32_t watch_flags, nub_bool_t hardware); nub_bool_t DNBWatchpointClear(nub_process_t pid, nub_addr_t addr); @@ -235,9 +221,7 @@ const DNBRegisterSetInfo *DNBGetRegisterSetInfo(nub_size_t *num_reg_sets); nub_bool_t DNBGetRegisterInfoByName(const char *reg_name, DNBRegisterInfo *info); -//---------------------------------------------------------------------- // Other static nub information calls. -//---------------------------------------------------------------------- const char *DNBStateAsString(nub_state_t state); nub_bool_t DNBResolveExecutablePath(const char *path, char *resolved_path, size_t resolved_path_size); diff --git a/lldb/tools/debugserver/source/DNBDataRef.cpp b/lldb/tools/debugserver/source/DNBDataRef.cpp index 073591c..f19c913 100644 --- a/lldb/tools/debugserver/source/DNBDataRef.cpp +++ b/lldb/tools/debugserver/source/DNBDataRef.cpp @@ -16,33 +16,25 @@ #include <ctype.h> #include <libkern/OSByteOrder.h> -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DNBDataRef::DNBDataRef() : m_start(NULL), m_end(NULL), m_swap(false), m_ptrSize(0), m_addrPCRelative(INVALID_NUB_ADDRESS), m_addrTEXT(INVALID_NUB_ADDRESS), m_addrDATA(INVALID_NUB_ADDRESS) {} -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DNBDataRef::DNBDataRef(const uint8_t *start, size_t size, bool swap) : m_start(start), m_end(start + size), m_swap(swap), m_ptrSize(0), m_addrPCRelative(INVALID_NUB_ADDRESS), m_addrTEXT(INVALID_NUB_ADDRESS), m_addrDATA(INVALID_NUB_ADDRESS) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DNBDataRef::~DNBDataRef() {} -//---------------------------------------------------------------------- // Get8 -//---------------------------------------------------------------------- uint8_t DNBDataRef::Get8(offset_t *offset_ptr) const { uint8_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -52,9 +44,7 @@ uint8_t DNBDataRef::Get8(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Get16 -//---------------------------------------------------------------------- uint16_t DNBDataRef::Get16(offset_t *offset_ptr) const { uint16_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -70,9 +60,7 @@ uint16_t DNBDataRef::Get16(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Get32 -//---------------------------------------------------------------------- uint32_t DNBDataRef::Get32(offset_t *offset_ptr) const { uint32_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -87,9 +75,7 @@ uint32_t DNBDataRef::Get32(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // Get64 -//---------------------------------------------------------------------- uint64_t DNBDataRef::Get64(offset_t *offset_ptr) const { uint64_t val = 0; if (ValidOffsetForDataOfSize(*offset_ptr, sizeof(val))) { @@ -104,12 +90,10 @@ uint64_t DNBDataRef::Get64(offset_t *offset_ptr) const { return val; } -//---------------------------------------------------------------------- // GetMax32 // // Used for calls when the size can vary. Fill in extra cases if they // are ever needed. -//---------------------------------------------------------------------- uint32_t DNBDataRef::GetMax32(offset_t *offset_ptr, uint32_t byte_size) const { switch (byte_size) { case 1: @@ -128,12 +112,10 @@ uint32_t DNBDataRef::GetMax32(offset_t *offset_ptr, uint32_t byte_size) const { return 0; } -//---------------------------------------------------------------------- // GetMax64 // // Used for calls when the size can vary. Fill in extra cases if they // are ever needed. -//---------------------------------------------------------------------- uint64_t DNBDataRef::GetMax64(offset_t *offset_ptr, uint32_t size) const { switch (size) { case 1: @@ -155,20 +137,16 @@ uint64_t DNBDataRef::GetMax64(offset_t *offset_ptr, uint32_t size) const { return 0; } -//---------------------------------------------------------------------- // GetPointer // // Extract a pointer value from the buffer. The pointer size must be // set prior to using this using one of the SetPointerSize functions. -//---------------------------------------------------------------------- uint64_t DNBDataRef::GetPointer(offset_t *offset_ptr) const { // Must set pointer size prior to using this call assert(m_ptrSize != 0); return GetMax64(offset_ptr, m_ptrSize); } -//---------------------------------------------------------------------- // GetCStr -//---------------------------------------------------------------------- const char *DNBDataRef::GetCStr(offset_t *offset_ptr, uint32_t fixed_length) const { const char *s = NULL; @@ -184,9 +162,7 @@ const char *DNBDataRef::GetCStr(offset_t *offset_ptr, return s; } -//---------------------------------------------------------------------- // GetData -//---------------------------------------------------------------------- const uint8_t *DNBDataRef::GetData(offset_t *offset_ptr, uint32_t length) const { const uint8_t *data = NULL; @@ -197,9 +173,7 @@ const uint8_t *DNBDataRef::GetData(offset_t *offset_ptr, return data; } -//---------------------------------------------------------------------- // Get_ULEB128 -//---------------------------------------------------------------------- uint64_t DNBDataRef::Get_ULEB128(offset_t *offset_ptr) const { uint64_t result = 0; if (m_start < m_end) { @@ -222,9 +196,7 @@ uint64_t DNBDataRef::Get_ULEB128(offset_t *offset_ptr) const { return result; } -//---------------------------------------------------------------------- // Get_SLEB128 -//---------------------------------------------------------------------- int64_t DNBDataRef::Get_SLEB128(offset_t *offset_ptr) const { int64_t result = 0; @@ -254,11 +226,9 @@ int64_t DNBDataRef::Get_SLEB128(offset_t *offset_ptr) const { return result; } -//---------------------------------------------------------------------- // Skip_LEB128 // // Skips past ULEB128 and SLEB128 numbers (just updates the offset) -//---------------------------------------------------------------------- void DNBDataRef::Skip_LEB128(offset_t *offset_ptr) const { if (m_start < m_end) { const uint8_t *start = m_start + *offset_ptr; diff --git a/lldb/tools/debugserver/source/DNBDefs.h b/lldb/tools/debugserver/source/DNBDefs.h index 278caad..3ff60d3 100644 --- a/lldb/tools/debugserver/source/DNBDefs.h +++ b/lldb/tools/debugserver/source/DNBDefs.h @@ -19,33 +19,25 @@ #include <sys/syslimits.h> #include <unistd.h> -//---------------------------------------------------------------------- // Define nub_addr_t and the invalid address value from the architecture -//---------------------------------------------------------------------- #if defined(__x86_64__) || defined(__ppc64__) || defined(__arm64__) || \ defined(__aarch64__) -//---------------------------------------------------------------------- // 64 bit address architectures -//---------------------------------------------------------------------- typedef uint64_t nub_addr_t; #define INVALID_NUB_ADDRESS ((nub_addr_t)~0ull) #elif defined(__i386__) || defined(__powerpc__) || defined(__ppc__) || \ defined(__arm__) -//---------------------------------------------------------------------- // 32 bit address architectures -//---------------------------------------------------------------------- typedef uint32_t nub_addr_t; #define INVALID_NUB_ADDRESS ((nub_addr_t)~0ul) #else -//---------------------------------------------------------------------- // Default to 64 bit address for unrecognized architectures. -//---------------------------------------------------------------------- #warning undefined architecture, defaulting to 8 byte addresses typedef uint64_t nub_addr_t; @@ -253,11 +245,9 @@ enum DNBMemoryPermissions { #define DNB_THREAD_STOP_INFO_MAX_DESC_LENGTH 256 #define DNB_THREAD_STOP_INFO_MAX_EXC_DATA 8 -//---------------------------------------------------------------------- // DNBThreadStopInfo // // Describes the reason a thread stopped. -//---------------------------------------------------------------------- struct DNBThreadStopInfo { DNBThreadStopType reason; char description[DNB_THREAD_STOP_INFO_MAX_DESC_LENGTH]; diff --git a/lldb/tools/debugserver/source/DNBLog.cpp b/lldb/tools/debugserver/source/DNBLog.cpp index 3d60b59c..11b2d0a 100644 --- a/lldb/tools/debugserver/source/DNBLog.cpp +++ b/lldb/tools/debugserver/source/DNBLog.cpp @@ -78,10 +78,8 @@ void _DNBLog(uint32_t flags, const char *format, ...) { va_end(args); } -//---------------------------------------------------------------------- // Print debug strings if and only if the global g_debug is set to // a non-zero value. -//---------------------------------------------------------------------- void _DNBLogDebug(const char *format, ...) { if (DNBLogEnabled() && g_debug) { va_list args; @@ -91,10 +89,8 @@ void _DNBLogDebug(const char *format, ...) { } } -//---------------------------------------------------------------------- // Print debug strings if and only if the global g_debug is set to // a non-zero value. -//---------------------------------------------------------------------- void _DNBLogDebugVerbose(const char *format, ...) { if (DNBLogEnabled() && g_debug && g_verbose) { va_list args; @@ -106,10 +102,8 @@ void _DNBLogDebugVerbose(const char *format, ...) { static uint32_t g_message_id = 0; -//---------------------------------------------------------------------- // Prefix the formatted log string with process and thread IDs and // suffix it with a newline. -//---------------------------------------------------------------------- void _DNBLogThreaded(const char *format, ...) { if (DNBLogEnabled()) { // PTHREAD_MUTEX_LOCKER(locker, GetLogThreadedMutex()); @@ -150,10 +144,8 @@ void _DNBLogThreaded(const char *format, ...) { } } -//---------------------------------------------------------------------- // Prefix the formatted log string with process and thread IDs and // suffix it with a newline. -//---------------------------------------------------------------------- void _DNBLogThreadedIf(uint32_t log_bit, const char *format, ...) { if (DNBLogEnabled() && (log_bit & g_log_bits) == log_bit) { // PTHREAD_MUTEX_LOCKER(locker, GetLogThreadedMutex()); @@ -195,9 +187,7 @@ void _DNBLogThreadedIf(uint32_t log_bit, const char *format, ...) { } } -//---------------------------------------------------------------------- // Printing of errors that are not fatal. -//---------------------------------------------------------------------- void _DNBLogError(const char *format, ...) { if (DNBLogEnabled()) { char *arg_msg = NULL; @@ -213,10 +203,8 @@ void _DNBLogError(const char *format, ...) { } } -//---------------------------------------------------------------------- // Printing of errors that ARE fatal. Exit with ERR exit code // immediately. -//---------------------------------------------------------------------- void _DNBLogFatalError(int err, const char *format, ...) { if (DNBLogEnabled()) { char *arg_msg = NULL; @@ -233,10 +221,8 @@ void _DNBLogFatalError(int err, const char *format, ...) { } } -//---------------------------------------------------------------------- // Printing of warnings that are not fatal only if verbose mode is // enabled. -//---------------------------------------------------------------------- void _DNBLogVerbose(const char *format, ...) { if (DNBLogEnabled() && g_verbose) { va_list args; @@ -246,10 +232,8 @@ void _DNBLogVerbose(const char *format, ...) { } } -//---------------------------------------------------------------------- // Printing of warnings that are not fatal only if verbose mode is // enabled. -//---------------------------------------------------------------------- void _DNBLogWarningVerbose(const char *format, ...) { if (DNBLogEnabled() && g_verbose) { char *arg_msg = NULL; @@ -265,9 +249,7 @@ void _DNBLogWarningVerbose(const char *format, ...) { } } } -//---------------------------------------------------------------------- // Printing of warnings that are not fatal. -//---------------------------------------------------------------------- void _DNBLogWarning(const char *format, ...) { if (DNBLogEnabled()) { char *arg_msg = NULL; diff --git a/lldb/tools/debugserver/source/DNBTimer.h b/lldb/tools/debugserver/source/DNBTimer.h index 9792c9b..21ee235 100644 --- a/lldb/tools/debugserver/source/DNBTimer.h +++ b/lldb/tools/debugserver/source/DNBTimer.h @@ -21,9 +21,7 @@ class DNBTimer { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ DNBTimer(bool threadSafe) : m_mutexAP() { if (threadSafe) m_mutexAP.reset(new PThreadMutex(PTHREAD_MUTEX_RECURSIVE)); @@ -50,16 +48,12 @@ public: ~DNBTimer() {} bool IsThreadSafe() const { return m_mutexAP.get() != NULL; } - //------------------------------------------------------------------ // Reset the time value to now - //------------------------------------------------------------------ void Reset() { PTHREAD_MUTEX_LOCKER(locker, m_mutexAP.get()); gettimeofday(&m_timeval, NULL); } - //------------------------------------------------------------------ // Get the total mircoseconds since Jan 1, 1970 - //------------------------------------------------------------------ uint64_t TotalMicroSeconds() const { PTHREAD_MUTEX_LOCKER(locker, m_mutexAP.get()); return (uint64_t)(m_timeval.tv_sec) * 1000000ull + @@ -71,10 +65,8 @@ public: sec = m_timeval.tv_sec; usec = m_timeval.tv_usec; } - //------------------------------------------------------------------ // Return the number of microseconds elapsed between now and the // m_timeval - //------------------------------------------------------------------ uint64_t ElapsedMicroSeconds(bool update) { PTHREAD_MUTEX_LOCKER(locker, m_mutexAP.get()); struct timeval now; @@ -134,9 +126,7 @@ public: } protected: - //------------------------------------------------------------------ // Classes that inherit from DNBTimer can see and modify these - //------------------------------------------------------------------ std::unique_ptr<PThreadMutex> m_mutexAP; struct timeval m_timeval; }; diff --git a/lldb/tools/debugserver/source/JSON.h b/lldb/tools/debugserver/source/JSON.h index e7ffcfb..b1c4a4c 100644 --- a/lldb/tools/debugserver/source/JSON.h +++ b/lldb/tools/debugserver/source/JSON.h @@ -203,7 +203,6 @@ public: JSONValue::SP GetObject(const std::string &key) const; - // ------------------------------------------------------------------------- /// Return keyed value as bool /// /// \param[in] key @@ -217,7 +216,6 @@ public: /// true if the key existed as was a bool value; false otherwise. /// Note the return value is *not* the value of the bool, use /// \b value for that. - // ------------------------------------------------------------------------- bool GetObjectAsBool(const std::string &key, bool &value) const; bool GetObjectAsString(const std::string &key, std::string &value) const; diff --git a/lldb/tools/debugserver/source/JSONGenerator.h b/lldb/tools/debugserver/source/JSONGenerator.h index efd8a6c..70708f9 100644 --- a/lldb/tools/debugserver/source/JSONGenerator.h +++ b/lldb/tools/debugserver/source/JSONGenerator.h @@ -16,7 +16,6 @@ #include <utility> #include <vector> -//---------------------------------------------------------------------- /// \class JSONGenerator JSONGenerator.h /// A class which can construct structured data for the sole purpose /// of printing it in JSON format. @@ -24,7 +23,6 @@ /// A stripped down version of lldb's StructuredData objects which are much /// general purpose. This variant is intended only for assembling information /// and printing it as a JSON string. -//---------------------------------------------------------------------- class JSONGenerator { public: diff --git a/lldb/tools/debugserver/source/MacOSX/CFBundle.cpp b/lldb/tools/debugserver/source/MacOSX/CFBundle.cpp index 6825fb3..6971c1f 100644 --- a/lldb/tools/debugserver/source/MacOSX/CFBundle.cpp +++ b/lldb/tools/debugserver/source/MacOSX/CFBundle.cpp @@ -13,38 +13,28 @@ #include "CFBundle.h" #include "CFString.h" -//---------------------------------------------------------------------- // CFBundle constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const char *path) : CFReleaser<CFBundleRef>(), m_bundle_url() { if (path && path[0]) SetPath(path); } -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const CFBundle &rhs) : CFReleaser<CFBundleRef>(rhs), m_bundle_url(rhs.m_bundle_url) {} -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle &CFBundle::operator=(const CFBundle &rhs) { if (this != &rhs) *this = rhs; return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFBundle::~CFBundle() {} -//---------------------------------------------------------------------- // Set the path for a bundle by supplying a -//---------------------------------------------------------------------- bool CFBundle::SetPath(const char *path) { CFAllocatorRef alloc = kCFAllocatorDefault; // Release our old bundle and ULR diff --git a/lldb/tools/debugserver/source/MacOSX/CFBundle.h b/lldb/tools/debugserver/source/MacOSX/CFBundle.h index c56edee..f49dc30 100644 --- a/lldb/tools/debugserver/source/MacOSX/CFBundle.h +++ b/lldb/tools/debugserver/source/MacOSX/CFBundle.h @@ -17,9 +17,7 @@ class CFBundle : public CFReleaser<CFBundleRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFBundle(const char *path = NULL); CFBundle(const CFBundle &rhs); CFBundle &operator=(const CFBundle &rhs); diff --git a/lldb/tools/debugserver/source/MacOSX/CFString.cpp b/lldb/tools/debugserver/source/MacOSX/CFString.cpp index 3061c42..637ba65 100644 --- a/lldb/tools/debugserver/source/MacOSX/CFString.cpp +++ b/lldb/tools/debugserver/source/MacOSX/CFString.cpp @@ -14,19 +14,13 @@ #include <glob.h> #include <string> -//---------------------------------------------------------------------- // CFString constructor -//---------------------------------------------------------------------- CFString::CFString(CFStringRef s) : CFReleaser<CFStringRef>(s) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString::CFString(const CFString &rhs) : CFReleaser<CFStringRef>(rhs) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString &CFString::operator=(const CFString &rhs) { if (this != &rhs) *this = rhs; @@ -41,9 +35,7 @@ CFString::CFString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFString::~CFString() {} const char *CFString::GetFileSystemRepresentation(std::string &s) { diff --git a/lldb/tools/debugserver/source/MacOSX/CFString.h b/lldb/tools/debugserver/source/MacOSX/CFString.h index 47db507..d1bd568 100644 --- a/lldb/tools/debugserver/source/MacOSX/CFString.h +++ b/lldb/tools/debugserver/source/MacOSX/CFString.h @@ -18,9 +18,7 @@ class CFString : public CFReleaser<CFStringRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFString(CFStringRef cf_str = NULL); CFString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); CFString(const CFString &rhs); diff --git a/lldb/tools/debugserver/source/MacOSX/CFUtils.h b/lldb/tools/debugserver/source/MacOSX/CFUtils.h index 9dae406..b567524 100644 --- a/lldb/tools/debugserver/source/MacOSX/CFUtils.h +++ b/lldb/tools/debugserver/source/MacOSX/CFUtils.h @@ -17,11 +17,9 @@ #ifdef __cplusplus -//---------------------------------------------------------------------- // Templatized CF helper class that can own any CF pointer and will // call CFRelease() on any valid pointer it owns unless that pointer is // explicitly released using the release() member function. -//---------------------------------------------------------------------- template <class T> class CFReleaser { public: // Type names for the avlue diff --git a/lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.h b/lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.h index 334953d..24ab423 100644 --- a/lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.h +++ b/lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.h @@ -29,21 +29,17 @@ class DarwinLogCollector : public std::enable_shared_from_this<DarwinLogCollector>, public ActivityStore { public: - //------------------------------------------------------------------ /// Return whether the os_log and activity tracing SPI is available. /// /// \return \b true if the activity stream support is available, /// \b false otherwise. - //------------------------------------------------------------------ static bool IsSupported(); - //------------------------------------------------------------------ /// Return a log function suitable for DNBLog to use as the internal /// logging function. /// /// \return a DNBLog-style logging function if IsSupported() returns /// true; otherwise, returns nullptr. - //------------------------------------------------------------------ static DNBCallbackLog GetLogFunction(); static bool StartCollectingForProcess(nub_process_t pid, @@ -57,9 +53,7 @@ public: pid_t GetProcessID() const { return m_pid; } - //------------------------------------------------------------------ // ActivityStore API - //------------------------------------------------------------------ const char *GetActivityForID(os_activity_id_t activity_id) const override; std::string diff --git a/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.cpp b/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.cpp index 9a09e55..489c056 100644 --- a/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.cpp +++ b/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.cpp @@ -11,11 +11,9 @@ #include "DNBLog.h" #include "LogMessage.h" -//---------------------------------------------------------------------- // Enable enhanced mode if it is available. This allows for things like // \d for digit, \s for space, and many more, but it isn't available // everywhere. -//---------------------------------------------------------------------- #if defined(REG_ENHANCED) #define DEFAULT_COMPILE_FLAGS (REG_ENHANCED | REG_EXTENDED) #else diff --git a/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.h b/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.h index 5f50e39..39b6adc 100644 --- a/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.h +++ b/lldb/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.h @@ -16,13 +16,11 @@ using ActivityStreamEntry = struct os_activity_stream_entry_s; -// ----------------------------------------------------------------------------- /// Provides a unified wrapper around os_log()-style log messages. /// /// The lifetime of this class is intended to be very short. The caller /// must ensure that the passed in ActivityStore and ActivityStreamEntry /// outlive this LogMessageOsLog entry. -// ----------------------------------------------------------------------------- class LogMessageOsLog : public LogMessage { public: diff --git a/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp b/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp index 803eb91..4b664be 100644 --- a/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp +++ b/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp @@ -16,9 +16,7 @@ #include "GenealogySPI.h" #include "MachThreadList.h" -//--------------------------- /// Constructor -//--------------------------- Genealogy::Genealogy() : m_os_activity_diagnostic_for_pid(nullptr), diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.h b/lldb/tools/debugserver/source/MacOSX/MachProcess.h index 644364b..0b8e1f4 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.h +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.h @@ -40,9 +40,7 @@ class DNBThreadResumeActions; class MachProcess { public: - //---------------------------------------------------------------------- // Constructors and Destructors - //---------------------------------------------------------------------- MachProcess(); ~MachProcess(); @@ -79,9 +77,7 @@ public: : filename(), load_address(INVALID_NUB_ADDRESS), mod_date(0) {} }; - //---------------------------------------------------------------------- // Child process control - //---------------------------------------------------------------------- pid_t AttachForDebug(pid_t pid, char *err_str, size_t err_len); pid_t LaunchForDebug(const char *path, char const *argv[], char const *envp[], const char *working_directory, const char *stdin_path, @@ -160,9 +156,7 @@ public: nub_size_t ReadMemory(nub_addr_t addr, nub_size_t size, void *buf); nub_size_t WriteMemory(nub_addr_t addr, nub_size_t size, const void *buf); - //---------------------------------------------------------------------- // Path and arg accessors - //---------------------------------------------------------------------- const char *Path() const { return m_path.c_str(); } size_t ArgumentCount() const { return m_args.size(); } const char *ArgumentAtIndex(size_t arg_idx) const { @@ -171,9 +165,7 @@ public: return NULL; } - //---------------------------------------------------------------------- // Breakpoint functions - //---------------------------------------------------------------------- DNBBreakpoint *CreateBreakpoint(nub_addr_t addr, nub_size_t length, bool hardware); bool DisableBreakpoint(nub_addr_t addr, bool remove); @@ -182,9 +174,7 @@ public: DNBBreakpointList &Breakpoints() { return m_breakpoints; } const DNBBreakpointList &Breakpoints() const { return m_breakpoints; } - //---------------------------------------------------------------------- // Watchpoint functions - //---------------------------------------------------------------------- DNBBreakpoint *CreateWatchpoint(nub_addr_t addr, nub_size_t length, uint32_t watch_type, bool hardware); bool DisableWatchpoint(nub_addr_t addr, bool remove); @@ -194,9 +184,7 @@ public: DNBBreakpointList &Watchpoints() { return m_watchpoints; } const DNBBreakpointList &Watchpoints() const { return m_watchpoints; } - //---------------------------------------------------------------------- // Exception thread functions - //---------------------------------------------------------------------- bool StartSTDIOThread(); static void *STDIOThread(void *arg); void ExceptionMessageReceived(const MachException::Message &exceptionMessage); @@ -205,9 +193,7 @@ public: nub_size_t CopyImageInfos(struct DNBExecutableImageInfo **image_infos, bool only_changed); - //---------------------------------------------------------------------- // Profile functions - //---------------------------------------------------------------------- void SetEnableAsyncProfiling(bool enable, uint64_t internal_usec, DNBProfileDataScanType scan_type); bool IsProfilingEnabled() { return m_profile_enabled; } @@ -217,9 +203,7 @@ public: void SignalAsyncProfileData(const char *info); size_t GetAsyncProfileData(char *buf, size_t buf_size); - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- pid_t ProcessID() const { return m_pid; } bool ProcessIDIsValid() const { return m_pid > 0; } pid_t SetProcessID(pid_t pid); diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.h b/lldb/tools/debugserver/source/MacOSX/MachTask.h index ad25f0e..a933bff 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachTask.h +++ b/lldb/tools/debugserver/source/MacOSX/MachTask.h @@ -5,7 +5,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -//---------------------------------------------------------------------- // // MachTask.h // debugserver @@ -45,9 +44,7 @@ struct MachMallocEvent { class MachTask { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ MachTask(MachProcess *process); virtual ~MachTask(); diff --git a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp index be59fb6..8d2165b 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp @@ -451,7 +451,6 @@ uint32_t MachThreadList::ProcessDidStop(MachProcess *process) { return num_threads; } -//---------------------------------------------------------------------- // Check each thread in our thread list to see if we should notify our // client of the current halt in execution. // @@ -461,7 +460,6 @@ uint32_t MachThreadList::ProcessDidStop(MachProcess *process) { // RETURNS // true if we should stop and notify our clients // false if we should resume our child process and skip notification -//---------------------------------------------------------------------- bool MachThreadList::ShouldStop(bool &step_more) { PTHREAD_MUTEX_LOCKER(locker, m_threads_mutex); uint32_t should_stop = false; diff --git a/lldb/tools/debugserver/source/MacOSX/OsLogger.cpp b/lldb/tools/debugserver/source/MacOSX/OsLogger.cpp index 5e13819..a83afb6 100644 --- a/lldb/tools/debugserver/source/MacOSX/OsLogger.cpp +++ b/lldb/tools/debugserver/source/MacOSX/OsLogger.cpp @@ -19,10 +19,8 @@ #define LLDB_OS_LOG_MAX_BUFFER_LENGTH 256 namespace { -//---------------------------------------------------------------------- // Darwin os_log logging callback that can be registered with // DNBLogSetLogCallback -//---------------------------------------------------------------------- void DarwinLogCallback(void *baton, uint32_t flags, const char *format, va_list args) { if (format == nullptr) diff --git a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp index 0d2455e..45d05d6 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp +++ b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp @@ -1423,9 +1423,7 @@ nub_addr_t DNBArchMachARM::GetWatchAddress(const DBG &debug_state, return bits(debug_state.__wvr[hw_index], 31, 0); } -//---------------------------------------------------------------------- // Register information definitions for 32 bit ARMV7. -//---------------------------------------------------------------------- enum gpr_regnums { gpr_r0 = 0, gpr_r1, @@ -1776,11 +1774,9 @@ const size_t DNBArchMachARM::k_num_exc_registers = const size_t DNBArchMachARM::k_num_all_registers = k_num_gpr_registers + k_num_vfp_registers + k_num_exc_registers; -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index // of zero is for all registers, followed by other registers sets. The // register information for the all register set need not be filled in. -//---------------------------------------------------------------------- const DNBRegisterSetInfo DNBArchMachARM::g_reg_sets[] = { {"ARM Registers", NULL, k_num_all_registers}, {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers}, diff --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp index 8fedb98..911cbe6 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp +++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp @@ -947,9 +947,7 @@ nub_addr_t DNBArchMachARM64::GetWatchAddress(const DBG &debug_state, return bits(debug_state.__wvr[hw_index], 63, 0); } -//---------------------------------------------------------------------- // Register information definitions for 64 bit ARMv8. -//---------------------------------------------------------------------- enum gpr_regnums { gpr_x0 = 0, gpr_x1, @@ -1689,11 +1687,9 @@ const size_t DNBArchMachARM64::k_num_exc_registers = const size_t DNBArchMachARM64::k_num_all_registers = k_num_gpr_registers + k_num_vfp_registers + k_num_exc_registers; -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index // of zero is for all registers, followed by other registers sets. The // register information for the all register set need not be filled in. -//---------------------------------------------------------------------- const DNBRegisterSetInfo DNBArchMachARM64::g_reg_sets[] = { {"ARM64 Registers", NULL, k_num_all_registers}, {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers}, diff --git a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp index 1854a9c..7d2d0c2 100644 --- a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp +++ b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp @@ -1025,9 +1025,7 @@ kern_return_t DNBArchImplI386::EnableHardwareSingleStep(bool enable) { return m_state.GetError(e_regSetGPR, Read); } -//---------------------------------------------------------------------- // Register information definitions -//---------------------------------------------------------------------- #define DEFINE_GPR_PSEUDO_16(reg16, reg32) \ { \ @@ -1540,11 +1538,9 @@ const size_t DNBArchImplI386::k_num_all_registers_avx = const size_t DNBArchImplI386::k_num_all_registers_avx512f = k_num_gpr_registers + k_num_fpu_registers_avx512f + k_num_exc_registers; -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index // of zero is for all registers, followed by other registers sets. The // register information for the all register set need not be filled in. -//---------------------------------------------------------------------- const DNBRegisterSetInfo DNBArchImplI386::g_reg_sets_no_avx[] = { {"i386 Registers", NULL, k_num_all_registers_no_avx}, {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers}, diff --git a/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp b/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp index 141b6b7..c6671b5 100644 --- a/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp +++ b/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp @@ -178,9 +178,7 @@ kern_return_t DNBArchMachPPC::EnableHardwareSingleStep(bool enable) { return m_state.GetError(e_regSetGPR, Read); } -//---------------------------------------------------------------------- // Register information definitions for 32 bit PowerPC. -//---------------------------------------------------------------------- enum gpr_regnums { e_regNumGPR_srr0, @@ -319,11 +317,9 @@ const size_t k_num_vec_registers = const size_t k_num_ppc_registers = k_num_gpr_registers + k_num_fpr_registers + k_num_exc_registers + k_num_vec_registers; -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index // of zero is for all registers, followed by other registers sets. The // register information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const DNBRegisterSetInfo g_reg_sets[] = { {"PowerPC Registers", NULL, k_num_ppc_registers}, {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers}, diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp index 4f32d44..319215e 100644 --- a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp +++ b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp @@ -980,9 +980,7 @@ kern_return_t DNBArchImplX86_64::EnableHardwareSingleStep(bool enable) { return m_state.GetError(e_regSetGPR, Read); } -//---------------------------------------------------------------------- // Register information definitions -//---------------------------------------------------------------------- enum { gpr_rax = 0, @@ -2062,11 +2060,9 @@ const size_t DNBArchImplX86_64::k_num_fpu_registers_avx512f = const size_t DNBArchImplX86_64::k_num_all_registers_avx512f = k_num_gpr_registers + k_num_fpu_registers_avx512f + k_num_exc_registers; -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index // of zero is for all registers, followed by other registers sets. The // register information for the all register set need not be filled in. -//---------------------------------------------------------------------- const DNBRegisterSetInfo DNBArchImplX86_64::g_reg_sets_no_avx[] = { {"x86_64 Registers", NULL, k_num_all_registers_no_avx}, {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers}, diff --git a/lldb/tools/debugserver/source/PThreadEvent.cpp b/lldb/tools/debugserver/source/PThreadEvent.cpp index 9a70b25..82d1d22 100644 --- a/lldb/tools/debugserver/source/PThreadEvent.cpp +++ b/lldb/tools/debugserver/source/PThreadEvent.cpp @@ -105,10 +105,8 @@ void PThreadEvent::ResetEvents(const uint32_t mask) { } } -//---------------------------------------------------------------------- // Wait until 'timeout_abstime' for any events that are set in // 'mask'. If 'timeout_abstime' is NULL, then wait forever. -//---------------------------------------------------------------------- uint32_t PThreadEvent::WaitForSetEvents(const uint32_t mask, const struct timespec *timeout_abstime) const { @@ -149,10 +147,8 @@ PThreadEvent::WaitForSetEvents(const uint32_t mask, return 0; } -//---------------------------------------------------------------------- // Wait until 'timeout_abstime' for any events in 'mask' to reset. // If 'timeout_abstime' is NULL, then wait forever. -//---------------------------------------------------------------------- uint32_t PThreadEvent::WaitForEventsToReset( const uint32_t mask, const struct timespec *timeout_abstime) const { // DNBLogThreadedIf(LOG_EVENTS, "%p PThreadEvent::%s (0x%8.8x, %p)", this, diff --git a/lldb/tools/debugserver/source/PThreadEvent.h b/lldb/tools/debugserver/source/PThreadEvent.h index 00c8316..5689cbf 100644 --- a/lldb/tools/debugserver/source/PThreadEvent.h +++ b/lldb/tools/debugserver/source/PThreadEvent.h @@ -44,10 +44,8 @@ public: const struct timespec *timeout_abstime = NULL) const; protected: - //---------------------------------------------------------------------- // pthread condition and mutex variable to control access and allow // blocking between the main thread and the spotlight index thread. - //---------------------------------------------------------------------- mutable PThreadMutex m_mutex; mutable PThreadCondition m_set_condition; mutable PThreadCondition m_reset_condition; diff --git a/lldb/tools/debugserver/source/PseudoTerminal.cpp b/lldb/tools/debugserver/source/PseudoTerminal.cpp index 0a75bc9..cac8bda 100644 --- a/lldb/tools/debugserver/source/PseudoTerminal.cpp +++ b/lldb/tools/debugserver/source/PseudoTerminal.cpp @@ -15,27 +15,21 @@ #include <sys/ioctl.h> #include <unistd.h> -//---------------------------------------------------------------------- // PseudoTerminal constructor -//---------------------------------------------------------------------- PseudoTerminal::PseudoTerminal() : m_master_fd(invalid_fd), m_slave_fd(invalid_fd) {} -//---------------------------------------------------------------------- // Destructor // The master and slave file descriptors will get closed if they are // valid. Call the ReleaseMasterFD()/ReleaseSlaveFD() member functions // to release any file descriptors that are needed beyond the lifespan // of this object. -//---------------------------------------------------------------------- PseudoTerminal::~PseudoTerminal() { CloseMaster(); CloseSlave(); } -//---------------------------------------------------------------------- // Close the master file descriptor if it is valid. -//---------------------------------------------------------------------- void PseudoTerminal::CloseMaster() { if (m_master_fd > 0) { ::close(m_master_fd); @@ -43,9 +37,7 @@ void PseudoTerminal::CloseMaster() { } } -//---------------------------------------------------------------------- // Close the slave file descriptor if it is valid. -//---------------------------------------------------------------------- void PseudoTerminal::CloseSlave() { if (m_slave_fd > 0) { ::close(m_slave_fd); @@ -53,7 +45,6 @@ void PseudoTerminal::CloseSlave() { } } -//---------------------------------------------------------------------- // Open the first available pseudo terminal with OFLAG as the // permissions. The file descriptor is store in the m_master_fd member // variable and can be accessed via the MasterFD() or ReleaseMasterFD() @@ -63,7 +54,6 @@ void PseudoTerminal::CloseSlave() { // // RETURNS: // Zero when successful, non-zero indicating an error occurred. -//---------------------------------------------------------------------- PseudoTerminal::Status PseudoTerminal::OpenFirstAvailableMaster(int oflag) { // Open the master side of a pseudo terminal m_master_fd = ::posix_openpt(oflag); @@ -86,7 +76,6 @@ PseudoTerminal::Status PseudoTerminal::OpenFirstAvailableMaster(int oflag) { return success; } -//---------------------------------------------------------------------- // Open the slave pseudo terminal for the current master pseudo // terminal. A master pseudo terminal should already be valid prior to // calling this function (see PseudoTerminal::OpenFirstAvailableMaster()). @@ -95,7 +84,6 @@ PseudoTerminal::Status PseudoTerminal::OpenFirstAvailableMaster(int oflag) { // // RETURNS: // Zero when successful, non-zero indicating an error occurred. -//---------------------------------------------------------------------- PseudoTerminal::Status PseudoTerminal::OpenSlave(int oflag) { CloseSlave(); @@ -113,7 +101,6 @@ PseudoTerminal::Status PseudoTerminal::OpenSlave(int oflag) { return success; } -//---------------------------------------------------------------------- // Get the name of the slave pseudo terminal. A master pseudo terminal // should already be valid prior to calling this function (see // PseudoTerminal::OpenFirstAvailableMaster()). @@ -123,14 +110,12 @@ PseudoTerminal::Status PseudoTerminal::OpenSlave(int oflag) { // The name of the slave pseudo terminal as a NULL terminated C string // that comes from static memory, so a copy of the string should be // made as subsequent calls can change this value. -//---------------------------------------------------------------------- const char *PseudoTerminal::SlaveName() const { if (m_master_fd < 0) return NULL; return ::ptsname(m_master_fd); } -//---------------------------------------------------------------------- // Fork a child process that and have its stdio routed to a pseudo // terminal. // @@ -150,7 +135,6 @@ const char *PseudoTerminal::SlaveName() const { // RETURNS: // in the parent process: the pid of the child, or -1 if fork fails // in the child process: zero -//---------------------------------------------------------------------- pid_t PseudoTerminal::Fork(PseudoTerminal::Status &error) { pid_t pid = invalid_pid; diff --git a/lldb/tools/debugserver/source/PseudoTerminal.h b/lldb/tools/debugserver/source/PseudoTerminal.h index c14042a..e4093bd 100644 --- a/lldb/tools/debugserver/source/PseudoTerminal.h +++ b/lldb/tools/debugserver/source/PseudoTerminal.h @@ -35,9 +35,7 @@ public: err_dup2_failed_on_stdout = -11, err_dup2_failed_on_stderr = -12 }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ PseudoTerminal(); ~PseudoTerminal(); @@ -69,16 +67,12 @@ public: pid_t Fork(Status &error); protected: - //------------------------------------------------------------------ // Classes that inherit from PseudoTerminal can see and modify these - //------------------------------------------------------------------ int m_master_fd; int m_slave_fd; private: - //------------------------------------------------------------------ // Outlaw copy and assignment constructors - //------------------------------------------------------------------ PseudoTerminal(const PseudoTerminal &rhs); PseudoTerminal &operator=(const PseudoTerminal &rhs); }; diff --git a/lldb/tools/debugserver/source/RNBContext.cpp b/lldb/tools/debugserver/source/RNBContext.cpp index 87f24cc..3f1a37a 100644 --- a/lldb/tools/debugserver/source/RNBContext.cpp +++ b/lldb/tools/debugserver/source/RNBContext.cpp @@ -25,14 +25,10 @@ #include "DNBLog.h" #include "RNBRemote.h" -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RNBContext::~RNBContext() { SetProcessID(INVALID_NUB_PROCESS); } -//---------------------------------------------------------------------- // RNBContext constructor -//---------------------------------------------------------------------- const char *RNBContext::EnvironmentAtIndex(size_t index) { if (index < m_env_vec.size()) @@ -134,10 +130,8 @@ void RNBContext::StopProcessStatusThread() { } } -//---------------------------------------------------------------------- // This thread's sole purpose is to watch for any status changes in the // child process. -//---------------------------------------------------------------------- void *RNBContext::ThreadFunctionProcessStatus(void *arg) { RNBRemoteSP remoteSP(g_remoteSP); RNBRemote *remote = remoteSP.get(); diff --git a/lldb/tools/debugserver/source/RNBContext.h b/lldb/tools/debugserver/source/RNBContext.h index c2a0d33..9159057 100644 --- a/lldb/tools/debugserver/source/RNBContext.h +++ b/lldb/tools/debugserver/source/RNBContext.h @@ -42,9 +42,7 @@ public: all_event_bits = sticky_event_bits | normal_event_bits } event_t; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RNBContext() : m_pid(INVALID_NUB_PROCESS), m_pid_stop_count(0), m_events(0, all_event_bits), m_pid_pthread(), m_launch_status(), @@ -127,9 +125,7 @@ public: bool GetDetachOnError() { return m_detach_on_error; } protected: - //------------------------------------------------------------------ // Classes that inherit from RNBContext can see and modify these - //------------------------------------------------------------------ nub_process_t m_pid; std::string m_stdin; std::string m_stdout; @@ -153,9 +149,7 @@ protected: static void *ThreadFunctionProcessStatus(void *arg); private: - //------------------------------------------------------------------ // Outlaw copy and assignment operators - //------------------------------------------------------------------ RNBContext(const RNBContext &rhs); RNBContext &operator=(const RNBContext &rhs); }; diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp index d67f5c8..16c15f6 100644 --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -49,18 +49,14 @@ #include <sstream> #include <unordered_set> -//---------------------------------------------------------------------- // constants -//---------------------------------------------------------------------- static const std::string OS_LOG_EVENTS_KEY_NAME("events"); static const std::string JSON_ASYNC_TYPE_KEY_NAME("type"); static const DarwinLogEventVector::size_type DARWIN_LOG_MAX_EVENTS_PER_PACKET = 10; -//---------------------------------------------------------------------- // std::iostream formatting macros -//---------------------------------------------------------------------- #define RAW_HEXBASE std::setfill('0') << std::hex << std::right #define HEXBASE '0' << 'x' << RAW_HEXBASE #define RAWHEX8(x) RAW_HEXBASE << std::setw(2) << ((uint32_t)((uint8_t)x)) @@ -89,16 +85,12 @@ static const DarwinLogEventVector::size_type DARWIN_LOG_MAX_EVENTS_PER_PACKET = std::setfill('\t') << std::setw((iword_idx)) << "" // Class to handle communications via gdb remote protocol. -//---------------------------------------------------------------------- // Prototypes -//---------------------------------------------------------------------- static std::string binary_encode_string(const std::string &s); -//---------------------------------------------------------------------- // Decode a single hex character and return the hex value as a number or // -1 if "ch" is not a hex character. -//---------------------------------------------------------------------- static inline int xdigit_to_sint(char ch) { if (ch >= 'a' && ch <= 'f') return 10 + ch - 'a'; @@ -109,10 +101,8 @@ static inline int xdigit_to_sint(char ch) { return -1; } -//---------------------------------------------------------------------- // Decode a single hex ASCII byte. Return -1 on failure, a value 0-255 // on success. -//---------------------------------------------------------------------- static inline int decoded_hex_ascii_char(const char *p) { const int hi_nibble = xdigit_to_sint(p[0]); if (hi_nibble == -1) @@ -123,9 +113,7 @@ static inline int decoded_hex_ascii_char(const char *p) { return (uint8_t)((hi_nibble << 4) + lo_nibble); } -//---------------------------------------------------------------------- // Decode a hex ASCII string back into a string -//---------------------------------------------------------------------- static std::string decode_hex_ascii_string(const char *p, uint32_t max_length = UINT32_MAX) { std::string arg; @@ -4414,10 +4402,8 @@ rnb_err_t RNBRemote::HandlePacket_C(const char *p) { return rnb_success; } -//---------------------------------------------------------------------- // 'D' packet // Detach from gdb. -//---------------------------------------------------------------------- rnb_err_t RNBRemote::HandlePacket_D(const char *p) { if (m_ctx.HasValidProcessID()) { if (DNBProcessDetach(m_ctx.ProcessID())) @@ -5821,13 +5807,11 @@ static nub_addr_t GetMachHeaderForMainExecutable(const nub_process_t pid, DNBDataRef::offset_t offset = 0; data.SetPointerSize(addr_size); - //---------------------------------------------------------------------- // When we are sitting at __dyld_start, the kernel has placed the // address of the mach header of the main executable on the stack. If we // read the SP and dereference a pointer, we might find the mach header // for the executable. We also just make sure there is only 1 thread // since if we are at __dyld_start we shouldn't have multiple threads. - //---------------------------------------------------------------------- if (DNBProcessGetNumThreads(pid) == 1) { nub_thread_t tid = DNBProcessGetThreadAtIndex(pid, 0); if (tid != INVALID_NUB_THREAD) { @@ -5847,10 +5831,8 @@ static nub_addr_t GetMachHeaderForMainExecutable(const nub_process_t pid, } } - //---------------------------------------------------------------------- // Check the dyld_all_image_info structure for a list of mach header // since it is a very easy thing to check - //---------------------------------------------------------------------- if (shlib_addr != INVALID_NUB_ADDRESS) { bytes_read = DNBProcessMemoryRead(pid, shlib_addr, sizeof(AllImageInfos), bytes); @@ -5880,12 +5862,10 @@ static nub_addr_t GetMachHeaderForMainExecutable(const nub_process_t pid, } } - //---------------------------------------------------------------------- // We failed to find the executable's mach header from the all image // infos and by dereferencing the stack pointer. Now we fall back to // enumerating the memory regions and looking for regions that are // executable. - //---------------------------------------------------------------------- DNBRegionInfo region_info; mach_header_addr = 0; while (DNBProcessMemoryRegionInfo(pid, mach_header_addr, ®ion_info)) { diff --git a/lldb/tools/debugserver/source/StdStringExtractor.cpp b/lldb/tools/debugserver/source/StdStringExtractor.cpp index a52e8ab..cb706a8 100644 --- a/lldb/tools/debugserver/source/StdStringExtractor.cpp +++ b/lldb/tools/debugserver/source/StdStringExtractor.cpp @@ -21,9 +21,7 @@ static inline int xdigit_to_sint(char ch) { return -1; } -//---------------------------------------------------------------------- // StdStringExtractor constructor -//---------------------------------------------------------------------- StdStringExtractor::StdStringExtractor() : m_packet(), m_index(0) {} StdStringExtractor::StdStringExtractor(const char *packet_cstr) @@ -32,15 +30,11 @@ StdStringExtractor::StdStringExtractor(const char *packet_cstr) m_packet.assign(packet_cstr); } -//---------------------------------------------------------------------- // StdStringExtractor copy constructor -//---------------------------------------------------------------------- StdStringExtractor::StdStringExtractor(const StdStringExtractor &rhs) : m_packet(rhs.m_packet), m_index(rhs.m_index) {} -//---------------------------------------------------------------------- // StdStringExtractor assignment operator -//---------------------------------------------------------------------- const StdStringExtractor &StdStringExtractor:: operator=(const StdStringExtractor &rhs) { if (this != &rhs) { @@ -50,9 +44,7 @@ operator=(const StdStringExtractor &rhs) { return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- StdStringExtractor::~StdStringExtractor() {} char StdStringExtractor::GetChar(char fail_value) { @@ -65,14 +57,12 @@ char StdStringExtractor::GetChar(char fail_value) { return fail_value; } -//---------------------------------------------------------------------- // If a pair of valid hex digits exist at the head of the // StdStringExtractor they are decoded into an unsigned byte and returned // by this function // // If there is not a pair of valid hex digits at the head of the // StdStringExtractor, it is left unchanged and -1 is returned -//---------------------------------------------------------------------- int StdStringExtractor::DecodeHexU8() { SkipSpaces(); if (GetBytesLeft() < 2) { @@ -87,10 +77,8 @@ int StdStringExtractor::DecodeHexU8() { return (uint8_t)((hi_nibble << 4) + lo_nibble); } -//---------------------------------------------------------------------- // Extract an unsigned character from two hex ASCII chars in the packet // string, or return fail_value on failure -//---------------------------------------------------------------------- uint8_t StdStringExtractor::GetHexU8(uint8_t fail_value, bool set_eof_on_fail) { // On success, fail_value will be overwritten with the next // character in the stream @@ -290,12 +278,10 @@ size_t StdStringExtractor::GetHexBytes(void *dst_void, size_t dst_len, return bytes_extracted; } -//---------------------------------------------------------------------- // Decodes all valid hex encoded bytes at the head of the // StdStringExtractor, limited by dst_len. // // Returns the number of bytes successfully decoded -//---------------------------------------------------------------------- size_t StdStringExtractor::GetHexBytesAvail(void *dst_void, size_t dst_len) { uint8_t *dst = (uint8_t *)dst_void; size_t bytes_extracted = 0; diff --git a/lldb/tools/debugserver/source/StdStringExtractor.h b/lldb/tools/debugserver/source/StdStringExtractor.h index cc256f5..d3edfb2 100644 --- a/lldb/tools/debugserver/source/StdStringExtractor.h +++ b/lldb/tools/debugserver/source/StdStringExtractor.h @@ -18,17 +18,13 @@ class StdStringExtractor { public: enum { BigEndian = 0, LittleEndian = 1 }; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StdStringExtractor(); StdStringExtractor(const char *packet_cstr); StdStringExtractor(const StdStringExtractor &rhs); virtual ~StdStringExtractor(); - //------------------------------------------------------------------ // Operators - //------------------------------------------------------------------ const StdStringExtractor &operator=(const StdStringExtractor &rhs); // Returns true if the file position is still valid for the data @@ -107,9 +103,7 @@ public: } protected: - //------------------------------------------------------------------ // For StdStringExtractor only - //------------------------------------------------------------------ std::string m_packet; // The string in which to extract data. uint64_t m_index; // When extracting data from a packet, this index // will march along as things get extracted. If set diff --git a/lldb/tools/debugserver/source/debugserver.cpp b/lldb/tools/debugserver/source/debugserver.cpp index c360a46..1463ff9 100644 --- a/lldb/tools/debugserver/source/debugserver.cpp +++ b/lldb/tools/debugserver/source/debugserver.cpp @@ -45,9 +45,7 @@ extern "C" int proc_set_wakemon_params(pid_t, int, // Global PID in case we get a signal and need to stop the process... nub_process_t g_pid = INVALID_NUB_PROCESS; -//---------------------------------------------------------------------- // Run loop modes which determine which run loop function will be called -//---------------------------------------------------------------------- typedef enum { eRNBRunLoopModeInvalid = 0, eRNBRunLoopModeGetStartModeFromRemoteProtocol, @@ -58,9 +56,7 @@ typedef enum { eRNBRunLoopModeExit } RNBRunLoopMode; -//---------------------------------------------------------------------- // Global Variables -//---------------------------------------------------------------------- RNBRemoteSP g_remoteSP; static int g_lockdown_opt = 0; static int g_applist_opt = 0; @@ -87,12 +83,10 @@ bool g_detach_on_error = true; } \ } while (0) -//---------------------------------------------------------------------- // Get our program path and arguments from the remote connection. // We will need to start up the remote connection without a PID, get the // arguments, wait for the new process to finish launching and hit its // entry point, and then return the run loop mode that should come next. -//---------------------------------------------------------------------- RNBRunLoopMode RNBRunLoopGetStartModeFromRemote(RNBRemote *remote) { std::string packet; @@ -162,12 +156,10 @@ RNBRunLoopMode RNBRunLoopGetStartModeFromRemote(RNBRemote *remote) { return eRNBRunLoopModeExit; } -//---------------------------------------------------------------------- // This run loop mode will wait for the process to launch and hit its // entry point. It will currently ignore all events except for the // process state changed event, where it watches for the process stopped // or crash process state. -//---------------------------------------------------------------------- RNBRunLoopMode RNBRunLoopLaunchInferior(RNBRemote *remote, const char *stdin_path, const char *stdout_path, @@ -351,12 +343,10 @@ RNBRunLoopMode RNBRunLoopLaunchInferior(RNBRemote *remote, return eRNBRunLoopModeExit; } -//---------------------------------------------------------------------- // This run loop mode will wait for the process to launch and hit its // entry point. It will currently ignore all events except for the // process state changed event, where it watches for the process stopped // or crash process state. -//---------------------------------------------------------------------- RNBRunLoopMode RNBRunLoopLaunchAttaching(RNBRemote *remote, nub_process_t attach_pid, nub_process_t &pid) { @@ -379,11 +369,9 @@ RNBRunLoopMode RNBRunLoopLaunchAttaching(RNBRemote *remote, } } -//---------------------------------------------------------------------- // Watch for signals: // SIGINT: so we can halt our inferior. (disabled for now) // SIGPIPE: in case our child process dies -//---------------------------------------------------------------------- int g_sigint_received = 0; int g_sigpipe_received = 0; void signal_handler(int signo) { @@ -654,10 +642,8 @@ RNBRunLoopMode RNBRunLoopPlatform(RNBRemote *remote) { return eRNBRunLoopModeExit; } -//---------------------------------------------------------------------- // Convenience function to set up the remote listening port // Returns 1 for success 0 for failure. -//---------------------------------------------------------------------- static void PortWasBoundCallbackUnixSocket(const void *baton, in_port_t port) { //::printf ("PortWasBoundCallbackUnixSocket (baton = %p, port = %u)\n", baton, @@ -761,9 +747,7 @@ static int ConnectRemote(RNBRemote *remote, const char *host, int port, return 1; } -//---------------------------------------------------------------------- // ASL Logging callback that can be registered with DNBLogSetLogCallback -//---------------------------------------------------------------------- void ASLLogCallback(void *baton, uint32_t flags, const char *format, va_list args) { if (format == NULL) @@ -792,10 +776,8 @@ void ASLLogCallback(void *baton, uint32_t flags, const char *format, ::asl_vlog(NULL, g_aslmsg, asl_level, format, args); } -//---------------------------------------------------------------------- // FILE based Logging callback that can be registered with // DNBLogSetLogCallback -//---------------------------------------------------------------------- void FileLogCallback(void *baton, uint32_t flags, const char *format, va_list args) { if (baton == NULL || format == NULL) @@ -821,9 +803,7 @@ void show_usage_and_exit(int exit_code) { exit(exit_code); } -//---------------------------------------------------------------------- // option descriptors for getopt_long_only() -//---------------------------------------------------------------------- static struct option g_long_options[] = { {"attach", required_argument, NULL, 'a'}, {"arch", required_argument, NULL, 'A'}, @@ -890,9 +870,7 @@ static struct option g_long_options[] = { // -F localhost:1234 -- /bin/ls" {NULL, 0, NULL, 0}}; -//---------------------------------------------------------------------- // main -//---------------------------------------------------------------------- int main(int argc, char *argv[]) { // If debugserver is launched with DYLD_INSERT_LIBRARIES, unset it so we // don't spawn child processes with this enabled. diff --git a/lldb/tools/debugserver/source/libdebugserver.cpp b/lldb/tools/debugserver/source/libdebugserver.cpp index 450ce41..e545caf 100644 --- a/lldb/tools/debugserver/source/libdebugserver.cpp +++ b/lldb/tools/debugserver/source/libdebugserver.cpp @@ -26,9 +26,7 @@ #include "RNBSocket.h" #include "SysSignal.h" -//---------------------------------------------------------------------- // Run loop modes which determine which run loop function will be called -//---------------------------------------------------------------------- typedef enum { eRNBRunLoopModeInvalid = 0, eRNBRunLoopModeGetStartModeFromRemoteProtocol, @@ -36,9 +34,7 @@ typedef enum { eRNBRunLoopModeExit } RNBRunLoopMode; -//---------------------------------------------------------------------- // Global Variables -//---------------------------------------------------------------------- RNBRemoteSP g_remoteSP; int g_disable_aslr = 0; int g_isatty = 0; @@ -60,12 +56,10 @@ int g_isatty = 0; } \ } while (0) -//---------------------------------------------------------------------- // Get our program path and arguments from the remote connection. // We will need to start up the remote connection without a PID, get the // arguments, wait for the new process to finish launching and hit its // entry point, and then return the run loop mode that should come next. -//---------------------------------------------------------------------- RNBRunLoopMode RNBRunLoopGetStartModeFromRemote(RNBRemoteSP &remoteSP) { std::string packet; @@ -125,11 +119,9 @@ RNBRunLoopMode RNBRunLoopGetStartModeFromRemote(RNBRemoteSP &remoteSP) { return eRNBRunLoopModeExit; } -//---------------------------------------------------------------------- // Watch for signals: // SIGINT: so we can halt our inferior. (disabled for now) // SIGPIPE: in case our child process dies -//---------------------------------------------------------------------- nub_process_t g_pid; int g_sigpipe_received = 0; void signal_handler(int signo) { diff --git a/lldb/tools/intel-features/intel-pt/Decoder.h b/lldb/tools/intel-features/intel-pt/Decoder.h index 390defb..2ae8965 100644 --- a/lldb/tools/intel-features/intel-pt/Decoder.h +++ b/lldb/tools/intel-features/intel-pt/Decoder.h @@ -29,13 +29,11 @@ #include "intel-pt.h" namespace ptdecoder_private { -//---------------------------------------------------------------------- /// \class Instruction /// Represents an assembly instruction containing raw /// instruction bytes, instruction address along with information /// regarding execution flow context and Intel(R) Processor Trace /// context. -//---------------------------------------------------------------------- class Instruction { public: Instruction() : ip(0), data(), error(), iclass(ptic_error), speculative(0) {} @@ -79,11 +77,9 @@ private: uint32_t speculative : 1; // Instruction was executed speculatively or not }; -//--------------------------------------------------------------------------- /// \class InstructionList /// Represents a list of assembly instructions. Each instruction is of /// type Instruction. -//--------------------------------------------------------------------------- class InstructionList { public: InstructionList() : m_insn_vec() {} @@ -109,41 +105,34 @@ private: std::vector<Instruction> m_insn_vec; }; -//---------------------------------------------------------------------- /// \class TraceOptions /// Provides Intel(R) Processor Trace specific configuration options and /// other information obtained by decoding and post-processing the trace /// data. Currently, this information comprises of the total number of /// assembly instructions executed for an inferior. -//---------------------------------------------------------------------- class TraceOptions : public lldb::SBTraceOptions { public: TraceOptions() : lldb::SBTraceOptions(), m_insn_log_size(0) {} ~TraceOptions() {} - //------------------------------------------------------------------ /// Get total number of assembly instructions obtained after decoding the /// complete Intel(R) Processor Trace data obtained from LLDB. /// /// \return /// Total number of instructions. - //------------------------------------------------------------------ uint32_t getInstructionLogSize() const { return m_insn_log_size; } - //------------------------------------------------------------------ /// Set total number of assembly instructions. /// /// \param[in] size /// Value to be set. - //------------------------------------------------------------------ void setInstructionLogSize(uint32_t size) { m_insn_log_size = size; } private: uint32_t m_insn_log_size; }; -//---------------------------------------------------------------------- /// \class Decoder /// This class makes use of Intel(R) Processor Trace hardware feature /// (implememted inside LLDB) to gather trace data for an inferior (being @@ -156,7 +145,6 @@ private: /// - stop the trace for a thread/process, /// - get the execution flow (assembly instructions) for a thread and /// - get trace specific information for a thread -//---------------------------------------------------------------------- class Decoder { public: typedef std::vector<Instruction> Instructions; @@ -216,7 +204,6 @@ private: void ParseCPUInfo(CPUInfo &pt_cpu, lldb::SBStructuredData &s, lldb::SBError &sberror); - ///------------------------------------------------------------------------ /// Function performs following tasks for a given process and thread: /// - Checks if the given thread is registered in the class or not. If not /// then tries to register it if trace was ever started on the entire @@ -224,7 +211,6 @@ private: /// - fetches trace and other necessary information from LLDB (using /// ReadTraceDataAndImageInfo()) and decodes the trace (using /// DecodeProcessorTrace()) - ///------------------------------------------------------------------------ void FetchAndDecode(lldb::SBProcess &sbprocess, lldb::tid_t tid, lldb::SBError &sberror, ThreadTraceInfo **threadTraceInfo); @@ -248,12 +234,10 @@ private: ReadExecuteSectionInfos &readExecuteSectionInfos, lldb::SBError &sberror); - ///------------------------------------------------------------------------ /// Helper functions of DecodeProcessorTrace() function for: /// - initializing raw trace decoder (provided by Intel(R) Processor Trace /// Decoding library) /// - start trace decoding - ///------------------------------------------------------------------------ void InitializePTInstDecoder( struct pt_insn_decoder **decoder, struct pt_config *config, const CPUInfo &pt_cpu, Buffer &pt_buffer, diff --git a/lldb/tools/intel-features/intel-pt/PTDecoder.h b/lldb/tools/intel-features/intel-pt/PTDecoder.h index 4b216af..10f2a58 100644 --- a/lldb/tools/intel-features/intel-pt/PTDecoder.h +++ b/lldb/tools/intel-features/intel-pt/PTDecoder.h @@ -29,13 +29,11 @@ class Decoder; namespace ptdecoder { -//---------------------------------------------------------------------- /// \class PTInstruction /// Represents an assembly instruction containing raw /// instruction bytes, instruction address along with information /// regarding execution flow context and Intel(R) Processor Trace /// context. -//---------------------------------------------------------------------- class PTInstruction { public: PTInstruction(); @@ -49,7 +47,6 @@ public: // Get instruction address in inferior's memory image uint64_t GetInsnAddress() const; - //------------------------------------------------------------------ /// Get raw bytes of the instruction in the buffer. /// /// \param[out] buf @@ -67,7 +64,6 @@ public: /// Number of bytes of the instruction actually written to @buf if API /// succeeds. In case of errors, total number of raw bytes of the /// instruction is returned. - //------------------------------------------------------------------ size_t GetRawBytes(void *buf, size_t size) const; // Get error string if it represents an invalid instruction. For a valid @@ -81,11 +77,9 @@ private: std::shared_ptr<ptdecoder_private::Instruction> m_opaque_sp; }; -//--------------------------------------------------------------------------- /// \class PTInstructionList /// Represents a list of assembly instructions. Each instruction is of /// type PTInstruction. -//--------------------------------------------------------------------------- class PTInstructionList { public: PTInstructionList(); @@ -110,12 +104,10 @@ private: std::shared_ptr<ptdecoder_private::InstructionList> m_opaque_sp; }; -//---------------------------------------------------------------------- /// \class PTTraceOptions /// Provides configuration options like trace type, trace buffer size, /// meta data buffer size along with other Intel(R) Processor Trace /// specific options. -//---------------------------------------------------------------------- class PTTraceOptions { public: PTTraceOptions(); @@ -130,7 +122,6 @@ public: uint64_t GetMetaDataBufferSize() const; - //------------------------------------------------------------------ /// Get Intel(R) Processor Trace specific configuration options (apart from /// trace buffer size, meta data buffer size and TraceType) formatted as /// json text i.e. {"Name":Value,"Name":Value} pairs, where "Value" is a @@ -139,7 +130,6 @@ public: /// /// \return /// A string formatted as json text {"Name":Value,"Name":Value} - //------------------------------------------------------------------ lldb::SBStructuredData GetTraceParams(lldb::SBError &error); private: @@ -150,7 +140,6 @@ private: std::shared_ptr<ptdecoder_private::TraceOptions> m_opaque_sp; }; -//---------------------------------------------------------------------- /// \class PTDecoder /// This class makes use of Intel(R) Processor Trace hardware feature /// (implememted inside LLDB) to gather trace data for an inferior (being @@ -163,7 +152,6 @@ private: /// - stop the trace for a thread/process, /// - get the execution flow (assembly instructions) for a thread and /// - get trace specific information for a thread -//---------------------------------------------------------------------- class PTDecoder { public: PTDecoder(lldb::SBDebugger &sbdebugger); @@ -172,7 +160,6 @@ public: ~PTDecoder(); - //------------------------------------------------------------------ /// Start Intel(R) Processor Trace on a thread or complete process with /// Intel(R) Processor Trace specific configuration options /// @@ -211,12 +198,10 @@ public: /// /// \param[out] sberror /// An error with the failure reason if API fails. Else success. - //------------------------------------------------------------------ void StartProcessorTrace(lldb::SBProcess &sbprocess, lldb::SBTraceOptions &sbtraceoptions, lldb::SBError &sberror); - //------------------------------------------------------------------ /// Stop Intel(R) Processor Trace on a thread or complete process. /// /// \param[in] sbprocess @@ -231,11 +216,9 @@ public: /// /// \param[out] sberror /// An error with the failure reason if API fails. Else success. - //------------------------------------------------------------------ void StopProcessorTrace(lldb::SBProcess &sbprocess, lldb::SBError &sberror, lldb::tid_t tid = LLDB_INVALID_THREAD_ID); - //------------------------------------------------------------------ /// Get instruction log containing the execution flow for a thread of a /// process in terms of assembly instructions executed. /// @@ -269,13 +252,11 @@ public: /// /// \param[out] sberror /// An error with the failure reason if API fails. Else success. - //------------------------------------------------------------------ void GetInstructionLogAtOffset(lldb::SBProcess &sbprocess, lldb::tid_t tid, uint32_t offset, uint32_t count, PTInstructionList &result_list, lldb::SBError &sberror); - //------------------------------------------------------------------ /// Get Intel(R) Processor Trace specific information for a thread of a /// process. The information contains the actual configuration options with /// which the trace was started for this thread. @@ -296,7 +277,6 @@ public: /// /// \param[out] sberror /// An error with the failure reason if API fails. Else success. - //------------------------------------------------------------------ void GetProcessorTraceInfo(lldb::SBProcess &sbprocess, lldb::tid_t tid, PTTraceOptions &options, lldb::SBError &sberror); diff --git a/lldb/tools/lldb-mi/MICmdArgContext.cpp b/lldb/tools/lldb-mi/MICmdArgContext.cpp index 959ccee..18da5b5 100644 --- a/lldb/tools/lldb-mi/MICmdArgContext.cpp +++ b/lldb/tools/lldb-mi/MICmdArgContext.cpp @@ -10,7 +10,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgContext constructor. // Type: Method. // Args: None. @@ -20,7 +19,6 @@ CMICmdArgContext::CMICmdArgContext() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgContext constructor. // Type: Method. // Args: vrCmdLineArgsRaw - (R) The text description of the arguments @@ -32,7 +30,6 @@ CMICmdArgContext::CMICmdArgContext(const CMIUtilString &vrCmdLineArgsRaw) : m_strCmdArgsAndOptions(vrCmdLineArgsRaw) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgContext destructor. // Type: Method. // Args: None. @@ -42,7 +39,6 @@ CMICmdArgContext::CMICmdArgContext(const CMIUtilString &vrCmdLineArgsRaw) CMICmdArgContext::~CMICmdArgContext() {} //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the remainder of the command's argument options left to // parse. // Type: Method. @@ -55,7 +51,6 @@ const CMIUtilString &CMICmdArgContext::GetArgsLeftToParse() const { } //++ -//------------------------------------------------------------------------------------ // Details: Ask if this arguments string has any arguments. // Type: Method. // Args: None. @@ -68,7 +63,6 @@ bool CMICmdArgContext::IsEmpty() const { } //++ -//------------------------------------------------------------------------------------ // Details: Remove the argument from the options text and any space after the // argument // if applicable. @@ -127,7 +121,6 @@ bool CMICmdArgContext::RemoveArg(const CMIUtilString &vArg) { } //++ -//------------------------------------------------------------------------------------ // Details: Remove the argument at the Nth word position along in the context // string. // Any space after the argument is removed if applicable. A search is @@ -187,7 +180,6 @@ bool CMICmdArgContext::RemoveArgAtPos(const CMIUtilString &vArg, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve number of arguments or options present in the command's // option text. // Type: Method. @@ -201,7 +193,6 @@ size_t CMICmdArgContext::GetNumberArgsPresent() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve all the arguments or options remaining in *this context. // Type: Method. // Args: None. @@ -215,7 +206,6 @@ CMIUtilString::VecString_t CMICmdArgContext::GetArgs() const { } //++ -//------------------------------------------------------------------------------------ // Details: Copy assignment operator. // Type: Method. // Args: vOther - (R) The variable to copy from. diff --git a/lldb/tools/lldb-mi/MICmdArgSet.cpp b/lldb/tools/lldb-mi/MICmdArgSet.cpp index c8d163b..0d67c03 100644 --- a/lldb/tools/lldb-mi/MICmdArgSet.cpp +++ b/lldb/tools/lldb-mi/MICmdArgSet.cpp @@ -13,7 +13,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgSet constructor. // Type: Method. // Args: None. @@ -24,7 +23,6 @@ CMICmdArgSet::CMICmdArgSet() : m_bIsArgsPresentButNotHandledByCmd(false), m_constStrCommaSpc(", ") {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgSet destructor. // Type: Method. // Args: None. @@ -37,7 +35,6 @@ CMICmdArgSet::~CMICmdArgSet() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources used by *this container object. // Type: Method. // Args: None. @@ -66,7 +63,6 @@ void CMICmdArgSet::Destroy() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state flag indicating that the command set up ready to // parse // command arguments or options found that one or more arguments was @@ -83,7 +79,6 @@ bool CMICmdArgSet::IsArgsPresentButNotHandledByCmd() const { } //++ -//------------------------------------------------------------------------------------ // Details: Add the list of command's arguments to parse and validate another // one. // Type: Method. @@ -94,7 +89,6 @@ bool CMICmdArgSet::IsArgsPresentButNotHandledByCmd() const { void CMICmdArgSet::Add(CMICmdArgValBase *vArg) { m_setCmdArgs.push_back(vArg); } //++ -//------------------------------------------------------------------------------------ // Details: After validating an options line of text (the context) and there is // a failure, // it is likely a mandatory command argument that is required is @@ -110,7 +104,6 @@ const CMICmdArgSet::SetCmdArgs_t &CMICmdArgSet::GetArgsThatAreMissing() const { } //++ -//------------------------------------------------------------------------------------ // Details: After validating an options line of text (the context) and there is // a failure, // it may be because one or more arguments were unable to extract a @@ -126,7 +119,6 @@ const CMICmdArgSet::SetCmdArgs_t &CMICmdArgSet::GetArgsThatInvalid() const { } //++ -//------------------------------------------------------------------------------------ // Details: The list of argument or option (objects) that were specified by the // command // and so recognised when parsed but were not handled. Ideally the @@ -148,7 +140,6 @@ const CMICmdArgSet::SetCmdArgs_t &CMICmdArgSet::GetArgsNotHandledByCmd() const { } //++ -//------------------------------------------------------------------------------------ // Details: Given a set of command argument objects parse the context option // string to // find those argument and retrieve their value. If the function fails @@ -199,7 +190,6 @@ bool CMICmdArgSet::Validate(const CMIUtilString &vStrMiCmd, } //++ -//------------------------------------------------------------------------------------ // Details: Having validated the command's options text and failed for some // reason form // the error message made up with the faults found. @@ -310,7 +300,6 @@ bool CMICmdArgSet::ValidationFormErrorMessages( } //++ -//------------------------------------------------------------------------------------ // Details: Ask if the command's argument options text had any arguments. // Type: Method. // Args: None. @@ -323,7 +312,6 @@ bool CMICmdArgSet::IsArgContextEmpty() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the number of arguments that are being used for the // command. // Type: Method. @@ -334,7 +322,6 @@ bool CMICmdArgSet::IsArgContextEmpty() const { size_t CMICmdArgSet::GetCount() const { return m_setCmdArgs.size(); } //++ -//------------------------------------------------------------------------------------ // Details: Given a set of command argument objects retrieve the argument with // the // specified name. @@ -364,7 +351,6 @@ bool CMICmdArgSet::GetArg(const CMIUtilString &vArgName, } //++ -//------------------------------------------------------------------------------------ // Details: Write a warning message to the MI Log file about the command's // arguments or // options that were found present but not handled. diff --git a/lldb/tools/lldb-mi/MICmdArgValBase.cpp b/lldb/tools/lldb-mi/MICmdArgValBase.cpp index ff87877..dc9c7e0 100644 --- a/lldb/tools/lldb-mi/MICmdArgValBase.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValBase.cpp @@ -11,7 +11,6 @@ #include "MIUtilString.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValBase constructor. // Type: Method. // Args: None. @@ -23,7 +22,6 @@ CMICmdArgValBase::CMICmdArgValBase() m_bIsMissingOptions(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValBase constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -42,7 +40,6 @@ CMICmdArgValBase::CMICmdArgValBase(const CMIUtilString &vrArgName, m_bIsMissingOptions(false) {} //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state flag of whether the argument is handled by the // command or // not. @@ -57,7 +54,6 @@ bool CMICmdArgValBase::GetIsMissingOptions() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state flag of whether the argument is handled by the // command or // not. @@ -70,7 +66,6 @@ bool CMICmdArgValBase::GetIsMissingOptions() const { bool CMICmdArgValBase::GetIsHandledByCmd() const { return m_bHandled; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the name of *this argument. // Type: Method. // Args: None. @@ -80,7 +75,6 @@ bool CMICmdArgValBase::GetIsHandledByCmd() const { return m_bHandled; } const CMIUtilString &CMICmdArgValBase::GetName() const { return m_strArgName; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state flag of whether the argument was found in the // command's // argument / options string. @@ -93,7 +87,6 @@ const CMIUtilString &CMICmdArgValBase::GetName() const { return m_strArgName; } bool CMICmdArgValBase::GetFound() const { return m_bFound; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state flag indicating whether the value was obtained // from the // text arguments string and is valid. @@ -106,7 +99,6 @@ bool CMICmdArgValBase::GetFound() const { return m_bFound; } bool CMICmdArgValBase::GetValid() const { return m_bValid; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state flag indicating whether *this argument is a // mandatory // argument for the command or is optional to be present. @@ -119,7 +111,6 @@ bool CMICmdArgValBase::GetValid() const { return m_bValid; } bool CMICmdArgValBase::GetIsMandatory() const { return m_bMandatory; } //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. diff --git a/lldb/tools/lldb-mi/MICmdArgValBase.h b/lldb/tools/lldb-mi/MICmdArgValBase.h index 9e31455..feb7fe4 100644 --- a/lldb/tools/lldb-mi/MICmdArgValBase.h +++ b/lldb/tools/lldb-mi/MICmdArgValBase.h @@ -85,7 +85,6 @@ protected: }; //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValBaseTemplate constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -103,7 +102,6 @@ CMICmdArgValBaseTemplate<T>::CMICmdArgValBaseTemplate( : CMICmdArgValBase(vrArgName, vbMandatory, vbHandleByCmd) {} //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value the argument parsed from the command's argument / // options // text string. diff --git a/lldb/tools/lldb-mi/MICmdArgValConsume.cpp b/lldb/tools/lldb-mi/MICmdArgValConsume.cpp index a99ea5c..01d0013 100644 --- a/lldb/tools/lldb-mi/MICmdArgValConsume.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValConsume.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValConsume constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMICmdArgValConsume::CMICmdArgValConsume() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValConsume constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -35,7 +33,6 @@ CMICmdArgValConsume::CMICmdArgValConsume(const CMIUtilString &vrArgName, : CMICmdArgValBaseTemplate(vrArgName, vbMandatory, true) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValConsume destructor. // Type: Overidden. // Args: None. @@ -45,7 +42,6 @@ CMICmdArgValConsume::CMICmdArgValConsume(const CMIUtilString &vrArgName, CMICmdArgValConsume::~CMICmdArgValConsume() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. @@ -81,7 +77,6 @@ bool CMICmdArgValConsume::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Nothing to examine as we just want to consume the argument or option // (ignore // it). diff --git a/lldb/tools/lldb-mi/MICmdArgValFile.cpp b/lldb/tools/lldb-mi/MICmdArgValFile.cpp index 2d1507a..7171b0f 100644 --- a/lldb/tools/lldb-mi/MICmdArgValFile.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValFile.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValFile constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMICmdArgValFile::CMICmdArgValFile() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValFile constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -38,7 +36,6 @@ CMICmdArgValFile::CMICmdArgValFile(const CMIUtilString &vrArgName, : CMICmdArgValBaseTemplate(vrArgName, vbMandatory, vbHandleByCmd) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValFile destructor. // Type: Overridden. // Args: None. @@ -48,7 +45,6 @@ CMICmdArgValFile::CMICmdArgValFile(const CMIUtilString &vrArgName, CMICmdArgValFile::~CMICmdArgValFile() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. @@ -101,7 +97,6 @@ bool CMICmdArgValFile::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Given some text extract the file name path from it. If a space is // found in // path done return the path surrounded in quotes. @@ -124,7 +119,6 @@ CMICmdArgValFile::GetFileNamePath(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid file name path. // Type: Method. // Args: vrFileNamePath - (R) File's name and directory path. @@ -161,7 +155,6 @@ bool CMICmdArgValFile::IsFilePath(const CMIUtilString &vrFileNamePath) const { } //++ -//------------------------------------------------------------------------------------ // Details: Determine if the path contains valid characters for a file path. // Letters can be // either upper or lower case. diff --git a/lldb/tools/lldb-mi/MICmdArgValListBase.cpp b/lldb/tools/lldb-mi/MICmdArgValListBase.cpp index 645a741..bd175f3 100644 --- a/lldb/tools/lldb-mi/MICmdArgValListBase.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValListBase.cpp @@ -18,7 +18,6 @@ #include "MICmdArgValThreadGrp.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListBase constructor. // Type: Method. // Args: None. @@ -29,7 +28,6 @@ CMICmdArgValListBase::CMICmdArgValListBase() : m_eArgType(eArgValType_invalid) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListBase constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -47,7 +45,6 @@ CMICmdArgValListBase::CMICmdArgValListBase(const CMIUtilString &vrArgName, m_eArgType(eArgValType_invalid) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListBase constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -68,7 +65,6 @@ CMICmdArgValListBase::CMICmdArgValListBase(const CMIUtilString &vrArgName, m_eArgType(veType) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListBase destructor. // Type: Overridden. // Args: None. @@ -81,7 +77,6 @@ CMICmdArgValListBase::~CMICmdArgValListBase() { } //++ -//------------------------------------------------------------------------------------ // Details: Tear down resources used by *this object. // Type: Method. // Args: None. @@ -102,7 +97,6 @@ void CMICmdArgValListBase::Destroy() { } //++ -//------------------------------------------------------------------------------------ // Details: Create an CMICmdArgValBase derived object matching the type // specified // and put the option or argument's value inside it. @@ -163,7 +157,6 @@ CMICmdArgValListBase::CreationObj(const CMIUtilString &vrTxt, } //++ -//------------------------------------------------------------------------------------ // Details: Validate the option or argument is the correct type. // Type: Method. // Args: vrTxt - (R) Text version the option or argument. diff --git a/lldb/tools/lldb-mi/MICmdArgValListBase.h b/lldb/tools/lldb-mi/MICmdArgValListBase.h index 8762b2d..4437ae1 100644 --- a/lldb/tools/lldb-mi/MICmdArgValListBase.h +++ b/lldb/tools/lldb-mi/MICmdArgValListBase.h @@ -45,7 +45,6 @@ public: // Enums: public: //++ - //--------------------------------------------------------------------------------- // Details: CMICmdArgValListBase needs to know what type of argument to look // for in // the command options text. It also needs to create argument objects diff --git a/lldb/tools/lldb-mi/MICmdArgValListOfN.cpp b/lldb/tools/lldb-mi/MICmdArgValListOfN.cpp index 5ba0f0a..b534245 100644 --- a/lldb/tools/lldb-mi/MICmdArgValListOfN.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValListOfN.cpp @@ -17,7 +17,6 @@ #include "MICmdArgValThreadGrp.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListOfN constructor. // Type: Method. // Args: None. @@ -27,7 +26,6 @@ CMICmdArgValListOfN::CMICmdArgValListOfN() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListOfN constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -47,7 +45,6 @@ CMICmdArgValListOfN::CMICmdArgValListOfN(const CMIUtilString &vrArgName, : CMICmdArgValListBase(vrArgName, vbMandatory, vbHandleByCmd, veType) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValListOfN destructor. // Type: Overridden. // Args: None. @@ -57,7 +54,6 @@ CMICmdArgValListOfN::CMICmdArgValListOfN(const CMIUtilString &vrArgName, CMICmdArgValListOfN::~CMICmdArgValListOfN() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // list of // arguments based on the argument object type to look for. @@ -87,7 +83,6 @@ bool CMICmdArgValListOfN::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Create list of argument objects each holding a value extract from // the command // options line. @@ -124,7 +119,6 @@ bool CMICmdArgValListOfN::CreateList(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Type: Method. @@ -157,7 +151,6 @@ bool CMICmdArgValListOfN::IsListOfN(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the list of CMICmdArgValBase derived option objects found // following // *this long option argument. For example "list-thread-groups [ diff --git a/lldb/tools/lldb-mi/MICmdArgValListOfN.h b/lldb/tools/lldb-mi/MICmdArgValListOfN.h index 9ccd315..74e8c16 100644 --- a/lldb/tools/lldb-mi/MICmdArgValListOfN.h +++ b/lldb/tools/lldb-mi/MICmdArgValListOfN.h @@ -61,7 +61,6 @@ private: }; //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the first argument or option value from the list of 1 or // more options // parsed from the command's options string. diff --git a/lldb/tools/lldb-mi/MICmdArgValNumber.cpp b/lldb/tools/lldb-mi/MICmdArgValNumber.cpp index 1d8fa632..ad2df79b 100644 --- a/lldb/tools/lldb-mi/MICmdArgValNumber.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValNumber.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValNumber constructor. // Type: Method. // Args: None. @@ -23,7 +22,6 @@ CMICmdArgValNumber::CMICmdArgValNumber() m_nNumber(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValNumber constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -45,7 +43,6 @@ CMICmdArgValNumber::CMICmdArgValNumber( m_nNumberFormatMask(vnNumberFormatMask), m_nNumber(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValNumber destructor. // Type: Overridden. // Args: None. @@ -55,7 +52,6 @@ CMICmdArgValNumber::CMICmdArgValNumber( CMICmdArgValNumber::~CMICmdArgValNumber() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. @@ -105,7 +101,6 @@ bool CMICmdArgValNumber::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Type: Method. @@ -134,7 +129,6 @@ bool CMICmdArgValNumber::IsArgNumber(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Extract the thread group number from the thread group argument. // Type: Method. // Args: vrTxt - (R) Some text. @@ -153,7 +147,6 @@ bool CMICmdArgValNumber::ExtractNumber(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the thread group ID found in the argument. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmdArgValNumber.h b/lldb/tools/lldb-mi/MICmdArgValNumber.h index ad4347c..23c888e 100644 --- a/lldb/tools/lldb-mi/MICmdArgValNumber.h +++ b/lldb/tools/lldb-mi/MICmdArgValNumber.h @@ -28,7 +28,6 @@ class CMICmdArgValNumber : public CMICmdArgValBaseTemplate<MIint64> { // Enums: public: //++ - //--------------------------------------------------------------------------------- // Details: CMICmdArgValNumber needs to know what format of argument to look // for in // the command options text. diff --git a/lldb/tools/lldb-mi/MICmdArgValOptionLong.cpp b/lldb/tools/lldb-mi/MICmdArgValOptionLong.cpp index 2370c31..3dc9d40 100644 --- a/lldb/tools/lldb-mi/MICmdArgValOptionLong.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValOptionLong.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionLong constructor. // Type: Method. // Args: None. @@ -22,7 +21,6 @@ CMICmdArgValOptionLong::CMICmdArgValOptionLong() : m_nExpectingNOptions(0), m_eExpectingOptionType(eArgValType_invalid) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionLong constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -40,7 +38,6 @@ CMICmdArgValOptionLong::CMICmdArgValOptionLong(const CMIUtilString &vrArgName, m_nExpectingNOptions(0), m_eExpectingOptionType(eArgValType_invalid) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionLong constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -65,7 +62,6 @@ CMICmdArgValOptionLong::CMICmdArgValOptionLong(const CMIUtilString &vrArgName, m_eExpectingOptionType(veType) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionLong destructor. // Type: Overridden. // Args: None. @@ -78,7 +74,6 @@ CMICmdArgValOptionLong::~CMICmdArgValOptionLong() { } //++ -//------------------------------------------------------------------------------------ // Details: Tear down resources used by *this object. // Type: Method. // Args: None. @@ -99,7 +94,6 @@ void CMICmdArgValOptionLong::Destroy() { } //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // long // argument *this argument type is looking for. @@ -167,7 +161,6 @@ bool CMICmdArgValOptionLong::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Parse the text following *this argument and extract the options the // values of // CMICmdArgValListBase::m_eArgType forming argument objects for each @@ -228,7 +221,6 @@ bool CMICmdArgValOptionLong::ExtractExpectedOptions(CMICmdArgContext &vrwTxt, } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid long type option // argument. // Long type argument looks like --someLongOption. @@ -255,7 +247,6 @@ bool CMICmdArgValOptionLong::IsArgLongOption(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid long type option // argument. // Long type argument looks like --someLongOption. @@ -270,7 +261,6 @@ bool CMICmdArgValOptionLong::IsArgOptionCorrect( } //++ -//------------------------------------------------------------------------------------ // Details: Does the argument name of the argument being parsed ATM match the // name of // *this argument object. @@ -285,7 +275,6 @@ bool CMICmdArgValOptionLong::ArgNameMatch(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the list of CMICmdArgValBase derived option objects found // following // *this long option argument. For example "list-thread-groups [ diff --git a/lldb/tools/lldb-mi/MICmdArgValOptionLong.h b/lldb/tools/lldb-mi/MICmdArgValOptionLong.h index cda9ce0..2408297 100644 --- a/lldb/tools/lldb-mi/MICmdArgValOptionLong.h +++ b/lldb/tools/lldb-mi/MICmdArgValOptionLong.h @@ -78,7 +78,6 @@ private: }; //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the first argument or option value from the list of 1 or // more options // parsed from the command's options string. diff --git a/lldb/tools/lldb-mi/MICmdArgValOptionShort.cpp b/lldb/tools/lldb-mi/MICmdArgValOptionShort.cpp index 8f25584..7b7116c 100644 --- a/lldb/tools/lldb-mi/MICmdArgValOptionShort.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValOptionShort.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionShort constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMICmdArgValOptionShort::CMICmdArgValOptionShort() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionShort constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -38,7 +36,6 @@ CMICmdArgValOptionShort::CMICmdArgValOptionShort(const CMIUtilString &vrArgName, : CMICmdArgValOptionLong(vrArgName, vbMandatory, vbHandleByCmd) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionLong constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -61,7 +58,6 @@ CMICmdArgValOptionShort::CMICmdArgValOptionShort( vnExpectingNOptions) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValOptionShort destructor. // Type: Overridden. // Args: None. @@ -71,7 +67,6 @@ CMICmdArgValOptionShort::CMICmdArgValOptionShort( CMICmdArgValOptionShort::~CMICmdArgValOptionShort() {} //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid short type option // argument. // Type: Method. @@ -98,7 +93,6 @@ bool CMICmdArgValOptionShort::IsArgShortOption( } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid short type option // argument. // Long type argument looks like -f some short option. @@ -113,7 +107,6 @@ bool CMICmdArgValOptionShort::IsArgOptionCorrect( } //++ -//------------------------------------------------------------------------------------ // Details: Does the argument name of the argument being parsed ATM match the // name of // *this argument object. diff --git a/lldb/tools/lldb-mi/MICmdArgValPrintValues.cpp b/lldb/tools/lldb-mi/MICmdArgValPrintValues.cpp index 1bb66d03..a2ce452 100644 --- a/lldb/tools/lldb-mi/MICmdArgValPrintValues.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValPrintValues.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValPrintValues constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMICmdArgValPrintValues::CMICmdArgValPrintValues() : m_nPrintValues(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValPrintValues constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -39,7 +37,6 @@ CMICmdArgValPrintValues::CMICmdArgValPrintValues(const CMIUtilString &vrArgName, m_nPrintValues(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValPrintValues destructor. // Type: Overridden. // Args: None. @@ -49,7 +46,6 @@ CMICmdArgValPrintValues::CMICmdArgValPrintValues(const CMIUtilString &vrArgName, CMICmdArgValPrintValues::~CMICmdArgValPrintValues() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. @@ -76,7 +72,6 @@ bool CMICmdArgValPrintValues::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Type: Method. @@ -95,7 +90,6 @@ bool CMICmdArgValPrintValues::IsArgPrintValues( } //++ -//------------------------------------------------------------------------------------ // Details: Extract the print-values from the print-values argument. // Type: Method. // Args: vrTxt - (R) Some text. @@ -120,7 +114,6 @@ bool CMICmdArgValPrintValues::ExtractPrintValues(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the print-values found in the argument. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmdArgValString.cpp b/lldb/tools/lldb-mi/MICmdArgValString.cpp index 1fda3cb..bd105bc 100644 --- a/lldb/tools/lldb-mi/MICmdArgValString.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValString.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValString constructor. // Type: Method. // Args: None. @@ -23,7 +22,6 @@ CMICmdArgValString::CMICmdArgValString() m_bHandleDirPaths(false), m_bHandleAnything(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValString constructor. // Type: Method. // Args: vbAnything - (R) True = Parse a string and accept anything, false = @@ -36,7 +34,6 @@ CMICmdArgValString::CMICmdArgValString(const bool vbAnything) m_bHandleDirPaths(false), m_bHandleAnything(vbAnything) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValString constructor. // Type: Method. // Args: vbHandleQuotes - (R) True = Parse a string surrounded by quotes @@ -58,7 +55,6 @@ CMICmdArgValString::CMICmdArgValString(const bool vbHandleQuotes, m_bHandleDirPaths(vbHandleDirPaths), m_bHandleAnything(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValString constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -85,7 +81,6 @@ CMICmdArgValString::CMICmdArgValString(const CMIUtilString &vrArgName, m_bHandleDirPaths(false), m_bHandleAnything(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValString constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -115,7 +110,6 @@ CMICmdArgValString::CMICmdArgValString(const CMIUtilString &vrArgName, m_bHandleDirPaths(vbHandleDirPaths), m_bHandleAnything(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValString destructor. // Type: Overridden. // Args: None. @@ -125,7 +119,6 @@ CMICmdArgValString::CMICmdArgValString(const CMIUtilString &vrArgName, CMICmdArgValString::~CMICmdArgValString() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. @@ -146,7 +139,6 @@ bool CMICmdArgValString::Validate(CMICmdArgContext &vrwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract only // the next // word delimited by the next space. @@ -180,7 +172,6 @@ bool CMICmdArgValString::ValidateSingleText(CMICmdArgContext &vrwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract all // the words // between quotes then delimited by the next space. @@ -212,7 +203,6 @@ bool CMICmdArgValString::ValidateQuotedText(CMICmdArgContext &vrwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Type: Method. @@ -232,7 +222,6 @@ bool CMICmdArgValString::IsStringArg(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument or // option value. If the string looks like a long option, short option, @@ -275,7 +264,6 @@ bool CMICmdArgValString::IsStringArgSingleText( } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Take into account quotes surrounding the text. Note this function @@ -326,7 +314,6 @@ bool CMICmdArgValString::IsStringArgQuotedText( } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Take into account quotes surrounding the text. Take into account @@ -365,7 +352,6 @@ bool CMICmdArgValString::IsStringArgQuotedTextEmbedded( } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Take into account quotes surrounding the text. Take into account diff --git a/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp b/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp index 00f90ce..201d516 100644 --- a/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp @@ -11,7 +11,6 @@ #include "MICmdArgContext.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValThreadGrp constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMICmdArgValThreadGrp::CMICmdArgValThreadGrp() : m_nThreadGrp(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValThreadGrp constructor. // Type: Method. // Args: vrArgName - (R) Argument's name to search by. @@ -39,7 +37,6 @@ CMICmdArgValThreadGrp::CMICmdArgValThreadGrp(const CMIUtilString &vrArgName, m_nThreadGrp(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdArgValThreadGrp destructor. // Type: Overridden. // Args: None. @@ -49,7 +46,6 @@ CMICmdArgValThreadGrp::CMICmdArgValThreadGrp(const CMIUtilString &vrArgName, CMICmdArgValThreadGrp::~CMICmdArgValThreadGrp() {} //++ -//------------------------------------------------------------------------------------ // Details: Parse the command's argument options string and try to extract the // value *this // argument is looking for. @@ -99,7 +95,6 @@ bool CMICmdArgValThreadGrp::Validate(CMICmdArgContext &vwArgContext) { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the string and determine if it is a valid string type // argument. // Type: Method. @@ -118,7 +113,6 @@ bool CMICmdArgValThreadGrp::IsArgThreadGrp(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Extract the thread group number from the thread group argument. // Type: Method. // Args: vrTxt - (R) Some text. @@ -138,7 +132,6 @@ bool CMICmdArgValThreadGrp::ExtractNumber(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the thread group ID found in the argument. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmdBase.cpp b/lldb/tools/lldb-mi/MICmdBase.cpp index 8bb2107..df36cfe 100644 --- a/lldb/tools/lldb-mi/MICmdBase.cpp +++ b/lldb/tools/lldb-mi/MICmdBase.cpp @@ -14,7 +14,6 @@ #include "MICmnMIValueConst.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdBase constructor. // Type: Method. // Args: None. @@ -30,7 +29,6 @@ CMICmdBase::CMICmdBase() m_ThreadArgMandatory(false), m_FrameArgMandatory(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdBase destructor. // Type: Overrideable. // Args: None. @@ -40,7 +38,6 @@ CMICmdBase::CMICmdBase() CMICmdBase::~CMICmdBase() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. // Type: Overridden. // Args: None. @@ -50,7 +47,6 @@ CMICmdBase::~CMICmdBase() {} const SMICmdData &CMICmdBase::GetCmdData() const { return m_cmdData; } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. // Type: Overridden. // Args: None. @@ -63,7 +59,6 @@ const CMIUtilString &CMICmdBase::GetErrorDescription() const { } //++ -//------------------------------------------------------------------------------------ // Details: The CMICmdFactory requires this function. Retrieve the command and // argument // options description string. @@ -75,7 +70,6 @@ const CMIUtilString &CMICmdBase::GetErrorDescription() const { const CMIUtilString &CMICmdBase::GetMiCmd() const { return m_strMiCmd; } //++ -//------------------------------------------------------------------------------------ // Details: Help parse the arguments that are common to all commands. // Args: None. // Return: None @@ -95,7 +89,6 @@ void CMICmdBase::AddCommonArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. A command must be given working // data and // provide data about its status or provide information to other @@ -110,7 +103,6 @@ void CMICmdBase::SetCmdData(const SMICmdData &vCmdData) { } //++ -//------------------------------------------------------------------------------------ // Details: The command factory requires this function. The factory calls this // function // so it can obtain *this command's creation function. @@ -124,7 +116,6 @@ CMICmdFactory::CmdCreatorFnPtr CMICmdBase::GetCmdCreatorFn() const { } //++ -//------------------------------------------------------------------------------------ // Details: If a command is an event type (has callbacks registered with // SBListener) it // needs to inform the Invoker that it has finished its work so that @@ -143,7 +134,6 @@ void CMICmdBase::CmdFinishedTellInvoker() const { } //++ -//------------------------------------------------------------------------------------ // Details: Returns the final version of the MI result record built up in the // command's // Acknowledge function. The one line text of MI result. @@ -157,7 +147,6 @@ const CMIUtilString &CMICmdBase::GetMIResultRecord() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve from the command additional MI result to its 1 line // response. // Because of using LLDB additional 'fake'/hack output is sometimes @@ -173,7 +162,6 @@ const CMIUtilString &CMICmdBase::GetMIResultRecordExtra() const { } //++ -//------------------------------------------------------------------------------------ // Details: Hss *this command got additional MI result to its 1 line response. // Because of using LLDB additional 'fake'/hack output is sometimes // required to @@ -189,7 +177,6 @@ bool CMICmdBase::HasMIResultRecordExtra() const { } //++ -//------------------------------------------------------------------------------------ // Details: Short cut function to enter error information into the command's // metadata // object and set the command's error status. @@ -212,7 +199,6 @@ void CMICmdBase::SetError(const CMIUtilString &rErrMsg) { } //++ -//------------------------------------------------------------------------------------ // Details: Short cut function to check MI command's execute status and // set an error in case of failure. // Type: Method. @@ -236,7 +222,6 @@ bool CMICmdBase::HandleSBError(const lldb::SBError &error, } //++ -//------------------------------------------------------------------------------------ // Details: Short cut function to check MI command's execute status and // call specified handler function for success case. // Type: Method. @@ -253,7 +238,6 @@ bool CMICmdBase::HandleSBErrorWithSuccess( } //++ -//------------------------------------------------------------------------------------ // Details: Short cut function to check MI command's execute status and // call specified handler function for error case. // Type: Method. @@ -270,7 +254,6 @@ bool CMICmdBase::HandleSBErrorWithFailure( } //++ -//------------------------------------------------------------------------------------ // Details: Ask a command to provide its unique identifier. // Type: Method. // Args: A unique identifier for this command class. @@ -286,7 +269,6 @@ MIuint CMICmdBase::GetGUID() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -303,7 +285,6 @@ bool CMICmdBase::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: Having previously given CMICmdArgSet m_setCmdArgs all the argument // or option // definitions for the command to handle proceed to parse and validate @@ -330,7 +311,6 @@ bool CMICmdBase::ParseValidateCmdOptions() { } //++ -//------------------------------------------------------------------------------------ // Details: If the MI Driver is not operating via a client i.e. Eclipse but say // operating // on a executable passed in as a argument to the drive then what diff --git a/lldb/tools/lldb-mi/MICmdBase.h b/lldb/tools/lldb-mi/MICmdBase.h index 72d73c3..4e32ed6 100644 --- a/lldb/tools/lldb-mi/MICmdBase.h +++ b/lldb/tools/lldb-mi/MICmdBase.h @@ -136,7 +136,6 @@ protected: }; //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the command argument or option object pointer so that it // can be // examined. If the option found and valid get the value (number, @@ -170,7 +169,6 @@ T *CMICmdBase::GetOption(const CMIUtilString &vStrOptionName) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the command argument or option object pointer using // template function // CMICmdBase::GetOption(). Should the argument (by name) not be found diff --git a/lldb/tools/lldb-mi/MICmdCmd.cpp b/lldb/tools/lldb-mi/MICmdCmd.cpp index a403020..081cff6f 100644 --- a/lldb/tools/lldb-mi/MICmdCmd.cpp +++ b/lldb/tools/lldb-mi/MICmdCmd.cpp @@ -14,7 +14,6 @@ #include "MICmdCmd.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdEnablePrettyPrinting constructor. // Type: Method. // Args: None. @@ -30,7 +29,6 @@ CMICmdCmdEnablePrettyPrinting::CMICmdCmdEnablePrettyPrinting() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdEnablePrettyPrinting destructor. // Type: Overrideable. // Args: None. @@ -40,7 +38,6 @@ CMICmdCmdEnablePrettyPrinting::CMICmdCmdEnablePrettyPrinting() { CMICmdCmdEnablePrettyPrinting::~CMICmdCmdEnablePrettyPrinting() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -57,7 +54,6 @@ bool CMICmdCmdEnablePrettyPrinting::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -79,7 +75,6 @@ bool CMICmdCmdEnablePrettyPrinting::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -92,12 +87,8 @@ CMICmdBase *CMICmdCmdEnablePrettyPrinting::CreateSelf() { return new CMICmdCmdEnablePrettyPrinting(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSource constructor. // Type: Method. // Args: None. @@ -113,7 +104,6 @@ CMICmdCmdSource::CMICmdCmdSource() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSource destructor. // Type: Overrideable. // Args: None. @@ -123,7 +113,6 @@ CMICmdCmdSource::CMICmdCmdSource() { CMICmdCmdSource::~CMICmdCmdSource() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -140,7 +129,6 @@ bool CMICmdCmdSource::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -159,7 +147,6 @@ bool CMICmdCmdSource::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdBreak.cpp b/lldb/tools/lldb-mi/MICmdCmdBreak.cpp index 98feea8..1cd0bac 100644 --- a/lldb/tools/lldb-mi/MICmdCmdBreak.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdBreak.cpp @@ -33,7 +33,6 @@ #include "MICmnStreamStdout.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakInsert constructor. // Type: Method. // Args: None. @@ -57,7 +56,6 @@ CMICmdCmdBreakInsert::CMICmdCmdBreakInsert() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakInsert destructor. // Type: Overrideable. // Args: None. @@ -67,7 +65,6 @@ CMICmdCmdBreakInsert::CMICmdCmdBreakInsert() CMICmdCmdBreakInsert::~CMICmdCmdBreakInsert() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -104,7 +101,6 @@ bool CMICmdCmdBreakInsert::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Helper function for CMICmdCmdBreakInsert::Execute(). // // Given a string, return the position of the ':' separator in 'file:func' @@ -122,7 +118,6 @@ static size_t findFileSeparatorPos(const std::string &x) { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -323,7 +318,6 @@ bool CMICmdCmdBreakInsert::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -359,7 +353,6 @@ bool CMICmdCmdBreakInsert::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -372,12 +365,8 @@ CMICmdBase *CMICmdCmdBreakInsert::CreateSelf() { return new CMICmdCmdBreakInsert(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakDelete constructor. // Type: Method. // Args: None. @@ -394,7 +383,6 @@ CMICmdCmdBreakDelete::CMICmdCmdBreakDelete() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakDelete destructor. // Type: Overrideable. // Args: None. @@ -404,7 +392,6 @@ CMICmdCmdBreakDelete::CMICmdCmdBreakDelete() CMICmdCmdBreakDelete::~CMICmdCmdBreakDelete() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -422,7 +409,6 @@ bool CMICmdCmdBreakDelete::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -461,7 +447,6 @@ bool CMICmdCmdBreakDelete::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -480,7 +465,6 @@ bool CMICmdCmdBreakDelete::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -493,12 +477,8 @@ CMICmdBase *CMICmdCmdBreakDelete::CreateSelf() { return new CMICmdCmdBreakDelete(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakDisable constructor. // Type: Method. // Args: None. @@ -516,7 +496,6 @@ CMICmdCmdBreakDisable::CMICmdCmdBreakDisable() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakDisable destructor. // Type: Overrideable. // Args: None. @@ -526,7 +505,6 @@ CMICmdCmdBreakDisable::CMICmdCmdBreakDisable() CMICmdCmdBreakDisable::~CMICmdCmdBreakDisable() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -544,7 +522,6 @@ bool CMICmdCmdBreakDisable::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -581,7 +558,6 @@ bool CMICmdCmdBreakDisable::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -612,7 +588,6 @@ bool CMICmdCmdBreakDisable::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -625,12 +600,8 @@ CMICmdBase *CMICmdCmdBreakDisable::CreateSelf() { return new CMICmdCmdBreakDisable(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakEnable constructor. // Type: Method. // Args: None. @@ -648,7 +619,6 @@ CMICmdCmdBreakEnable::CMICmdCmdBreakEnable() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakEnable destructor. // Type: Overrideable. // Args: None. @@ -658,7 +628,6 @@ CMICmdCmdBreakEnable::CMICmdCmdBreakEnable() CMICmdCmdBreakEnable::~CMICmdCmdBreakEnable() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -676,7 +645,6 @@ bool CMICmdCmdBreakEnable::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -713,7 +681,6 @@ bool CMICmdCmdBreakEnable::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -744,7 +711,6 @@ bool CMICmdCmdBreakEnable::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -757,12 +723,8 @@ CMICmdBase *CMICmdCmdBreakEnable::CreateSelf() { return new CMICmdCmdBreakEnable(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakAfter constructor. // Type: Method. // Args: None. @@ -780,7 +742,6 @@ CMICmdCmdBreakAfter::CMICmdCmdBreakAfter() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakAfter destructor. // Type: Overrideable. // Args: None. @@ -790,7 +751,6 @@ CMICmdCmdBreakAfter::CMICmdCmdBreakAfter() CMICmdCmdBreakAfter::~CMICmdCmdBreakAfter() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -808,7 +768,6 @@ bool CMICmdCmdBreakAfter::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -854,7 +813,6 @@ bool CMICmdCmdBreakAfter::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -873,7 +831,6 @@ bool CMICmdCmdBreakAfter::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -886,12 +843,8 @@ CMICmdBase *CMICmdCmdBreakAfter::CreateSelf() { return new CMICmdCmdBreakAfter(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakCondition constructor. // Type: Method. // Args: None. @@ -914,7 +867,6 @@ CMICmdCmdBreakCondition::CMICmdCmdBreakCondition() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdBreakCondition destructor. // Type: Overrideable. // Args: None. @@ -924,7 +876,6 @@ CMICmdCmdBreakCondition::CMICmdCmdBreakCondition() CMICmdCmdBreakCondition::~CMICmdCmdBreakCondition() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -946,7 +897,6 @@ bool CMICmdCmdBreakCondition::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -993,7 +943,6 @@ bool CMICmdCmdBreakCondition::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1012,7 +961,6 @@ bool CMICmdCmdBreakCondition::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1026,7 +974,6 @@ CMICmdBase *CMICmdCmdBreakCondition::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: A breakpoint expression can be passed to *this command as: // a single string i.e. '2' -> ok. // a quoted string i.e. "a > 100" -> ok diff --git a/lldb/tools/lldb-mi/MICmdCmdData.cpp b/lldb/tools/lldb-mi/MICmdCmdData.cpp index afc68a8..ae54b95 100644 --- a/lldb/tools/lldb-mi/MICmdCmdData.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdData.cpp @@ -52,7 +52,6 @@ CMIUtilString IntToHexAddrStr(uint32_t number) { } // namespace //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataEvaluateExpression constructor. // Type: Method. // Args: None. @@ -71,7 +70,6 @@ CMICmdCmdDataEvaluateExpression::CMICmdCmdDataEvaluateExpression() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataEvaluateExpression destructor. // Type: Overrideable. // Args: None. @@ -81,7 +79,6 @@ CMICmdCmdDataEvaluateExpression::CMICmdCmdDataEvaluateExpression() CMICmdCmdDataEvaluateExpression::~CMICmdCmdDataEvaluateExpression() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -98,7 +95,6 @@ bool CMICmdCmdDataEvaluateExpression::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -150,7 +146,6 @@ bool CMICmdCmdDataEvaluateExpression::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -205,7 +200,6 @@ bool CMICmdCmdDataEvaluateExpression::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -219,7 +213,6 @@ CMICmdBase *CMICmdCmdDataEvaluateExpression::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the expression string to see if it contains invalid // characters. // Type: Method. @@ -241,12 +234,8 @@ bool CMICmdCmdDataEvaluateExpression::HaveInvalidCharacterInExpression( return bFoundInvalidCharInExpression; } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataDisassemble constructor. // Type: Method. // Args: None. @@ -264,7 +253,6 @@ CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataDisassemble destructor. // Type: Overrideable. // Args: None. @@ -274,7 +262,6 @@ CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble() CMICmdCmdDataDisassemble::~CMICmdCmdDataDisassemble() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -296,7 +283,6 @@ bool CMICmdCmdDataDisassemble::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -439,7 +425,6 @@ bool CMICmdCmdDataDisassemble::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -460,7 +445,6 @@ bool CMICmdCmdDataDisassemble::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -473,12 +457,8 @@ CMICmdBase *CMICmdCmdDataDisassemble::CreateSelf() { return new CMICmdCmdDataDisassemble(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemoryBytes constructor. // Type: Method. // Args: None. @@ -497,7 +477,6 @@ CMICmdCmdDataReadMemoryBytes::CMICmdCmdDataReadMemoryBytes() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemoryBytes destructor. // Type: Overrideable. // Args: None. @@ -512,7 +491,6 @@ CMICmdCmdDataReadMemoryBytes::~CMICmdCmdDataReadMemoryBytes() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -533,7 +511,6 @@ bool CMICmdCmdDataReadMemoryBytes::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -663,7 +640,6 @@ bool CMICmdCmdDataReadMemoryBytes::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -711,7 +687,6 @@ bool CMICmdCmdDataReadMemoryBytes::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -724,12 +699,8 @@ CMICmdBase *CMICmdCmdDataReadMemoryBytes::CreateSelf() { return new CMICmdCmdDataReadMemoryBytes(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemory constructor. // Type: Method. // Args: None. @@ -745,7 +716,6 @@ CMICmdCmdDataReadMemory::CMICmdCmdDataReadMemory() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemory destructor. // Type: Overrideable. // Args: None. @@ -755,7 +725,6 @@ CMICmdCmdDataReadMemory::CMICmdCmdDataReadMemory() { CMICmdCmdDataReadMemory::~CMICmdCmdDataReadMemory() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -772,7 +741,6 @@ bool CMICmdCmdDataReadMemory::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -797,7 +765,6 @@ bool CMICmdCmdDataReadMemory::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -810,12 +777,8 @@ CMICmdBase *CMICmdCmdDataReadMemory::CreateSelf() { return new CMICmdCmdDataReadMemory(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterNames constructor. // Type: Method. // Args: None. @@ -832,7 +795,6 @@ CMICmdCmdDataListRegisterNames::CMICmdCmdDataListRegisterNames() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemoryBytes destructor. // Type: Overrideable. // Args: None. @@ -842,7 +804,6 @@ CMICmdCmdDataListRegisterNames::CMICmdCmdDataListRegisterNames() CMICmdCmdDataListRegisterNames::~CMICmdCmdDataListRegisterNames() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -860,7 +821,6 @@ bool CMICmdCmdDataListRegisterNames::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -925,7 +885,6 @@ bool CMICmdCmdDataListRegisterNames::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -946,7 +905,6 @@ bool CMICmdCmdDataListRegisterNames::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -960,7 +918,6 @@ CMICmdBase *CMICmdCmdDataListRegisterNames::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -994,12 +951,8 @@ CMICmdCmdDataListRegisterNames::GetRegister(const MIuint vRegisterIndex) const { return lldb::SBValue(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterValues constructor. // Type: Method. // Args: None. @@ -1017,7 +970,6 @@ CMICmdCmdDataListRegisterValues::CMICmdCmdDataListRegisterValues() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterValues destructor. // Type: Overrideable. // Args: None. @@ -1027,7 +979,6 @@ CMICmdCmdDataListRegisterValues::CMICmdCmdDataListRegisterValues() CMICmdCmdDataListRegisterValues::~CMICmdCmdDataListRegisterValues() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1050,7 +1001,6 @@ bool CMICmdCmdDataListRegisterValues::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1132,7 +1082,6 @@ bool CMICmdCmdDataListRegisterValues::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1153,7 +1102,6 @@ bool CMICmdCmdDataListRegisterValues::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1167,7 +1115,6 @@ CMICmdBase *CMICmdCmdDataListRegisterValues::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1202,7 +1149,6 @@ lldb::SBValue CMICmdCmdDataListRegisterValues::GetRegister( } //++ -//------------------------------------------------------------------------------------ // Details: Adds the register value to the output list. // Type: Method. // Args: Value of the register, its index and output format. @@ -1224,12 +1170,8 @@ void CMICmdCmdDataListRegisterValues::AddToOutput( m_miValueList.Add(miValueTuple); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterChanged constructor. // Type: Method. // Args: None. @@ -1245,7 +1187,6 @@ CMICmdCmdDataListRegisterChanged::CMICmdCmdDataListRegisterChanged() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterChanged destructor. // Type: Overrideable. // Args: None. @@ -1255,7 +1196,6 @@ CMICmdCmdDataListRegisterChanged::CMICmdCmdDataListRegisterChanged() { CMICmdCmdDataListRegisterChanged::~CMICmdCmdDataListRegisterChanged() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1273,7 +1213,6 @@ bool CMICmdCmdDataListRegisterChanged::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1295,7 +1234,6 @@ bool CMICmdCmdDataListRegisterChanged::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1308,12 +1246,8 @@ CMICmdBase *CMICmdCmdDataListRegisterChanged::CreateSelf() { return new CMICmdCmdDataListRegisterChanged(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemoryBytes constructor. // Type: Method. // Args: None. @@ -1331,7 +1265,6 @@ CMICmdCmdDataWriteMemoryBytes::CMICmdCmdDataWriteMemoryBytes() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemoryBytes destructor. // Type: Overrideable. // Args: None. @@ -1341,7 +1274,6 @@ CMICmdCmdDataWriteMemoryBytes::CMICmdCmdDataWriteMemoryBytes() CMICmdCmdDataWriteMemoryBytes::~CMICmdCmdDataWriteMemoryBytes() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1362,7 +1294,6 @@ bool CMICmdCmdDataWriteMemoryBytes::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1387,7 +1318,6 @@ bool CMICmdCmdDataWriteMemoryBytes::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1409,7 +1339,6 @@ bool CMICmdCmdDataWriteMemoryBytes::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1422,12 +1351,8 @@ CMICmdBase *CMICmdCmdDataWriteMemoryBytes::CreateSelf() { return new CMICmdCmdDataWriteMemoryBytes(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemory constructor. // Type: Method. // Args: None. @@ -1447,7 +1372,6 @@ CMICmdCmdDataWriteMemory::CMICmdCmdDataWriteMemory() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemory destructor. // Type: Overrideable. // Args: None. @@ -1462,7 +1386,6 @@ CMICmdCmdDataWriteMemory::~CMICmdCmdDataWriteMemory() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1484,7 +1407,6 @@ bool CMICmdCmdDataWriteMemory::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1548,7 +1470,6 @@ bool CMICmdCmdDataWriteMemory::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1567,7 +1488,6 @@ bool CMICmdCmdDataWriteMemory::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1580,12 +1500,8 @@ CMICmdBase *CMICmdCmdDataWriteMemory::CreateSelf() { return new CMICmdCmdDataWriteMemory(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataInfoLine constructor. // Type: Method. // Args: None. @@ -1604,7 +1520,6 @@ CMICmdCmdDataInfoLine::CMICmdCmdDataInfoLine() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataInfoLine destructor. // Type: Overrideable. // Args: None. @@ -1614,7 +1529,6 @@ CMICmdCmdDataInfoLine::CMICmdCmdDataInfoLine() CMICmdCmdDataInfoLine::~CMICmdCmdDataInfoLine() = default; //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1630,7 +1544,6 @@ bool CMICmdCmdDataInfoLine::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1725,7 +1638,6 @@ bool CMICmdCmdDataInfoLine::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1741,7 +1653,6 @@ bool CMICmdCmdDataInfoLine::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdEnviro.cpp b/lldb/tools/lldb-mi/MICmdCmdEnviro.cpp index 71fa618..e7a92f3 100644 --- a/lldb/tools/lldb-mi/MICmdCmdEnviro.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdEnviro.cpp @@ -17,7 +17,6 @@ #include "MICmnMIValueConst.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdEnvironmentCd constructor. // Type: Method. // Args: None. @@ -34,7 +33,6 @@ CMICmdCmdEnvironmentCd::CMICmdCmdEnvironmentCd() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdEnvironmentCd destructor. // Type: Overrideable. // Args: None. @@ -44,7 +42,6 @@ CMICmdCmdEnvironmentCd::CMICmdCmdEnvironmentCd() CMICmdCmdEnvironmentCd::~CMICmdCmdEnvironmentCd() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -61,7 +58,6 @@ bool CMICmdCmdEnvironmentCd::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -104,7 +100,6 @@ bool CMICmdCmdEnvironmentCd::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -137,7 +132,6 @@ bool CMICmdCmdEnvironmentCd::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdExec.cpp b/lldb/tools/lldb-mi/MICmdCmdExec.cpp index 960c0bb..fd13a91 100644 --- a/lldb/tools/lldb-mi/MICmdCmdExec.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdExec.cpp @@ -41,7 +41,6 @@ #include "MIDriver.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecRun constructor. // Type: Method. // Args: None. @@ -57,7 +56,6 @@ CMICmdCmdExecRun::CMICmdCmdExecRun() : m_constStrArgStart("start") { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecRun destructor. // Type: Overrideable. // Args: None. @@ -67,7 +65,6 @@ CMICmdCmdExecRun::CMICmdCmdExecRun() : m_constStrArgStart("start") { CMICmdCmdExecRun::~CMICmdCmdExecRun() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. It parses the command line // options' // arguments to extract values for each of those arguments. @@ -85,7 +82,6 @@ bool CMICmdCmdExecRun::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -147,7 +143,6 @@ bool CMICmdCmdExecRun::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -181,7 +176,6 @@ bool CMICmdCmdExecRun::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -192,12 +186,8 @@ bool CMICmdCmdExecRun::Acknowledge() { //-- CMICmdBase *CMICmdCmdExecRun::CreateSelf() { return new CMICmdCmdExecRun(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecContinue constructor. // Type: Method. // Args: None. @@ -213,7 +203,6 @@ CMICmdCmdExecContinue::CMICmdCmdExecContinue() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecContinue destructor. // Type: Overrideable. // Args: None. @@ -223,7 +212,6 @@ CMICmdCmdExecContinue::CMICmdCmdExecContinue() { CMICmdCmdExecContinue::~CMICmdCmdExecContinue() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -253,7 +241,6 @@ bool CMICmdCmdExecContinue::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -270,7 +257,6 @@ bool CMICmdCmdExecContinue::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -283,12 +269,8 @@ CMICmdBase *CMICmdCmdExecContinue::CreateSelf() { return new CMICmdCmdExecContinue(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecNext constructor. // Type: Method. // Args: None. @@ -304,7 +286,6 @@ CMICmdCmdExecNext::CMICmdCmdExecNext() : m_constStrArgNumber("number") { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecNext destructor. // Type: Overrideable. // Args: None. @@ -314,7 +295,6 @@ CMICmdCmdExecNext::CMICmdCmdExecNext() : m_constStrArgNumber("number") { CMICmdCmdExecNext::~CMICmdCmdExecNext() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -330,7 +310,6 @@ bool CMICmdCmdExecNext::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -375,7 +354,6 @@ bool CMICmdCmdExecNext::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -392,7 +370,6 @@ bool CMICmdCmdExecNext::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -403,12 +380,8 @@ bool CMICmdCmdExecNext::Acknowledge() { //-- CMICmdBase *CMICmdCmdExecNext::CreateSelf() { return new CMICmdCmdExecNext(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecStep constructor. // Type: Method. // Args: None. @@ -424,7 +397,6 @@ CMICmdCmdExecStep::CMICmdCmdExecStep() : m_constStrArgNumber("number") { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecStep destructor. // Type: Overrideable. // Args: None. @@ -434,7 +406,6 @@ CMICmdCmdExecStep::CMICmdCmdExecStep() : m_constStrArgNumber("number") { CMICmdCmdExecStep::~CMICmdCmdExecStep() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -450,7 +421,6 @@ bool CMICmdCmdExecStep::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -496,7 +466,6 @@ bool CMICmdCmdExecStep::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -513,7 +482,6 @@ bool CMICmdCmdExecStep::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -524,12 +492,8 @@ bool CMICmdCmdExecStep::Acknowledge() { //-- CMICmdBase *CMICmdCmdExecStep::CreateSelf() { return new CMICmdCmdExecStep(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecNextInstruction constructor. // Type: Method. // Args: None. @@ -546,7 +510,6 @@ CMICmdCmdExecNextInstruction::CMICmdCmdExecNextInstruction() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecNextInstruction destructor. // Type: Overrideable. // Args: None. @@ -556,7 +519,6 @@ CMICmdCmdExecNextInstruction::CMICmdCmdExecNextInstruction() CMICmdCmdExecNextInstruction::~CMICmdCmdExecNextInstruction() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -572,7 +534,6 @@ bool CMICmdCmdExecNextInstruction::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -618,7 +579,6 @@ bool CMICmdCmdExecNextInstruction::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -635,7 +595,6 @@ bool CMICmdCmdExecNextInstruction::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -648,12 +607,8 @@ CMICmdBase *CMICmdCmdExecNextInstruction::CreateSelf() { return new CMICmdCmdExecNextInstruction(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecStepInstruction constructor. // Type: Method. // Args: None. @@ -670,7 +625,6 @@ CMICmdCmdExecStepInstruction::CMICmdCmdExecStepInstruction() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecStepInstruction destructor. // Type: Overrideable. // Args: None. @@ -680,7 +634,6 @@ CMICmdCmdExecStepInstruction::CMICmdCmdExecStepInstruction() CMICmdCmdExecStepInstruction::~CMICmdCmdExecStepInstruction() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -696,7 +649,6 @@ bool CMICmdCmdExecStepInstruction::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -742,7 +694,6 @@ bool CMICmdCmdExecStepInstruction::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -759,7 +710,6 @@ bool CMICmdCmdExecStepInstruction::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -772,12 +722,8 @@ CMICmdBase *CMICmdCmdExecStepInstruction::CreateSelf() { return new CMICmdCmdExecStepInstruction(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecFinish constructor. // Type: Method. // Args: None. @@ -793,7 +739,6 @@ CMICmdCmdExecFinish::CMICmdCmdExecFinish() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecFinish destructor. // Type: Overrideable. // Args: None. @@ -803,7 +748,6 @@ CMICmdCmdExecFinish::CMICmdCmdExecFinish() { CMICmdCmdExecFinish::~CMICmdCmdExecFinish() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -816,7 +760,6 @@ CMICmdCmdExecFinish::~CMICmdCmdExecFinish() {} bool CMICmdCmdExecFinish::ParseArgs() { return ParseValidateCmdOptions(); } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -861,7 +804,6 @@ bool CMICmdCmdExecFinish::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -878,7 +820,6 @@ bool CMICmdCmdExecFinish::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -891,12 +832,8 @@ CMICmdBase *CMICmdCmdExecFinish::CreateSelf() { return new CMICmdCmdExecFinish(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecInterrupt constructor. // Type: Method. // Args: None. @@ -912,7 +849,6 @@ CMICmdCmdExecInterrupt::CMICmdCmdExecInterrupt() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecInterrupt destructor. // Type: Overrideable. // Args: None. @@ -922,7 +858,6 @@ CMICmdCmdExecInterrupt::CMICmdCmdExecInterrupt() { CMICmdCmdExecInterrupt::~CMICmdCmdExecInterrupt() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -953,7 +888,6 @@ bool CMICmdCmdExecInterrupt::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -970,7 +904,6 @@ bool CMICmdCmdExecInterrupt::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -983,12 +916,8 @@ CMICmdBase *CMICmdCmdExecInterrupt::CreateSelf() { return new CMICmdCmdExecInterrupt(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecArguments constructor. // Type: Method. // Args: None. @@ -1005,7 +934,6 @@ CMICmdCmdExecArguments::CMICmdCmdExecArguments() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecArguments destructor. // Type: Overrideable. // Args: None. @@ -1015,7 +943,6 @@ CMICmdCmdExecArguments::CMICmdCmdExecArguments() CMICmdCmdExecArguments::~CMICmdCmdExecArguments() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1033,7 +960,6 @@ bool CMICmdCmdExecArguments::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1074,7 +1000,6 @@ bool CMICmdCmdExecArguments::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1091,7 +1016,6 @@ bool CMICmdCmdExecArguments::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1104,12 +1028,8 @@ CMICmdBase *CMICmdCmdExecArguments::CreateSelf() { return new CMICmdCmdExecArguments(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecAbort constructor. // Type: Method. // Args: None. @@ -1125,7 +1045,6 @@ CMICmdCmdExecAbort::CMICmdCmdExecAbort() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdExecAbort destructor. // Type: Overrideable. // Args: None. @@ -1135,7 +1054,6 @@ CMICmdCmdExecAbort::CMICmdCmdExecAbort() { CMICmdCmdExecAbort::~CMICmdCmdExecAbort() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1168,7 +1086,6 @@ bool CMICmdCmdExecAbort::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1185,7 +1102,6 @@ bool CMICmdCmdExecAbort::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdFile.cpp b/lldb/tools/lldb-mi/MICmdCmdFile.cpp index 7b13209..8b105eb1 100644 --- a/lldb/tools/lldb-mi/MICmdCmdFile.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdFile.cpp @@ -23,7 +23,6 @@ #include "MIUtilFileStd.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdFileExecAndSymbols constructor. // Type: Method. // Args: None. @@ -41,7 +40,6 @@ CMICmdCmdFileExecAndSymbols::CMICmdCmdFileExecAndSymbols() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdFileExecAndSymbols destructor. // Type: Overrideable. // Args: None. @@ -51,7 +49,6 @@ CMICmdCmdFileExecAndSymbols::CMICmdCmdFileExecAndSymbols() CMICmdCmdFileExecAndSymbols::~CMICmdCmdFileExecAndSymbols() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -73,7 +70,6 @@ bool CMICmdCmdFileExecAndSymbols::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -159,7 +155,6 @@ bool CMICmdCmdFileExecAndSymbols::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -178,7 +173,6 @@ bool CMICmdCmdFileExecAndSymbols::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -192,7 +186,6 @@ CMICmdBase *CMICmdCmdFileExecAndSymbols::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: If the MI Driver is not operating via a client i.e. Eclipse but say // operating // on a executable passed in as a argument to the drive then what diff --git a/lldb/tools/lldb-mi/MICmdCmdGdbInfo.cpp b/lldb/tools/lldb-mi/MICmdCmdGdbInfo.cpp index 2039616..b351353 100644 --- a/lldb/tools/lldb-mi/MICmdCmdGdbInfo.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdGdbInfo.cpp @@ -26,7 +26,6 @@ const CMICmdCmdGdbInfo::MapPrintFnNameToPrintFn_t {"sharedlibrary", &CMICmdCmdGdbInfo::PrintFnSharedLibrary}}; //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbInfo constructor. // Type: Method. // Args: None. @@ -45,7 +44,6 @@ CMICmdCmdGdbInfo::CMICmdCmdGdbInfo() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbInfo destructor. // Type: Overrideable. // Args: None. @@ -55,7 +53,6 @@ CMICmdCmdGdbInfo::CMICmdCmdGdbInfo() CMICmdCmdGdbInfo::~CMICmdCmdGdbInfo() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -71,7 +68,6 @@ bool CMICmdCmdGdbInfo::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -99,7 +95,6 @@ bool CMICmdCmdGdbInfo::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -140,7 +135,6 @@ bool CMICmdCmdGdbInfo::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -152,7 +146,6 @@ bool CMICmdCmdGdbInfo::Acknowledge() { CMICmdBase *CMICmdCmdGdbInfo::CreateSelf() { return new CMICmdCmdGdbInfo(); } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the print function's pointer for the matching print // request. // Type: Method. @@ -177,7 +170,6 @@ bool CMICmdCmdGdbInfo::GetPrintFn(const CMIUtilString &vrPrintFnName, } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the request to prepare and send back // information // asked for. diff --git a/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp b/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp index c99c217..162e3d5 100644 --- a/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp @@ -31,7 +31,6 @@ const CMICmdCmdGdbSet::MapGdbOptionNameToFnGdbOptionPtr_t {"breakpoint", &CMICmdCmdGdbSet::OptionFnBreakpoint}}; //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbSet constructor. // Type: Method. // Args: None. @@ -50,7 +49,6 @@ CMICmdCmdGdbSet::CMICmdCmdGdbSet() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbSet destructor. // Type: Overrideable. // Args: None. @@ -60,7 +58,6 @@ CMICmdCmdGdbSet::CMICmdCmdGdbSet() CMICmdCmdGdbSet::~CMICmdCmdGdbSet() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -78,7 +75,6 @@ bool CMICmdCmdGdbSet::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command is executed in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -132,7 +128,6 @@ bool CMICmdCmdGdbSet::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute() method. @@ -179,7 +174,6 @@ bool CMICmdCmdGdbSet::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -191,7 +185,6 @@ bool CMICmdCmdGdbSet::Acknowledge() { CMICmdBase *CMICmdCmdGdbSet::CreateSelf() { return new CMICmdCmdGdbSet(); } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the print function's pointer for the matching print // request. // Type: Method. @@ -216,7 +209,6 @@ bool CMICmdCmdGdbSet::GetOptionFn(const CMIUtilString &vrPrintFnName, } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option 'target-async' to // prepare // and send back information asked for. @@ -261,7 +253,6 @@ bool CMICmdCmdGdbSet::OptionFnTargetAsync( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option // 'print-char-array-as-string' to // prepare and send back information asked for. @@ -312,7 +303,6 @@ bool CMICmdCmdGdbSet::OptionFnPrint(const CMIUtilString::VecString_t &vrWords) { } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option 'solib-search-path' to // prepare // and send back information asked for. @@ -348,7 +338,6 @@ bool CMICmdCmdGdbSet::OptionFnSolibSearchPath( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option 'output-radix' to // prepare // and send back information asked for. @@ -399,7 +388,6 @@ bool CMICmdCmdGdbSet::OptionFnOutputRadix( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option 'disassembly-flavor' // to prepare // and send back information asked for. @@ -432,7 +420,6 @@ bool CMICmdCmdGdbSet::OptionFnDisassemblyFlavor( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option 'breakpoint' to // prepare // and send back information asked for. @@ -482,7 +469,6 @@ bool CMICmdCmdGdbSet::OptionFnBreakpoint( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option to prepare and send // back the // requested information. diff --git a/lldb/tools/lldb-mi/MICmdCmdGdbShow.cpp b/lldb/tools/lldb-mi/MICmdCmdGdbShow.cpp index 58f626d..9ebd362 100644 --- a/lldb/tools/lldb-mi/MICmdCmdGdbShow.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdGdbShow.cpp @@ -35,7 +35,6 @@ const CMICmdCmdGdbShow::MapGdbOptionNameToFnGdbOptionPtr_t {"breakpoint", &CMICmdCmdGdbShow::OptionFnBreakpoint}}; //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbShow constructor. // Type: Method. // Args: None. @@ -54,7 +53,6 @@ CMICmdCmdGdbShow::CMICmdCmdGdbShow() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbShow destructor. // Type: Overrideable. // Args: None. @@ -64,7 +62,6 @@ CMICmdCmdGdbShow::CMICmdCmdGdbShow() CMICmdCmdGdbShow::~CMICmdCmdGdbShow() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -82,7 +79,6 @@ bool CMICmdCmdGdbShow::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command is executed in this // function. // Type: Overridden. @@ -134,7 +130,6 @@ bool CMICmdCmdGdbShow::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute() method. @@ -190,7 +185,6 @@ bool CMICmdCmdGdbShow::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -202,7 +196,6 @@ bool CMICmdCmdGdbShow::Acknowledge() { CMICmdBase *CMICmdCmdGdbShow::CreateSelf() { return new CMICmdCmdGdbShow(); } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the print function's pointer for the matching print // request. // Type: Method. @@ -227,7 +220,6 @@ bool CMICmdCmdGdbShow::GetOptionFn(const CMIUtilString &vrPrintFnName, } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB show option 'target-async' to // prepare // and send back the requested information. @@ -251,7 +243,6 @@ bool CMICmdCmdGdbShow::OptionFnTargetAsync( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB show option 'print' to prepare // and send // back the requested information. @@ -302,7 +293,6 @@ bool CMICmdCmdGdbShow::OptionFnPrint( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB show option 'language' to prepare // and send back the requested information. // Type: Method. @@ -328,7 +318,6 @@ bool CMICmdCmdGdbShow::OptionFnLanguage( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB show option 'disassembly-flavor' to prepare // and send back the requested information. // Type: Method. @@ -348,7 +337,6 @@ bool CMICmdCmdGdbShow::OptionFnDisassemblyFlavor(const CMIUtilString::VecString_ } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB show option 'breakpoint' to // prepare // and send back the requested information. @@ -385,7 +373,6 @@ bool CMICmdCmdGdbShow::OptionFnBreakpoint( } //++ -//------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB show option to prepare and send // back the // requested information. diff --git a/lldb/tools/lldb-mi/MICmdCmdGdbThread.cpp b/lldb/tools/lldb-mi/MICmdCmdGdbThread.cpp index 8a01225..132cf2c 100644 --- a/lldb/tools/lldb-mi/MICmdCmdGdbThread.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdGdbThread.cpp @@ -14,7 +14,6 @@ #include "MICmnMIValueConst.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbThread constructor. // Type: Method. // Args: None. @@ -30,7 +29,6 @@ CMICmdCmdGdbThread::CMICmdCmdGdbThread() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdThread destructor. // Type: Overrideable. // Args: None. @@ -40,7 +38,6 @@ CMICmdCmdGdbThread::CMICmdCmdGdbThread() { CMICmdCmdGdbThread::~CMICmdCmdGdbThread() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -58,7 +55,6 @@ bool CMICmdCmdGdbThread::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -80,7 +76,6 @@ bool CMICmdCmdGdbThread::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp b/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp index 9d644c8..5aa7959 100644 --- a/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdMiscellanous.cpp @@ -34,7 +34,6 @@ #include "MIDriverBase.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbExit constructor. // Type: Method. // Args: None. @@ -50,7 +49,6 @@ CMICmdCmdGdbExit::CMICmdCmdGdbExit() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdGdbExit destructor. // Type: Overrideable. // Args: None. @@ -60,7 +58,6 @@ CMICmdCmdGdbExit::CMICmdCmdGdbExit() { CMICmdCmdGdbExit::~CMICmdCmdGdbExit() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -80,7 +77,6 @@ bool CMICmdCmdGdbExit::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -109,7 +105,6 @@ bool CMICmdCmdGdbExit::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -120,12 +115,8 @@ bool CMICmdCmdGdbExit::Acknowledge() { //-- CMICmdBase *CMICmdCmdGdbExit::CreateSelf() { return new CMICmdCmdGdbExit(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdListThreadGroups constructor. // Type: Method. // Args: None. @@ -145,7 +136,6 @@ CMICmdCmdListThreadGroups::CMICmdCmdListThreadGroups() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdListThreadGroups destructor. // Type: Overrideable. // Args: None. @@ -157,7 +147,6 @@ CMICmdCmdListThreadGroups::~CMICmdCmdListThreadGroups() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -182,7 +171,6 @@ bool CMICmdCmdListThreadGroups::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -253,7 +241,6 @@ bool CMICmdCmdListThreadGroups::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -387,7 +374,6 @@ bool CMICmdCmdListThreadGroups::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -400,12 +386,8 @@ CMICmdBase *CMICmdCmdListThreadGroups::CreateSelf() { return new CMICmdCmdListThreadGroups(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdInterpreterExec constructor. // Type: Method. // Args: None. @@ -423,7 +405,6 @@ CMICmdCmdInterpreterExec::CMICmdCmdInterpreterExec() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdInterpreterExec destructor. // Type: Overrideable. // Args: None. @@ -433,7 +414,6 @@ CMICmdCmdInterpreterExec::CMICmdCmdInterpreterExec() CMICmdCmdInterpreterExec::~CMICmdCmdInterpreterExec() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -452,7 +432,6 @@ bool CMICmdCmdInterpreterExec::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -484,7 +463,6 @@ bool CMICmdCmdInterpreterExec::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -522,7 +500,6 @@ bool CMICmdCmdInterpreterExec::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -535,12 +512,8 @@ CMICmdBase *CMICmdCmdInterpreterExec::CreateSelf() { return new CMICmdCmdInterpreterExec(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdInferiorTtySet constructor. // Type: Method. // Args: None. @@ -556,7 +529,6 @@ CMICmdCmdInferiorTtySet::CMICmdCmdInferiorTtySet() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdInferiorTtySet destructor. // Type: Overrideable. // Args: None. @@ -566,7 +538,6 @@ CMICmdCmdInferiorTtySet::CMICmdCmdInferiorTtySet() { CMICmdCmdInferiorTtySet::~CMICmdCmdInferiorTtySet() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -584,7 +555,6 @@ bool CMICmdCmdInferiorTtySet::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -603,7 +573,6 @@ bool CMICmdCmdInferiorTtySet::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdStack.cpp b/lldb/tools/lldb-mi/MICmdCmdStack.cpp index 06b114f..599db37 100644 --- a/lldb/tools/lldb-mi/MICmdCmdStack.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdStack.cpp @@ -34,7 +34,6 @@ #include <algorithm> //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackInfoDepth constructor. // Type: Method. // Args: None. @@ -51,7 +50,6 @@ CMICmdCmdStackInfoDepth::CMICmdCmdStackInfoDepth() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackInfoDepth destructor. // Type: Overrideable. // Args: None. @@ -61,7 +59,6 @@ CMICmdCmdStackInfoDepth::CMICmdCmdStackInfoDepth() CMICmdCmdStackInfoDepth::~CMICmdCmdStackInfoDepth() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -77,7 +74,6 @@ bool CMICmdCmdStackInfoDepth::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -114,7 +110,6 @@ bool CMICmdCmdStackInfoDepth::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -137,7 +132,6 @@ bool CMICmdCmdStackInfoDepth::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -150,12 +144,8 @@ CMICmdBase *CMICmdCmdStackInfoDepth::CreateSelf() { return new CMICmdCmdStackInfoDepth(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackInfoFrame constructor. // Type: Method. // Args: None. @@ -171,7 +161,6 @@ CMICmdCmdStackInfoFrame::CMICmdCmdStackInfoFrame() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackInfoFrame destructor. // Type: Overrideable. // Args: None. @@ -181,7 +170,6 @@ CMICmdCmdStackInfoFrame::CMICmdCmdStackInfoFrame() { CMICmdCmdStackInfoFrame::~CMICmdCmdStackInfoFrame() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -194,7 +182,6 @@ CMICmdCmdStackInfoFrame::~CMICmdCmdStackInfoFrame() {} bool CMICmdCmdStackInfoFrame::ParseArgs() { return ParseValidateCmdOptions(); } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -227,7 +214,6 @@ bool CMICmdCmdStackInfoFrame::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -248,7 +234,6 @@ bool CMICmdCmdStackInfoFrame::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -261,12 +246,8 @@ CMICmdBase *CMICmdCmdStackInfoFrame::CreateSelf() { return new CMICmdCmdStackInfoFrame(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListFrames constructor. // Type: Method. // Args: None. @@ -284,7 +265,6 @@ CMICmdCmdStackListFrames::CMICmdCmdStackListFrames() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListFrames destructor. // Type: Overrideable. // Args: None. @@ -296,7 +276,6 @@ CMICmdCmdStackListFrames::~CMICmdCmdStackListFrames() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -313,7 +292,6 @@ bool CMICmdCmdStackListFrames::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -382,7 +360,6 @@ bool CMICmdCmdStackListFrames::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -438,7 +415,6 @@ bool CMICmdCmdStackListFrames::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -451,12 +427,8 @@ CMICmdBase *CMICmdCmdStackListFrames::CreateSelf() { return new CMICmdCmdStackListFrames(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListArguments constructor. // Type: Method. // Args: None. @@ -475,7 +447,6 @@ CMICmdCmdStackListArguments::CMICmdCmdStackListArguments() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListArguments destructor. // Type: Overrideable. // Args: None. @@ -485,7 +456,6 @@ CMICmdCmdStackListArguments::CMICmdCmdStackListArguments() CMICmdCmdStackListArguments::~CMICmdCmdStackListArguments() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -504,7 +474,6 @@ bool CMICmdCmdStackListArguments::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -598,7 +567,6 @@ bool CMICmdCmdStackListArguments::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -632,7 +600,6 @@ bool CMICmdCmdStackListArguments::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -645,12 +612,8 @@ CMICmdBase *CMICmdCmdStackListArguments::CreateSelf() { return new CMICmdCmdStackListArguments(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListLocals constructor. // Type: Method. // Args: None. @@ -668,7 +631,6 @@ CMICmdCmdStackListLocals::CMICmdCmdStackListLocals() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListLocals destructor. // Type: Overrideable. // Args: None. @@ -678,7 +640,6 @@ CMICmdCmdStackListLocals::CMICmdCmdStackListLocals() CMICmdCmdStackListLocals::~CMICmdCmdStackListLocals() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -695,7 +656,6 @@ bool CMICmdCmdStackListLocals::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -770,7 +730,6 @@ bool CMICmdCmdStackListLocals::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -803,7 +762,6 @@ bool CMICmdCmdStackListLocals::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -816,12 +774,8 @@ CMICmdBase *CMICmdCmdStackListLocals::CreateSelf() { return new CMICmdCmdStackListLocals(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListVariables constructor. // Type: Method. // Args: None. @@ -839,7 +793,6 @@ CMICmdCmdStackListVariables::CMICmdCmdStackListVariables() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackListVariables destructor. // Type: Overrideable. // Args: None. @@ -849,7 +802,6 @@ CMICmdCmdStackListVariables::CMICmdCmdStackListVariables() CMICmdCmdStackListVariables::~CMICmdCmdStackListVariables() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -866,7 +818,6 @@ bool CMICmdCmdStackListVariables::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -942,7 +893,6 @@ bool CMICmdCmdStackListVariables::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -975,7 +925,6 @@ bool CMICmdCmdStackListVariables::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -988,12 +937,8 @@ CMICmdBase *CMICmdCmdStackListVariables::CreateSelf() { return new CMICmdCmdStackListVariables(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackSelectFrame constructor. // Type: Method. // Args: None. @@ -1010,7 +955,6 @@ CMICmdCmdStackSelectFrame::CMICmdCmdStackSelectFrame() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdStackSelectFrame destructor. // Type: Overrideable. // Args: None. @@ -1020,7 +964,6 @@ CMICmdCmdStackSelectFrame::CMICmdCmdStackSelectFrame() CMICmdCmdStackSelectFrame::~CMICmdCmdStackSelectFrame() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1036,7 +979,6 @@ bool CMICmdCmdStackSelectFrame::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1066,7 +1008,6 @@ bool CMICmdCmdStackSelectFrame::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1099,7 +1040,6 @@ bool CMICmdCmdStackSelectFrame::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdSupportInfo.cpp b/lldb/tools/lldb-mi/MICmdCmdSupportInfo.cpp index 384069f..18260f2 100644 --- a/lldb/tools/lldb-mi/MICmdCmdSupportInfo.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdSupportInfo.cpp @@ -17,7 +17,6 @@ #include "MICmnMIValueTuple.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSupportInfoMiCmdQuery constructor. // Type: Method. // Args: None. @@ -34,7 +33,6 @@ CMICmdCmdSupportInfoMiCmdQuery::CMICmdCmdSupportInfoMiCmdQuery() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSupportInfoMiCmdQuery destructor. // Type: Overrideable. // Args: None. @@ -44,7 +42,6 @@ CMICmdCmdSupportInfoMiCmdQuery::CMICmdCmdSupportInfoMiCmdQuery() CMICmdCmdSupportInfoMiCmdQuery::~CMICmdCmdSupportInfoMiCmdQuery() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -60,7 +57,6 @@ bool CMICmdCmdSupportInfoMiCmdQuery::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -85,7 +81,6 @@ bool CMICmdCmdSupportInfoMiCmdQuery::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -109,7 +104,6 @@ bool CMICmdCmdSupportInfoMiCmdQuery::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdSupportList.cpp b/lldb/tools/lldb-mi/MICmdCmdSupportList.cpp index 72bcb20..e457e01 100644 --- a/lldb/tools/lldb-mi/MICmdCmdSupportList.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdSupportList.cpp @@ -15,7 +15,6 @@ #include "MICmnMIValueList.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSupportListFeatures constructor. // Type: Method. // Args: None. @@ -31,7 +30,6 @@ CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSupportListFeatures destructor. // Type: Overrideable. // Args: None. @@ -41,7 +39,6 @@ CMICmdCmdSupportListFeatures::CMICmdCmdSupportListFeatures() { CMICmdCmdSupportListFeatures::~CMICmdCmdSupportListFeatures() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -59,7 +56,6 @@ bool CMICmdCmdSupportListFeatures::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -87,7 +83,6 @@ bool CMICmdCmdSupportListFeatures::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdSymbol.cpp b/lldb/tools/lldb-mi/MICmdCmdSymbol.cpp index 833c5cb..d57d1b0 100644 --- a/lldb/tools/lldb-mi/MICmdCmdSymbol.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdSymbol.cpp @@ -41,7 +41,6 @@ CreateMITuplePCLine(const uint32_t addr, const uint32_t line_number) { using namespace lldb; // For operator==(const SBAddress &, const SBAddress &). //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSymbolListLines constructor. // Type: Method. // Args: None. @@ -58,7 +57,6 @@ CMICmdCmdSymbolListLines::CMICmdCmdSymbolListLines() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdSymbolListLines destructor. // Type: Overrideable. // Args: None. @@ -68,7 +66,6 @@ CMICmdCmdSymbolListLines::CMICmdCmdSymbolListLines() CMICmdCmdSymbolListLines::~CMICmdCmdSymbolListLines() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -84,7 +81,6 @@ bool CMICmdCmdSymbolListLines::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -149,7 +145,6 @@ bool CMICmdCmdSymbolListLines::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -169,7 +164,6 @@ bool CMICmdCmdSymbolListLines::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdTarget.cpp b/lldb/tools/lldb-mi/MICmdCmdTarget.cpp index f614eb0..b3e0bea 100644 --- a/lldb/tools/lldb-mi/MICmdCmdTarget.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdTarget.cpp @@ -25,7 +25,6 @@ #include "MICmnMIValueConst.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTargetSelect constructor. // Type: Method. // Args: None. @@ -43,7 +42,6 @@ CMICmdCmdTargetSelect::CMICmdCmdTargetSelect() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTargetSelect destructor. // Type: Overrideable. // Args: None. @@ -53,7 +51,6 @@ CMICmdCmdTargetSelect::CMICmdCmdTargetSelect() CMICmdCmdTargetSelect::~CMICmdCmdTargetSelect() = default; //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -71,7 +68,6 @@ bool CMICmdCmdTargetSelect::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -151,7 +147,6 @@ bool CMICmdCmdTargetSelect::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -187,7 +182,6 @@ bool CMICmdCmdTargetSelect::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -201,7 +195,6 @@ CMICmdBase *CMICmdCmdTargetSelect::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTargetAttach constructor. // Type: Method. // Args: None. @@ -219,7 +212,6 @@ CMICmdCmdTargetAttach::CMICmdCmdTargetAttach() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTargetAttach destructor. // Type: Overrideable. // Args: None. @@ -229,7 +221,6 @@ CMICmdCmdTargetAttach::CMICmdCmdTargetAttach() CMICmdCmdTargetAttach::~CMICmdCmdTargetAttach() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -250,7 +241,6 @@ bool CMICmdCmdTargetAttach::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -312,7 +302,6 @@ bool CMICmdCmdTargetAttach::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -348,7 +337,6 @@ bool CMICmdCmdTargetAttach::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -362,7 +350,6 @@ CMICmdBase *CMICmdCmdTargetAttach::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTargetDetach constructor. // Type: Method. // Args: None. @@ -378,7 +365,6 @@ CMICmdCmdTargetDetach::CMICmdCmdTargetDetach() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTargetDetach destructor. // Type: Overrideable. // Args: None. @@ -388,7 +374,6 @@ CMICmdCmdTargetDetach::CMICmdCmdTargetDetach() { CMICmdCmdTargetDetach::~CMICmdCmdTargetDetach() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -401,7 +386,6 @@ CMICmdCmdTargetDetach::~CMICmdCmdTargetDetach() {} bool CMICmdCmdTargetDetach::ParseArgs() { return MIstatus::success; } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -433,7 +417,6 @@ bool CMICmdCmdTargetDetach::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -451,7 +434,6 @@ bool CMICmdCmdTargetDetach::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdThread.cpp b/lldb/tools/lldb-mi/MICmdCmdThread.cpp index c3a64c0..e0c74f9 100644 --- a/lldb/tools/lldb-mi/MICmdCmdThread.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdThread.cpp @@ -21,7 +21,6 @@ #include "MICmnMIValueConst.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdThreadInfo constructor. // Type: Method. // Args: None. @@ -39,7 +38,6 @@ CMICmdCmdThreadInfo::CMICmdCmdThreadInfo() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdThreadInfo destructor. // Type: Overrideable. // Args: None. @@ -49,7 +47,6 @@ CMICmdCmdThreadInfo::CMICmdCmdThreadInfo() CMICmdCmdThreadInfo::~CMICmdCmdThreadInfo() { m_vecMIValueTuple.clear(); } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -66,7 +63,6 @@ bool CMICmdCmdThreadInfo::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -135,7 +131,6 @@ bool CMICmdCmdThreadInfo::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -203,7 +198,6 @@ bool CMICmdCmdThreadInfo::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdTrace.cpp b/lldb/tools/lldb-mi/MICmdCmdTrace.cpp index 8ca6574..1daa180 100644 --- a/lldb/tools/lldb-mi/MICmdCmdTrace.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdTrace.cpp @@ -14,7 +14,6 @@ #include "MICmnMIValueConst.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTraceStatus constructor. // Type: Method. // Args: None. @@ -30,7 +29,6 @@ CMICmdCmdTraceStatus::CMICmdCmdTraceStatus() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdTraceStatus destructor. // Type: Overrideable. // Args: None. @@ -40,7 +38,6 @@ CMICmdCmdTraceStatus::CMICmdCmdTraceStatus() { CMICmdCmdTraceStatus::~CMICmdCmdTraceStatus() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -57,7 +54,6 @@ bool CMICmdCmdTraceStatus::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -79,7 +75,6 @@ bool CMICmdCmdTraceStatus::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCmdVar.cpp b/lldb/tools/lldb-mi/MICmdCmdVar.cpp index 60c66d3..3063b1b 100644 --- a/lldb/tools/lldb-mi/MICmdCmdVar.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdVar.cpp @@ -40,7 +40,6 @@ #include <algorithm> //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarCreate constructor. // Type: Method. // Args: None. @@ -60,7 +59,6 @@ CMICmdCmdVarCreate::CMICmdCmdVarCreate() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarCreate destructor. // Type: Overrideable. // Args: None. @@ -70,7 +68,6 @@ CMICmdCmdVarCreate::CMICmdCmdVarCreate() CMICmdCmdVarCreate::~CMICmdCmdVarCreate() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -89,7 +86,6 @@ bool CMICmdCmdVarCreate::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -211,7 +207,6 @@ bool CMICmdCmdVarCreate::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -264,7 +259,6 @@ bool CMICmdCmdVarCreate::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -278,7 +272,6 @@ CMICmdBase *CMICmdCmdVarCreate::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Complete SBValue object and its children to get // SBValue::GetValueDidChange // work. @@ -304,12 +297,8 @@ void CMICmdCmdVarCreate::CompleteSBValue(lldb::SBValue &vrwValue) { } } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarUpdate constructor. // Type: Method. // Args: None. @@ -327,7 +316,6 @@ CMICmdCmdVarUpdate::CMICmdCmdVarUpdate() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarUpdate destructor. // Type: Overrideable. // Args: None. @@ -337,7 +325,6 @@ CMICmdCmdVarUpdate::CMICmdCmdVarUpdate() CMICmdCmdVarUpdate::~CMICmdCmdVarUpdate() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -355,7 +342,6 @@ bool CMICmdCmdVarUpdate::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -408,7 +394,6 @@ bool CMICmdCmdVarUpdate::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -441,7 +426,6 @@ bool CMICmdCmdVarUpdate::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -455,7 +439,6 @@ CMICmdBase *CMICmdCmdVarUpdate::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Form the MI response for multiple variables. // Type: Method. // Args: vrStrVarName - (R) Session var object's name. @@ -491,7 +474,6 @@ void CMICmdCmdVarUpdate::MIFormResponse(const CMIUtilString &vrStrVarName, } //++ -//------------------------------------------------------------------------------------ // Details: Determine if the var object was changed. // Type: Method. // Args: vrVarObj - (R) Session var object to examine. @@ -527,12 +509,8 @@ bool CMICmdCmdVarUpdate::ExamineSBValueForChange(lldb::SBValue &vrwValue, return MIstatus::success; } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarDelete constructor. // Type: Method. // Args: None. @@ -548,7 +526,6 @@ CMICmdCmdVarDelete::CMICmdCmdVarDelete() : m_constStrArgName("name") { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -564,7 +541,6 @@ bool CMICmdCmdVarDelete::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarDelete destructor. // Type: Overrideable. // Args: None. @@ -574,7 +550,6 @@ bool CMICmdCmdVarDelete::ParseArgs() { CMICmdCmdVarDelete::~CMICmdCmdVarDelete() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -595,7 +570,6 @@ bool CMICmdCmdVarDelete::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -614,7 +588,6 @@ bool CMICmdCmdVarDelete::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -627,12 +600,8 @@ CMICmdBase *CMICmdCmdVarDelete::CreateSelf() { return new CMICmdCmdVarDelete(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarAssign constructor. // Type: Method. // Args: None. @@ -650,7 +619,6 @@ CMICmdCmdVarAssign::CMICmdCmdVarAssign() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarAssign destructor. // Type: Overrideable. // Args: None. @@ -660,7 +628,6 @@ CMICmdCmdVarAssign::CMICmdCmdVarAssign() CMICmdCmdVarAssign::~CMICmdCmdVarAssign() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -677,7 +644,6 @@ bool CMICmdCmdVarAssign::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -715,7 +681,6 @@ bool CMICmdCmdVarAssign::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -751,7 +716,6 @@ bool CMICmdCmdVarAssign::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -764,12 +728,8 @@ CMICmdBase *CMICmdCmdVarAssign::CreateSelf() { return new CMICmdCmdVarAssign(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarSetFormat constructor. // Type: Method. // Args: None. @@ -786,7 +746,6 @@ CMICmdCmdVarSetFormat::CMICmdCmdVarSetFormat() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarSetFormat destructor. // Type: Overrideable. // Args: None. @@ -796,7 +755,6 @@ CMICmdCmdVarSetFormat::CMICmdCmdVarSetFormat() CMICmdCmdVarSetFormat::~CMICmdCmdVarSetFormat() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -813,7 +771,6 @@ bool CMICmdCmdVarSetFormat::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -854,7 +811,6 @@ bool CMICmdCmdVarSetFormat::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -897,7 +853,6 @@ bool CMICmdCmdVarSetFormat::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -910,12 +865,8 @@ CMICmdBase *CMICmdCmdVarSetFormat::CreateSelf() { return new CMICmdCmdVarSetFormat(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarListChildren constructor. // Type: Method. // Args: None. @@ -934,7 +885,6 @@ CMICmdCmdVarListChildren::CMICmdCmdVarListChildren() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarListChildren destructor. // Type: Overrideable. // Args: None. @@ -944,7 +894,6 @@ CMICmdCmdVarListChildren::CMICmdCmdVarListChildren() CMICmdCmdVarListChildren::~CMICmdCmdVarListChildren() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -964,7 +913,6 @@ bool CMICmdCmdVarListChildren::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1077,7 +1025,6 @@ bool CMICmdCmdVarListChildren::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1119,7 +1066,6 @@ bool CMICmdCmdVarListChildren::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1132,12 +1078,8 @@ CMICmdBase *CMICmdCmdVarListChildren::CreateSelf() { return new CMICmdCmdVarListChildren(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarEvaluateExpression constructor. // Type: Method. // Args: None. @@ -1155,7 +1097,6 @@ CMICmdCmdVarEvaluateExpression::CMICmdCmdVarEvaluateExpression() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarEvaluateExpression destructor. // Type: Overrideable. // Args: None. @@ -1165,7 +1106,6 @@ CMICmdCmdVarEvaluateExpression::CMICmdCmdVarEvaluateExpression() CMICmdCmdVarEvaluateExpression::~CMICmdCmdVarEvaluateExpression() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1184,7 +1124,6 @@ bool CMICmdCmdVarEvaluateExpression::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1219,7 +1158,6 @@ bool CMICmdCmdVarEvaluateExpression::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1252,7 +1190,6 @@ bool CMICmdCmdVarEvaluateExpression::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1265,12 +1202,8 @@ CMICmdBase *CMICmdCmdVarEvaluateExpression::CreateSelf() { return new CMICmdCmdVarEvaluateExpression(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarInfoPathExpression constructor. // Type: Method. // Args: None. @@ -1287,7 +1220,6 @@ CMICmdCmdVarInfoPathExpression::CMICmdCmdVarInfoPathExpression() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarInfoPathExpression destructor. // Type: Overrideable. // Args: None. @@ -1297,7 +1229,6 @@ CMICmdCmdVarInfoPathExpression::CMICmdCmdVarInfoPathExpression() CMICmdCmdVarInfoPathExpression::~CMICmdCmdVarInfoPathExpression() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1313,7 +1244,6 @@ bool CMICmdCmdVarInfoPathExpression::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1384,7 +1314,6 @@ bool CMICmdCmdVarInfoPathExpression::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1416,7 +1345,6 @@ bool CMICmdCmdVarInfoPathExpression::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1429,12 +1357,8 @@ CMICmdBase *CMICmdCmdVarInfoPathExpression::CreateSelf() { return new CMICmdCmdVarInfoPathExpression(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarShowAttributes constructor. // Type: Method. // Args: None. @@ -1451,7 +1375,6 @@ CMICmdCmdVarShowAttributes::CMICmdCmdVarShowAttributes() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdVarShowAttributes destructor. // Type: Overrideable. // Args: None. @@ -1461,7 +1384,6 @@ CMICmdCmdVarShowAttributes::CMICmdCmdVarShowAttributes() CMICmdCmdVarShowAttributes::~CMICmdCmdVarShowAttributes() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1477,7 +1399,6 @@ bool CMICmdCmdVarShowAttributes::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1504,7 +1425,6 @@ bool CMICmdCmdVarShowAttributes::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1527,7 +1447,6 @@ bool CMICmdCmdVarShowAttributes::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. diff --git a/lldb/tools/lldb-mi/MICmdCommands.cpp b/lldb/tools/lldb-mi/MICmdCommands.cpp index f172012..cffc50a 100644 --- a/lldb/tools/lldb-mi/MICmdCommands.cpp +++ b/lldb/tools/lldb-mi/MICmdCommands.cpp @@ -45,7 +45,6 @@ template <typename T> static bool Register(); } //++ -//------------------------------------------------------------------------------------ // Details: Command to command factory registration function. // Type: Template function. // Args: typename T - A command type class. @@ -61,7 +60,6 @@ template <typename T> static bool MICmnCommands::Register() { } //++ -//------------------------------------------------------------------------------------ // Details: Register commands with MI command factory // Type: Function. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmdFactory.cpp b/lldb/tools/lldb-mi/MICmdFactory.cpp index 9336803..3099583 100644 --- a/lldb/tools/lldb-mi/MICmdFactory.cpp +++ b/lldb/tools/lldb-mi/MICmdFactory.cpp @@ -14,7 +14,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdFactory constructor. // Type: Method. // Args: None. @@ -24,7 +23,6 @@ CMICmdFactory::CMICmdFactory() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdFactory destructor. // Type: Overridable. // Args: None. @@ -34,7 +32,6 @@ CMICmdFactory::CMICmdFactory() {} CMICmdFactory::~CMICmdFactory() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Command factory. // Type: Method. // Args: None. @@ -56,7 +53,6 @@ bool CMICmdFactory::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Command Factory. // Type: Method. // Args: None. @@ -79,7 +75,6 @@ bool CMICmdFactory::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Register a command's creator function with the command identifier // the MI // command name i.e. 'file-exec-and-symbols'. @@ -116,7 +111,6 @@ bool CMICmdFactory::CmdRegister(const CMIUtilString &vMiCmd, } //++ -//------------------------------------------------------------------------------------ // Details: Check a command is already registered. // Type: Method. // Args: vMiCmd - (R) Command's name, the MI command. @@ -131,7 +125,6 @@ bool CMICmdFactory::HaveAlready(const CMIUtilString &vMiCmd) const { } //++ -//------------------------------------------------------------------------------------ // Details: Check a command's name is valid: // - name is not empty // - name does not have spaces @@ -157,7 +150,6 @@ bool CMICmdFactory::IsValid(const CMIUtilString &vMiCmd) const { } //++ -//------------------------------------------------------------------------------------ // Details: Check a command is already registered. // Type: Method. // Args: vMiCmd - (R) Command's name, the MI command. @@ -170,7 +162,6 @@ bool CMICmdFactory::CmdExist(const CMIUtilString &vMiCmd) const { } //++ -//------------------------------------------------------------------------------------ // Details: Create a command given the specified MI command name. The command // data object // contains the options for the command. diff --git a/lldb/tools/lldb-mi/MICmdInterpreter.cpp b/lldb/tools/lldb-mi/MICmdInterpreter.cpp index 0ed4b2f..9e37ac2 100644 --- a/lldb/tools/lldb-mi/MICmdInterpreter.cpp +++ b/lldb/tools/lldb-mi/MICmdInterpreter.cpp @@ -11,7 +11,6 @@ #include "MICmdFactory.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdInterpreter constructor. // Type: Method. // Args: None. @@ -22,7 +21,6 @@ CMICmdInterpreter::CMICmdInterpreter() : m_rCmdFactory(CMICmdFactory::Instance()) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdInterpreter destructor. // Type: Overridable. // Args: None. @@ -32,7 +30,6 @@ CMICmdInterpreter::CMICmdInterpreter() CMICmdInterpreter::~CMICmdInterpreter() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Command Interpreter. // Type: Method. // Args: None. @@ -52,7 +49,6 @@ bool CMICmdInterpreter::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Command Interpreter. // Type: Method. // Args: None. @@ -73,7 +69,6 @@ bool CMICmdInterpreter::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Establish whether the text data is an MI format type command. // Type: Method. // Args: vTextLine - (R) Text data to interpret. @@ -122,7 +117,6 @@ bool CMICmdInterpreter::ValidateIsMi(const CMIUtilString &vTextLine, } //++ -//------------------------------------------------------------------------------------ // Details: Establish whether the command name entered on the stdin stream is // recognised by // the MI driver. @@ -137,7 +131,6 @@ bool CMICmdInterpreter::HasCmdFactoryGotMiCmd(const SMICmdData &vCmd) const { } //++ -//------------------------------------------------------------------------------------ // Details: Does the command entered match the criteria for a MI command format. // The format to validate against is 'nn-' where there can be 1 to n // digits. @@ -174,7 +167,6 @@ bool CMICmdInterpreter::MiHasCmdTokenEndingHyphen( } //++ -//------------------------------------------------------------------------------------ // Details: Does the command entered match the criteria for a MI command format. // The format to validate against is 'nnA' where there can be 1 to n // digits. @@ -210,7 +202,6 @@ bool CMICmdInterpreter::MiHasCmdTokenEndingAlpha( } //++ -//------------------------------------------------------------------------------------ // Details: Does the command entered match the criteria for a MI command format. // Is the command token present before the hyphen? // Type: Method. @@ -224,7 +215,6 @@ bool CMICmdInterpreter::MiHasCmdTokenPresent(const CMIUtilString &vTextLine) { } //++ -//------------------------------------------------------------------------------------ // Details: Does the command name entered match the criteria for a MI command // format. // Is a recognised command present? The command name is entered into @@ -287,7 +277,6 @@ bool CMICmdInterpreter::MiHasCmd(const CMIUtilString &vTextLine) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the just entered new command from stdin. It contains the // command // name, number and any options. diff --git a/lldb/tools/lldb-mi/MICmdInvoker.cpp b/lldb/tools/lldb-mi/MICmdInvoker.cpp index 1714c62..f4150a2 100644 --- a/lldb/tools/lldb-mi/MICmdInvoker.cpp +++ b/lldb/tools/lldb-mi/MICmdInvoker.cpp @@ -15,7 +15,6 @@ #include "MIDriver.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdInvoker constructor. // Type: Method. // Args: None. @@ -25,7 +24,6 @@ CMICmdInvoker::CMICmdInvoker() : m_rStreamOut(CMICmnStreamStdout::Instance()) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdInvoker destructor. // Type: Overridable. // Args: None. @@ -35,7 +33,6 @@ CMICmdInvoker::CMICmdInvoker() : m_rStreamOut(CMICmnStreamStdout::Instance()) {} CMICmdInvoker::~CMICmdInvoker() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Command Invoker. // Type: Method. // Args: None. @@ -55,7 +52,6 @@ bool CMICmdInvoker::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Stdin stream. // Type: Method. // Args: None. @@ -78,7 +74,6 @@ bool CMICmdInvoker::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Empty the map of invoked commands doing work. Command objects are // deleted too. // Type: Method. @@ -104,7 +99,6 @@ void CMICmdInvoker::CmdDeleteAll() { } //++ -//------------------------------------------------------------------------------------ // Details: Remove from the map of invoked commands doing work a command that // has finished // its work. The command object is deleted too. @@ -138,7 +132,6 @@ bool CMICmdInvoker::CmdDelete(const MIuint vId, } //++ -//------------------------------------------------------------------------------------ // Details: Add to the map of invoked commands doing work a command that is // about to // start to do work. @@ -165,7 +158,6 @@ bool CMICmdInvoker::CmdAdd(const CMICmdBase &vCmd) { } //++ -//------------------------------------------------------------------------------------ // Details: Having previously had the potential command validated and found // valid now // get the command executed. @@ -212,7 +204,6 @@ bool CMICmdInvoker::CmdExecute(CMICmdBase &vCmd) { } //++ -//------------------------------------------------------------------------------------ // Details: Called when a command has finished its Execution() work either // synchronously // because the command executed was the type a non event type or @@ -269,7 +260,6 @@ bool CMICmdInvoker::CmdExecuteFinished(CMICmdBase &vCmd) { } //++ -//------------------------------------------------------------------------------------ // Details: If the MI Driver is not operating via a client i.e. Eclipse check // the command // on failure suggests the application exits. A command can be such @@ -290,7 +280,6 @@ void CMICmdInvoker::CmdCauseAppExit(const CMICmdBase &vCmd) const { } //++ -//------------------------------------------------------------------------------------ // Details: Write to stdout and the Log file the command's MI formatted result. // Type: vCmdData - (R) A command's information. // Return: MIstatus::success - Functionality succeeded. @@ -312,7 +301,6 @@ bool CMICmdInvoker::CmdStdout(const SMICmdData &vCmdData) const { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdMgr::ICmdDeleteCallback. *this object is // registered // with the Command Manager to receive callbacks when a command is diff --git a/lldb/tools/lldb-mi/MICmdMgr.cpp b/lldb/tools/lldb-mi/MICmdMgr.cpp index d9d0f57..453ffed 100644 --- a/lldb/tools/lldb-mi/MICmdMgr.cpp +++ b/lldb/tools/lldb-mi/MICmdMgr.cpp @@ -18,7 +18,6 @@ #include "MIUtilSingletonHelper.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmdMgr constructor. // Type: Method. // Args: None. @@ -31,7 +30,6 @@ CMICmdMgr::CMICmdMgr() m_invoker(CMICmdInvoker::Instance()) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmdMgr destructor. // Type: Overridable. // Args: None. @@ -41,7 +39,6 @@ CMICmdMgr::CMICmdMgr() CMICmdMgr::~CMICmdMgr() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Command Manager. // Type: Method. // Args: None. @@ -90,7 +87,6 @@ bool CMICmdMgr::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Command Manager. // Type: Method. // Args: None. @@ -147,7 +143,6 @@ bool CMICmdMgr::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Establish whether the text data is an MI format type command. // Type: Method. // Args: vTextLine - (R) Text data to interpret. @@ -167,7 +162,6 @@ bool CMICmdMgr::CmdInterpret(const CMIUtilString &vTextLine, bool &vwbYesValid, } //++ -//------------------------------------------------------------------------------------ // Details: Having previously had the potential command validated and found // valid now // get the command executed. @@ -209,7 +203,6 @@ bool CMICmdMgr::CmdExecute(const SMICmdData &vCmdData) { } //++ -//------------------------------------------------------------------------------------ // Details: Iterate all interested clients and tell them a command is being // deleted. // Type: Method. @@ -228,7 +221,6 @@ bool CMICmdMgr::CmdDelete(SMICmdData vCmdData) { } //++ -//------------------------------------------------------------------------------------ // Details: Register an object to be called when a command object is deleted. // Type: Method. // Args: vObject - (R) A new interested client. @@ -242,7 +234,6 @@ bool CMICmdMgr::CmdRegisterForDeleteNotification( } //++ -//------------------------------------------------------------------------------------ // Details: Unregister an object from being called when a command object is // deleted. // Type: Method. diff --git a/lldb/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp b/lldb/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp index 2710ff5..d6146b8 100644 --- a/lldb/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp +++ b/lldb/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp @@ -12,7 +12,6 @@ namespace CMICmdMgrSetCmdDeleteCallback { //++ -//------------------------------------------------------------------------------------ // Details: CSetClients constructor. // Type: Method. // Args: None. @@ -22,7 +21,6 @@ namespace CMICmdMgrSetCmdDeleteCallback { CSetClients::CSetClients() : m_bClientUnregistered(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CSetClients destructor. // Type: Method. // Args: None. @@ -32,7 +30,6 @@ CSetClients::CSetClients() : m_bClientUnregistered(false) {} CSetClients::~CSetClients() {} //++ -//------------------------------------------------------------------------------------ // Details: Register an object to be called when a command object is deleted. // Type: Method. // Args: vObject - (R) A new interested client. @@ -47,7 +44,6 @@ bool CSetClients::Register(ICallback &vObject) { } //++ -//------------------------------------------------------------------------------------ // Details: Unregister an object from being called when a command object is // deleted. // Type: Method. @@ -64,7 +60,6 @@ bool CSetClients::Unregister(ICallback &vObject) { } //++ -//------------------------------------------------------------------------------------ // Details: Iterate all interested clients and tell them a command is being // deleted. // Type: Method. diff --git a/lldb/tools/lldb-mi/MICmnBase.cpp b/lldb/tools/lldb-mi/MICmnBase.cpp index 855db5c..72096d5 100644 --- a/lldb/tools/lldb-mi/MICmnBase.cpp +++ b/lldb/tools/lldb-mi/MICmnBase.cpp @@ -15,7 +15,6 @@ #include "MICmnStreamStderr.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnBase constructor. // Type: Method. // Args: None. @@ -27,7 +26,6 @@ CMICmnBase::CMICmnBase() m_pLog(&CMICmnLog::Instance()), m_clientUsageRefCnt(0) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnBase destructor. // Type: Overrideable. // Args: None. @@ -37,7 +35,6 @@ CMICmnBase::CMICmnBase() CMICmnBase::~CMICmnBase() { m_pLog = NULL; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve whether *this object has an error description set. // Type: Method. // Args: None. @@ -49,7 +46,6 @@ bool CMICmnBase::HaveErrorDescription() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve MI's last error condition. // Type: Method. // Args: None. @@ -61,7 +57,6 @@ const CMIUtilString &CMICmnBase::GetErrorDescription() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set MI's error condition description. This may be accessed by // clients and // seen by users. Message is available to the client using the server @@ -81,7 +76,6 @@ void CMICmnBase::SetErrorDescription(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Set MI's error condition description. This may be accessed by // clients and // seen by users. Message is available to the client using the server @@ -97,7 +91,6 @@ void CMICmnBase::SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Clear MI's error condition description. // Type: Method. // Args: None. @@ -109,7 +102,6 @@ void CMICmnBase::ClrErrorDescription() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set MI's error condition description. This may be accessed by // clients and // seen by users. Message is available to the client using the server diff --git a/lldb/tools/lldb-mi/MICmnLLDBBroadcaster.cpp b/lldb/tools/lldb-mi/MICmnLLDBBroadcaster.cpp index 805667c..554ec1f 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBBroadcaster.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBBroadcaster.cpp @@ -10,7 +10,6 @@ #include "MICmnLLDBBroadcaster.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBBroadcaster constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMICmnLLDBBroadcaster::CMICmnLLDBBroadcaster() : lldb::SBBroadcaster("MI driver") {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBBroadcaster destructor. // Type: Overridable. // Args: None. @@ -31,7 +29,6 @@ CMICmnLLDBBroadcaster::CMICmnLLDBBroadcaster() CMICmnLLDBBroadcaster::~CMICmnLLDBBroadcaster() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this broadcaster object. // Type: Method. // Args: None. @@ -51,7 +48,6 @@ bool CMICmnLLDBBroadcaster::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this broadcaster object. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp index 0ffb967..5ec2c58 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp @@ -29,7 +29,6 @@ #include "Platform.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfo constructor. // Type: Method. // Args: None. @@ -46,7 +45,6 @@ CMICmnLLDBDebugSessionInfo::CMICmnLLDBDebugSessionInfo() m_constStrPrintAggregateFieldNames("Print AggregateFieldNames") {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfo destructor. // Type: Overridable. // Args: None. @@ -56,7 +54,6 @@ CMICmnLLDBDebugSessionInfo::CMICmnLLDBDebugSessionInfo() CMICmnLLDBDebugSessionInfo::~CMICmnLLDBDebugSessionInfo() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this object. // Type: Method. // Args: None. @@ -79,7 +76,6 @@ bool CMICmnLLDBDebugSessionInfo::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this object. // Type: Method. // Args: None. @@ -106,7 +102,6 @@ bool CMICmnLLDBDebugSessionInfo::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Command instances can create and share data between other instances // of commands. // Data can also be assigned by a command and retrieved by LLDB event @@ -128,7 +123,6 @@ void CMICmnLLDBDebugSessionInfo::SharedDataDestroy() { } //++ -//------------------------------------------------------------------------------------ // Details: Record information about a LLDB break point so that is can be // recalled in other // commands or LLDB event handling functions. @@ -148,7 +142,6 @@ bool CMICmnLLDBDebugSessionInfo::RecordBrkPtInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve information about a LLDB break point previous recorded // either by // commands or LLDB event handling functions. @@ -172,7 +165,6 @@ bool CMICmnLLDBDebugSessionInfo::RecordBrkPtInfoGet( } //++ -//------------------------------------------------------------------------------------ // Details: Delete information about a specific LLDB break point object. This // function // should be called when a LLDB break point is deleted. @@ -194,7 +186,6 @@ bool CMICmnLLDBDebugSessionInfo::RecordBrkPtInfoDelete(const MIuint vnBrkPtId) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the specified thread's frame information. // Type: Method. // Args: vCmdData - (R) A command's information. @@ -241,7 +232,6 @@ bool CMICmnLLDBDebugSessionInfo::GetThreadFrames( } //++ -//------------------------------------------------------------------------------------ // Details: Return the resolved file's path for the given file. // Type: Method. // Args: vCmdData - (R) A command's information. @@ -272,7 +262,6 @@ bool CMICmnLLDBDebugSessionInfo::ResolvePath(const SMICmdData &vCmdData, } //++ -//------------------------------------------------------------------------------------ // Details: Return the resolved file's path for the given file. // Type: Method. // Args: vstrUnknown - (R) String assigned to path when resolved path @@ -320,7 +309,6 @@ bool CMICmnLLDBDebugSessionInfo::ResolvePath(const CMIUtilString &vstrUnknown, } //++ -//------------------------------------------------------------------------------------ // Details: Determine the given file path exists or not. // Type: Method. // Args: vPath - (R) File name path. @@ -342,7 +330,6 @@ bool CMICmnLLDBDebugSessionInfo::AccessPath(const CMIUtilString &vPath, } //++ -//------------------------------------------------------------------------------------ // Details: Form MI partial response by appending more MI value type objects to // the // tuple type object past in. @@ -408,7 +395,6 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Form MI partial response by appending more MI value type objects to // the // tuple type object past in. @@ -511,7 +497,6 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseForVariableInfoInternal( } //++ -//------------------------------------------------------------------------------------ // Details: Extract the value's name and value or recurse into child value // object. // Type: Method. @@ -535,7 +520,6 @@ bool CMICmnLLDBDebugSessionInfo::GetVariableInfo(const lldb::SBValue &vrValue, } //++ -//------------------------------------------------------------------------------------ // Details: Form MI partial response by appending more MI value type objects to // the // tuple type object past in. @@ -606,7 +590,6 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the frame information from LLDB frame object. // Type: Method. // Args: vrFrame - (R) LLDB thread object. @@ -648,7 +631,6 @@ bool CMICmnLLDBDebugSessionInfo::GetFrameInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Form MI partial response by appending more MI value type objects to // the // tuple type object past in. @@ -683,7 +665,6 @@ void CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtFrameInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Form MI partial response by appending more MI value type objects to // the // tuple type object past in. @@ -773,7 +754,6 @@ bool CMICmnLLDBDebugSessionInfo::MIResponseFormBrkPtInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve breakpoint information and write into the given breakpoint // information // object. Note not all possible information is retrieved and so the @@ -836,7 +816,6 @@ bool CMICmnLLDBDebugSessionInfo::GetBrkPtInfo(const lldb::SBBreakpoint &vBrkPt, } //++ -//------------------------------------------------------------------------------------ // Details: Get current debugger. // Type: Method. // Args: None. @@ -848,7 +827,6 @@ lldb::SBDebugger &CMICmnLLDBDebugSessionInfo::GetDebugger() const { } //++ -//------------------------------------------------------------------------------------ // Details: Get current listener. // Type: Method. // Args: None. @@ -860,7 +838,6 @@ lldb::SBListener &CMICmnLLDBDebugSessionInfo::GetListener() const { } //++ -//------------------------------------------------------------------------------------ // Details: Get current target. // Type: Method. // Args: None. @@ -875,7 +852,6 @@ lldb::SBTarget CMICmnLLDBDebugSessionInfo::GetTarget() const { } //++ -//------------------------------------------------------------------------------------ // Details: Get current process. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h index 05b7cff..1fa8195 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h +++ b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h @@ -242,7 +242,6 @@ private: }; //++ -//------------------------------------------------------------------------------------ // Details: Command instances can create and share data between other instances // of commands. // This function adds new data to the shared data. Using the same ID @@ -268,7 +267,6 @@ bool CMICmnLLDBDebugSessionInfo::SharedDataAdd(const CMIUtilString &vKey, } //++ -//------------------------------------------------------------------------------------ // Details: Command instances can create and share data between other instances // of commands. // This function retrieves data from the shared data container. diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp index 4eaf812..fc0f76b 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp @@ -28,7 +28,6 @@ CMICmnLLDBDebugSessionInfoVarObj::varFormat_e CMICmnLLDBDebugSessionInfoVarObj::ms_eDefaultFormat = eVarFormat_Natural; //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj constructor. // Type: Method. // Args: None. @@ -41,7 +40,6 @@ CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj constructor. // Type: Method. // Args: vrStrNameReal - (R) The actual name of the variable, the @@ -61,7 +59,6 @@ CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj constructor. // Type: Method. // Args: vrStrNameReal - (R) The actual name of the variable, the @@ -84,7 +81,6 @@ CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj copy constructor. // Type: Method. // Args: vrOther - (R) The object to copy from. @@ -97,7 +93,6 @@ CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj copy constructor. // Type: Method. // Args: vrOther - (R) The object to copy from. @@ -110,7 +105,6 @@ CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj move constructor. // Type: Method. // Args: vrwOther - (R) The object to copy from. @@ -123,7 +117,6 @@ CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj assignment operator. // Type: Method. // Args: vrOther - (R) The object to copy from. @@ -138,7 +131,6 @@ operator=(const CMICmnLLDBDebugSessionInfoVarObj &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj assignment operator. // Type: Method. // Args: vrwOther - (R) The object to copy from. @@ -153,7 +145,6 @@ operator=(CMICmnLLDBDebugSessionInfoVarObj &&vrwOther) { } //++ -//------------------------------------------------------------------------------------ // Details: Copy the other instance of that object to *this object. // Type: Method. // Args: vrOther - (R) The object to copy from. @@ -179,7 +170,6 @@ bool CMICmnLLDBDebugSessionInfoVarObj::CopyOther( } //++ -//------------------------------------------------------------------------------------ // Details: Move that object to *this object. // Type: Method. // Args: vrwOther - (RW) The object to copy from. @@ -206,7 +196,6 @@ bool CMICmnLLDBDebugSessionInfoVarObj::MoveOther( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugSessionInfoVarObj destructor. // Type: Overridden. // Args: None. @@ -216,7 +205,6 @@ bool CMICmnLLDBDebugSessionInfoVarObj::MoveOther( CMICmnLLDBDebugSessionInfoVarObj::~CMICmnLLDBDebugSessionInfoVarObj() {} //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the var format enumeration for the specified string. // Type: Static method. // Args: vrStrFormat - (R) Text description of the var format. @@ -238,7 +226,6 @@ CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForString( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the var format enumeration for the specified character. // Type: Static method. // Args: vcFormat - Character representing the var format. @@ -262,7 +249,6 @@ CMICmnLLDBDebugSessionInfoVarObj::GetVarFormatForChar(char vcFormat) { } //++ -//------------------------------------------------------------------------------------ // Details: Return the equivalent var value formatted string for the given value // type, // which was prepared for printing (i.e. value was escaped and now it's @@ -297,7 +283,6 @@ CMIUtilString CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted( } //++ -//------------------------------------------------------------------------------------ // Details: Return number formatted string according to the given value type. // Type: Static method. // Args: vnValue - (R) The number value to get formatted. @@ -340,7 +325,6 @@ CMIUtilString CMICmnLLDBDebugSessionInfoVarObj::GetStringFormatted( } //++ -//------------------------------------------------------------------------------------ // Details: Delete internal container contents. // Type: Static method. // Args: None. @@ -352,7 +336,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjClear() { } //++ -//------------------------------------------------------------------------------------ // Details: Add a var object to the internal container. // Type: Static method. // Args: vrVarObj - (R) The var value object. @@ -367,7 +350,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjAdd( } //++ -//------------------------------------------------------------------------------------ // Details: Delete the var object from the internal container matching the // specified name. // Type: Static method. @@ -385,7 +367,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjDelete( } //++ -//------------------------------------------------------------------------------------ // Details: Update an existing var object in the internal container. // Type: Static method. // Args: vrVarObj - (R) The var value object. @@ -398,7 +379,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjUpdate( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the var object matching the specified name. // Type: Static method. // Args: vrVarName - (R) The var value name. @@ -421,7 +401,6 @@ bool CMICmnLLDBDebugSessionInfoVarObj::VarObjGet( } //++ -//------------------------------------------------------------------------------------ // Details: A count is kept of the number of var value objects created. This is // count is // used to ID the var value object. Reset the count to 0. @@ -435,7 +414,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjIdResetToZero() { } //++ -//------------------------------------------------------------------------------------ // Details: Default format is globally used as the data format when "natural" is // in effect, that is, this overrides the default // Type: Static method. @@ -449,7 +427,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjSetFormat( } //++ -//------------------------------------------------------------------------------------ // Details: A count is kept of the number of var value objects created. This is // count is // used to ID the var value object. Increment the count by 1. @@ -461,7 +438,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::VarObjSetFormat( void CMICmnLLDBDebugSessionInfoVarObj::VarObjIdInc() { ms_nVarUniqueId++; } //++ -//------------------------------------------------------------------------------------ // Details: A count is kept of the number of var value objects created. This is // count is // used to ID the var value object. Retrieve ID. @@ -475,7 +451,6 @@ MIuint CMICmnLLDBDebugSessionInfoVarObj::VarObjIdGet() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value formatted object's name. // Type: Method. // Args: None. @@ -487,7 +462,6 @@ const CMIUtilString &CMICmnLLDBDebugSessionInfoVarObj::GetName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value formatted object's variable name as given in the // MI command // to create the var object. @@ -501,7 +475,6 @@ const CMIUtilString &CMICmnLLDBDebugSessionInfoVarObj::GetNameReal() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value formatted string. // Type: Method. // Args: None. @@ -514,7 +487,6 @@ CMICmnLLDBDebugSessionInfoVarObj::GetValueFormatted() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the LLDB Value object. // Type: Method. // Args: None. @@ -526,7 +498,6 @@ lldb::SBValue &CMICmnLLDBDebugSessionInfoVarObj::GetValue() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the LLDB Value object. // Type: Method. // Args: None. @@ -538,7 +509,6 @@ const lldb::SBValue &CMICmnLLDBDebugSessionInfoVarObj::GetValue() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the var format type for *this object and update the formatting. // Type: Method. // Args: None. @@ -557,7 +527,6 @@ bool CMICmnLLDBDebugSessionInfoVarObj::SetVarFormat( } //++ -//------------------------------------------------------------------------------------ // Details: Update *this var obj. Update it's value and type. // Type: Method. // Args: None. @@ -576,7 +545,6 @@ void CMICmnLLDBDebugSessionInfoVarObj::UpdateValue() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the enumeration type of the var object. // Type: Method. // Args: None. @@ -589,7 +557,6 @@ CMICmnLLDBDebugSessionInfoVarObj::GetType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the parent var object's name, the parent var object to // *this var // object (if assigned). The parent is equivalent to LLDB SBValue diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp index f93faeb..b22e7d9 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp @@ -29,7 +29,6 @@ #include "MIUtilSingletonHelper.h" //++ -//------------------------------------------------------------------------------------ // MI private summary providers static inline bool MI_char_summary_provider(lldb::SBValue value, lldb::SBTypeSummaryOptions options, @@ -55,7 +54,6 @@ static inline bool MI_char_summary_provider(lldb::SBValue value, } //++ -//------------------------------------------------------------------------------------ // MI summary helper routines static inline bool MI_add_summary(lldb::SBTypeCategory category, const char *typeName, @@ -74,7 +72,6 @@ static inline bool MI_add_summary(lldb::SBTypeCategory category, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugger constructor. // Type: Method. // Args: None. @@ -85,7 +82,6 @@ CMICmnLLDBDebugger::CMICmnLLDBDebugger() : m_constStrThisThreadId("MI debugger event") {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebugger destructor. // Type: Overridable. // Args: None. @@ -95,7 +91,6 @@ CMICmnLLDBDebugger::CMICmnLLDBDebugger() CMICmnLLDBDebugger::~CMICmnLLDBDebugger() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this debugger object. // Type: Method. // Args: None. @@ -157,7 +152,6 @@ bool CMICmnLLDBDebugger::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this debugger object. // Type: Method. // Args: None. @@ -217,7 +211,6 @@ bool CMICmnLLDBDebugger::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Return the LLDB debugger instance created for this debug session. // Type: Method. // Args: None. @@ -229,7 +222,6 @@ lldb::SBDebugger &CMICmnLLDBDebugger::GetTheDebugger() { } //++ -//------------------------------------------------------------------------------------ // Details: Return the LLDB listener instance created for this debug session. // Type: Method. // Args: None. @@ -241,7 +233,6 @@ lldb::SBListener &CMICmnLLDBDebugger::GetTheListener() { } //++ -//------------------------------------------------------------------------------------ // Details: Set the client driver that wants to use *this LLDB debugger. Call // this function // prior to Initialize(). @@ -258,7 +249,6 @@ bool CMICmnLLDBDebugger::SetDriver(const CMIDriverBase &vClientDriver) { } //++ -//------------------------------------------------------------------------------------ // Details: Get the client driver that is use *this LLDB debugger. // Type: Method. // Args: vClientDriver - (R) A driver. @@ -270,7 +260,6 @@ CMIDriverBase &CMICmnLLDBDebugger::GetDriver() const { } //++ -//------------------------------------------------------------------------------------ // Details: Wait until all events have been handled. // This function works in pair with // CMICmnLLDBDebugger::MonitorSBListenerEvents @@ -294,7 +283,6 @@ void CMICmnLLDBDebugger::WaitForHandleEvent() { } //++ -//------------------------------------------------------------------------------------ // Details: Check if need to rebroadcast stop event. This function will return // true if // debugger is in synchronouse mode. In such case the @@ -321,7 +309,6 @@ bool CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent() { } //++ -//------------------------------------------------------------------------------------ // Details: Rebroadcast stop event if needed. This function should be called // only if the // CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent() returned @@ -342,7 +329,6 @@ void CMICmnLLDBDebugger::RebroadcastStopEvent() { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize the LLDB Debugger object. // Type: Method. // Args: None. @@ -363,7 +349,6 @@ bool CMICmnLLDBDebugger::InitSBDebugger() { } //++ -//------------------------------------------------------------------------------------ // Details: Set the LLDB Debugger's std in, err and out streams. (Not // implemented left // here for reference. Was called in the @@ -388,7 +373,6 @@ bool CMICmnLLDBDebugger::InitStdStreams() { } //++ -//------------------------------------------------------------------------------------ // Details: Set up the events from the SBDebugger's we would like to listen to. // Type: Method. // Args: None. @@ -443,7 +427,6 @@ bool CMICmnLLDBDebugger::InitSBListener() { } //++ -//------------------------------------------------------------------------------------ // Details: Register with the debugger, the SBListener, the type of events you // are interested // in. Others, like commands, may have already set the mask. @@ -481,7 +464,6 @@ bool CMICmnLLDBDebugger::RegisterForEvent( } //++ -//------------------------------------------------------------------------------------ // Details: Register with the debugger, the SBListener, the type of events you // are interested // in. Others, like commands, may have already set the mask. @@ -532,7 +514,6 @@ bool CMICmnLLDBDebugger::RegisterForEvent( } //++ -//------------------------------------------------------------------------------------ // Details: Unregister with the debugger, the SBListener, the type of events you // are no // longer interested in. Others, like commands, may still remain @@ -579,7 +560,6 @@ bool CMICmnLLDBDebugger::UnregisterForEvent( } //++ -//------------------------------------------------------------------------------------ // Details: Given the SBBroadcaster class name retrieve it's current event mask. // Type: Method. // Args: vBroadcasterClass - (R) The SBBroadcaster's class name. @@ -609,7 +589,6 @@ bool CMICmnLLDBDebugger::BroadcasterGetMask( } //++ -//------------------------------------------------------------------------------------ // Details: Remove the event mask for the specified SBBroadcaster class name. // Type: Method. // Args: vBroadcasterClass - (R) The SBBroadcaster's class name. @@ -629,7 +608,6 @@ bool CMICmnLLDBDebugger::BroadcasterRemoveMask( } //++ -//------------------------------------------------------------------------------------ // Details: Given the SBBroadcaster class name save it's current event mask. // Type: Method. // Args: vBroadcasterClass - (R) The SBBroadcaster's class name. @@ -655,7 +633,6 @@ bool CMICmnLLDBDebugger::BroadcasterSaveMask( } //++ -//------------------------------------------------------------------------------------ // Details: Iterate all the clients who have registered event masks against // particular // SBBroadcasters and build up the mask that is for all of them. @@ -683,7 +660,6 @@ MIuint CMICmnLLDBDebugger::ClientGetMaskForAllClients( } //++ -//------------------------------------------------------------------------------------ // Details: Given the client save its particular event requirements. // Type: Method. // Args: vClientName - (R) The Client's unique ID. @@ -714,7 +690,6 @@ bool CMICmnLLDBDebugger::ClientSaveMask(const CMIUtilString &vClientName, } //++ -//------------------------------------------------------------------------------------ // Details: Given the client remove it's particular event requirements. // Type: Method. // Args: vClientName - (R) The Client's unique ID. @@ -743,7 +718,6 @@ bool CMICmnLLDBDebugger::ClientRemoveTheirMask( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the client's event mask used for on a particular // SBBroadcaster. // Type: Method. @@ -778,7 +752,6 @@ bool CMICmnLLDBDebugger::ClientGetTheirMask( } //++ -//------------------------------------------------------------------------------------ // Details: Momentarily wait for an events being broadcast and inspect those // that do // come this way. Check if the target should exit event if so start @@ -848,7 +821,6 @@ bool CMICmnLLDBDebugger::MonitorSBListenerEvents(bool &vrbIsAlive) { } //++ -//------------------------------------------------------------------------------------ // Details: The main worker method for this thread. // Type: Method. // Args: vrbIsAlive - (W) True = *this thread is working, false = thread has @@ -862,7 +834,6 @@ bool CMICmnLLDBDebugger::ThreadRun(bool &vrbIsAlive) { } //++ -//------------------------------------------------------------------------------------ // Details: Let this thread clean up after itself. // Type: Method. // Args: @@ -873,7 +844,6 @@ bool CMICmnLLDBDebugger::ThreadRun(bool &vrbIsAlive) { bool CMICmnLLDBDebugger::ThreadFinish() { return MIstatus::success; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve *this thread object's name. // Type: Overridden. // Args: None. @@ -885,7 +855,6 @@ const CMIUtilString &CMICmnLLDBDebugger::ThreadGetName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Loads lldb-mi formatters // Type: Method. // Args: None. @@ -913,7 +882,6 @@ bool CMICmnLLDBDebugger::LoadMIFormatters(lldb::SBTypeCategory miCategory) { } //++ -//------------------------------------------------------------------------------------ // Details: Registers lldb-mi custom summary providers // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp index c35d730..58a7c7d 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp @@ -43,7 +43,6 @@ #include <algorithm> //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebuggerHandleEvents constructor. // Type: Method. // Args: None. @@ -53,7 +52,6 @@ CMICmnLLDBDebuggerHandleEvents::CMICmnLLDBDebuggerHandleEvents() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBDebuggerHandleEvents destructor. // Type: Overridable. // Args: None. @@ -65,7 +63,6 @@ CMICmnLLDBDebuggerHandleEvents::~CMICmnLLDBDebuggerHandleEvents() { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this broadcaster object. // Type: Method. // Args: None. @@ -90,7 +87,6 @@ bool CMICmnLLDBDebuggerHandleEvents::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this broadcaster object. // Type: Method. // Args: None. @@ -111,7 +107,6 @@ bool CMICmnLLDBDebuggerHandleEvents::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Interpret the event object to ascertain the action to take or // information to // to form and put in a MI Out-of-band record object which is given to @@ -150,7 +145,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEvent(const lldb::SBEvent &vEvent, } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBProcess event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -201,7 +195,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBProcess( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBBreakpoint event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -274,7 +267,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakPoint( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBBreakpoint event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -299,7 +291,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointLocationsAdded( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBBreakpoint event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -368,7 +359,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointCmn( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBBreakpoint added event. // Add more breakpoint information or overwrite existing information. // Normally a break point session info objects exists by now when an MI @@ -493,7 +483,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBBreakpointAdded( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBThread event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -542,7 +531,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBThread( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBThread event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -576,7 +564,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBThreadSuspended( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBThread event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -596,7 +583,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBThreadBitStackChanged( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBTarget event. // Type: Method. // Args: vEvent - (R) An LLDB broadcast event. @@ -645,7 +631,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBTarget( } //++ -//------------------------------------------------------------------------------------ // Details: Print to stdout // "=library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded="%d"[,symbols-path=\"%s\"],loaded_addr=\"0x%016" // PRIx64"\"" @@ -675,7 +660,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleTargetEventBroadcastBitModulesLoaded( } //++ -//------------------------------------------------------------------------------------ // Details: Print to stdout // "=library-unloaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded="%d"[,symbols-path=\"%s\"],loaded_addr=\"0x%016" // PRIx64"\"" @@ -705,7 +689,6 @@ bool CMICmnLLDBDebuggerHandleEvents:: } //++ -//------------------------------------------------------------------------------------ // Details: Build module information for =library-loaded/=library-unloaded: // "id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded="%d"[,symbols-path=\"%s\"],loaded_addr=\"0x%016" // PRIx64"\"" @@ -783,7 +766,6 @@ bool CMICmnLLDBDebuggerHandleEvents::MiHelpGetModuleInfo( } //++ -//------------------------------------------------------------------------------------ // Details: Handle a LLDB SBCommandInterpreter event. // Type: Method. // Args: vEvent - (R) An LLDB command interpreter event. @@ -842,7 +824,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleEventSBCommandInterpreter( } //++ -//------------------------------------------------------------------------------------ // Details: Handle SBProcess event eBroadcastBitStateChanged. // Type: Method. // Args: vEvent - (R) An LLDB event object. @@ -938,7 +919,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventBroadcastBitStateChanged( } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous event handler for LLDB Process state suspended. // Type: Method. // Args: vEvent - (R) An LLDB event object. @@ -983,7 +963,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended( } //++ -//------------------------------------------------------------------------------------ // Details: Print to stdout MI formatted text to indicate process stopped. // Type: Method. // Args: vwrbShouldBrk - (W) True = Yes break, false = do not. @@ -1052,7 +1031,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped( } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous event handler for LLDB Process stop signal. // Type: Method. // Args: vrEvent - (R) An LLDB broadcast event. @@ -1203,7 +1181,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal( } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous event handler for LLDB Process stop exception. // Type: Method. // Args: None. @@ -1244,7 +1221,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopException() { } //++ -//------------------------------------------------------------------------------------ // Details: Form partial MI response in a MI value tuple object. // Type: Method. // Args: vwrMiValueTuple - (W) MI value tuple object. @@ -1295,7 +1271,6 @@ bool CMICmnLLDBDebuggerHandleEvents::MiHelpGetCurrentThreadFrame( } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous event handler for LLDB Process stop reason breakpoint. // Type: Method. // Args: None. @@ -1325,7 +1300,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonBreakpoint() { } //++ -//------------------------------------------------------------------------------------ // Details: Form the MI Out-of-band response for stopped reason on hitting a // break point. // Type: Method. @@ -1425,7 +1399,6 @@ bool CMICmnLLDBDebuggerHandleEvents::MiStoppedAtBreakPoint( } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous event handler for LLDB Process stop reason trace. // Type: Method. // Args: None. @@ -1491,7 +1464,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopReasonTrace() { } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous function update selected thread. // Type: Method. // Args: None. @@ -1564,7 +1536,6 @@ bool CMICmnLLDBDebuggerHandleEvents::UpdateSelectedThread() { } //++ -//------------------------------------------------------------------------------------ // Details: Print to stdout "*running,thread-id=\"all\"", "(gdb)". // Type: Method. // Args: None. @@ -1584,7 +1555,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateRunning() { } //++ -//------------------------------------------------------------------------------------ // Details: Print to stdout "=thread-exited,id=\"%ld\",group-id=\"i1\"", // "=thread-group-exited,id=\"i1\",exit-code=\"0\""), // "*stopped,reason=\"exited-normally\"", @@ -1628,7 +1598,6 @@ bool CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateExited() { } //++ -//------------------------------------------------------------------------------------ // Details: Drain all stdout so we don't see any output come after we print our // prompts. // The process has stuff waiting for stdout; get it and write it out to @@ -1684,7 +1653,6 @@ bool CMICmnLLDBDebuggerHandleEvents::GetProcessStdout() { } //++ -//------------------------------------------------------------------------------------ // Details: Drain all stderr so we don't see any output come after we print our // prompts. // The process has stuff waiting for stderr; get it and write it out to @@ -1739,7 +1707,6 @@ bool CMICmnLLDBDebuggerHandleEvents::GetProcessStderr() { } //++ -//------------------------------------------------------------------------------------ // Details: Asynchronous event function check for state changes. // Type: Method. // Args: None. @@ -1835,7 +1802,6 @@ bool CMICmnLLDBDebuggerHandleEvents::ChkForStateChanges() { } //++ -//------------------------------------------------------------------------------------ // Details: Take a fully formed MI result record and send to the stdout stream. // Also output to the MI Log file. // Type: Method. @@ -1850,7 +1816,6 @@ bool CMICmnLLDBDebuggerHandleEvents::MiResultRecordToStdout( } //++ -//------------------------------------------------------------------------------------ // Details: Take a fully formed MI Out-of-band record and send to the stdout // stream. // Also output to the MI Log file. @@ -1866,7 +1831,6 @@ bool CMICmnLLDBDebuggerHandleEvents::MiOutOfBandRecordToStdout( } //++ -//------------------------------------------------------------------------------------ // Details: Take a text data and send to the stdout stream. Also output to the // MI Log // file. @@ -1881,7 +1845,6 @@ bool CMICmnLLDBDebuggerHandleEvents::TextToStdout(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Take a text data and send to the stderr stream. Also output to the // MI Log // file. @@ -1896,7 +1859,6 @@ bool CMICmnLLDBDebuggerHandleEvents::TextToStderr(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize the member variables with the signal values in this // process // file. diff --git a/lldb/tools/lldb-mi/MICmnLLDBProxySBValue.cpp b/lldb/tools/lldb-mi/MICmnLLDBProxySBValue.cpp index 865d8a0..14e39cd 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBProxySBValue.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBProxySBValue.cpp @@ -17,7 +17,6 @@ #include "MIUtilString.h" //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the numerical value from the SBValue object. If the // function fails // it could indicate the SBValue object does not represent an internal @@ -51,7 +50,6 @@ bool CMICmnLLDBProxySBValue::GetValueAsUnsigned(const lldb::SBValue &vrValue, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the numerical value from the SBValue object. If the // function fails // it could indicate the SBValue object does not represent an internal @@ -85,7 +83,6 @@ bool CMICmnLLDBProxySBValue::GetValueAsSigned(const lldb::SBValue &vrValue, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the NUL terminated string from the SBValue object if it of // the type // unsigned char *. diff --git a/lldb/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp b/lldb/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp index 06d5aea..0e7df52 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp @@ -21,7 +21,6 @@ static const char *kUnknownValue = "??"; static const char *kUnresolvedCompositeValue = "{...}"; //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBUtilSBValue constructor. // Type: Method. // Args: vrValue - (R) The LLDB value object. @@ -41,7 +40,6 @@ CMICmnLLDBUtilSBValue::CMICmnLLDBUtilSBValue( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLLDBUtilSBValue destructor. // Type: Method. // Args: None. @@ -51,7 +49,6 @@ CMICmnLLDBUtilSBValue::CMICmnLLDBUtilSBValue( CMICmnLLDBUtilSBValue::~CMICmnLLDBUtilSBValue() {} //++ -//------------------------------------------------------------------------------------ // Details: Retrieve from the LLDB SB Value object the name of the variable. If // the name // is invalid (or the SBValue object invalid) then "??" is returned. @@ -68,7 +65,6 @@ CMIUtilString CMICmnLLDBUtilSBValue::GetName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve from the LLDB SB Value object the value of the variable // described in // text. If the value is invalid (or the SBValue object invalid) then @@ -119,7 +115,6 @@ CMIUtilString CMICmnLLDBUtilSBValue::GetValue( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve from the LLDB SB Value object the value of the variable // described in // text if it has a simple format (not composite). @@ -246,7 +241,6 @@ CMICmnLLDBUtilSBValue::GetValueSummary(bool valueOnly, } //++ -//------------------------------------------------------------------------------------ // Details: Check that basic type is a char type. Char type can be signed or // unsigned. // Type: Static. @@ -268,7 +262,6 @@ bool CMICmnLLDBUtilSBValue::IsCharBasicType(lldb::BasicType eType) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the flag stating whether this value object is a char type // or some // other type. Char type can be signed or unsigned. @@ -283,7 +276,6 @@ bool CMICmnLLDBUtilSBValue::IsCharType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the flag stating whether first child value object of *this // object is // a char type or some other type. Returns false if there are not @@ -307,7 +299,6 @@ bool CMICmnLLDBUtilSBValue::IsFirstChildCharType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the flag stating whether pointee object of *this object is // a char type or some other type. Returns false if there are not // children. Char @@ -330,7 +321,6 @@ bool CMICmnLLDBUtilSBValue::IsPointeeCharType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the flag stating whether this value object is a integer // type or some // other type. Char type can be signed or unsigned and short or @@ -355,7 +345,6 @@ bool CMICmnLLDBUtilSBValue::IsIntegerType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the flag stating whether this value object is a pointer // type or some // other type. @@ -369,7 +358,6 @@ bool CMICmnLLDBUtilSBValue::IsPointerType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the flag stating whether this value object is an array type // or some // other type. @@ -383,7 +371,6 @@ bool CMICmnLLDBUtilSBValue::IsArrayType() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the C string data of value object by read the memory where // the // variable is held. @@ -418,7 +405,6 @@ CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory(lldb::SBValue &vrValue, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state of the value object's name. // Type: Method. // Args: None. @@ -431,7 +417,6 @@ bool CMICmnLLDBUtilSBValue::IsNameUnknown() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the state of the value object's value data. // Type: Method. // Args: None. @@ -444,7 +429,6 @@ bool CMICmnLLDBUtilSBValue::IsValueUnknown() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value object's type name if valid. // Type: Method. // Args: None. @@ -459,7 +443,6 @@ CMIUtilString CMICmnLLDBUtilSBValue::GetTypeName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value object's display type name if valid. // Type: Method. // Args: None. @@ -474,7 +457,6 @@ CMIUtilString CMICmnLLDBUtilSBValue::GetTypeNameDisplay() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve whether the value object's is valid or not. // Type: Method. // Args: None. @@ -484,7 +466,6 @@ CMIUtilString CMICmnLLDBUtilSBValue::GetTypeNameDisplay() const { bool CMICmnLLDBUtilSBValue::IsValid() const { return m_bValidSBValue; } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the value object' has a name. A value object can be valid // but still // have no name which suggest it is not a variable. @@ -505,7 +486,6 @@ bool CMICmnLLDBUtilSBValue::HasName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Determine if the value object' represents a LLDB variable i.e. "$0". // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnLog.cpp b/lldb/tools/lldb-mi/MICmnLog.cpp index 5597184..fc4c314 100644 --- a/lldb/tools/lldb-mi/MICmnLog.cpp +++ b/lldb/tools/lldb-mi/MICmnLog.cpp @@ -14,7 +14,6 @@ #include "MIUtilDateTimeStd.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLog constructor. // Type: Method. // Args: None. @@ -26,7 +25,6 @@ CMICmnLog::CMICmnLog() : m_bEnabled(false), m_bInitializingATM(false) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLog destructor. // Type: Method. // Args: None. @@ -36,7 +34,6 @@ CMICmnLog::CMICmnLog() : m_bEnabled(false), m_bInitializingATM(false) { CMICmnLog::~CMICmnLog() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Logger. // Type: Method. // Args: None. @@ -94,7 +91,6 @@ bool CMICmnLog::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Logger. // Type: Method. // Args: None. @@ -119,7 +115,6 @@ bool CMICmnLog::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Enabled or disable *this Logger from writing any data to registered // clients. // Type: Method. @@ -135,7 +130,6 @@ bool CMICmnLog::SetEnabled(const bool vbYes) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve state whether *this Logger is enabled writing data to // registered clients. // Type: Method. @@ -147,7 +141,6 @@ bool CMICmnLog::SetEnabled(const bool vbYes) { bool CMICmnLog::GetEnabled() const { return m_bEnabled; } //++ -//------------------------------------------------------------------------------------ // Details: Unregister all the Mediums registered with *this Logger. // Type: Method. // Args: None. @@ -168,7 +161,6 @@ bool CMICmnLog::UnregisterMediumAll() { } //++ -//------------------------------------------------------------------------------------ // Details: Register a Medium with *this Logger. // Type: Method. // Args: vrMedium - (R) The medium to register. @@ -197,7 +189,6 @@ bool CMICmnLog::RegisterMedium(const IMedium &vrMedium) { } //++ -//------------------------------------------------------------------------------------ // Details: Query the Logger to see if a medium is already registered. // Type: Method. // Args: vrMedium - (R) The medium to query. @@ -212,7 +203,6 @@ bool CMICmnLog::HaveMediumAlready(const IMedium &vrMedium) const { } //++ -//------------------------------------------------------------------------------------ // Details: Unregister a medium from the Logger. // Type: Method. // Args: vrMedium - (R) The medium to unregister. @@ -228,7 +218,6 @@ bool CMICmnLog::UnregisterMedium(const IMedium &vrMedium) { } //++ -//------------------------------------------------------------------------------------ // Details: The callee client uses this function to write to the Logger. The // data to be // written is given out to all the mediums registered. The verbosity @@ -293,7 +282,6 @@ bool CMICmnLog::Write(const CMIUtilString &vData, const ELogVerbosity veType) { } //++ -//------------------------------------------------------------------------------------ // Details: Short cut function call to write only to the Log file. // The logger must be initialized successfully before a write to any // registered @@ -309,7 +297,6 @@ bool CMICmnLog::WriteLog(const CMIUtilString &vData) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve a string detailing the last error. // Type: Method. // Args: None, @@ -321,7 +308,6 @@ const CMIUtilString &CMICmnLog::GetErrorDescription() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the internal description of the last error. // Type: Method. // Args: (R) String containing a description of the last error. @@ -333,7 +319,6 @@ void CMICmnLog::SetErrorDescription(const CMIUtilString &vrTxt) const { } //++ -//------------------------------------------------------------------------------------ // Details: Clear the last error. // Type: None. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp b/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp index 20449cf..7fbe28f 100644 --- a/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp +++ b/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp @@ -11,7 +11,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLogMediumFile constructor. // Type: Method. // Args: None. @@ -29,7 +28,6 @@ CMICmnLogMediumFile::CMICmnLogMediumFile() m_fileHeaderTxt(MIRSRC(IDS_MEDIUMFILE_ERR_FILE_HEADER)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnLogMediumFile destructor. // Type: Overridden. // Args: None. @@ -39,7 +37,6 @@ CMICmnLogMediumFile::CMICmnLogMediumFile() CMICmnLogMediumFile::~CMICmnLogMediumFile() {} //++ -//------------------------------------------------------------------------------------ // Details: Get the singleton instance of *this class. // Type: Static. // Args: None. @@ -53,7 +50,6 @@ CMICmnLogMediumFile &CMICmnLogMediumFile::Instance() { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize setup *this medium ready for use. // Type: Overridden. // Args: None. @@ -67,7 +63,6 @@ bool CMICmnLogMediumFile::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Unbind detach or release resources used by *this medium. // Type: Method. // Args: None. @@ -83,7 +78,6 @@ bool CMICmnLogMediumFile::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the name of *this medium. // Type: Overridden. // Args: None. @@ -95,7 +89,6 @@ const CMIUtilString &CMICmnLogMediumFile::GetName() const { } //++ -//------------------------------------------------------------------------------------ // Details: The callee client calls the write function on the Logger. The data // to be // written is given out to all the mediums registered. The verbosity @@ -132,7 +125,6 @@ bool CMICmnLogMediumFile::Write(const CMIUtilString &vData, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve *this medium's last error condition. // Type: Method. // Args: None. @@ -144,7 +136,6 @@ const CMIUtilString &CMICmnLogMediumFile::GetError() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the verbosity mode for this medium. // Type: Method. // Args: veType - (R) Mask value. @@ -158,7 +149,6 @@ bool CMICmnLogMediumFile::SetVerbosity(const MIuint veType) { } //++ -//------------------------------------------------------------------------------------ // Details: Get the verbosity mode for this medium. // Type: Method. // Args: veType - (R) Mask value. @@ -168,7 +158,6 @@ bool CMICmnLogMediumFile::SetVerbosity(const MIuint veType) { MIuint CMICmnLogMediumFile::GetVerbosity() const { return m_eVerbosityType; } //++ -//------------------------------------------------------------------------------------ // Details: Write data to a file English font. // Type: Method. // Args: vData - (R) The data to write to the logger. @@ -180,7 +169,6 @@ bool CMICmnLogMediumFile::FileWriteEnglish(const CMIUtilString &vData) { } //++ -//------------------------------------------------------------------------------------ // Details: Determine and form the medium file's directory path and name. // Type: Method. // Args: None. @@ -210,7 +198,6 @@ bool CMICmnLogMediumFile::FileFormFileNamePath() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the medium file's directory path and name. // Type: Method. // Args: None. @@ -222,7 +209,6 @@ const CMIUtilString &CMICmnLogMediumFile::GetFileNamePath() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the medium file's name. // Type: Method. // Args: None. @@ -234,7 +220,6 @@ const CMIUtilString &CMICmnLogMediumFile::GetFileName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Massage the data to behave correct when submitted to file. Insert // extra log // specific text. The veType is there to allow in the future to parse @@ -272,7 +257,6 @@ CMICmnLogMediumFile::MassagedData(const CMIUtilString &vData, } //++ -//------------------------------------------------------------------------------------ // Details: Convert the Log's verbosity type number into a single char // character. // Type: Method. @@ -299,7 +283,6 @@ char CMICmnLogMediumFile::ConvertLogVerbosityTypeToId( } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve state of whether the file medium is ok. // Type: Method. // Args: None. @@ -310,7 +293,6 @@ char CMICmnLogMediumFile::ConvertLogVerbosityTypeToId( bool CMICmnLogMediumFile::IsOk() const { return m_file.IsOk(); } //++ -//------------------------------------------------------------------------------------ // Details: Status on the file log medium existing already. // Type: Method. // Args: None. @@ -323,7 +305,6 @@ bool CMICmnLogMediumFile::IsFileExist() const { } //++ -//------------------------------------------------------------------------------------ // Details: Write the header text the logger file. // Type: Method. // Args: vText - (R) Text. @@ -336,7 +317,6 @@ bool CMICmnLogMediumFile::FileWriteHeader() { } //++ -//------------------------------------------------------------------------------------ // Details: Convert any carriage line returns to be compatible with the platform // the // Log file is being written to. @@ -365,7 +345,6 @@ CMIUtilString CMICmnLogMediumFile::ConvertCr(const CMIUtilString &vData) const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the header text that is written to the logger file at the // beginning. // Type: Method. @@ -381,7 +360,6 @@ bool CMICmnLogMediumFile::SetHeaderTxt(const CMIUtilString &vText) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the file current carriage line return characters used. // Type: Method. // Args: None. @@ -393,7 +371,6 @@ const CMIUtilString &CMICmnLogMediumFile::GetLineReturn() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the directory to place the log file. // Type: Method. // Args: vPath - (R) Path to log. diff --git a/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp b/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp index 778043a..6cef283 100644 --- a/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp +++ b/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp @@ -99,7 +99,6 @@ MapOutOfBandToToken(CMICmnMIOutOfBandRecord::OutOfBand_e veType) { } //++ -//------------------------------------------------------------------------------------ // Details: Build the Out-of-band record's mandatory data part. The part up to // the first // (additional) result i.e. async-record ==> "*" type. @@ -116,7 +115,6 @@ BuildAsyncRecord(CMICmnMIOutOfBandRecord::OutOfBand_e veType) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIOutOfBandRecord constructor. // Type: Method. // Args: None. @@ -127,7 +125,6 @@ CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord() : m_strAsyncRecord(MIRSRC(IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIOutOfBandRecord constructor. // Type: Method. // Args: veType - (R) A MI Out-of-Bound enumeration. @@ -138,7 +135,6 @@ CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord(OutOfBand_e veType) : m_strAsyncRecord(BuildAsyncRecord(veType)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIOutOfBandRecord constructor. // Type: Method. // Args: veType - (R) A MI Out-of-Bound enumeration. @@ -153,7 +149,6 @@ CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIOutOfBandRecord constructor. // Type: Method. // Args: veType - (R) A MI Out-of-Bound enumeration. @@ -168,7 +163,6 @@ CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord( } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIOutOfBandRecord destructor. // Type: Overrideable. // Args: None. @@ -178,7 +172,6 @@ CMICmnMIOutOfBandRecord::CMICmnMIOutOfBandRecord( CMICmnMIOutOfBandRecord::~CMICmnMIOutOfBandRecord() {} //++ -//------------------------------------------------------------------------------------ // Details: Return the MI Out-of-band record as a string. The string is a direct // result of // work done on *this Out-of-band record so if not enough data is added @@ -197,7 +190,6 @@ const CMIUtilString &CMICmnMIOutOfBandRecord::GetString() const { } //++ -//------------------------------------------------------------------------------------ // Details: Add to *this Out-of-band record additional information. // Type: Method. // Args: vResult - (R) A MI result object. diff --git a/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp b/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp index b56c3ad..00d1ce1 100644 --- a/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp +++ b/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp @@ -14,7 +14,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: Map a result class to the corresponding string. // Args: veType - (R) A MI result class enumeration. // Return: const char* - The string corresponding to the result class. @@ -39,7 +38,6 @@ MapResultClassToResultClassText(CMICmnMIResultRecord::ResultClass_e veType) { } //++ -//------------------------------------------------------------------------------------ // Details: Build the result record's mandatory data part. The part up to the // first // (additional) result i.e. result-record ==> [ token ] "^" @@ -58,7 +56,6 @@ BuildResultRecord(const CMIUtilString &vrToken, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord constructor. // Type: Method. // Args: None. @@ -69,7 +66,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord() : m_strResultRecord(MIRSRC(IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord constructor. // Type: Method. // Args: vrToken - (R) The command's transaction ID or token. @@ -82,7 +78,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, : m_strResultRecord(BuildResultRecord(vrToken, veType)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord constructor. // Type: Method. // Args: vrToken - (R) The command's transaction ID or token. @@ -99,7 +94,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIResultRecord destructor. // Type: Overrideable. // Args: None. @@ -109,7 +103,6 @@ CMICmnMIResultRecord::CMICmnMIResultRecord(const CMIUtilString &vrToken, CMICmnMIResultRecord::~CMICmnMIResultRecord() {} //++ -//------------------------------------------------------------------------------------ // Details: Return the MI result record as a string. The string is a direct // result of // work done on *this result record so if not enough data is added then @@ -128,7 +121,6 @@ const CMIUtilString &CMICmnMIResultRecord::GetString() const { } //++ -//------------------------------------------------------------------------------------ // Details: Add to *this result record additional information. // Type: Method. // Args: vMIValue - (R) A MI value derived object. diff --git a/lldb/tools/lldb-mi/MICmnMIValue.cpp b/lldb/tools/lldb-mi/MICmnMIValue.cpp index 7f3f759..05ed71e 100644 --- a/lldb/tools/lldb-mi/MICmnMIValue.cpp +++ b/lldb/tools/lldb-mi/MICmnMIValue.cpp @@ -11,7 +11,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValue constructor. // Type: Method. // Args: None. @@ -22,7 +21,6 @@ CMICmnMIValue::CMICmnMIValue() : m_strValue(MIRSRC(IDS_WORD_INVALIDBRKTS)), m_bJustConstructed(true) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValue destructor. // Type: Overrideable. // Args: None. @@ -32,7 +30,6 @@ CMICmnMIValue::CMICmnMIValue() CMICmnMIValue::~CMICmnMIValue() {} //++ -//------------------------------------------------------------------------------------ // Details: Return the MI value as a string. The string is a direct result of // work done on *this value so if not enough data is added then it is // possible to return a malformed value. If nothing has been set or diff --git a/lldb/tools/lldb-mi/MICmnMIValueConst.cpp b/lldb/tools/lldb-mi/MICmnMIValueConst.cpp index 5f3b134..1cdbc64 100644 --- a/lldb/tools/lldb-mi/MICmnMIValueConst.cpp +++ b/lldb/tools/lldb-mi/MICmnMIValueConst.cpp @@ -13,7 +13,6 @@ const CMIUtilString CMICmnMIValueConst::ms_constStrDblQuote("\""); //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueConst constructor. // Type: Method. // Args: vString - (R) MI Const c-string value. @@ -26,7 +25,6 @@ CMICmnMIValueConst::CMICmnMIValueConst(const CMIUtilString &vString) } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueConst constructor. // Type: Method. // Args: vString - (R) MI Const c-string value. @@ -42,7 +40,6 @@ CMICmnMIValueConst::CMICmnMIValueConst(const CMIUtilString &vString, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueConst destructor. // Type: Overrideable. // Args: None. @@ -52,7 +49,6 @@ CMICmnMIValueConst::CMICmnMIValueConst(const CMIUtilString &vString, CMICmnMIValueConst::~CMICmnMIValueConst() {} //++ -//------------------------------------------------------------------------------------ // Details: Build the Value Const data. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnMIValueList.cpp b/lldb/tools/lldb-mi/MICmnMIValueList.cpp index 3bda4a4..038d3ae 100644 --- a/lldb/tools/lldb-mi/MICmnMIValueList.cpp +++ b/lldb/tools/lldb-mi/MICmnMIValueList.cpp @@ -11,7 +11,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueList constructor. // Type: Method. // Args: vbValueTypeList - (R) True = yes value type list, false = result @@ -24,7 +23,6 @@ CMICmnMIValueList::CMICmnMIValueList(const bool vbValueTypeList) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueList constructor. // Construct a results only list. // return MIstatus::failure. @@ -40,7 +38,6 @@ CMICmnMIValueList::CMICmnMIValueList(const CMICmnMIValueResult &vResult) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueList constructor. // Construct a value only list. // Type: Method. @@ -55,7 +52,6 @@ CMICmnMIValueList::CMICmnMIValueList(const CMICmnMIValue &vValue) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueList destructor. // Type: Overrideable. // Args: None. @@ -65,7 +61,6 @@ CMICmnMIValueList::CMICmnMIValueList(const CMICmnMIValue &vValue) { CMICmnMIValueList::~CMICmnMIValueList() {} //++ -//------------------------------------------------------------------------------------ // Details: Build the result value's mandatory data part, one tuple // Type: Method. // Args: None. @@ -78,7 +73,6 @@ void CMICmnMIValueList::BuildList() { } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI result object to the value list's of list is // results. // Only result objects can be added to a list of result otherwise this @@ -94,7 +88,6 @@ void CMICmnMIValueList::Add(const CMICmnMIValueResult &vResult) { } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI value object to the value list's of list is values. // Only values objects can be added to a list of values otherwise this // function @@ -107,7 +100,6 @@ void CMICmnMIValueList::Add(const CMICmnMIValueResult &vResult) { void CMICmnMIValueList::Add(const CMICmnMIValue &vValue) { BuildList(vValue); } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI result object to the value list's of list is // results. // Only result objects can be added to a list of result otherwise this @@ -134,7 +126,6 @@ void CMICmnMIValueList::BuildList(const CMICmnMIValueResult &vResult) { } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI value object to the value list's of list is values. // Only values objects can be added to a list of values otherwise this // function @@ -164,7 +155,6 @@ void CMICmnMIValueList::BuildList(const CMICmnMIValue &vValue) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the contents of *this value object but without the outer // most // brackets. diff --git a/lldb/tools/lldb-mi/MICmnMIValueResult.cpp b/lldb/tools/lldb-mi/MICmnMIValueResult.cpp index 27b8310..5ef6074 100644 --- a/lldb/tools/lldb-mi/MICmnMIValueResult.cpp +++ b/lldb/tools/lldb-mi/MICmnMIValueResult.cpp @@ -14,7 +14,6 @@ const CMIUtilString CMICmnMIValueResult::ms_constStrEqual("="); //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueResult constructor. // Type: Method. // Args: None. @@ -24,7 +23,6 @@ const CMIUtilString CMICmnMIValueResult::ms_constStrEqual("="); CMICmnMIValueResult::CMICmnMIValueResult() : m_bEmptyConstruction(true) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueResult constructor. // Type: Method. // Args: vrVariable - (R) MI value's name. @@ -40,7 +38,6 @@ CMICmnMIValueResult::CMICmnMIValueResult(const CMIUtilString &vrVariable, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueResult constructor. // Type: Method. // Args: vrVariable - (R) MI value's name. @@ -59,7 +56,6 @@ CMICmnMIValueResult::CMICmnMIValueResult(const CMIUtilString &vrVariable, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueResult destructor. // Type: Overrideable. // Args: None. @@ -69,7 +65,6 @@ CMICmnMIValueResult::CMICmnMIValueResult(const CMIUtilString &vrVariable, CMICmnMIValueResult::~CMICmnMIValueResult() {} //++ -//------------------------------------------------------------------------------------ // Details: Build the MI value result string. // Type: Method. // Args: None. @@ -84,7 +79,6 @@ void CMICmnMIValueResult::BuildResult() { } //++ -//------------------------------------------------------------------------------------ // Details: Build the MI value result string. // Type: Method. // Args: vrVariable - (R) MI value's name. @@ -101,7 +95,6 @@ void CMICmnMIValueResult::BuildResult(const CMIUtilString &vVariable, } //++ -//------------------------------------------------------------------------------------ // Details: Append another MI value object to *this MI value result. // Type: Method. // Args: vrVariable - (R) MI value's name. diff --git a/lldb/tools/lldb-mi/MICmnMIValueTuple.cpp b/lldb/tools/lldb-mi/MICmnMIValueTuple.cpp index fc93c33..2f05d21 100644 --- a/lldb/tools/lldb-mi/MICmnMIValueTuple.cpp +++ b/lldb/tools/lldb-mi/MICmnMIValueTuple.cpp @@ -10,7 +10,6 @@ #include "MICmnMIValueTuple.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueTuple constructor. // Type: Method. // Args: None. @@ -22,7 +21,6 @@ CMICmnMIValueTuple::CMICmnMIValueTuple() : m_bSpaceAfterComma(false) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueTuple constructor. // Type: Method. // Args: vResult - (R) MI result object. @@ -37,7 +35,6 @@ CMICmnMIValueTuple::CMICmnMIValueTuple(const CMICmnMIValueResult &vResult) } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueTuple constructor. // Type: Method. // Args: vResult - (R) MI result object. @@ -55,7 +52,6 @@ CMICmnMIValueTuple::CMICmnMIValueTuple(const CMICmnMIValueResult &vResult, } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnMIValueTuple destructor. // Type: Overrideable. // Args: None. @@ -65,7 +61,6 @@ CMICmnMIValueTuple::CMICmnMIValueTuple(const CMICmnMIValueResult &vResult, CMICmnMIValueTuple::~CMICmnMIValueTuple() {} //++ -//------------------------------------------------------------------------------------ // Details: Build the result value's mandatory data part, one tuple // Type: Method. // Args: None. @@ -78,7 +73,6 @@ void CMICmnMIValueTuple::BuildTuple() { } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI result object to the value's list of tuples. // Type: Method. // Args: vResult - (R) The MI result object. @@ -107,7 +101,6 @@ void CMICmnMIValueTuple::BuildTuple(const CMICmnMIValueResult &vResult) { } //++ -//------------------------------------------------------------------------------------ // Details: Add string value to the value's list of tuples. // Type: Method. // Args: vValue - (R) The string object. @@ -129,7 +122,6 @@ void CMICmnMIValueTuple::BuildTuple(const CMIUtilString &vValue) { } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI value object to the value list's of list is values. // Only values objects can be added to a list of values otherwise this // function @@ -144,7 +136,6 @@ void CMICmnMIValueTuple::Add(const CMICmnMIValueResult &vResult) { } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI value object to the value list's of list is values. // Only values objects can be added to a list of values otherwise this // function @@ -163,7 +154,6 @@ void CMICmnMIValueTuple::Add(const CMICmnMIValueResult &vResult, } //++ -//------------------------------------------------------------------------------------ // Details: Add another MI value object to the value list's of list is values. // Only values objects can be added to a list of values otherwise this // function @@ -182,7 +172,6 @@ void CMICmnMIValueTuple::Add(const CMICmnMIValueConst &vValue, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the contents of *this value object but without the outer // most // brackets. diff --git a/lldb/tools/lldb-mi/MICmnResources.cpp b/lldb/tools/lldb-mi/MICmnResources.cpp index 3866dec..3925f0b 100644 --- a/lldb/tools/lldb-mi/MICmnResources.cpp +++ b/lldb/tools/lldb-mi/MICmnResources.cpp @@ -461,7 +461,6 @@ const CMICmnResources::SRsrcTextData "Command '%s'. Must specify either a PID or a Name"}}; //++ -//------------------------------------------------------------------------------------ // Details: CMICmnResources constructor. // Type: Method. // Args: None. @@ -473,7 +472,6 @@ CMICmnResources::CMICmnResources() : m_nResourceId2TextDataSize(0) { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmnResources destructor. // Type: Overridden. // Args: None. @@ -485,7 +483,6 @@ CMICmnResources::~CMICmnResources() { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize the resources and set locality for the server. // Type: Method. // Args: None. @@ -505,7 +502,6 @@ bool CMICmnResources::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this object. // Type: Method. // Args: None. @@ -529,7 +525,6 @@ bool CMICmnResources::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize the resources and set locality for the server. // Type: Method. // Args: None. @@ -550,7 +545,6 @@ bool CMICmnResources::ReadResourceStringData() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the corresponding text assigned to the resource ID. // Type: Method. // Args: vResourceId - (R) MI resource ID. @@ -567,7 +561,6 @@ CMIUtilString CMICmnResources::GetString(const MIuint vResourceId) const { } //++ -//------------------------------------------------------------------------------------ // Details: Determine the MI resource ID existings. // Type: Method. // Args: vResourceId - (R) MI resource ID. @@ -581,7 +574,6 @@ bool CMICmnResources::HasString(const MIuint vResourceId) const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the resource text data for the given resource ID. If a // resource ID // cannot be found and error is given returning the ID of the resource diff --git a/lldb/tools/lldb-mi/MICmnStreamStderr.cpp b/lldb/tools/lldb-mi/MICmnStreamStderr.cpp index 09d9cf8..f4f6a3a 100644 --- a/lldb/tools/lldb-mi/MICmnStreamStderr.cpp +++ b/lldb/tools/lldb-mi/MICmnStreamStderr.cpp @@ -14,7 +14,6 @@ #include "MIDriver.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnStreamStderr constructor. // Type: Method. // Args: None. @@ -24,7 +23,6 @@ CMICmnStreamStderr::CMICmnStreamStderr() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnStreamStderr destructor. // Type: Overridable. // Args: None. @@ -34,7 +32,6 @@ CMICmnStreamStderr::CMICmnStreamStderr() {} CMICmnStreamStderr::~CMICmnStreamStderr() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this stderr stream. // Type: Method. // Args: None. @@ -64,7 +61,6 @@ bool CMICmnStreamStderr::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this stderr stream. // Type: Method. // Args: None. @@ -87,7 +83,6 @@ bool CMICmnStreamStderr::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Write text data to stderr. Prefix the message with "MI:". The text // data does // not need to include a carriage line return as this is added to the @@ -114,7 +109,6 @@ bool CMICmnStreamStderr::Write(const CMIUtilString &vText, } //++ -//------------------------------------------------------------------------------------ // Details: Write an LLDB text message to stderr. // The text data does not need to include a carriage line return as // this is added @@ -141,7 +135,6 @@ bool CMICmnStreamStderr::WriteLLDBMsg(const CMIUtilString &vText, } //++ -//------------------------------------------------------------------------------------ // Details: Write text data to stderr. The text data does not need to // include a carriage line return as this is added to the text. The // function also @@ -188,7 +181,6 @@ bool CMICmnStreamStderr::WritePriv(const CMIUtilString &vText, } //++ -//------------------------------------------------------------------------------------ // Details: Lock the availability of the stream stderr. Other users of *this // stream will // be stalled until it is available (Unlock()). @@ -204,7 +196,6 @@ bool CMICmnStreamStderr::Lock() { } //++ -//------------------------------------------------------------------------------------ // Details: Release a previously locked stderr. // Type: Method. // Args: None. @@ -218,7 +209,6 @@ bool CMICmnStreamStderr::Unlock() { } //++ -//------------------------------------------------------------------------------------ // Details: Take MI Driver text message and send to the stderr stream. Also // output to the // MI Log file. @@ -237,7 +227,6 @@ bool CMICmnStreamStderr::TextToStderr(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Take an LLDB message and send to the stderr stream. The message is // not always // an error message. The user has typed a command in to the Eclipse diff --git a/lldb/tools/lldb-mi/MICmnStreamStdin.cpp b/lldb/tools/lldb-mi/MICmnStreamStdin.cpp index 7b48bf3..4084b36 100644 --- a/lldb/tools/lldb-mi/MICmnStreamStdin.cpp +++ b/lldb/tools/lldb-mi/MICmnStreamStdin.cpp @@ -21,7 +21,6 @@ #include "MIUtilSingletonHelper.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnStreamStdin constructor. // Type: Method. // Args: None. @@ -32,7 +31,6 @@ CMICmnStreamStdin::CMICmnStreamStdin() : m_strPromptCurrent("(gdb)"), m_bShowPrompt(true), m_pCmdBuffer(nullptr) {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnStreamStdin destructor. // Type: Overridable. // Args: None. @@ -42,7 +40,6 @@ CMICmnStreamStdin::CMICmnStreamStdin() CMICmnStreamStdin::~CMICmnStreamStdin() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Stdin stream. // Type: Method. // Args: None. @@ -79,7 +76,6 @@ bool CMICmnStreamStdin::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Stdin stream. // Type: Method. // Args: None. @@ -117,7 +113,6 @@ bool CMICmnStreamStdin::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Validate and set the text that forms the prompt on the command line. // Type: Method. // Args: vNewPrompt - (R) Text description. @@ -139,7 +134,6 @@ bool CMICmnStreamStdin::SetPrompt(const CMIUtilString &vNewPrompt) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the command line prompt text currently being used. // Type: Method. // Args: None. @@ -151,7 +145,6 @@ const CMIUtilString &CMICmnStreamStdin::GetPrompt() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set whether to display optional command line prompt. The prompt is // output to // stdout. Disable it when this may interfere with the client reading @@ -169,7 +162,6 @@ void CMICmnStreamStdin::SetEnablePrompt(const bool vbYes) { } //++ -//------------------------------------------------------------------------------------ // Details: Get whether to display optional command line prompt. The prompt is // output to // stdout. Disable it when this may interfere with the client reading @@ -184,7 +176,6 @@ void CMICmnStreamStdin::SetEnablePrompt(const bool vbYes) { bool CMICmnStreamStdin::GetEnablePrompt() const { return m_bShowPrompt; } //++ -//------------------------------------------------------------------------------------ // Details: Wait on new line of data from stdin stream (completed by '\n' or // '\r'). // Type: Method. diff --git a/lldb/tools/lldb-mi/MICmnStreamStdout.cpp b/lldb/tools/lldb-mi/MICmnStreamStdout.cpp index 88b7235..4a0e2d1 100644 --- a/lldb/tools/lldb-mi/MICmnStreamStdout.cpp +++ b/lldb/tools/lldb-mi/MICmnStreamStdout.cpp @@ -13,7 +13,6 @@ #include "MIDriver.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnStreamStdout constructor. // Type: Method. // Args: None. @@ -23,7 +22,6 @@ CMICmnStreamStdout::CMICmnStreamStdout() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnStreamStdout destructor. // Type: Overridable. // Args: None. @@ -33,7 +31,6 @@ CMICmnStreamStdout::CMICmnStreamStdout() {} CMICmnStreamStdout::~CMICmnStreamStdout() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize resources for *this Stdout stream. // Type: Method. // Args: None. @@ -63,7 +60,6 @@ bool CMICmnStreamStdout::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this Stdout stream. // Type: Method. // Args: None. @@ -86,7 +82,6 @@ bool CMICmnStreamStdout::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Write an MI format type response to stdout. The text data does not // need to // include a carriage line return as this is added to the text. The @@ -106,7 +101,6 @@ bool CMICmnStreamStdout::WriteMIResponse(const CMIUtilString &vText, } //++ -//------------------------------------------------------------------------------------ // Details: Write text data to stdout. The text data does not need to // include a carriage line return as this is added to the text. The // function also @@ -132,7 +126,6 @@ bool CMICmnStreamStdout::Write(const CMIUtilString &vText, } //++ -//------------------------------------------------------------------------------------ // Details: Write text data to stdout. The text data does not need to // include a carriage line return as this is added to the text. The // function also @@ -179,7 +172,6 @@ bool CMICmnStreamStdout::WritePriv(const CMIUtilString &vText, } //++ -//------------------------------------------------------------------------------------ // Details: Lock the availability of the stream stdout. Other users of *this // stream will // be stalled until it is available (Unlock()). @@ -195,7 +187,6 @@ bool CMICmnStreamStdout::Lock() { } //++ -//------------------------------------------------------------------------------------ // Details: Release a previously locked stdout. // Type: Method. // Args: None. @@ -209,7 +200,6 @@ bool CMICmnStreamStdout::Unlock() { } //++ -//------------------------------------------------------------------------------------ // Details: Take a text data and send to the stdout stream. Also output to the // MI Log // file. @@ -225,7 +215,6 @@ bool CMICmnStreamStdout::TextToStdout(const CMIUtilString &vrTxt) { } //++ -//------------------------------------------------------------------------------------ // Details: Write prompt to stdout if it's enabled. // Type: Static method. // Args: None. diff --git a/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp b/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp index 14ad5b5..25afbbc 100644 --- a/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp +++ b/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp @@ -13,7 +13,6 @@ #include "MIUtilSingletonHelper.h" //++ -//------------------------------------------------------------------------------------ // Details: CMICmnThreadMgr constructor. // Type: Method. // Args: None. @@ -23,7 +22,6 @@ CMICmnThreadMgrStd::CMICmnThreadMgrStd() {} //++ -//------------------------------------------------------------------------------------ // Details: CMICmnThreadMgr destructor. // Type: Method. // Args: None. @@ -33,7 +31,6 @@ CMICmnThreadMgrStd::CMICmnThreadMgrStd() {} CMICmnThreadMgrStd::~CMICmnThreadMgrStd() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialise resources for *this thread manager. // Type: Method. // Args: None. @@ -70,7 +67,6 @@ bool CMICmnThreadMgrStd::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Release resources for *this thread manager. // Type: Method. // Args: None. @@ -107,7 +103,6 @@ bool CMICmnThreadMgrStd::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Ask the thread manager to kill all threads and wait until they have // died // Type: Method. @@ -134,7 +129,6 @@ bool CMICmnThreadMgrStd::ThreadAllTerminate() { } //++ -//------------------------------------------------------------------------------------ // Details: Add a thread object to *this manager's list of thread objects. The // list to // used to manage thread objects centrally. diff --git a/lldb/tools/lldb-mi/MICmnThreadMgrStd.h b/lldb/tools/lldb-mi/MICmnThreadMgrStd.h index bd8f791..ce8dd70 100644 --- a/lldb/tools/lldb-mi/MICmnThreadMgrStd.h +++ b/lldb/tools/lldb-mi/MICmnThreadMgrStd.h @@ -64,7 +64,6 @@ private: }; //++ -//------------------------------------------------------------------------------------ // Details: Given a thread object start its (worker) thread to do work. The // object is // added to the *this manager for housekeeping and deletion of all diff --git a/lldb/tools/lldb-mi/MIDataTypes.h b/lldb/tools/lldb-mi/MIDataTypes.h index 51e8903..c1ed764 100644 --- a/lldb/tools/lldb-mi/MIDataTypes.h +++ b/lldb/tools/lldb-mi/MIDataTypes.h @@ -14,7 +14,6 @@ #pragma once -//-------------------------------------------------------------------------------------- // Windows headers: #ifdef _WIN32 @@ -25,7 +24,6 @@ #endif // _WIN32 -//-------------------------------------------------------------------------------------- // Common definitions: // Function return status @@ -55,7 +53,6 @@ typedef unsigned int MIuint; #endif // _WIN32 #endif // _WIN64 -//-------------------------------------------------------------------------------------- // Common types: // Fundamentals: diff --git a/lldb/tools/lldb-mi/MIDriver.cpp b/lldb/tools/lldb-mi/MIDriver.cpp index 3cf30d6..02361f4 100644 --- a/lldb/tools/lldb-mi/MIDriver.cpp +++ b/lldb/tools/lldb-mi/MIDriver.cpp @@ -43,7 +43,6 @@ const CMIUtilString const CMIUtilString CMIDriver::ms_constAppNameLong(MIRSRC(IDS_MI_APPNAME_LONG)); //++ -//------------------------------------------------------------------------------------ // Details: CMIDriver constructor. // Type: Method. // Args: None. @@ -61,7 +60,6 @@ CMIDriver::CMIDriver() m_bHaveCommandFileNamePathOnCmdLine(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIDriver destructor. // Type: Overridden. // Args: None. @@ -71,7 +69,6 @@ CMIDriver::CMIDriver() CMIDriver::~CMIDriver() {} //++ -//------------------------------------------------------------------------------------ // Details: Set whether *this driver (the parent) is enabled to pass a command // to its // fall through (child) driver to interpret the command and do work @@ -90,7 +87,6 @@ bool CMIDriver::SetEnableFallThru(const bool vbYes) { } //++ -//------------------------------------------------------------------------------------ // Details: Get whether *this driver (the parent) is enabled to pass a command // to its // fall through (child) driver to interpret the command and do work @@ -106,7 +102,6 @@ bool CMIDriver::GetEnableFallThru() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve MI's application name of itself. // Type: Method. // Args: None. @@ -118,7 +113,6 @@ const CMIUtilString &CMIDriver::GetAppNameShort() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve MI's application name of itself. // Type: Method. // Args: None. @@ -130,7 +124,6 @@ const CMIUtilString &CMIDriver::GetAppNameLong() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve MI's version description of itself. // Type: Method. // Args: None. @@ -142,7 +135,6 @@ const CMIUtilString &CMIDriver::GetVersionDescription() const { } //++ -//------------------------------------------------------------------------------------ // Details: Initialize setup *this driver ready for use. // Type: Method. // Args: None. @@ -191,7 +183,6 @@ bool CMIDriver::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Unbind detach or release resources used by *this driver. // Type: Method. // Args: None. @@ -238,7 +229,6 @@ bool CMIDriver::Shutdown() { } //++ -//------------------------------------------------------------------------------------ // Details: Work function. Client (the driver's user) is able to append their // own message // in to the MI's Log trace file. @@ -255,7 +245,6 @@ bool CMIDriver::WriteMessageToLog(const CMIUtilString &vMessage) { } //++ -//------------------------------------------------------------------------------------ // Details: CDriverMgr calls *this driver initialize setup ready for use. // Type: Overridden. // Args: None. @@ -266,7 +255,6 @@ bool CMIDriver::WriteMessageToLog(const CMIUtilString &vMessage) { bool CMIDriver::DoInitialize() { return CMIDriver::Instance().Initialize(); } //++ -//------------------------------------------------------------------------------------ // Details: CDriverMgr calls *this driver to unbind detach or release resources // used by // *this driver. @@ -279,7 +267,6 @@ bool CMIDriver::DoInitialize() { return CMIDriver::Instance().Initialize(); } bool CMIDriver::DoShutdown() { return CMIDriver::Instance().Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the name for *this driver. // Type: Overridden. // Args: None. @@ -296,7 +283,6 @@ const CMIUtilString &CMIDriver::GetName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve *this driver's last error condition. // Type: Overridden. // Args: None. @@ -306,7 +292,6 @@ const CMIUtilString &CMIDriver::GetName() const { CMIUtilString CMIDriver::GetError() const { return GetErrorDescription(); } //++ -//------------------------------------------------------------------------------------ // Details: Call *this driver to return it's debugger. // Type: Overridden. // Args: None. @@ -318,7 +303,6 @@ lldb::SBDebugger &CMIDriver::GetTheDebugger() { } //++ -//------------------------------------------------------------------------------------ // Details: Specify another driver *this driver can call should this driver not // be able // to handle the client data input. DoFallThruToAnotherDriver() makes @@ -336,7 +320,6 @@ bool CMIDriver::SetDriverToFallThruTo(const CMIDriverBase &vrOtherDriver) { } //++ -//------------------------------------------------------------------------------------ // Details: Proxy function CMIDriverMgr IDriver interface implementation. *this // driver's // implementation called from here to match the existing function name @@ -373,7 +356,6 @@ lldb::SBError CMIDriver::DoParseArgs(const int argc, const char *argv[], } //++ -//------------------------------------------------------------------------------------ // Details: Check the arguments that were passed to this program to make sure // they are // valid and to get their argument values (if any). The following are @@ -483,7 +465,6 @@ lldb::SBError CMIDriver::ParseArgs(const int argc, const char *argv[], } //++ -//------------------------------------------------------------------------------------ // Details: A client can ask if *this driver is GDB/MI compatible. // Type: Overridden. // Args: None. @@ -494,7 +475,6 @@ lldb::SBError CMIDriver::ParseArgs(const int argc, const char *argv[], bool CMIDriver::GetDriverIsGDBMICompatibleDriver() const { return true; } //++ -//------------------------------------------------------------------------------------ // Details: Start worker threads for the driver. // Type: Method. // Args: None. @@ -521,7 +501,6 @@ bool CMIDriver::StartWorkerThreads() { } //++ -//------------------------------------------------------------------------------------ // Details: Stop worker threads for the driver. // Type: Method. // Args: None. @@ -535,7 +514,6 @@ bool CMIDriver::StopWorkerThreads() { } //++ -//------------------------------------------------------------------------------------ // Details: Call this function puts *this driver to work. // This function is used by the application's main thread. // Type: Overridden. @@ -610,7 +588,6 @@ bool CMIDriver::DoMainLoop() { } //++ -//------------------------------------------------------------------------------------ // Details: Set things in motion, set state etc that brings *this driver (and // the // application) to a tidy shutdown. @@ -634,7 +611,6 @@ bool CMIDriver::DoAppQuit() { } //++ -//------------------------------------------------------------------------------------ // Details: *this driver passes text commands to a fall through driver is it // does not // understand them (the LLDB driver). @@ -686,7 +662,6 @@ bool CMIDriver::InterpretCommandFallThruDriver(const CMIUtilString &vTextLine, } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the name for *this driver. // Type: Overridden. // Args: None. @@ -696,7 +671,6 @@ bool CMIDriver::InterpretCommandFallThruDriver(const CMIUtilString &vTextLine, const CMIUtilString &CMIDriver::GetDriverName() const { return GetName(); } //++ -//------------------------------------------------------------------------------------ // Details: Get the unique ID for *this driver. // Type: Overridden. // Args: None. @@ -706,7 +680,6 @@ const CMIUtilString &CMIDriver::GetDriverName() const { return GetName(); } const CMIUtilString &CMIDriver::GetDriverId() const { return GetId(); } //++ -//------------------------------------------------------------------------------------ // Details: This function allows *this driver to call on another driver to // perform work // should this driver not be able to handle the client data input. @@ -731,7 +704,6 @@ bool CMIDriver::DoFallThruToAnotherDriver(const CMIUtilString &vCmd, } //++ -//------------------------------------------------------------------------------------ // Details: *this driver provides a file stream to other drivers on which *this // driver // write's out to and they read as expected input. *this driver is @@ -752,7 +724,6 @@ FILE *CMIDriver::GetStdin() const { } //++ -//------------------------------------------------------------------------------------ // Details: *this driver provides a file stream to other pass through assigned // drivers // so they know what to write to. @@ -770,7 +741,6 @@ FILE *CMIDriver::GetStdout() const { } //++ -//------------------------------------------------------------------------------------ // Details: *this driver provides a error file stream to other pass through // assigned drivers // so they know what to write to. @@ -789,7 +759,6 @@ FILE *CMIDriver::GetStderr() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set a unique ID for *this driver. It cannot be empty. // Type: Overridden. // Args: vId - (R) Text description. @@ -809,7 +778,6 @@ bool CMIDriver::SetId(const CMIUtilString &vId) { } //++ -//------------------------------------------------------------------------------------ // Details: Get the unique ID for *this driver. // Type: Overridden. // Args: None. @@ -819,7 +787,6 @@ bool CMIDriver::SetId(const CMIUtilString &vId) { const CMIUtilString &CMIDriver::GetId() const { return m_strDriverId; } //++ -//------------------------------------------------------------------------------------ // Details: Interpret the text data and match against current commands to see if // there // is a match. If a match then the command is issued and actioned on. @@ -849,7 +816,6 @@ bool CMIDriver::InterpretCommand(const CMIUtilString &vTextLine) { } //++ -//------------------------------------------------------------------------------------ // Details: Helper function for CMIDriver::InterpretCommandThisDriver. // Convert a CLI command to MI command (just wrap any CLI command // into "<tokens>-interpreter-exec command \"<CLI command>\""). @@ -925,7 +891,6 @@ CMIDriver::WrapCLICommandIntoMICommand(const CMIUtilString &vTextLine) const { } //++ -//------------------------------------------------------------------------------------ // Details: Interpret the text data and match against current commands to see if // there // is a match. If a match then the command is issued and actioned on. @@ -998,7 +963,6 @@ bool CMIDriver::InterpretCommandThisDriver(const CMIUtilString &vTextLine, } //++ -//------------------------------------------------------------------------------------ // Details: Having previously had the potential command validated and found // valid now // get the command executed. @@ -1015,7 +979,6 @@ bool CMIDriver::ExecuteCommand(const SMICmdData &vCmdData) { } //++ -//------------------------------------------------------------------------------------ // Details: Set the MI Driver's exit application flag. The application checks // this flag // after every stdin line is read so the exit may not be instantaneous. @@ -1048,7 +1011,6 @@ void CMIDriver::SetExitApplicationFlag(const bool vbForceExit) { } //++ -//------------------------------------------------------------------------------------ // Details: Get the MI Driver's exit exit application flag. // This is related to the running state of the MI driver. // Type: Method. @@ -1060,7 +1022,6 @@ void CMIDriver::SetExitApplicationFlag(const bool vbForceExit) { bool CMIDriver::GetExitApplicationFlag() const { return m_bExitApp; } //++ -//------------------------------------------------------------------------------------ // Details: Get the current running state of the MI Driver. // Type: Method. // Args: None. @@ -1072,7 +1033,6 @@ CMIDriver::DriverState_e CMIDriver::GetCurrentDriverState() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the current running state of the MI Driver to running and // currently not in // a debug session. @@ -1119,7 +1079,6 @@ bool CMIDriver::SetDriverStateRunningNotDebugging() { } //++ -//------------------------------------------------------------------------------------ // Details: Set the current running state of the MI Driver to running and // currently not in // a debug session. The driver's state must in the state running and in @@ -1168,7 +1127,6 @@ bool CMIDriver::SetDriverStateRunningDebugging() { } //++ -//------------------------------------------------------------------------------------ // Details: Prepare the client IDE so it will start working/communicating with // *this MI // driver. @@ -1184,7 +1142,6 @@ bool CMIDriver::InitClientIDEToMIDriver() const { } //++ -//------------------------------------------------------------------------------------ // Details: The IDE Eclipse when debugging locally expects "(gdb)\n" character // sequence otherwise it refuses to communicate and times out. This // should be @@ -1200,7 +1157,6 @@ bool CMIDriver::InitClientIDEEclipse() const { } //++ -//------------------------------------------------------------------------------------ // Details: Ask *this driver whether it found an executable in the MI Driver's // list of // arguments which to open and debug. If so instigate commands to set @@ -1219,7 +1175,6 @@ bool CMIDriver::HaveExecutableFileNamePathOnCmdLine() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve from *this driver executable file name path to start a // debug session // with (if present see HaveExecutableFileNamePathOnCmdLine()). @@ -1233,7 +1188,6 @@ const CMIUtilString &CMIDriver::GetExecutableFileNamePathOnCmdLine() const { } //++ -//------------------------------------------------------------------------------------ // Details: Execute commands (by injecting them into the stdin line queue // container) and // other code to set up the MI Driver such that is can take the @@ -1256,7 +1210,6 @@ bool CMIDriver::LocalDebugSessionStartupExecuteCommands() { } //++ -//------------------------------------------------------------------------------------ // Details: Set the MI Driver into "its debugging an executable passed as an // argument" // mode as against running via a client like Eclipse. @@ -1270,7 +1223,6 @@ void CMIDriver::SetDriverDebuggingArgExecutable() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the MI Driver state indicating if it is operating in "its // debugging // an executable passed as an argument" mode as against running via a @@ -1286,7 +1238,6 @@ bool CMIDriver::IsDriverDebuggingArgExecutable() const { } //++ -//------------------------------------------------------------------------------------ // Details: Execute commands from command source file in specified mode, and // set exit-flag if needed. // Type: Method. @@ -1352,7 +1303,6 @@ bool CMIDriver::ExecuteCommandFile(const bool vbAsyncMode) { } //++ -//------------------------------------------------------------------------------------ // Details: Gets called when lldb-mi gets a signal. Stops the process if it was // SIGINT. // diff --git a/lldb/tools/lldb-mi/MIDriverBase.cpp b/lldb/tools/lldb-mi/MIDriverBase.cpp index 04bc7d2..9958770 100644 --- a/lldb/tools/lldb-mi/MIDriverBase.cpp +++ b/lldb/tools/lldb-mi/MIDriverBase.cpp @@ -14,7 +14,6 @@ #include "MIDriverBase.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIDriverBase constructor. // Type: Method. // Args: None. @@ -25,7 +24,6 @@ CMIDriverBase::CMIDriverBase() : m_pDriverFallThru(nullptr), m_pDriverParent(nullptr), m_bExitApp(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIDriverBase destructor. // Type: Overrideable. // Args: None. @@ -35,7 +33,6 @@ CMIDriverBase::CMIDriverBase() CMIDriverBase::~CMIDriverBase() { m_pDriverFallThru = NULL; } //++ -//------------------------------------------------------------------------------------ // Details: This function allows *this driver to call on another driver to // perform work // should this driver not be able to handle the client data input. @@ -55,7 +52,6 @@ bool CMIDriverBase::DoFallThruToAnotherDriver(const CMIUtilString &vCmd, } //++ -//------------------------------------------------------------------------------------ // Details: This function allows *this driver to call on another driver to // perform work // should this driver not be able to handle the client data input. @@ -74,7 +70,6 @@ bool CMIDriverBase::SetDriverToFallThruTo(const CMIDriverBase &vrOtherDriver) { } //++ -//------------------------------------------------------------------------------------ // Details: This function allows *this driver to call functionality on the // parent driver // ask for information for example. @@ -93,7 +88,6 @@ bool CMIDriverBase::SetDriverParent(const CMIDriverBase &vrOtherDriver) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the parent driver to *this driver if one assigned. If // assigned *this // is the pass through driver that the parent driver passes work to. @@ -108,7 +102,6 @@ CMIDriverBase *CMIDriverBase::GetDriversParent() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the pointer to the other fall through driver *this driver // is using // (or not using). @@ -123,7 +116,6 @@ CMIDriverBase *CMIDriverBase::GetDriverToFallThruTo() const { } //++ -//------------------------------------------------------------------------------------ // Details: *this driver provides a file stream to other drivers on which *this // driver // write's out to and they read as expected input. *this driver is @@ -140,7 +132,6 @@ FILE *CMIDriverBase::GetStdin() const { } //++ -//------------------------------------------------------------------------------------ // Details: *this driver provides a file stream to other pass through assigned // drivers // so they know what to write to. @@ -155,7 +146,6 @@ FILE *CMIDriverBase::GetStdout() const { } //++ -//------------------------------------------------------------------------------------ // Details: *this driver provides a error file stream to other pass through // assigned drivers // so they know what to write to. @@ -170,7 +160,6 @@ FILE *CMIDriverBase::GetStderr() const { } //++ -//------------------------------------------------------------------------------------ // Details: Set the MI Driver's exit application flag. The application checks // this flag // after every stdin line is read so the exit may not be instantaneous. diff --git a/lldb/tools/lldb-mi/MIDriverMain.cpp b/lldb/tools/lldb-mi/MIDriverMain.cpp index eac1412..8bc4571 100644 --- a/lldb/tools/lldb-mi/MIDriverMain.cpp +++ b/lldb/tools/lldb-mi/MIDriverMain.cpp @@ -51,7 +51,6 @@ // CODETAG_IOR_SIGNALS //++ -//------------------------------------------------------------------------------------ // Details: The SIGINT signal is sent to a process by its controlling terminal // when a // user wishes to interrupt the process. This is typically initiated by @@ -85,7 +84,6 @@ void sigint_handler(int vSigno) { } //++ -//------------------------------------------------------------------------------------ // Details: Init the MI driver system. Initialize the whole driver system which // includes // both the original LLDB driver and the MI driver. @@ -111,7 +109,6 @@ bool DriverSystemInit() { } //++ -//------------------------------------------------------------------------------------ // Details: Shutdown the debugger system. Release / terminate resources external // to // specifically the MI driver. @@ -131,7 +128,6 @@ bool DriverSystemShutdown(const bool vbAppExitOk) { } //++ -//------------------------------------------------------------------------------------ // Details: MI's application start point of execution. The application runs in // two modes. // An LLDB native driver mode where it acts no different from the LLDB diff --git a/lldb/tools/lldb-mi/MIDriverMgr.cpp b/lldb/tools/lldb-mi/MIDriverMgr.cpp index 8dc1c64..26c4add 100644 --- a/lldb/tools/lldb-mi/MIDriverMgr.cpp +++ b/lldb/tools/lldb-mi/MIDriverMgr.cpp @@ -19,7 +19,6 @@ #include "MIUtilSingletonHelper.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIDriverMgr constructor. // Type: Method. // Args: None. @@ -29,7 +28,6 @@ CMIDriverMgr::CMIDriverMgr() : m_pDriverCurrent(nullptr), m_bInMi2Mode(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIDriverMgr destructor. // Type: Overridden. // Args: None. @@ -39,7 +37,6 @@ CMIDriverMgr::CMIDriverMgr() : m_pDriverCurrent(nullptr), m_bInMi2Mode(false) {} CMIDriverMgr::~CMIDriverMgr() { Shutdown(); } //++ -//------------------------------------------------------------------------------------ // Details: Initialize *this manager. // Type: Method. // Args: None. @@ -76,7 +73,6 @@ bool CMIDriverMgr::Initialize() { } //++ -//------------------------------------------------------------------------------------ // Details: Unbind detach or release resources used by this server in general // common // functionality shared between versions of any server interfaces @@ -119,7 +115,6 @@ bool CMIDriverMgr::Shutdown() { return bOk; } //++ -//------------------------------------------------------------------------------------ // Details: Unregister all the Driver registered with *this manager. The manager // also // deletes @@ -146,7 +141,6 @@ bool CMIDriverMgr::UnregisterDriverAll() { } //++ -//------------------------------------------------------------------------------------ // Details: Register a driver with *this Driver Manager. Call // SetUseThisDriverToDoWork() // inform the manager which driver is the one to the work. The manager @@ -183,7 +177,6 @@ bool CMIDriverMgr::RegisterDriver(const IDriver &vrDriver, } //++ -//------------------------------------------------------------------------------------ // Details: Query the Driver Manager to see if *this manager has the driver // already // registered. @@ -208,7 +201,6 @@ bool CMIDriverMgr::HaveDriverAlready(const IDriver &vrDriver) const { } //++ -//------------------------------------------------------------------------------------ // Details: Unregister a driver from the Driver Manager. Call the // SetUseThisDriverToDoWork() // function to define another driver to do work if the one being @@ -240,7 +232,6 @@ bool CMIDriverMgr::UnregisterDriver(const IDriver &vrDriver) { } //++ -//------------------------------------------------------------------------------------ // Details: Specify the driver to do work. The Driver Manager drives this // driver. Any // previous driver doing work is not called anymore (so be sure the @@ -266,7 +257,6 @@ bool CMIDriverMgr::SetUseThisDriverToDoWork(const IDriver &vrADriver) { } //++ -//------------------------------------------------------------------------------------ // Details: Ask *this manager which driver is currently doing the work. // Type: Method. // Args: None. @@ -279,7 +269,6 @@ CMIDriverMgr::IDriver *CMIDriverMgr::GetUseThisDriverToDoWork() const { } //++ -//------------------------------------------------------------------------------------ // Details: Call this function puts *this driver to work. // Type: Method. // Args: None. @@ -306,7 +295,6 @@ bool CMIDriverMgr::DriverMainLoop() { } //++ -//------------------------------------------------------------------------------------ // Details: Get the current driver to validate executable command line // arguments. // Type: Method. @@ -356,7 +344,6 @@ bool CMIDriverMgr::DriverParseArgs(const int argc, const char *argv[], } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the current driver's last error condition. // Type: Method. // Args: None. @@ -375,7 +362,6 @@ CMIUtilString CMIDriverMgr::DriverGetError() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the current driver's name. // Type: Method. // Args: None. @@ -395,7 +381,6 @@ CMIUtilString CMIDriverMgr::DriverGetName() const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the current driver's debugger object. // Type: Method. // Args: None. @@ -416,7 +401,6 @@ lldb::SBDebugger *CMIDriverMgr::DriverGetTheDebugger() { } //++ -//------------------------------------------------------------------------------------ // Details: Check the arguments given on the command line. The main purpose of // this // function is to check for the presence of the --interpreter option. @@ -605,7 +589,6 @@ bool CMIDriverMgr::ParseArgs(const int argc, const char *argv[], } //++ -//------------------------------------------------------------------------------------ // Details: Return formatted application version and name information. // Type: Method. // Args: None. @@ -623,7 +606,6 @@ CMIUtilString CMIDriverMgr::GetAppVersion() const { } //++ -//------------------------------------------------------------------------------------ // Details: Return formatted help information on all the MI command line // options. // Type: Method. @@ -655,7 +637,6 @@ CMIUtilString CMIDriverMgr::GetHelpOnCmdLineArgOptions() const { } //++ -//------------------------------------------------------------------------------------ // Details: Search the registered drivers and return the first driver which says // it is // GDB/MI compatible i.e. the CMIDriver class. @@ -684,7 +665,6 @@ CMIDriverMgr::IDriver *CMIDriverMgr::GetFirstMIDriver() const { } //++ -//------------------------------------------------------------------------------------ // Details: Search the registered drivers and return the first driver which says // it is // not GDB/MI compatible i.e. the LLDB Driver class. @@ -713,7 +693,6 @@ CMIDriverMgr::IDriver *CMIDriverMgr::GetFirstNonMIDriver() const { } //++ -//------------------------------------------------------------------------------------ // Details: Search the registered drivers and return driver with the specified // ID. // Type: Method. @@ -734,7 +713,6 @@ CMIDriverMgr::GetDriver(const CMIUtilString &vrDriverId) const { } //++ -//------------------------------------------------------------------------------------ // Details: Gets called when lldb-mi gets a signal. Passed signal to current // driver. // diff --git a/lldb/tools/lldb-mi/MIUtilDateTimeStd.cpp b/lldb/tools/lldb-mi/MIUtilDateTimeStd.cpp index 0688c85..e92250a 100644 --- a/lldb/tools/lldb-mi/MIUtilDateTimeStd.cpp +++ b/lldb/tools/lldb-mi/MIUtilDateTimeStd.cpp @@ -11,7 +11,6 @@ #include "MICmnResources.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilDateTimeStd constructor. // Type: Method. // Args: None. @@ -21,7 +20,6 @@ CMIUtilDateTimeStd::CMIUtilDateTimeStd() {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilDateTimeStd destructor. // Type: Method. // Args: None. @@ -31,7 +29,6 @@ CMIUtilDateTimeStd::CMIUtilDateTimeStd() {} CMIUtilDateTimeStd::~CMIUtilDateTimeStd() {} //++ -//------------------------------------------------------------------------------------ // Details: Retrieve system local current date. Format is MM/DD/YYYY. // Type: Method. // Args: None. @@ -50,7 +47,6 @@ CMIUtilString CMIUtilDateTimeStd::GetDate() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve system local current time. Format is HH:MM:SS 24 hour // clock. // Type: Method. @@ -70,7 +66,6 @@ CMIUtilString CMIUtilDateTimeStd::GetTime() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve system local current date and time in yyyy-MM-dd--HH-mm-ss // format for log file names. // Type: Method. diff --git a/lldb/tools/lldb-mi/MIUtilDebug.cpp b/lldb/tools/lldb-mi/MIUtilDebug.cpp index 46b2702..4b418f3 100644 --- a/lldb/tools/lldb-mi/MIUtilDebug.cpp +++ b/lldb/tools/lldb-mi/MIUtilDebug.cpp @@ -17,7 +17,6 @@ #include "MIUtilDebug.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilDebug constructor. // Type: Method. // Args: None. @@ -27,7 +26,6 @@ CMIUtilDebug::CMIUtilDebug() {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilDebug destructor. // Type: Method. // Args: None. @@ -37,7 +35,6 @@ CMIUtilDebug::CMIUtilDebug() {} CMIUtilDebug::~CMIUtilDebug() {} //++ -//------------------------------------------------------------------------------------ // Details: Temporarily stall the process/application to give the programmer the // opportunity to attach a debugger. How to use: Put a break in the // programmer @@ -61,16 +58,12 @@ void CMIUtilDebug::WaitForDbgAttachInfinteLoop() { } } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- // Instantiations: CMICmnLog &CMIUtilDebugFnTrace::ms_rLog = CMICmnLog::Instance(); MIuint CMIUtilDebugFnTrace::ms_fnDepthCnt = 0; //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilDebugFnTrace constructor. // Type: Method. // Args: vFnName - (R) The text to insert into the log. @@ -85,7 +78,6 @@ CMIUtilDebugFnTrace::CMIUtilDebugFnTrace(const CMIUtilString &vFnName) } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilDebugFnTrace destructor. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MIUtilFileStd.cpp b/lldb/tools/lldb-mi/MIUtilFileStd.cpp index 1af9a58..2d8a059 100644 --- a/lldb/tools/lldb-mi/MIUtilFileStd.cpp +++ b/lldb/tools/lldb-mi/MIUtilFileStd.cpp @@ -21,7 +21,6 @@ #include "llvm/Support/Errno.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilFileStd constructor. // Type: Method. // Args: None. @@ -42,7 +41,6 @@ CMIUtilFileStd::CMIUtilFileStd() } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilFileStd destructor. // Type: Method. // Args: None. @@ -52,7 +50,6 @@ CMIUtilFileStd::CMIUtilFileStd() CMIUtilFileStd::~CMIUtilFileStd() { Close(); } //++ -//------------------------------------------------------------------------------------ // Details: Open file for writing. On the first call to this function after // *this object // is created the file is either created or replace, from then on open @@ -111,7 +108,6 @@ bool CMIUtilFileStd::CreateWrite(const CMIUtilString &vFileNamePath, } //++ -//------------------------------------------------------------------------------------ // Details: Write data to existing opened file. // Type: Method. // Args: vData - (R) Text data. @@ -149,7 +145,6 @@ bool CMIUtilFileStd::Write(const CMIUtilString &vData) { } //++ -//------------------------------------------------------------------------------------ // Details: Write data to existing opened file. // Type: Method. // Args: vData - (R) Text data. @@ -186,7 +181,6 @@ bool CMIUtilFileStd::Write(const char *vpData, const MIuint vCharCnt) { } //++ -//------------------------------------------------------------------------------------ // Details: Close existing opened file. Note Close() must must an open! // Type: Method. // Args: None. @@ -204,7 +198,6 @@ void CMIUtilFileStd::Close() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve state of whether the file is ok. // Type: Method. // Args: None. @@ -215,7 +208,6 @@ void CMIUtilFileStd::Close() { bool CMIUtilFileStd::IsOk() const { return !m_bFileError; } //++ -//------------------------------------------------------------------------------------ // Details: Status on a file existing already. // Type: Method. // Args: vFileNamePath. @@ -239,7 +231,6 @@ bool CMIUtilFileStd::IsFileExist(const CMIUtilString &vFileNamePath) const { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the file current carriage line return characters used. // Type: Method. // Args: None. @@ -251,7 +242,6 @@ const CMIUtilString &CMIUtilFileStd::GetLineReturn() const { } //++ -//------------------------------------------------------------------------------------ // Details: Given a file name directory path, strip off the filename and return // the path. // It look for either backslash or forward slash. @@ -275,7 +265,6 @@ CMIUtilFileStd::StripOffFileName(const CMIUtilString &vDirectoryPath) { } //++ -//------------------------------------------------------------------------------------ // Details: Return either backslash or forward slash appropriate to the OS this // application // is running on. diff --git a/lldb/tools/lldb-mi/MIUtilMapIdToVariant.cpp b/lldb/tools/lldb-mi/MIUtilMapIdToVariant.cpp index 2e88f12..9361ced 100644 --- a/lldb/tools/lldb-mi/MIUtilMapIdToVariant.cpp +++ b/lldb/tools/lldb-mi/MIUtilMapIdToVariant.cpp @@ -10,7 +10,6 @@ #include "MIUtilMapIdToVariant.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilMapIdToVariant constructor. // Type: Method. // Args: None. @@ -20,7 +19,6 @@ CMIUtilMapIdToVariant::CMIUtilMapIdToVariant() {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilMapIdToVariant destructor. // Type: Method. // Args: None. @@ -30,7 +28,6 @@ CMIUtilMapIdToVariant::CMIUtilMapIdToVariant() {} CMIUtilMapIdToVariant::~CMIUtilMapIdToVariant() {} //++ -//------------------------------------------------------------------------------------ // Details: Remove at the data from *this container. // Type: Method. // Args: None. @@ -40,7 +37,6 @@ CMIUtilMapIdToVariant::~CMIUtilMapIdToVariant() {} void CMIUtilMapIdToVariant::Clear() { m_mapKeyToVariantValue.clear(); } //++ -//------------------------------------------------------------------------------------ // Details: Check an ID is present already in *this container. // Type: Method. // Args: vId - (R) Unique ID i.e. GUID. @@ -55,7 +51,6 @@ bool CMIUtilMapIdToVariant::HaveAlready(const CMIUtilString &vId) const { } //++ -//------------------------------------------------------------------------------------ // Details: Determine if *this container is currently holding any data. // Type: Method. // Args: None. @@ -67,7 +62,6 @@ bool CMIUtilMapIdToVariant::IsEmpty() const { } //++ -//------------------------------------------------------------------------------------ // Details: Check the ID is valid to be registered. // Type: Method. // Args: vId - (R) Unique ID i.e. GUID. @@ -85,7 +79,6 @@ bool CMIUtilMapIdToVariant::IsValid(const CMIUtilString &vId) const { } //++ -//------------------------------------------------------------------------------------ // Details: Remove from *this contain a data object specified by ID. The data // object // when removed also calls its destructor should it have one. diff --git a/lldb/tools/lldb-mi/MIUtilMapIdToVariant.h b/lldb/tools/lldb-mi/MIUtilMapIdToVariant.h index 8e684b3..ba3e176 100644 --- a/lldb/tools/lldb-mi/MIUtilMapIdToVariant.h +++ b/lldb/tools/lldb-mi/MIUtilMapIdToVariant.h @@ -55,7 +55,6 @@ private: }; //++ -//------------------------------------------------------------------------------------ // Details: Add to *this container a data object of general type identified by // an ID. // If the data with that ID already exists in the container it is @@ -89,7 +88,6 @@ bool CMIUtilMapIdToVariant::Add(const CMIUtilString &vId, const T &vData) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve a data object from *this container identified by the // specified ID. // Type: Method. diff --git a/lldb/tools/lldb-mi/MIUtilString.cpp b/lldb/tools/lldb-mi/MIUtilString.cpp index 27a39da..986de96 100644 --- a/lldb/tools/lldb-mi/MIUtilString.cpp +++ b/lldb/tools/lldb-mi/MIUtilString.cpp @@ -20,7 +20,6 @@ #include "MIUtilString.h" //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilString constructor. // Type: Method. // Args: None. @@ -30,7 +29,6 @@ CMIUtilString::CMIUtilString() : std::string() {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilString constructor. // Type: Method. // Args: vpData - Pointer to UTF8 text data. @@ -41,7 +39,6 @@ CMIUtilString::CMIUtilString(const char *vpData) : std::string(WithNullAsEmpty(vpData)) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilString constructor. // Type: Method. // Args: vpStr - Text data. @@ -51,7 +48,6 @@ CMIUtilString::CMIUtilString(const char *vpData) CMIUtilString::CMIUtilString(const std::string &vrStr) : std::string(vrStr) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilString assignment operator. // Type: Method. // Args: vpRhs - Pointer to UTF8 text data. @@ -64,7 +60,6 @@ CMIUtilString &CMIUtilString::operator=(const char *vpRhs) { } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilString assignment operator. // Type: Method. // Args: vrRhs - The other string to copy from. @@ -77,7 +72,6 @@ CMIUtilString &CMIUtilString::operator=(const std::string &vrRhs) { } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilString destructor. // Type: Method. // Args: None. @@ -87,7 +81,6 @@ CMIUtilString &CMIUtilString::operator=(const std::string &vrRhs) { CMIUtilString::~CMIUtilString() {} //++ -//------------------------------------------------------------------------------------ // Details: Perform a snprintf format style on a string data. A new string // object is // created and returned. @@ -146,7 +139,6 @@ CMIUtilString CMIUtilString::FormatPriv(const CMIUtilString &vrFormat, } //++ -//------------------------------------------------------------------------------------ // Details: Perform a snprintf format style on a string data. A new string // object is // created and returned. @@ -167,7 +159,6 @@ CMIUtilString CMIUtilString::Format(const char *vFormating, ...) { } //++ -//------------------------------------------------------------------------------------ // Details: Perform a snprintf format style on a string data. A new string // object is // created and returned. @@ -183,7 +174,6 @@ CMIUtilString CMIUtilString::FormatValist(const CMIUtilString &vrFormating, } //++ -//------------------------------------------------------------------------------------ // Details: Splits string into array of strings using delimiter. If multiple // delimiter // are found in sequence then they are not added to the list of splits. @@ -227,7 +217,6 @@ size_t CMIUtilString::Split(const CMIUtilString &vDelimiter, } //++ -//------------------------------------------------------------------------------------ // Details: Splits string into array of strings using delimiter. However the // string is // also considered for text surrounded by quotes. Text with quotes @@ -286,7 +275,6 @@ size_t CMIUtilString::SplitConsiderQuotes(const CMIUtilString &vDelimiter, } //++ -//------------------------------------------------------------------------------------ // Details: Split string into lines using \n and return an array of strings. // Type: Method. // Args: vwVecSplits - (W) Container of splits found in string data. @@ -298,7 +286,6 @@ size_t CMIUtilString::SplitLines(VecString_t &vwVecSplits) const { } //++ -//------------------------------------------------------------------------------------ // Details: Remove '\n' from the end of string if found. It does not alter // *this string. // Type: Method. @@ -317,7 +304,6 @@ CMIUtilString CMIUtilString::StripCREndOfLine() const { } //++ -//------------------------------------------------------------------------------------ // Details: Remove all '\n' from the string and replace with a space. It does // not alter // *this string. @@ -331,7 +317,6 @@ CMIUtilString CMIUtilString::StripCRAll() const { } //++ -//------------------------------------------------------------------------------------ // Details: Find and replace all matches of a sub string with another string. It // does not // alter *this string. @@ -362,7 +347,6 @@ CMIUtilString::FindAndReplace(const CMIUtilString &vFind, } //++ -//------------------------------------------------------------------------------------ // Details: Check if *this string is a decimal number. // Type: Method. // Args: None. @@ -381,7 +365,6 @@ bool CMIUtilString::IsNumber() const { } //++ -//------------------------------------------------------------------------------------ // Details: Check if *this string is a hexadecimal number. // Type: Method. // Args: None. @@ -399,7 +382,6 @@ bool CMIUtilString::IsHexadecimalNumber() const { } //++ -//------------------------------------------------------------------------------------ // Details: Extract the number from the string. The number can be either a // hexadecimal or // natural number. It cannot contain other non-numeric characters. @@ -422,7 +404,6 @@ bool CMIUtilString::ExtractNumber(MIint64 &vwrNumber) const { } //++ -//------------------------------------------------------------------------------------ // Details: Extract the number from the hexadecimal string.. // Type: Method. // Args: vwrNumber - (W) Number extracted from the string. @@ -447,7 +428,6 @@ bool CMIUtilString::ExtractNumberFromHexadecimal(MIint64 &vwrNumber) const { } //++ -//------------------------------------------------------------------------------------ // Details: Determine if the text is all valid alpha numeric characters. Letters // can be // either upper or lower case. @@ -471,7 +451,6 @@ bool CMIUtilString::IsAllValidAlphaAndNumeric(const char *vpText) { } //++ -//------------------------------------------------------------------------------------ // Details: Check if two strings share equal contents. // Type: Method. // Args: vrLhs - (R) String A. @@ -489,7 +468,6 @@ bool CMIUtilString::Compare(const CMIUtilString &vrLhs, } //++ -//------------------------------------------------------------------------------------ // Details: Remove from either end of *this string the following: " \t\n\v\f\r". // Type: Method. // Args: None. @@ -512,7 +490,6 @@ CMIUtilString CMIUtilString::Trim() const { } //++ -//------------------------------------------------------------------------------------ // Details: Remove from either end of *this string the specified character. // Type: Method. // Args: None. @@ -531,7 +508,6 @@ CMIUtilString CMIUtilString::Trim(const char vChar) const { } //++ -//------------------------------------------------------------------------------------ // Details: Do a printf equivalent for printing a number in binary i.e. "b%llB". // Type: Static method. // Args: vnDecimal - (R) The number to represent in binary. @@ -564,7 +540,6 @@ CMIUtilString CMIUtilString::FormatBinary(const MIuint64 vnDecimal) { } //++ -//------------------------------------------------------------------------------------ // Details: Remove from a string doubled up characters so only one set left. // Characters // are only removed if the previous character is already a same @@ -580,7 +555,6 @@ CMIUtilString CMIUtilString::RemoveRepeatedCharacters(const char vChar) { } //++ -//------------------------------------------------------------------------------------ // Details: Recursively remove from a string doubled up characters so only one // set left. // Characters are only removed if the previous character is already a @@ -615,7 +589,6 @@ CMIUtilString CMIUtilString::RemoveRepeatedCharacters(size_t vnPos, } //++ -//------------------------------------------------------------------------------------ // Details: Is the text in *this string surrounded by quotes. // Type: Method. // Args: None. @@ -633,7 +606,6 @@ bool CMIUtilString::IsQuoted() const { } //++ -//------------------------------------------------------------------------------------ // Details: Find first occurrence in *this string which matches the pattern. // Type: Method. // Args: vrPattern - (R) The pattern to search for. @@ -648,7 +620,6 @@ size_t CMIUtilString::FindFirst(const CMIUtilString &vrPattern, } //++ -//------------------------------------------------------------------------------------ // Details: Find first occurrence in *this string which matches the pattern and // isn't surrounded by quotes. // Type: Method. @@ -697,7 +668,6 @@ size_t CMIUtilString::FindFirst(const CMIUtilString &vrPattern, } //++ -//------------------------------------------------------------------------------------ // Details: Find first occurrence in *this string which doesn't match the // pattern. // Type: Method. @@ -724,7 +694,6 @@ size_t CMIUtilString::FindFirstNot(const CMIUtilString &vrPattern, } //++ -//------------------------------------------------------------------------------------ // Details: Find first occurrence of not escaped quotation mark in *this string. // Type: Method. // Args: vnPos - Position of the first character in the string to be @@ -755,7 +724,6 @@ size_t CMIUtilString::FindFirstQuote(size_t vnPos) const { } //++ -//------------------------------------------------------------------------------------ // Details: Get escaped string from *this string. // Type: Method. // Args: None. @@ -777,7 +745,6 @@ CMIUtilString CMIUtilString::Escape(bool vbEscapeQuotes /* = false */) const { } //++ -//------------------------------------------------------------------------------------ // Details: Get string with backslashes in front of double quote '"' and // backslash '\\' // characters. @@ -813,7 +780,6 @@ CMIUtilString CMIUtilString::AddSlashes() const { } //++ -//------------------------------------------------------------------------------------ // Details: Remove backslashes added by CMIUtilString::AddSlashes. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MIUtilThreadBaseStd.cpp b/lldb/tools/lldb-mi/MIUtilThreadBaseStd.cpp index 30d129e..72cf147 100644 --- a/lldb/tools/lldb-mi/MIUtilThreadBaseStd.cpp +++ b/lldb/tools/lldb-mi/MIUtilThreadBaseStd.cpp @@ -14,7 +14,6 @@ #include "MIUtilThreadBaseStd.h" //++ -//------------------------------------------------------------------------------------ // Details: Constructor. // Type: None. // Args: None. @@ -25,7 +24,6 @@ CMIUtilThreadActiveObjBase::CMIUtilThreadActiveObjBase() : m_references(0), m_bHasBeenKilled(false) {} //++ -//------------------------------------------------------------------------------------ // Details: Destructor. // Type: None. // Args: None. @@ -38,7 +36,6 @@ CMIUtilThreadActiveObjBase::~CMIUtilThreadActiveObjBase() { } //++ -//------------------------------------------------------------------------------------ // Details: Check if an object is already running. // Type: Method. // Args: None. @@ -52,7 +49,6 @@ bool CMIUtilThreadActiveObjBase::ThreadIsActive() { } //++ -//------------------------------------------------------------------------------------ // Details: Set up *this thread. // Type: Method. // Args: None. @@ -66,7 +62,6 @@ bool CMIUtilThreadActiveObjBase::ThreadExecute() { } //++ -//------------------------------------------------------------------------------------ // Details: Acquire a reference to CMIUtilThreadActiveObjBase. // Type: Method. // Args: None. @@ -85,7 +80,6 @@ bool CMIUtilThreadActiveObjBase::Acquire() { } //++ -//------------------------------------------------------------------------------------ // Details: Release a reference to CMIUtilThreadActiveObjBase. // Type: Method. // Args: None. @@ -104,7 +98,6 @@ bool CMIUtilThreadActiveObjBase::Release() { } //++ -//------------------------------------------------------------------------------------ // Details: Force this thread to stop, regardless of references // Type: Method. // Args: None. @@ -123,7 +116,6 @@ bool CMIUtilThreadActiveObjBase::ThreadKill() { } //++ -//------------------------------------------------------------------------------------ // Details: Proxy to thread join. // Type: Method. // Args: None. @@ -134,7 +126,6 @@ bool CMIUtilThreadActiveObjBase::ThreadKill() { bool CMIUtilThreadActiveObjBase::ThreadJoin() { return m_thread.Join(); } //++ -//------------------------------------------------------------------------------------ // Details: This function is the entry point of this object thread. // It is a trampoline to an instances operation manager. // Type: Static method. @@ -158,7 +149,6 @@ MIuint CMIUtilThreadActiveObjBase::ThreadEntry(void *vpThisClass) { } //++ -//------------------------------------------------------------------------------------ // Details: This function forms a small management routine, to handle the // thread's running. // Type: Method. @@ -196,15 +186,11 @@ void CMIUtilThreadActiveObjBase::ThreadManage() { m_thread.Finish(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- // CMIUtilThread::CMIUtilThread() : m_pThread(nullptr), m_bIsActive(false) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilThread destructor. // Type: Method. // Args: None. @@ -214,7 +200,6 @@ CMIUtilThread::CMIUtilThread() : m_pThread(nullptr), m_bIsActive(false) {} CMIUtilThread::~CMIUtilThread() { Join(); } //++ -//------------------------------------------------------------------------------------ // Details: Wait for thread to stop. // Type: Method. // Args: None. @@ -239,7 +224,6 @@ bool CMIUtilThread::Join() { } //++ -//------------------------------------------------------------------------------------ // Details: Is the thread doing work. // Type: Method. // Args: None. @@ -253,7 +237,6 @@ bool CMIUtilThread::IsActive() { } //++ -//------------------------------------------------------------------------------------ // Details: Finish this thread // Type: Method. // Args: None. @@ -267,7 +250,6 @@ void CMIUtilThread::Finish() { } //++ -//------------------------------------------------------------------------------------ // Details: Set up *this thread. // Type: Method. // Args: vpFn (R) - Function pointer to thread's main function. @@ -290,12 +272,8 @@ bool CMIUtilThread::Start(FnThreadProc vpFn, void *vpArg) { return MIstatus::success; } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: Take resource. // Type: Method. // Args: None. @@ -305,7 +283,6 @@ bool CMIUtilThread::Start(FnThreadProc vpFn, void *vpArg) { void CMIUtilThreadMutex::Lock() { m_mutex.lock(); } //++ -//------------------------------------------------------------------------------------ // Details: Release resource. // Type: Method. // Args: None. @@ -315,7 +292,6 @@ void CMIUtilThreadMutex::Lock() { m_mutex.lock(); } void CMIUtilThreadMutex::Unlock() { m_mutex.unlock(); } //++ -//------------------------------------------------------------------------------------ // Details: Take resource if available. Immediately return in either case. // Type: Method. // Args: None. diff --git a/lldb/tools/lldb-mi/MIUtilVariant.cpp b/lldb/tools/lldb-mi/MIUtilVariant.cpp index bdf7b37..062dce8 100644 --- a/lldb/tools/lldb-mi/MIUtilVariant.cpp +++ b/lldb/tools/lldb-mi/MIUtilVariant.cpp @@ -10,7 +10,6 @@ #include "MIUtilVariant.h" //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase constructor. // Type: Method. // Args: None. @@ -20,7 +19,6 @@ CMIUtilVariant::CDataObjectBase::CDataObjectBase() {} //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase copy constructor. // Type: Method. // Args: vrOther - (R) The other object. @@ -33,7 +31,6 @@ CMIUtilVariant::CDataObjectBase::CDataObjectBase( } //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase copy constructor. // Type: Method. // Args: vrOther - (R) The other object. @@ -45,7 +42,6 @@ CMIUtilVariant::CDataObjectBase::CDataObjectBase(CDataObjectBase &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase move constructor. // Type: Method. // Args: vrwOther - (R) The other object. @@ -57,7 +53,6 @@ CMIUtilVariant::CDataObjectBase::CDataObjectBase(CDataObjectBase &&vrwOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase destructor. // Type: Overrideable. // Args: None. @@ -67,7 +62,6 @@ CMIUtilVariant::CDataObjectBase::CDataObjectBase(CDataObjectBase &&vrwOther) { CMIUtilVariant::CDataObjectBase::~CDataObjectBase() { Destroy(); } //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase copy assignment. // Type: Method. // Args: vrOther - (R) The other object. @@ -81,7 +75,6 @@ operator=(const CDataObjectBase &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObjectBase move assignment. // Type: Method. // Args: vrwOther - (R) The other object. @@ -96,7 +89,6 @@ operator=(CDataObjectBase &&vrwOther) { } //++ -//------------------------------------------------------------------------------------ // Details: Create a new copy of *this class. // Type: Overrideable. // Args: None. @@ -110,7 +102,6 @@ CMIUtilVariant::CDataObjectBase::CreateCopyOfSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Determine if *this object is a derived from CDataObjectBase. // Type: Overrideable. // Args: None. @@ -124,7 +115,6 @@ bool CMIUtilVariant::CDataObjectBase::GetIsDerivedClass() const { } //++ -//------------------------------------------------------------------------------------ // Details: Perform a bitwise copy of *this object. // Type: Overrideable. // Args: vrOther - (R) The other object. @@ -137,7 +127,6 @@ void CMIUtilVariant::CDataObjectBase::Copy(const CDataObjectBase &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: Release any resources used by *this object. // Type: Overrideable. // Args: None. @@ -148,12 +137,8 @@ void CMIUtilVariant::CDataObjectBase::Destroy() { // Do nothing - override to implement } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CDataObject copy constructor. // Type: Method. // Args: T - The object's type. @@ -169,7 +154,6 @@ CMIUtilVariant::CDataObject<T>::CDataObject(const CDataObject &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObject copy constructor. // Type: Method. // Args: T - The object's type. @@ -185,7 +169,6 @@ CMIUtilVariant::CDataObject<T>::CDataObject(CDataObject &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObject move constructor. // Type: Method. // Args: T - The object's type. @@ -202,7 +185,6 @@ CMIUtilVariant::CDataObject<T>::CDataObject(CDataObject &&vrwOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObject copy assignment. // Type: Method. // Args: T - The object's type. @@ -220,7 +202,6 @@ operator=(const CDataObject &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObject move assignment. // Type: Method. // Args: T - The object's type. @@ -238,12 +219,8 @@ operator=(CDataObject &&vrwOther) { return *this; } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant constructor. // Type: Method. // Args: None. @@ -253,7 +230,6 @@ operator=(CDataObject &&vrwOther) { CMIUtilVariant::CMIUtilVariant() : m_pDataObject(nullptr) {} //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant copy constructor. // Type: Method. // Args: vrOther - (R) The other object. @@ -269,7 +245,6 @@ CMIUtilVariant::CMIUtilVariant(const CMIUtilVariant &vrOther) } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant copy constructor. // Type: Method. // Args: vrOther - (R) The other object. @@ -285,7 +260,6 @@ CMIUtilVariant::CMIUtilVariant(CMIUtilVariant &vrOther) } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant move constructor. // Type: Method. // Args: vrwOther - (R) The other object. @@ -302,7 +276,6 @@ CMIUtilVariant::CMIUtilVariant(CMIUtilVariant &&vrwOther) } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant destructor. // Type: Method. // Args: None. @@ -312,7 +285,6 @@ CMIUtilVariant::CMIUtilVariant(CMIUtilVariant &&vrwOther) CMIUtilVariant::~CMIUtilVariant() { Destroy(); } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant copy assignment. // Type: Method. // Args: vrOther - (R) The other object. @@ -328,7 +300,6 @@ CMIUtilVariant &CMIUtilVariant::operator=(const CMIUtilVariant &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: CMIUtilVariant move assignment. // Type: Method. // Args: vrwOther - (R) The other object. @@ -345,7 +316,6 @@ CMIUtilVariant &CMIUtilVariant::operator=(CMIUtilVariant &&vrwOther) { } //++ -//------------------------------------------------------------------------------------ // Details: Release the resources used by *this object. // Type: Method. // Args: None. @@ -359,7 +329,6 @@ void CMIUtilVariant::Destroy() { } //++ -//------------------------------------------------------------------------------------ // Details: Bitwise copy another data object to *this variant object. // Type: Method. // Args: vrOther - (R) The other object. diff --git a/lldb/tools/lldb-mi/MIUtilVariant.h b/lldb/tools/lldb-mi/MIUtilVariant.h index 4adc701..4c9db33 100644 --- a/lldb/tools/lldb-mi/MIUtilVariant.h +++ b/lldb/tools/lldb-mi/MIUtilVariant.h @@ -116,12 +116,8 @@ private: CDataObjectBase *m_pDataObject; }; -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CDataObject constructor. // Type: Method. // Args: T - The object's type. @@ -131,7 +127,6 @@ private: template <typename T> CMIUtilVariant::CDataObject<T>::CDataObject() {} //++ -//------------------------------------------------------------------------------------ // Details: CDataObject constructor. // Type: Method. // Args: T - The object's type. @@ -145,7 +140,6 @@ CMIUtilVariant::CDataObject<T>::CDataObject(const T &vArg) { } //++ -//------------------------------------------------------------------------------------ // Details: CDataObject destructor. // Type: Overridden. // Args: T - The object's type. @@ -157,7 +151,6 @@ template <typename T> CMIUtilVariant::CDataObject<T>::~CDataObject() { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the data object hold by *this object wrapper. // Type: Method. // Args: T - The object's type. @@ -169,7 +162,6 @@ template <typename T> T &CMIUtilVariant::CDataObject<T>::GetDataObject() { } //++ -//------------------------------------------------------------------------------------ // Details: Create a new copy of *this class. // Type: Overridden. // Args: T - The object's type. @@ -185,7 +177,6 @@ CMIUtilVariant::CDataObject<T>::CreateCopyOfSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Determine if *this object is a derived from CDataObjectBase. // Type: Overridden. // Args: T - The object's type. @@ -199,7 +190,6 @@ bool CMIUtilVariant::CDataObject<T>::GetIsDerivedClass() const { } //++ -//------------------------------------------------------------------------------------ // Details: Perform a bitwise copy of *this object. // Type: Overrideable. // Args: T - The object's type. @@ -214,7 +204,6 @@ void CMIUtilVariant::CDataObject<T>::Duplicate(const CDataObject &vrOther) { } //++ -//------------------------------------------------------------------------------------ // Details: Release any resources used by *this object. // Type: Overridden. // Args: None. @@ -225,12 +214,8 @@ template <typename T> void CMIUtilVariant::CDataObject<T>::Destroy() { CDataObjectBase::Destroy(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: Assign to the variant an object of a specified type. // Type: Template method. // Args: T - The object's type. @@ -243,7 +228,6 @@ template <typename T> void CMIUtilVariant::Set(const T &vArg) { } //++ -//------------------------------------------------------------------------------------ // Details: Retrieve the data object from *this variant. // Type: Template method. // Args: T - The object's type. diff --git a/lldb/tools/lldb-server/lldb-gdbserver.cpp b/lldb/tools/lldb-server/lldb-gdbserver.cpp index 6222dd3..afa4487 100644 --- a/lldb/tools/lldb-server/lldb-gdbserver.cpp +++ b/lldb/tools/lldb-server/lldb-gdbserver.cpp @@ -79,9 +79,7 @@ public: #endif } -//---------------------------------------------------------------------- // option descriptors for getopt_long_only() -//---------------------------------------------------------------------- static int g_debug = 0; static int g_verbose = 0; @@ -106,9 +104,7 @@ static struct option g_long_options[] = { {"fd", required_argument, NULL, 'F'}, {NULL, 0, NULL, 0}}; -//---------------------------------------------------------------------- // Watch for signals -//---------------------------------------------------------------------- static int g_sighup_received_count = 0; #ifndef _WIN32 @@ -356,9 +352,7 @@ void ConnectToRemote(MainLoop &mainloop, printf("Connection established.\n"); } -//---------------------------------------------------------------------- // main -//---------------------------------------------------------------------- int main_gdbserver(int argc, char *argv[]) { Status error; MainLoop mainloop; diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp index 4f0abc4..595a0e8 100644 --- a/lldb/tools/lldb-server/lldb-platform.cpp +++ b/lldb/tools/lldb-server/lldb-platform.cpp @@ -39,9 +39,7 @@ using namespace lldb_private::lldb_server; using namespace lldb_private::process_gdb_remote; using namespace llvm; -//---------------------------------------------------------------------- // option descriptors for getopt_long_only() -//---------------------------------------------------------------------- static int g_debug = 0; static int g_verbose = 0; @@ -69,9 +67,7 @@ static struct option g_long_options[] = { #define HIGH_PORT (49151u) #endif -//---------------------------------------------------------------------- // Watch for signals -//---------------------------------------------------------------------- static void signal_handler(int signo) { switch (signo) { case SIGHUP: @@ -129,9 +125,7 @@ static Status save_socket_id_to_file(const std::string &socket_id, return Status(); } -//---------------------------------------------------------------------- // main -//---------------------------------------------------------------------- int main_platform(int argc, char *argv[]) { const char *progname = argv[0]; const char *subcommand = argv[1]; diff --git a/lldb/tools/lldb-server/lldb-server.cpp b/lldb/tools/lldb-server/lldb-server.cpp index 03258bd..5f0aab1 100644 --- a/lldb/tools/lldb-server/lldb-server.cpp +++ b/lldb/tools/lldb-server/lldb-server.cpp @@ -46,9 +46,7 @@ static void initialize() { static void terminate() { g_debugger_lifetime->Terminate(); } } // namespace llgs -//---------------------------------------------------------------------- // main -//---------------------------------------------------------------------- int main(int argc, char *argv[]) { llvm::StringRef ToolName = argv[0]; llvm::sys::PrintStackTraceOnErrorSignal(ToolName); diff --git a/lldb/tools/lldb-test/SystemInitializerTest.cpp b/lldb/tools/lldb-test/SystemInitializerTest.cpp index 9d535de..44b960c 100644 --- a/lldb/tools/lldb-test/SystemInitializerTest.cpp +++ b/lldb/tools/lldb-test/SystemInitializerTest.cpp @@ -213,9 +213,7 @@ llvm::Error SystemInitializerTest::Initialize() { // It shouldn't be limited to __APPLE__. StructuredDataDarwinLog::Initialize(); - //---------------------------------------------------------------------- // Platform agnostic plugins - //---------------------------------------------------------------------- platform_gdb_server::PlatformRemoteGDBServer::Initialize(); process_gdb_remote::ProcessGDBRemote::Initialize(); diff --git a/lldb/tools/lldb-test/SystemInitializerTest.h b/lldb/tools/lldb-test/SystemInitializerTest.h index 4134c53..4f58d2a 100644 --- a/lldb/tools/lldb-test/SystemInitializerTest.h +++ b/lldb/tools/lldb-test/SystemInitializerTest.h @@ -12,14 +12,12 @@ #include "lldb/Initialization/SystemInitializerCommon.h" namespace lldb_private { -//------------------------------------------------------------------ /// Initializes lldb. /// /// This class is responsible for initializing all of lldb system /// services needed to use the full LLDB application. This class is /// not intended to be used externally, but is instead used /// internally by SBDebugger to initialize the system. -//------------------------------------------------------------------ class SystemInitializerTest : public SystemInitializerCommon { public: SystemInitializerTest(); diff --git a/lldb/tools/lldb-vscode/JSONUtils.cpp b/lldb/tools/lldb-vscode/JSONUtils.cpp index f7c7a25..b83f564 100644 --- a/lldb/tools/lldb-vscode/JSONUtils.cpp +++ b/lldb/tools/lldb-vscode/JSONUtils.cpp @@ -164,7 +164,6 @@ void FillResponse(const llvm::json::Object &request, response.try_emplace("success", true); } -//---------------------------------------------------------------------- // "Scope": { // "type": "object", // "description": "A Scope is a named container for variables. Optionally @@ -223,7 +222,6 @@ void FillResponse(const llvm::json::Object &request, // }, // "required": [ "name", "variablesReference", "expensive" ] // } -//---------------------------------------------------------------------- llvm::json::Value CreateScope(const llvm::StringRef name, int64_t variablesReference, int64_t namedVariables, bool expensive) { @@ -235,7 +233,6 @@ llvm::json::Value CreateScope(const llvm::StringRef name, return llvm::json::Value(std::move(object)); } -//---------------------------------------------------------------------- // "Breakpoint": { // "type": "object", // "description": "Information about a Breakpoint created in setBreakpoints @@ -284,7 +281,6 @@ llvm::json::Value CreateScope(const llvm::StringRef name, // }, // "required": [ "verified" ] // } -//---------------------------------------------------------------------- llvm::json::Value CreateBreakpoint(lldb::SBBreakpointLocation &bp_loc) { // Each breakpoint location is treated as a separate breakpoint for VS code. // They don't have the notion of a single breakpoint with multiple locations. @@ -318,7 +314,6 @@ void AppendBreakpoint(lldb::SBBreakpoint &bp, llvm::json::Array &breakpoints) { } } -//---------------------------------------------------------------------- // "Event": { // "allOf": [ { "$ref": "#/definitions/ProtocolMessage" }, { // "type": "object", @@ -357,7 +352,6 @@ void AppendBreakpoint(lldb::SBBreakpoint &bp, llvm::json::Array &breakpoints) { // }, // "required": [ "seq", "type" ] // } -//---------------------------------------------------------------------- llvm::json::Object CreateEventObject(const llvm::StringRef event_name) { llvm::json::Object event; event.try_emplace("seq", 0); @@ -366,7 +360,6 @@ llvm::json::Object CreateEventObject(const llvm::StringRef event_name) { return event; } -//---------------------------------------------------------------------- // "ExceptionBreakpointsFilter": { // "type": "object", // "description": "An ExceptionBreakpointsFilter is shown in the UI as an @@ -389,7 +382,6 @@ llvm::json::Object CreateEventObject(const llvm::StringRef event_name) { // }, // "required": [ "filter", "label" ] // } -//---------------------------------------------------------------------- llvm::json::Value CreateExceptionBreakpointFilter(const ExceptionBreakpoint &bp) { llvm::json::Object object; @@ -399,7 +391,6 @@ CreateExceptionBreakpointFilter(const ExceptionBreakpoint &bp) { return llvm::json::Value(std::move(object)); } -//---------------------------------------------------------------------- // "Source": { // "type": "object", // "description": "A Source is a descriptor for source code. It is returned @@ -465,7 +456,6 @@ CreateExceptionBreakpointFilter(const ExceptionBreakpoint &bp) { // } // } // } -//---------------------------------------------------------------------- llvm::json::Value CreateSource(lldb::SBLineEntry &line_entry) { llvm::json::Object object; lldb::SBFileSpec file = line_entry.GetFileSpec(); @@ -569,7 +559,6 @@ llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line) { return llvm::json::Value(std::move(object)); } -//---------------------------------------------------------------------- // "StackFrame": { // "type": "object", // "description": "A Stackframe contains the source location.", @@ -626,7 +615,6 @@ llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line) { // }, // "required": [ "id", "name", "line", "column" ] // } -//---------------------------------------------------------------------- llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) { llvm::json::Object object; int64_t frame_id = MakeVSCodeFrameID(frame); @@ -648,7 +636,6 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) { return llvm::json::Value(std::move(object)); } -//---------------------------------------------------------------------- // "Thread": { // "type": "object", // "description": "A Thread", @@ -664,7 +651,6 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) { // }, // "required": [ "id", "name" ] // } -//---------------------------------------------------------------------- llvm::json::Value CreateThread(lldb::SBThread &thread) { llvm::json::Object object; object.try_emplace("id", (int64_t)thread.GetThreadID()); @@ -682,7 +668,6 @@ llvm::json::Value CreateThread(lldb::SBThread &thread) { return llvm::json::Value(std::move(object)); } -//---------------------------------------------------------------------- // "StoppedEvent": { // "allOf": [ { "$ref": "#/definitions/Event" }, { // "type": "object", @@ -740,7 +725,6 @@ llvm::json::Value CreateThread(lldb::SBThread &thread) { // "required": [ "event", "body" ] // }] // } -//---------------------------------------------------------------------- llvm::json::Value CreateThreadStopped(lldb::SBThread &thread, uint32_t stop_id) { llvm::json::Object event(CreateEventObject("stopped")); @@ -799,7 +783,6 @@ llvm::json::Value CreateThreadStopped(lldb::SBThread &thread, return llvm::json::Value(std::move(event)); } -//---------------------------------------------------------------------- // "Variable": { // "type": "object", // "description": "A Variable is a name/value pair. Optionally a variable @@ -862,7 +845,6 @@ llvm::json::Value CreateThreadStopped(lldb::SBThread &thread, // }, // "required": [ "name", "value", "variablesReference" ] // } -//---------------------------------------------------------------------- llvm::json::Value CreateVariable(lldb::SBValue v, int64_t variablesReference, int64_t varID, bool format_hex) { llvm::json::Object object; diff --git a/lldb/tools/lldb-vscode/JSONUtils.h b/lldb/tools/lldb-vscode/JSONUtils.h index 20e2184..2391ac3 100644 --- a/lldb/tools/lldb-vscode/JSONUtils.h +++ b/lldb/tools/lldb-vscode/JSONUtils.h @@ -16,7 +16,6 @@ namespace lldb_vscode { -//------------------------------------------------------------------ /// Emplace a StringRef in a json::Object after enusring that the /// string is valid UTF8. If not, first call llvm::json::fixUTF8 /// before emplacing. @@ -29,11 +28,9 @@ namespace lldb_vscode { /// /// \param[in] str /// The string to emplace -//------------------------------------------------------------------ void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key, llvm::StringRef str); -//------------------------------------------------------------------ /// Extract simple values as a string. /// /// \param[in] value @@ -42,10 +39,8 @@ void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key, /// \return /// A llvm::StringRef that contains the string value, or an empty /// string if \a value isn't a string. -//------------------------------------------------------------------ llvm::StringRef GetAsString(const llvm::json::Value &value); -//------------------------------------------------------------------ /// Extract the string value for the specified key from the /// specified object. /// @@ -59,11 +54,9 @@ llvm::StringRef GetAsString(const llvm::json::Value &value); /// A llvm::StringRef that contains the string value for the /// specified \a key, or an empty string if there is no key that /// matches or if the value is not a string. -//------------------------------------------------------------------ llvm::StringRef GetString(const llvm::json::Object &obj, llvm::StringRef key); llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key); -//------------------------------------------------------------------ /// Extract the unsigned integer value for the specified key from /// the specified object. /// @@ -77,13 +70,11 @@ llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key); /// The unsigned integer value for the specified \a key, or /// \a fail_value if there is no key that matches or if the /// value is not an integer. -//------------------------------------------------------------------ uint64_t GetUnsigned(const llvm::json::Object &obj, llvm::StringRef key, uint64_t fail_value); uint64_t GetUnsigned(const llvm::json::Object *obj, llvm::StringRef key, uint64_t fail_value); -//------------------------------------------------------------------ /// Extract the boolean value for the specified key from the /// specified object. /// @@ -97,13 +88,11 @@ uint64_t GetUnsigned(const llvm::json::Object *obj, llvm::StringRef key, /// The boolean value for the specified \a key, or \a fail_value /// if there is no key that matches or if the value is not a /// boolean value of an integer. -//------------------------------------------------------------------ bool GetBoolean(const llvm::json::Object &obj, llvm::StringRef key, bool fail_value); bool GetBoolean(const llvm::json::Object *obj, llvm::StringRef key, bool fail_value); -//------------------------------------------------------------------ /// Extract the signed integer for the specified key from the /// specified object. /// @@ -117,13 +106,11 @@ bool GetBoolean(const llvm::json::Object *obj, llvm::StringRef key, /// The signed integer value for the specified \a key, or /// \a fail_value if there is no key that matches or if the /// value is not an integer. -//------------------------------------------------------------------ int64_t GetSigned(const llvm::json::Object &obj, llvm::StringRef key, int64_t fail_value); int64_t GetSigned(const llvm::json::Object *obj, llvm::StringRef key, int64_t fail_value); -//------------------------------------------------------------------ /// Check if the specified key exists in the specified object. /// /// \param[in] obj @@ -134,10 +121,8 @@ int64_t GetSigned(const llvm::json::Object *obj, llvm::StringRef key, /// /// \return /// \b True if the key exists in the \a obj, \b False otherwise. -//------------------------------------------------------------------ bool ObjectContainsKey(const llvm::json::Object &obj, llvm::StringRef key); -//------------------------------------------------------------------ /// Extract an array of strings for the specified key from an object. /// /// String values in the array will be extracted without any quotes @@ -156,11 +141,9 @@ bool ObjectContainsKey(const llvm::json::Object &obj, llvm::StringRef key); /// \a fail_value if there is no key that matches or if the /// value is not an array or all items in the array are not /// strings, numbers or booleans. -//------------------------------------------------------------------ std::vector<std::string> GetStrings(const llvm::json::Object *obj, llvm::StringRef key); -//------------------------------------------------------------------ /// Fill a response object given the request object. /// /// The \a response object will get its "type" set to "response", @@ -174,11 +157,9 @@ std::vector<std::string> GetStrings(const llvm::json::Object *obj, /// \param[in,out] response /// An empty llvm::json::Object object that will be filled /// in as noted in description. -//------------------------------------------------------------------ void FillResponse(const llvm::json::Object &request, llvm::json::Object &response); -//---------------------------------------------------------------------- /// Emplace the string value from an SBValue into the supplied object /// using \a key as the key that will contain the value. /// @@ -200,11 +181,9 @@ void FillResponse(const llvm::json::Object &request, /// /// \param[in] key /// The key name to use when inserting the value object we create -//---------------------------------------------------------------------- void SetValueForKey(lldb::SBValue &v, llvm::json::Object &object, llvm::StringRef key); -//---------------------------------------------------------------------- /// Converts \a bp to a JSON value and appends all locations to the /// \a breakpoints array. /// @@ -215,10 +194,8 @@ void SetValueForKey(lldb::SBValue &v, llvm::json::Object &object, /// \param[in] breakpoints /// A JSON array that will get a llvm::json::Value for \a bp /// appended to it. -//---------------------------------------------------------------------- void AppendBreakpoint(lldb::SBBreakpoint &bp, llvm::json::Array &breakpoints); -//---------------------------------------------------------------------- /// Converts breakpoint location to a Visual Studio Code "Breakpoint" /// JSON object and appends it to the \a breakpoints array. /// @@ -228,10 +205,8 @@ void AppendBreakpoint(lldb::SBBreakpoint &bp, llvm::json::Array &breakpoints); /// \return /// A "Breakpoint" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateBreakpoint(lldb::SBBreakpointLocation &bp_loc); -//---------------------------------------------------------------------- /// Create a "Event" JSON object using \a event_name as the event name /// /// \param[in] event_name @@ -240,10 +215,8 @@ llvm::json::Value CreateBreakpoint(lldb::SBBreakpointLocation &bp_loc); /// \return /// A "Event" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Object CreateEventObject(const llvm::StringRef event_name); -//---------------------------------------------------------------------- /// Create a "ExceptionBreakpointsFilter" JSON object as described in /// the Visual Studio Code debug adaptor definition. /// @@ -253,11 +226,9 @@ llvm::json::Object CreateEventObject(const llvm::StringRef event_name); /// \return /// A "ExceptionBreakpointsFilter" JSON object with that follows /// the formal JSON definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateExceptionBreakpointFilter(const ExceptionBreakpoint &bp); -//---------------------------------------------------------------------- /// Create a "Scope" JSON object as described in the Visual Studio Code /// debug adaptor definition. /// @@ -276,12 +247,10 @@ CreateExceptionBreakpointFilter(const ExceptionBreakpoint &bp); /// \return /// A "Scope" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateScope(const llvm::StringRef name, int64_t variablesReference, int64_t namedVariables, bool expensive); -//---------------------------------------------------------------------- /// Create a "Source" JSON object as described in the Visual Studio Code /// debug adaptor definition. /// @@ -292,10 +261,8 @@ llvm::json::Value CreateScope(const llvm::StringRef name, /// \return /// A "Source" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateSource(lldb::SBLineEntry &line_entry); -//---------------------------------------------------------------------- /// Create a "Source" object for a given frame. /// /// When there is no source file information for a stack frame, we will @@ -319,10 +286,8 @@ llvm::json::Value CreateSource(lldb::SBLineEntry &line_entry); /// \return /// A "Source" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line); -//---------------------------------------------------------------------- /// Create a "StackFrame" object for a LLDB frame object. /// /// This function will fill in the following keys in the returned @@ -340,10 +305,8 @@ llvm::json::Value CreateSource(lldb::SBFrame &frame, int64_t &disasm_line); /// \return /// A "StackFrame" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateStackFrame(lldb::SBFrame &frame); -//---------------------------------------------------------------------- /// Create a "Thread" object for a LLDB thread object. /// /// This function will fill in the following keys in the returned @@ -360,10 +323,8 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame); /// \return /// A "Thread" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateThread(lldb::SBThread &thread); -//---------------------------------------------------------------------- /// Create a "StoppedEvent" object for a LLDB thread object. /// /// This function will fill in the following keys in the returned @@ -385,10 +346,8 @@ llvm::json::Value CreateThread(lldb::SBThread &thread); /// \return /// A "StoppedEvent" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateThreadStopped(lldb::SBThread &thread, uint32_t stop_id); -//---------------------------------------------------------------------- /// Create a "Variable" object for a LLDB thread object. /// /// This function will fill in the following keys in the returned @@ -428,7 +387,6 @@ llvm::json::Value CreateThreadStopped(lldb::SBThread &thread, uint32_t stop_id); /// \return /// A "Variable" JSON object with that follows the formal JSON /// definition outlined by Microsoft. -//---------------------------------------------------------------------- llvm::json::Value CreateVariable(lldb::SBValue v, int64_t variablesReference, int64_t varID, bool format_hex); diff --git a/lldb/tools/lldb-vscode/LLDBUtils.h b/lldb/tools/lldb-vscode/LLDBUtils.h index 2d7c07f..4e0da17 100644 --- a/lldb/tools/lldb-vscode/LLDBUtils.h +++ b/lldb/tools/lldb-vscode/LLDBUtils.h @@ -18,7 +18,6 @@ namespace lldb_vscode { -///---------------------------------------------------------------------- /// Run a list of LLDB commands in the LLDB command interpreter. /// /// All output from every command, including the prompt + the command @@ -34,12 +33,10 @@ namespace lldb_vscode { /// \param[in] strm /// The stream that will receive the prefix, prompt + command and /// all command output. -//---------------------------------------------------------------------- void RunLLDBCommands(llvm::StringRef prefix, const llvm::ArrayRef<std::string> &commands, llvm::raw_ostream &strm); -///---------------------------------------------------------------------- /// Run a list of LLDB commands in the LLDB command interpreter. /// /// All output from every command, including the prompt + the command @@ -55,11 +52,9 @@ void RunLLDBCommands(llvm::StringRef prefix, /// \return /// A std::string that contains the prefix and all commands and /// command output -//---------------------------------------------------------------------- std::string RunLLDBCommands(llvm::StringRef prefix, const llvm::ArrayRef<std::string> &commands); -///---------------------------------------------------------------------- /// Check if a thread has a stop reason. /// /// \param[in] thread @@ -68,10 +63,8 @@ std::string RunLLDBCommands(llvm::StringRef prefix, /// \return /// \b True if the thread has a valid stop reason, \b false /// otherwise. -//---------------------------------------------------------------------- bool ThreadHasStopReason(lldb::SBThread &thread); -///---------------------------------------------------------------------- /// Given a LLDB frame, make a frame ID that is unique to a specific /// thread and frame. /// @@ -85,10 +78,8 @@ bool ThreadHasStopReason(lldb::SBThread &thread); /// \return /// A unique integer that allows us to easily find the right /// stack frame within a thread on subsequent VS code requests. -//---------------------------------------------------------------------- int64_t MakeVSCodeFrameID(lldb::SBFrame &frame); -///---------------------------------------------------------------------- /// Given a VSCode frame ID, convert to a LLDB thread index id. /// /// VSCode requires a Stackframe "id" to be unique, so we use the frame @@ -100,10 +91,8 @@ int64_t MakeVSCodeFrameID(lldb::SBFrame &frame); /// /// \return /// The LLDB thread index ID. -//---------------------------------------------------------------------- uint32_t GetLLDBThreadIndexID(uint64_t dap_frame_id); -///---------------------------------------------------------------------- /// Given a VSCode frame ID, convert to a LLDB frame ID. /// /// VSCode requires a Stackframe "id" to be unique, so we use the frame @@ -115,10 +104,8 @@ uint32_t GetLLDBThreadIndexID(uint64_t dap_frame_id); /// /// \return /// The LLDB frame index ID. -//---------------------------------------------------------------------- uint32_t GetLLDBFrameID(uint64_t dap_frame_id); -///---------------------------------------------------------------------- /// Given a LLDB breakpoint, make a breakpoint ID that is unique to a /// specific breakpoint and breakpoint location. /// @@ -132,10 +119,8 @@ uint32_t GetLLDBFrameID(uint64_t dap_frame_id); /// \return /// A unique integer that allows us to easily find the right /// stack frame within a thread on subsequent VS code requests. -//---------------------------------------------------------------------- int64_t MakeVSCodeBreakpointID(lldb::SBBreakpointLocation &bp_loc); -///---------------------------------------------------------------------- /// Given a VSCode breakpoint ID, convert to a LLDB breakpoint ID. /// /// VSCode requires a Breakpoint "id" to be unique, so we use the @@ -147,10 +132,8 @@ int64_t MakeVSCodeBreakpointID(lldb::SBBreakpointLocation &bp_loc); /// /// \return /// The LLDB breakpoint ID. -//---------------------------------------------------------------------- uint32_t GetLLDBBreakpointID(uint64_t dap_breakpoint_id); -///---------------------------------------------------------------------- /// Given a VSCode breakpoint ID, convert to a LLDB breakpoint location ID. /// /// VSCode requires a Breakpoint "id" to be unique, so we use the @@ -162,7 +145,6 @@ uint32_t GetLLDBBreakpointID(uint64_t dap_breakpoint_id); /// /// \return /// The LLDB breakpoint location ID. -//---------------------------------------------------------------------- uint32_t GetLLDBBreakpointLocationID(uint64_t dap_breakpoint_id); } // namespace lldb_vscode diff --git a/lldb/tools/lldb-vscode/VSCode.cpp b/lldb/tools/lldb-vscode/VSCode.cpp index 9022feb..3b314a2 100644 --- a/lldb/tools/lldb-vscode/VSCode.cpp +++ b/lldb/tools/lldb-vscode/VSCode.cpp @@ -78,11 +78,9 @@ VSCode::GetExceptionBreakpoint(const lldb::break_id_t bp_id) { return nullptr; } -//---------------------------------------------------------------------- // Send the JSON in "json_str" to the "out" stream. Correctly send the // "Content-Length:" field followed by the length, followed by the raw // JSON bytes. -//---------------------------------------------------------------------- void VSCode::SendJSON(const std::string &json_str) { output.write_full("Content-Length: "); output.write_full(llvm::utostr(json_str.size())); @@ -96,10 +94,8 @@ void VSCode::SendJSON(const std::string &json_str) { } } -//---------------------------------------------------------------------- // Serialize the JSON value into a string and send the JSON packet to // the "out" stream. -//---------------------------------------------------------------------- void VSCode::SendJSON(const llvm::json::Value &json) { std::string s; llvm::raw_string_ostream strm(s); @@ -109,9 +105,7 @@ void VSCode::SendJSON(const llvm::json::Value &json) { SendJSON(strm.str()); } -//---------------------------------------------------------------------- // Read a JSON packet from the "in" stream. -//---------------------------------------------------------------------- std::string VSCode::ReadJSON() { std::string length_str; std::string json_str; @@ -135,7 +129,6 @@ std::string VSCode::ReadJSON() { return json_str; } -//---------------------------------------------------------------------- // "OutputEvent": { // "allOf": [ { "$ref": "#/definitions/Event" }, { // "type": "object", @@ -196,7 +189,6 @@ std::string VSCode::ReadJSON() { // "required": [ "event", "body" ] // }] // } -//---------------------------------------------------------------------- void VSCode::SendOutput(OutputType o, const llvm::StringRef output) { if (output.empty()) return; diff --git a/lldb/tools/lldb-vscode/VSCode.h b/lldb/tools/lldb-vscode/VSCode.h index bb05e78..be8b228 100644 --- a/lldb/tools/lldb-vscode/VSCode.h +++ b/lldb/tools/lldb-vscode/VSCode.h @@ -99,17 +99,13 @@ struct VSCode { int64_t GetLineForPC(int64_t sourceReference, lldb::addr_t pc) const; ExceptionBreakpoint *GetExceptionBreakpoint(const std::string &filter); ExceptionBreakpoint *GetExceptionBreakpoint(const lldb::break_id_t bp_id); - //---------------------------------------------------------------------- // Send the JSON in "json_str" to the "out" stream. Correctly send the // "Content-Length:" field followed by the length, followed by the raw // JSON bytes. - //---------------------------------------------------------------------- void SendJSON(const std::string &json_str); - //---------------------------------------------------------------------- // Serialize the JSON value into a string and send the JSON packet to // the "out" stream. - //---------------------------------------------------------------------- void SendJSON(const llvm::json::Value &json); std::string ReadJSON(); diff --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp index 2cad12f..d5b5123 100644 --- a/lldb/tools/lldb-vscode/lldb-vscode.cpp +++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp @@ -119,9 +119,7 @@ std::vector<const char *> MakeArgv(const llvm::ArrayRef<std::string> &strs) { return argv; } -//---------------------------------------------------------------------- // Send a "exited" event to indicate the process has exited. -//---------------------------------------------------------------------- void SendProcessExitedEvent(lldb::SBProcess &process) { llvm::json::Object event(CreateEventObject("exited")); llvm::json::Object body; @@ -139,10 +137,8 @@ void SendThreadExitedEvent(lldb::tid_t tid) { g_vsc.SendJSON(llvm::json::Value(std::move(event))); } -//---------------------------------------------------------------------- // Send a "terminated" event to indicate the process is done being // debugged. -//---------------------------------------------------------------------- void SendTerminatedEvent() { if (!g_vsc.sent_terminated_event) { g_vsc.sent_terminated_event = true; @@ -152,10 +148,8 @@ void SendTerminatedEvent() { } } -//---------------------------------------------------------------------- // Send a thread stopped event for all threads as long as the process // is stopped. -//---------------------------------------------------------------------- void SendThreadStoppedEvent() { lldb::SBProcess process = g_vsc.target.GetProcess(); if (process.IsValid()) { @@ -228,7 +222,6 @@ void SendThreadStoppedEvent() { g_vsc.RunStopCommands(); } -//---------------------------------------------------------------------- // "ProcessEvent": { // "allOf": [ // { "$ref": "#/definitions/Event" }, @@ -283,7 +276,6 @@ void SendThreadStoppedEvent() { // } // ] // } -//---------------------------------------------------------------------- void SendProcessEvent(LaunchMethod launch_method) { lldb::SBFileSpec exe_fspec = g_vsc.target.GetExecutable(); char exe_path[PATH_MAX]; @@ -311,10 +303,8 @@ void SendProcessEvent(LaunchMethod launch_method) { g_vsc.SendJSON(llvm::json::Value(std::move(event))); } -//---------------------------------------------------------------------- // Grab any STDOUT and STDERR from the process and send it up to VS Code // via an "output" event to the "stdout" and "stderr" categories. -//---------------------------------------------------------------------- void SendStdOutStdErr(lldb::SBProcess &process) { char buffer[1024]; size_t count; @@ -324,13 +314,11 @@ void SendStdOutStdErr(lldb::SBProcess &process) { g_vsc.SendOutput(OutputType::Stderr, llvm::StringRef(buffer, count)); } -//---------------------------------------------------------------------- // All events from the debugger, target, process, thread and frames are // received in this function that runs in its own thread. We are using a // "FILE *" to output packets back to VS Code and they have mutexes in them // them prevent multiple threads from writing simultaneously so no locking // is required. -//---------------------------------------------------------------------- void EventThreadFunction() { lldb::SBEvent event; lldb::SBListener listener = g_vsc.debugger.GetListener(); @@ -420,10 +408,8 @@ void EventThreadFunction() { } } -//---------------------------------------------------------------------- // Both attach and launch take a either a sourcePath or sourceMap // argument (or neither), from which we need to set the target.source-map. -//---------------------------------------------------------------------- void SetSourceMapFromArguments(const llvm::json::Object &arguments) { const char *sourceMapHelp = "source must be be an array of two-element arrays, " @@ -465,7 +451,6 @@ void SetSourceMapFromArguments(const llvm::json::Object &arguments) { } } -//---------------------------------------------------------------------- // "AttachRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -494,7 +479,6 @@ void SetSourceMapFromArguments(const llvm::json::Object &arguments) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_attach(const llvm::json::Object &request) { llvm::json::Object response; lldb::SBError error; @@ -602,7 +586,6 @@ void request_attach(const llvm::json::Object &request) { } } -//---------------------------------------------------------------------- // "ContinueRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -657,7 +640,6 @@ void request_attach(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_continue(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -673,7 +655,6 @@ void request_continue(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "ConfigurationDoneRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -705,7 +686,6 @@ void request_continue(const llvm::json::Object &request) { // just an acknowledgement, so no body field is required." // }] // }, -//---------------------------------------------------------------------- void request_configurationDone(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -716,7 +696,6 @@ void request_configurationDone(const llvm::json::Object &request) { g_vsc.target.GetProcess().Continue(); } -//---------------------------------------------------------------------- // "DisconnectRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -761,7 +740,6 @@ void request_configurationDone(const llvm::json::Object &request) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_disconnect(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -840,7 +818,6 @@ void request_exceptionInfo(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "EvaluateRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -942,7 +919,6 @@ void request_exceptionInfo(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_evaluate(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -992,7 +968,6 @@ void request_evaluate(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "InitializeRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1069,7 +1044,6 @@ void request_evaluate(const llvm::json::Object &request) { // } // }] // } -//---------------------------------------------------------------------- void request_initialize(const llvm::json::Object &request) { g_vsc.debugger = lldb::SBDebugger::Create(true /*source_init_files*/); // Create an empty target right away since we might get breakpoint requests @@ -1163,7 +1137,6 @@ void request_initialize(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "LaunchRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1198,7 +1171,6 @@ void request_initialize(const llvm::json::Object &request) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_launch(const llvm::json::Object &request) { llvm::json::Object response; lldb::SBError error; @@ -1297,7 +1269,6 @@ void request_launch(const llvm::json::Object &request) { g_vsc.debugger.SetAsync(true); } -//---------------------------------------------------------------------- // "NextRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1336,7 +1307,6 @@ void request_launch(const llvm::json::Object &request) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_next(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -1353,7 +1323,6 @@ void request_next(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "PauseRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1390,7 +1359,6 @@ void request_next(const llvm::json::Object &request) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_pause(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -1399,7 +1367,6 @@ void request_pause(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "ScopesRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1451,7 +1418,6 @@ void request_pause(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_scopes(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -1477,7 +1443,6 @@ void request_scopes(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "SetBreakpointsRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1588,7 +1553,6 @@ void request_scopes(const llvm::json::Object &request) { // }, // "required": [ "line" ] // } -//---------------------------------------------------------------------- void request_setBreakpoints(const llvm::json::Object &request) { llvm::json::Object response; lldb::SBError error; @@ -1670,7 +1634,6 @@ void request_setBreakpoints(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "SetExceptionBreakpointsRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1718,7 +1681,6 @@ void request_setBreakpoints(const llvm::json::Object &request) { // just an acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_setExceptionBreakpoints(const llvm::json::Object &request) { llvm::json::Object response; lldb::SBError error; @@ -1747,7 +1709,6 @@ void request_setExceptionBreakpoints(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "SetFunctionBreakpointsRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1826,7 +1787,6 @@ void request_setExceptionBreakpoints(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_setFunctionBreakpoints(const llvm::json::Object &request) { llvm::json::Object response; lldb::SBError error; @@ -1883,7 +1843,6 @@ void request_setFunctionBreakpoints(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "SourceRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -1942,7 +1901,6 @@ void request_setFunctionBreakpoints(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_source(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -1961,7 +1919,6 @@ void request_source(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "StackTraceRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -2032,7 +1989,6 @@ void request_source(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_stackTrace(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -2058,7 +2014,6 @@ void request_stackTrace(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "StepInRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -2104,7 +2059,6 @@ void request_stackTrace(const llvm::json::Object &request) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_stepIn(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -2121,7 +2075,6 @@ void request_stepIn(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "StepOutRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -2158,7 +2111,6 @@ void request_stepIn(const llvm::json::Object &request) { // acknowledgement, so no body field is required." // }] // } -//---------------------------------------------------------------------- void request_stepOut(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -2175,7 +2127,6 @@ void request_stepOut(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "ThreadsRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -2211,7 +2162,6 @@ void request_stepOut(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_threads(const llvm::json::Object &request) { lldb::SBProcess process = g_vsc.target.GetProcess(); @@ -2233,7 +2183,6 @@ void request_threads(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "SetVariableRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -2316,7 +2265,6 @@ void request_threads(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_setVariable(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); @@ -2426,7 +2374,6 @@ void request_setVariable(const llvm::json::Object &request) { g_vsc.SendJSON(llvm::json::Value(std::move(response))); } -//---------------------------------------------------------------------- // "VariablesRequest": { // "allOf": [ { "$ref": "#/definitions/Request" }, { // "type": "object", @@ -2500,7 +2447,6 @@ void request_setVariable(const llvm::json::Object &request) { // "required": [ "body" ] // }] // } -//---------------------------------------------------------------------- void request_variables(const llvm::json::Object &request) { llvm::json::Object response; FillResponse(request, response); diff --git a/lldb/unittests/Language/Highlighting/HighlighterTest.cpp b/lldb/unittests/Language/Highlighting/HighlighterTest.cpp index 8426712..71457ed 100644 --- a/lldb/unittests/Language/Highlighting/HighlighterTest.cpp +++ b/lldb/unittests/Language/Highlighting/HighlighterTest.cpp @@ -124,9 +124,7 @@ TEST_F(HighlighterTest, DefaultHighlighterWithCursorOutOfBounds) { style.selected.Set("<c>", "</c>"); EXPECT_EQ("a bc", highlightDefault("a bc", style, 4)); } -//------------------------------------------------------------------------------ // Tests highlighting with the Clang highlighter. -//------------------------------------------------------------------------------ static std::string highlightC(llvm::StringRef code, HighlightStyle style, diff --git a/lldb/unittests/Utility/StreamTest.cpp b/lldb/unittests/Utility/StreamTest.cpp index 0514625..2e2bcb3 100644 --- a/lldb/unittests/Utility/StreamTest.cpp +++ b/lldb/unittests/Utility/StreamTest.cpp @@ -279,9 +279,7 @@ TEST_F(StreamTest, PutMaxHex64ByteOrderLittle) { EXPECT_EQ("12341278563412efcdab9078563412", TakeValue()); } -//------------------------------------------------------------------------------ // Shift operator tests. -//------------------------------------------------------------------------------ TEST_F(StreamTest, ShiftOperatorChars) { s << 'a' << 'b'; @@ -345,9 +343,7 @@ TEST_F(StreamTest, PutPtr) { // that it should use the host byte order. const static auto hostByteOrder = lldb::eByteOrderInvalid; -//------------------------------------------------------------------------------ // PutRawBytes/PutBytesAsRawHex tests. -//------------------------------------------------------------------------------ TEST_F(StreamTest, PutBytesAsRawHex8ToBigEndian) { uint32_t value = 0x12345678; @@ -405,9 +401,7 @@ TEST_F(StreamTest, PutRawBytesToMixedEndian) { #endif } -//------------------------------------------------------------------------------ // ULEB128 support for binary streams. -//------------------------------------------------------------------------------ TEST_F(BinaryStreamTest, PutULEB128OneByte) { auto bytes = s.PutULEB128(0x74ULL); @@ -493,9 +487,7 @@ TEST_F(BinaryStreamTest, PutULEB128One) { EXPECT_EQ(1U, bytes); } -//------------------------------------------------------------------------------ // SLEB128 support for binary streams. -//------------------------------------------------------------------------------ TEST_F(BinaryStreamTest, PutSLEB128OneByte) { auto bytes = s.PutSLEB128(0x74LL); @@ -581,9 +573,7 @@ TEST_F(BinaryStreamTest, PutSLEB128One) { EXPECT_EQ(1U, bytes); } -//------------------------------------------------------------------------------ // SLEB128/ULEB128 support for non-binary streams. -//------------------------------------------------------------------------------ // The logic for this is very simple, so it should be enough to test some basic // use cases. diff --git a/lldb/unittests/debugserver/debugserver_LogCallback.cpp b/lldb/unittests/debugserver/debugserver_LogCallback.cpp index 2f95365..45a502f 100644 --- a/lldb/unittests/debugserver/debugserver_LogCallback.cpp +++ b/lldb/unittests/debugserver/debugserver_LogCallback.cpp @@ -6,11 +6,9 @@ // //===----------------------------------------------------------------------===// -//------------------------------------------------------------------------------ // this function is defined in debugserver.cpp, but is needed to link the // debugserver Common library. It is for logging only, so it is left // unimplemented here. -//------------------------------------------------------------------------------ #include <stdint.h> #include <stdarg.h> |