summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* Update the vFile:open: description to note that the flagsJason Molenda2018-12-152-1/+5
| | | | | | | | | | in the packet are lldb enum values, not the open(2) oflags -- forgot about that wrinkle. Also added a comment to File.h noting that the existing values cannot be modified or we'll have a compatibilty break with any alternative platform implementations, or older versions of lldb-server. llvm-svn: 349282
* lldb-test: Improve newline handlingPavel Labath2018-12-153-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously lldb-test's LinePrinter would output the indentation spaces even on completely empty lines. This is not nice, as trailing spaces get flagged as errors in some tools/editors, and it prevents FileCheck's CHECK-EMPTY from working. Equally annoying was the fact that the LinePrinter did not terminate it's output with a newline (instead it would leave the unterminated hanging indent from the last NewLine() command), which meant that the shell prompt following the lldb-test command came out wrong. This fixes both issues by changing how newlines are handled. NewLine(), which was ending the previous line ('\n') *and* begging the next line by printing the indent, is now "demoted" to just printing literal "\n". Instead, lines are now delimited via a helper Line object, which makes sure the line is indented and terminated in an RAII fashion. The typical usage would be: Printer.line() << "This text will be indented and terminated"; If one needs to do more work than it will fit into a single statement, one can also assign the result of the line() function to a local variable. The line will then be terminated when that object goes out of scope. Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D55597 llvm-svn: 349269
* ELF: more section creation cleanupPavel Labath2018-12-159-73/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch attempts to move as much code as possible out of the CreateSections function to make room for future improvements there. Some of this may be slightly over-engineered (VMAddressProvider), but I wanted to keep the logic of this function very simple, because once I start taking segment headers into acount (as discussed in D55356), the function is going to grow significantly. While in there, I also added tests for various bits of functionality. This should be NFC, except that I changed the order of hac^H^Heuristicks for determining section type slightly. Previously, name-based deduction (.symtab -> symtab) would take precedence over type-based (SHT_SYMTAB -> symtab) one. In fact we would assert if we ran into a .text section with type SHT_SYMTAB. Though unlikely to matter in practice, this order seemed wrong to me, so I have inverted it. Reviewers: clayborg, krytarowski, espindola Subscribers: emaste, arichardson, lldb-commits Differential Revision: https://reviews.llvm.org/D55706 llvm-svn: 349268
* Remove /proc/pid/maps parsing code from NativeProcessLinuxPavel Labath2018-12-151-101/+18
| | | | | | A utility function doing this was added in r349182, so use that instead. llvm-svn: 349267
* Ah, forgot qModuleInfo. Need to look that one upJason Molenda2018-12-151-0/+11
| | | | | | and finish filling this in. llvm-svn: 349232
* A brief outline of the packets that need to be implementedJason Molenda2018-12-151-0/+375
| | | | | | | | | | to write an lldb platform server that doesn't link against LLDB.framework to be able to fully run the lldb testsuite on a remote system. The platform packets weren't covered in the existing lldb-gdb-remote.txt doc, so I wanted to jot them down in one place. llvm-svn: 349231
* Simplify Boolean expressionsJonas Devlieghere2018-12-15177-1018/+599
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* Fix the unittests for the move of Listener & BroadcasterJim Ingham2018-12-141-2/+2
| | | | | | from Core to Utility. llvm-svn: 349211
* Update a comment according to r255360 "Remove -r and -R options from dotest.py"Tatyana Krasnukha2018-12-141-2/+1
| | | | llvm-svn: 349208
* Remove the Disassembly benchmarks.Adrian Prantl2018-12-143-355/+0
| | | | | | | | | | | | While I was out hunting for remaining pexpect-based tests, I came across these tests that can't possibly work an any modern system, as they rely on having gdb available in /Developer. This patch simply removes the test without replacement. Differential Revision: https://reviews.llvm.org/D55559 llvm-svn: 349194
* Add missing .dmp files to test inputs.Greg Clayton2018-12-141-0/+3
| | | | llvm-svn: 349183
* Cache memory regions in ProcessMinidump and use the linux maps as the source ↵Greg Clayton2018-12-1413-106/+456
| | | | | | | | | | | | | | | | | | | | | | | of the information if available Breakpad creates minidump files that sometimes have: - linux maps textual content - no MemoryInfoList Right now unless the file has a MemoryInfoList we get no region information. This patch: - reads and caches the memory region info one time and sorts it for easy subsequent access - get the region info from the best source in this order: - linux maps info (if available) - MemoryInfoList (if available) - MemoryList or Memory64List - returns memory region info for the gaps between regions (before the first and after the last) Differential Revision: https://reviews.llvm.org/D55522 llvm-svn: 349182
* Fix Xcode project for MIPS architecture plug-in and move of Event, Listener ↵Greg Clayton2018-12-141-18/+41
| | | | | | and Broadcaster to Utility. llvm-svn: 349180
* [NativePDB] Fix local-variables.cpp test.Zachary Turner2018-12-141-1/+1
| | | | | | | | Since we're actually running an executable on the host now, different versions of Windows could load different system libraries, so we need to regex out the number of loaded modules. llvm-svn: 349175
* Move Broadcaster+Listener+Event combo from Core into UtilityPavel Labath2018-12-1441-74/+74
| | | | | | | | | | | | | | | | | | Summary: These are general purpose "utility" classes, whose functionality is not debugger-specific in any way. As such, I believe they belong in the Utility module. This doesn't break any particular dependency (yet), but it reduces the number of Core dependencies across the board. Reviewers: zturner, jingham, teemperor, clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D55361 llvm-svn: 349157
* Fix minidump unit test failures from r349062Pavel Labath2018-12-141-9/+12
| | | | | | | | | This commit added new test inputs, but it did not add them to the cmake files. This caused the test to fail at runtime. While in there, I also sorted the list of minidump test inputs. llvm-svn: 349154
* Fix build with older (<3.0) swigsPavel Labath2018-12-141-0/+6
| | | | | | | | | | | It turns out it wasn't the compilers, but swig who had issues with my previous patch -- older versions do not recognise the "constexpr" keyword. Fortunately, that can be fixed the same way we fix all other swig incompatibilities: #ifndef SWIG. llvm-svn: 349153
* Mark Permissions as a bitmask enumPavel Labath2018-12-141-3/+4
| | | | | | | | | | | | | | | | this allows one to use bitwise operators on the variables of this type without complicated casting. The gotcha here is that the combinations of these enums were being used in some constexpr contexts such as case labels (case ePermissionsWritable | ePermissionsExecutable:), which is not possible if the user-defined operator| is not constexpr. So, this commit also marks these operators as constexpr. I am committing this as a small standalone patch so it can be easily reverted if some compiler has an issue with this. llvm-svn: 349149
* Remove unused variable.Richard Trieu2018-12-141-1/+0
| | | | llvm-svn: 349128
* Fix test failures that depended on module orderGreg Clayton2018-12-142-24/+24
| | | | llvm-svn: 349122
* [NativePDB] Add support for local variables.Zachary Turner2018-12-138-71/+1104
| | | | | | | | | This patch adds support for parsing and evaluating local variables. using the native pdb plugin. Differential Revision: https://reviews.llvm.org/D55575 llvm-svn: 349067
* Fix MinidumpParser::GetFilteredModuleList() and test itGreg Clayton2018-12-134-19/+66
| | | | | | | | | | The MinidumpParser::GetFilteredModuleList() code was attempting to iterate through the entire module list and if it found more than one entry for a given module name, it wanted to pick the MinidumpModule with the lowest address. A bug existed where it wasn't doing that due to "exists" variable being inverted. "exists" was set to true if it was inserted, not if it existed. Furthermore, the order of the modules would be modified by sorting all modules from low address to high address (using MinidumpModule::base_of_image). This fix also maintains the original order which means your executable is at index 0 as intended instead of some random shared library. Tests were added to ensure this functionality doesn't regress. Differential Revision: https://reviews.llvm.org/D55614 llvm-svn: 349062
* Add missing Initialize/Terminate for Architecture pluginsTatyana Krasnukha2018-12-131-0/+6
| | | | llvm-svn: 349036
* Classify tests in lit/ModulesPavel Labath2018-12-139-0/+0
| | | | | | | | We've recently developed a convention where the tests are placed into subfolders according to the object file type. This applies that convention to existing tests too. llvm-svn: 349027
* Fix for clang interface updateMikael Nilsson2018-12-131-1/+1
| | | | | | | | | FunctionProtoType.TypeQuals is now a Qualifiers object instead of an integer. The related clang commit: r349019 llvm-svn: 349020
* [NFC] Small code cleanups in utility.Jonas Devlieghere2018-12-136-11/+9
| | | | | | Fix a few small annoyances in Utility I ran into. llvm-svn: 348996
* NFC: fix compiler warning about code never being executed when compiling on ↵Greg Clayton2018-12-121-3/+4
| | | | | | non windows platform. llvm-svn: 348951
* [ast] CreateParameterDeclaration should use an appropriate DeclContext.Zachary Turner2018-12-125-9/+12
| | | | | | | | | | | | | | | | | | Previously CreateParameterDeclaration was always using the translation unit DeclContext. We would later go and add parameters to the FunctionDecl, but internally clang makes a copy when you do this, and we'd end up with ParmVarDecl's at the global scope as well as in the function scope. This fixes the issue. It's hard to say whether this will introduce a behavioral change in name lookup, but I know there have been several hacks introduced in previous years to deal with collisions between various types of variables, so there's a chance that this patch could obviate one of those hacks. Differential Revision: https://reviews.llvm.org/D55571 llvm-svn: 348941
* ELF: Clean up section type computationPavel Labath2018-12-126-160/+82
| | | | | | | | | | | | | Move code into a separate function, and replace the if-else chain with llvm::StringSwitch. A slight behavioral change is that now I use the section flags (SHF_TLS) instead of the section name to set the thread-specific property. There is no explanation in the original commit introducing this (r153537) as to why that was done this way, but the new behavior should be more correct. llvm-svn: 348936
* ELF: Simplify program header iterationPavel Labath2018-12-124-98/+59
| | | | | | | | | | | | | Instead of GetProgramHeaderCount+GetProgramHeaderByIndex, expose an ArrayRef of all program headers, to enable range-based iteration. Instead of GetSegmentDataByIndex, expose GetSegmentData, taking a program header (reference). This makes the code simpler by enabling range-based loops and also allowed to remove some null checks, as it became locally obvious that some pointers can never be null. llvm-svn: 348928
* lldb-test: Add ability to dump subsectionsPavel Labath2018-12-122-20/+138
| | | | | | | | Previously, lldb-test would only print top-level sections. However, in lldb, sections can contain other sections. This teaches lldb-test to print nested sections too. llvm-svn: 348924
* build.py: Implement "gcc" builderPavel Labath2018-12-125-53/+114
| | | | | | | | | | | | | | | | Summary: This implements the gcc builder in build.py script to allow it to compile host executables when running on a non-windows host. Where it made sense, I tried to share code with the msvc builder by moving stuff to the base class. Reviewers: zturner Subscribers: mehdi_amini, dexonsmith, lldb-commits Differential Revision: https://reviews.llvm.org/D55430 llvm-svn: 348918
* Remove unused fileJonas Devlieghere2018-12-111-19/+0
| | | | | | | I removed the dotest-style reproducer test but forgot to delete the source file. Thanks Jim for the heads up! llvm-svn: 348901
* [Driver] Simplify OptionData. NFCJonas Devlieghere2018-12-112-68/+36
| | | | | | | | | | | | | Hopefully this makes the option data easier to understand and maintain. - Group the member variables. - Do the initialization in the header as it's less error prone. - Rename the Clean method. It was called only once and was re-initializing some but not all (?) members. The only useful thing it does is dealing with the local lldbinit file so keep that and make the name reflect that. llvm-svn: 348894
* Add ObjectFileBreakpad.{cpp,h} to the Xcode project.Jim Ingham2018-12-111-0/+14
| | | | llvm-svn: 348890
* Rename ObjectFile::GetHeaderAddress to GetBaseAddressPavel Labath2018-12-119-47/+45
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This function was named such because in the case of MachO files, the mach header is located at this address. However all (most?) usages of this function were not interested in that fact, but the fact that this address is used as the base address for expressing various relative addresses in the object file. For other object file formats, this name is not appropriate (and it's probably the reason why this function was not implemented in these classes). In the ELF case the ELF header will usually end up at this address, but this is a result of the linker optimizing the file layout and not a requirement of the spec. For COFF files, I believe the is no header located at this address either. Reviewers: clayborg, jasonmolenda, amccarth, lemo, stella.stamenova Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D55422 llvm-svn: 348849
* Fix undefined behavior in Variable.hZachary Turner2018-12-111-1/+2
| | | | | | | | | | | | m_loc_is_constant_data was uninitialized, so unless someone explicitly called SetLocIsConstantData(), this would be UB. I think every existing call-site would always call the proper function to initialize the value, so there were no existing bugs, but I encountered this when I tried to use it without calling this function and encountered this. llvm-svn: 348813
* [DataFormatters] Fixes to libc++ std::function formatter to deal with ABI ↵Shafik Yaghmour2018-12-101-0/+9
| | | | | | | | change see https://reviews.llvm.org/D55045 llvm-svn: 348810
* 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
OpenPOWER on IntegriCloud