summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language
Commit message (Collapse)AuthorAgeFilesLines
...
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1951-204/+153
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Replace auto -> llvm::Optional<uint64_t>Adrian Prantl2019-01-156-9/+11
| | | | | | This addresses post-commit feedback for https://reviews.llvm.org/D56688 llvm-svn: 351237
* Make CompilerType::getBitSize() / getByteSize() return an optional result. NFCAdrian Prantl2019-01-156-51/+86
| | | | | | | | | | | | | | | | | | | | | | | The code in LLDB assumes that CompilerType and friends use the size 0 as a sentinel value to signal an error. This works for C++, where no zero-sized type exists, but in many other programming languages (including I believe C) types of size zero are possible and even common. This is a particular pain point in swift-lldb, where extra code exists to double-check that a type is *really* of size zero and not an error at various locations. To remedy this situation, this patch starts by converting CompilerType::getBitSize() and getByteSize() to return an optional result. To avoid wasting space, I hand-rolled my own optional data type assuming that no type is larger than what fits into 63 bits. Follow-up patches would make similar changes to the ValueObject hierarchy. rdar://problem/47178964 Differential Revision: https://reviews.llvm.org/D56688 llvm-svn: 351214
* Simplify Boolean expressionsJonas Devlieghere2018-12-155-23/+10
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* Remove unused variable. NFC.Benjamin Kramer2018-11-191-1/+0
| | | | llvm-svn: 347188
* [Cocoa] Prefer llvm::SignExtend64. Pointed out by zturner.Davide Italiano2018-11-161-2/+1
| | | | llvm-svn: 347087
* [lldb] NFC: Remove the extra ';'Henry Wong2018-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Remove extra `;` to eliminate the following pedantic warning. ``` warning: extra ';' [-Wpedantic] ``` Reviewers: shafik Reviewed By: shafik Subscribers: abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D54528 llvm-svn: 347047
* Fix some compilation failures introduced in recent patches.Zachary Turner2018-11-141-1/+2
| | | | | | | | | | This fixes two compilation failures: 1) Designated initializers are C++20. We can't use them in LLVM. 2) thread_result_t is not a pointer type on all platforms, so returning nullptr is an error. llvm-svn: 346873
* Suppress a "-Wliteral-conversion" compiler warning.Haojian Wu2018-11-141-1/+1
| | | | | error: implicit conversion from 'double' to 'uint64_t' (aka 'unsigned long') changes value from -0 to 0 [-Werror,-Wliteral-conversion] llvm-svn: 346841
* [Cocoa] Implement formatter for the new NSDate representation.Davide Italiano2018-11-131-1/+63
| | | | | | <rdar://problem/46002786> llvm-svn: 346783
* [lldb] Add synthetic frontend for _NSCallStackArrayKuba Mracek2018-11-122-1/+33
| | | | | | | | An Obj-C array type _NSCallStackArray is used in NSException backtraces. This patch adds a synthetic frontend for _NSCallStackArray, which now correctly returns frame PCs. Differential Revision: https://reviews.llvm.org/D44081 llvm-svn: 346708
* [lldb] Extract more fields from NSException valuesKuba Mracek2018-11-121-8/+37
| | | | | | | | This patch teaches LLDB about more fields on NSException Obj-C objects, specifically we can now retrieve the "name" and "reason" of an NSException. The goal is to eventually be able to have SB API that can provide details about the currently thrown/caught/processed exception. Differential Revision: https://reviews.llvm.org/D43884 llvm-svn: 346695
* [lldb] Refactor ObjC/NSException.cpp (cleanup, avoid code duplication). NFC.Kuba Mracek2018-11-121-75/+47
| | | | | | | | | | - Refactor reading of NSException fields into ExtractFields method to avoid code duplication. - Remove "m_child_ptr" field, as it's not used anywhere. - Clang-format. Differential Revision: https://reviews.llvm.org/D44073 llvm-svn: 346679
* Remove header grouping comments.Jonas Devlieghere2018-11-1122-88/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Add a break to avoid an unannotated fall-through.Eric Christopher2018-11-071-0/+1
| | | | llvm-svn: 346294
* CPlusPlusLanguage: Use new demangler API to implement type substitutionPavel Labath2018-11-061-62/+80
| | | | | | | | | | | | | | | | Summary: Now that llvm demangler supports more generic customization, we can implement type substitution directly on top of this API. This will allow us to remove the specialized hooks which were added to the demangler to support this use case. Reviewers: sgraenitz, erik.pilkington, JDevlieghere Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D54074 llvm-svn: 346233
* Add parens to silence warningBenjamin Kramer2018-11-061-1/+1
| | | | | | MSVCUndecoratedNameParser.cpp:25:36: warning: '&&' within '||' [-Wlogical-op-parentheses] llvm-svn: 346220
* [PDB] Introduce `MSVCUndecoratedNameParser`Aleksandr Urakov2018-11-064-0/+155
| | | | | | | | | | | | This patch introduces the simple MSVCUndecoratedNameParser. It is needed for parsing names of PDB symbols corresponding to template instantiations. For example, for the name `operator<<A>'::`2'::B::operator> we can't just split the name with :: (as it is implemented for now) to retrieve its scopes. This parser processes such names in a more correct way. Differential Revision: https://reviews.llvm.org/D52461 llvm-svn: 346213
* Fix (and improve) the support for C99 variable length array typesAdrian Prantl2018-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang recently improved its DWARF support for C VLA types. The DWARF now looks like this: 0x00000051: DW_TAG_variable [4] DW_AT_location( fbreg -32 ) DW_AT_name( "__vla_expr" ) DW_AT_type( {0x000000d3} ( long unsigned int ) ) DW_AT_artificial( true ) ... 0x000000da: DW_TAG_array_type [10] * DW_AT_type( {0x000000cc} ( int ) ) 0x000000df: DW_TAG_subrange_type [11] DW_AT_type( {0x000000e9} ( __ARRAY_SIZE_TYPE__ ) ) DW_AT_count( {0x00000051} ) Without this patch LLDB will naively interpret the DIE offset 0x51 as the static size of the array, which is clearly wrong. This patch extends ValueObject::GetNumChildren to query the dynamic properties of incomplete array types. See the testcase for an example: 4 int foo(int a) { 5 int vla[a]; 6 for (int i = 0; i < a; ++i) 7 vla[i] = i; 8 -> 9 pause(); // break here 10 return vla[a-1]; 11 } (lldb) fr v vla (int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3) (lldb) quit rdar://problem/21814005 Differential Revision: https://reviews.llvm.org/D53530 llvm-svn: 346165
* Remove OCaml debugger pluginJonas Devlieghere2018-11-054-138/+0
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the OCaml debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54060 llvm-svn: 346159
* Remove Java debugger pluginJonas Devlieghere2018-11-056-374/+0
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Java debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54059 llvm-svn: 346158
* Remove Go debugger pluginJonas Devlieghere2018-11-056-405/+0
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Go debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54057 llvm-svn: 346157
* NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)Erik Pilkington2018-10-301-1/+2
| | | | | | | | | | We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC. Differential revision: https://reviews.llvm.org/D53547 llvm-svn: 345637
* [DataFormatters] Adding formatters for libc++ std::u16string and std::u32stringShafik Yaghmour2018-10-263-9/+62
| | | | | | | | rdar://problem/41302849 Differential Revision: https://reviews.llvm.org/D53656 llvm-svn: 345402
* [DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour2018-09-195-0/+302
| | | | | | | | | | rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520 llvm-svn: 342563
* Revert "[DataFormatters] Add formatter for C++17 std::variant"Shafik Yaghmour2018-09-175-319/+0
| | | | | | | | This reverts commit r342421. Because it breaks build bot http://green.lab.llvm.org/green/job/lldb-cmake-clang-5.0.2//418/console llvm-svn: 342424
* [DataFormatters] Add formatter for C++17 std::variantShafik Yaghmour2018-09-175-0/+319
| | | | | | | | | | rdar://problem/43691454 Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51520 llvm-svn: 342421
* Refactoring std::function formatter to move core functionality into ↵Shafik Yaghmour2018-09-111-197/+26
| | | | | | | | | | CPPLanguageRuntime Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51896 llvm-svn: 341991
* Undoing first commit which added a space to a commentShafik Yaghmour2018-09-101-1/+1
| | | | llvm-svn: 341881
* First test commit into svn, adding space to commentShafik Yaghmour2018-09-101-1/+1
| | | | llvm-svn: 341879
* Move the column marking functionality to the Highlighter frameworkRaphael Isemann2018-08-302-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The syntax highlighting feature so far is mutually exclusive with the lldb feature that marks the current column in the line by underlining it via an ANSI color code. Meaning that if you enable one, the other is automatically disabled by LLDB. This was caused by the fact that both features inserted color codes into the the source code and were likely to interfere with each other (which would result in a broken source code printout to the user). This patch moves the cursor code into the highlighting framework, which provides the same feature to the user in normal non-C source code. For any source code that is highlighted by Clang, we now also have cursor marking for the whole token that is under the current source location. E.g., before we underlined only the '!' in the expression '1 != 2', but now the whole token '!=' is underlined. The same for function calls and so on. Below you can see two examples where we before only underlined the first character of the token, but now underline the whole token. {F7075400} {F7075414} It also simplifies the DisplaySourceLines method in the SourceManager as most of the code in there was essentially just for getting this column marker to work as a FormatEntity. Reviewers: aprantl Reviewed By: aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D51466 llvm-svn: 341003
* Fix format string issue introduced in r340548Walter Lee2018-08-231-1/+1
| | | | | | Make format string portable. llvm-svn: 340562
* Add libc++ data formatter for std::functionAdrian Prantl2018-08-233-27/+231
| | | | | | | | | | | | - Added LibcxxFunctionSummaryProvider - Removed LibcxxFunctionFrontEnd - Modified data formatter tests to test new summary functionality Patch by Shafik Yaghmour! Differential Revision: https://reviews.llvm.org/D50864 llvm-svn: 340543
* Add libc++ data formatters for std::optional.Adrian Prantl2018-08-155-7/+132
| | | | | | | | | | Patch by Shafik Yaghmour! This reapplies an earlier version after addressing some post-commit feedback. Differential Revision: https://reviews.llvm.org/D49271 llvm-svn: 339828
* Remove manual byte counting from Highlighter code.Raphael Isemann2018-08-142-13/+7
| | | | | | | | | | | | | | | | | | | | Summary: This removes the manual byte counting mechanism from the syntax highlighting code. This is no longer necessary as the Stream class now has built-in support for automatically counting the bytes that were written to it so far. The advantage of automatic byte counting via Stream is that it is less error-prone than the manual version and we need to write less boilerplate code. Reviewers: labath Reviewed By: labath Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D50676 llvm-svn: 339695
* Remove unused FastDemangle sourcesStefan Granitz2018-08-141-1/+1
| | | | llvm-svn: 339671
* 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-0219-1/+359
| | | | | | | | | | | | | | | | | | | | | | 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
* [DataFormatter] Add CFDictionary data formatterJonas Devlieghere2018-06-211-1/+3
| | | | | | | | Add data formatter for NSCFDictionary/CFDictionaryRef. Differential revision: https://reviews.llvm.org/D48450 llvm-svn: 335271
* [ObjC] Add dataformatter for NSDecimalNumberJonas Devlieghere2018-06-133-0/+59
| | | | | | | | | | This patch adds a data formatter for NSDecimalNumber. The latter is a Foundation object used for representing and performing arithmetic on base-10 numbers that bridges to Decimal. Differential revision: https://reviews.llvm.org/D48114 llvm-svn: 334638
* [ObjC] Use llvm::StringRef in summary providersJonas Devlieghere2018-06-131-20/+19
| | | | | | | Replace const char pointers with llvm::StringRef and use its equality operator for string comparisons. llvm-svn: 334631
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-131-1/+1
| | | | llvm-svn: 334614
* 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
* [ObjC] Fix the formatter for NSOrderedSet.Davide Italiano2018-05-291-28/+5
| | | | | | | | While I'm here, delete some dead code. <rdar://problem/40622096> llvm-svn: 333465
* 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
OpenPOWER on IntegriCloud