summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
Commit message (Collapse)AuthorAgeFilesLines
...
* Move StructuredData from Core to UtilityPavel Labath2017-06-272-3/+3
| | | | | | | | | | | | | | | | Summary: It had a dependency on StringConvert and file reading code, which is not in Utility. I've replaced that code by equivalent llvm operations. I've added a unit test to demonstrate that parsing a file still works. Reviewers: zturner, jingham Subscribers: kubamracek, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34625 llvm-svn: 306394
* Introduce new command: thread backtrace uniquePavel Labath2017-06-123-32/+40
| | | | | | | | | | | | | | | | | This patch introduces a new thread backtrace command "unique". The command is based off of "thread backtrace all" but will instead find all threads which share matching call stacks and de-duplicate their output, listing call stack and all the threads which share it. This is especially useful for apps which use thread/task pools sitting around waiting for work and cause excessive duplicate output. I needed this behavior recently when debugging a core with 700+ threads. Differential Revision: https://reviews.llvm.org/D33426 Reviewers: clayborg, jingham Patch by Brian Gianforcaro <b.gianfo@gmail.com> llvm-svn: 305197
* Fix backtrace of noreturn functions situated at the end of a modulePavel Labath2017-06-082-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When a call instruction is the last instruction in a function, the backtrace PC will point past the end of the function. We already had special code to handle that, but we did not handle the case where the PC ends up outside of the bounds of the module containing the function, which is a situation that occured in TestNoreturnUnwind on android for some arch/compiler combinations. I fix this by adding an argument to Address resolution code which states that we are ok with addresses pointing to the end of a module/section to resolve to that module/section. I create a reproducible test case for this situation by hand-crafting an executable which has a noreturn function at the end of a module. Reviewers: jasonmolenda, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32022 llvm-svn: 304976
* Added new API to SBStructuredData classAbhishek Aggarwal2017-05-291-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Added API to access data types -- integer, double, array, string, boolean and dictionary data types -- Earlier user had to parse through the string output to get these values - Added Test cases for API testing - Added new StructuredDataType enum in public include file -- Replaced locally-defined enum in StructuredData.h with this new one -- Modified other internal files using this locally-defined enum Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: clayborg, lldb-commits Reviewed By: clayborg Subscribers: labath Differential Revision: https://reviews.llvm.org/D33434 llvm-svn: 304138
* Recommit "RunThreadPlan: Fix halting logic in IgnoreBreakpoints = false"Pavel Labath2017-05-251-70/+67
| | | | | | | | | | | | | | | | | | This is a resubmit of r303732, which was reverted due to a regression. The original patch caused a regression in TestLoadUnload, which has only showed up when running the remote test suite. The problem there was that we interrupted the target just as it has hit the rendezvous breakpoint in the dlopen call. This meant that the stop reason was set to "breakpoint" even though the event would not have been broadcast if we had not stopped the process. I fix this by checking StopInfo->ShouldNotify() before stopping. I also add a new test for the handling of conditional breakpoints in expressions, which I noticed to be broken (pr33164) Differential Revision: https://reviews.llvm.org/D33283 llvm-svn: 303848
* Revert "RunThreadPlan: Fix halting logic in IgnoreBreakpoints = false"Pavel Labath2017-05-241-66/+70
| | | | | | | This reverts commit r303732, as it introduces a regression in TestLoadUnload on android. llvm-svn: 303740
* RunThreadPlan: Fix halting logic in IgnoreBreakpoints = falsePavel Labath2017-05-241-70/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The function had logic to handle the case when the expression terminated while we were trying to halt the process, but it failed to take into account the possibility that the expression stopped because it hit a breakpoint. This was caused by the fact that the handling of the stopped events was duplicated for the "halting" and regular cases (the regular case handled this situation correctly). I've tried to merge these two cases into one to make sure they stay in sync. I should call out that the two cases were checking whether the thread plan has completed in slightly different ways. I am not sure what is the difference between them, but I think the check should be the same in both cases, whatever it is, so I just took the one from the regular case, as that is probably more tested. For the test, I modified TestUnwindExpression to run the expression with a smaller timeout (this is how I found this bug originally). With a 1ms one thread timeout, the test failed consistently without this patch. Reviewers: jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D33283 llvm-svn: 303732
* Remove an expensive lock from TimerPavel Labath2017-05-152-5/+6
| | | | | | | | | | | | | The Timer destructor would grab a global mutex in order to update execution time. Add a class to define a category once, statically; the class adds itself to an atomic singly linked list, and thus subsequent updates only need to use an atomic rather than grab a lock and perform a hashtable lookup. Differential Revision: https://reviews.llvm.org/D32823 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 303058
* Update StructuredData::String to return StringRefs.Zachary Turner2017-05-123-12/+10
| | | | | | | | It was returning const std::string& which was leading to unnecessary copies all over the place, and preventing people from doing things like Dict->GetValueForKeyAsString("foo", ref); llvm-svn: 302875
* Rename Error -> Status.Zachary Turner2017-05-1218-374/+382
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Add DidStartExecuting/WillFinishExecuting methods to Expression.Lang Hames2017-05-051-0/+11
| | | | | | | | | | | | | | | | These methods can be used by the derived expression types to perform expression specific and/or language specific actions before and after the expression runs. (ThreadPlanCallUserExpression is modified to call these methods on the expression immediately before/after execution of the expression). The immediate motivation is allowing Swift expressions to notify the swift runtime that exclusivity enforcement should be suspended while the expression runs (we want LLDB expressions to be able to access variables even when they're considered exclusively owned by someone else in the original program). Reviewed in https://reviews.llvm.org/D32889 llvm-svn: 302314
* Provide a mechanism to do some pre-loading of symbols up front.Jim Ingham2017-04-281-0/+19
| | | | | | | | | | | Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
* Teach SBFrame how to guess its language.Jim Ingham2017-04-121-3/+8
| | | | | | <rdar://problem/31411646> llvm-svn: 300012
* iwyu fixes for lldbCore.Zachary Turner2017-04-063-0/+4
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* DisassembleRange can return an empty DisassemblerSPJim Ingham2017-03-311-1/+1
| | | | | | | | check for it. <rdar://problem/31379799> llvm-svn: 299276
* Add support for sythetic operator dereferenceTamas Berghammer2017-03-311-2/+25
| | | | | | | | | | | | | | | | Summary: After this change a sythetic child provider can generate a special child named "$$dereference$$" what if present is used when "operator*" or "operator->" used on a ValueObject. The goal of the change is to make expressions like "up->foo" work inside the "frame variable" command. Reviewers: labath, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31368 llvm-svn: 299251
* Delete some more dead includes.Zachary Turner2017-03-224-2/+2
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-223-3/+3
| | | | llvm-svn: 298536
* Resubmit "Delete the remainder of platform specific code in FileSpec."Zachary Turner2017-03-221-4/+5
| | | | | | | | | | | | | | This was causing a test failure in one of LLDB's tests which specifically dealt with a limitation in LLVM's implementation of home_directory() that LLDB's own implementation had worked around. This limitation has been addressed in r298513 on the LLVM side, so the failing test (which is now unnecessary as the limitation no longer exists) was removed in r298519, allowing this patch to be re-submitted without modification. llvm-svn: 298526
* Revert "Delete the remainder of platform specific code in FileSpec."Pavel Labath2017-03-221-5/+4
| | | | | | | This reverts commit r298465 as it breaks TestLLVM.TestHomeDirectory.test_tilde_home_directory. llvm-svn: 298509
* Delete the remainder of platform specific code in FileSpec.Zachary Turner2017-03-221-4/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D31129 llvm-svn: 298465
* Replace std::ofstream with llvm::raw_fd_ostreamPavel Labath2017-03-211-2/+3
| | | | | | | | | | | | | | Summary: ofstream does not handle paths with non-ascii characters correctly on windows, so I am switching these to llvm streams to fix that. Reviewers: zturner, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31079 llvm-svn: 298375
* Resubmit r298334 after fixing OSX build errors.Zachary Turner2017-03-212-15/+12
| | | | | | | Hopefully this works, I can't test since I don't have Mac hardware, however. llvm-svn: 298340
* Revert r298334 until Zachary has a chance to fix the buildbot failureJason Molenda2017-03-212-12/+15
| | | | | | on macosx. llvm-svn: 298338
* Delete various lldb FileSystem functions.Zachary Turner2017-03-212-15/+12
| | | | | | | | Use LLVM's equivalent versions instead. Differential Revision: https://reviews.llvm.org/D31111 llvm-svn: 298334
* Delete LLDB's MD5 code. Use LLVM instead.Zachary Turner2017-03-201-3/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D31108 llvm-svn: 298325
* Remove FileSystem::Get/SetFilePermissionsZachary Turner2017-03-191-6/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D31089 llvm-svn: 298205
* Remove FileSystem::MakeDirectory.Zachary Turner2017-03-191-1/+1
| | | | | | | | Have callers use llvm::sys::fs::create_directory() instead. Differential Revision: https://reviews.llvm.org/D31086 llvm-svn: 298203
* Remove LLDB's recursive directory deletion function.Zachary Turner2017-03-091-1/+1
| | | | | | LLVM now has such a function, so we use that instead. llvm-svn: 297360
* Resubmit FileSystem changes.Zachary Turner2017-03-083-31/+27
| | | | | | | | | | This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300
* Make LLDB skip server-client roundtrip for signals that don't require any ↵Eugene Zemtsov2017-03-072-0/+53
| | | | | | | | | | | | | | actions If QPassSignals packaet is supported by lldb-server, lldb-client will utilize it and ask the server to ignore signals that don't require stops or notifications. Such signals will be immediately re-injected into inferior to continue normal execution. Differential Revision: https://reviews.llvm.org/D30520 llvm-svn: 297231
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-073-31/+26
| | | | | | | | | | | | | | | this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
* Use LLVM for all stat-related functionality.Zachary Turner2017-03-073-26/+31
| | | | | | | | | | This deletes LLDB's FileType enumeration and replaces all users, and all calls to functions that check whether a file exists etc with corresponding calls to LLVM. Differential Revision: https://reviews.llvm.org/D30624 llvm-svn: 297116
* Move many other files from Core -> Utility.Zachary Turner2017-03-061-1/+1
| | | | llvm-svn: 297043
* Truncate thread names if they're too long.Zachary Turner2017-03-041-2/+4
| | | | llvm-svn: 296972
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-044-5/+5
| | | | llvm-svn: 296943
* Move Log from Core -> Utility.Zachary Turner2017-03-0329-31/+31
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Fix various warnings. NFCZachary Turner2017-03-023-5/+5
| | | | llvm-svn: 296717
* Fix incorrect logic in StackFrame::Disassemble.Zachary Turner2017-02-281-11/+13
| | | | | | This had broken as the result of some previous cleanup. llvm-svn: 296495
* Fixed errors in AllocatedBlock:Greg Clayton2017-02-221-4/+9
| | | | | | | | | - Allow zero byte size request for memory and ensure it gets a unique address - Exit the free block loop when we find an appropriate free block <rdar://problem/30644888> llvm-svn: 295907
* Fix a couple of corner cases in NameMatchesPavel Labath2017-02-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I originally set out to move the NameMatches closer to the relevant function and add some unit tests. However, in the process I've found a couple of bugs in the implementation: - the early exits where not always correct: - (test==pattern) does not mean the match will always suceed because of regular expressions - pattern.empty() does not mean the match will fail because the "" is a valid prefix of any string So I cleaned up those and added some tests. The only tricky part here was that regcomp() implementation on darwin did not recognise the empty string as a regular expression and returned an REG_EMPTY error instead. The simples fix here seemed to be to replace the empty expression with an equivalent non-empty one. Reviewers: clayborg, zturner Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D30094 llvm-svn: 295651
* Bug 30863 - Step doesn't stop with conditional breakpoint on the next lineBoris Ulasevich2017-02-155-27/+91
| | | | | | | | | Differential Revisions: https://reviews.llvm.org/D26497 (committed r290168, temporary reverted r290197) https://reviews.llvm.org/D28945 (fix for Ubuntu tests fail) https://reviews.llvm.org/D29909 (fix for TestCallThatThrows test fail) llvm-svn: 295168
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-145-2/+459
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Add a format_provider for the Timeout classPavel Labath2017-02-101-45/+17
| | | | | | | | | | and use it in the appropriate log statements. Formatting of chrono types in log messages was very clunky. This should make it much nicer to use and give better output. For details of the formatting options see the chrono formatter in llvm. llvm-svn: 294738
* Make sure we only load the OS plug-in once.Greg Clayton2017-02-091-3/+7
| | | | | | <rdar://problem/27580297> llvm-svn: 294611
* Fix build bots.Greg Clayton2017-02-091-2/+2
| | | | llvm-svn: 294603
* Fixed an issue where AllocatedBlock::ReserveRange does a linear search ↵Greg Clayton2017-02-091-110/+45
| | | | | | | | | | | | through reserved ranges. After many expressions are evaluated we were spending time looking for open blocks on memory in the one or more AllocatedBlock objects and it would slow down expression evaluation. I implemented a fixed size blocks implementation that maintains a sorted free list to fix the issue. <rdar://problem/17962974> llvm-svn: 294600
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-061-4/+6
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
* Remove LIBLLDB_LOG_VERBOSE categoryPavel Labath2017-02-053-48/+29
| | | | | | | | | | | | | | | | | | | | | Summary: Per discussion in D28616, having two ways two request logging (log enable lldb XXX verbose && log enable -v lldb XXX) is confusing. This removes the first option and standardizes all code to use the second one. I've added a LLDB_LOGV macro as a shorthand for if(log && log->GetVerbose()) and switched most of the affected log statements to use that (I've only left a couple of cases that were doing complex computations in an if(log) block). Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29510 llvm-svn: 294113
* Fix incorrect logging in ThreadPlan::ShouldReportStopPavel Labath2017-02-031-5/+2
| | | | | | | it used printf with formatv style specifications. Also, switch to LLDB_LOG. llvm-svn: 294024
OpenPOWER on IntegriCloud