summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Rewrite pexpect-based test in LIT/FileCheck.Adrian Prantl2018-12-106-119/+36
| | | | | | | pexecpt-based tests are flakey because they involve timeouts and this test is eprfectly serializable. llvm-svn: 348808
* Reflow a multi-line string and add a newlineFrederic Riss2018-12-101-3/+2
| | | | llvm-svn: 348805
* Fix r348773Pavel Labath2018-12-101-1/+1
| | | | | | | It's not sufficient to implement the CreateMemoryInstance function, one has to use it too. llvm-svn: 348780
* [Host] Use FileSystem wrapperJonas Devlieghere2018-12-101-10/+8
| | | | | | | Fixes Host.mm to use the FileSystem class instead of making native calls to check if a file exists. llvm-svn: 348779
* Do not use PATH_MAX with SmallStringStella Stamenova2018-12-109-11/+11
| | | | | | | | | | | | | | Summary: Instead use a more reasonable value to start and rely on the fact that SmallString will resize if necessary. Reviewers: labath, asmith Reviewed By: labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D55457 llvm-svn: 348775
* Re-commit "Introduce ObjectFileBreakpad"Pavel Labath2018-12-1020-1/+558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This re-commits r348592, which was reverted due to a failing test on macos. The issue was that I was passing a null pointer for the "CreateMemoryInstance" callback when registering ObjectFileBreakpad, which caused crashes when attemping to load modules from memory. The correct thing to do is to pass a callback which always returns a null pointer (as breakpad files are never loaded in inferior memory). It turns out that there is only one test which exercises this code path, and it's mac-only, so I've create a new test which should run everywhere (except windows, as one cannot delete an executable which is being run). Unfortunately, this test still fails on linux for other reasons, but at least it gives us something to aim for. The original commit message was: This patch adds the scaffolding necessary for lldb to recognise symbol files generated by breakpad. These (textual) files contain just enough information to be able to produce a backtrace from a crash dump. This information includes: - UUID, architecture and name of the module - line tables - list of symbols - unwind information A minimal breakpad file could look like this: MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 FILE 0 /tmp/a.c FUNC 1010 10 0 _start 1010 4 4 0 1014 5 5 0 1019 5 6 0 101e 2 7 0 PUBLIC 1010 0 _start STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^ STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + STACK CFI 1014 .cfa: $rbp 16 + Even though this data would normally be considered "symbol" information, in the current lldb infrastructure it is assumed every SymbolFile object is backed by an ObjectFile instance. So, in order to better interoperate with the rest of the code (particularly symbol vendors). In this patch I just parse the breakpad header, which is enough to populate the UUID and architecture fields of the ObjectFile interface. The rough plan for followup patches is to expose the individual parts of the breakpad file as ObjectFile "sections", which can then be used by other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary information. Reviewers: clayborg, zturner, lemo, amccarth Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D55214 llvm-svn: 348773
* Revert a hunk that shouldn't have been included in the last commit.Frederic Riss2018-12-091-1/+1
| | | | | | I've seen this line trigger UB, but that's obviously not the correct fix... llvm-svn: 348711
* Remove some UB in RegisterContextDarwin_arm64.cppFrederic Riss2018-12-092-2/+12
| | | | llvm-svn: 348710
* [lit] Fix case-insensitive testStella Stamenova2018-12-071-4/+1
| | | | | | The test still only passes when not run from VS because the previous patch did not remove the original build commands.... This also simplifies the build command by removing some defaults llvm-svn: 348664
* [NativePDB] Reconstruct function declarations from debug info.Zachary Turner2018-12-077-7/+180
| | | | | | | | | | | | Previously we would create an lldb::Function object for each function parsed, but we would not add these to the clang AST. This is a first step towards getting local variable support working, as we first need an AST decl so that when we create local variable entries, they have the proper DeclContext. Differential Revision: https://reviews.llvm.org/D55384 llvm-svn: 348631
* Revert "Introduce ObjectFileBreakpad"Shafik Yaghmour2018-12-0717-502/+1
| | | | | | | | This reverts commit 5e056e624cc57bb22a4c29a70b522783c6242293. Reverting because this lldb cmake bot: http://lab.llvm.org:8080/green/view/LLDB/job/lldb-cmake/13712/ llvm-svn: 348629
* Introduce ObjectFileBreakpadPavel Labath2018-12-0717-1/+502
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the scaffolding necessary for lldb to recognise symbol files generated by breakpad. These (textual) files contain just enough information to be able to produce a backtrace from a crash dump. This information includes: - UUID, architecture and name of the module - line tables - list of symbols - unwind information A minimal breakpad file could look like this: MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 FILE 0 /tmp/a.c FUNC 1010 10 0 _start 1010 4 4 0 1014 5 5 0 1019 5 6 0 101e 2 7 0 PUBLIC 1010 0 _start STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^ STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + STACK CFI 1014 .cfa: $rbp 16 + Even though this data would normally be considered "symbol" information, in the current lldb infrastructure it is assumed every SymbolFile object is backed by an ObjectFile instance. So, in order to better interoperate with the rest of the code (particularly symbol vendors). In this patch I just parse the breakpad header, which is enough to populate the UUID and architecture fields of the ObjectFile interface. The rough plan for followup patches is to expose the individual parts of the breakpad file as ObjectFile "sections", which can then be used by other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary information. Reviewers: clayborg, zturner, lemo, amccarth Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D55214 llvm-svn: 348592
* Add SBInitializerOptions.h to the Xcode project.Jim Ingham2018-12-071-0/+4
| | | | | | | | And mark it as a public header so it will get copied into the LLDB.framework. A handful of "api" tests were failing because they couldn't find this file. llvm-svn: 348561
* Handle detecting exec for DynamicLoaderMacOS with older debugserversJim Ingham2018-12-072-11/+34
| | | | | | | | | | that don't send reason:exec. <rdar://problem/43756823> Differential Revision: https://reviews.llvm.org/D55399 llvm-svn: 348559
* Change the amount of data that Platform::PutFile will try to transferJason Molenda2018-12-071-1/+1
| | | | | | | | | | | | | in one packet from 1k bytes to 16k bytes. Sending a large file to an iOS device directly connected by USB cable, to lldb-server running in platform mode, this speeds up the file xfer by 77%. Sending the file in 32k blocks speeds up the file xfer by 80% versus 1k blocks, starting with 16k to make sure we don't have any problems with android testing. We may not have the same perf characteristics over ethernet, but with USB it's faster to send fewer larger packets than many small packets. llvm-svn: 348557
* Host: remove Yield on WindowsSaleem Abdulrasool2018-12-071-0/+1
| | | | | | | | Windows provides a Yield function-like macro that allows a thread to yield the CPU. However, this conflicts with `Yield` in swift. Undefine `Yield` to allow building lldb with swift support. llvm-svn: 348556
* [lit] Use the build.py script in the case-insensitive testStella Stamenova2018-12-061-2/+3
| | | | | | This makes the test build correctly regardless of whether we use VS or ninja to run the tests llvm-svn: 348544
* [pecoff] Use PATH_MAX instead of MAX_PATHStella Stamenova2018-12-061-1/+1
| | | | | | PATH_MAX is defined on all platforms while MAX_PATH is Windows-specific llvm-svn: 348542
* [pecoff] Implement ObjectFilePECOFF::GetDependedModules()Aaron Smith2018-12-066-11/+504
| | | | | | | | | | | | | | | | | | Summary: This parses entries in pecoff import tables for imported DLLs and is intended as the first step to allow LLDB to load a PE's shared modules when creating a target on the LLDB console. Reviewers: rnk, zturner, aleksandr.urakov, lldb-commits, labath, asmith Reviewed By: labath, asmith Subscribers: labath, lemo, clayborg, Hui, mgorny, mgrang, teemperor Differential Revision: https://reviews.llvm.org/D53094 llvm-svn: 348527
* Implement WindowsDYLD::DidAttach for use with gdb-server attachNathan Lanza2018-12-061-1/+35
| | | | | | | | | | | | | | | Summary: Windows lldb debugging currently uses a process plugin to handle launching and attaching to a process. Launching a process via a debug server (e.g. ds2) and attaching to it with `gdb-remote port` currently doesn't communicate address information of the executable properly. Implement DynamicLoaderWindowsDYLD::DidAttach which allow us to obtain the proper executable load address. Differential Revision: https://reviews.llvm.org/D55383 llvm-svn: 348526
* Fix the Xcode project build for the addition of ↵Jim Ingham2018-12-061-0/+6
| | | | | | NativePDB/DWARFLocationExpression.{h,cpp} llvm-svn: 348519
* Fix line endings in build.pyZachary Turner2018-12-061-1/+1
| | | | llvm-svn: 348514
* [build.py] Embed the output file name in generated object file names.Zachary Turner2018-12-064-20/+30
| | | | | | | | | | | | | | | | | | In compile-and-link mode, the user doesn't specify the name of the object files to generate, because there could be multiple inputs on a single command line and this would be hard to specify. So the script just tries to be smart and figure out the best object file names. However, if two build scripts are running in parallel and using the same source files as input, they would previously race to write the same object files, since the computed name only considered the source file names when computing the object file names. With this patch, we also consider the final executable name. In a way, this "namespaces" the generated object files so that as long as the final executable file names don't clash, the intermediate object file names won't clash either. llvm-svn: 348511
* [PDB] Move some code around. NFC.Zachary Turner2018-12-066-245/+333
| | | | llvm-svn: 348505
* Add another ArchSpec unit test.Adrian Prantl2018-12-061-1/+8
| | | | llvm-svn: 348502
* Support skewed stream arrays.Zachary Turner2018-12-061-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VarStreamArray was built on the assumption that it is backed by a StreamRef, and offset 0 of that StreamRef is the first byte of the first record in the array. This is a logical and intuitive assumption, but unfortunately we have use cases where it doesn't hold. Specifically, a PDB module's symbol stream is prefixed by 4 bytes containing a magic value, and the first byte of record data in the array is actually at offset 4 of this byte sequence. Previously, we would just truncate the first 4 bytes and then construct the VarStreamArray with the resulting StreamRef, so that offset 0 of the underlying stream did correspond to the first byte of the first record, but this is problematic, because symbol records reference other symbol records by the absolute offset including that initial magic 4 bytes. So if another record wants to refer to the first record in the array, it would say "the record at offset 4". This led to extremely confusing hacks and semantics in loading code, and after spending 30 minutes trying to get some math right and failing, I decided to fix this in the underlying implementation of VarStreamArray. Now, we can say that a stream is skewed by a particular amount. This way, when we access a record by absolute offset, we can use the same values that the records themselves contain, instead of having to do fixups. Differential Revision: https://reviews.llvm.org/D55344 llvm-svn: 348499
* Make scripts/analyzer-project-deps compatible with python3Pavel Labath2018-12-061-19/+19
| | | | llvm-svn: 348479
* Remove REQUIRES: darwin from a couple of MachO testsPavel Labath2018-12-062-2/+0
| | | | | | lldb is able to parse MachO files also on other platforms nowadays. llvm-svn: 348476
* disable toolchain-clang-cl.test on non-windowsPavel Labath2018-12-061-1/+1
| | | | | | The recently added test fail on non-windows platforms. llvm-svn: 348474
* Add a unit test for ArchSpec matching to document how it behaves (and test it).Adrian Prantl2018-12-062-2/+52
| | | | llvm-svn: 348440
* [lldbsuite] Disable TestStopPCs when there's no XML supportStella Stamenova2018-12-061-0/+2
| | | | | | The test relies on xml support to setup the correct registers. If there's no XML support, the test is going to fail. llvm-svn: 348435
* [PDB] Make PDB lit tests use the new builderAleksandr Urakov2018-12-0515-44/+33
| | | | | | | | | | | | Reviewers: zturner, stella.stamenova Reviewed By: zturner Tags: #lldb Differential Revision: https://reviews.llvm.org/D54942 llvm-svn: 348386
* [CMake] Fix side-effect from LLDB_VERSION change in r346668 for ↵Stefan Granitz2018-12-052-2/+2
| | | | | | framework-enabled builds llvm-svn: 348360
* gdb-remote: use elaborated type specifier for `Module`Saleem Abdulrasool2018-12-051-2/+2
| | | | | | | | When building with MSVC, the type `Module` is ambiguous due to both the lldb_private and llvm namespaces being used. Use the elaborated type instead to resolve the ambiguity. llvm-svn: 348332
* [build.py] Disable tests on non-Windows.Zachary Turner2018-12-042-0/+4
| | | | | | This won't work until we get the GCC / clang builder implemented. llvm-svn: 348319
* Fix LLDB build script.Zachary Turner2018-12-041-3/+4
| | | | | | | A local patch was omitted from the original commit. This makes the tests pass. llvm-svn: 348314
* [build.py] A few general improvements.Zachary Turner2018-12-048-37/+302
| | | | | | | | | | | | | This makes -mode=compile support multiple inputs (and hence multiple outputs). It also makes the value of -arch for compiling inferiors default to the architecture that LLDB is built in. This can still be overridden however. Differential Revision: https://reviews.llvm.org/D55230 llvm-svn: 348305
* Add SBInitializerOptions.cpp.Jason Molenda2018-12-041-0/+4
| | | | llvm-svn: 348300
* [Reproducers] Only creaate the bottom-most dirJonas Devlieghere2018-12-042-6/+3
| | | | | | | | As Pavel noted on the mailing list we should only create the bottom-most directory if it doesn't exist. This should also fix the test case on Windows as we can use lit's temp directory. llvm-svn: 348289
* [FileSystem] Migrate CommandCompletionsJonas Devlieghere2018-12-044-17/+62
| | | | | | | | Make use of the convenience helpers from FileSystem. Differential revision: https://reviews.llvm.org/D55240 llvm-svn: 348287
* Fix lldb-server unit tests for the MonitoringProcessLauncher refactorPavel Labath2018-12-041-1/+5
| | | | | | We now need to initialize the filesystem in these tests. llvm-svn: 348261
* [Expr] Fix `TestExprOptions` after r348240 on MacOS XAleksandr Urakov2018-12-041-0/+15
| | | | | | | | | | Summary: r348240 assumes that an expression contains the Objective C option if Objective C Runtime is found. But on MacOS X it seems that the test application process always contains Objective C Runtime, so the test fails when it assumes that the language is C++ only. Skip this part on Darwin. llvm-svn: 348250
* [Expr] Check the language before ignoring Objective C keywordsAleksandr Urakov2018-12-044-7/+22
| | | | | | | | | | | | | | | | | | Summary: This patch adds the check of the language before ignoring names like `id` or `Class`, which are reserved in Objective C, but are allowed in C++. It is needed to make it possible to evaluate expressions in a C++ program containing names like `id` or `Class`. Reviewers: jingham, zturner, labath, clayborg Reviewed By: jingham, clayborg Tags: #lldb Differential Revision: https://reviews.llvm.org/D54843 llvm-svn: 348240
* [PlatformDarwin] Simplify logic and use FileSystemJonas Devlieghere2018-12-041-17/+4
| | | | | | Simplify code path by using the FileSystem. llvm-svn: 348232
* [FileSystem] Migrate MonitoringProcessLauncherJonas Devlieghere2018-12-031-10/+5
| | | | | | Use the FileSystem helpers instead of using the file system directly. llvm-svn: 348207
* Skip TestDriverOptions on WindowsJonas Devlieghere2018-12-031-0/+3
| | | | | | | It's not clear to me why this is failing on Windows. Maybe it has something to do with the path? llvm-svn: 348186
* [Reproducers] Change how reproducers are initialized.Jonas Devlieghere2018-12-0340-311/+402
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the way the reproducer is initialized. Rather than making changes at run time we now do everything at initialization time. To make this happen we had to introduce initializer options and their SB variant. This allows us to tell the initializer that we're running in reproducer capture/replay mode. Because of this change we also had to alter our testing strategy. We cannot reinitialize LLDB when using the dotest infrastructure. Instead we use lit and invoke two instances of the driver. Another consequence is that we can no longer enable capture or replay through commands. This was bound to go away form the beginning, but I had something in mind where you could enable/disable specific providers. However this seems like it adds very little value right now so the corresponding commands were removed. Finally this change also means you now have to control this through the driver, for which I replaced --reproducer with --capture and --replay to differentiate between the two modes. Differential revision: https://reviews.llvm.org/D55038 llvm-svn: 348152
* [PDB] Support PDB-backed expressions evaluation (+ fix stuck test)Aleksandr Urakov2018-12-0312-33/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch contains several small fixes, which makes it possible to evaluate expressions on Windows using information from PDB. The changes are: - several sanitize checks; - make IRExecutionUnit::MemoryManager::getSymbolAddress to not return a magic value on a failure, because callers wait 0 in this case; - entry point required to be a file address, not RVA, in the ObjectFilePECOFF; - do not crash on a debuggee second chance exception - it may be an expression evaluation crash. Also fix detection of "crushed" threads in tests; - create parameter declarations for functions in AST to make it possible to call debugee functions from expressions; - relax name searching rules for variables, functions, namespaces and types. Now it works just like in the DWARF plugin; - fix endless recursion in SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc. Reviewers: zturner, asmith, stella.stamenova Reviewed By: stella.stamenova, asmith Tags: #lldb Differential Revision: https://reviews.llvm.org/D53759 llvm-svn: 348136
* [lit] Add a generic build script with a lit substitution.Zachary Turner2018-12-0116-56/+700
| | | | | | | | | | | | | | | | | | | This adds a script called build.py as well as a lit substitution called %build that we can use to invoke it. The idea is that this allows a lit test to build test inferiors without having to worry about architecture / platform specific differences, command line syntax, finding / configurationg a proper toolchain, and other issues. They can simply write something like: %build --arch=32 -o %t.exe %p/Inputs/foo.cpp and it will just work. This paves the way for being able to run lit tests with multiple configurations, platforms, and compilers with a single test. Differential Revision: https://reviews.llvm.org/D54914 llvm-svn: 348058
* [windows] Fix two minor bugs on WindowsStella Stamenova2018-12-012-5/+6
| | | | | | | 1. In ProcessWindows if we fail to allocate memory, we need to return LLDB_INVALID_ADDRESS rather than 0 or nullptr as that is the invalid address that LLDB looks for 2. In RegisterContextWindows in ReadAllRegisterValues, always create a new buffer. This is what the other platforms do and data_sp is always null in all tested scenarios on Windows as well llvm-svn: 348055
OpenPOWER on IntegriCloud