summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove null checks of results of new expressionsPavel Labath2019-07-0115-52/+15
| | | | | | | | operator new doesn't return a null pointer, even if one turns off exceptions (it calls std::terminate instead). Therefore, all of this is dead code. llvm-svn: 364744
* Revert "[GDBRemote] Remove code that flushes GDB remote packets"Jonas Devlieghere2019-06-301-0/+7
| | | | | | | Reverting this again as it doesn't appear to solve the flakiness on the LLDB standalone bot. llvm-svn: 364722
* Replace tabs with spaces.Adrian Prantl2019-06-291-2/+2
| | | | llvm-svn: 364716
* Use const auto *Fangrui Song2019-06-292-7/+7
| | | | llvm-svn: 364702
* Get the expression parser to handle missing weak symbols.Jim Ingham2019-06-2814-40/+269
| | | | | | | | | | MachO only for this patch. Differential Revision: https://reviews.llvm.org/D63914 <rdar://problem/51463642> llvm-svn: 364686
* [GDBRemote] Remove code that flushes GDB remote packetsJonas Devlieghere2019-06-281-7/+0
| | | | | | | | | | | | | | The arbitrary timeout when flushing GDB remote packets caused non-determinism and flakiness between test runs. I suspect it is what's causing the flakiness of the reproducer tests on GreenDragon, and want to see if removing it causes that to go away. This change was originally introduced in r197579 to discard a `$T02thread:01;#4` that QEMU was sending. If anybody knows how to test that this continues working after removing this code, I'd love to hear it. llvm-svn: 364669
* Make sure the thread list is updated before you set the stop reasonJim Ingham2019-06-285-8/+225
| | | | | | | | | | | | | | | on a thread. When talking to some older gdb-remote stubs, We were getting a stop reason from the stop reply packet and setting it on the relevant thread before we updated the full stop list. That would get discarded when the full list was updated. Also, if you already have a thread list when you go to see if there is an Operating System plugin, and you do indeed load a new OS plugin, you have to re-fetch the thread list or it will only show the raw threads. Differential Revision: https://reviews.llvm.org/D62887 llvm-svn: 364666
* Fixing a couple of wrong logical operator bugs.Ali Tamur2019-06-282-2/+2
| | | | llvm-svn: 364614
* Add a sanity check to the domain socket tests.Adrian Prantl2019-06-271-1/+5
| | | | | | rdar://problem/52062631 llvm-svn: 364562
* [lldb] [Plugins/SysV-x86_64] NetBSD is also using SysV ABIMichal Gorny2019-06-271-0/+1
| | | | | | | | | | | Reenable SysV x86_64 ABI usage on NetBSD that was accidentally removed in r364216. This fixes numerous test failures with messages similar to the following: error: Can't run the expression locally: Interpreter doesn't handle one of the expression's opcodes llvm-svn: 364503
* [Reproducers] Fix flakiness and off-by-one during replay.Jonas Devlieghere2019-06-271-6/+25
| | | | | | | | | | | | | | | | | | | | | | | This fixes two replay issues that caused the tests to behave erratically: 1. It fixes an off-by-one error, where all replies where shifted by 1 because of a `+` packet that should've been ignored. 2. It fixes another off-by-one-error, where an asynchronous ^C was offsetting all subsequent packets. The reason is that we 'synchronize' requests and replies. In reality, a stop reply is only sent when the process halt. During replay however, we instantly report the stop, as the reply to packets like continue (vCont). Both packets should be ignored, and indeed, checking the gdb-remote log, no unexpected packets are received anymore. Additionally, be more pedantic when it comes to unexpected packets and return an failure form the replay server. This way we should be able to catch these things faster in the future. llvm-svn: 364494
* Support nested target.xml register definition files, lack of reg group markers.Jason Molenda2019-06-263-60/+326
| | | | | | | | | | | | | | | | | | | | | The qemu x86_64 target returns a target.xml register definition file which includes other xml files and they include others, etc. Also, the registers are not put in register groups like lldb wants to see. This patch (1) puts registers that aren't in a register group in a "general" register group, (2) change ProcessGDBRemote::GetGDBServerRegisterInfo to be a method that starts the parsing, asking a recurisve function to fetch and parse target.xml, (3) adds ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess which can recusively call itself to read and parse included xml files, (4) in addition to expecting the top-level <target> element (which only happens in the top level xml file), also an xml file that consists of a <feature> node - read the register defintions and includes from that <feature> element. <rdar://problem/49537922> Differential revision: https://reviews.llvm.org/D63802 llvm-svn: 364484
* Use the // integer divide operator in these Jason Molenda2019-06-262-2/+2
| | | | | | target definition files, like Davide's change to x86_64_target_definition.py. llvm-svn: 364481
* [x86-64] Use `//` for integer division in the target definition.Davide Italiano2019-06-261-1/+1
| | | | | | | | This forces integer division and works with python 2 and python 3. <rdar://problem/52073911> llvm-svn: 364465
* [Reproducers] Copy over access/modification time in the FileCollector.Jonas Devlieghere2019-06-261-0/+31
| | | | | | | | Copy over access and modification time for the files included in the reproducer. This is needed to pass tests that check the integrity of object files based on their time stamp. llvm-svn: 364457
* [dotest] Add the ability to set environment variables for the inferior.Jonas Devlieghere2019-06-264-0/+15
| | | | | | | | | | | This patch adds a dotest flag for setting environment variables for the inferior. This is different from the current --env flag, which sets variables in the debugger's environment. This allows us to set things like LD_LIBRARY_PATH for testing. Differential revision: https://reviews.llvm.org/D63790 llvm-svn: 364443
* Fix a typo in help text.Adrian McCarthy2019-06-251-1/+1
| | | | llvm-svn: 364361
* Revert "Add ReadCStringFromMemory for faster string reads"Antonio Afonso2019-06-255-136/+7
| | | | | | | | This reverts commit a7335393f50246b59db450dc6005f7c8f29e73a6. It seems this is breaking a bunch of tests (https://reviews.llvm.org/D62503#1549874) so reverting until I find the time to repro and fix. llvm-svn: 364355
* [dotest] Remove unused functionJonas Devlieghere2019-06-251-9/+1
| | | | | | The function `EnvArray` has no used. llvm-svn: 364351
* Add a defensive check for nullptr as in the block above.Adrian Prantl2019-06-251-1/+1
| | | | | | | | | Unfortunately I had to work backwards from a crash log, so I don't have a good testcase at this point in time. rdar://problem/51874647 llvm-svn: 364344
* [Python] Flush prompt before reading inputJonas Devlieghere2019-06-251-0/+1
| | | | | | | | Make sure the prompt has been flushed before reading commands. Buffering is different in Python 3, which led to the prompt not being displayed in the Xcode console. llvm-svn: 364335
* [CMake] Check that a certificate for lldb is present at build time.Davide Italiano2019-06-251-0/+15
| | | | | | | | | | | | Reviewers: JDevlieghere, sgraenitz, aprantl, friss Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D63745 llvm-svn: 364334
* Options: Correctly check for missing argumentsPavel Labath2019-06-251-3/+5
| | | | | | | | | | | | | | | | | Relying on the value of optind for detecting missing arguments is unreliable because its value after a failed parse is an implementation detail. A more correct way to achieve this is to pass ':' at the beginning of option string, which tells getopt to return ':' for missing arguments. For this to work, I also had to add a nullptr at the end of the argv vector, as some getopt implementations did not work without that. This is also an implementation detail, as getopt should normally be called with argc+argc "as to main function" (i.e. null-terminated). Thanks to Michał Górny for testing this patch out on NetBSD. llvm-svn: 364317
* Remove core loading timeoutPavel Labath2019-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If target.preload-symbols is false, waiting for the process to "stop" can take an arbitrarily long amount of time, because it will cause all the debug info to be parsed (to compute the stop message showing the function, its arguments, etc). We were previously waiting for 10 seconds for the stop even to arrive, which is a pretty long time, but it's not that hard to overcome with huge debug info. Since any arbitrary limit can be theoretically overcome with huge debug_info and/or slow machine, and the stop even was sent 3 lines above the wait, if we ever do not receive the stop even means we've got a bug in lldb. Therefore, I remove the timeout on this wait completely. No test because I don't know how to reproduce this without a multi-gigabyte symbol file. Reviewers: jingham, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D63730 llvm-svn: 364276
* DWARF: Add support for type units+split dwarf comboPavel Labath2019-06-259-24/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With the last round of refactors, supporting type units in dwo files becomes almost trivial. This patch contains a couple of small fixes, which taken as a whole make type units work in the split dwarf scenario (both DWARF4 and DWARF5): - DWARFContext: make sure we actually read the debug_types.dwo section - DWARFUnit: set string offsets base on all units in the dwo file, not just the main CU - ManualDWARFIndex: index all units in the file - SymbolFileDWARFDwo: Search for the single compile unit in the file, as we can no longer assume it will be the first one The last part makes it obvious that there is still some work to be done here, namely that we do not support dwo files with multiple compile units. That is something that should be easier after the DIERef refactors, but it still requires more work. Tests are added for the type units+split dwarf + dwarf4/5 scenarios, as well as a test that checks we behave reasonably in the presence of dwo files with multiple CUs. Reviewers: clayborg, JDevlieghere, aprantl Subscribers: arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63643 llvm-svn: 364274
* Reapply "Fix a crash in option parsing."Adrian Prantl2019-06-253-1/+16
| | | | | | | | with an additional read-out-of-bounds bugfix applied. Differential Revision: https://reviews.llvm.org/D63110 llvm-svn: 364260
* Don't link against the DebugSymbols private framework; try to dlopenJason Molenda2019-06-242-64/+18
| | | | | | | | | | | | | | | | | | | | | | | + dlsym the two functions we need from there at runtime. I'm not maintaining a negative cache if DebugSymbols is absent, so we'll try to dlopen() it on every call to LocateMacOSXFilesUsingDebugSymbols but this file is only built on mac and iOS type systems, so there's a slight perf impact running lldb on an iOS type system. I store the function pointer results in two global variables without any locking; two threads calling into LocateMacOSXFilesUsingDebugSymbols for the first time will both try to set these fptrs, but they'll be setting them to the same value, so I'm not too worried. I didn't see where in the cmake build configurations we link against DebugSymbols, but I removed the dependency from the xcode project file. <rdar://problem/49458356> llvm-svn: 364243
* Add windows abi plugin, breakpointprecondition.Jason Molenda2019-06-241-0/+20
| | | | llvm-svn: 364240
* [Target] Hoist LanguageRuntime::GetDeclVendorAlex Langford2019-06-243-38/+23
| | | | | | | | | | | | | | | | | Summary: It's possible that each LanguageRuntime could have its own DeclVendor, so let's hoist that out of ObjCLanguageRuntime into LanguageRuntime. Additionally, this gives the opportunity to remove SBTarget's dependency on ObjCLanguageRuntime. Reviewers: JDevlieghere, labath, compnerd, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D63622 llvm-svn: 364229
* [ABI] Remove unused variables in ABIWindows_x86_64Alex Langford2019-06-241-4/+0
| | | | llvm-svn: 364223
* [ABI] Implement Windows ABI for x86_64Alex Langford2019-06-249-11/+2118
| | | | | | | | | | | | | | | | | | Summary: Implement the ABI for WIndows-x86_64 including register info and calling convention. Handled nested struct returned in register (SysV doesn't have it supported) Reviewers: xiaobai, compnerd Reviewed By: compnerd Subscribers: labath, jasonmolenda, fedor.sergeev, mgorny, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62213 llvm-svn: 364216
* Move common functionality from processwindows into processdebuggerAaron Smith2019-06-245-452/+716
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change extracts functionalities from processwindows into a introduced processdebugger that can be reused in native process debugging. The main reason is that the native process debugging can't directly be based on processwindows or be implemented as a pass-through to this plugin since the plugin has ties to Target and Process classes that are needed in host debugging but not necessary in native debugging. Reviewers: labath, Hui, jfb, clayborg, amccarth Reviewed By: labath Subscribers: amccarth, dexonsmith, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D63166 llvm-svn: 364210
* [lit] Deduplicate logic in toolchain.pyJonas Devlieghere2019-06-211-6/+4
| | | | | | No need to compute the path of lit-lldb-init twice. llvm-svn: 364113
* [lit] Make lit-lldb-init configurable by CMakeJonas Devlieghere2019-06-213-2/+6
| | | | | | | | | | This makes the `lit-lldb-init` file configurable by CMake. This matters to us downstream in Swift, where we want to set environment variables with the `env` command for every test. Differential revision: https://reviews.llvm.org/D63679 llvm-svn: 364112
* [Target] Decouple ObjCLanguageRuntime from LanguageRuntimeAlex Langford2019-06-2116-65/+135
| | | | | | | | | | | | Summary: ObjCLanguageRuntime was being pulled into LanguageRuntime because of Breakpoint Preconditions. If we move BreakpointPrecondition out of Breakpoint, we can extend the LanguageRuntime plugin interface so that LanguageRuntimes can give us a BreakpointPrecondition for exceptions. Differential Revision: https://reviews.llvm.org/D63181 llvm-svn: 364098
* [lldb] [Process] Introduce common helpers to split/recombine YMM dataMichal Gorny2019-06-213-58/+32
| | | | | | | | | | | | | | | | | Introduce two common helpers to take care of splitting and recombining YMM registers to/from XSAVE-like data. Since FreeBSD, Linux and NetBSD all use XSAVE-like data structures but with potentially different field layouts, the function takes two pointers -- to XMM register and to YMM high bits, and copies the data from/to YMMReg type. While at it, remove support for big endian. To mine and Pavel Labath's combined knowledge, there is no such thing on x86. Furthermore, assuming that the YMM register data would be swapped for big endian seems to be a weird assumption. Differential Revision: https://reviews.llvm.org/D63610 llvm-svn: 364042
* [unittests] Simplify CMakeLists with object libraryTatyana Krasnukha2019-06-211-19/+2
| | | | | | | | The solution suggested by Chris Bieneman works for all versions of CMake. Differential Revision: https://reviews.llvm.org/D63544 llvm-svn: 364035
* DWARF: Add "dwo_num" field to the DIERef classPavel Labath2019-06-2124-138/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When dwo support was introduced, it used a trick where debug info entries were referenced by the offset of the compile unit in the main file, but the die offset was relative to the dwo file. Although there was some elegance to it, this representation was starting to reach its breaking point: - the fact that the skeleton compile unit owned the DWO file meant that it was impossible (or at least hard and unintuitive) to support DWO files containing more than one compile unit. These kinds of files are produced by LTO for example. - it made it impossible to reference any DIEs in the skeleton compile unit (although the skeleton units are generally empty, clang still puts some info into them with -fsplit-dwarf-inlining). - (current motivation) it made it very hard to support type units placed in DWO files, as type units don't have any skeleton units which could be referenced in the main file This patch addresses this problem by introducing an new "dwo_num" field to the DIERef class, whose purpose is to identify the dwo file. It's kind of similar to the dwo_id field in DWARF5 unit headers, but while this is a 64bit hash whose main purpose is to catch file mismatches, this is just a smaller integer used to indentify a loaded dwo file. Currently, this is based on the index of the skeleton compile unit which owns the dwo file, but it is intended to be eventually independent of that (to support the LTO use case). Simultaneously the cu_offset is dropped to conserve space, as it is no longer necessary. This means we can remove the "BaseObjectOffset" field from the DWARFUnit class. It also means we can remove some of the workarounds put in place to support the skeleton-unit+dwo-die combo. More work is needed to remove all of them, which is out of scope of this patch. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: mehdi_amini, dexonsmith, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63428 llvm-svn: 364009
* Revert "Fix a crash in option parsing."Davide Italiano2019-06-203-9/+0
| | | | | | This fails on the bots around 1/10 of the time. llvm-svn: 363999
* [unittests] Use object library if cmake supports itTatyana Krasnukha2019-06-201-2/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D63544 llvm-svn: 363933
* [lldb] [Process/NetBSD] Remove unnecessary register buffer abstractionMichal Gorny2019-06-204-117/+12
| | | | | | | | | | | | | | | | | Remove most of the abstraction over ptrace() register operations, as it has little value and introduces more code than it saves. Instead, leave a single ptrace() wrapper method and call it directly from ReadRegisterSet() and WriteRegisterSet() with correct PT_* request and buffer. Remove the remaining direct ReadGPR() and WriteGPR() invocations with ReadRegisterSet() and WriteRegisterSet(). Cleanup suggested by Pavel Labath in D63545. Differential Revision: https://reviews.llvm.org/D63594 llvm-svn: 363923
* Fix -Wmismatched-tags introduced in r363910Pavel Labath2019-06-203-4/+1
| | | | | | | | That commit changed DIERef from a struct to a class, but did not update the forward-declarations. This fixes one forward-declaration, and removes other (unused) decls. llvm-svn: 363915
* DWARF: Provide accessors to DIERef fieldsPavel Labath2019-06-209-24/+65
| | | | | | | | | | | | | | | | | | | | | | Summary: Instead of accessing the fields directly, use accessor functions to provide access to the DIERef components. This allows us to decouple the external interface, from the internal representation. The external interface can use llvm::Optional and similar goodies, while the data can still be stored internally in a more compact representation. I also document the purpose of the existing DIERef fields. The main motivation for this change is a need to introduce an additional field to the DIERef class, but I believe the change has its own merit. Reviewers: JDevlieghere, aprantl, clayborg Subscribers: arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63400 llvm-svn: 363910
* [Process] Remove unused field from HistoryThreadAlex Langford2019-06-1910-49/+17
| | | | | | | | | | | | | | Summary: These fields are unused and have been since their inception, from what I can tell. Reviewers: compnerd, JDevlieghere, davide, labath Subscribers: kubamracek, lldb-commits Differential Revision: https://reviews.llvm.org/D63357 llvm-svn: 363881
* [lldb] [Process/NetBSD] Fix constructor after r363707Michal Gorny2019-06-191-1/+1
| | | | llvm-svn: 363827
* [lldb] [Process/NetBSD] Remove unnecessary FPU presence checks for x86_64Michal Gorny2019-06-191-53/+1
| | | | | | | | | | Remove the checks for FPU presence, FXSAVE support and usage from the code for x86_64. Those are always true for this architecture, and in fact are hardcoded to true inside NetBSD kernel. Differential Revision: https://reviews.llvm.org/D63554 llvm-svn: 363823
* Specify log level for CMake messages (less stderr)Stefan Granitz2019-06-192-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Specify message levels in CMake. Prefer STATUS (stdout). As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools, noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step. This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR) instead of the default. * I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations. * Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know. Patch by: Christoph Siedentop Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz Reviewed By: sgraenitz Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits Tags: #sanitizers, #lldb, #llvm Differential Revision: https://reviews.llvm.org/D63370 llvm-svn: 363821
* Stabilize TestGdbRemoteLibrariesSvr4SupportPavel Labath2019-06-191-3/+6
| | | | | | | | | | | | | | on some systems this test fails because the two methods it uses to cross-reference the data don't match in the case of the vdso module. The "read from /proc/%pid/maps" method returns "[vdso]", while the method which reads it from the linker rendezvous structures returns "linux-vdso.so.1". Neither of the two names match any actual file. This restricts the test to only consider the libraries that we ourselves have added to the test, minimizing the impact of system dependencies that we cannot control. llvm-svn: 363772
* Fix a dangling StringRef in FileCollectorPavel Labath2019-06-191-1/+1
| | | | | | FileSpec::GetPath returns a temporary std::string. llvm-svn: 363770
* DWARF: Make DIERefs always validPavel Labath2019-06-1914-124/+101
| | | | | | | | | | | | | | | | | | | | | Summary: This patch makes the DIERef class always valid by default constructor and operator bool. This allows one to express the validity of a DIERef in the type system. Places which are working with potentially-invalid DIERefs have been updated to use Optional<DIERef> instead. The constructor taking a DWARFFormValue was not needed, as all places which were constructing a DIERef this way were immediately converting it into a DWARFDIE or a user_id. This can be done without constructing an intermediate DIERef. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63399 llvm-svn: 363767
OpenPOWER on IntegriCloud