summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* Change the formula for tagged NSIndexPath data formattingEnrico Granata2016-09-014-11/+139
| | | | | | Fixes rdar://25192935 llvm-svn: 280389
* Minidump parsingDimitar Vlahovski2016-09-0112-0/+768
| | | | | | | | | | | | | | | | | | | Summary: This is a Minidump parsing code. There are still some more structures/data streams that need to be added. The aim ot this is to be used in the implementation of a minidump debugging plugin that works on all platforms/architectures. Currently we have a windows-only plugin that uses the WinAPI to parse the dump files. Also added unittests for the current functionality. Reviewers: labath, amccarth Subscribers: tberghammer, danalbert, srhines, lldb-commits, dschuff Differential Revision: https://reviews.llvm.org/D23545 llvm-svn: 280356
* XFail TestMemoryFind on 32-bit architecturesPavel Labath2016-09-011-0/+2
| | | | | | | | the test fails for a very prosaic reason: `(const char *)0x1000` returns "4096" on x86_64 and "1000" (without the "0x") on i386. I haven't tried other 32-bit arches, but I am guessing the behaviour is the same. XFAIL until someone can get a chance to look at this. llvm-svn: 280344
* There exists at least one compiler on one platform that doesn't know how to ↵Enrico Granata2016-09-011-1/+1
| | | | | | | | assert on a std::shared_ptr<> Appease it by being very very very explicit about what I mean llvm-svn: 280328
* Change "memory find" over to using a variation of the Boyer–Moore search ↵Enrico Granata2016-09-014-16/+152
| | | | | | | | algorithm Fixes rdar://15455621 (and adds a test case for this command which - surprisingly and sadly - was not there originally) llvm-svn: 280327
* Add a data formatter for std::function in libcxxEnrico Granata2016-08-316-0/+107
| | | | llvm-svn: 280295
* Fix an issue where a synthetic child provider could only provide a value of ↵Enrico Granata2016-08-313-10/+31
| | | | | | the same size as the containing type llvm-svn: 280294
* Remove unused variables.Zachary Turner2016-08-314-7/+1
| | | | | | Patch by Taras Tsugrii llvm-svn: 280283
* Always rely on CFI unwind info for linux vdsoPavel Labath2016-08-312-4/+26
| | | | | | | | | | | | | | | | | | Summary: The vdso is full of hand-written assembly which the instruction emulator has a hard time understanding. Luckily, the kernel already provides us with correct unwind info for them. So let's use it. This fixes (at least) the AssertingInferiorTestCase.test_inferior_asserting_disassemble test on android N i386. Reviewers: tberghammer Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D24079 llvm-svn: 280264
* Fixup TestPyObjSynthProvider.py and enable it againPavel Labath2016-08-313-1/+3
| | | | | | | | | | | | | | | Summary: - copies the new file in the cmake build - adds an additional import statement - marks the test as no-debug-info specific, as it seems to be testing a python feature Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24074 llvm-svn: 280261
* Add more unit tests for StringExtractor hex/endian functions.Zachary Turner2016-08-311-19/+133
| | | | | | | There were a few corner cases that weren't tested for dealing with extraction of an odd number of nibbles. Add tests for those here. llvm-svn: 280253
* XFail new TestPyObjSynthProvider.py on linux until I can investigate the ↵Pavel Labath2016-08-311-0/+1
| | | | | | cause of the problem llvm-svn: 280208
* Revert r280137 and 280139 and subsequent build fixesPavel Labath2016-08-3111-140/+218
| | | | | | | | | | The rewrite of StringExtractor::GetHexMaxU32 changes functionality in a way which makes lldb-server crash. The crash (assert) happens when parsing the "qRegisterInfo0" packet, because the function tries to drop_front more bytes than the packet contains. It's not clear to me whether we should consider this a bug in the caller or the callee, but it any case, it worked before, so I am reverting this until we can figure out what the proper interface should be. llvm-svn: 280207
* Revert r280200 and put it a proper fixPavel Labath2016-08-312-5/+4
| | | | | | PeekChar returns a character, we want the whole string there. llvm-svn: 280204
* Fix lldb build on Mac.Pavel Labath2016-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: https://github.com/llvm-mirror/lldb/commit/e80f43fd78fa0fbc04d2d59b5713acb5d06c8308 greatly improved an API, but missed one more occurence of legacy usage. This leads to: if (extractor.GetHexBytes(&payload_bytes[0], payload_bytes.size(), '\xdd') != payload_bytes.size()) ~~~~~~~~~~~~~~~~~~~~~ ^~~~~~ /lldb/include/lldb/Utility/StringExtractor.h:151:5: note: 'GetHexBytes' declared here Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24064 Author: Taras Tsugrii <ttsugrii@fb.com> llvm-svn: 280202
* Update the Linux code to reflect the changes done by zturner in r280139Sylvestre Ledru2016-08-311-1/+1
| | | | llvm-svn: 280200
* Rename the test classEnrico Granata2016-08-301-1/+1
| | | | llvm-svn: 280173
* Add an helper class lldb.formatters.synth.PythonObjectSyntheticChildProviderEnrico Granata2016-08-306-0/+153
| | | | | | | | This class enables one to easily write a synthetic child provider by writing a class that returns pairs of names and primitive Python values - the base class then converts those into LLDB SBValues Comes with a test case llvm-svn: 280172
* Teach ValueObject::ReadPointedString how to read char[] in host memoryEnrico Granata2016-08-301-5/+16
| | | | llvm-svn: 280166
* Fix a typo/thinko - this was generating the wrong kind of arrayEnrico Granata2016-08-301-1/+1
| | | | llvm-svn: 280164
* Add SBType::GetArrayType() such that - given a type - one can make an array ↵Enrico Granata2016-08-309-1/+57
| | | | | | | | (of a given size) of that type This is currently only implemented for the clang-based TypeSystem, but other languages are welcome to jump in! llvm-svn: 280151
* A few minor stylistic cleanups in StringExtractor.Zachary Turner2016-08-3010-114/+107
| | | | | | | | | | | Makes Peek() return a StringRef instead of a const char*. This leads to a few callers of Peek() being able to be made a little nicer (for example using StringRef member functions instead of c-style strncmp and related functions) and generally safer usage. llvm-svn: 280139
* Use llvm to do endian conversions.Zachary Turner2016-08-301-105/+35
| | | | | | | | | LLDB was rolling its own endian conversion code, but functions to do this already exist in LLVM. While the code was probably correct, no point reinventing the wheel when we have well tested equivalents in LLVM that are one-liners. llvm-svn: 280137
* Add a few more unit tests for StringExtractor.Zachary Turner2016-08-302-0/+172
| | | | | | | | This is a NFC that adds more unit test coverage of the GetHex*** functions as well as the functions to extract numbers with a specific endianness. llvm-svn: 280124
* Convert some StringExtractor functions to accept MutableArrayRefs.Zachary Turner2016-08-308-41/+48
| | | | | | | | | | MutableArrayRef<T> is essentially a safer version of passing around (T*, length) pairs and provides some convenient functions for working with the data without having to manually manipulate indices. This is a minor NFC. llvm-svn: 280123
* Remove mention of autoconf from the build instructionsTamas Berghammer2016-08-301-37/+0
| | | | | | | | | autoconf+make have been removed from LLVM and LLDB ~6month ago. We shouldn't advertise it on the website as a valid way to build LLDB. Differential revision: https://reviews.llvm.org/D24025 llvm-svn: 280102
* Revert "gdb-remote: Make the sequence mutex non-recursive"Pavel Labath2016-08-308-164/+101
| | | | | | This reverts commit r279725 as it breaks "dynamic register size" feature of mips. llvm-svn: 280088
* Fix darwin cmake build for r279997Pavel Labath2016-08-301-1/+1
| | | | llvm-svn: 280087
* Fix fallout from the GetNameColonValue() refactor (r280000)Pavel Labath2016-08-302-8/+12
| | | | | | This fixes the linux test suite. llvm-svn: 280074
* Update debugserver project to pull in StdStringExtractor.cpp instead of the newJason Molenda2016-08-301-8/+6
| | | | | | llvm-using StringExtractor.cpp in the xcode project file settings. llvm-svn: 280039
* Convert GetNameColonValue to return StringRefs.Zachary Turner2016-08-2910-509/+489
| | | | | | | | | | | | StringExtractor::GetNameColonValue() looks for a substring of the form "<name>:<value>" and returns <name> and <value> to the caller. This results in two unnecessary string copies, since the name and value are not translated in any way and simply returned as-is. By converting this to return StringRefs we can get rid of hundreds of string copies. llvm-svn: 280000
* Copy StringExtractor to StdStringExtractor.Zachary Turner2016-08-296-16/+700
| | | | | | | | | | | I have some improvements to make to StringExtractor that require using LLVM. debugserver can't take a dependency on LLVM but uses this file, so I'm forking it off into StdStringExtractor and StringExtractor, so that StringExtractor can take advantage of some performance improvements and readability improvements that LLVM can provide. llvm-svn: 279997
* Remove std::atomic from lldb::Address.Zachary Turner2016-08-292-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | std::atomic<uint64_t> requires 64-bit alignment in order to guarantee atomicity. Normally the compiler is pretty good about aligning types, but an exception to this is when the type is passed by value as a function parameter. In this case, if your stack is 4-byte aligned, most modern compilers (including clang as of LLVM 4.0) fail to align the type, rendering the atomicity ineffective. A deeper investigation of the class's implementation suggests that the use of atomic was in vain anyway, because if the class were to be shared amongst multiple threads, there were already other data races present, and that the proper way to ensure thread-safe access to this data would be to use a mutex from a higher level. Since the std::atomic was not serving its intended purpose anyway, and since the presence of it generates compiler errors on some platforms that cannot be workaround, we remove std::atomic from Address here. Although unlikely, if data races do resurface the proper fix should involve a mutex from a higher level, or an attempt to limit the Address's access to a single thread. llvm-svn: 279994
* Fix some build bot breakages.Zachary Turner2016-08-272-6/+6
| | | | | | | There was some code that was ifdef'ed out that I didn't catch in my earlier patch. llvm-svn: 279920
* Add some unit tests for StringExtractor::GetNameColonValue.Zachary Turner2016-08-271-0/+53
| | | | | | | | These are helpful on their own, but will be even more useful once the GetNameColonValue is updated to return StringRefs instead of std::strings. llvm-svn: 279919
* Convert some functions to use StringRef instead of c_str, lenZachary Turner2016-08-278-65/+62
| | | | | | | | | | | | | | | | | | | | | This started as an effort to change StringExtractor to store a StringRef internally instead of a std::string. I got that working locally with just 1 test failure which I was unable to figure out the cause of. But it was also a massive changelist due to a trickle down effect of changes. So I'm starting over, using what I learned from the first time to tackle smaller, more isolated changes hopefully leading up to a full conversion by the end. At first the changes (such as in this CL) will seem mostly a matter of preference and pointless otherwise. However, there are some places in my larger CL where using StringRef turned 20+ lines of code into 2, drastically simplifying logic. Hopefully once these go in they will illustrate some of the benefits of thinking in terms of StringRef. llvm-svn: 279917
* This test now succeeds.Jim Ingham2016-08-271-1/+0
| | | | llvm-svn: 279897
* Fixed the location of a conditional to make the following code clearer.Sean Callanan2016-08-271-7/+7
| | | | llvm-svn: 279896
* The error stream in IRForTarget is never null, so use it instead of the log.Sean Callanan2016-08-273-102/+53
| | | | llvm-svn: 279894
* Fixed a bad lldbassert() condition.Sean Callanan2016-08-261-1/+1
| | | | llvm-svn: 279884
* Tables of command options in LLDB benefit from hand-formatting to make itKate Stone2016-08-2620-554/+564
| | | | | | | | | | | | | easier to scan a set of options with a relatively large number of positional arguments. This commit standardizes their formatting throughout LLDB and applies surrounding directives to exempt them from being formatted by clang-format. These kinds of exemptions should be rare cases that benefit significantly from alternative formatting. They also imply a long-term obligation to maintain their format since the automated tools will not do so. llvm-svn: 279882
* Don't crash when trying to capture persistent variables in a block.Sean Callanan2016-08-264-9/+34
| | | | | | | | | Reports an error instead. We can fix this later to make persistent variables work, but right now we hit an LLVM assertion if we get this wrong. <rdar://problem/27770298> llvm-svn: 279850
* Switch linux and android CODE_OWNERSPavel Labath2016-08-261-2/+2
| | | | | | | | | | | | | | Summary: Oleksiy is no longer active in LLDB, I'd like to formally assume ownership of the linux and android parts. Reviewers: ovyalov, clayborg Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D23877 llvm-svn: 279812
* Add cmake option to choose whether to use the builtin demanglerPavel Labath2016-08-262-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously the builting demangler was on for platforms that explicitly set a flag by modifying Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used at build time. The flag is only available on non-windows platforms as there the system demangler is not present (in the form we're trying to use it, at least). The impact of this change is: - linux: switches to the builtin demangler - freebsd, windows: NFC (I hope) - netbsd: switches to the builtin demangler - osx cmake build: switches to the builtin demangler (matching the XCode build) The main motivation for this is the cross-platform case, where it should bring more consistency by removing the dependency on the host demangler (which can be completely unrelated to the debug target). Reviewers: zturner, emaste, krytarowski Subscribers: emaste, clayborg, lldb-commits Differential Revision: https://reviews.llvm.org/D23830 llvm-svn: 279808
* Make all the Function implementations different so the compiler won't share ↵Jim Ingham2016-08-262-56/+54
| | | | | | | | | | | | | | them. Clang on ARM64 was making the three Function methods with identical bodies have one implementation that was shared. That threw off the count of breakpoints, since we don't count as separate locations three functions with the same address. I also cleaned up the test case while I was at it. <rdar://problem/27001915> llvm-svn: 279800
* Add a notification message in 'type lookup' when the current language ↵Enrico Granata2016-08-251-9/+19
| | | | | | | | doesn't yield results and one has to go across multiple languages to scan for types Fixes rdar://22422313 llvm-svn: 279784
* gdb-remote: Make the sequence mutex non-recursivePavel Labath2016-08-258-101/+164
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is a preparatory commit for D22914, where I'd like to replace this mutex by an R/W lock (which is also not recursive). This required a couple of changes: - The only caller of Read/WriteRegister, GDBRemoteRegisterContext class, was already acquiring the mutex, so these functions do not need to. All functions which now do not take a lock, take an lock argument instead, to remind the caller of this fact. - GetThreadSuffixSupported() was being called from locked and unlocked contexts (including contexts where the process was running, and the call would fail if it did not have the result cached). I have split this into two functions, one which computes the thread suffix support and caches it (this one always takes the lock), and another, which returns the cached value (and never needs to take the lock). This feels quite natural as ProcessGdbRemote was already pre-caching this value at the start. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23802 llvm-svn: 279725
* Fix warnings preventing copy elision.Pavel Labath2016-08-251-10/+10
| | | | | | | | | | | | | | | | | Summary: Moving a temporary object prevents copy elision, which is exactly what clang points out by warning about this pattern. The fix is simply removal of std::move applied to temporary objects. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23825 Author: Taras Tsugrii <ttsugrii@fb.com> llvm-svn: 279724
* If the user has specified target.memory-module-load-level 'minimal'Jason Molenda2016-08-251-3/+5
| | | | | | | | | | | and we couldn't find a dyld binary on the debug system, override that setting and read dyld out of memory - we need to put an internal breakpoint on dyld to register binaries being loaded or unloaded; the debugger won't work right without dyld symbols. <rdar://problem/27857025> llvm-svn: 279704
* Rewrite the GetFileInSDK methods in PlatformRemoteiOS,Jason Molenda2016-08-246-223/+57
| | | | | | | | | | | | | | | | PlatformRemoteAppleWatch, PlatformRemoteAppleTV and remove the GetFileInSDKRoot method from those classes. The rewrite uses the more modern FileSpec etc API to simplify, and handles the case where an SDK Root is given to lldb with the "/Symbols" directory name already appended. The new version will try appending "/Symbols" and "/Symbols.Internal" to the sdk root directories, and will also try appending nothing to the sdk root directory in case it's handed such an sdkroot. <rdar://problem/28000054> llvm-svn: 279688
OpenPOWER on IntegriCloud