summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix mismatched new/free in Process:RunPrivateStateThreadPavel Labath2016-08-241-3/+2
| | | | | | NFC llvm-svn: 279627
* Add api logging for SBDebugger::SetCurrentPlatformSDKRoot.Jason Molenda2016-08-241-0/+3
| | | | | | <rdar://problem/27857025> llvm-svn: 279611
* Implementation "step out" plans shouldn't gather the return value.Jim Ingham2016-08-232-3/+10
| | | | | | | | | | When, for instance, "step-in" steps into a function that it doesn't want to stop in (e.g. has no debug info) it will push a step-out plan to implement the step out so it can then continue stepping. These step out's don't use the result of the function stepped out of, so they shouldn't spend the time to compute it. llvm-svn: 279540
* Change the PathMappingList::FindFile to use FileSpec API'sJim Ingham2016-08-232-8/+8
| | | | | | Also, when appending path components, collapse multiple "/" into one at the join. llvm-svn: 279533
* Fix a crash in GDBRemoteCommunicationClient::GetSupportedStructuredDataPluginsPavel Labath2016-08-231-1/+1
| | | | | | The function was attempting to write the reply to the log even if the reply was empty. llvm-svn: 279513
* Add a non-code-running data formatter for __NSCFBooleanEnrico Granata2016-08-222-0/+39
| | | | llvm-svn: 279446
* Add logic to the ObjC runtime in LLDB to extract the pointer values of the ↵Enrico Granata2016-08-204-1/+63
| | | | | | | | two singleton (pairtons?) instances of __NSCFBoolean that represent true and false This is useful because that knowledge will in turn allow no-code-running formatting of boolean NSNumbers; but that's a commit that will have to wait Monday.. llvm-svn: 279353
* [lldb] Use OrcMCJITReplacement rather than MCJIT as the underlying JIT for LLDBLang Hames2016-08-191-1/+2
| | | | | | | | | | expression evaluation. OrcMCJITReplacement is a reimplementation of MCJIT using ORC components, and provides an easy upgrade path to ORC for existing MCJIT clients. There should be no functional changes resulting from this switch. llvm-svn: 279327
* Moved #include for lldb-python.h to a distinct group with a reminder commentKate Stone2016-08-193-1/+7
| | | | | | | declaring that it must be first. Failure to do so results in build failures on macOS due to subtle header conflicts. llvm-svn: 279315
* Fix 32-bit builds after r279232Pavel Labath2016-08-191-2/+3
| | | | | | | GetByteSize() of a DataBuffer returns a uint64_t (it probably shouldn't), which isn't implicitly convertible to size_t. llvm-svn: 279238
* Remove the last manually constructed packet from gdb-remote register context ↵Pavel Labath2016-08-197-129/+90
| | | | | | | | | | | | | | | | | | | | | + small refactor Summary: The tricky part here was that the exisiting implementation of WriteAllRegisters was expecting hex-encoded data (as that was what the first implementation I replaced was using, but here we had binary data to begin with. I thought the read/write register functions would be more useful if they handled the hex-encoding themselves (all the other client functions provide the responses in a more-or-less digested form). The read functions return a DataBuffer, so they can allocate as much memory as they need to, while the write functions functions take an llvm::ArrayRef, as that can be constructed from pretty much anything. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23659 llvm-svn: 279232
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-1925-12/+3884
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-1924-3882/+12
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-1924-12/+3882
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* Fixed a problem where we failed to get the size of an Objective-C type.Sean Callanan2016-08-181-1/+3
| | | | | | <rdar://problem/27897056> llvm-svn: 279098
* gdb-remote: Remove manual locking from GetShlibInfoAddrPavel Labath2016-08-181-16/+4
| | | | | | | The function can simply call the non-NoLock version of the SendPacket function and let it do the locking. llvm-svn: 279070
* Move QSyncThreadState packet generation to the gdb-remote clientPavel Labath2016-08-184-29/+21
| | | | llvm-svn: 279057
* gdb-remote: Centralize thread specific packet handlingPavel Labath2016-08-182-164/+79
| | | | | | | | | | | | | | | | | | | | Summary: Before this, each function had a copy of the code which handled appending of the thread suffix to the packet (or using $Hg instead). I have moved that code into a single function and made everyone else use that. The function takes the partial packet as a StreamString rvalue reference, to avoid a copy and to remind the users that the packet will have undeterminate contents after the call. This also fixes the incorrect formatting of the QRestoreRegisterState packet in case thread suffix is not supported. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23604 llvm-svn: 279040
* Fix parsing of complicated C++ namesPavel Labath2016-08-181-1/+3
| | | | | | | | | | | | | | | | Summary: CPlusPlusLanguage::MethodName was not correctly parsing templated functions whose demangled name included the return type -- the space before the function name was included in the "context" and the context itself was not terminated correctly due to a misuse of the substr function (second argument is length, not the end position). Fix that and add a regression test. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23608 llvm-svn: 279038
* Remove cmake legacy codePavel Labath2016-08-171-1/+1
| | | | | | | | | | | | Summary: Cmake 2.8 support is gone and not coming back. We can remove a bit of legacy code now. Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23554 llvm-svn: 278924
* Remove manual packet construction from ↵Pavel Labath2016-08-171-18/+5
| | | | | | GDBRemoteRegisterContext::SetPrimordialRegister llvm-svn: 278916
* Move packet construction from GDBRemoteRegisterContext go the communication ↵Pavel Labath2016-08-173-271/+217
| | | | | | | | | | | | | | | | | | | | | | | | class Summary: When saving/restoring registers the GDBRemoteRegisterContext class was manually constructing the register save/restore packets. This creates appropriate helper functions in GDBRemoteCommunicationClient, and switches the class to use those. It also removes what a duplicate packet send in some of those functions, a thing that I can only attribute to a bad merge artefact. I also add a test framework for testing gdb-remote client functionality and add tests for the new functions I introduced. I'd like to be able to test the register context changes in isolation as well, but currently there doesn't seem to be a way to reasonably construct a standalone register context object, so we'll have to rely on the end-to-end tests to verify that. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23553 llvm-svn: 278915
* Remove GetThreadSuffixSupported from GDBRemoteCommunication **base** classPavel Labath2016-08-163-13/+1
| | | | | | | Despite its comment, the function is only used in the Client class, and its presence was merely complicating mock implementation in unit tests. llvm-svn: 278785
* Symbol: add missing item in covered switchSaleem Abdulrasool2016-08-161-0/+1
| | | | | | | RenderScript was missing from the covered switch. Add it to avoid a warning of the missing entry. NFC. llvm-svn: 278774
* Fix expression evaluation with operator newPavel Labath2016-08-152-242/+283
| | | | | | | | | | | | | | | | Summary: referencing a user-defined operator new was triggering an assert in clang because we were registering the function name as string "operator new", instead of using the special operator enum, which clang has for this purpose. Method operators already had code to handle this, and now I extend this to cover free standing operator functions as well. Test included. Reviewers: spyffe Subscribers: sivachandra, paulherman, lldb-commits Differential Revision: http://reviews.llvm.org/D17856 llvm-svn: 278670
* Fix a race in Broadcaster/Listener interactionPavel Labath2016-08-151-82/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following problem was occuring: - broadcaster B had two listeners: L1 and L2 (thread T1) - (T1) B has started to broadcast an event, it has locked a shared_ptr to L1 (in ListenerIterator()) - on another thread T2 the penultimate reference to L1 was destroyed (the transient object in B is now the last reference) - (T2) the last reference to L2 was destroyed as well - (T1) B has finished broadcasting the event to L1 and destroyed the last shared_ptr - (T1) this triggered the destructor, which called into B->RemoveListener() - (T1) all pointers in the m_listeners list were now stale, so RemoveListener emptied the list - (T1) Eventually control returned to the ListenerIterator() for doing broadcasting, which was still in the middle of iterating through the list - (T1) Only now, it was holding onto a dangling iterator. BOOM. I fix this issue by making sure nothing can interfere with the iterate-and-remove-expired-pointers loop, by moving this logic into a single function, which first locks (or clears) the whole list and then returns the list of valid and locked Listeners for further processing. Instead of std::list I use an llvm::SmallVector which should hopefully offset the fact that we create a copy of the list for the common case where we have only a few listeners (no heap allocations). A slight difference in behaviour is that now RemoveListener does not remove an element from the list -- it only sets it's mask to 0, which means it will be removed during the next iteration of GetListeners(). This is purely an implementation detail and it should not be externally noticable. I was not able to reproduce this bug reliably without inserting sleep statements into the code, so I do not add a test for it. Instead, I add some unit tests for the functions that I do modify. Reviewers: clayborg, jingham Subscribers: tberghammer, lldb-commits Differential Revision: https://reviews.llvm.org/D23406 llvm-svn: 278664
* Fixup r278524 for non-apple targetsPavel Labath2016-08-151-3/+5
| | | | | | | | The commit started passing a nullptr port into GDBRemoteCommunication::StartDebugserverProcess. The function was mostly handling the null value correctly, but it one case it did not check it's value before assigning to it. Fix that. llvm-svn: 278662
* elf-core: set powerpc vector byte order correctlyEd Maste2016-08-141-1/+1
| | | | | | | It was being set to the fp reg set's byte order due to an apparent copy-and-pasteo. llvm-svn: 278625
* Fix build on Windows.Zachary Turner2016-08-121-1/+1
| | | | llvm-svn: 278526
* Switch over to using socketpair for local debugserver connections as they ↵Greg Clayton2016-08-124-32/+72
| | | | | | | | | | | | | | | | are twice as fast as TCP sockets (on macOS at least). This change opens a socket pair and passes the second socket pair file descriptor down to the debugserver binary using a new option: "--fd=N" where N is the file descriptor. This file descriptor gets passed via posix_spawn() so that there is no need to do any bind/listen or bind/accept calls and eliminates the hanshake unix socket that is used to pass the result of the actual port that ends up being used so it can save time on launch as well as being faster. This is currently only enabled on __APPLE__ builds. Other OSs should try modifying the #define from ProcessGDBRemote.cpp but the first person will need to port the --fd option over to lldb-server. Any OSs that enable USE_SOCKETPAIR_FOR_LOCAL_CONNECTION in their native builds can use the socket pair stuff. The #define is Apple only right now, but looks like: #if defined (__APPLE__) #define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1 #endif <rdar://problem/27814880> llvm-svn: 278524
* Fix-up r278299 for windowsPavel Labath2016-08-121-1/+7
| | | | | | | | | | | | FD_SETSIZE on windows limits the number of file descriptors, rather than their individual magnitude (the underlying implementation uses an array rather than a bitset). This meant that the assert in the SelectHelper was incorrect, and failing all the time. Fix that. I am not sure whether this should be #ifdef MSVC, or #ifdef WINDOWS, but my feeling is that a more posix-conforming implementation on windows would choose the bitset implementation, so I'm sticking with the former. llvm-svn: 278500
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-1153-600/+802
| | | | | | | | | | | | | | | | Options used to store a reference to the CommandInterpreter instance in the base Options class. This made it impossible to parse options independent of a CommandInterpreter. This change removes the reference from the base class. Instead, it modifies the options-parsing-related methods to take an ExecutionContext pointer, which the options may inspect if they need to do so. Closes https://reviews.llvm.org/D23416 Reviewers: clayborg, jingham llvm-svn: 278440
* [InstrumentationRuntime] Refactor the API (Part 2/N) (NFCI)Vedant Kumar2016-08-115-87/+74
| | | | | | | | | Factor out some common logic used to find the runtime library in a list of modules. Differential Revision: https://reviews.llvm.org/D23150 llvm-svn: 278368
* [InstrumentationRuntime] Refactor the API (Part 1/N) (NFCI)Vedant Kumar2016-08-115-98/+20
| | | | | | | | | | | | | | | | | Adapters for instrumentation runtimes have to do two basic things: 1) Load a runtime library. 2) Install breakpoints in that library. This logic is duplicated in the adapters for asan and tsan. Factor it out and document bits of it to make it easier to add new adapters. I tested this with check-lldb, and double-checked testcases/functionalities/{a,t}san. Differential Revision: https://reviews.llvm.org/D23043 llvm-svn: 278367
* Make sure files include what they use (part 2/2)Pavel Labath2016-08-117-9/+14
| | | | | | This makes lldb still compile on linux after a project-wide clang-format llvm-svn: 278335
* Remove a double send of eRunPacketSent eventPavel Labath2016-08-111-2/+0
| | | | | | | I accidentaly added the send both to the base class and the derived class in my refactor. Fix that. llvm-svn: 278325
* dlopen & dlclose can't throw C++ or ObjC exceptions, so don't do the extra ↵Jim Ingham2016-08-111-0/+1
| | | | | | | | | | work of setting & deleting the breakpoints to watch for this. <rdar://problem/27780214> llvm-svn: 278305
* Fix a problem where if a uint64_t value is placed into a python dictionary ↵Greg Clayton2016-08-101-1/+12
| | | | | | | | and sent up to LLDB and converted to StructuredData, it would not be able to parse the full 64 bit value. A number like 0xf000000000000000L could be placed into a dictionary, and sent to LLDB and it would end up being 0xffffffffffffffff since it would overflow a int64_t. We leave the old code there, but if it overflows, we treat the number like a uint64_t and get it to decode correctly. Added a gtest to cover this so we don't regress. I verified the gtest failed prior to the fix, and it succeeds after it. <rdar://problem/27409265> llvm-svn: 278304
* Make pascal debugging work again.Greg Clayton2016-08-101-3/+4
| | | | | | <rdar://problem/27652051> llvm-svn: 278302
* Centralize all select() calls into one place so that we can take advantage ↵Greg Clayton2016-08-106-209/+383
| | | | | | | | | of system specific optimizations to deal with more file descriptors than FD_SETSIZE on some systems. <rdar://problem/25325383> https://reviews.llvm.org/D22950 llvm-svn: 278299
* Make sure files include what they use (part 1/N)Pavel Labath2016-08-108-9/+18
| | | | | | preparation for the big clang-format. llvm-svn: 278222
* Fix build on android and Linux.Zachary Turner2016-08-101-18/+8
| | | | | | | | gettimeofday() isn't defined without a special header. Rather than rely on C apis, let's just use modern C++11 to do this portably on all platforms using std::chrono. llvm-svn: 278182
* Delete Host/windows/win32.hZachary Turner2016-08-0951-114/+117
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* Adjust LLDB's iOS simulator interface for changes in CoreSimulatorEnrico Granata2016-08-096-21/+37
| | | | | | rdar://27732333 and rdar://27732377 llvm-svn: 278166
* Reapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"Pavel Labath2016-08-0911-895/+773
| | | | | | | | | | | | Resumbitting the commit after fixing the following problems: - broken unit tests on windows: incorrect gtest usage on my part (TEST vs. TEST_F) - the new code did not correctly handle the case where we went to interrupt the process, but it stopped due to a different reason - the interrupt request would remain queued and would interfere with the following "continue". I also added a unit test for this case. This reapplies r277156 and r277139. llvm-svn: 278118
* Garbage collection is not around anymore, we can remove our support for it.Greg Clayton2016-08-081-17/+1
| | | | llvm-svn: 278064
* Fix more RegisterInfo initialization issues and quiet hundreds of warnings.Greg Clayton2016-08-0811-727/+727
| | | | llvm-svn: 278063
* Fix printf warnings.Greg Clayton2016-08-081-2/+2
| | | | llvm-svn: 278061
* Fix RegisterInfo initializers to have all the required initializers after ↵Greg Clayton2016-08-088-229/+229
| | | | | | recent changes. This quiets a few hundred warnings on MacOSX. llvm-svn: 278060
* Fix uninitialized field warnings in GDBRemoteRegisterContextPavel Labath2016-08-081-109/+111
| | | | | | | also take the opportunity to replace NULL with nullptr and add clang-format guards to prevent it from messing up the nice table there. llvm-svn: 278005
OpenPOWER on IntegriCloud