summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language/CPlusPlus
Commit message (Collapse)AuthorAgeFilesLines
...
* Straight forward FastDemangle replacement in SubsPrimitiveParmItaniumStefan Granitz2018-08-131-38/+57
| | | | | | | | | | | | | | | | | | | Summary: Removing FastDemangle will greatly reduce maintenance efforts. This patch replaces the last point of use in LLDB. Semantics should be kept intact. Once this is agreed upon, we can: * Remove the FastDemangle sources * Add more features e.g. substitutions in template parameters, considering all variations, etc. Depends on LLVM patch https://reviews.llvm.org/D50586 Reviewers: erik.pilkington, friss, jingham, JDevlieghere Subscribers: kristof.beyls, chrib, lldb-commits Differential Revision: https://reviews.llvm.org/D50587 llvm-svn: 339583
* [LLDB] Added syntax highlighting supportRaphael Isemann2018-08-023-0/+22
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds syntax highlighting support to LLDB. When enabled (and lldb is allowed to use colors), printed source code is annotated with the ANSI color escape sequences. So far we have only one highlighter which is based on Clang and is responsible for all languages that are supported by Clang. It essentially just runs the raw lexer over the input and then surrounds the specific tokens with the configured escape sequences. Reviewers: zturner, davide Reviewed By: davide Subscribers: labath, teemperor, llvm-commits, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D49334 llvm-svn: 338662
* Revert "Recommit [DataFormatters] Add formatter for C++17 std::optional."Davide Italiano2018-07-275-125/+0
| | | | | | | This broke a linux bot which doesn't support -std=c++17. The solution is to add a decorator to skip these tests on machines with older compilers. llvm-svn: 338162
* Recommit [DataFormatters] Add formatter for C++17 std::optional.Davide Italiano2018-07-275-0/+125
| | | | | | | | | | This should have all the correct files now. <rdar://problem/41471112> Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D49271 llvm-svn: 338156
* Revert "[DataFormatters] Add formatter for C++17 std::optional."Davide Italiano2018-07-251-85/+0
| | | | | | | I forgot to git add some files. I'm going to recommit the correct version at once soon. llvm-svn: 337963
* [DataFormatters] Add formatter for C++17 std::optional.Davide Italiano2018-07-251-0/+85
| | | | | | | | | | <rdar://problem/41471112> Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D49271 llvm-svn: 337959
* Fix the libcxx set, multiset, vector and bitset formatters to work on ↵Jim Ingham2018-07-131-4/+6
| | | | | | | | | | | | | | | | references. The synthetic child providers for these classes had a type expression that matched pointers & references to the type, but the Front End only worked on the actual object. I fixed this by adding a way for the Synthetic Child FrontEnd provider to request dereference, and then had these formatters use that mode. <rdar://problem/40849836> Differential Revision: https://reviews.llvm.org/D49279 llvm-svn: 337035
* Fix tuple getter in std unique pointer pretty-printerPavel Labath2018-06-111-0/+2
| | | | | | | | | | | | | Summary: Check case when _M_t child member is not present. Reviewers: labath, tberghammer Reviewed By: labath, tberghammer Differential Revision: https://reviews.llvm.org/D47932 Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com>. llvm-svn: 334411
* Fix memory leak in SubsPrimitiveParmItaniumRaphael Isemann2018-05-271-1/+3
| | | | | | | | | | | | | | Summary: FastDemangle gives us a C-string that we own (which is allocated in SymbolDemangler::GetDemangledCopy). As we are not deleting the string, we leak memory whenever we call SubsPrimitiveParmItanium. Reviewers: javed.absar Subscribers: kristof.beyls, chrib, lldb-commits Differential Revision: https://reviews.llvm.org/D47418 llvm-svn: 333353
* Reflow paragraphs in comments.Adrian Prantl2018-04-307-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Fix std unique pointer pretty-printer for new stl versionsPavel Labath2018-03-081-4/+23
| | | | | | | | | | | | | | | Summary: The unique pointer layout was changed in libstdc++ 6.0.23. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: luporl, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D44015 Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>. llvm-svn: 327017
* Recognize MSVC style mangling in CPlusPlusLanguage::IsCPPMangledNameAaron Smith2018-02-081-7/+11
| | | | | | | | | | | | Reviewers: zturner, lldb-commits, labath Reviewed By: zturner Subscribers: jingham, labath, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D43059 llvm-svn: 324672
* More correct handling of error cases C++ name parserEugene Zemtsov2018-02-061-2/+1
| | | | | | | | | | Now incorrect type argument that looks like T<A><B> doesn't cause an assert, but just a parsing error. Bug: 36224 Differential Revision: https://reviews.llvm.org/D42939 llvm-svn: 324380
* Switch from C++1z to C++17; corresponds to r319688 in Clang.Aaron Ballman2017-12-041-1/+1
| | | | llvm-svn: 319694
* Fix assertion in ClangASTContextPavel Labath2017-11-301-4/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: llvm::APSInt(0) asserts because it creates an int with bit-width 0 and not (as I thought) a value 0. Theoretically it should be sufficient to change this to APSInt(1), as the intention there was that the value of the first argument should be ignored if the type is invalid, but that would look dodgy. Instead, I use llvm::Optional to denote an invalid value and use a special struct instead of a std::pair, to reduce typing and increase clarity. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40615 llvm-svn: 319414
* Add a data formatter for libc++ std::bitsetPavel Labath2017-11-144-0/+125
| | | | | | | | | | Reviewers: jingham, EricWF Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D39966 llvm-svn: 318145
* CompilerType: Add ability to retrieve an integral template argumentPavel Labath2017-11-137-22/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: Despite it's name, GetTemplateArgument was only really working for Type template arguments. This adds the ability to retrieve integral arguments as well (which I've needed for the std::bitset data formatter). I've done this by splitting the function into three pieces. The idea is that one first calls GetTemplateArgumentKind (first function) to determine the what kind of a parameter this is. Based on that, one can then use specialized functions to retrieve the correct value. Currently, I only implement two of these: GetTypeTemplateArgument and GetIntegralTemplateArgument. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39844 llvm-svn: 318040
* Update tuple/list/deque data formatters to work with newest libc++Pavel Labath2017-11-072-6/+18
| | | | | | | | | | | | | | Summary: A couple of members of these data structures have been renamed in recent months. This makes sure they still work with the latest libc++ version. Reviewers: jingham, EricWF Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39602 llvm-svn: 317624
* Add data formatter for libc++ std::queuePavel Labath2017-11-014-0/+74
| | | | | | | | | | | | | | Summary: std::queue is just a fancy wrapper around another container, so all we need to do is to delegate to the it. Reviewers: jingham, EricWF Subscribers: srhines, mgorny, lldb-commits, eugene Differential Revision: https://reviews.llvm.org/D35666 llvm-svn: 317099
* Add data formatter for libc++ std::tuplePavel Labath2017-11-014-0/+91
| | | | | | | | | | Reviewers: jingham, EricWF Subscribers: srhines, eugene, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D35615 llvm-svn: 317095
* Add data formatter for libc++'s forward_listPavel Labath2017-10-313-85/+183
| | | | | | | | | | | | | | | Summary: This adds a data formatter for the implementation of forward_list in libc++. I've refactored the existing std::list data formatter a bit to enable more sharing of code (mainly the loop detection stuff). Reviewers: jingham, EricWF Subscribers: srhines, eugene, lldb-commits Differential Revision: https://reviews.llvm.org/D35556 llvm-svn: 316992
* Enable parsing C++ names generated by lambda functions.Jim Ingham2017-07-132-0/+34
| | | | | | https://reviews.llvm.org/D34911 from Weng Xuetian. llvm-svn: 307944
* Rename Error -> Status.Zachary Turner2017-05-129-26/+26
| | | | | | | | | | | | | | | 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
* Remove unused code related to CPlusPlusLanguage::FindEquivalentNamesPavel Labath2017-05-022-150/+0
| | | | | | | | | | | | | | | Summary: It is simply unused, and the header for it is private, so there should be no external dependencies. Reviewers: #lldb, zturner Reviewed By: zturner Subscribers: zturner, tberghammer, jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D32503 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 301903
* Fix libcxx formatters for changes in r300140.Lang Hames2017-04-263-16/+87
| | | | | | | | | | | | | | | | | | Summary: LLVM r300140 changed the layout and field names of __compressed_pair, which broke LLDB's std::vector, std::map and std::unsorted_map formatters. This patch attempts to fix these formatters by having them interogate the __compressed_pair values to determine whether they're pre- or post-r300140 variants, then access them accordingly. Reviewers: jingham, EricWF Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D32554 llvm-svn: 301493
* Use llvm::ArrayRef rather than std::vector/std::initializer lists for someLang Hames2017-04-261-1/+2
| | | | | | | | | | | ValueObject methods. Using ArrayRef allows us to remove some overloads, work with more array-like types, and avoid some std::vector temporaries. https://reviews.llvm.org/D32518 llvm-svn: 301441
* Add libc++ category to the remaining libc++ data formattersPavel Labath2017-04-121-1/+1
| | | | llvm-svn: 300054
* Fix libc++ vector<bool> data formatter (bug #32553)Pavel Labath2017-04-124-207/+142
| | | | | | | | | | | | | | | | | Summary: The iteration list through the available data formatters was undefined, which meant that the vector<bool> formatter kicked in only in cases where it happened to be queried before the general vector formatter. To fix this, I merge the two data formatter entries into one, and select which implementation to use in the factory function. Reviewers: jasonmolenda, tberghammer, EricWF Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31880 llvm-svn: 300047
* New C++ function name parsing logic (Resubmit)Eugene Zemtsov2017-04-065-119/+881
| | | | | | | | | | | | | | | | | | | | | Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't get anywhere close to covering full extent of possible function declarations. It causes incorrect behavior in avoid-stepping and sometimes messes printing of thread backtrace. This change implements more methodical parsing logic based on clang lexer and simple recursive parser. Examples: void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&) void (*&std::_Any_data::_M_access<void (*)()>())() Previous version of this change (D31451) was rolled back due to an issue with Objective-C selectors being incorrectly recognized as a C++ identifier. Differential Revision: https://reviews.llvm.org/D31451 llvm-svn: 299721
* Reverting r299374 & r299402 due to testsuite failure.Jim Ingham2017-04-055-862/+119
| | | | | | | | | | | | | | This caused a failure in the test case: functionalities/breakpoint/objc/TestObjCBreakpoints.py When we are parsing up names we stick interesting parts of the names in various buckets, one of which is the ObjC selector bucket. The new C++ name parser must be interfering with this process somehow. <rdar://problem/31439305> llvm-svn: 299489
* New C++ function name parsing logicEugene Zemtsov2017-04-035-119/+862
| | | | | | | | | | | | | | | | | | Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't get anywhere close to covering full extent of possible function declarations. It causes incorrect behavior in avoid-stepping and sometimes messes printing of thread backtrace. This change implements more methodical parsing logic based on clang lexer and simple recursive parser. Examples: void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&) void (*&std::_Any_data::_M_access<void (*)()>())() Differential Revision: https://reviews.llvm.org/D31451 llvm-svn: 299374
* Stop calling ValueObject::SetName from synthetic child providersTamas Berghammer2017-03-313-14/+11
| | | | | | | | | | | | | | | Summary: Calling ValueObject::SetName from a sythetic child provider would change the underying value object used for the non-synthetic child as well what is clearly unintentional. Reviewers: jingham, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31371 llvm-svn: 299259
* Add support for sythetic operator dereferenceTamas Berghammer2017-03-311-1/+2
| | | | | | | | | | | | | | | | 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
* Do not dereference std::unique_ptr by defaultTamas Berghammer2017-03-311-7/+5
| | | | | | | | | | | | | | | Summary: Displaying the object pointed by the unique_ptr can cause an infinite recursion when we have a pointer loop so this change stops that behavior. Additionally it makes the unique_ptr act more like a class containing a pointer (what is the underlying truth) instead of some "magic" class. Reviewers: labath, jingham Differential Revision: https://reviews.llvm.org/D31366 llvm-svn: 299249
* Move many other files from Core -> Utility.Zachary Turner2017-03-061-1/+1
| | | | llvm-svn: 297043
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-046-6/+6
| | | | llvm-svn: 296943
* Move Log from Core -> Utility.Zachary Turner2017-03-031-1/+1
| | | | | | | | | 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
* Three LoadLibCxxFormatters formatters were given a regex string toJason Molenda2017-02-251-3/+3
| | | | | | | | | | match but the 'is_regex' argument was not passed as true. Not sure this is causing a bug, but noticed it while working on another bug. These formatters gained a regex in r274489 for NDK but didn't pick up the is_regex flag at the time. <rdar://problem/30646077> llvm-svn: 296243
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-146-8/+8
| | | | | | | | | | 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
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-061-6/+7
| | | | | | | | | | | | | | | | | | | | | 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
* Move classes from Core -> Utility.Zachary Turner2017-02-0216-23/+23
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* [CMake] [2/4] Update a batch of pluginsChris Bieneman2017-01-311-1/+11
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293699
* Expression evaluation for overloaded C functions (redux)Luke Drummond2016-12-192-3/+109
| | | | | | | | | | | | | | | | | | | This is a redux of [Ewan's patch](https://reviews.llvm.org/D17957) , refactored to properly substitute primitive types using a hook in the itanium demangler, and updated after the previous patch went stale The new `SubsPrimitiveParmItanium` function takes a symbol name and replacement primitive type parameter as before but parses it using the FastDemangler, which has been modified to be able to notify clients of parse events (primitive types at this point). Additionally, we now use a `set` of `ConstStrings` instead of a `vector` so that we don't try and resolve the same invalid candidate multiple times. Differential Revision: https://reviews.llvm.org/D27223 Subscribers: lldb-commits llvm-svn: 290117
* Replace __ANDROID_NDK__ with __ANDROID__Pavel Labath2016-12-021-6/+1
| | | | | | | | | | | | | | | | | | | | Summary: This replaces all the uses of the __ANDROID_NDK__ define with __ANDROID__. This is a preparatory step to remove our custom android toolchain file and rely on the standard android NDK one instead, which does not provide this define. Instead I rely, on __ANDROID__, which is set by the compiler. I haven't yet removed the cmake variable with the same name, as we will need to do something completely different there -- NDK toolchain defines CMAKE_SYSTEM_NAME to Android, while our current one pretends it's linux. Reviewers: tberghammer, zturner Subscribers: danalbert, srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D27305 llvm-svn: 288494
* [lldb] Fix typos in file headersAlexander Shaposhnikov2016-11-263-4/+3
| | | | | | | | | | | | | This diff fixes typos in file headers (incorrect file names). Test plan: Under llvm/tools/lldb/source: find ./* -type f | grep -e '\(cpp\|h\)$' | while read F; do B=$(basename $F); echo $F head -n 1 $F | grep -v $B | wc -l ; done Differential revision: https://reviews.llvm.org/D27115 llvm-svn: 287966
* Resubmit "Remove an output-parameter from Variable function".Zachary Turner2016-11-181-10/+12
| | | | | | | | | | | The scanning algorithm had a few little subtleties that I overlooked, but this patch should fix everything. I still haven't changed the function to take a StringRef since that has some trickle down effect and is mostly mechanical, I just wanted to get the tricky part as isolated as possible. llvm-svn: 287354
* Revert "Remove an out param from ValueObject::GetValueForExpressionPath."Zachary Turner2016-11-181-12/+10
| | | | | | | This reverts commit r287315, as it introduces a bug that breaks many things. llvm-svn: 287320
* Remove an out param from ValueObject::GetValueForExpressionPath.Zachary Turner2016-11-181-10/+12
| | | | | | | | | | This argument was only used in one place in the codebase, and it was in a non-critical log statement and can be easily substituted for an equally meaningful field instead. The payoff of computing this value is not worth the added complexity. llvm-svn: 287315
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-167-10/+12
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Display the pointer value in the libstdc++ unique_ptr summaryPavel Labath2016-11-091-16/+7
| | | | | | | | | | | | | | | | | | | Summary: r284830 added a summary provider for unique_ptr in libstdc++, whose value printed the value of the pointee. This is a bit unintuitive as it becomes unobvious that the value actually is a pointer, and we lose the way to actually obtain the pointer value. Change that to print the pointer value instead. The pointee value can still be obtained through the synthetic children. Reviewers: tberghammer, granata.enrico Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26403 llvm-svn: 286355
OpenPOWER on IntegriCloud