summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
Commit message (Collapse)AuthorAgeFilesLines
...
* Pass an SBStructuredData to scripted ThreadPlans on use.Jim Ingham2019-10-032-4/+72
| | | | | | | | | | This will allow us to write reusable scripted ThreadPlans, since you can use key/value pairs with known keys in the plan to parametrize its behavior. Differential Revision: https://reviews.llvm.org/D68366 llvm-svn: 373675
* factor out an abstract base class for FileLawrence D'Anna2019-10-032-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch factors out File as an abstract base class and moves most of its actual functionality into a subclass called NativeFile. In the next patch, I'm going to be adding subclasses of File that don't necessarily have any connection to actual OS files, so they will not inherit from NativeFile. This patch was split out as a prerequisite for https://reviews.llvm.org/D68188 Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68317 llvm-svn: 373564
* SBDebugger::SetInputFile, SetOutputFile, etc.Lawrence D'Anna2019-10-032-14/+105
| | | | | | | | | | | | | | | | | | | | | Summary: Add new methods to SBDebugger to set IO files as SBFiles instead of as FILE* streams. In future commits, the FILE* methods will be deprecated and these will become the primary way to set the debugger I/O streams. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68181 llvm-svn: 373563
* new api class: SBFileLawrence D'Anna2019-10-033-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: SBFile is a scripting API wrapper for lldb_private::File This is the first step in a project to enable arbitrary python io.IOBase file objects -- including those that override the read() and write() methods -- to be used as the main debugger IOStreams. Currently this is impossible because python file objects must first be converted into FILE* streams by SWIG in order to be passed into the debugger. full prototype: https://github.com/smoofra/llvm-project/tree/files Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath Reviewed By: labath Subscribers: labath, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67793 llvm-svn: 373562
* Remove size_t return parameter from FindTypesAdrian Prantl2019-10-012-19/+15
| | | | | | | | | | | | | | | In r368345 I accidentally introduced a regression that would over-report the number of matches found by FindTypes if the DeclContext Filter was hit. This patch simply removes the size_t return parameter altogether — it's not that useful. rdar://problem/55500457 Differential Revision: https://reviews.llvm.org/D68169 llvm-svn: 373344
* remove File::SetStream(), make new files instead.Lawrence D'Anna2019-09-271-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes File::SetStream() and File::SetDescriptor(), and replaces most direct uses of File with pointers to File. Instead of calling SetStream() on a file, we make a new file and replace it. My ultimate goal here is to introduce a new API class SBFile, which has full support for python io.IOStream file objects. These can redirect read() and write() to python code, so lldb::Files will need a way to dispatch those methods. Additionally it will need some form of sharing and assigning files, as a SBFile will be passed in and assigned to the main IO streams of the debugger. In my prototype patch queue, I make File itself copyable and add a secondary class FileOps to manage the sharing and dispatch. In that case SBFile was a unique_ptr<File>. (here: https://github.com/smoofra/llvm-project/tree/files) However in review, Pavel Labath suggested that it be shared_ptr instead. (here: https://reviews.llvm.org/D67793) In order for SBFile to use shared_ptr<File>, everything else should as well. If this patch is accepted, I will make SBFile use a shared_ptr I will remove FileOps from future patches and use subclasses of File instead. Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67891 llvm-svn: 373090
* Convert FileSystem::Open() to return Expected<FileUP>Lawrence D'Anna2019-09-261-33/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch converts FileSystem::Open from this prototype: Status Open(File &File, const FileSpec &file_spec, ...); to this one: llvm::Expected<std::unique_ptr<File>> Open(const FileSpec &file_spec, ...); This is beneficial on its own, as llvm::Expected is a more modern and recommended error type than Status. It is also a necessary step towards https://reviews.llvm.org/D67891, and further developments for lldb_private::File. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67996 llvm-svn: 373003
* SystemInitializer: Define macros for experimental targets tooPavel Labath2019-09-261-0/+2
| | | | llvm-svn: 372998
* [lldb] Code cleanup: Simplify SBCommandReturnObjectJan Kratochvil2019-09-261-82/+51
| | | | | | | | | | | | A simplification for D67589. m_opaque_up can never be nullptr (unless one calls a ctor with nullptr or one uses SetLLDBObjectPtr with nullptr). Also protected SetLLDBObjectPtr is not used anywhere (I haven't found it would ever be used). Differential revision: https://reviews.llvm.org/D68083 llvm-svn: 372976
* SystemInitializer: Use Targets.def to selectively initialize ABI pluginsPavel Labath2019-09-262-61/+34
| | | | | | | | | | | This avoids having to define additional macros in the cmake file, and and also makes the logic in the cpp files more compact. It is also easily extendible to other plugin types (instruction emulation?) that should only be initialized if the corresponding llvm target is built. Thanks to Ilya Birukov for pointing me to this file. llvm-svn: 372952
* Have ABI plugins vend llvm MCRegisterInfo dataPavel Labath2019-09-252-14/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I was recently surprised to learn that there is a total of 2 (two) users of the register info definitions contained in the ABI plugins. Yet, the defitions themselves span nearly 10kLOC. The two users are: - dwarf expression pretty printer - the mechanism for augmenting the register info definitions obtained over gdb-remote protocol (AugmentRegisterInfoViaABI) Both of these uses need the DWARF an EH register numbers, which is information that is already available in LLVM. This patch makes it possible to do so. It adds a GetMCRegisterInfo method to the ABI class, which every class is expected to implement. Normally, it should be sufficient to obtain the definitions from the appropriate llvm::Target object (for which I provide a utility function), but the subclasses are free to construct it in any way they deem fit. We should be able to always get the MCRegisterInfo object from llvm, with one important exception: if the relevant llvm target was disabled at compile time. To handle this, I add a mechanism to disable the compilation of ABI plugins based on the value of LLVM_TARGETS_TO_BUILD cmake setting. This ensures all our existing are able to create their MCRegisterInfo objects. The new MCRegisterInfo api is not used yet, but the intention is to make use of it in follow-up patches. Reviewers: jasonmolenda, aprantl, JDevlieghere, tatyana-krasnukha Subscribers: wuzish, nemanjai, mgorny, kbarton, atanasyan, lldb-commits Differential Revision: https://reviews.llvm.org/D67965 llvm-svn: 372862
* [lldb][NFC] Make ArgEntry::quote private and provide a getterRaphael Isemann2019-09-131-1/+1
| | | | llvm-svn: 371823
* [Reproducer] Move the command loader into the reproducer (NFC)Jonas Devlieghere2019-09-111-48/+6
| | | | | | | | This just moves the CommandLoader utility into the reproducer namespace and makes it accessible outside the API layer. This is setting things up for a bigger change. llvm-svn: 371689
* [NFC] Reformat SBDebugger before making changesJonas Devlieghere2019-09-111-31/+14
| | | | llvm-svn: 371688
* [lldb][NFC] Remove dead code in SBAddress::GetDescriptionRaphael Isemann2019-09-111-6/+0
| | | | llvm-svn: 371618
* Code cleanup: Change FormattersContainer::KeyType from SP to rvalueJan Kratochvil2019-09-042-12/+12
| | | | | | | | | | | There is now std::shared_ptr passed around which is expensive for manycore CPUs. Most of the times (except for 3 cases) it is now just std::moved with no CPU locks needed. It also makes it possible to sort the keys (which is now not needed much after D66398). Differential revision: https://reviews.llvm.org/D67049 llvm-svn: 370863
* [dotest] Add @skipIfCursesSupportMissing and annotate the new gui testPavel Labath2019-09-021-0/+7
| | | | | | | | | | | | | | | Summary: The gui command requires curses support, which can be disabled at compile time. This patch adds the ability to detect this situation in the test suite and skip the test accordingly. Reviewers: teemperor, jankratochvil Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D67073 llvm-svn: 370658
* [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and ↵Raphael Isemann2019-08-221-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove any undocumented/redundant return values Summary: We still have some leftovers of the old completion API in the internals of LLDB that haven't been replaced by the new CompletionRequest. These leftovers are: * The return values (int/size_t) in all completion functions. * Our result array that starts indexing at 1. * `WordComplete` mode. I didn't replace them back then because it's tricky to figure out what exactly they are used for and the completion code is relatively untested. I finally got around to writing more tests for the API and understanding the semantics, so I think it's a good time to get rid of them. A few words why those things should be removed/replaced: * The return values are really cryptic, partly redundant and rarely documented. They are also completely ignored by Xcode, so whatever information they contain will end up breaking Xcode's completion mechanism. They are also partly impossible to even implement as we assign negative values special meaning and our completion API sometimes returns size_t. Completion functions are supposed to return -2 to rewrite the current line. We seem to use this in some untested code path to expand the history repeat character to the full command, but I haven't figured out why that doesn't work at the moment. Completion functions return -1 to 'insert the completion character', but that isn't implemented (even though we seem to activate this feature in LLDB sometimes). All positive values have to match the number of results. This is obviously just redundant information as the user can just look at the result list to get that information (which is what Xcode does). * The result array that starts indexing at 1 is obviously unexpected. The first element of the array is reserved for the common prefix of all completions (e.g. "foobar" and "footar" -> "foo"). The idea is that we calculate this to make the life of the API caller easier, but obviously forcing people to have 1-based indices is not helpful (or even worse, forces them to manually copy the results to make it 0-based like Xcode has to do). * The `WordComplete` mode indicates that LLDB should enter a space behind the completion. The idea is that we let the top-level API know that we just provided a full completion. Interestingly we `WordComplete` is just a single bool that somehow represents all N completions. And we always provide full completions in LLDB, so in theory it should always be true. The only use it currently serves is providing redundant information about whether we have a single definitive completion or not (which we already know from the number of results we get). This patch essentially removes `WordComplete` mode and makes the result array indexed from 0. It also removes all return values from all internal completion functions. The only non-redundant information they contain is about rewriting the current line (which is broken), so that functionality was moved to the CompletionRequest API. So you can now do `addCompletion("blub", "description", CompletionMode::RewriteLine)` to do the same. For the SB API we emulate the old behaviour by making the array indexed from 1 again with the common prefix at index 0. I didn't keep the special negative return codes as we either never sent them before (e.g. -2) or we didn't even implement them in the Editline handler (e.g. -1). I tried to keep this patch minimal and I'm aware we can probably now even further simplify a bunch of related code, but I would prefer doing this in follow-up NFC commits Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: arphaman, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66536 llvm-svn: 369624
* [lldb][NFC] Refactor remaining completion logic to use CompletionRequestsRaphael Isemann2019-08-151-2/+5
| | | | | | | | | | | | | | | | | | | | This patch moves the remaining completion functions from the old completion API (that used several variables) to just passing a single CompletionRequest. This is for the most part a simple change as we just replace the old arguments with a single CompletionRequest argument. There are a few places where I had to create new CompletionRequests in the called functions as CompletionRequests itself are immutable and don't expose their internal match list anymore. This means that if a function wanted to change the CompletionRequest or directly access the result list, we need to work around this by creating a new CompletionRequest and a temporary match/description list. Preparation work for rdar://53769355 llvm-svn: 369000
* [LLDB] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-1410-19/+19
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368933
* [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptrPavel Labath2019-08-141-7/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: It seems this was an unintended side-effect of D26698. AFAICT, these functions did return an empty string before that patch, and the patch contained code which attempted to ensure that, but those efforts were negated by ConstString::AsCString, which by default returns a nullptr even for empty strings. This patch: - fixes the GetOutput/Error methods to really return empty strings - adds and explicit test for that - removes a workaround in lldbtest.py, which was masking this problem from our other tests Reviewers: jingham, clayborg Subscribers: zturner, lldb-commits Differential Revision: https://reviews.llvm.org/D65739 llvm-svn: 368806
* SymbolVendor: Remove passthrough methodsPavel Labath2019-08-062-17/+14
| | | | | | | | | | After the recent refactorings the SymbolVendor passthrough no longer serve any purpose. This patch removes those methods, and updates all callsites to go to the symbol file directly -- in most cases that just means calling GetSymbolFile()->foo() instead of GetSymbolVendor()->foo(). llvm-svn: 368001
* Remove SymbolVendor::GetSymtabPavel Labath2019-08-051-10/+4
| | | | | | | | | | | | | | | | | | | | Summary: This patch removes the GetSymtab method from the SymbolVendor, which is a no-op as it's implementation just forwards to the relevant SymbolFile. Instead it creates a Module::GetSymtab, which calls the SymbolFile method directly. All callers have been updated to use the Module method directly instead of a two phase GetSymbolVendor->GetSymtab search, which leads to reduced intentation in a lot of deeply nested code. Reviewers: clayborg, JDevlieghere, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D65569 llvm-svn: 367820
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* [API] Remove use of ClangASTContext from SBTargetAlex Langford2019-07-311-13/+12
| | | | | | | | | | | | | Summary: The methods to find types in a Target aren't clang specific and are pretty generalizable to type systems. Additionally, to support some of the use cases in SBTarget, I've added a "GetScratchTypeSystems" method to Target to support getting all type systems for a target we are debugging. Differential Revision: https://reviews.llvm.org/D64964 llvm-svn: 367480
* [CompletionRequest] Remove unimplemented members.Jonas Devlieghere2019-07-311-2/+1
| | | | | | | | | | Completion requests have two fields that are essentially unimplemented: `m_match_start_point` and `m_max_return_elements`. This would've been okay, if it wasn't for the fact that this caused a bunch of useless parameters to be passed around. Occasionally there would be a comment or assert saying that they are not supported. This patch removes them. llvm-svn: 367385
* [Symbol] Use llvm::Expected when getting TypeSystemsAlex Langford2019-07-301-9/+19
| | | | | | | | | | | | | | | | | | Summary: This commit achieves the following: - Functions used to return a `TypeSystem *` return an `llvm::Expected<TypeSystem *>` now. This means that the result of a call is always checked, forcing clients to move more carefully. - `TypeSystemMap::GetTypeSystemForLanguage` will either return an Error or a non-null pointer to a TypeSystem. Reviewers: JDevlieghere, davide, compnerd Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D65122 llvm-svn: 367360
* SymbolVendor: Remove the type list memberPavel Labath2019-07-251-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Similarly to the compile unit lists, the list of types can also be managed by the symbol file itself. Since the only purpose of this list seems to be to maintain an owning reference to all the types a symbol file has created (items are only ever added to the list, never retrieved), I remove the passthrough functions in SymbolVendor and Module. I also tighten the interface of the function (return a reference instead of a pointer, make it protected instead of public). Reviewers: clayborg, JDevlieghere, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D65135 llvm-svn: 366994
* [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)Jonas Devlieghere2019-07-243-61/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
* [CMake] `install-distribution` for LLDB on DarwinStefan Granitz2019-07-101-3/+5
| | | | | | | | | | | | | | | | | | | | | Summary: There's a number of requirements for installing LLDB on macOS that are untypical for LLVM projects: use special install-prefix for LLDB.framework, ship headers and tools as framework resources, patch RPATHs, externalize debug-info to dSYM's and strip binaries with `-ST`. For some of it we could use `llvm_externalize_debuginfo()` in the past and just add special cases. However, this complicates the code for all projects and comes with the major drawback, that it adds all these actions at build-time, i.e. dSYM creation and stripping take a lot of time and don't make sense at build-time. LLVM's distribution mechanism (https://llvm.org/docs/BuildingADistribution.html) appears to be the natural candidate to install LLDB. Based on D64399 (enable in standalone builds), this patch integrates framework installation with the distribution mechanism and adds custom stripping flags and dSYM creation at install-time. Unlike the abandoned D61952, it leaves build-tree binaries untouched, so there's no side-effects on testing. Potential install-order issues must be handled externally. Please let me know what you think, while I run a few more tests and add remarks+documentation. Reviewers: xiaobai, compnerd, JDevlieghere, davide, labath, mgorny Reviewed By: xiaobai, JDevlieghere Subscribers: lldb-commits, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D64408 llvm-svn: 365617
* Change LaunchThread interface to return an expected.Jonas Devlieghere2019-07-051-4/+11
| | | | | | | | | Change the interface to return an expected, instead of taking a Status pointer. Differential revision: https://reviews.llvm.org/D64163 llvm-svn: 365226
* [Symbol] Add DeclVendor::FindTypesAlex Langford2019-07-021-19/+7
| | | | | | | | | | | | | Summary: Following up on the plan I outlined in D63622, we can remove the dependence on clang in all the places where we only want to find the types from the DeclVendor. This means that currently DeclVendor depends on clang, but centralizing the dependency makes it easier to refactor cleanly. Differential Revision: https://reviews.llvm.org/D63853 llvm-svn: 364962
* [Target] Hoist LanguageRuntime::GetDeclVendorAlex Langford2019-06-241-35/+20
| | | | | | | | | | | | | | | | | Summary: It's possible that each LanguageRuntime could have its own DeclVendor, so let's hoist that out of ObjCLanguageRuntime into LanguageRuntime. Additionally, this gives the opportunity to remove SBTarget's dependency on ObjCLanguageRuntime. Reviewers: JDevlieghere, labath, compnerd, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D63622 llvm-svn: 364229
* [ABI] Implement Windows ABI for x86_64Alex Langford2019-06-241-0/+3
| | | | | | | | | | | | | | | | | | Summary: Implement the ABI for WIndows-x86_64 including register info and calling convention. Handled nested struct returned in register (SysV doesn't have it supported) Reviewers: xiaobai, compnerd Reviewed By: compnerd Subscribers: labath, jasonmolenda, fedor.sergeev, mgorny, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62213 llvm-svn: 364216
* [Reproducers] Make reproducer relocatableJonas Devlieghere2019-06-181-0/+6
| | | | | | | | | | | | | | Before this patch, reproducers weren't relocatable. The reproducer contained hard coded paths in the VFS mapping, as well in the yaml file listing the different input files for the command interpreter. This patch changes that: - Use relative paths for the DataCollector. - Use an overlay prefix for the FileCollector. Differential revision: https://reviews.llvm.org/D63467 llvm-svn: 363697
* [NFC] Replace a plugin header with a non-plugin headerAlex Langford2019-06-131-1/+1
| | | | llvm-svn: 363338
* [Reproducers] Simplify providers with nested Info struct (NFC)Jonas Devlieghere2019-06-123-10/+8
| | | | | | | | | This replaces the `info` typedef with a nested struct named Info. This means we now have FooProvider and FooProvider::Info, instead of two related but separate classes FooProvider and FooInfo. This change is mostly cosmetic. llvm-svn: 363211
* [Target] Remove Process::GetObjCLanguageRuntimeAlex Langford2019-06-101-2/+2
| | | | | | | | | | | Summary: In an effort to make Process more language agnostic, I removed GetCPPLanguageRuntime from Process. I'm following up now with an equivalent change for ObjC. Differential Revision: https://reviews.llvm.org/D63052 llvm-svn: 362981
* Make CompileUnit::GetSupportFiles return a const listPavel Labath2019-05-301-8/+6
| | | | | | | | | | | | There's no reason for anyone to modify a list from outside of a symbol file (as that would break a lot of invariants that symbol files depend on). Make the function return a const FileSpecList and fix up a couple of places that were needlessly binding non-const references to the result of this function. llvm-svn: 362069
* [CMake] Folder structure for generated Xcode project to cover more targetsStefan Granitz2019-05-281-0/+1
| | | | llvm-svn: 361799
* [lldb] NFC modernize codebase with modernize-use-nullptrKonrad Kleine2019-05-2343-225/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CommandInterpreter] Refactor SourceInitFileJonas Devlieghere2019-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | I was looking at the current implementation of SourceInitFile and there were a few things that made this function hard to read: * The code to find the ~/.lldbinit file is duplicated across the cwd and non-cwd branch. * The ./.lldbinit is once computed by resolving .lldbinit and once by resolving ./.lldbinit. * It wasn't clear to me what happened when you're sourcing the .lldbinit file in the current working directory. Apparently we do nothing when we property to control that is set to warn (makes sense) and we don't care when the property is set to true (debatable). * There were at least two branches where the status of the CommandReturnObject were not set. This patch attempts to simplify that code. Differential revision: https://reviews.llvm.org/D61994 llvm-svn: 361080
* Fix file names in file headers. NFCFangrui Song2019-05-131-1/+1
| | | | llvm-svn: 360554
* Initialization: move InstructionEmulation to full initializationSaleem Abdulrasool2019-05-061-0/+13
| | | | | | | | The debug server does not need to use the instruction emulation. This helps reduce the size of the final lldb-server binary by another ~100K (~1% savings). llvm-svn: 360067
* ExpressionParser: only force link MCJIT when neededSaleem Abdulrasool2019-05-031-0/+5
| | | | | | | | | | | This was added to support FreeBSD. The inclusion of this header increases the size of `lldb-server` due to MCJIT being forcefully preserved. Conditionalise the inclusion to shared builds of LLVM which will allow for MCJIT to be stripped if unnecessary when performing static linking of tools. This shaves off ~28% of the binary size for lldb-server when linked with gold using `-ffunction-sections` and `-fdata-sections`. llvm-svn: 359944
* C.128 override, virtual keyword handlingRaphael Isemann2019-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: According to [C128] "Virtual functions should specify exactly one of `virtual`, `override`, or `final`", I've added override where a virtual function is overriden but the explicit `override` keyword was missing. Whenever both `virtual` and `override` were specified, I removed `virtual`. As C.128 puts it: > [...] writing more than one of these three is both redundant and > a potential source of errors. I anticipate a discussion about whether or not to add `override` to destructors but I went for it because of an example in [ISOCPP1000]. Let me repeat the comment for you here: Consider this code: ``` struct Base { virtual ~Base(){} }; struct SubClass : Base { ~SubClass() { std::cout << "It works!\n"; } }; int main() { std::unique_ptr<Base> ptr = std::make_unique<SubClass>(); } ``` If for some odd reason somebody removes the `virtual` keyword from the `Base` struct, the code will no longer print `It works!`. So adding `override` to destructors actively protects us from accidentally breaking our code at runtime. [C128]: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final [ISOCPP1000]: https://github.com/isocpp/CppCoreGuidelines/issues/1000#issuecomment-476951555 Reviewers: teemperor, JDevlieghere, davide, shafik Reviewed By: teemperor Subscribers: kwk, arphaman, kadircet, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D61440 llvm-svn: 359868
* Revert "Initialization: move InstructionEmulation to full initialization"Pavel Labath2019-05-031-13/+0
| | | | | | | This change is bogus. lldb-server definitely uses instruction emulation on some architectures. llvm-svn: 359862
* Initialization: move InstructionEmulation to full initializationSaleem Abdulrasool2019-05-021-0/+13
| | | | | | | The debug server does not need to use the instruction emulation. This helps reduce the size of the final lldb-server binary by another ~100K (~1% savings). llvm-svn: 359832
* Initialization: remove ObjectContainer from CommonSaleem Abdulrasool2019-05-021-0/+8
| | | | | | | | | This restructures the initialization path to move the ObjectContainer initialization into the *full* initialization path. This is not needed for the lldb-server initialization path. This helps strip off ~1MiB from the binary. llvm-svn: 359810
* [ScriptInterpreter] Move ownership into debugger (NFC)Jonas Devlieghere2019-04-264-8/+2
| | | | | | | | | | | | | | This is part two of the change started in r359330. This patch moves the ownership of the script interpreter from the command interpreter into the debugger. I would've preferred to remove the lazy initialization, however the fact that the scripting language is set after the debugger is created makes that tricky. So for now this does exactly the same thing as when it was under the command interpreter. The result is that this patch is fully NFC. Differential revision: https://reviews.llvm.org/D61211 llvm-svn: 359354
OpenPOWER on IntegriCloud