summaryrefslogtreecommitdiffstats
path: root/lldb/utils
Commit message (Collapse)AuthorAgeFilesLines
* [lldb/Utils] Remove vim-lldbJonas Devlieghere2020-01-109-1834/+0
| | | | | | | | | The vim-lldb plugin is unmaintained and doesn't work with a recent vim installation that uses Python 3. This removes it from the LLDB repository. The code is still available under lldb-tools on GitHub like we did with for lldb-mi. (https://github.com/lldb-tools/vim-lldb) Differential revision: https://reviews.llvm.org/D72541
* [lldb/Test] Bypass LLDB_TEST_COMMON_ARGS for certain dotest args (NFC)Jonas Devlieghere2020-01-101-0/+10
| | | | | | | | Rather than serializing every argument through LLDB_TEST_COMMON_ARGS, we can pass some of them directly using their CMake variable. Although this does introduce some code duplication between lit's site config and the lldb-dotest utility, it also means that it becomes easier to override these values (WIP).
* [lldb] Respect previously set values of LLDB_TABLEGEN_EXEAlex Langford2019-12-161-11/+13
| | | | | | | If you set LLDB_TABLEGEN_EXE in a CMake cache file or in the CMake invocation line, your setting isn't respected. Setting up the tablegen for the host will overwrite the value that we set LLDB_TABLEGEN_EXE to, which defeats the whole point of setting it in the first place.
* [LLDB] Fix inline variable only used in assertion. (NFC)Jonas Devlieghere2019-10-251-2/+1
| | | | | | | | | This prevents unused variable warning/error in -DNDEBUG builds. The variable was introduced in 5934cd11ea3e. Patch by: Shu-Chun Weng Differential revision: https://reviews.llvm.org/D69451
* [TableGen] Add asserts to make sure default values match property typeJonas Devlieghere2019-10-251-0/+16
| | | | | | This adds a few asserts to the property TableGen backend to prevent mismatches between property types and their default values. This would've prevented a copy-paste mistake we discovered downstream.
* [utils] Update lldb-dotest for new test layoutJonas Devlieghere2019-10-091-1/+1
| | | | | | The path to dotest.py changed after the test directory reorganization. llvm-svn: 374215
* [CMake] Track test dependencies with add_lldb_test_dependencyJonas Devlieghere2019-10-081-1/+1
| | | | | | | | | | | | | I often use `ninja lldb-test-deps` to build all the test dependencies before running a subset of the tests with `lit --filter`. This functionality seems to break relatively often because test dependencies are tracked in an ad-hoc way acrooss cmake files. This patch adds a helper function `add_lldb_test_dependency` to unify test dependency tracking by adding dependencies to lldb-test-deps. Differential revision: https://reviews.llvm.org/D68612 llvm-svn: 373996
* Do not install lit-cpuidSylvestre Ledru2019-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: AFAIK, lit-cpuid is used by the tests. Installing it causes LLVMExports*.cmake files to depend on this program. It causes some serious packaging issues as it would means that llvm-dev depends on lldb. See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941082 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941306 See also https://bugs.llvm.org/show_bug.cgi?id=43035 for a similar issue caused by https://reviews.llvm.org/D56606 Reviewers: mgorny Reviewed By: mgorny Subscribers: delcypher, lldb-commits Differential Revision: https://reviews.llvm.org/D68537 llvm-svn: 373819
* [test] Fix various module cache bugs and inconsistenciesJonas Devlieghere2019-08-291-0/+2
| | | | | | | | | | | | | | | | | Currently, lit tests don't set neither the module cache for building inferiors nor the module cache used by lldb when running tests. Furthermore, we have several places where we rely on the path to the module cache being always the same, rather than passing the correct value around. This makes it hard to specify a different module cache path when debugging a a test. This patch reworks how we determine and pass around the module cache paths and fixes the omission on the lit side. It also adds a sanity check to the lit and dotest suites. Differential revision: https://reviews.llvm.org/D66966 llvm-svn: 370394
* [dotest] Remove -q (quiet) flag.Jonas Devlieghere2019-08-281-1/+1
| | | | | | | | | | | | | | This patch removes the -q (quiet) flag and changing the default behavior. Currently the flag serves two purposes that are somewhat contradictory, as illustrated by the difference between the argument name (quiet) and the configuration flag (parsable). On the one hand it reduces output, but on the other hand it prints more output, like the result of individual tests. My proposal is to guard the extra output behind the verbose flag and always print the individual test results. Differential revision: https://reviews.llvm.org/D66837 llvm-svn: 370226
* [TableGen] Move helpers into LLDBTableGenUtils.Jonas Devlieghere2019-07-316-28/+62
| | | | | | | Instead of polluting the LLDBTableGenBackends header with helpers used by both emitters, move them into a separate files. llvm-svn: 367377
* [TableGen] Include vectorJonas Devlieghere2019-07-311-0/+1
| | | | | | Fixes "no member named 'vector' in namespace 'std'" compile error. llvm-svn: 367375
* [TableGen] Reuse typedef across emitters (NFC)Jonas Devlieghere2019-07-303-18/+14
| | | | | | | This moves the std::map typedef into the header so it can be reused by all the emitter implementations. llvm-svn: 367363
* [lldb] Also include the array definition in Properties.incJonas Devlieghere2019-07-291-0/+3
| | | | | | | | | | | | | | | | Right now our Properties.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the Properties.inc generate it alongside the initializers. Unfortunately we cannot do the same for enums, as there's this magic ePropertyExperimental, which needs to come at the end to be interpreted correctly. Hopefully we can get rid of this in the future and do the same for the property enums. Differential revision: https://reviews.llvm.org/D65353 llvm-svn: 367238
* [lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitterRaphael Isemann2019-07-291-42/+80
| | | | | | | | Splitting the different logic is cleaner and we it will be easier to implement the enum emitting (which otherwise would have to reimplement the Record parsing). llvm-svn: 367207
* [lldb] Also include the array definition in CommandOptions.incRaphael Isemann2019-07-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Right now our CommandOptions.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the CommandOptions.inc generate it alongside the initializers. This patch will also allow us to generate additional declarations related to that option list in the future (e.g. a enum class representing the specific options which would make our handling code less prone). This patch also fixes a few option tables that didn't follow our naming style. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65331 llvm-svn: 367186
* [lldb] Don't dynamically allocate the posix option validator.Raphael Isemann2019-07-261-1/+7
| | | | | | | | We dynamically allocate the option validator which means we can't mark this list of OptionDefinitions as constexpr. It's also more complicated than necessary. llvm-svn: 367102
* [Tablegen] Fix issues caused by incorrect escaping.Jonas Devlieghere2019-07-251-2/+2
| | | | | | | | The printEscapedString would escape newlines by their ASCII values instead of prefixing them with a `\`. Remove the escaping logic and escape the strings in the definition file. llvm-svn: 367065
* Let tablegen generate property definitionsJonas Devlieghere2019-07-254-8/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | Property definitions are currently defined in a PropertyDefinition array and have a corresponding enum to index in this array. Unfortunately this is quite error prone. Indeed, just today we found an incorrect merge where a discrepancy between the order of the enum values and their definition caused the test suite to fail spectacularly. Tablegen can streamline the process of generating the property definition table while at the same time guaranteeing that the enums stay in sync. That's exactly what this patch does. It adds a new tablegen file for the properties, building on top of the infrastructure that Raphael added recently for the command options. It also introduces two new tablegen backends: one for the property definitions and one for their corresponding enums. It might be worth mentioning that I generated most of the tablegen definitions from the existing property definitions, by adding a dump method to the struct. This seems both more efficient and less error prone that copying everything over by hand. Only Enum properties needed manual fixup for the EnumValues and DefaultEnumValue fields. Differential revision: https://reviews.llvm.org/D65185 llvm-svn: 367058
* [TableGen] Fix comments/headers referencing clang (NFC)Jonas Devlieghere2019-07-253-6/+7
| | | | | | | Remove references to clang's TableGen implementation. Presumably these files were originally copied over. llvm-svn: 366982
* [lldb] Fix enum value descriptionJonas Devlieghere2019-07-231-1/+1
| | | | llvm-svn: 366863
* [utils] Remove sync-source (with SVN)Jonas Devlieghere2019-07-237-646/+0
| | | | llvm-svn: 366833
* [Utils] Add back utils directoryJonas Devlieghere2019-07-2345-0/+6808
| | | | | | | Due to a bug my earlier commit removed the whole utils directory: https://reviews.llvm.org/D65123 llvm-svn: 366830
* [Utils] Remove legacy scriptsJonas Devlieghere2019-07-2347-6978/+0
| | | | | | | As pointed out by Nathan in D65155, these scrips don't seem to serve any real need anymore. llvm-svn: 366827
* [lldb][NFC] Tablegenify breakpointRaphael Isemann2019-07-221-3/+5
| | | | llvm-svn: 366673
* [lldb] Don't double emit option groupsRaphael Isemann2019-07-181-1/+0
| | | | | | | | | We currently emit the option groups twice if Groups<[1,2,3]> is used in the tablegen. This leads to compilation errors. This patch just removes the line that accidentially emits the option group a second time. llvm-svn: 366414
* Only build lldb-tblgen if it's not a current targetNathan Lanza2019-07-181-7/+13
| | | | | | | | | | | | | | | Summary: When doing standalone builds, you could potentially be building against an llvm which also built lldb. If this were the case, you'd be attempting to build this target twice. Reviewers: xiaobai Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D64847 llvm-svn: 366394
* [lldb] Let table gen create command option initializers.Raphael Isemann2019-07-124-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have man large arrays containing initializers for our command options. These tables are tricky maintain as we don't have any good place to check them for consistency and it's also hard to read (`nullptr, {}, 0` is not very descriptive). This patch fixes this by letting table gen generate those tables. This way we can have a more readable syntax for this (especially for all the default arguments) and we can let TableCheck check them for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.). Also refactoring the related data structures can now be done without changing the hundred of option initializers. For example, this line: ``` {LLDB_OPT_SET_ALL, false, "hide-aliases", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."}, ``` becomes this: ``` def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">; ``` For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other option initializers tables in separate patches. Reviewers: JDevlieghere, davide, sgraenitz Reviewed By: JDevlieghere Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D64365 llvm-svn: 365908
* [CMake] Fix lldb-dotest for single-config generators in standalone buildsStefan Granitz2019-06-131-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D62859 llvm-svn: 363279
* [CMake] Add special case for processing LLDB_DOTEST_ARGSStefan Granitz2019-06-071-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Allow to run the test suite when building LLDB Standalone with Xcode against a provided LLVM build-tree that used a single-configuration generator like Ninja. So far both test drivers, lit-based `check-lldb` as well as `lldb-dotest`, were looking for test dependencies (clang/dsymutil/etc.) in a subdirectory with the configuration name (Debug/Release/etc.). It was implicitly assuming that both, LLDB and the provided LLVM used the same generator. In practice, however, the opposite is quite common: build the dependencies with Ninja and LLDB with Xcode for development*. With this patch it becomes the default. (* In fact, it turned out that the Xcode<->Xcode variant didn't even build out of the box. It's fixed since D62879) Once this is sound, I'm planning the following steps: * add stage to the [lldb-cmake-standalone bot](http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone/) to build and test it * update `Building LLDB with Xcode` section in the docs * bring the same mechanism to swift-lldb * fade out the manually maintained Xcode project On macOS build and test like this: ``` $ git clone https://github.com/llvm/llvm-project.git /path/to/llvm-project $ cd /path/to/lldb-dev-deps $ cmake -GNinja -C/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi" /path/to/llvm-project/llvm $ ninja $ cd /path/to/lldb-dev-xcode $ cmake -GXcode -C/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake -DLLDB_BUILD_FRAMEWORK=Off -DLLVM_DIR=/path/to/lldb-dev-deps/lib/cmake/llvm -DClang_DIR=/path/to/lldb-dev-deps/lib/cmake/clang /path/to/llvm-project/lldb $ xcodebuild -configuration Debug -target check-lldb $ xcodebuild -configuration Debug -target lldb-dotest $ ./Debug/bin/lldb-dotest ``` Reviewers: JDevlieghere, jingham, xiaobai, stella.stamenova, labath Reviewed By: stella.stamenova Subscribers: labath, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62859 llvm-svn: 362803
* [CMake] Folder structure for generated Xcode project to cover more targetsStefan Granitz2019-05-282-0/+2
| | | | llvm-svn: 361799
* [lldb] [lit] Add tests for reading ZMM registers (AVX512)Michal Gorny2019-04-291-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D61212 llvm-svn: 359439
* [lldb] [lit] Add register read tests for YMM registers (AVX)Michal Gorny2019-04-261-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D61074 llvm-svn: 359304
* [lldb] [lit] Add feature flags for native CPU featuresMichal Gorny2019-04-262-0/+38
| | | | | | | | | | | | Add a new lit-cpuid tool that detects CPU features used by some of the tests, and use it to populate available_features in lit. For now, this means that the test for MM/XMM register read will be run only when the host CPU support SSE instruction set. However, this is going to make it possible to introduce additional tests relying on AVX. Differential Revision: https://reviews.llvm.org/D61073 llvm-svn: 359303
* [lldb-dotest] Print dotest.py invocation.Jonas Devlieghere2019-04-031-0/+1
| | | | | | | | In order to debug a failing python test, you need to debug Python instead of the wrapper. For a while I've been adding and removing this, but I think it could be useful for everyone. llvm-svn: 357554
* Python 2/3 compat: StringIOSerge Guelton2019-03-256-17/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D59582 llvm-svn: 356910
* Python 2/3 compat: queue vs QueueSerge Guelton2019-03-252-4/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D59590 llvm-svn: 356906
* Python 2/3 compatibility: from __future__ import print_functionSerge Guelton2019-03-2114-78/+99
| | | | | | Differential Revision: https://reviews.llvm.org/D59580 llvm-svn: 356695
* Use list comprehension instead of map/filter to prepare Python2/3 compatSerge Guelton2019-03-212-10/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D59579 llvm-svn: 356647
* Use sys.executable in lldb-dotestPavel Labath2019-02-151-1/+1
| | | | | | | | | | | Without that, dotest.py would be executed with the default python interpreter, which may not be the same one that lldb is built with. This still requires the user do know which python interpreter to use when running lldb-dotest, but now he is at least able to choose it, if he knows which one to use. llvm-svn: 354105
* Adjust documentation for git migration.James Y Knight2019-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes most references to the paths: llvm.org/svn/ llvm.org/git/ llvm.org/viewvc/ github.com/llvm-mirror/ github.com/llvm-project/ reviews.llvm.org/diffusion/ to instead point to https://github.com/llvm/llvm-project. This is *not* a trivial substitution, because additionally, all the checkout instructions had to be migrated to instruct users on how to use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of checking out various projects into various subdirectories. I've attempted to not change any scripts here, only documentation. The scripts will have to be addressed separately. Additionally, I've deleted one document which appeared to be outdated and unneeded: lldb/docs/building-with-debug-llvm.txt Differential Revision: https://reviews.llvm.org/D57330 llvm-svn: 352514
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1911-44/+33
| | | | | | | | | | | | | | | | | 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
* Fix typos.Bruce Mitchener2018-10-041-1/+1
| | | | | | | | | | Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
* [CMake] Unify and relayer testingJonas Devlieghere2018-05-032-0/+38
| | | | | | | | | | | | | | | | | | | | | | | This patch restructures part of LLDB's testing configuration: 1. I moved the test dependencies up the chain so every dotest dependency becomes a lit dependency as well. It wouldn't make sense for dotest to have other dependencies when it's being run by lit. Lit on the other hand can still specify extra dependencies. 2. I replaced as much generator expressions with variables as possible. This is consistent with the rest of LLVM and doesn't break generators that support multiple targets (MSVC, Xcode). This wasn't a problem before, but now we need to expand the dotest arguments in the lit configuration and there's only one test suite even with multiple targets. 3. I moved lldb-dotest into it's own directory under utils since there's no need anymore for it to located under `test/`. Differential revision: https://reviews.llvm.org/D46334 llvm-svn: 331463
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0629-2292/+2779
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Python 3: Modernize exception raising syntax.Zachary Turner2015-11-031-1/+1
| | | | | | | | | | Old-style: `raise foo, bar` New-style: `raise foo(bar)` These two statements are equivalent, but the former is an error in Python 3. llvm-svn: 251977
* syncsource.py: a specific dir's source_excludes may now include the special ↵Todd Fiala2015-10-081-1/+10
| | | | | | | | | | entry "<no-defaults>". The <no-defaults> special entry will prevent that specific directory's excludes from receiving the global default source excludes. This allows overriding the global default in a specific instance, simplifying the syntax for that case. llvm-svn: 249705
* Adjustments to syncsource.py.Todd Fiala2015-09-173-13/+13
| | | | | | | | | | | - renamed sync-source.py to syncsource.py to appease pylint. - added missing lib/transfer/__init__.py file. Fumble from git to svn. - adjusted README to call sync-source.py syncsource.py, and call .sync-sourcerc .syncsourcerc. - marked syncsource.py as executable by all. llvm-svn: 247922
* Add sync-source.py utility.Todd Fiala2015-09-176-0/+634
| | | | | | | | | | | | See: http://reviews.llvm.org/D12940 for more details. See utils/sync-source/README.txt for documentation and a sample .sync-sourcerc file. llvm-svn: 247903
* LUI: Fix some issues causing crashes in the source viewWei Pan2013-10-231-26/+8
| | | | llvm-svn: 193217
OpenPOWER on IntegriCloud