aboutsummaryrefslogtreecommitdiff
path: root/lldb/utils
AgeCommit message (Collapse)AuthorFilesLines
2019-10-25[TableGen] Add asserts to make sure default values match property typeJonas Devlieghere1-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.
2019-10-09[utils] Update lldb-dotest for new test layoutJonas Devlieghere1-1/+1
The path to dotest.py changed after the test directory reorganization. llvm-svn: 374215
2019-10-08[CMake] Track test dependencies with add_lldb_test_dependencyJonas Devlieghere1-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
2019-10-05Do not install lit-cpuidSylvestre Ledru1-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
2019-08-29[test] Fix various module cache bugs and inconsistenciesJonas Devlieghere1-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
2019-08-28[dotest] Remove -q (quiet) flag.Jonas Devlieghere1-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
2019-07-31[TableGen] Move helpers into LLDBTableGenUtils.Jonas Devlieghere6-28/+62
Instead of polluting the LLDBTableGenBackends header with helpers used by both emitters, move them into a separate files. llvm-svn: 367377
2019-07-31[TableGen] Include vectorJonas Devlieghere1-0/+1
Fixes "no member named 'vector' in namespace 'std'" compile error. llvm-svn: 367375
2019-07-30[TableGen] Reuse typedef across emitters (NFC)Jonas Devlieghere3-18/+14
This moves the std::map typedef into the header so it can be reused by all the emitter implementations. llvm-svn: 367363
2019-07-29[lldb] Also include the array definition in Properties.incJonas Devlieghere1-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
2019-07-29[lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitterRaphael Isemann1-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
2019-07-28[lldb] Also include the array definition in CommandOptions.incRaphael Isemann1-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
2019-07-26[lldb] Don't dynamically allocate the posix option validator.Raphael Isemann1-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
2019-07-25[Tablegen] Fix issues caused by incorrect escaping.Jonas Devlieghere1-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
2019-07-25Let tablegen generate property definitionsJonas Devlieghere4-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
2019-07-25[TableGen] Fix comments/headers referencing clang (NFC)Jonas Devlieghere3-6/+7
Remove references to clang's TableGen implementation. Presumably these files were originally copied over. llvm-svn: 366982
2019-07-23[lldb] Fix enum value descriptionJonas Devlieghere1-1/+1
llvm-svn: 366863
2019-07-23[utils] Remove sync-source (with SVN)Jonas Devlieghere7-646/+0
llvm-svn: 366833
2019-07-23[Utils] Add back utils directoryJonas Devlieghere45-0/+6808
Due to a bug my earlier commit removed the whole utils directory: https://reviews.llvm.org/D65123 llvm-svn: 366830
2019-07-23[Utils] Remove legacy scriptsJonas Devlieghere47-6978/+0
As pointed out by Nathan in D65155, these scrips don't seem to serve any real need anymore. llvm-svn: 366827
2019-07-22[lldb][NFC] Tablegenify breakpointRaphael Isemann1-3/+5
llvm-svn: 366673
2019-07-18[lldb] Don't double emit option groupsRaphael Isemann1-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
2019-07-18Only build lldb-tblgen if it's not a current targetNathan Lanza1-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
2019-07-12[lldb] Let table gen create command option initializers.Raphael Isemann4-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
2019-06-13[CMake] Fix lldb-dotest for single-config generators in standalone buildsStefan Granitz1-1/+5
Differential Revision: https://reviews.llvm.org/D62859 llvm-svn: 363279
2019-06-07[CMake] Add special case for processing LLDB_DOTEST_ARGSStefan Granitz1-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
2019-05-28[CMake] Folder structure for generated Xcode project to cover more targetsStefan Granitz2-0/+2
llvm-svn: 361799
2019-04-29[lldb] [lit] Add tests for reading ZMM registers (AVX512)Michal Gorny1-0/+2
Differential Revision: https://reviews.llvm.org/D61212 llvm-svn: 359439
2019-04-26[lldb] [lit] Add register read tests for YMM registers (AVX)Michal Gorny1-0/+2
Differential Revision: https://reviews.llvm.org/D61074 llvm-svn: 359304
2019-04-26[lldb] [lit] Add feature flags for native CPU featuresMichal Gorny2-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
2019-04-03[lldb-dotest] Print dotest.py invocation.Jonas Devlieghere1-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
2019-03-25Python 2/3 compat: StringIOSerge Guelton6-17/+16
Differential Revision: https://reviews.llvm.org/D59582 llvm-svn: 356910
2019-03-25Python 2/3 compat: queue vs QueueSerge Guelton2-4/+10
Differential Revision: https://reviews.llvm.org/D59590 llvm-svn: 356906
2019-03-21Python 2/3 compatibility: from __future__ import print_functionSerge Guelton14-78/+99
Differential Revision: https://reviews.llvm.org/D59580 llvm-svn: 356695
2019-03-21Use list comprehension instead of map/filter to prepare Python2/3 compatSerge Guelton2-10/+10
Differential Revision: https://reviews.llvm.org/D59579 llvm-svn: 356647
2019-02-15Use sys.executable in lldb-dotestPavel Labath1-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
2019-01-29Adjust documentation for git migration.James Y Knight1-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
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth11-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
2018-10-04Fix typos.Bruce Mitchener1-1/+1
Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
2018-05-03[CMake] Unify and relayer testingJonas Devlieghere2-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
2016-09-06*** This commit represents a complete reformatting of the LLDB source codeKate Stone29-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
2015-11-03Python 3: Modernize exception raising syntax.Zachary Turner1-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
2015-10-08syncsource.py: a specific dir's source_excludes may now include the special ↵Todd Fiala1-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
2015-09-17Adjustments to syncsource.py.Todd Fiala3-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
2015-09-17Add sync-source.py utility.Todd Fiala6-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
2013-10-23LUI: Fix some issues causing crashes in the source viewWei Pan1-26/+8
llvm-svn: 193217
2013-10-16lui: enable tab completion in command windowSriram Murali1-2/+21
llvm-svn: 192814
2013-10-16prevent lui from crashing with small source filesSriram Murali1-3/+5
llvm-svn: 192811
2013-10-16A couple of small visual improvements for luiBen Langmuir1-2/+2
Change titles to white rather than green text to improve readability on blue background, and use erase() instead of clear() to reduce flicker in the source window. llvm-svn: 192768
2013-10-16lui: clean up breakpoint window, and allow multi-line list itemsBen Langmuir2-12/+79
* Clean the SBBreakpoint: id = out of the output * clamp output to window width (eventually we should be able to scroll left/right) * On 'tab', expand a breakpoint to show its locations * Allow enter/space to toggle breakpoints llvm-svn: 192766