summaryrefslogtreecommitdiff
path: root/lldb/source/Target/Language.cpp
AgeCommit message (Collapse)Author
2025-10-09[lldb][Language] Make SourceLanguage::GetDescription for language version ↵Michael Buch
(#162050) Depends on https://github.com/llvm/llvm-project/pull/162048 This makes sure we also include the version number in the description. For `C++17`, this would, e.g., now return `"C++17"` instead of `"ISO C++"`.
2025-10-08[lldb] Fix off-by-one error in ToDwarfSourceLanguage (#162315)Joshua Peterson
The ToDwarfSourceLanguage function incorrectly excluded languages that equal eLanguageTypeLastStandardLanguage. The comparison used `<` instead of `<=`, causing the last standard language to fall through to the default case and return std::nullopt. This broke language plugins that use eLanguageTypeLastStandardLanguage (currently Mojo at 0x0033) as their language code, preventing proper DWARF language conversion and breaking REPL functionality. The fix changes the comparison from `<` to `<=` to include the last standard language in the automatic conversion to DWARF source language. This is a regression from commit 7f51a2a47d2e706d04855b0e41690ebafa2b3238 which introduced the ToDwarfSourceLanguage function.
2025-10-03[lldb][Language] Add Language::GetDisplayNameForLanguageType API (#161803)Michael Buch
The intention for this API is to be used when presenting language names to the user, e.g., in expression evaluation diagnostics or LLDB errors. Most uses of `GetNameForLanguageType` can be probably replaced with `GetDisplayNameForLanguageType`, but that's out of scope of this PR. This uses `llvm::dwarf::LanguageDescription` under the hood, so we would lose the version numbers in the names. If we deem those to be important, we could switch to an implementation that hardcodes a list of user-friendly names with version numbers included. The intention is to use it from https://github.com/llvm/llvm-project/pull/161688 Depends on https://github.com/llvm/llvm-project/pull/161804
2025-10-03[lldb][Language] Simplify SourceLanguage::GetDescription (#161804)Michael Buch
Currently we don't benefit from the user-friendly names that `LanguageDescription` returns because we would always use `Language::GetNameForLanguageType`. I'm not aware of a situation where `GetDescription` should prefer the non-human readable form of the name with. This patch removes the call to `GetNameForLanguageType`. `LanguageDescription` already handles languages that it doesn't know about. For those it would return `Unknown`. The LLDB language types should all be available via DWARF. If there are languages that don't map cleanly between `lldb::LanguageType` and `DW_LANG`, then we should add explicit support for that in the `SourceLanguage::SourceLanguage` constructor.
2025-10-03[lldb][Lanugage][NFC] Adapt Language::ForEach to IterationAction (#161830)Michael Buch
2025-07-22[lldb] Fix UB cast when encountering DW_LANG_* >= eNumLanguageTypes (#150132)Daniel Sanders
LanguageType has two kinds of enumerators in it. The first is DWARF-assigned enumerators which must be consecutive and match DW_LANG values. The second is the vendor-assigned enumerators which must be unique and must follow on from the DWARF-assigned values (i.e. the first one is currently eLanguageTypeMojo + 1) even if that collides with DWARF-assigned values that lldb is not yet aware of Only the DWARF-assigned enumerators may be static_cast from DW_LANG since their values match. The vendor-assigned enumerators must be explicitly converted since their values do not match. This needs to handle new languages added to DWARF and not yet implemented in lldb. This fixes a crash when encountering a DW_LANG value >= eNumLanguageTypes and wrong behaviour when encountering DW_LANG values that have not yet been added to LanguageType but happen to coincide with a vendor-assigned enumerator due to the consecutive values requirement described above. Another way to fix the crash is to add the language to LanguageType (and fill any preceeding gaps in the number space) so that the DW_LANG being encountered is correctly handled but this just moves the problem to a new subset of DW_LANG values. Also fix an unnecessary static-cast from LanguageType to LanguageType.
2025-04-13[lldb][Language] Change GetFunctionDisplayName to take SymbolContext by ↵Michael Buch
reference (#135536) Both the `CPlusPlusLanguage` plugins and the Swift language plugin already assume the `sc != nullptr`. And all `FormatEntity` callsites of `GetFunctionDisplayName` already check for nullptr before passing `sc`. This patch makes this pre-condition explicit by changing the parameter to `const SymbolContext &`. This will help with some upcoming changes in this area.
2024-11-12[lldb] Support true/false in ValueObject::SetValueFromCString (#115780)Jonas Devlieghere
Support "true" and "false" (and "YES" and "NO" in Objective-C) in ValueObject::SetValueFromCString. Fixes #112597
2024-04-29Add a new SBExpressionOptions::SetLanguage() API (NFCI) (#89981)Adrian Prantl
that separates out language and version. To avoid reinventing the wheel and introducing subtle incompatibilities, this API uses the table of languages and versiond defined by the upcoming DWARF 6 standard (https://dwarfstd.org/languages-v6.html). While the DWARF 6 spec is not finialized, the list of languages is broadly considered stable. The primary motivation for this is to allow the Swift language plugin to switch between language dialects between, e.g., Swift 5.9 and 6.0 with out introducing a ton of new language codes. On the main branch this change is considered NFC. Depends on https://github.com/llvm/llvm-project/pull/89980
2024-03-14[lldb] Allow languages to filter breakpoints set by line (#83908)Felipe de Azevedo Piovezan
Some languages may create artificial functions that have no real user code, even though there is line table information for them. One such case is with coroutine code that receives the CoroSplitter transformation in LLVM IR. That code transformation creates many different Functions, cloning one Instruction into many Instructions in many different Functions and copying the associated debug locations. It would be difficult to make that pass delete debug locations of cloned instructions in a language agnostic way (is it even possible?), but LLDB can ignore certain locations by querying its Language APIs and having it decide based on, for example, mangling information.
2023-12-12[lldb] Make only one function that needs to be implemented when searching ↵Greg Clayton
for types (#74786) This patch revives the effort to get this Phabricator patch into upstream: https://reviews.llvm.org/D137900 This patch was accepted before in Phabricator but I found some -gsimple-template-names issues that are fixed in this patch. A fixed up version of the description from the original patch starts now. This patch started off trying to fix Module::FindFirstType() as it sometimes didn't work. The issue was the SymbolFile plug-ins didn't do any filtering of the matching types they produced, and they only looked up types using the type basename. This means if you have two types with the same basename, your type lookup can fail when only looking up a single type. We would ask the Module::FindFirstType to lookup "Foo::Bar" and it would ask the symbol file to find only 1 type matching the basename "Bar", and then we would filter out any matches that didn't match "Foo::Bar". So if the SymbolFile found "Foo::Bar" first, then it would work, but if it found "Baz::Bar" first, it would return only that type and it would be filtered out. Discovering this issue lead me to think of the patch Alex Langford did a few months ago that was done for finding functions, where he allowed SymbolFile objects to make sure something fully matched before parsing the debug information into an AST type and other LLDB types. So this patch aimed to allow type lookups to also be much more efficient. As LLDB has been developed over the years, we added more ways to to type lookups. These functions have lots of arguments. This patch aims to make one API that needs to be implemented that serves all previous lookups: - Find a single type - Find all types - Find types in a namespace This patch introduces a `TypeQuery` class that contains all of the state needed to perform the lookup which is powerful enough to perform all of the type searches that used to be in our API. It contain a vector of CompilerContext objects that can fully or partially specify the lookup that needs to take place. If you just want to lookup all types with a matching basename, regardless of the containing context, you can specify just a single CompilerContext entry that has a name and a CompilerContextKind mask of CompilerContextKind::AnyType. Or you can fully specify the exact context to use when doing lookups like: CompilerContextKind::Namespace "std" CompilerContextKind::Class "foo" CompilerContextKind::Typedef "size_type" This change expands on the clang modules code that already used a vector<CompilerContext> items, but it modifies it to work with expression type lookups which have contexts, or user lookups where users query for types. The clang modules type lookup is still an option that can be enabled on the `TypeQuery` objects. This mirrors the most recent addition of type lookups that took a vector<CompilerContext> that allowed lookups to happen for the expression parser in certain places. Prior to this we had the following APIs in Module: ``` void Module::FindTypes(ConstString type_name, bool exact_match, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeList &types); void Module::FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap &types); void Module::FindTypesInNamespace(ConstString type_name, const CompilerDeclContext &parent_decl_ctx, size_t max_matches, TypeList &type_list); ``` The new Module API is much simpler. It gets rid of all three above functions and replaces them with: ``` void FindTypes(const TypeQuery &query, TypeResults &results); ``` The `TypeQuery` class contains all of the needed settings: - The vector<CompilerContext> that allow efficient lookups in the symbol file classes since they can look at basename matches only realize fully matching types. Before this any basename that matched was fully realized only to be removed later by code outside of the SymbolFile layer which could cause many types to be realized when they didn't need to. - If the lookup is exact or not. If not exact, then the compiler context must match the bottom most items that match the compiler context, otherwise it must match exactly - If the compiler context match is for clang modules or not. Clang modules matches include a Module compiler context kind that allows types to be matched only from certain modules and these matches are not needed when d oing user type lookups. - An optional list of languages to use to limit the search to only certain languages The `TypeResults` object contains all state required to do the lookup and store the results: - The max number of matches - The set of SymbolFile objects that have already been searched - The matching type list for any matches that are found The benefits of this approach are: - Simpler API, and only one API to implement in SymbolFile classes - Replaces the FindTypesInNamespace that used a CompilerDeclContext as a way to limit the search, but this only worked if the TypeSystem matched the current symbol file's type system, so you couldn't use it to lookup a type in another module - Fixes a serious bug in our FindFirstType functions where if we were searching for "foo::bar", and we found a "baz::bar" first, the basename would match and we would only fetch 1 type using the basename, only to drop it from the matching list and returning no results
2023-09-11[LLDB][NFC] Add the mojo language to Language::GetPrimaryLanguagewalter erquinigo
This doesn't change the current behavior of the function, but the explicit declaration looks cleaner.
2023-06-26[LLDB] Fix 582582fb474b8cd4103e65c3e5a705b3aff61794walter erquinigo
This issue has been seen in - https://lab.llvm.org/buildbot/#/builders/17/builds/39525 - https://lab.llvm.org/buildbot/#/builders/68/builds/55140 The reason is that a new language tag has been added for Mojo, but other recent languages need to be added to the language array so that a name lookup array doesn't have gaps. `ninja check-lldb-shell-process` now passes.
2023-06-26[LLDB] Add DWARF definitions for the new Mojo languagewalter erquinigo
The new language Mojo recently received a proper DWARF code, which can be seen in https://dwarfstd.org/languages.html, and this patch adds the basic definitions for using this language in DWARF. Differential Revision: https://reviews.llvm.org/D153073
2023-05-30[lldb][NFCI] Refactor Language::GetFormatterPrefixSuffixAlex Langford
- Remove unused parameter `valobj` (I checked downstream, not even swift is using it). - Return a std::pair<StringRef, StringRef> insted of having 2 out parameter strings. - Remove the use of ConstStrings. This change was primarily mechanical except in `ObjCLanguage::GetFormatterPrefixSuffix`. To keep this fast, we construct an llvm::StringMap<std::pair<StringRef, StringRef>> so that we can look things up quickly. There is some amount of cost to setting up the map the first time it is called, but subsequent lookups should be as fast as a hash + string comparison (the cost of looking up something in an llvm::StringMap). Differential Revision: https://reviews.llvm.org/D151603
2023-05-05[LLDB] Add minimal support for the new Mojo languagewalter erquinigo
Modular just announced a new language called Mojo. This patch adds an entry in the language list in LLDB for minimal support (e.g. being able to create a TypeSystem for this language). We will later add debug info entries when the language matures.
2023-04-14[lldb] Allow evaluating expressions in C++20 modeMichael Buch
This patch allows users to evaluate expressions using `expr -l c++20`. Currently DWARF keeps the CU's at `DW_AT_language` at `DW_LANG_C_plus_plus_14` even when compiling with `-std=c++20`. So even in "C++20 programs" expression evaluation will by default be performed in `C++11` mode for now. Enabling `C++14` has been previously attempted at https://reviews.llvm.org/D80308 There are some remaining issues around evaluating C++20 expressions. Mainly, lack of support for C++20 AST nodes in `clang::ASTImporter`. But these can be addressed in follow-up patches.
2023-04-14[lldb][Language] Add more language typesMichael Buch
Adds more languages to the `language_names` list in preparation for adding support for C++20 expression evaluation. The language constants were taken from the DWARFv5 constants defined in LLVM's `Dwarf.def`. Two vendor constants overlap with the DWARFv5 constants so bump their values. Their actual value is not important, whereas keeping the enum values consecutive is (since they are used for array lookups). Differential Revision: https://reviews.llvm.org/D143061
2023-02-17Remove Renderscript LLDBYi Kong
Renderscript is deprecated from Android, we no longer support LLDB for Renderscript. Differential Revision: https://reviews.llvm.org/D143983
2023-01-18[lldb][Language] List supported languages in expr error textMichael Buch
Before: ``` (lldb) expr --language abc -- 1 + 1 error: unknown language type: 'abc' for expression ``` After: ``` (lldb) expr --language abc -- 1 + 1 error: unknown language type: 'abc' for expression. List of supported languages: c++ objective-c++ c++03 c++11 c++14 objc++ ``` We choose to only list the languages which `expr` will actually accept instead of all the language constants defined in `Language.cpp` since that's what the user will most likely need. Differential Revision: https://reviews.llvm.org/D142034
2022-10-19[lldb] Add matching based on Python callbacks for data formatters.Jorge Gorbe Moya
This patch adds a new matching method for data formatters, in addition to the existing exact typename and regex-based matching. The new method allows users to specify the name of a Python callback function that takes a `SBType` object and decides whether the type is a match or not. Here is an overview of the changes performed: - Add a new `eFormatterMatchCallback` matching type, and logic to handle it in `TypeMatcher` and `SBTypeNameSpecifier`. - Extend `FormattersMatchCandidate` instances with a pointer to the current `ScriptInterpreter` and the `TypeImpl` corresponding to the candidate type, so we can run registered callbacks and pass the type to them. All matcher search functions now receive a `FormattersMatchCandidate` instead of a type name. - Add some glue code to ScriptInterpreterPython and the SWIG bindings to allow calling a formatter matching callback. Most of this code is modeled after the equivalent code for watchpoint callback functions. - Add an API test for the new callback-based matching feature. For more context, please check the RFC thread where this feature was originally discussed: https://discourse.llvm.org/t/rfc-python-callback-for-data-formatters-type-matching/64204/11 Differential Revision: https://reviews.llvm.org/D135648
2022-05-12We don't require users to type out the full context of a function, forJim Ingham
symbol name matches. Instead, we extract the incoming path's base name, look up all the symbols with that base name, and then compare the rest of the context that the user provided to make sure it matches. However, we do this comparison using just a strstr. So for instance: break set -n foo::bar will match not only "a::foo::bar" but "notherfoo::bar". The former is pretty clearly the user's intent, but I don't think the latter is, and results in breakpoints picking up too many matches. This change adds a Language::DemangledNameContainsPath API which can do a language aware match against the path provided. If the language doesn't provide this we fall back to the strstr (though that's changed to StringRef::contains in the patch). Differential Revision: https://reviews.llvm.org/D124579
2021-08-31[lldb] Tighten lock in Language::ForEachAlex Langford
It is easy to accidentally introduce a deadlock by having the callback passed to Language::ForEach also attempt to acquire the same lock. It is easy enough to disallow the callback from calling anything in Language directly, but it may happen through a series of other function/method calls. The solution I am proposing is to tighten the lock in Language::ForEach so that it is only held as we gather the currently loaded language plugins. We store them in a vector and then iterate through them with the callback so that the callback can't introduce a deadlock. Differential Revision: https://reviews.llvm.org/D109013
2021-07-02[lldb] Replace default bodies of special member functions with = default;Jonas Devlieghere
Replace default bodies of special member functions with = default; $ run-clang-tidy.py -header-filter='lldb' -checks='-*,modernize-use-equals-default' -fix , https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html Differential revision: https://reviews.llvm.org/D104041
2021-06-25[lldb] Rename StringRef _lower() method calls to _insensitive()Martin Storsjö
2021-05-12Rename human-readable name for DW_LANG_Mips_AssemblerAdrian Prantl
The Mips in DW_LANG_Mips_Assembler is a vendor name not an architecture name and in lack of a proper generic DW_LANG_assembler, some assemblers emit DWARF using this tag. Due to a warning I recently introduced users will now be greeted with This version of LLDB has no plugin for the mipsassem language. Inspection of frame variables will be limited. By renaming this to just "Assembler" this error message will make more sense. Differential Revision: https://reviews.llvm.org/D101406 rdar://77214764
2020-05-04[lldb/DataFormatters] Delete GetStringPrinterEscapingHelperVedant Kumar
Summary: Languages can have different ways of formatting special characters. E.g. when debugging C++ code a string might look like "\b", but when debugging Swift code the same string would look like "\u{8}". To make this work, plugins override GetStringPrinterEscapingHelper. However, because there's a large amount of subtly divergent work done in each override, we end up with large amounts of duplicated code. And all the memory smashers fixed in one copy of the logic (see D73860) don't get fixed in the others. IMO the GetStringPrinterEscapingHelper is overly general and hard to use. I propose deleting it and replacing it with an EscapeStyle enum, which can be set as needed by each plugin. A fix for some swift-lldb memory smashers falls out fairly naturally from this deletion (https://github.com/apple/llvm-project/pull/1046). As the swift logic becomes really tiny, I propose moving it upstream as part of this change. I've added unit tests to cover it. rdar://61419673 Reviewers: JDevlieghere, davide Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D77843
2020-01-24[lldb][NFC] Fix all formatting errors in .cpp file headersRaphael Isemann
Summary: A *.cpp file header in LLDB (and in LLDB) should like this: ``` //===-- TestUtilities.cpp -------------------------------------------------===// ``` However in LLDB most of our source files have arbitrary changes to this format and these changes are spreading through LLDB as folks usually just use the existing source files as templates for their new files (most notably the unnecessary editor language indicator `-*- C++ -*-` is spreading and in every review someone is pointing out that this is wrong, resulting in people pointing out that this is done in the same way in other files). This patch removes most of these inconsistencies including the editor language indicators, all the different missing/additional '-' characters, files that center the file name, missing trailing `===//` (mostly caused by clang-format breaking the line). Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere Reviewed By: JDevlieghere Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D73258
2019-12-11Remove TypeValidators (NFC in terms of the testsuite)Adrian Prantl
This is a half-implemented feature that as far as we can tell was never used by anything since its original inclusion in 2014. This patch removes it to make remaining the code easier to understand. Differential Revision: https://reviews.llvm.org/D71310
2019-08-22Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl
This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch. In multi-language projects it is extremely common to have, e.g., a Clang type and a similarly-named rendition of that same type in another language. When searching for a type It is much cheaper to pass a set of supported languages to the SymbolFile than having it materialize every result and then rejecting the materialized types that have the wrong language. Differential Revision: https://reviews.llvm.org/D66546 <rdar://problem/54471165> This reapplies r369690 with a previously missing constructor for LanguageSet. llvm-svn: 369710
2019-08-22Revert Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl
This reverts r369690 (git commit aa3a564efa6b5fff2129f81a4041069a0233168f) llvm-svn: 369702
2019-08-22Extend FindTypes with CompilerContext to allow filtering by language.Adrian Prantl
This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch. In multi-language projects it is extremely common to have, e.g., a Clang type and a similarly-named rendition of that same type in another language. When searching for a type It is much cheaper to pass a set of supported languages to the SymbolFile than having it materialize every result and then rejecting the materialized types that have the wrong language. Differential Revision: https://reviews.llvm.org/D66546 <rdar://problem/54471165> llvm-svn: 369690
2019-05-29[Target] Introduce Process::GetLanguageRuntimesAlex Langford
Summary: Currently there's not really a good way to iterate over the language runtimes a process has. This is sometimes desirable (as seen in my change to Thread). Additionally, there's not really a good reason to iterate over every available language, but rather only over languages for which we have a plugin loaded. Reviewers: JDevlieghere, davide, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D62562 llvm-svn: 361999
2019-05-16Factor out switch statement into a helper function (NFC)Adrian Prantl
This addresses post-commit review feedback for https://reviews.llvm.org/D62015. llvm-svn: 360930
2019-04-10[NFC] Remove ASCII lines from commentsJonas Devlieghere
A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
2019-02-12Remove redundant ::get() for smart pointer. (NFC)Jonas Devlieghere
This commit removes redundant calls to smart pointer’s ::get() method. https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html llvm-svn: 353795
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
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
2019-01-14[SymbolFile] Remove SymbolContext parameter from FindTypes.Zachary Turner
This parameter was only ever used with the Module set, and since a SymbolFile is tied to a module, the parameter turns out to be entirely unnecessary. Furthermore, it doesn't make a lot of sense to ask a caller to ask SymbolFile which is tied to Module X to find types for Module Y, but that possibility was open with the previous interface. By removing this parameter from the API, it makes it harder to use incorrectly as well as easier for an implementor to understand what it needs to do. llvm-svn: 351133
2018-08-02[LLDB] Added syntax highlighting supportRaphael Isemann
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
2017-05-12Rename Error -> Status.Zachary Turner
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
2017-02-06Switch std::call_once to llvm::call_onceKamil Rytarowski
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
2017-02-02Move classes from Core -> Utility.Zachary Turner
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
2016-11-01Implement a general type scavenger that can dig types from debug info + a ↵Enrico Granata
filtering mechanism to accept/reject results thusly obtained Implement the C++ type lookup support in terms of this general scavenger The idea is that we may want other languages to do debug info based search (exclusively, or as an add-on to runtime/module based searching) and it makes sense to avoid duplicating this functionality llvm-svn: 285727
2016-09-23Update OptionGroup::SetValue to take StringRef.Zachary Turner
Then deal with all the fallout. Differential Revision: https://reviews.llvm.org/D24847 llvm-svn: 282265
2016-09-17Convert many functions to use StringRefs.Zachary Turner
Where possible, remove the const char* version. To keep the risk and impact here minimal, I've only done the simplest functions. In the process, I found a few opportunities for adding some unit tests, so I added those as well. Tested on Windows, Linux, and OSX. llvm-svn: 281799
2016-09-06*** This commit represents a complete reformatting of the LLDB source codeKate Stone
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
2016-05-19second pass over removal of Mutex and ConditionSaleem Abdulrasool
llvm-svn: 270024
2016-05-18remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool
This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
2016-03-24Make it possible for language plugins to provide additional custom help for ↵Enrico Granata
'type lookup' llvm-svn: 264356
2016-02-12Objective-C++ is a kind of C++.Sean Callanan
llvm-svn: 260715