summaryrefslogtreecommitdiff
path: root/lldb/source/Target/LanguageRuntime.cpp
AgeCommit message (Collapse)Author
2024-11-20Rename GetLanguageInfo to GetLanguageSpecificData (#117012)Adrian Prantl
Unbeknownst to me the Swift LLDB branch already had an almost identical API with this name, so it makes sense to merge the two.
2024-11-20[lldb] Add an API to derive language-specific runtime information (#116904)Adrian Prantl
This is motivated by exposing some Swift language-specific flags through the API, in the example here it is used to communicate the Objective-C runtime version. This could also be a meaningful extension point to get information about "embedded: languages, such as extracting the C++ version in an Objective-C++ frame or something along those lines.
2022-12-19Revert "[lldb] Remove redundant .c_str() and .get() calls"Muhammad Omair Javaid
This reverts commit fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd. This has broken all LLDB buildbots: https://lab.llvm.org/buildbot/#/builders/68/builds/44990 https://lab.llvm.org/buildbot/#/builders/96/builds/33160
2022-12-18[lldb] Remove redundant .c_str() and .get() callsFangrui Song
Removing .c_str() has a semantics difference, but the use scenarios likely do not matter as we don't have NUL in the strings.
2022-03-14[LLDB] Applying clang-tidy modernize-use-default-member-init over LLDBShafik Yaghmour
Applied modernize-use-default-member-init clang-tidy check over LLDB. It appears in many files we had already switched to in class member init but never updated the constructors to reflect that. This check is already present in the lldb/.clang-tidy config. Differential Revision: https://reviews.llvm.org/D121481
2021-04-08Add setting to disable LanguageRuntime UnwindPlansJason Molenda
When debugging LanguageRuntime unwindplans, it can be helpful to disable their use and see the normal stack walk. Add a setting for this. Differential Revision: https://reviews.llvm.org/D99828
2021-03-03LanguageRuntime for 0th frame unwind, simplify getting pc-for-symbolicationJason Molenda
Add calls into LanguageRuntime when finding the unwind method to use out of the 0th (currently executing) stack frame. Allow for the LanguageRuntimes to indicate if this stack frames should be treated like a zeroth-frame -- symbolication should be done based on the saved pc address, not decremented like normal ABI function calls. Add methods to RegisterContext and StackFrame to get a pc value suitable for symbolication, to reduce the number of places in lldb where we decrement the saved pc values before symbolication. <rdar://problem/70398009> Differential Revision: https://reviews.llvm.org/D97644
2021-02-18LanguageRuntime can provide an UnwindPlan for special occasionsJason Molenda
Add a facility in the LanguageRuntime to provide a special UnwindPlan based on the register values in a RegisterContext, instead of using the return-pc to find a function and use its normal UnwindPlans. Needed when the runtime has special stack frames that we want to show the user, but aren't actually on the real stack. Specifically for Swift asynchronous functions. With feedback from Greg Clayton, Jonas Devlieghere, Dave Lee <rdar://problem/70398009> Differential Revision: https://reviews.llvm.org/D96839
2020-10-09[lldb] Delete copy operations on PluginInterface classPavel Labath
This is a polymorphic class, copying it is a bad idea. This was not a problem because most classes inheriting from it were deleting their copy operations themselves. However, this enables us to delete those explicit deletions, and ensure noone forgets to add them in the future.
2020-07-24[lldb] Have LanguageRuntime and SystemRuntime share a base class (NFC)Jonas Devlieghere
LangaugeRuntime and SystemRuntime now both inherit from Runtime.
2020-07-24[lldb] Don't wrap and release raw pointer in unique_ptr (NFC)Jonas Devlieghere
2020-03-04[lldb] Make BreakpointResolver hold weak_ptr instead of raw pointer to ↵Tatyana Krasnukha
breakpoint This prevents calling Breakpoint::shared_from_this of an object that is not owned by any shared_ptr. Differential Revision: https://reviews.llvm.org/D74557
2020-02-18[lldb][NFC] Remove unused parameterTatyana Krasnukha
Rename search-filter's CopyForBreakpoint to CreateCopy, since they don't do anything with breakpoints.
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-11-22[lldb] Fix exception breakpoint not being resolved when set on dummy targetMartin Svensson
Summary: Ensure that breakpoint ivar is properly set in exception breakpoint resolver so that exception breakpoints set on dummy targets are resolved once real targets are created and run. Reviewers: jingham Reviewed By: jingham Subscribers: teemperor, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69880
2019-10-10[lldb][NFC] Remove strange bool parameter from Searcher::SearchCallbackRaphael Isemann
Summary: The SearchCallback has a bool parameter that we always set to false, we never use in any callback implementation and that also changes its name from one file to the other (either `containing` and `complete`). It was added in the original LLDB check in, so there isn't any history what this was supposed to be, so let's just remove it. Reviewers: jingham, JDevlieghere, labath Reviewed By: jingham, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68696 llvm-svn: 374313
2019-06-21[Target] Decouple ObjCLanguageRuntime from LanguageRuntimeAlex Langford
Summary: ObjCLanguageRuntime was being pulled into LanguageRuntime because of Breakpoint Preconditions. If we move BreakpointPrecondition out of Breakpoint, we can extend the LanguageRuntime plugin interface so that LanguageRuntimes can give us a BreakpointPrecondition for exceptions. Differential Revision: https://reviews.llvm.org/D63181 llvm-svn: 364098
2019-06-11[LanguageRuntime] Simplify CreateExceptionSearchFilter in derived classesAlex Langford
llvm-svn: 363109
2019-06-08[LanguageRuntime] Introduce LLVM-style castsAlex Langford
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
2019-05-16[Target] Stop linking against lldbPluginObjCLanguageAlex Langford
llvm-svn: 360945
2019-02-13Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere
The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
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
2018-11-11Remove header grouping comments.Jonas Devlieghere
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
2018-09-07NFC: Move Searcher::Depth into lldb-enumerations as SearchDepth.Jim Ingham
In a subsequent commit, I will need to expose the search depth to the SB API's, so I'm moving this define into lldb-enumerations where it will get added to the lldb module. llvm-svn: 341690
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-03-22Delete some more dead includes.Zachary Turner
This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
2016-10-05Convert CommandObject constructors to StringRef.Zachary Turner
llvm-svn: 283384
2016-09-13Add a few const's (thanks Zachary) and return shared or unique pointersJim Ingham
in places where they help prevent leaks. llvm-svn: 281288
2016-09-12This is the main part of a change to add breakpoint save and restore to lldb.Jim Ingham
Still to come: 1) SB API's 2) Testcases 3) Loose ends: a) serialize Thread options b) serialize Exception resolvers 4) "break list --file" should list breakpoints contained in a file and "break read -f 1 3 5" should then read in only those breakpoints. <rdar://problem/12611863> llvm-svn: 281273
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-02-18Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.Eugene Zelenko
llvm-svn: 261179
2016-02-06Per Jim's suggestion, move checks that we're not mixing and matching ↵Enrico Granata
Debuggers and Commands deeper in the bowels of LLDB NFC llvm-svn: 259972
2016-02-06Fix an issue where certain CommandObjects (or Options thereof) were being ↵Enrico Granata
created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes Fixes rdar://24460882 llvm-svn: 259964
2015-12-18Make the Language print the description of the Exception Breakpoint ↵Jim Ingham
resolver. Also have the breakpoint description print the precondition description if one exists. No behavior change. <rdar://problem/22885189> llvm-svn: 255972
2015-12-16Rework breakpoint language filtering to use the symbol context's language.Dawn Perchik
This patch reworks the breakpoint filter-by-language patch to use the symbol context instead of trying to guess the language solely from the symbol's name. This has the advantage that symbols compiled with debug info will have their actual language known. Symbols without debug info will still do the same "guess"ing because Symbol::GetLanguage() is implemented using Mangled::GuessLanguage(). The recognition of ObjC names was merged into Mangled::GuessLanguage. Reviewed by: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15326 llvm-svn: 255808
2015-12-04Fix breakpoint language filtering for other C variants (like C99) and Pascal.Dawn Perchik
This patch fixes setting breakpoints on symbol for variants of C and Pascal where the language is "unknown" within the filter-by-language process added in r252356. It also renames GetLanguageForSymbolByName to GuessLanguageForSymbolByName and adds comments explaining the pitfalls of the flawed assumption that the language can be determined solely from the name and target. Reviewed by: jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15175 llvm-svn: 254753
2015-11-06Make the language specifier to "break set" actually filter the names by ↵Jim Ingham
their language. So for instance: break set -l c++ -r Name will only break on C++ symbols that match Name, not ObjC or plain C symbols. This also works for "break set -n" and there are SB API's to pass this as well. llvm-svn: 252356
2015-10-23Fix Clang-tidy modernize-use-override warnings in source/Target; other minor ↵Eugene Zelenko
fixes. llvm-svn: 251134
2015-09-02Move things from the LanguageRuntime that obviously belong in the new ↵Jim Ingham
Language plugin instead. llvm-svn: 246611
2015-07-22Fix warnings found by -Wextra-semiPavel Labath
patch by Eugene Zelenko. llvm-svn: 242875
2015-07-21Add support for specifying a language to use when parsing breakpoints.Dawn Perchik
Target and breakpoints options were added: breakpoint set --language lang --name func settings set target.language pascal These specify the Language to use when interpreting the breakpoint's expression (note: currently only implemented for breakpoints on identifiers). If the breakpoint language is not set, the target.language setting is used. This support is required by Pascal, for example, to set breakpoint at 'ns.foo' for function 'foo' in namespace 'ns'. Tests on the language were also added to Module::PrepareForFunctionNameLookup for efficiency. Reviewed by: clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D11119 llvm-svn: 242844
2015-06-17Fix enum LanguageType values and language string table lookups.Dawn Perchik
Summary: * Fix enum LanguageType values so that they can be used as indexes into array language_names and g_languages as assumed by LanguageRuntime::GetNameForLanguageType, Language::SetLanguageFromCString and Language::AsCString. * Add DWARFCompileUnit::LanguageTypeFromDWARF to convert from DWARF DW_LANG_* values to enum LanguageType values. Reviewed By: clayborg, abidh Differential Revision: http://reviews.llvm.org/D10484 llvm-svn: 239963
2015-05-04Add language command and LanguageRuntime plugin changes to allow vending of ↵Colin Riley
command objects. Differential Revision: http://reviews.llvm.org/D9402 llvm-svn: 236443
2015-04-22This is some groundwork for filtering the language ExceptionJim Ingham
breakpoints, for instance on the class of the thrown object. This change doesn't actually make that work, the part where we extract the thrown object type from the throw site isn't done yet. This provides a general programmatic "precondition" that you can add to breakpoints to give them the ability to do filtering on the LLDB side before we pass the stop on to the user-provided conditions & callbacks. llvm-svn: 235538
2015-04-17Fix "help language", the languages printer was assuming the Jim Ingham
eLanguageType numbers would be sequential, but vendor types are not and the printer went crazy. llvm-svn: 235153
2015-04-03Adding the RenderScript language type.Colin Riley
Differential Revision: http://reviews.llvm.org/D8803 llvm-svn: 234002
2015-03-24[DWARF] If linkages names are missing, use decl context to get qualified names.Siva Chandra
Summary: This commit adds this alternate route only when parsing variable dies corresponding to global or static variables. The motivation for this is that GCC does not emit linkage names for functions and variables declared/defined in anonymous namespaces. Having this alternate route fixes one part of TestNamespace which fails when the test case is compiled with GCC. An alternate route to get fully qualified names of functions whose linkage names are missing will be added with a followup change. With that, the other failing part of TestNamespace will also be fixed. Test Plan: dotest.py -C gcc -p TestNamespace Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8569 llvm-svn: 233098
2015-02-06Add additional DWARF 5 language constants.Bruce Mitchener
This also hooks up the new C++14 language constant to be treated the same as the other C++ language constants. Differential Revision: http://reviews.llvm.org/D7429 llvm-svn: 228386
2014-12-10Fix a bunch of [-Werror,-Winconsistent-missing-override] warnings.Eric Christopher
llvm-svn: 223973
2014-12-06Add the ability to set breakpoints with conditions, commands, etc,Jim Ingham
in the "dummy-target". The dummy target breakpoints prime all future targets. Breakpoints set before any target is created (e.g. breakpoints in ~/.lldbinit) automatically get set in the dummy target. You can also list, add & delete breakpoints from the dummy target using the "-D" flag, which is supported by most of the breakpoint commands. This removes a long-standing wart in lldb... <rdar://problem/10881487> llvm-svn: 223565