summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [NativePDB] Higher fidelity reconstruction of AST from Debug Info.Zachary Turner2018-11-0810-36/+496
| | | | | | | | | | | | | | | | | | | | | | | | | In order to accurately put a type into the correct location in the AST we construct from debug info, we need to be able to determine what DeclContext (namespace, global, nested class, etc) that it goes into. PDB doesn't contain this mapping. It does, however, contain the reverse mapping. That is, for a given class type T, you can determine all classes Q1, Q2, ..., Qn that are nested inside of T. We need to know, for a given class type Q, what type T is it nested inside of. This patch builds this map as a pre-processing step when we first load the PDB by scanning every type. Initial tests show that while this can be slow in debug builds of LLDB, it is quite fast in release builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen once). Furthermore, having this pre-processing step in place allows us to repurpose it for building up other kinds of indexing to it down the line. For the time being, this gives us very accurate reconstruction of the DeclContext hierarchy. Differential Revision: https://reviews.llvm.org/D54216 llvm-svn: 346429
* Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove ↵Shafik Yaghmour2018-11-088-47/+117
| | | | | | | | | | redundant parameter which can be calculated from other parameter. rdar://problem/43822994 Differential Revision: https://reviews.llvm.org/D54003 llvm-svn: 346428
* [FileSystem] Add convenience method to check for directories.Jonas Devlieghere2018-11-0817-28/+44
| | | | | | | | | | | Replace calls to LLVM's is_directory with calls to LLDB's FileSytem class. For this I introduced a new convenience method that, like the other methods, takes either a path or filespec. This still uses the LLVM functions under the hood. Differential revision: https://reviews.llvm.org/D54135 llvm-svn: 346375
* Re-commit regularization of the lldb-gtest-build target.Jason Molenda2018-11-071-0/+8
| | | | llvm-svn: 346347
* Adjust some id bit shifts to fit inside 32 bit integersNathan Lanza2018-11-074-6/+107
| | | | | | | | | | | | | | | Summary: The DAP on vscode uses a JavaScript `number` for identifiers while the Visual Studio version uses a C# `Int` for identifiers. lldb-vscode is bit shifting identifiers 32 bits and then bitwise ORing another 32 bit identifier into a 64 bit id to form a unique ID. Change this to a a partitioning of the 32 bits that makes sense for the data types. Reviewers: clayborg Differential Revision: https://reviews.llvm.org/D53599 llvm-svn: 346346
* Revert r346285 until I can make it work correctlyJason Molenda2018-11-071-68/+8
| | | | | | the way the bots build lldb. llvm-svn: 346342
* Add a break to avoid an unannotated fall-through.Eric Christopher2018-11-071-0/+1
| | | | llvm-svn: 346294
* Standardize the OTHER_LDFLAGS for the lldb-gtest-build target.Jason Molenda2018-11-071-8/+68
| | | | llvm-svn: 346285
* Compiler warning pointed out a mistake - fix it.Jason Molenda2018-11-071-1/+1
| | | | llvm-svn: 346283
* Remove working directory for debugserver code signing targetNathan Lanza2018-11-061-2/+0
| | | | | | | | | | | | | | | | | | Summary: LLVM puts output binaries in `${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin`. This chunk of code left out the `${CMAKE_CFG_INTDIR}`. Ultimately, the code signing target does not need a working directory anyways, so it's safe to just remove it. Reviewers: sas, xiaobai, beanz Reviewed By: beanz Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D53959 llvm-svn: 346281
* Add MSVCUndecoratedNameParser.cpp.Jason Molenda2018-11-061-0/+6
| | | | llvm-svn: 346278
* [ObjectFile] Prefer reinterpret_cast<>Davide Italiano2018-11-061-2/+2
| | | | llvm-svn: 346247
* [ObjectFileELF] Fix misaligned read/writes caught by UBSan.Davide Italiano2018-11-062-15/+23
| | | | llvm-svn: 346244
* CPlusPlusLanguage: Use new demangler API to implement type substitutionPavel Labath2018-11-062-62/+81
| | | | | | | | | | | | | | | | Summary: Now that llvm demangler supports more generic customization, we can implement type substitution directly on top of this API. This will allow us to remove the specialized hooks which were added to the demangler to support this use case. Reviewers: sgraenitz, erik.pilkington, JDevlieghere Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D54074 llvm-svn: 346233
* Add parens to silence warningBenjamin Kramer2018-11-061-1/+1
| | | | | | MSVCUndecoratedNameParser.cpp:25:36: warning: '&&' within '||' [-Wlogical-op-parentheses] llvm-svn: 346220
* [PDB] Introduce `MSVCUndecoratedNameParser`Aleksandr Urakov2018-11-0611-123/+333
| | | | | | | | | | | | This patch introduces the simple MSVCUndecoratedNameParser. It is needed for parsing names of PDB symbols corresponding to template instantiations. For example, for the name `operator<<A>'::`2'::B::operator> we can't just split the name with :: (as it is implemented for now) to retrieve its scopes. This parser processes such names in a more correct way. Differential Revision: https://reviews.llvm.org/D52461 llvm-svn: 346213
* [TestVLA] Fix a python decorator.Davide Italiano2018-11-061-1/+2
| | | | llvm-svn: 346186
* Adjust the comment section of CreateSource to account for lines longer than 60Nathan Lanza2018-11-051-2/+6
| | | | | | | | | | | | | | | | | | Summary: On rare occasions, the address, instruction and arguments of a line of assembly in the CreateSource printout would reach > 60 characters. The function would integer overflow and try to indent a line by `0xfff...`. Change the calculated offset to be the maximum of 60 or `line_strm.str().size()` Reviewers: clayborg, xiaobai Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D52745 llvm-svn: 346179
* Set stdout/stdin to binary mode on WindowsNathan Lanza2018-11-051-0/+12
| | | | | | | | | | | | | | | | | Summary: A file opened in text mode on Windows will have `\n` automatically changed to `13,10` while Darwin and Linux leave it as `10`. Set the file to binary mode to avoid this automatic conversion so that Darwin, Linux and Windows have equivalent treatment of `\r`. Reviewers: clayborg, xiaobai Reviewed By: clayborg Subscribers: emaste, ki.stfu, mgorny, eraman, JDevlieghere, mgrang Differential Revision: https://reviews.llvm.org/D52672 llvm-svn: 346174
* Skip this test on older versions of clang.Adrian Prantl2018-11-051-0/+1
| | | | llvm-svn: 346172
* Add a relocation to ObjectFileELF::ApplyRelocations and a testNathan Lanza2018-11-054-3/+252
| | | | | | | | | | | | | | | | | | | | | Summary: pcm files can end up being processed by lldb with relocations to be made for the .debug_info section. When a R_AARCH64_ABS64 relocation was required lldb would hit an `assert(false)` and die. Add R_AARCH64_ABS64 relocations to the S+A 64 bit width code path. Add a test for R_AARCH64_ABS64 and R_AARCH64_ABS32 .rela.debug_info relocations in a pcm file. Reviewers: sas, xiaobai, davide, javed.absar, espindola Reviewed By: davide Subscribers: labath, zturner, emaste, mgorny, arichardson, kristof.beyls Differential Revision: https://reviews.llvm.org/D51566 llvm-svn: 346171
* Fix (and improve) the support for C99 variable length array typesAdrian Prantl2018-11-0533-51/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang recently improved its DWARF support for C VLA types. The DWARF now looks like this: 0x00000051: DW_TAG_variable [4] DW_AT_location( fbreg -32 ) DW_AT_name( "__vla_expr" ) DW_AT_type( {0x000000d3} ( long unsigned int ) ) DW_AT_artificial( true ) ... 0x000000da: DW_TAG_array_type [10] * DW_AT_type( {0x000000cc} ( int ) ) 0x000000df: DW_TAG_subrange_type [11] DW_AT_type( {0x000000e9} ( __ARRAY_SIZE_TYPE__ ) ) DW_AT_count( {0x00000051} ) Without this patch LLDB will naively interpret the DIE offset 0x51 as the static size of the array, which is clearly wrong. This patch extends ValueObject::GetNumChildren to query the dynamic properties of incomplete array types. See the testcase for an example: 4 int foo(int a) { 5 int vla[a]; 6 for (int i = 0; i < a; ++i) 7 vla[i] = i; 8 -> 9 pause(); // break here 10 return vla[a-1]; 11 } (lldb) fr v vla (int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3) (lldb) quit rdar://problem/21814005 Differential Revision: https://reviews.llvm.org/D53530 llvm-svn: 346165
* Fix the Xcode project for the removal of the Go, Java & OCamlJim Ingham2018-11-051-186/+0
| | | | | | plugins. llvm-svn: 346162
* Remove OCaml debugger pluginJonas Devlieghere2018-11-0515-1410/+0
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the OCaml debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54060 llvm-svn: 346159
* Remove Java debugger pluginJonas Devlieghere2018-11-0522-2906/+0
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Java debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54059 llvm-svn: 346158
* Remove Go debugger pluginJonas Devlieghere2018-11-0552-9892/+4
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Go debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54057 llvm-svn: 346157
* Properly cast from DeclContext to Decl.Zachary Turner2018-11-052-5/+4
| | | | | | | Apparently there's a special procedure for doing this. Not following this silently breaks builds. llvm-svn: 346156
* Add a target modules dump ast command.Zachary Turner2018-11-0513-10/+140
| | | | | | | | | | This is useful for investigating the clang ast as you reconstruct it via by parsing debug info. It can also be used to write tests against. Differential Revision: https://reviews.llvm.org/D54072 llvm-svn: 346149
* [LLDB] Fix FreeBSD/Darwin buildDavid Carlier2018-11-042-9/+12
| | | | | | | | | | Reviewers: JDevlieghere, tatyana-krasnukha Reviwed By: tatyana-krasnukha Differential Revision: https://reviews.llvm.org/D54084 llvm-svn: 346109
* Fix NetBSD build after "Move path resolution logic out of FileSpec"Kamil Rytarowski2018-11-043-3/+3
| | | | | | D53915 llvm-svn: 346100
* Update framework-header-fix to force system sedDave Lee2018-11-041-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are 2 changes here: 1. Use system sed instead of the sed found in the user's path. This fixes this script in the case the user has gnu-sed in their $PATH before bsd sed since `-i ''` isn't compatible and you need `-i` instead. 2. `set -e` in this script so it fails as soon as one of these commands fail instead of throwing errors for each file if they fail Since this is only ran on macOS, and we're already using this absolute path below, this seems like a safe addition Reviewers: kastiglione, beanz Reviewed By: kastiglione Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D49776 llvm-svn: 346099
* Fix log statement in r346093Pavel Labath2018-11-041-1/+1
| | | | | | Thanks to Dávid Bolvanský for pointing that out. llvm-svn: 346094
* NativeProcessProtocol: Simplify breakpoint setting codePavel Labath2018-11-0414-885/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A fairly simple operation as setting a breakpoint (writing a breakpoint opcode) at a given address was going through three classes: NativeProcessProtocol which called NativeBreakpointList, which then called SoftwareBrekpoint, only to end up again in NativeProcessProtocol to do the actual writing itself. This is unnecessarily complex and can be simplified by moving all of the logic into NativeProcessProtocol class itself, removing a lot of boilerplate. One of the reeasons for this complexity was that (it seems) NativeBreakpointList class was meant to hold both software and hardware breakpoints. However, that never materialized, and hardware breakpoints are stored in a separate map holding only hardware breakpoints. Essentially, this patch makes software breakpoints follow that approach by replacing the heavy SoftwareBraekpoint with a light struct of the same name, which holds only the data necessary to describe one breakpoint. The rest of the logic is in the main class. As, at the lldb-server level, handling software and hardware breakpoints is very different, this seems like a reasonable state of things. Reviewers: krytarowski, zturner, clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D52941 llvm-svn: 346093
* Fix duplicate testcase filenameJan Kratochvil2018-11-041-0/+0
| | | | | | | | | dotest.py started reporting: Exception: Found multiple tests with the name TestSampleTest.py After the commit of: https://reviews.llvm.org/D54056 llvm-svn: 346089
* Test commitNathan Lanza2018-11-031-0/+1
| | | | llvm-svn: 346067
* Fix some windows-specific fallout from the FileSpec change.Zachary Turner2018-11-032-32/+32
| | | | llvm-svn: 346058
* Make sure to have lit load the configured site config first.Zachary Turner2018-11-031-1/+3
| | | | | | | | | | For the lldb unit test suite, we forgot to add the mapping from site config to main config, so when it found the main config in the source tree, it wasn't going and loading the configured version in the build tree first, so the required properties weren't getting set up properly. llvm-svn: 346057
* Add an SBExpressionOptions setting mirroring the "exec" command's --allow-jit.Jim Ingham2018-11-026-0/+138
| | | | | | | | <rdar://problem/44809176> Differential Revision: https://reviews.llvm.org/D54056 llvm-svn: 346053
* [FileSystem] Open File instances through the FileSystem.Jonas Devlieghere2018-11-0219-220/+199
| | | | | | | | | | | This patch modifies how we open File instances in LLDB. Rather than passing a path or FileSpec to the constructor, we now go through the virtual file system. This is needed in order to make things work with the VFS in the future. Differential revision: https://reviews.llvm.org/D54020 llvm-svn: 346049
* Fix the lit test suite.Zachary Turner2018-11-021-0/+3
| | | | | | This change was accidentally missed from the original changeset. llvm-svn: 346046
* Revert "[Symbol] Search symbols with name and type in a symbol file"Davide Italiano2018-11-0210-93/+24
| | | | | | It broke MacOS buildbots. llvm-svn: 346045
* Fix a bug in the lit test suite generation.Zachary Turner2018-11-021-1/+1
| | | | | | | | I'm not sure why this has to be CMAKE_CURRENT_SOURCE_DIR, but it causes all kinds of strange cmake generation errors when it's the binary dir. llvm-svn: 346035
* Refactor the lit configuration filesZachary Turner2018-11-0239-231/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | A year or so ago, I re-wrote most of the lit infrastructure in LLVM so that it wasn't so boilerplate-y. I added lots of common helper type stuff, simplifed usage patterns, and made the code more elegant and maintainable. We migrated to this in LLVM, clang, and lld's lit files, but not in LLDBs. This started to bite me recently, as the 4 most recent times I tried to run the lit test suite in LLDB on a fresh checkout the first thing that would happen is that python would just start crashing with unhelpful backtraces and I would have to spend time investigating. You can reproduce this today by doing a fresh cmake generation, doing ninja lldb and then python bin/llvm-lit.py -sv ~/lldb/lit/SymbolFile at which point you'll get a segfault that tells you nothing about what your problem is. I started trying to fix the issues with bandaids, but it became clear that the proper solution was to just bring in the work I did in the rest of the projects. The side benefit of this is that the lit configuration files become much cleaner and more understandable as a result. Differential Revision: https://reviews.llvm.org/D54009 llvm-svn: 346008
* [FileSystem] Remove `SetFileSystem` method.Jonas Devlieghere2018-11-022-7/+0
| | | | | | | This is no longer relevant with the new way we initialize the FileSystem. llvm-svn: 346003
* [FileSystme] Move ::open abstraction into FileSystem.Jonas Devlieghere2018-11-024-12/+20
| | | | | | | This moves the abstraction around ::open into the FileSystem, as is already the case for ::fopen. llvm-svn: 346002
* [NativePDB] Make tests work on x86 tooAleksandr Urakov2018-11-023-9/+9
| | | | | | | | | | | | | | | Summary: This patch fixes the NativePDB tests to make them work from x86 command line too Reviewers: zturner, stella.stamenova Subscribers: aleksandr.urakov, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D54031 llvm-svn: 345974
* [LLDB] - Add support for DW_FORM_rnglistx and relative DW_RLE_* entries.George Rimar2018-11-027-21/+175
| | | | | | | | | This adds support for DW_RLE_base_addressx, DW_RLE_startx_endx, DW_RLE_startx_length, DW_FORM_rnglistx. Differential revision: https://reviews.llvm.org/D53929 llvm-svn: 345958
* [Symbol] Search symbols with name and type in a symbol fileAleksandr Urakov2018-11-0210-24/+93
| | | | | | | | | | | | | | | | | | | | Summary: This patch adds possibility of searching a public symbol with name and type in a symbol file. It is helpful when working with PE, because PE's symtabs contain only imported / exported symbols only. Such a search is required for e.g. evaluation of an expression that calls some function of the debuggee. Reviewers: zturner, asmith, labath, clayborg, espindola Reviewed By: clayborg Subscribers: emaste, arichardson, aleksandr.urakov, jingham, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D53368 llvm-svn: 345957
* [Windows] Fix Windows build after be053dd5a384a03da5a77552686900ddc7bfc178Aleksandr Urakov2018-11-026-15/+18
| | | | llvm-svn: 345956
* When no FileCheck binary is specified, look in the llvm/clang binJason Molenda2018-11-011-0/+32
| | | | | | | dirs relative to the source directory (Xcode build style) to find one, use it if found. llvm-svn: 345912
OpenPOWER on IntegriCloud