summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure that "add-dsym" can't crash us when using it.Greg Clayton2015-03-311-8/+38
| | | | | | | | | | I am fixing this by: 1 - make sure we aren't trying to set the symbol file for a module to the same thing it already has and leaving it alone if it is the same 2 - keep all old symbol files around in the module in case there are any outstanding type references <rdar://problem/18029116> llvm-svn: 233757
* Fix type detection for 'char' variablesTamas Berghammer2015-03-311-0/+26
| | | | | | | | | | | | A char can have signed and unsigned encoding but previously lldb always assumed it is signed. This CL adds a logic to detect the encoding of 'char' types based on the default encoding on the target architecture. It fixes variable printing and expression evaluation on architectures where 'char' is signed by default. Differential revision: http://reviews.llvm.org/D8636 llvm-svn: 233682
* Work around lack of %zd printf format specifier in MSVC libs.Adrian McCarthy2015-03-301-1/+1
| | | | llvm-svn: 233569
* Bug 23051 - Fix build failure on Freebsd with gcc 4.9.Sylvestre Ledru2015-03-281-1/+1
| | | | | | Patch by Craig Rodrigues llvm-svn: 233478
* Support for truncate/append on log filesPavel Labath2015-03-202-1/+13
| | | | | | | | | | | | | | | Summary: Presently, if a log file already exists, lldb simply starts overwriting bits of it, without truncating or anything. This patch makes it use eFileOptionFileTruncate by default. It also adds an --append option, which will append to the file without truncating. A test is included. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8450 llvm-svn: 232801
* Move LLDB initialization/shutdown to Initialization.Zachary Turner2015-03-191-24/+5
| | | | | | | | | | | | | | | | This creates a new top-level folder called Initialization which is intended to hold code specific to LLDB system initialization. Currently this holds the Initialize() and Terminate() functions, as well as the fatal error handler. This provides a means to break the massive dependency cycle which is caused by the fact that Debugger depends on Initialize and Terminate which then depends on the entire LLDB project. With this structure, it will be possible for applications to invoke lldb_private::Initialize() directly, and have that invoke Debugger::Initialize. llvm-svn: 232768
* Move some functions from source/lldb.cpp to Utility.Zachary Turner2015-03-183-1/+5
| | | | | | | | | | Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-1813-11/+275
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Remove ScriptInterpreterObject.Zachary Turner2015-03-171-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | This removes ScriptInterpreterObject from the codebase completely. Places that used to rely on ScriptInterpreterObject now use StructuredData::Object and its derived classes. To support this, a new type of StructuredData object is introduced, called StructuredData::Generic, which stores a void*. Internally within the python library, StructuredPythonObject subclasses this StructuredData::Generic class so that it can addref and decref the python object on construction and destruction. Additionally, all of the classes in PythonDataObjects.h such as PythonList, PythonDictionary, etc now provide a method to create an instance of the corresponding StructuredData type. For example, there is PythonDictionary::CreateStructuredDictionary. To eliminate dependencies on PythonDataObjects for external callers, all ScriptInterpreter methods now return only StructuredData classes The rest of the changes in this CL are focused on fixing up users of PythonDataObjects classes to use the new StructuredData classes. llvm-svn: 232534
* [MIPS] - Register Context for MIPS64Mohit K. Bhakkad2015-03-171-1/+3
| | | | | | | | | | | | | | | | Patch by Jaydeep Patil Summery: 1. Add MIPS variants by parsing e_flags of the ELF 2. Create RegisterInfoInterface and RegisterContext for MIPS64 and MIPS64EL Reviewers: clayborg Subscribers: tberghammer, bhushan, mohit.bhakkad, sagar Differential Revision: http://reviews.llvm.org/D8166 llvm-svn: 232467
* Make ModuleList::GetSharedModule to use module_search_paths parameter.Oleksiy Vyalov2015-03-161-6/+38
| | | | | | http://reviews.llvm.org/D8365 llvm-svn: 232437
* This fixes the build I previously broke - and actually makes the test case ↵Enrico Granata2015-03-121-24/+74
| | | | | | work just like I promised llvm-svn: 232115
* Fix a bug in the data formatters where summary strings would not look into ↵Enrico Granata2015-03-121-1/+1
| | | | | | | | the non-synthetic value for child members if the ValueObject being formatted happened to have a synthetic value rdar://15630776 llvm-svn: 232114
* Fix ProcessIO test failuresPavel Labath2015-03-121-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was a race condition regarding the output of the inferior process. The reading of the output is performed on a separate thread, and there was no guarantee that the output will get eventually consumed. Because of that, it was happening that calling Process::GetSTDOUT was not returning anything even though the process was terminated and would definitely not produce any further output. This was usually happening only under very heavy system load, but it can be reproduced by placing an usleep in the stdio thread (Process::STDIOReadThreadBytesReceived). This patch addresses this by adding synchronization capabilities to the Communication thread. After calling Communication::SynchronizeWithReadThread one can be sure that all pending input has been processed by the read thread. This function is then called after every public event which stops the process to obtain the entire process output. Test Plan: TestProcessIO.py should now succeed every time instead of flaking in and out. Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8246 llvm-svn: 232023
* Add Debugger::InitializeForLLGS to allow ref counted LLGS initialization.Robert Flack2015-03-101-3/+22
| | | | | | | | | | | | | | After http://reviews.llvm.org/D8133 landed as r231550 process launch on remote platform stopped working. This adds Debugger::InitializeForLLGS and tracks whether one or both of Initialize and InitializeForLLGS have been called, calling only the corresponding lldb_private::Terminate* methods as necessary. Since lldb_private::Terminate calls lldb_private::TerminateForLLGS, the latter method may be called twice if Initialize was called for both however the terminate methods ensure they are only called once after being initialized. This still maintains the reduced binary size, though it does now technically link in lldb_private::Terminate on lldb-server even though this should never be called. This should resolve the issue raised in http://reviews.llvm.org/D8133 where Debugger::Terminate assumed that there were 0 references to debugger and terminated early. Differential Revision: http://reviews.llvm.org/D8183 llvm-svn: 231808
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-102-0/+7
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()Zachary Turner2015-03-062-3/+18
| | | | | | | | | | | | This removes Host::Backtrace from the codebase, and changes all call sites to use llvm::sys::PrintStackTrace(). This makes the functionality available for all platforms, and even for platforms which currently had a supported implementation of Host::Backtrace, this patch should enable richer information in stack traces, such as file and line number information, as well as giving it the ability to unwind through inlined functions. llvm-svn: 231511
* Further reduce header footprint of Debugger.h.Zachary Turner2015-03-043-0/+3
| | | | llvm-svn: 231202
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-031-0/+1
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Don't #include ClangASTContext.h from Module.hZachary Turner2015-03-031-5/+6
| | | | | | | | | | | | This is part of a larger effort to reduce header file footprints. Combined, these patches reduce the build time of LLDB locally by over 30%. However, they touch many files and make many changes, so will be submitted in small incremental pieces. Reviewed By: Greg Clayton Differential Revision: http://reviews.llvm.org/D8022 llvm-svn: 231097
* Remove duplicated code for synthetic array members.Bruce Mitchener2015-02-261-52/+6
| | | | | | | | | | | | | | | | | Summary: The code for GetSyntheticArrayMemberFromPointer and GetSyntheticArrayMemberFromArray was identical, so just collapse the the methods into one. Reviewers: granata.enrico, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7911 llvm-svn: 230708
* Fix Bug 20400Chaoren Lin2015-02-261-1/+1
| | | | | | | | | | | | | | | | | | | Summary: http://llvm.org/bugs/show_bug.cgi?id=20400 The default triple of i686-pc-linux-gnu for 32 bit linux targets is compatible but not necessarily identical to the inferior binaries. Applying Azat Khuzhin's solution of using ArchSpec::IsCompatibleMatch() instead of ArchSpec::IsExactMatch() when comparing ObjectFile and Modules architecture. Reviewers: vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7897 llvm-svn: 230694
* Fix a typo Debugger::ExecuteIOHanders to Debugger::ExecuteIOHandlers.Siva Chandra2015-02-261-2/+2
| | | | | | | | | | | | | | Test Plan: Build LLDB. Reviewers: zturner, vharron, clayborg Reviewed By: vharron, clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D7894 llvm-svn: 230663
* Fix a bug where LLDB could be convinced to attempt to extract a bitfield of ↵Enrico Granata2015-02-261-1/+1
| | | | | | size 0, and consequently crash llvm-svn: 230661
* Refactor OptionValue::SetValueFromCString to use llvm::StringRefPavel Labath2015-02-201-2/+2
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7676 llvm-svn: 230005
* Fix TestDataFormatter* on LinuxVince Harron2015-02-181-1/+1
| | | | | | | | | | | llvm::StringRef doesn't make a copy of a string, it just holds a reference. When special_directions_stream went out of scope, special_directions was holding on to a stale pointer. Moving special_directions_stream into a higher scope to keep special_directions pointing to a valid string. llvm-svn: 229767
* Change the default disassembly format again. First attempt atJason Molenda2015-02-134-16/+97
| | | | | | | | | | | | | | | | changing it was in r219544 - after living on that for a few months, I wanted to take another crack at this. The disassembly-format setting still exists and the old format can be user specified with a setting like ${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}: This patch was discussed in http://reviews.llvm.org/D7578 <rdar://problem/19726421> llvm-svn: 229186
* Add a ModuleList::ForEach(...) which takes the module list mutex calls the ↵Greg Clayton2015-02-131-0/+12
| | | | | | | | std::function argument with each module. If you return true in the callback, iteration will continue, if you return false, iteration will stop and the lock will be released. <rdar://problem/19213054> llvm-svn: 229008
* Make a more complete fix for always supplying an execution context when ↵Greg Clayton2015-02-123-6/+6
| | | | | | | | | | getting byte sizes from types. There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime. Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use. llvm-svn: 228892
* Introduce the notion of "runtime support values"Enrico Granata2015-02-111-0/+15
| | | | | | | | | | | | A runtime support value is a ValueObject whose only purpose is to support some language runtime's operation, but it does not directly provide any user-visible benefit As such, unless the user is working on the runtime support, it is mostly safe for them not to see such a value when debugging It is a language runtime's job to check whether a ValueObject is a support value, and that - in conjunction with a target setting - is used by frame variable and target variable SBFrame::GetVariables gets a new overload with yet another flag to dictate whether to return those support values to the caller - that which defaults to the setting's value rdar://problem/15539930 llvm-svn: 228791
* When creating a disassembler for one of the arm variants that canJason Molenda2015-02-071-0/+18
| | | | | | | | | only execute thumb instructions, force the arch triple string to be "thumbv..." instead of "armv..." so we do the right thing by default when disassembling arbitrary chunks of code. <rdar://problem/15126397> llvm-svn: 228486
* Avoid leaking log file descriptors into the inferior process.Pavel Labath2015-02-051-1/+2
| | | | | | | | | | | | | | Summary: This commit adds a new open flag File::eOpenOptionCloseOnExec (i.e., O_CLOEXEC), and adds it to the list of flags when opening log files (#ifndef windows). A regression test is included. Reviewers: vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7412 llvm-svn: 228310
* Don't wait for the dynamic loader to set a module as a dynamic link editor, ↵Greg Clayton2015-02-051-3/+10
| | | | | | | | | | figure it out through the ObjectFile. Background: dyld binaries often have extra symbols in their symbol table like "malloc" and "free" for the early bringup of dyld and we often don't want to set breakpoints in dynamic linker binaries. We also don't want to call the "malloc" or "free" function in dyld when a user writes an expression like "(void *)malloc(123)" so we need to avoid doing name lookups in dyld. We mark Modules as being dynamic link editors and this helps do correct lookups for breakpoints by name and function lookups. <rdar://problem/19716267> llvm-svn: 228261
* Unbreak the cmake build by adding some new filesReid Kleckner2015-02-041-0/+1
| | | | llvm-svn: 228224
* Update documenation for the changed in from ${var.script:<pythonfunction>} ↵Greg Clayton2015-02-041-1/+1
| | | | | | to the new ${script.var:<pythonfunction>}. llvm-svn: 228216
* Get rid of Debugger::FormatPrompt() and replace it with the new FormatEntity ↵Greg Clayton2015-02-044-1723/+2581
| | | | | | | | | | | | | | | | | | | class. Why? Debugger::FormatPrompt() would run through the format prompt every time and parse it and emit it piece by piece. It also did formatting differently depending on which key/value pair it was parsing. The new code improves on this with the following features: 1 - Allow format strings to be parsed into a FormatEntity::Entry which can contain multiple child FormatEntity::Entry objects. This FormatEntity::Entry is a parsed version of what was previously always done in Debugger::FormatPrompt() so it is more efficient to emit formatted strings using the new parsed FormatEntity::Entry. 2 - Allows errors in format strings to be shown immediately when setting the settings (frame-format, thread-format, disassembly-format 3 - Allows auto completion by implementing a new OptionValueFormatEntity and switching frame-format, thread-format, and disassembly-format settings over to using it. 4 - The FormatEntity::Entry for each of the frame-format, thread-format, disassembly-format settings only replaces the old one if the format parses correctly 5 - Combines all consecutive string values together for efficient output. This means all "${ansi.*}" keys and all desensitized characters like "\n" "\t" "\0721" "\x23" will get combined with their previous strings 6 - ${*.script:} (like "${var.script:mymodule.my_var_function}") have all been switched over to use ${script.*:} "${script.var:mymodule.my_var_function}") to make the format easier to parse as I don't believe anyone was using these format string power user features. 7 - All key values pairs are defined in simple C arrays of entries so it is much easier to add new entries. These changes pave the way for subsequent modifications where we can modify formats to do more (like control the width of value strings can do more and add more functionality more easily like string formatting to control the width, printf formats and more). llvm-svn: 228207
* Fix synchronization issue in Broadcaster::HijackBroadcaster.Oleksiy Vyalov2015-02-041-0/+10
| | | | llvm-svn: 228179
* Fixed bugs in the multi-threaded access in HostInfoBase. Prior to this fix, ↵Greg Clayton2015-02-031-1/+1
| | | | | | | | | | static bool variables were used but this is not sufficient. We now use std::call_once in all places where the previous static bool code was used to try to implement thread safety. This was causing code that opened multiple targets to try and get a path to debugserver from the GDB remote communication class, and it would get the LLDB path and some instances would return empty strings and it would cause debugserver to not be found. <rdar://problem/18756927> llvm-svn: 227935
* Move several GetByteSize() calls over to the brave new world of taking an ↵Enrico Granata2015-01-284-7/+17
| | | | | | | | | | ExecutionContext* And since enough of these are doing the right thing, add a test case to verify we are doing the right thing with freeze drying ObjC object types Fixes rdar://18092770 llvm-svn: 227282
* If we say:Greg Clayton2015-01-281-1/+1
| | | | | | | | (lldb) b isEqual: We end up calling "breakpoint set --name "isEqual:" and it was not checking for selectors due to a logic error. llvm-svn: 227281
* Preparatory infrastructural work to support dynamically determining sizes of ↵Enrico Granata2015-01-285-9/+9
| | | | | | | | | | | | ObjC types via the runtime This is necessary because the byte size of an ObjC class type is not reliably statically knowable (e.g. because superclasses sit deep in frameworks that we have no debug info for) The lack of reliable size info is a problem when trying to freeze-dry an ObjC instance (not the pointer, the pointee) This commit lays the foundation for having language runtimes help in figuring out byte sizes, and having ClangASTType ask for runtime help No feature change as no runtime actually implements the logic, and nowhere is an ExecutionContext passed in yet llvm-svn: 227274
* Add an overload of SetValueFromCString() to ValueObjectSynthetic that is ↵Enrico Granata2015-01-261-0/+6
| | | | | | | | | | just a passthrough to the parent object Without this overload, attempts to edit the value of a variable with synthetic children enabled would change the value inside the synthetic ValueObject, but not propagate the changes to the underlying storage, hence resulting in no write for any meaningful purpose Comes with a test case, and fixes rdar://19586311 llvm-svn: 227120
* Adding the ability to get the language from a mangled name. This isn't used ↵Greg Clayton2015-01-231-0/+15
| | | | | | in the SVN LLDB, but will be used in another codebase based on the SVN LLDB. llvm-svn: 226962
* Fix indentation in ValueObject.cpp (test commit)Tamas Berghammer2015-01-231-2/+2
| | | | llvm-svn: 226906
* Error::Clear() should reset the type to invalid instead of generic.Zachary Turner2015-01-221-1/+1
| | | | | | | | | | This matches the behavior of the default constructor, so is technically more correct. Patch by Chaoren Lin Differential Revision: http://reviews.llvm.org/D7113 llvm-svn: 226851
* Don't stomp the triple when loading a PECOFF target.Zachary Turner2015-01-222-3/+20
| | | | | | | | | | | | | | | | | | | | | When you create a target, it tries to look for the platform's list of supported architectures for a match. The match it finds can contain specific triples, like i386-pc-windows-msvc. Later, we overwrite this value with the most generic triple that can apply to any platform with COFF support, causing some of the fields of the triple to get overwritten. This patch changes the behavior to only merge in values from the COFF triple if the fields of the matching triple were unknown/unspecified to begin with. This fixes load address resolution on Windows, since it enables the DynamicLoaderWindows to be used instead of DynamicLoaderStatic. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D7120 llvm-svn: 226849
* Add an API to ValueObject that iterates over the entire parent chain via a ↵Enrico Granata2015-01-221-8/+14
| | | | | | callback, and rewrite GetRoot() in terms of this general iteration API. NFC llvm-svn: 226771
* Abstract the details from regex.h a bit more by not allowing people to ↵Greg Clayton2015-01-211-34/+22
| | | | | | | | | | specify compile and execute flags for regular expressions. Also enable better regular expressions if they are available by check if the REG_ENHANCED is available and using it if it is. Since REG_ENHANCED is available on MacOSX, this allow the use of \d (digits) \b (word boundaries) and much more without affecting other systems. <rdar://problem/12082562> llvm-svn: 226704
* Allow individual ValueObjects to pick their preferred display languageEnrico Granata2015-01-211-12/+23
| | | | | | | | Most of the time, we can use context information just fine to choose a language (i.e. the language of the frame that the root object was defined in, if any); but in some cases, synthetic children may be fabricated as root frame-less entities, and then we wouldn't know any better This patch allows (internal) synthetic child providers to set a display language on the children they generate, should they so choose llvm-svn: 226634
* Added Connection::GetURI()Vince Harron2015-01-172-0/+15
| | | | | | | | | | | | | This function returns a URI of the resource that the connection is connected to. This is especially important for connections established by accepting a connection from a remote host. Also added implementations for ConnectionMachPort, ConnectionSharedMemory, Also fixed up some documentation in Connection::Write Renamed ConnectionFileDescriptorPosix::SocketListen to ConnectionFileDescriptorPosix::SocketListenAndAccept Fixed a log message in Socket.cpp Differential Review: http://reviews.llvm.org/D7026 llvm-svn: 226362
OpenPOWER on IntegriCloud