summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/CPPLanguageRuntime.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [LanguageRuntime] Move CPPLanguageRuntime into a pluginAlex Langford2019-07-121-354/+0
| | | | | | | | | | | | Summary: This seems better suited to be in a plugin. Reviewers: JDevlieghere, clayborg, jingham, compnerd, labath Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D64599 llvm-svn: 365951
* [Core] Generalize ValueObject::IsRuntimeSupportValueAlex Langford2019-07-011-14/+2
| | | | | | | | | | | | | | | Summary: Instead of falling back to ObjCLanguageRuntime, we should be falling back to every loaded language runtime. This makes ValueObject more language agnostic. Reviewers: labath, compnerd, JDevlieghere, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D63240 llvm-svn: 364845
* Add a defensive check for nullptr as in the block above.Adrian Prantl2019-06-251-1/+1
| | | | | | | | | Unfortunately I had to work backwards from a crash log, so I don't have a good testcase at this point in time. rdar://problem/51874647 llvm-svn: 364344
* [LanguageRuntime] Introduce LLVM-style castsAlex Langford2019-06-081-0/+2
| | | | | | | | | | | | Summary: Using llvm-style rtti gives us stronger guarantees around casting LanguageRuntimes. As discussed in D62755 Differential Revision: https://reviews.llvm.org/D62934 llvm-svn: 362884
* [lldb] NFC modernize codebase with modernize-use-nullptrKonrad Kleine2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]] This commit is the result of modernizing the LLDB codebase by using `nullptr` instread of `0` or `NULL`. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html for more information. This is the command I ran and I to fix and format the code base: ``` run-clang-tidy.py \ -header-filter='.*' \ -checks='-*,modernize-use-nullptr' \ -fix ~/dev/llvm-project/lldb/.* \ -format \ -style LLVM \ -p ~/llvm-builds/debug-ninja-gcc ``` NOTE: There were also changes to `llvm/utils/unittest` but I did not include them because I felt that maybe this library shall be updated in isolation somehow. NOTE: I know this is a rather large commit but it is a nobrainer in most parts. Reviewers: martong, espindola, shafik, #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits Tags: #lldb, #llvm Differential Revision: https://reviews.llvm.org/D61847 llvm-svn: 361484
* [DataFormatters] FindLibCppStdFunctionCallableInfo() currently uses ↵Shafik Yaghmour2019-05-131-2/+2
| | | | | | | | FindFunctions() in order to find a lambdas operator()() but using FindSymbolsMatchingRegExAndType() is cheaper and if we also anchor the regex using ^ this adds some additional performance gains. Differential Revision: https://reviews.llvm.org/D61759 llvm-svn: 360599
* Hide runtime support values such as clang's __vla_expr from frame variableAdrian Prantl2019-05-021-1/+21
| | | | | | | | | | | | by respecting the "artificial" attribute on variables. Function arguments that are artificial and useful to end-users are being whitelisted by the language runtime. <rdar://problem/45322477> Differential Revision: https://reviews.llvm.org/D61451 llvm-svn: 359841
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* [NFC] find_first_of/find_last_of -> find/rfind for single char.Jonas Devlieghere2019-03-281-1/+1
| | | | | | | | | For a single char argument, find_first_of is equal to find and find_last_of is equal to rfind. While playing around with the plugin stuff this caused an export failure because it always got inlined except once, which resulted in an undefined symbol. llvm-svn: 357198
* Use std::make_shared in LLDB (NFC)Jonas Devlieghere2019-02-111-5/+7
| | | | | | | | | | | Unlike std::make_unique, which is only available since C++14, std::make_shared is available since C++11. Not only is std::make_shared a lot more readable compared to ::reset(new), it also performs a single heap allocation for the object and control block. Differential revision: https://reviews.llvm.org/D57990 llvm-svn: 353764
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* [DataFormatters] Fixes to libc++ std::function formatter to deal with ABI ↵Shafik Yaghmour2018-12-101-0/+9
| | | | | | | | change see https://reviews.llvm.org/D55045 llvm-svn: 348810
* Adding support to step into the callable wrapped by libc++ std::functionShafik Yaghmour2018-10-121-1/+74
| | | | | | | | rdar://problem/14365983 Differential Revision: https://reviews.llvm.org/D52851 llvm-svn: 344371
* Remove another unused mislayered include.Benjamin Kramer2018-09-121-1/+0
| | | | llvm-svn: 342047
* Remove unused include that's also a layering violation.Benjamin Kramer2018-09-121-1/+0
| | | | llvm-svn: 342046
* Refactoring std::function formatter to move core functionality into ↵Shafik Yaghmour2018-09-111-0/+224
| | | | | | | | | | CPPLanguageRuntime Patch by Shafik Yaghmour. Differential Revision: https://reviews.llvm.org/D51896 llvm-svn: 341991
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-19/+13
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Move more functionality from the LanguageRuntimes to the Languages.Jim Ingham2015-09-021-369/+0
| | | | llvm-svn: 246616
* Improve C++ function name handling and step-in avoid regerxp handlingTamas Berghammer2015-07-241-10/+7
| | | | | | | | | | | | | | | | | | | If the function is a template then the return type is part of the function name. This CL fixes the parsing of these function names in the case when the return type contains ':'. The name of free functions in C++ don't have context part. Fix the logic geting the function name without arguments out from a full function name to handle this case. Change the handling of step-in-avoid-regexp to match the value against the function name without it's arguments and return value. This is required because the default regex ("^std::") would match any template function returning an std object. Fifferential revision: http://reviews.llvm.org/D11461 llvm-svn: 243099
* Fixed the C++ method name class to be a bit more picky about what it ↵Greg Clayton2014-11-051-2/+47
| | | | | | | | | | | | identifies as a C++ method. This was done by using regular expressions on any basename we find to ensure it is valid. This fixed setting breakpoints by name with values like '[J]com.robovm.debug.server.apps.SleepLoop.startingUp()V'. This was previously triggering the C++ method name class to identify the string as C++ with a basename of '[J]com.robovm.debug.server.apps.SleepLoop.startingUp' which was obviously incorrect. The changes also fixed errors in templated function names like "void foo<int>(...)" where "void foo<int>" was being identified incorrectly as the basename. We also handle more C++ operators correctly now. llvm-svn: 221416
* Setting breakpoints with name mask eFunctionNameTypeBase was broken for ↵Jim Ingham2014-10-251-10/+8
| | | | | | | | straight C names by 220432. Get that working again. llvm-svn: 220602
* Fixed name lookups for names that contain "::" but aren't actually C++ ↵Greg Clayton2014-10-221-20/+11
| | | | | | | | | | | | qualified C++ names. To do this, I fixed the CPPLanguageRuntime::StripNamespacesFromVariableName() function to use a regular expression that correctly determines if the name passed to it is a qualfied C++ name like "a::b::c" or "b::c". The old version of this function was treating '__54-[NSUserScriptTask executeWithInterpreter:arguments::]_block_invoke' as a match with a basename of ']_block_invoke'. Also fixed a case in the by name lookup of functions where we wouldn't look for the full name if we actually tried to call CPPLanguageRuntime::StripNamespacesFromVariableName() and got an empty basename back. <rdar://problem/18527866> llvm-svn: 220432
* <rdar://problem/11398407>Greg Clayton2013-05-181-43/+7
| | | | | | | | Name matching was working inconsistently across many places in LLDB. Anyone doing name lookups where you want to look for all types of names should used "eFunctionNameTypeAuto" as the sole name type mask. This will ensure that we get consistent "lookup function by name" results. We had many function calls using as mask like "eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector". This was due to the function lookup by name evolving over time, but as it stands today, use eFunctionNameTypeAuto when you want general name lookups. Either ModuleList::FindFunctions() or Module::FindFunctions() will figure out the right kinds of names to lookup and remove the "eFunctionNameTypeAuto" and replace it with the exact subset of what the name can be. This checkin also changes eFunctionNameTypeAny over to use eFunctionNameTypeAuto to reflect this. llvm-svn: 182179
* <rdar://problem/13506727> Greg Clayton2013-04-031-29/+182
| | | | | | | | | | | | Symbol table function names should support lookups like symbols with debug info. To fix this I: - Gutted the way FindFunctions is used, there used to be way too much smarts only in the DWARF plug-in - Made it more efficient by chopping the name up once and using simpler queries so that SymbolFile and Symtab plug-ins don't need to do as much - Filter the results at a higher level - Make the lldb_private::Symtab able to chop up C++ mangled names and make as much sense out of them as possible and also be able to search by basename, fullname, method name, and selector name. llvm-svn: 178608
* <rdar://problem/11113279>Greg Clayton2012-03-261-2/+0
| | | | | | | | | | Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method. This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB. llvm-svn: 153482
* Adding support for an "equivalents map". This can be useful when compilers ↵Enrico Granata2012-02-031-0/+151
| | | | | | | | emit multiple, different names for the same actual type. In such scenarios, one of the type names can actually be found during a type lookup, while the others are just aliases. This can cause issues when trying to work with these aliased names and being unable to resolve them to an actual type (e.g. getting an SBType for the aliased name). Currently, no code is using this feature, since we can hopefully rely on the new template support in SBType to get the same stuff done, but the support is there just in case it turns out to be useful for some future need. llvm-svn: 149661
* Move the responsibility for translating the various eFunctionNameType ↵Jim Ingham2011-10-071-0/+78
| | | | | | | | | | lookups to the SymbolFIle (it was done mostly in the BreakpointResolverName resolver before.) Then tailor our searches to the way the indexed maps are laid out. This removes a bunch of test case failures using indexed dSYM's. llvm-svn: 141428
* Remove unneeded ExecutionContextScope variables.Jim Ingham2011-03-311-1/+1
| | | | llvm-svn: 128685
* Add "-o" option to "expression" which prints the object description if ↵Jim Ingham2010-09-301-0/+7
| | | | | | available. llvm-svn: 115115
* Replace the vestigial Value::GetOpaqueCLangQualType with the more correct ↵Jim Ingham2010-09-281-1/+9
| | | | | | | | Value::GetValueOpaqueClangQualType. But mostly, move the ObjC Trampoline handling code from the MacOSX dyld plugin to the AppleObjCRuntime classes. llvm-svn: 114935
* Committing the skeleton of Language runtime plugin classes.Jim Ingham2010-09-231-0/+27
llvm-svn: 114620
OpenPOWER on IntegriCloud